zs 1 年之前
父节点
当前提交
12584f407c

+ 4 - 4
.env.development

@@ -1,7 +1,7 @@
-VITE_BASE_URL = "/usedCarAdmin"
-VITE_OUT_DIR = "usedCarAdmin"
-VITE_REQUEST_BASE = '/usedCar/api'
-VITE_APP_HOST="http://localhost:8001"
+VITE_BASE_URL = "/canteenAdmin"
+VITE_OUT_DIR = "canteenAdmin"
+VITE_REQUEST_BASE = '/st/api'
+VITE_APP_HOST="http://192.168.1.197"
 VITE_APP_PAGE_SIZE=15
 VITE_APP_ROUTER="admin"
 VITE_APP_ENV = 'development'

+ 4 - 4
.env.production

@@ -1,8 +1,8 @@
-VITE_BASE_URL = "/usedCarAdmin"
-VITE_OUT_DIR = "usedCarAdmin"
-VITE_REQUEST_BASE = '/usedCar/api'
+VITE_BASE_URL = "/canteenAdmin"
+VITE_OUT_DIR = "canteenAdmin"
+VITE_REQUEST_BASE = '/st/api'
 VITE_APP_HOST="https://broadcast.waityou24.cn"
 VITE_APP_PAGE_SIZE=15
 VITE_APP_ROUTER="admin"
 VITE_APP_ENV = 'production'
-VITE_API_BASE='/usedCar/api'
+VITE_API_BASE='/st/api'

二进制
public/favicon.ico


+ 2 - 0
src/components/admin-frame/parts/Sidebar.vue

