zs преди 1 година
родител
ревизия
e7193111c0

+ 6 - 1
src/router/index.ts

@@ -109,6 +109,11 @@ const router = createRouter({
           meta: { title: '角色设置' },
           component: () => import('@/views/system/role/index.vue')
         },
+        {
+          path: '/system/role/detail',
+          meta: { title: '角色信息管理' },
+          component: () => import('@/views/system/role/detail.vue')
+        },
         {
           path: '/acccount/updatepd',
           meta: { title: '修改密码' },
@@ -125,7 +130,7 @@ router.beforeEach(async (to, from, next) => {
     if (token) {
       const res = await axios.request({
         method: 'get',
-        url: '/ball/v1/api/token/tokenView',
+        url: '/material/v1/api/tool/token',
         responseType: 'json',
         headers: {
           token: token

+ 52 - 0
src/stores/ShopSetting/buy.ts

@@ -0,0 +1,52 @@
+import { ref, computed } from 'vue';
+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: `/material/v1/api/ShopSetting`
+};
+export const ShopStore = defineStore('shopSetting', () => {
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
+  function increment() {
+    count.value++;
+  }
+  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 {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 52 - 0
src/stores/module/module.ts

@@ -0,0 +1,52 @@
+import { ref, computed } from 'vue';
+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: `/material/v1/api/Module`
+};
+export const ModuleStore = defineStore('module', () => {
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
+  function increment() {
+    count.value++;
+  }
+  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 {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 52 - 0
src/stores/role/role.ts

@@ -0,0 +1,52 @@
+import { ref, computed } from 'vue';
+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: `/material/v1/api/Role`
+}
+export const RoleStore = defineStore('role', () => {
+  const count = ref(0);
+  const doubleCount = computed(() => count.value * 2);
+  function increment() {
+    count.value++;
+  }
+  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 {
+    count,
+    doubleCount,
+    increment,
+    query,
+    fetch,
+    create,
+    update,
+    del
+  };
+});

+ 3 - 3
src/views/login/index.vue

@@ -10,8 +10,8 @@
               <el-col :span="24" class="login_2">
                 <el-col :span="24" class="form">
                   <el-form ref="formRef" :model="form" :rules="rules" label-width="auto">
-                    <el-form-item label="" prop="account">
-                      <el-input v-model="form.account" placeholder="请输入登录账号">
+                    <el-form-item label="" prop="username">
+                      <el-input v-model="form.username" placeholder="请输入登录账号">
                         <template #prefix>
                           <el-icon><User /></el-icon>
                         </template>
@@ -58,7 +58,7 @@ const router = useRouter();
 const formRef = ref<FormInstance>();
 const form: Ref<any> = ref({});
 const rules = reactive<FormRules>({
-  account: [{ required: true, message: '请输入登录账号', trigger: 'blur' }],
+  username: [{ required: true, message: '请输入登录账号', trigger: 'blur' }],
   password: [{ required: true, message: '请输入账号密码', trigger: 'blur' }]
 });
 // 请求

+ 147 - 16
src/views/system/buy/index.vue

@@ -2,37 +2,168 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </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"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
+            <template #is_use>
+              <el-radio v-for="i in is_useList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
   </div>
 </template>
 
 <script setup lang="ts">
 // 基础
+import _ from 'lodash';
+import type { FormRules } from 'element-plus';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance, reactive } from 'vue';
+import { ElMessage } from 'element-plus';
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { ShopStore } from '@/stores/ShopSetting/buy';
+import { DictDataStore } from '@/stores/dict/dictData';
+import type { IQueryResult } from '@/util/types.util';
+const dictData = DictDataStore();
+const buyAxios = ShopStore();
 const { proxy } = getCurrentInstance() as any;
 // 加载中
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '街道/社区', model: 'office', format: (i: any) => getDict(i, 'office') },
+  { label: '领导', model: 'leader' },
+  { label: '会计', model: 'accounting' },
+  { label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 弹框
+const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
+let form: Ref<{}> = ref({});
+// 表单
+let formFields: Ref<any[]> = ref([
+  { label: '街道/社区', model: 'office', type: 'select' },
+  { label: '领导', model: 'leader', custom: true },
+  { label: '会计', model: 'accounting', custom: true },
+  { label: '是否使用', model: 'is_use', type: 'radio' }
+]);
+const rules = reactive<FormRules>({
+  name: [{ required: true, message: '名称', trigger: 'blur' }],
+  route: [{ required: true, message: '路由', trigger: 'blur' }],
+  url: [{ required: true, message: '图片', trigger: 'blur' }],
+  type: [{ required: true, message: '类型', trigger: 'blur' }],
+  sort: [{ required: true, message: '排序', trigger: 'blur' }]
+});
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+let is_useList: Ref<any> = ref([]);
+let typeList: Ref<any> = ref([]);
+
 // 请求
 onMounted(async () => {
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition };
+  let res: IQueryResult = await buyAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query: any) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value: any, model: any) => {
+  if (model == 'is_use') {
+    if (value) {
+      let data = is_useList.value.find((i: any) => i.value == value);
+      if (data) return data.label;
+      else return '暂无';
+    }
+  } else if (model == 'type') {
+    let data = typeList.value.find((i: any) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 新增
+const toAdd = () => {
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 修改
+const toEdit = async (data: any) => {
+  form.value = data;
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 提交保存
+const toSave = async (data: any) => {
+  let res: IQueryResult;
+  if (data._id) res = await buyAxios.update(data);
+  else res = await buyAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toClose();
+  }
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await buyAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 弹框关闭
+const toClose = () => {
+  form.value = {};
+  dialog.value = { title: '信息管理', show: false, type: '1' };
+  search({ skip, limit });
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictData.query({ type: 'is_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+  // 类型
+  res = await dictData.query({ type: 'goods_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 2 - 26
src/views/system/config/index.vue

@@ -11,27 +11,7 @@
               <cUpload
                 :model="item.model"
                 :limit="1"
-                url="/files/ball/config/upload"
-                :list="form[item.model]"
-                listType="picture-card"
-                @change="onUpload"
-              ></cUpload>
-            </template>
-            <template #longlogo_url="{ item }">
-              <cUpload
-                :model="item.model"
-                :limit="1"
-                url="/files/ball/config/upload"
-                :list="form[item.model]"
-                listType="picture-card"
-                @change="onUpload"
-              ></cUpload>
-            </template>
-            <template #admin_url="{ item }">
-              <cUpload
-                :model="item.model"
-                :limit="1"
-                url="/files/ball/config/upload"
+                url="/files/material/config/upload"
                 :list="form[item.model]"
                 listType="picture-card"
                 @change="onUpload"
@@ -58,11 +38,7 @@ const configAxios = ConfigStore();
 const loading: Ref<any> = ref(false);
 // 表单
 let form: Ref<any> = ref({});
-let fields: Ref<any[]> = ref([
-  { label: 'logo', model: 'logo_url', custom: true },
-  { label: 'logo长图', model: 'longlogo_url', custom: true },
-  { label: '管理员二维码', model: 'admin_url', custom: true }
-]);
+let fields: Ref<any[]> = ref([{ label: 'logo', model: 'logo_url', custom: true }]);
 const rules = reactive<FormRules>({});
 // 请求
 onMounted(async () => {

+ 169 - 16
src/views/system/module/index.vue

@@ -2,37 +2,190 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </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"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
+            <template #url>
+              <cUpload
+                :model="`${'url'}`"
+                :limit="1"
+                listType="picture"
+                url="/files/material/module/upload"
+                accept="*"
+                :list="form.url"
+                @change="onUpload"
+              ></cUpload>
+            </template>
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #is_use>
+              <el-radio v-for="i in is_useList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
   </div>
 </template>
 
 <script setup lang="ts">
 // 基础
+import _ from 'lodash';
+import type { FormRules } from 'element-plus';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance, reactive } from 'vue';
+import { ElMessage } from 'element-plus';
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { ModuleStore } from '@/stores/module/module';
+import { DictDataStore } from '@/stores/dict/dictData';
+import type { IQueryResult } from '@/util/types.util';
+const dictData = DictDataStore();
+const moduleAxios = ModuleStore();
 const { proxy } = getCurrentInstance() as any;
 // 加载中
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '名称', model: 'name', isSearch: true },
+  { label: '类型', model: 'type', format: (i: any) => getDict(i, 'type') },
+  { label: '路由', model: 'route' },
+  { label: '排序', model: 'sort', type: 'number' },
+  { label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 弹框
+const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
+let form: Ref<{}> = ref({});
+// 表单
+let formFields: Ref<any[]> = ref([
+  { label: '名称', model: 'name' },
+  { label: '类型', model: 'type', type: 'select' },
+  { label: '路由', model: 'route' },
+  { label: '图片', model: 'url', custom: true },
+  { label: '排序', model: 'sort', type: 'number' },
+  { label: '是否使用', model: 'is_use', type: 'radio' }
+]);
+const rules = reactive<FormRules>({
+  name: [{ required: true, message: '名称', trigger: 'blur' }],
+  route: [{ required: true, message: '路由', trigger: 'blur' }],
+  url: [{ required: true, message: '图片', trigger: 'blur' }],
+  type: [{ required: true, message: '类型', trigger: 'blur' }],
+  sort: [{ required: true, message: '排序', trigger: 'blur' }]
+});
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+let is_useList: Ref<any> = ref([]);
+let typeList: Ref<any> = ref([]);
+
 // 请求
 onMounted(async () => {
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition };
+  let res: IQueryResult = await moduleAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query: any) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value: any, model: any) => {
+  if (model == 'is_use') {
+    if (value) {
+      let data = is_useList.value.find((i: any) => i.value == value);
+      if (data) return data.label;
+      else return '暂无';
+    }
+  } else if (model == 'type') {
+    let data = typeList.value.find((i: any) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 新增
+const toAdd = () => {
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 修改
+const toEdit = async (data: any) => {
+  form.value = data;
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 提交保存
+const toSave = async (data: any) => {
+  let res: IQueryResult;
+  if (data._id) res = await moduleAxios.update(data);
+  else res = await moduleAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toClose();
+  }
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await moduleAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 上传图片
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 弹框关闭
+const toClose = () => {
+  form.value = {};
+  dialog.value = { title: '信息管理', show: false, type: '1' };
+  search({ skip, limit });
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictData.query({ type: 'is_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+  // 类型
+  res = await dictData.query({ type: 'goods_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 169 - 16
src/views/system/money/index.vue

@@ -2,37 +2,190 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </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"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <cForm :span="24" :fields="formFields" :form="form" :rules="rules" @save="toSave">
+            <template #url>
+              <cUpload
+                :model="`${'url'}`"
+                :limit="1"
+                listType="picture"
+                url="/files/material/module/upload"
+                accept="*"
+                :list="form.url"
+                @change="onUpload"
+              ></cUpload>
+            </template>
+            <template #type>
+              <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+            <template #is_use>
+              <el-radio v-for="i in is_useList" :key="i._id" :label="i.value">{{ i.label }}</el-radio>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
   </div>
 </template>
 
 <script setup lang="ts">
 // 基础
+import _ from 'lodash';
+import type { FormRules } from 'element-plus';
 import type { Ref } from 'vue';
-// reactive,
-import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ref, onMounted, getCurrentInstance, reactive } from 'vue';
+import { ElMessage } from 'element-plus';
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { ModuleStore } from '@/stores/module/module';
+import { DictDataStore } from '@/stores/dict/dictData';
+import type { IQueryResult } from '@/util/types.util';
+const dictData = DictDataStore();
+const moduleAxios = ModuleStore();
 const { proxy } = getCurrentInstance() as any;
 // 加载中
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+// 列表数据
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '名称', model: 'name', isSearch: true },
+  { label: '类型', model: 'type', format: (i: any) => getDict(i, 'type') },
+  { label: '路由', model: 'route' },
+  { label: '排序', model: 'sort', type: 'number' },
+  { label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 弹框
+const dialog: Ref<{ type: string; show: boolean; title: string }> = ref({ type: '1', show: false, title: '信息管理' });
+let form: Ref<{}> = ref({});
+// 表单
+let formFields: Ref<any[]> = ref([
+  { label: '名称', model: 'name' },
+  { label: '类型', model: 'type', type: 'select' },
+  { label: '路由', model: 'route' },
+  { label: '图片', model: 'url', custom: true },
+  { label: '排序', model: 'sort', type: 'number' },
+  { label: '是否使用', model: 'is_use', type: 'radio' }
+]);
+const rules = reactive<FormRules>({
+  name: [{ required: true, message: '名称', trigger: 'blur' }],
+  route: [{ required: true, message: '路由', trigger: 'blur' }],
+  url: [{ required: true, message: '图片', trigger: 'blur' }],
+  type: [{ required: true, message: '类型', trigger: 'blur' }],
+  sort: [{ required: true, message: '排序', trigger: 'blur' }]
+});
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+let is_useList: Ref<any> = ref([]);
+let typeList: Ref<any> = ref([]);
+
 // 请求
 onMounted(async () => {
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const { skip, limit } = e;
+  const condition = _.cloneDeep(searchForm.value);
+  let info = { limit: limit, skip: skip, ...condition };
+  let res: IQueryResult = await moduleAxios.query(info);
+  if (res.errcode == 0) {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query: any) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (value: any, model: any) => {
+  if (model == 'is_use') {
+    if (value) {
+      let data = is_useList.value.find((i: any) => i.value == value);
+      if (data) return data.label;
+      else return '暂无';
+    }
+  } else if (model == 'type') {
+    let data = typeList.value.find((i: any) => i.value == value);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 新增
+const toAdd = () => {
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 修改
+const toEdit = async (data: any) => {
+  form.value = data;
+  dialog.value = { title: '信息管理', show: true, type: '1' };
+};
+// 提交保存
+const toSave = async (data: any) => {
+  let res: IQueryResult;
+  if (data._id) res = await moduleAxios.update(data);
+  else res = await moduleAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toClose();
+  }
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await moduleAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 上传图片
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  form.value[model] = value;
+};
+// 弹框关闭
+const toClose = () => {
+  form.value = {};
+  dialog.value = { title: '信息管理', show: false, type: '1' };
+  search({ skip, limit });
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictData.query({ type: 'is_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+  // 类型
+  res = await dictData.query({ type: 'goods_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+</style>

+ 204 - 0
src/views/system/role/detail.vue

@@ -0,0 +1,204 @@
+<template>
+  <div id="detail">
+    <el-row>
+      <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
+        <el-col :span="24" class="one">
+          <cSearch :is_back="true" @toBack="toBack"></cSearch>
+        </el-col>
+        <el-col :span="24" class="two">
+          <cForm :span="24" :fields="fields" :form="form" :rules="rules" @save="toSave" label-width="auto">
+            <template #menu>
+              <el-col :span="24" class="two_1"><cButton @toAdd="toMenu()"></cButton></el-col>
+              <cTable :fields="menufields" :opera="opera" :list="form.menu" @query="search" :usePage="false" @edit="toEdit" @del="toDel"> </cTable>
+            </template>
+            <template #is_use>
+              <el-option v-for="i in is_useList" :key="i.value" :label="i.label" :value="i.value"></el-option>
+            </template>
+          </cForm>
+        </el-col>
+      </el-col>
+    </el-row>
+    <cDialog :dialog="dialog" @toClose="toClose">
+      <template v-slot:info>
+        <el-col :span="24" class="dialog_one" v-if="dialog.type == '1'">
+          <cForm :span="24" :fields="menuformfields" :form="menuform" :rules="{}" @save="tomenuSave" label-width="auto">
+            <template #iconPath>
+              <cUpload
+                :model="`${'iconPath'}`"
+                :limit="1"
+                listType="picture"
+                url="/files/material/role/upload"
+                accept="*"
+                :list="menuform.iconPath"
+                @change="onUpload"
+              ></cUpload>
+            </template>
+            <template #selectedIconPath>
+              <cUpload
+                :model="`${'selectedIconPath'}`"
+                :limit="1"
+                listType="picture"
+                url="/files/material/role/upload"
+                accept="*"
+                :list="menuform.selectedIconPath"
+                @change="onUpload"
+              ></cUpload>
+            </template>
+          </cForm>
+        </el-col>
+      </template>
+    </cDialog>
+  </div>
+</template>
+
+<script setup lang="ts">
+// 基础
+import moment from 'moment';
+import type { Ref } from 'vue';
+import { ref, reactive, onMounted } from 'vue';
+import { ElMessage } from 'element-plus';
+import type { FormRules } from 'element-plus';
+import { useRoute } from 'vue-router';
+// 接口
+import { RoleStore } from '@/stores/role/role'; // 角色
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const roleAxios = RoleStore();
+const dictAxios = DictDataStore();
+// 路由
+const route = useRoute();
+// 加载中
+const loading: Ref<any> = ref(false);
+// 表单
+let form: Ref<any> = ref({ menu: [] });
+let fields: Ref<any[]> = ref([
+  { label: '角色名称', model: 'name' },
+  { label: '角色编码', model: 'code' },
+  { label: '底部菜单', model: 'menu', custom: true },
+  { label: '简介', model: 'brief', type: 'textarea' },
+  { label: '是否使用', model: 'is_use', type: 'select' }
+]);
+const rules = reactive<FormRules>({
+  name: [{ required: true, message: '角色名称', trigger: 'blur' }],
+  code: [{ required: true, message: '角色编码', trigger: 'blur' }],
+  is_use: [{ required: true, message: '是否使用', trigger: 'blur' }]
+});
+// 字典表
+const is_useList: Ref<any> = ref([]);
+let menufields: Ref<any[]> = ref([
+  { label: '名称', model: 'text' },
+  { label: '路由', model: 'pagePath' },
+  { label: '排序', model: 'index', type: 'number' }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 弹框
+const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
+const menuform: Ref<any> = ref({});
+let menuformfields: Ref<any[]> = ref([
+  { label: '名称', model: 'text' },
+  { label: '路由', model: 'pagePath' },
+  { label: '排序', model: 'index', type: 'number' },
+  { label: '未选择图标', model: 'iconPath', custom: true },
+  { label: '选中图标', model: 'selectedIconPath', custom: true }
+]);
+// 请求
+onMounted(async () => {
+  loading.value = true;
+  await searchOther();
+  await search();
+  loading.value = false;
+});
+const search = async () => {
+  let id = route.query.id;
+  if (id) {
+    let res: IQueryResult = await roleAxios.fetch(id);
+    if (res.errcode == '0') {
+      let info: any = res.data as {};
+      form.value = info;
+    }
+  }
+};
+// 上传图片
+const onUpload = (e: { model: string; value: Array<[]> }) => {
+  const { model, value } = e;
+  menuform.value[model] = value;
+};
+// 保存
+const toSave = async (data: any) => {
+  let res: IQueryResult;
+  if (data._id) res = await roleAxios.update(data);
+  else res = await roleAxios.create(data);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `维护信息成功` });
+    toBack();
+  }
+};
+// 底部菜单保存
+const tomenuSave = async (data: any) => {
+  if (data._id) {
+    let info = form.value.menu.filter((i) => i._id != data._id);
+    info.push({
+      _id: moment().valueOf(),
+      text: data.text,
+      index: data.index,
+      pagePath: data.pagePath,
+      iconPath: data.iconPath,
+      selectedIconPath: data.selectedIconPath
+    });
+    form.value.menu = info;
+  } else {
+    form.value.menu.push({
+      _id: moment().valueOf(),
+      text: data.text,
+      index: data.index,
+      pagePath: data.pagePath,
+      iconPath: data.iconPath,
+      selectedIconPath: data.selectedIconPath
+    });
+  }
+  toClose();
+};
+// 新增底部菜单
+const toMenu = async () => {
+  dialog.value = { title: '审核管理', show: true, type: '1' };
+};
+// 修改底部菜单
+const toEdit = async (data: any) => {
+  menuform.value = data;
+  dialog.value = { title: '审核管理', show: true, type: '1' };
+};
+// 删除底部菜单
+const toDel = async (data: any) => {
+  let info = form.value.menu.filter((i) => i._id != data._id);
+  form.value.menu = info;
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictAxios.query({ type: 'is_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+};
+// 关闭弹框
+const toClose = () => {
+  menuform.value = {};
+  dialog.value = { show: false };
+};
+// 返回上一页
+const toBack = () => {
+  window.history.go(-1);
+};
+</script>
+<style scoped lang="scss">
+.main {
+  .two {
+    .two_1 {
+      margin: 5px 0;
+    }
+  }
+}
+</style>

+ 92 - 15
src/views/system/role/index.vue

@@ -2,7 +2,15 @@
   <div id="index">
     <el-row>
       <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
-        <el-col :span="24" class="one">系统首页</el-col>
+        <el-col :span="24" class="one">
+          <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch"> </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"> </cTable>
+        </el-col>
       </el-col>
     </el-row>
   </div>
@@ -11,28 +19,97 @@
 <script setup lang="ts">
 // 基础
 import type { Ref } from 'vue';
-// reactive,
 import { onMounted, ref, getCurrentInstance } from 'vue';
+import { ElMessage } from 'element-plus';
+import { useRouter } from 'vue-router';
 // 接口
-//import { TestStore } from '@common/src/stores/test';
-//import type { IQueryResult } from '@/util/types.util';
-//const testAxios = TestStore();
+import { RoleStore } from '@/stores/role/role'; // 角色
+import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
+import type { IQueryResult } from '@/util/types.util';
+const roleAxios = RoleStore();
+const dictAxios = DictDataStore();
 const { proxy } = getCurrentInstance() as any;
+// 路由
+const router = useRouter();
 // 加载中
 const loading: Ref<any> = ref(false);
-// 分页数据
-//  const skip = 0;
-//  const limit = proxy.limit;;
+let list: Ref<any> = ref([]);
+let total: Ref<number> = ref(0);
+let skip = 0;
+let limit: number = proxy.$limit;
+let fields: Ref<any[]> = ref([
+  { label: '角色名称', model: 'name', isSearch: true },
+  { label: '角色编码', model: 'code', isSearch: true },
+  { label: '是否使用', model: 'is_use', format: (i: any) => getDict(i, 'is_use') }
+]);
+// 操作
+let opera: Ref<any[]> = ref([
+  { label: '修改', method: 'edit' },
+  { label: '删除', method: 'del', confirm: true, type: 'danger' }
+]);
+// 查询数据
+let searchForm: Ref<any> = ref({});
+// 字典表
+const is_useList: Ref<any> = ref([]);
 // 请求
 onMounted(async () => {
   loading.value = true;
-  //  await search({ skip, limit });
+  await searchOther();
+  await search({ skip, limit });
   loading.value = false;
 });
-//const search = async (e: { skip: number; limit: number }) => {
-//  const info = { skip: e.skip, limit: e.limit, ...searchInfo.value  };
-//  const res: IQueryResult = await testAxios.query(info);
-//  console.log(res);
-//};
+const search = async (e: { skip: number; limit: number }) => {
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, type: '0' };
+  const res: IQueryResult = await roleAxios.query(info);
+  if (res.errcode == '0') {
+    list.value = res.data;
+    total.value = res.total;
+  }
+};
+const toSearch = (query) => {
+  searchForm.value = query;
+  search({ skip, limit });
+};
+const getDict = (e, model) => {
+  if (model == 'is_use') {
+    let data: any = is_useList.value.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  }
+};
+// 添加
+const toAdd = async () => {
+  router.push({ path: '/system/role/detail' });
+};
+// 修改
+const toEdit = async (data) => {
+  router.push({ path: '/system/role/detail', query: { id: data._id } });
+};
+// 删除
+const toDel = async (data: any) => {
+  let res: IQueryResult = await roleAxios.del(data._id);
+  if (res.errcode == 0) {
+    ElMessage({ type: `success`, message: `刪除信息成功` });
+    search({ skip, limit });
+  }
+};
+// 查询其他信息
+const searchOther = async () => {
+  let res: IQueryResult;
+  // 是否使用
+  res = await dictAxios.query({ type: 'is_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+};
 </script>
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+.main {
+  .two {
+    margin: 0 0 10px 0;
+  }
+}
+.dialog_one {
+  .one {
+    margin: 5px 0;
+  }
+}
+</style>

+ 1 - 1
src/views/users/admin/detail.vue

@@ -44,7 +44,7 @@ const loading: Ref<any> = ref(false);
 let form: Ref<any> = ref({});
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid', options: { disabled: true } },
-  { label: '账号', model: 'account', options: { disabled: true } },
+  { label: '账号', model: 'username', options: { disabled: true } },
   { label: '名称', model: 'name' },
   { label: '手机号', model: 'phone' },
   { label: '电子邮箱', model: 'email' },

+ 13 - 10
src/views/users/admin/index.vue

@@ -47,13 +47,12 @@ let skip = 0;
 let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
-  { label: '用户账号', model: 'account', isSearch: true },
+  { label: '手机号', model: 'tel', isSearch: true },
+  { label: '用户姓名', model: 'name', isSearch: true },
   { label: '姓名', model: 'name', isSearch: true },
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
-  { label: '年龄', model: 'age' },
-  { label: '手机号', model: 'phone', isSearch: true },
-  { label: '电子邮箱', model: 'email' },
-  { label: '工作单位', model: 'work' },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, 'role') },
+  { label: '所属', model: 'belong', format: (i: any) => getDict(i, 'belong') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
 ]);
 // 操作
@@ -66,7 +65,8 @@ let opera: Ref<any[]> = ref([
 let searchForm: Ref<any> = ref({});
 // 字典表
 const genderList: Ref<any> = ref([]);
-const typeList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
+const belongList: Ref<any> = ref([]);
 const statusList: Ref<any> = ref([]);
 // 弹框
 const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
@@ -92,8 +92,8 @@ const toSearch = (query) => {
   search({ skip, limit });
 };
 const getDict = (e, model) => {
-  if (model == 'gender') {
-    let data: any = genderList.value.find((i: any) => i.value == e);
+  if (model == 'role') {
+    let data: any = roleList.value.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
   } else if (model == 'status') {
@@ -146,9 +146,12 @@ const searchOther = async () => {
   // 性别
   res = await dictAxios.query({ type: 'gender' });
   if (res.errcode == '0') genderList.value = res.data;
-  // 类别
+  // 角色
+  res = await dictAxios.query({ type: 'role' });
+  if (res.errcode == '0') roleList.value = res.data;
+  // 所属
   res = await dictAxios.query({ type: 'type' });
-  if (res.errcode == '0') typeList.value = res.data;
+  if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status' });
   if (res.errcode == '0') statusList.value = res.data;

+ 1 - 1
src/views/users/firm/detail.vue

@@ -44,7 +44,7 @@ const loading: Ref<any> = ref(false);
 let form: Ref<any> = ref({});
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid', options: { disabled: true } },
-  { label: '账号', model: 'account', options: { disabled: true } },
+  { label: '账号', model: 'username', options: { disabled: true } },
   { label: '名称', model: 'name' },
   { label: '手机号', model: 'phone' },
   { label: '电子邮箱', model: 'email' },

+ 13 - 10
src/views/users/firm/index.vue

@@ -47,13 +47,12 @@ let skip = 0;
 let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
-  { label: '用户账号', model: 'account', isSearch: true },
+  { label: '手机号', model: 'tel', isSearch: true },
+  { label: '用户姓名', model: 'name', isSearch: true },
   { label: '姓名', model: 'name', isSearch: true },
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
-  { label: '年龄', model: 'age' },
-  { label: '手机号', model: 'phone', isSearch: true },
-  { label: '电子邮箱', model: 'email' },
-  { label: '工作单位', model: 'work' },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, 'role') },
+  { label: '所属', model: 'belong', format: (i: any) => getDict(i, 'belong') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
 ]);
 // 操作
@@ -66,7 +65,8 @@ let opera: Ref<any[]> = ref([
 let searchForm: Ref<any> = ref({});
 // 字典表
 const genderList: Ref<any> = ref([]);
-const typeList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
+const belongList: Ref<any> = ref([]);
 const statusList: Ref<any> = ref([]);
 // 弹框
 const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
@@ -92,8 +92,8 @@ const toSearch = (query) => {
   search({ skip, limit });
 };
 const getDict = (e, model) => {
-  if (model == 'gender') {
-    let data: any = genderList.value.find((i: any) => i.value == e);
+  if (model == 'role') {
+    let data: any = roleList.value.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
   } else if (model == 'status') {
@@ -146,9 +146,12 @@ const searchOther = async () => {
   // 性别
   res = await dictAxios.query({ type: 'gender' });
   if (res.errcode == '0') genderList.value = res.data;
-  // 类别
+  // 角色
+  res = await dictAxios.query({ type: 'role' });
+  if (res.errcode == '0') roleList.value = res.data;
+  // 所属
   res = await dictAxios.query({ type: 'type' });
-  if (res.errcode == '0') typeList.value = res.data;
+  if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status' });
   if (res.errcode == '0') statusList.value = res.data;

+ 1 - 1
src/views/users/user/detail.vue

@@ -44,7 +44,7 @@ const loading: Ref<any> = ref(false);
 let form: Ref<any> = ref({});
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid', options: { disabled: true } },
-  { label: '账号', model: 'account', options: { disabled: true } },
+  { label: '账号', model: 'username', options: { disabled: true } },
   { label: '名称', model: 'name' },
   { label: '手机号', model: 'phone' },
   { label: '电子邮箱', model: 'email' },

+ 13 - 10
src/views/users/user/index.vue

@@ -47,13 +47,12 @@ let skip = 0;
 let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
-  { label: '用户账号', model: 'account', isSearch: true },
+  { label: '手机号', model: 'tel', isSearch: true },
+  { label: '用户姓名', model: 'name', isSearch: true },
   { label: '姓名', model: 'name', isSearch: true },
   { label: '性别', model: 'gender', format: (i: any) => getDict(i, 'gender') },
-  { label: '年龄', model: 'age' },
-  { label: '手机号', model: 'phone', isSearch: true },
-  { label: '电子邮箱', model: 'email' },
-  { label: '工作单位', model: 'work' },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, 'role') },
+  { label: '所属', model: 'belong', format: (i: any) => getDict(i, 'belong') },
   { label: '状态', model: 'status', format: (i: any) => getDict(i, 'status') }
 ]);
 // 操作
@@ -66,7 +65,8 @@ let opera: Ref<any[]> = ref([
 let searchForm: Ref<any> = ref({});
 // 字典表
 const genderList: Ref<any> = ref([]);
-const typeList: Ref<any> = ref([]);
+const roleList: Ref<any> = ref([]);
+const belongList: Ref<any> = ref([]);
 const statusList: Ref<any> = ref([]);
 // 弹框
 const dialog: Ref<any> = ref({ title: '审核管理', show: false, type: '1' });
@@ -92,8 +92,8 @@ const toSearch = (query) => {
   search({ skip, limit });
 };
 const getDict = (e, model) => {
-  if (model == 'gender') {
-    let data: any = genderList.value.find((i: any) => i.value == e);
+  if (model == 'role') {
+    let data: any = roleList.value.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
   } else if (model == 'status') {
@@ -146,9 +146,12 @@ const searchOther = async () => {
   // 性别
   res = await dictAxios.query({ type: 'gender' });
   if (res.errcode == '0') genderList.value = res.data;
-  // 类别
+  // 角色
+  res = await dictAxios.query({ type: 'role' });
+  if (res.errcode == '0') roleList.value = res.data;
+  // 所属
   res = await dictAxios.query({ type: 'type' });
-  if (res.errcode == '0') typeList.value = res.data;
+  if (res.errcode == '0') belongList.value = res.data;
   // 状态
   res = await dictAxios.query({ type: 'status' });
   if (res.errcode == '0') statusList.value = res.data;

+ 2 - 1
vite.config.ts

@@ -15,7 +15,8 @@ export default defineConfig(({ mode }) => {
       port: 10001,
       proxy: {
         '/files': {
-          target: 'https://broadcast.waityou24.cn'
+          target: 'https://broadcast.waityou24.cn',
+          changeOrigin: true,
         },
         '/material/v1/api': {
           target: 'http://192.168.255.1:13004',