@@ -94,6 +94,7 @@ watch(
 .sidebar::-webkit-scrollbar {
   width: 0;
 }
+
 .sidebar>ul {
   height: 100%;
 }
@@ -101,6 +102,7 @@ watch(
 .main {
   .first {
     padding: 0 2px 0 0;
+
     .el-menu {
       border-right: none;
     }

+ 139 - 29
src/layout/site.ts

@@ -1,7 +1,7 @@
 // 网站基本设置
 export const siteInfo = {
   display: false,
-  zhTitle: '二手车交易平台',
+  zhTitle: '食堂管理平台',
   logo_url: '/src/assets/logo.png'
 };
 // 菜单设置
@@ -13,47 +13,157 @@ export const menuInfo = {
     textColor: '#ffffff'
   },
   menuList: [
-    { icon: 'iconshouye', _id: 'admin_1', path: '/homeIndex', name: '系统首页' },
     // {
-    //   icon: 'iconshouye',
-    //   _id: 'admin_2',
-    //   name: '校友信息管理',
-    //   index: '2',
+    //   _id: '65a479b4969adc42d8feea73',
+    //   name: '首页',
+    //   order_num: 1,
+    //   path: '/homeIndex',
+    //   component: '/home/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
+    // },
+    // {
+    //   _id: '65a479b4969adc42d8feea71',
+    //   name: '系统设置',
+    //   order_num: 2,
     //   type: '0',
+    //   is_use: '0',
+    //   for_platform: '0',
     //   children: [
-    //     { icon: 'iconshouye', _id: 'admin_2_1', path: '/users/info', name: '登记信息管理' },
-    //     { icon: 'iconshouye', _id: 'admin_2_2', path: '/users/images', name: '照片上传管理' }
+    //     {
+    //       _id: '65a479b4969adc42d8feea75',
+    //       name: '菜单设置',
+    //       parent_id: '65a479b4969adc42d8feea71',
+    //       order_num: 1,
+    //       path: '/system/menus',
+    //       component: '/system/menus/index',
+    //       type: '1',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '系统设置'
+    //     },
+    //     {
+    //       _id: '65a479b4969adc42d8feea76',
+    //       name: '角色管理',
+    //       parent_id: '65a479b4969adc42d8feea71',
+    //       order_num: 2,
+    //       path: '/system/role',
+    //       component: '/system/role/index',
+    //       type: '1',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '系统设置'
+    //     },
+    //     {
+    //       _id: '65a479b4969adc42d8feea77',
+    //       name: '字典管理',
+    //       parent_id: '65a479b4969adc42d8feea71',
+    //       order_num: 3,
+    //       path: '/system/dict',
+    //       component: '/system/dict/index',
+    //       type: '1',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '系统设置'
+    //     },
+    //     {
+    //       _id: '65a479b4969adc42d8feea78',
+    //       name: '字典数据',
+    //       parent_id: '65a479b4969adc42d8feea71',
+    //       order_num: 4,
+    //       path: '/system/dictData',
+    //       component: '/system/dictData/index',
+    //       type: '2',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '系统设置'
+    //     }
     //   ]
     // },
     // {
-    //   icon: 'iconshouye',
-    //   _id: 'admin_3',
-    //   name: '基本设置',
-    //   index: '3',
+    //   _id: '65a479b4969adc42d8feea72',
+    //   name: '用户管理',
+    //   order_num: 3,
     //   type: '0',
+    //   is_use: '0',
+    //   for_platform: '0',
     //   children: [
-    //     { icon: 'iconshouye', _id: 'admin_3_1', path: '/basic/agreement', name: '协议修改' },
-    //     { icon: 'iconshouye', _id: 'admin_3_2', path: '/basic/notice', name: '通知修改' }
+    //     {
+    //       _id: '65a479b4969adc42d8feea7a',
+    //       name: '管理员用户',
+    //       parent_id: '65a479b4969adc42d8feea72',
+    //       order_num: 1,
+    //       path: '/user/admin',
+    //       component: '/user/admin/index',
+    //       type: '1',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '用户管理'
+    //     },
+    //     {
+    //       _id: '65a479b4969adc42d8feea7b',
+    //       name: '平台用户',
+    //       parent_id: '65a479b4969adc42d8feea72',
+    //       order_num: 2,
+    //       path: '/user/user',
+    //       component: '/user/user/index',
+    //       type: '1',
+    //       is_use: '0',
+    //       for_platform: '0',
+    //       parent_name: '用户管理'
+    //     }
     //   ]
     // },
     // {
-    //   icon: 'iconshouye',
-    //   _id: 'admin_4',
-    //   name: '账号管理',
-    //   index: '4',
-    //   type: '0',
-    //   children: [{ icon: 'iconshouye', _id: 'admin_4_1', path: '/acccount/updatepd', name: '修改密码' }]
+    //   _id: '65a479b4969adc42d8feea7e',
+    //   name: '菜品管理',
+    //   order_num: 5,
+    //   path: '/menu',
+    //   component: '/menu/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
     // },
     // {
-    //   icon: 'iconshouye',
-    //   _id: 'admin_5',
-    //   name: '系统设置',
-    //   index: '5',
-    //   type: '0',
-    //   children: [
-    //     { icon: 'iconshouye', _id: 'admin_5_2', path: '/system/config', name: '基础设置' },
-    //     { icon: 'iconshouye', _id: 'admin_5_1', path: '/system/dict', name: '字典管理' }
-    //   ]
+    //   _id: '65a479b4969adc42d8feea7e',
+    //   name: '安排管理',
+    //   order_num: 6,
+    //   path: '/arrange',
+    //   component: '/arrange/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
+    // },
+    // {
+    //   _id: '65a479b4969adc42d8feea7f',
+    //   name: '订单管理',
+    //   order_num: 7,
+    //   path: '/order',
+    //   component: '/order/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
+    // },
+    // {
+    //   _id: '65a479b4969adc42d8feea80',
+    //   name: '新闻管理',
+    //   order_num: 8,
+    //   path: '/news',
+    //   component: '/news/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
+    // },
+    // {
+    //   _id: '65a479b4969adc42d8feea7c',
+    //   name: '修改密码',
+    //   order_num: 999,
+    //   path: '/acccount/updatepd',
+    //   component: '/acccount/updatepd/index',
+    //   type: '1',
+    //   is_use: '0',
+    //   for_platform: '0'
     // }
   ]
 };

+ 27 - 22
src/router/index.ts

@@ -27,16 +27,6 @@ const system = [
     path: '/acccount/updatepd',
     meta: { title: '修改密码' },
     component: () => import('@/views/acccount/updatepd/index.vue')
-  },
-  {
-    path: '/system/brand',
-    meta: { title: '品牌管理' },
-    component: () => import('@/views/system/brand/index.vue')
-  },
-  {
-    path: '/system/config',
-    meta: { title: '平台设置' },
-    component: () => import('@/views/system/config/index.vue')
   }
 ];
 const user = [
@@ -53,19 +43,34 @@ const user = [
 ];
 const core = [
   {
-    path: '/shop',
-    meta: { title: '店铺管理' },
-    component: () => import('@/views/core/shop/index.vue')
+    path: '/config',
+    meta: { title: '平台设置' },
+    component: () => import('@/views/core/config/index.vue')
+  },
+  {
+    path: '/menu',
+    meta: { title: '菜品管理' },
+    component: () => import('@/views/core/menu/index.vue')
+  },
+  {
+    path: '/rate',
+    meta: { title: '菜品评价' },
+    component: () => import('@/views/core/menu/rate.vue')
+  },
+  {
+    path: '/arrange',
+    meta: { title: '安排管理' },
+    component: () => import('@/views/core/arrange/index.vue')
   },
   {
-    path: '/car',
-    meta: { title: '车源管理' },
-    component: () => import('@/views/core/car/index.vue')
+    path: '/order',
+    meta: { title: '订单管理' },
+    component: () => import('@/views/core/order/index.vue')
   },
   {
-    path: '/estimate',
-    meta: { title: '车辆估价' },
-    component: () => import('@/views/core/estimate/index.vue')
+    path: '/news',
+    meta: { title: '新闻管理' },
+    component: () => import('@/views/core/news/index.vue')
   }
 ];
 const router = createRouter({
@@ -78,12 +83,12 @@ const router = createRouter({
     {
       path: '/login',
       name: 'login',
-      meta: { title: '二手车交易平台-账号登录' },
+      meta: { title: '食堂管理平台-账号登录' },
       component: () => import('@/views/login/index.vue')
     },
     {
       path: '/homeIndex',
-      meta: { title: '二手车交易平台-系统首页' },
+      meta: { title: '食堂管理平台-系统首页' },
       component: () => import('@/components/admin-frame/home.vue'),
       children: [
         ...system,
@@ -91,7 +96,7 @@ const router = createRouter({
         ...core,
         {
           path: '/homeIndex',
-          meta: { title: '二手车交易平台-系统首页' },
+          meta: { title: '食堂管理平台-系统首页' },
           component: () => import('@/views/home/index.vue')
         }
       ]

+ 48 - 0
src/stores/core/arrange.ts

@@ -0,0 +1,48 @@
+import { defineStore } from 'pinia';
+import { AxiosWrapper } from '@/util/axios-wrapper';
+import _ from 'lodash';
+
+import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
+const axios = new AxiosWrapper();
+const api = {
+  url: `/arrange`
+};
+export const ArrangeStore = defineStore('arrange', () => {
+  const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
+    let cond: IQueryType = {};
+    if (skip) cond.skip = skip;
+    if (limit) cond.limit = limit;
+    cond = { ...cond, ...info };
+    const res = await axios.$get(`${api.url}`, cond);
+    return res;
+  };
+  const getByDate = async (info: IQueryParams = {}): Promise<IQueryResult> => {
+    const res = await axios.$get(`${api.url}/getByDate`, info);
+    return res;
+  };
+  const fetch = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$get(`${api.url}/${payload}`);
+    return res;
+  };
+  const create = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}`, payload);
+    return res;
+  };
+  const update = async (payload: any): Promise<IQueryResult> => {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  };
+  const del = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$delete(`${api.url}/${payload}`);
+    return res;
+  };
+  return {
+    query,
+    getByDate,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 2 - 2
src/stores/car.ts

@@ -5,9 +5,9 @@ import _ from 'lodash';
 import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
 const axios = new AxiosWrapper();
 const api = {
-  url: `/car`
+  url: `/menu`
 };
-export const CarStore = defineStore('car', () => {
+export const MenuStore = defineStore('menu', () => {
   const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
     let cond: IQueryType = {};
     if (skip) cond.skip = skip;

+ 2 - 2
src/stores/estimate.ts

@@ -5,9 +5,9 @@ import _ from 'lodash';
 import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
 const axios = new AxiosWrapper();
 const api = {
-  url: `/estimate`
+  url: `/news`
 };
-export const EstimateStore = defineStore('estimate', () => {
+export const NewsStore = defineStore('news', () => {
   const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
     let cond: IQueryType = {};
     if (skip) cond.skip = skip;

+ 2 - 2
src/stores/system/brand.ts

@@ -5,9 +5,9 @@ import _ from 'lodash';
 import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
 const axios = new AxiosWrapper();
 const api = {
-  url: `/brand`
+  url: `/order`
 };
-export const BrandStore = defineStore('brand', () => {
+export const OrderStore = defineStore('order', () => {
   const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
     let cond: IQueryType = {};
     if (skip) cond.skip = skip;

+ 43 - 0
src/stores/core/rate.ts

@@ -0,0 +1,43 @@
+import { defineStore } from 'pinia';
+import { AxiosWrapper } from '@/util/axios-wrapper';
+import _ from 'lodash';
+
+import type { IQueryType, IQueryResult, IQueryParams } from '@/util/types.util';
+const axios = new AxiosWrapper();
+const api = {
+  url: `/rate`
+};
+export const RateStore = defineStore('rate', () => {
+  const query = async ({ skip = 0, limit = undefined, ...info }: IQueryParams = {}): Promise<IQueryResult> => {
+    let cond: IQueryType = {};
+    if (skip) cond.skip = skip;
+    if (limit) cond.limit = limit;
+    cond = { ...cond, ...info };
+    const res = await axios.$get(`${api.url}`, cond);
+    return res;
+  };
+  const fetch = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$get(`${api.url}/${payload}`);
+    return res;
+  };
+  const create = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$post(`${api.url}`, payload);
+    return res;
+  };
+  const update = async (payload: any): Promise<IQueryResult> => {
+    const id = _.get(payload, 'id', _.get(payload, '_id'));
+    const res = await axios.$post(`${api.url}/${id}`, payload);
+    return res;
+  };
+  const del = async (payload: any): Promise<IQueryResult> => {
+    const res = await axios.$delete(`${api.url}/${payload}`);
+    return res;
+  };
+  return {
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

src/stores/shop.ts → src/stores/core/shop.ts


+ 185 - 0
src/views/core/arrange/index.vue

@@ -0,0 +1,185 @@
+<template>
+  <el-row>
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+      <el-row :gutter="10">
+        <el-col :span="8" class="one">
+          <el-calendar v-model="date">
+            <template #date-cell="{ data }">
+              <p :class="data.isSelected ? 'is-selected' : ''">
+                {{ data.day.split('-').slice(2).join('-') }}
+                {{ data.isSelected ? '✔️' : '' }}
+              </p>
+            </template>
+          </el-calendar>
+        </el-col>
+        <el-col :span="16" class="two">
+          <el-tabs v-model="active" type="border-card">
+            <el-tab-pane label="早餐" name="breakfast">
+              <el-col :span="24" class="button">
+                <cButton @toAdd="toAdd"> </cButton>
+              </el-col>
+              <cTable :fields="fields" :opera="opera" :list="form.arrange.breakfast" @del="toDel" :usePage="false"> </cTable>
+            </el-tab-pane>
+            <el-tab-pane label="午餐" name="lunch">
+              <el-col :span="24" class="button">
+                <cButton @toAdd="toAdd"> </cButton>
+              </el-col>
+              <cTable :fields="fields" :opera="opera" :list="form.arrange.lunch" @del="toDel" :usePage="false"> </cTable>
+            </el-tab-pane>
+            <el-tab-pane label="晚餐" name="dinner">
+              <el-col :span="24" class="button">
+                <cButton @toAdd="toAdd"> </cButton>
+              </el-col>
+              <cTable :fields="fields" :opera="opera" :list="form.arrange.dinner" @del="toDel" :usePage="false"> </cTable>
+            </el-tab-pane>
+          </el-tabs>
+        </el-col>
+      </el-row>
+    </el-col>
+  </el-row>
+  <cDialog :dialog="dialog" @toClose="toClose">
+    <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+      <cTable
+        :fields="[
+          { label: '菜品', model: 'name' },
+          { label: '卡路里(大卡)', model: 'reserve' }
+        ]"
+        :opera="foodOpera"
+        :list="foodList"
+        @select="toSelect"
+        :usePage="false"
+      >
+      </cTable>
+    </el-col>
+  </cDialog>
+</template>
+
+<script setup lang="ts">
+import { ref, Ref, onMounted, inject, watch } from 'vue';
+import moment from 'moment';
+// NeedChange
+import { ArrangeStore } from '@/stores/core/arrange';
+import { MenuStore } from '@/stores/core/menu';
+import type { IQueryResult } from '@/util/types.util';
+import baseStore from '@/stores/counter';
+import { cloneDeep, get } from 'lodash';
+const user = ref(baseStore.state.user);
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const date: Ref<any> = ref(new Date());
+const active: Ref<any> = ref('breakfast');
+const loading: Ref<any> = ref(false);
+// NeedChange
+const store = ArrangeStore();
+const menuStore = MenuStore();
+const $checkRes = inject('$checkRes') as Function;
+
+// #region 字典
+// NeedChange
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 菜品
+  res = await menuStore.query({ is_use: '0' });
+  if ($checkRes(res)) foodList.value = res.data;
+};
+// #endregion
+// #region 查询相关
+const search = async () => {
+  const info = { date: moment(date.value).format('YYYY-MM-DD') };
+  const res: IQueryResult = await store.getByDate(info);
+  if (res.errcode == '0' && get(res.data, 'date')) form.value = res.data;
+  else form.value = { arrange: { breakfast: [], lunch: [], dinner: [] } };
+  active.value = 'breakfast';
+};
+// #endregion
+
+// #region 表格及操作
+// NeedChange
+let fields: Ref<any[]> = ref([
+  { label: '菜品名称', model: 'name' },
+  { label: '卡路里(大卡)', model: 'reserve' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([{ label: '删除', method: 'del', confirm: true, type: 'danger' }]);
+const toAdd = () => {
+  dialog.value.show = true;
+};
+// #endregion
+
+// #region 常规接口
+const toSelect = async (data) => {
+  form.value.arrange[active.value].push(data);
+  const arr = cloneDeep(form.value);
+  arr.date = moment(date.value).format('YYYY-MM-DD');
+  let res: IQueryResult;
+  if (get(arr, '_id')) res = await store.update(arr);
+  else res = await store.create(arr);
+  if ($checkRes(res, true)) {
+    search();
+    toClose();
+  }
+};
+const toDel = async (data) => {
+  form.value.arrange[active.value] = form.value.arrange[active.value].filter((item) => {
+    if (item._id != data._id) return item;
+  });
+  const arr = cloneDeep(form.value);
+  let res: IQueryResult = await store.update(arr);
+  if ($checkRes(res, true)) {
+    search();
+  }
+};
+
+// #endregion
+
+// #region 表单及操作
+// NeedChange
+const foodList: Ref<any> = ref([]);
+const foodOpera: Ref<any[]> = ref([{ label: '选择', method: 'select', display: (i) => isSelect(i) }]);
+const form: Ref<any> = ref({ arrange: { breakfast: [], lunch: [], dinner: [] } });
+const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
+// 关闭弹框
+const toClose = () => {
+  dialog.value.show = false;
+};
+const isSelect = (i) => {
+  if (i) {
+    const res = form.value.arrange[active.value].find((f) => f._id === i._id);
+    if (res) return false;
+    return true;
+  }
+};
+watch(
+  date,
+  (newVal) => {
+    if (newVal) {
+      search();
+    }
+  },
+  {
+    deep: true
+  }
+);
+// #endregion
+</script>
+
+<style scoped lang="scss">
+.main {
+  .one {
+    .is-selected {
+      color: #1989fa;
+    }
+  }
+
+  .two {
+    margin: 8px 0 0 0;
+    .button {
+      margin: 0 0 5px 0;
+    }
+  }
+}
+</style>

+ 0 - 367
src/views/core/car/index.vue

@@ -1,367 +0,0 @@
-<template>
-  <el-row>
-    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-      <el-col :span="24" class="one">
-        <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
-          <template #status>
-            <el-option v-for="i in statusList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-          </template>
-        </cSearch>
-      </el-col>
-      <el-col :span="24" class="two">
-        <cButton @toAdd="toAdd"> </cButton>
-      </el-col>
-      <el-col :span="24" class="thr">
-        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel" @changeUse="toChangeUse"> </cTable>
-      </el-col>
-    </el-col>
-  </el-row>
-  <cDialog :dialog="dialog" @toClose="toClose">
-    <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
-      <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-        <template #shop>
-          <el-option v-for="i in shopList" :key="i._id" :label="i.name" :value="i._id"></el-option>
-        </template>
-        <template #brand>
-          <el-select
-            v-model="form.brand"
-            clearable
-            filterable
-            remote
-            reserve-keyword
-            placeholder="请选择品牌"
-            remote-show-suffix
-            :remote-method="remoteMethod"
-            :loading="loading"
-            style="width: 100%"
-          >
-            <el-option v-for="item in brandList" :key="item._id" :label="item.name" :value="item.name" />
-          </el-select>
-        </template>
-        <template #use_type>
-          <el-option v-for="i in useTypeList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #type>
-          <el-option v-for="i in boxTypeList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #structure>
-          <el-option v-for="i in structureList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #emission>
-          <el-option v-for="i in emissionList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #energy>
-          <el-option v-for="i in energyList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #set>
-          <el-option v-for="i in setList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #level>
-          <el-option v-for="i in levelList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #drive>
-          <el-option v-for="i in driveList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-        <template #status>
-          <el-radio v-for="i in statusList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
-        </template>
-        <template #file>
-          <cUpload model="file" :list="form.file" :limit="21" url="/files/usedCar/car/upload" listType="picture-card" @change="onUpload"></cUpload>
-        </template>
-      </cForm>
-    </el-col>
-  </cDialog>
-</template>
-
-<script setup lang="ts">
-import { ref, Ref, onMounted, inject } from 'vue';
-// NeedChange
-import { CarStore } from '@/stores/car';
-import { ShopStore } from '@/stores/shop';
-import { BrandStore } from '@/stores/system/brand';
-import { DictDataStore } from '@/stores/system/dictData';
-import type { IQueryResult } from '@/util/types.util';
-import { cloneDeep, get } from 'lodash';
-import baseStore from '@/stores/counter';
-const user = ref(baseStore.state.user);
-onMounted(async () => {
-  loading.value = true;
-  await searchOther();
-  await search({ skip, limit });
-  loading.value = false;
-});
-
-const loading: Ref<any> = ref(false);
-// NeedChange
-const store = CarStore();
-const dictDataStore = DictDataStore();
-const shopStore = ShopStore();
-const brandStore = BrandStore();
-const $checkRes = inject('$checkRes') as Function;
-
-// #region 字典
-// NeedChange
-const statusList: Ref<any> = ref([]);
-const shopList: Ref<any> = ref([]);
-const brandList: Ref<any> = ref([]);
-const useTypeList: Ref<any> = ref([]);
-const boxTypeList: Ref<any> = ref([]);
-const structureList: Ref<any> = ref([]);
-const emissionList: Ref<any> = ref([]);
-const energyList: Ref<any> = ref([]);
-const setList: Ref<any> = ref([]);
-const levelList: Ref<any> = ref([]);
-const driveList: Ref<any> = ref([]);
-
-const searchOther = async () => {
-  let res: IQueryResult;
-  // 是否使用
-  res = await dictDataStore.query({ code: 'carType', is_use: '0' });
-  if ($checkRes(res)) statusList.value = res.data;
-  // 店铺信息
-  res = await shopStore.query({ is_use: '0' });
-  if ($checkRes(res)) shopList.value = res.data;
-  // 品牌
-  res = await brandStore.query({ is_use: '0' });
-  if ($checkRes(res)) brandList.value = res.data;
-  // 车辆使用性质
-  res = await dictDataStore.query({ code: 'useType', is_use: '0' });
-  if ($checkRes(res)) useTypeList.value = res.data;
-  // 变速箱
-  res = await dictDataStore.query({ code: 'boxType', is_use: '0' });
-  if ($checkRes(res)) boxTypeList.value = res.data;
-  // 车身结构
-  res = await dictDataStore.query({ code: 'structure', is_use: '0' });
-  if ($checkRes(res)) structureList.value = res.data;
-  // 排放标准
-  res = await dictDataStore.query({ code: 'emission', is_use: '0' });
-  if ($checkRes(res)) emissionList.value = res.data;
-  // 能源类型
-  res = await dictDataStore.query({ code: 'energy', is_use: '0' });
-  if ($checkRes(res)) energyList.value = res.data;
-  // 座椅
-  res = await dictDataStore.query({ code: 'set', is_use: '0' });
-  if ($checkRes(res)) setList.value = res.data;
-  // 车辆级别
-  res = await dictDataStore.query({ code: 'level', is_use: '0' });
-  if ($checkRes(res)) levelList.value = res.data;
-  // 驱动方式
-  res = await dictDataStore.query({ code: 'drive', is_use: '0' });
-  if ($checkRes(res)) driveList.value = res.data;
-};
-// #endregion
-
-// #region 查询相关
-let list: Ref<any> = ref([]);
-let total: Ref<number> = ref(0);
-let skip = 0;
-let limit = inject('$limit') as number;
-let searchForm: Ref<any> = ref({});
-
-const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value };
-  const res: IQueryResult = await store.query(info);
-  if (res.errcode == '0') {
-    list.value = res.data;
-    total.value = res.total;
-  }
-};
-const toSearch = (query) => {
-  searchForm.value = query;
-  search({ skip, limit });
-};
-const toChangeUse = async (data) => {
-  let status = '0';
-  switch (data.status) {
-    case '0':
-      status = '1';
-      break;
-    case '1':
-      status = '0';
-      break;
-    default:
-      break;
-  }
-  const udata = { _id: data._id, status: status };
-  const res = await store.update(udata);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-  }
-};
-// #endregion
-
-// #region 表格及操作
-// NeedChange
-let fields: Ref<any[]> = ref([
-  { label: '品牌', model: 'brand', isSearch: true },
-  { label: '车型', model: 'series', isSearch: true },
-  { label: '年份', model: 'year', isSearch: true },
-  { label: '车款', model: 'style', isSearch: true },
-  { label: '新车价格', model: 'price' },
-  { label: '实付价格', model: 'real_pay' },
-  { label: '车龄', model: 'age', isSearch: true },
-  { label: '过户次数', model: 'number' },
-  { label: '状态', model: 'status', format: (i) => getDict(i, 'status'), isSearch: true, type: 'select' }
-]);
-// 操作
-let opera: Ref<any[]> = ref([
-  { label: '修改', method: 'edit' },
-  { label: '下架', method: 'changeUse', type: 'warning', confirm: true, display: (i) => i.status === '0' },
-  { label: '上架', method: 'changeUse', type: 'success', confirm: true, display: (i) => i.status === '1' },
-  { label: '删除', method: 'del', confirm: true, type: 'danger' }
-]);
-// 转化字典表
-const getDict = (data, model) => {
-  let list;
-  switch (model) {
-    case 'status':
-      list = statusList.value;
-      break;
-    default:
-      break;
-  }
-  if (!list) return;
-  const res = list.find((f) => f.value == data);
-  return get(res, 'label');
-};
-// 远程搜索品牌
-const remoteMethod = (query: string) => {
-  if (query) {
-    loading.value = true;
-    setTimeout(() => {
-      loading.value = false;
-      brandList.value = brandList.value.filter((item) => {
-        return item.name.toLowerCase().includes(query.toLowerCase());
-      });
-    }, 200);
-  }
-};
-// 新增弹框
-const toAdd = () => {
-  formFields.value = formFieldsForCreate;
-  // 所属人是自己,需要把自己的id放进去
-  form.value = { ...cloneDeep(defaultForm) };
-  dialog.value.show = true;
-};
-// 修改弹框
-const toEdit = async (data) => {
-  formFields.value = formFieldsForUpdate;
-  form.value = { ...data };
-  dialog.value.show = true;
-};
-// #endregion
-
-// #region 常规接口
-// 添加/修改
-const toSave = async () => {
-  const data = cloneDeep(form.value);
-  let res: IQueryResult;
-  if (get(data, '_id')) res = await store.update(data);
-  else res = await store.create(data);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-    toClose();
-  }
-};
-// 删除
-const toDel = async (data) => {
-  const res = await store.del(data._id);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-  }
-};
-
-// #endregion
-
-// #region 表单及操作
-// NeedChange
-const defaultForm = { status: '0', file: [] };
-const formFields: Ref<any> = ref();
-const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
-const form: Ref<any> = ref({ file: [] });
-const formFieldsForCreate = [
-  { label: '店铺', model: 'shop', type: 'select' },
-  { label: '品牌', model: 'brand', custom: true },
-  { label: '年份', model: 'year', type: 'year' },
-  { label: '车型', model: 'series' },
-  { label: '车款', model: 'style' },
-  { label: '过户次数', model: 'number' },
-  { label: '车辆识别VIN', model: 'vin' },
-  { label: '首次上牌时间', model: 'f_time', type: 'date' },
-  { label: '车源地', model: 'place' },
-  { label: '车牌地', model: 'license' },
-  { label: '外观颜色', model: 'out_color' },
-  { label: '内饰颜色', model: 'in_color' },
-  { label: '车辆使用性质', model: 'use_type', type: 'select' },
-  { label: '新车价格', model: 'price' },
-  { label: '车龄', model: 'age' },
-  { label: '里程', model: 'mileage' },
-  { label: '变速箱', model: 'type', type: 'select' },
-  { label: '车身结构', model: 'structure', type: 'select' },
-  { label: '排放标准', model: 'emission', type: 'select' },
-  { label: '能源类型', model: 'energy', type: 'select' },
-  { label: '排量', model: 'displacement' },
-  { label: '座椅', model: 'set', type: 'select' },
-  { label: '车辆级别', model: 'level', type: 'select' },
-  { label: '驱动方式', model: 'drive', type: 'select' },
-  { label: '油耗', model: 'oil' },
-  { label: '年均保险费', model: 'premium' },
-  { label: '年均保养费', model: 'maintenance' },
-  { label: '百公里加速', model: 'hundred_time' },
-  { label: '轴距', model: 'wheelbase' },
-  { label: '总价', model: 'total_money' },
-  { label: '付款方式', model: 'pay_type' },
-  { label: '首付', model: 'first_pay' },
-  { label: '实付价格', model: 'real_pay' },
-  { label: '图片', model: 'file', custom: true }
-];
-const formFieldsForUpdate = [
-  { label: '店铺', model: 'shop', type: 'select' },
-  { label: '品牌', model: 'brand', custom: true },
-  { label: '年份', model: 'year', type: 'year' },
-  { label: '车型', model: 'series' },
-  { label: '车款', model: 'style' },
-  { label: '过户次数', model: 'number' },
-  { label: '车辆识别VIN', model: 'vin' },
-  { label: '首次上牌时间', model: 'f_time', type: 'date' },
-  { label: '车源地', model: 'place' },
-  { label: '车牌地', model: 'license' },
-  { label: '外观颜色', model: 'out_color' },
-  { label: '内饰颜色', model: 'in_color' },
-  { label: '车辆使用性质', model: 'use_type', type: 'select' },
-  { label: '价格', model: 'price' },
-  { label: '车龄', model: 'age' },
-  { label: '里程', model: 'mileage' },
-  { label: '变速箱', model: 'type', type: 'select' },
-  { label: '车身结构', model: 'structure', type: 'select' },
-  { label: '排放标准', model: 'emission', type: 'select' },
-  { label: '能源类型', model: 'energy', type: 'select' },
-  { label: '排量', model: 'displacement' },
-  { label: '座椅', model: 'set', type: 'select' },
-  { label: '车辆级别', model: 'level', type: 'select' },
-  { label: '驱动方式', model: 'drive', type: 'select' },
-  { label: '油耗', model: 'oil' },
-  { label: '年均保险费', model: 'premium' },
-  { label: '年均保养费', model: 'maintenance' },
-  { label: '百公里加速', model: 'hundred_time' },
-  { label: '轴距', model: 'wheelbase' },
-  { label: '总价', model: 'total_money' },
-  { label: '付款方式', model: 'pay_type' },
-  { label: '首付', model: 'first_pay' },
-  { label: '实付价格', model: 'real_pay' },
-  { label: '图片', model: 'file', custom: true }
-];
-// 关闭弹框
-const toClose = () => {
-  form.value = {};
-  dialog.value.show = false;
-};
-const onUpload = (e: { model: string; value: Array<[]> }) => {
-  console.log(e);
-  const { model, value } = e;
-  form.value[model] = value;
-};
-// #endregion
-</script>
-
-<style scoped></style>

+ 35 - 23
src/views/system/config/index.vue

@@ -3,11 +3,38 @@
     <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-          <template #mode>
-            <el-radio v-for="i in statusList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+          <template #b_time>
+            <el-time-picker
+              v-model="form.b_time"
+              is-range
+              range-separator="-"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              format="HH:mm"
+              value-format="HH:mm"
+            />
           </template>
-          <template #logo>
-            <cUpload model="logo" :list="form.logo" :limit="1" url="/files/usedCar/config/upload" listType="picture-card" @change="onUpload"></cUpload>
+          <template #l_time>
+            <el-time-picker
+              v-model="form.l_time"
+              is-range
+              range-separator="-"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              format="HH:mm"
+              value-format="HH:mm"
+            />
+          </template>
+          <template #d_time>
+            <el-time-picker
+              v-model="form.d_time"
+              is-range
+              range-separator="-"
+              start-placeholder="开始时间"
+              end-placeholder="结束时间"
+              format="HH:mm"
+              value-format="HH:mm"
+            />
           </template>
         </cForm>
       </el-col>
@@ -34,13 +61,6 @@ const loading: Ref<any> = ref(false);
 const store = ConfigStore();
 const $checkRes = inject('$checkRes') as Function;
 
-// #region 字典
-// NeedChange
-const statusList: Ref<any> = ref([
-  { label: '平台销售', value: '0' },
-  { label: '多店铺销售', value: '1' }
-]);
-
 // #endregion
 const search = async () => {
   let res: IQueryResult = await store.query();
@@ -66,19 +86,11 @@ const toSave = async () => {
 // #region 表单及操作
 // NeedChange
 const formFields: Ref<any> = ref([
-  { label: '销售模式', model: 'mode', type: 'radio' },
-  { label: '联系人', model: 'contacts' },
-  { label: '联系电话', model: 'tel' },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '底部文案', model: 'bottom_title' }
+  { label: '早餐时间', model: 'b_time', custom: true },
+  { label: '午餐时间', model: 'l_time', custom: true },
+  { label: '晚餐时间', model: 'd_time', custom: true }
 ]);
-const form: Ref<any> = ref({ logo: [] });
-// #endregion
-const onUpload = (e: { model: string; value: Array<[]> }) => {
-  console.log(e);
-  const { model, value } = e;
-  form.value[model] = value;
-};
+const form: Ref<any> = ref({ b_time: [], l_time: [], d_time: [] });
 </script>
 
 <style scoped></style>

+ 71 - 34
src/views/core/shop/index.vue

@@ -12,21 +12,35 @@
         <cButton @toAdd="toAdd"> </cButton>
       </el-col>
       <el-col :span="24" class="thr">
-        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel" @changeUse="toChangeUse"> </cTable>
+        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @rate="toRate" @edit="toEdit" @del="toDel" @changeUse="toChangeUse"> </cTable>
       </el-col>
     </el-col>
   </el-row>
   <cDialog :dialog="dialog" @toClose="toClose">
     <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
       <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-        <template #is_use>
-          <el-radio v-for="i in statusList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+        <template #params>
+          <el-button class="button" type="primary" size="mini" @click="paramsAdd()">添加</el-button>
+          <el-table :data="form.params" border size="mini">
+            <el-table-column label="参数名" prop="label" align="center">
+              <template #default="scope">
+                <el-input v-model="scope.row.label" placeholder="请输入参数名"></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column label="参数值" prop="value" align="center">
+              <template #default="scope">
+                <el-input v-model="scope.row.value" placeholder="请输入参数值"></el-input>
+              </template>
+            </el-table-column>
+            <el-table-column label="操作" align="center">
+              <template #default="scope">
+                <el-button type="danger" size="mini" @click="paramsDel(scope.$index)">删除</el-button>
+              </template>
+            </el-table-column>
+          </el-table>
         </template>
-        <template #logo>
-          <cUpload model="logo" :list="form.logo" :limit="1" url="/files/usedCar/shop/upload" listType="picture-card" @change="onUpload"></cUpload>
-        </template>
-        <template #file>
-          <cUpload model="file" :list="form.file" :limit="1" url="/files/usedCar/shop/upload" listType="picture-card" @change="onUpload"></cUpload>
+        <template #img>
+          <cUpload model="img" :list="form.img" :limit="1" url="/files/canteen/menu/upload" listType="picture-card" @change="onUpload"></cUpload>
         </template>
       </cForm>
     </el-col>
@@ -35,8 +49,9 @@
 
 <script setup lang="ts">
 import { ref, Ref, onMounted, inject } from 'vue';
+import { useRouter } from 'vue-router';
 // NeedChange
-import { ShopStore } from '@/stores/shop';
+import { MenuStore } from '@/stores/core/menu';
 import { DictDataStore } from '@/stores/system/dictData';
 import type { IQueryResult } from '@/util/types.util';
 import { cloneDeep, get } from 'lodash';
@@ -48,10 +63,11 @@ onMounted(async () => {
   await search({ skip, limit });
   loading.value = false;
 });
-
+// 路由
+const router = useRouter();
 const loading: Ref<any> = ref(false);
 // NeedChange
-const store = ShopStore();
+const store = MenuStore();
 const dictDataStore = DictDataStore();
 const $checkRes = inject('$checkRes') as Function;
 
@@ -60,10 +76,10 @@ const $checkRes = inject('$checkRes') as Function;
 const statusList: Ref<any> = ref([]);
 
 const searchOther = async () => {
-  const statusResult: IQueryResult = await dictDataStore.query({ code: 'isUse', is_use: '0' });
-  if ($checkRes(statusResult)) {
-    statusList.value = statusResult.data;
-  }
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictDataStore.query({ code: 'isUse', is_use: '0' });
+  if ($checkRes(res)) statusList.value = res.data;
 };
 // #endregion
 
@@ -109,15 +125,14 @@ const toChangeUse = async (data) => {
 // #region 表格及操作
 // NeedChange
 let fields: Ref<any[]> = ref([
-  { label: '店铺名称', model: 'name', isSearch: true },
-  { label: '店铺地址', model: 'address' },
-  { label: '联系电话', model: 'tel' },
-  { label: '联系人', model: 'contacts' },
+  { label: '菜品名称', model: 'name', isSearch: true },
+  { label: '卡路里(大卡)', model: 'reserve' },
   { label: '状态', model: 'is_use', format: (i) => getDict(i, 'is_use'), isSearch: true, type: 'select' }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
   { label: '修改', method: 'edit' },
+  { label: '评价', method: 'rate' },
   { label: '禁用', method: 'changeUse', type: 'warning', confirm: true, display: (i) => i.is_use === '0' },
   { label: '使用', method: 'changeUse', type: 'success', confirm: true, display: (i) => i.is_use === '1' },
   { label: '删除', method: 'del', confirm: true, type: 'danger' }
@@ -147,6 +162,10 @@ const toEdit = async (data) => {
   form.value = { ...data };
   dialog.value.show = true;
 };
+// 菜品评价
+const toRate = async (data) => {
+  router.push({ path: '/rate', query: { id: data._id } });
+};
 // #endregion
 
 // #region 常规接口
@@ -171,26 +190,38 @@ const toDel = async (data) => {
 
 // #region 表单及操作
 // NeedChange
-const defaultForm = { is_use: '0', logo: [] };
+const defaultForm = { is_use: '0', img: [] };
 const formFields: Ref<any> = ref();
 const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
-const form: Ref<any> = ref({ file: [] });
+const form: Ref<any> = ref({ img: [], params: [] });
 const formFieldsForCreate = [
-  { label: '店铺名称', model: 'name' },
-  { label: '店铺地址', model: 'address' },
-  { label: '联系电话', model: 'tel' },
-  { label: '联系人', model: 'contacts' },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '营业执照', model: 'file', custom: true }
+  { label: '菜品名称', model: 'name' },
+  { label: '卡路里(大卡)', model: 'reserve', type: 'number' },
+  { label: '参数列表', model: 'params', custom: true },
+  { label: '图片', model: 'img', custom: true },
+  { label: '菜品介绍', model: 'content', type: 'textarea' },
+  { label: '备注', model: 'remark', type: 'textarea' }
 ];
 const formFieldsForUpdate = [
-  { label: '店铺名称', model: 'name' },
-  { label: '店铺地址', model: 'address' },
-  { label: '联系电话', model: 'tel' },
-  { label: '联系人', model: 'contacts' },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '营业执照', model: 'file', custom: true }
+  { label: '菜品名称', model: 'name' },
+  { label: '卡路里(大卡)', model: 'reserve', type: 'number' },
+  { label: '参数列表', model: 'params', custom: true },
+  { label: '图片', model: 'img', custom: true },
+  { label: '菜品介绍', model: 'content', type: 'textarea' },
+  { label: '备注', model: 'remark', type: 'textarea' }
 ];
+// 添加参数
+const paramsAdd = () => {
+  let list = form.value.params || [];
+  list.push({});
+  form.value.params = list;
+};
+// 删除参数
+const paramsDel = (index: number) => {
+  let list = form.value.params;
+  list.splice(index, 1);
+  form.value.params = list;
+};
 // 关闭弹框
 const toClose = () => {
   form.value = {};
@@ -204,4 +235,10 @@ const onUpload = (e: { model: string; value: Array<[]> }) => {
 // #endregion
 </script>
 
-<style scoped></style>
+<style scoped lang="scss">
+.dialog_one {
+  .button {
+    margin: 0 0 5px 0;
+  }
+}
+</style>

+ 155 - 0
src/views/core/menu/rate.vue

@@ -0,0 +1,155 @@
+<template>
+  <el-row>
+    <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+      <el-col :span="24" class="one">
+        <cSearch :is_title="false" :is_back="true" @toBack="toBack"></cSearch>
+      </el-col>
+      <el-col :span="24" class="thr">
+        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView" @changeUse="toChangeUse"> </cTable>
+      </el-col>
+    </el-col>
+  </el-row>
+  <cDialog :dialog="dialog" @toClose="toClose">
+    <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+      <cForm :span="24" :fields="formFields" :form="form" :rules="{}" :isSave="false" label-width="auto">
+        <template #content>
+          <cEditor v-model="form.content" url="/files/canteen/news/upload"></cEditor>
+        </template>
+      </cForm>
+    </el-col>
+  </cDialog>
+</template>
+
+<script setup lang="ts">
+import { ref, Ref, onMounted, inject } from 'vue';
+import { useRoute } from 'vue-router';
+// NeedChange
+import { RateStore } from '@/stores/core/rate';
+import { DictDataStore } from '@/stores/system/dictData';
+import type { IQueryResult } from '@/util/types.util';
+import { get } from 'lodash';
+import baseStore from '@/stores/counter';
+const user = ref(baseStore.state.user);
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search({ skip, limit });
+  loading.value = false;
+});
+// 路由
+const route = useRoute();
+const loading: Ref<any> = ref(false);
+// NeedChange
+const store = RateStore();
+const dictDataStore = DictDataStore();
+const $checkRes = inject('$checkRes') as Function;
+
+// #region 字典
+// NeedChange
+const statusList: Ref<any> = ref([]);
+
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictDataStore.query({ code: 'isUse', is_use: '0' });
+  if ($checkRes(res)) statusList.value = res.data;
+};
+// #endregion
+
+// #region 查询相关
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit = inject('$limit') as number;
+let searchForm: Ref<any> = ref({});
+
+const search = async (e: { skip: number; limit: number }) => {
+  let id = route.query.id;
+  if (id) {
+    const info = { skip: e.skip, limit: e.limit, ...searchForm.value, menu_id: id };
+    const res: IQueryResult = await store.query(info);
+    if (res.errcode == '0') {
+      list.value = res.data;
+      total.value = res.total;
+    }
+  }
+};
+const toChangeUse = async (data) => {
+  let status = '0';
+  switch (data.is_use) {
+    case '0':
+      status = '1';
+      break;
+    case '1':
+      status = '0';
+      break;
+    default:
+      break;
+  }
+  const udata = { _id: data._id, is_use: status };
+  const res = await store.update(udata);
+  if ($checkRes(res, true)) {
+    search({ skip: 0, limit });
+  }
+};
+// #endregion
+
+// #region 表格及操作
+// NeedChange
+let fields: Ref<any[]> = ref([
+  { label: '菜品名称', model: 'menu_id' },
+  { label: '用户名称', model: 'openid' },
+  { label: '评分', model: 'score' },
+  { label: '状态', model: 'is_use', format: (i) => getDict(i, 'is_use'), isSearch: true, type: 'select' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '查看', method: 'view' },
+  { label: '禁用', method: 'changeUse', type: 'warning', confirm: true, display: (i) => i.is_use === '0' },
+  { label: '使用', method: 'changeUse', type: 'success', confirm: true, display: (i) => i.is_use === '1' }
+]);
+
+const getDict = (data, model) => {
+  let list;
+  switch (model) {
+    case 'is_use':
+      list = statusList.value;
+      break;
+    default:
+      break;
+  }
+  if (!list) return;
+  const res = list.find((f) => f.value == data);
+  return get(res, 'label');
+};
+const toView = async (data) => {
+  formFields.value = formFields;
+  form.value = { ...data };
+  dialog.value.show = true;
+};
+// #endregion
+
+// #region 表单及操作
+// NeedChange
+const formFields: Ref<any> = ref([{ label: '内容', model: 'content', custom: true }]);
+const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
+const form: Ref<any> = ref({ img: [] });
+// 关闭弹框
+const toClose = () => {
+  form.value = {};
+  dialog.value.show = false;
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+// #endregion
+</script>
+<style scoped lang="scss">
+.main {
+  .one {
+    display: flex;
+    justify-content: flex-end;
+  }
+}
+</style>

+ 29 - 33
src/views/system/brand/index.vue

@@ -12,22 +12,18 @@
         <cButton @toAdd="toAdd"> </cButton>
       </el-col>
       <el-col :span="24" class="thr">
-        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel" @changeUse="toChangeUse">
-          <template #logo="{ row }">
-            <el-image :src="getLogo(row.logo)" style="width: 64px; height: 64px"></el-image>
-          </template>
-        </cTable>
+        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel" @changeUse="toChangeUse"> </cTable>
       </el-col>
     </el-col>
   </el-row>
   <cDialog :dialog="dialog" @toClose="toClose">
     <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
       <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-        <template #is_use>
-          <el-radio v-for="i in statusList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+        <template #img>
+          <cUpload model="img" :list="form.img" :limit="1" url="/files/canteen/news/upload" listType="picture-card" @change="onUpload"></cUpload>
         </template>
-        <template #logo>
-          <cUpload model="logo" :list="form.logo" :limit="1" url="/files/usedCar/brand/upload" listType="picture-card" @change="onUpload"></cUpload>
+        <template #content>
+          <cEditor v-model="form.content" url="/files/canteen/news/upload"></cEditor>
         </template>
       </cForm>
     </el-col>
@@ -36,9 +32,8 @@
 
 <script setup lang="ts">
 import { ref, Ref, onMounted, inject } from 'vue';
-import { head } from 'lodash';
 // NeedChange
-import { BrandStore as mainStroe } from '@/stores/system/brand';
+import { NewsStore } from '@/stores/core/news';
 import { DictDataStore } from '@/stores/system/dictData';
 import type { IQueryResult } from '@/util/types.util';
 import { cloneDeep, get } from 'lodash';
@@ -53,7 +48,7 @@ onMounted(async () => {
 
 const loading: Ref<any> = ref(false);
 // NeedChange
-const store = mainStroe();
+const store = NewsStore();
 const dictDataStore = DictDataStore();
 const $checkRes = inject('$checkRes') as Function;
 
@@ -62,10 +57,10 @@ const $checkRes = inject('$checkRes') as Function;
 const statusList: Ref<any> = ref([]);
 
 const searchOther = async () => {
-  const statusResult: IQueryResult = await dictDataStore.query({ code: 'isUse' });
-  if ($checkRes(statusResult)) {
-    statusList.value = statusResult.data;
-  }
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictDataStore.query({ code: 'isUse', is_use: '0' });
+  if ($checkRes(res)) statusList.value = res.data;
 };
 // #endregion
 
@@ -111,9 +106,9 @@ const toChangeUse = async (data) => {
 // #region 表格及操作
 // NeedChange
 let fields: Ref<any[]> = ref([
-  { label: '品牌名', model: 'name', isSearch: true },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '首字母', model: 'letter' },
+  { label: '标题', model: 'title', isSearch: true },
+  { label: '来源', model: 'origin', isSearch: true },
+  { label: '创建时间', model: 'create_time' },
   { label: '状态', model: 'is_use', format: (i) => getDict(i, 'is_use'), isSearch: true, type: 'select' }
 ]);
 // 操作
@@ -148,10 +143,6 @@ const toEdit = async (data) => {
   form.value = { ...data };
   dialog.value.show = true;
 };
-const getLogo = (list = []) => {
-  const pic = head(list);
-  if (pic) return pic.uri;
-};
 // #endregion
 
 // #region 常规接口
@@ -176,19 +167,25 @@ const toDel = async (data) => {
 
 // #region 表单及操作
 // NeedChange
-const defaultForm = { is_use: '0', logo: [] };
+const defaultForm = { is_use: '0', img: [] };
 const formFields: Ref<any> = ref();
 const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
-const form: Ref<any> = ref({ file: [] });
+const form: Ref<any> = ref({ img: [] });
 const formFieldsForCreate = [
-  { label: '品牌名', model: 'name' },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '首字母', model: 'letter' }
+  { label: '标题', model: 'title' },
+  { label: '来源', model: 'origin' },
+  { label: '创建时间', model: 'create_time', type: 'date' },
+  { label: '封面图片', model: 'img', custom: true },
+  { label: '简介', model: 'brief', type: 'textarea' },
+  { label: '内容', model: 'content', custom: true }
 ];
 const formFieldsForUpdate = [
-  { label: '品牌名', model: 'name' },
-  { label: 'logo', model: 'logo', custom: true },
-  { label: '首字母', model: 'letter' }
+  { label: '标题', model: 'title' },
+  { label: '来源', model: 'origin' },
+  { label: '创建时间', model: 'create_time', type: 'date' },
+  { label: '封面图片', model: 'img', custom: true },
+  { label: '简介', model: 'brief', type: 'textarea' },
+  { label: '内容', model: 'content', custom: true }
 ];
 // 关闭弹框
 const toClose = () => {
@@ -202,5 +199,4 @@ const onUpload = (e: { model: string; value: Array<[]> }) => {
 };
 // #endregion
 </script>
-
-<style scoped></style>
+<style scoped lang="scss"></style>

+ 39 - 58
src/views/core/estimate/index.vue

@@ -3,38 +3,42 @@
     <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
       <el-col :span="24" class="one">
         <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
-          <template #status>
+          <template #is_use>
             <el-option v-for="i in statusList" :key="i._id" :label="i.label" :value="i.value"></el-option>
           </template>
-          <template #brand>
-            <el-option v-for="i in brandList" :key="i._id" :label="i.name" :value="i.name"></el-option>
-          </template>
         </cSearch>
       </el-col>
-      <el-col :span="24" class="two">
-        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @evaluate="toEvaluate"> </cTable>
+      <el-col :span="24" class="thr">
+        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @view="toView"> </cTable>
       </el-col>
     </el-col>
   </el-row>
   <cDialog :dialog="dialog" @toClose="toClose">
     <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
-      <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-        <template #status>
-          <el-option v-for="i in statusList" :key="i._id" :label="i.label" :value="i.value"></el-option>
-        </template>
-      </cForm>
+      <el-tabs v-model="active" type="border-card">
+        <el-tab-pane label="早餐" name="breakfast">
+          <meal :form="form.breakfast" :scheduleList="scheduleList" />
+        </el-tab-pane>
+        <el-tab-pane label="午餐" name="lunch">
+          <meal :form="form.lunch" :scheduleList="scheduleList" />
+        </el-tab-pane>
+        <el-tab-pane label="晚餐" name="dinner">
+          <meal :form="form.dinner" :scheduleList="scheduleList" />
+        </el-tab-pane>
+      </el-tabs>
     </el-col>
   </cDialog>
 </template>
 
 <script setup lang="ts">
+// 组件
+import meal from './parts/meal.vue';
 import { ref, Ref, onMounted, inject } from 'vue';
 // NeedChange
-import { EstimateStore } from '@/stores/estimate';
-import { BrandStore } from '@/stores/system/brand';
+import { OrderStore } from '@/stores/core/order';
 import { DictDataStore } from '@/stores/system/dictData';
 import type { IQueryResult } from '@/util/types.util';
-import { cloneDeep, get } from 'lodash';
+import { get } from 'lodash';
 import baseStore from '@/stores/counter';
 const user = ref(baseStore.state.user);
 onMounted(async () => {
@@ -45,22 +49,25 @@ onMounted(async () => {
 });
 
 const loading: Ref<any> = ref(false);
+const active: Ref<any> = ref('breakfast');
 // NeedChange
-const store = EstimateStore();
-const brandStore = BrandStore();
+const store = OrderStore();
 const dictDataStore = DictDataStore();
 const $checkRes = inject('$checkRes') as Function;
 
 // #region 字典
 // NeedChange
 const statusList: Ref<any> = ref([]);
-const brandList: Ref<any> = ref([]);
+const scheduleList: Ref<any> = ref([]);
 
 const searchOther = async () => {
-  const statusResult: IQueryResult = await dictDataStore.query({ code: 'valuation', is_use: '0' });
-  if ($checkRes(statusResult)) statusList.value = statusResult.data;
-  const brandResult: IQueryResult = await brandStore.query({ is_use: '0' });
-  if ($checkRes(brandResult)) brandList.value = brandResult.data;
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictDataStore.query({ code: 'isUse', is_use: '0' });
+  if ($checkRes(res)) statusList.value = res.data;
+  // 用餐进度
+  res = await dictDataStore.query({ code: 'schedule', is_use: '0' });
+  if ($checkRes(res)) scheduleList.value = res.data;
 };
 // #endregion
 
@@ -88,29 +95,23 @@ const toSearch = (query) => {
 // #region 表格及操作
 // NeedChange
 let fields: Ref<any[]> = ref([
-  { label: '品牌', model: 'brand', isSearch: true, type: 'select' },
-  { label: '车系', model: 'bank' },
-  { label: '车型', model: 'type' },
-  { label: '上牌日期', model: 'start' },
-  { label: '上牌城市', model: 'city', isSearch: true },
-  { label: '所在地区', model: 'place', isSearch: true },
-  { label: '行驶里程', model: 'course', isSearch: true },
-  { label: '联系人', model: 'contacts', isSearch: true },
-  { label: '联系电话', model: 'tel', isSearch: true },
-  { label: '预估金额', model: 'estimate' },
-  { label: '状态', model: 'status', format: (i) => getDict(i, 'status'), isSearch: true, type: 'select' }
+  { label: '日期', model: 'date', isSearch: true },
+  { label: '早餐', model: 'breakfast', format: (i) => getDict(i, 'schedule') },
+  { label: '午餐', model: 'lunch', format: (i) => getDict(i, 'schedule') },
+  { label: '晚餐', model: 'dinner', format: (i) => getDict(i, 'schedule') },
+  { label: '状态', model: 'is_use', format: (i) => getDict(i, 'is_use') }
 ]);
 // 操作
-let opera: Ref<any[]> = ref([{ label: '估价', method: 'evaluate', display: (i) => i.status === '0' }]);
+let opera: Ref<any[]> = ref([{ label: '查看', method: 'view' }]);
 
 const getDict = (data, model) => {
   let list;
   switch (model) {
-    case 'status':
+    case 'is_use':
       list = statusList.value;
       break;
-    case 'brand':
-      list = brandList.value;
+    case 'schedule':
+      list = scheduleList.value;
       break;
     default:
       break;
@@ -119,36 +120,16 @@ const getDict = (data, model) => {
   const res = list.find((f) => f.value == data);
   return get(res, 'label');
 };
-const toEvaluate = async (data) => {
-  formFields.value = formFieldsForUpdate;
+const toView = async (data) => {
   form.value = { ...data };
   dialog.value.show = true;
 };
 // #endregion
 
-// #region 常规接口
-const toSave = async () => {
-  const data = cloneDeep(form.value);
-  let res: IQueryResult;
-  if (get(data, '_id')) res = await store.update(data);
-  else res = await store.create(data);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-    toClose();
-  }
-};
-
-// #endregion
-
 // #region 表单及操作
 // NeedChange
-const formFields: Ref<any> = ref();
 const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
 const form: Ref<any> = ref({ file: [] });
-const formFieldsForUpdate = [
-  { label: '预估金额', model: 'estimate' },
-  { label: '状态', model: 'status', type: 'select' }
-];
 // 关闭弹框
 const toClose = () => {
   form.value = {};
@@ -157,4 +138,4 @@ const toClose = () => {
 // #endregion
 </script>
 
-<style scoped></style>
+<style scoped lang="scss"></style>

+ 62 - 0
src/views/core/order/parts/meal.vue

@@ -0,0 +1,62 @@
+<template>
+  <div id="meal">
+    <el-row>
+      <el-col :span="24" class="main">
+        <el-row v-if="form?.list.length > 0">
+          <el-col :span="24"> 总卡路里:{{ form.reserve }}大卡 </el-col>
+          <el-col :span="24"> {{ getDict(form.status, 'schedule') }} </el-col>
+          <el-col :span="24">
+            <cTable :fields="fields" :opera="[]" :list="form.list" :usePage="false"> </cTable>
+          </el-col>
+        </el-row>
+        <el-row v-else class="empty">
+          <el-empty description="未订餐" />
+        </el-row>
+      </el-col>
+    </el-row>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, Ref, toRefs } from 'vue';
+import { get } from 'lodash';
+// #region 传递
+interface fieldsItem {
+  is_use: string;
+  code: string;
+  label: string;
+  value: string;
+  sort: number;
+  _id: string;
+}
+const props = defineProps({
+  form: { type: Object, default: () => { } },
+  scheduleList: { type: Array<fieldsItem>, default: () => [] }
+});
+const { form, scheduleList } = toRefs(props);
+let fields: Ref<any[]> = ref([
+  { label: '菜品名称', model: 'name' },
+  { label: '卡路里(大卡)', model: 'reserve' }
+]);
+const getDict = (data, model) => {
+  let list;
+  switch (model) {
+    case 'schedule':
+      list = scheduleList.value;
+      break;
+    default:
+      break;
+  }
+  if (!list) return;
+  const res = list.find((f) => f.value == data);
+  return get(res, 'label');
+};
+</script>
+<style scoped lang="scss">
+.main {
+  .empty {
+    display: flex;
+    justify-content: center;
+  }
+}
+</style>

+ 7 - 172
src/views/home/index.vue

@@ -5,115 +5,9 @@
         <el-col :span="24" class="one">
           <el-row class="one_1">
             <el-col :span="24" class="title">
-              <span>二手车交易平台统计</span>
-            </el-col>
-            <el-col :span="24" class="info">
-              <el-row class="info_1">
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">校友登记数</el-col>
-                      <el-col :span="24" class="num">{{ info.num_1 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-dengji"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核中</el-col>
-                      <el-col :span="24" class="num">{{ info.num_2 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-shenhezhong"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核通过</el-col>
-                      <el-col :span="24" class="num">{{ info.num_3 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-shenhetongguo"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核未通过</el-col>
-                      <el-col :span="24" class="num">{{ info.num_4 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-dkw_shenheweitongguo"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-              </el-row>
+              <span>食堂管理平台统计</span>
             </el-col>
-          </el-row>
-          <el-row class="one_1">
-            <el-col :span="24" class="title">
-              <span>照片上传统计</span>
-            </el-col>
-            <el-col :span="24" class="info">
-              <el-row class="info_1">
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">照片上传数</el-col>
-                      <el-col :span="24" class="num">{{ info.num_5 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-dengji"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核中</el-col>
-                      <el-col :span="24" class="num">{{ info.num_6 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-shenhezhong"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核通过</el-col>
-                      <el-col :span="24" class="num">{{ info.num_7 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-shenhetongguo"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-                <el-col :span="6" class="list">
-                  <el-row>
-                    <el-col :span="20" class="l">
-                      <el-col :span="24" class="name">审核未通过</el-col>
-                      <el-col :span="24" class="num">{{ info.num_8 }}<span class="dw">人</span></el-col>
-                    </el-col>
-                    <el-col :span="4" class="r">
-                      <span class="iconfont icon-dkw_shenheweitongguo"></span>
-                    </el-col>
-                  </el-row>
-                </el-col>
-              </el-row>
-            </el-col>
-          </el-row>
-        </el-col>
-        <el-col :span="24" class="two" style="display: none">
-          <el-row class="two_1">
-            <el-col :span="12" class="l">1</el-col>
-            <el-col :span="12" class="l">1</el-col>
+            <el-col :span="24" class="info"> </el-col>
           </el-row>
         </el-col>
       </el-col>
@@ -150,10 +44,13 @@ const search = async () => {
 .main {
   .one {
     margin: 0 0 20px 0;
+
     .one_1 {
       margin: 0 0 20px 0;
+
       .title {
         margin: 0 0 20px 0;
+
         span {
           background-color: #439eff;
           color: #ffffff;
@@ -162,70 +59,8 @@ const search = async () => {
           font-weight: bold;
         }
       }
-      .info {
-        .info_1 {
-          display: flex;
-          justify-content: center;
-          .list {
-            max-width: 23%;
-            margin: 0 10px;
-            border-radius: 5px;
-            padding: 15px 10px;
-            background: linear-gradient(to bottom, #439eff 90%, #f1f1f1);
-            .l {
-              .name {
-                font-size: 18px;
-                font-weight: bold;
-                color: #ffffff;
-                margin: 0 0 10px 0;
-              }
-              .num {
-                color: #ffffff;
-                font-size: 22px;
-                font-weight: bold;
-                .dw {
-                  padding: 0 0 0 5px;
-                  font-size: 12px;
-                  color: #f1f1f1;
-                }
-              }
-            }
-            .r {
-              text-align: center;
-              padding: 5px 0;
-              .iconfont {
-                font-size: 40px;
-                color: #ffffff;
-              }
-            }
-          }
-          .list:nth-child(2) {
-            background: linear-gradient(to bottom, #ffa500 90%, #f1f1f1);
-          }
-          .list:nth-child(3) {
-            background: linear-gradient(to bottom, #00ff7f 90%, #f1f1f1);
-          }
-          .list:nth-child(4) {
-            background: linear-gradient(to bottom, #ff0000 90%, #f1f1f1);
-          }
-          .list:hover {
-            cursor: pointer;
-          }
-        }
-      }
-    }
-  }
-  .two {
-    .two_1 {
-      display: flex;
-      justify-content: center;
-      .l {
-        max-width: 48%;
-        margin: 0 10px;
-        border: 1px solid #ff0000;
-        padding: 20px;
-        border-radius: 10px;
-      }
+
+      .info {}
     }
   }
 }

+ 5 - 112
src/views/user/user/index.vue

@@ -8,34 +8,20 @@
         <cButton :isAdd="false"> </cButton>
       </el-col>
       <el-col :span="24" class="thr">
-        <cTable :fields="fields" :opera="opera" :list="list" @query="search" :total="total" @edit="toEdit" @del="toDel" @changeUse="toChangeUse"> </cTable>
+        <cTable :fields="fields" :opera="[]" :list="list" @query="search" :total="total"> </cTable>
       </el-col>
     </el-col>
   </el-row>
-  <cDialog :dialog="dialog" @toClose="toClose">
-    <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
-      <cForm :span="24" :fields="formFields" :form="form" :rules="{}" @save="toSave" label-width="auto">
-        <template #status>
-          <el-radio v-for="i in getEditStatusList()" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
-        </template>
-      </cForm>
-    </el-col>
-  </cDialog>
 </template>
 
 <script setup lang="ts">
 import { ref, Ref, onMounted, inject } from 'vue';
 // NeedChange
 import { UserStore } from '@/stores/users/user';
-import { DictDataStore } from '@/stores/system/dictData';
-import { LoginStore } from '@/stores/login';
 import type { IQueryResult } from '@/util/types.util';
-import { cloneDeep, get } from 'lodash';
-import { ElMessageBox } from 'element-plus';
 
 onMounted(async () => {
   loading.value = true;
-  await searchOther();
   await search({ skip, limit });
   loading.value = false;
 });
@@ -43,18 +29,6 @@ onMounted(async () => {
 const loading: Ref<any> = ref(false);
 // NeedChange
 const store = UserStore();
-const dictDataStore = DictDataStore();
-const $checkRes = inject('$checkRes') as Function;
-
-// #region 字典
-// NeedChange
-const statusList: Ref<any> = ref([]);
-const searchOther = async () => {
-  const statusResult: IQueryResult = await dictDataStore.query({ code: 'userStatus', is_use: '0' });
-  if ($checkRes(statusResult)) {
-    statusList.value = statusResult.data;
-  }
-};
 // #endregion
 
 // #region 查询相关
@@ -65,7 +39,7 @@ let limit = inject('$limit') as number;
 let searchForm: Ref<any> = ref({});
 
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, is_del: '0' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value };
   const res: IQueryResult = await store.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -82,91 +56,10 @@ const toSearch = (query) => {
 // NeedChange
 let fields: Ref<any[]> = ref([
   { label: 'openid', model: 'openid' },
-  { label: '昵称', model: 'nick_name', isSearch: true }
-]);
-// 操作
-let opera: Ref<any[]> = ref([
-  // { label: '修改', method: 'edit' },
-  // { label: '重置密码', method: 'rp', type: 'warning', confirm: true, confirmWord: '您确定要重置密码?' },
-  // { label: '禁用', method: 'changeUse', type: 'warning', confirm: true, confirmWord: '您确定要禁用该用户?', display: (i) => i.status === '1' },
-  // { label: '使用', method: 'changeUse', type: 'success', confirm: true, confirmWord: '您确定要启用该用户?', display: (i) => i.status === '-1' },
-  // { label: '删除', method: 'del', confirm: true, type: 'danger' }
+  { label: '昵称', model: 'nick_name', isSearch: true },
+  { label: '电话', model: 'tel', isSearch: true },
+  { label: '部门', model: 'dept', isSearch: true }
 ]);
-
-const getEditStatusList = () => {
-  return statusList.value.filter((f) => f.value === '1' || f.value === '2');
-};
-const getDict = (data) => {
-  const res = statusList.value.find((f) => f.value == data);
-  return get(res, 'label');
-};
-const toAdd = () => {
-  formFields.value = formFieldsForCreate;
-  form.value = cloneDeep(defaultForm);
-  dialog.value.show = true;
-};
-const toEdit = (data) => {
-  formFields.value = formFieldsForUpdate;
-  form.value = data;
-  dialog.value.show = true;
-};
-// #endregion
-
-// #region 常规接口
-const toSave = async () => {
-  const data = cloneDeep(form.value);
-  let res: IQueryResult;
-  if (get(data, '_id')) res = await store.update(data);
-  else res = await store.create(data);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-    toClose();
-  }
-};
-const toDel = async (data) => {
-  const res = await store.del(data._id);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-  }
-};
-const toChangeUse = async (data) => {
-  const udata = { _id: data._id, status: data.status === '1' ? '-1' : '1' };
-  const res = await store.update(udata);
-  if ($checkRes(res, true)) {
-    search({ skip: 0, limit });
-  }
-};
-// #endregion
-
-// #region 表单及操作
-// NeedChange
-const defaultForm = { status: '1' };
-const formFields: Ref<any> = ref();
-const dialog: Ref<any> = ref({ title: '数据信息', show: false, type: '1' });
-const form: Ref<any> = ref({ file: [] });
-const formFieldsForCreate = [
-  { label: '账号', model: 'account' },
-  { label: '密码', model: 'password', type: 'password' },
-  { label: '用户名', model: 'nick_name' },
-  { label: '工作单位', model: 'unit' },
-  { label: '联系电话', model: 'tel' },
-  { label: '身份证号', model: 'id_card' },
-  { label: '联系邮箱', model: 'email' }
-];
-const formFieldsForUpdate = [
-  { label: '账号', model: 'account' },
-  { label: '用户名', model: 'nick_name' },
-  { label: '工作单位', model: 'unit' },
-  { label: '联系电话', model: 'tel' },
-  { label: '身份证号', model: 'id_card' },
-  { label: '联系邮箱', model: 'email' }
-];
-// 关闭弹框
-const toClose = () => {
-  form.value = {};
-  dialog.value.show = false;
-};
-// #endregion
 </script>
 
 <style scoped></style>

+ 3 - 3
vite.config.ts

@@ -16,11 +16,11 @@ export default defineConfig(({ mode }) => {
       port: 8001,
       proxy: {
         '/files': {
-          target: 'http://120.48.146.1', // https://broadcast.waityou24.cn
+          target: 'http://192.168.1.197', // https://broadcast.waityou24.cn
           changeOrigin: true
         },
-        '/usedCar/api': {
-          target: 'http://127.0.0.1:9800', //https://www.ccwit.net
+        '/st/api': {
+          target: 'http://192.168.1.197:9902', //https://www.ccwit.net
           changeOrigin: true,
           ws: false
         }