Browse Source

修改用户管理

zs 1 year ago
parent
commit
1a591917d0

+ 5 - 2
src/views/system/buy/index.vue

@@ -124,11 +124,14 @@ const toSearch = (query: any) => {
 };
 const toChange = async (val: any) => {
   let res: IQueryResult;
+  let info: any = { status: '1' };
+  if (val.type == '0') info.street = val._id;
+  else if (val.type == '1') info.community = val._id;
   // 领导
-  res = await userAxios.query({ status: '1', belong: val._id, role: 'ld' });
+  res = await userAxios.query({ role: 'ld', ...info });
   if (res.errcode == '0') ldList.value = res.data;
   // 会计
-  res = await userAxios.query({ status: '1', belong: val._id, role: 'kj' });
+  res = await userAxios.query({ role: 'kj', ...info });
   if (res.errcode == '0') kjList.value = res.data;
 };
 const getDict = (value: any, model: any) => {

+ 5 - 2
src/views/system/money/index.vue

@@ -124,11 +124,14 @@ const toSearch = (query: any) => {
 };
 const toChange = async (val: any) => {
   let res: IQueryResult;
+  let info: any = { status: '1' };
+  if (val.type == '0') info.street = val._id;
+  else if (val.type == '1') info.community = val._id;
   // 领导
-  res = await userAxios.query({ status: '1', belong: val.belong, role: '64c213db894448b6ed4f9a43' });
+  res = await userAxios.query({ role: 'ld', ...info });
   if (res.errcode == '0') ldList.value = res.data;
   // 会计
-  res = await userAxios.query({ status: '1', belong: val.belong, role: '64c213ce894448b6ed4f9a3b' });
+  res = await userAxios.query({ role: 'kj', ...info });
   if (res.errcode == '0') kjList.value = res.data;
 };
 const getDict = (value: any, model: any) => {

+ 24 - 16
src/views/users/five/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { 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: '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') }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -80,7 +84,7 @@ onMounted(async () => {
   loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, code: 'kj' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, role: 'kj' };
   const res: IQueryResult = await userAxios.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -91,14 +95,18 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  if (model == 'role') {
-    let data: any = roleList.value.find((i: any) => i.value == e);
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
-  } else if (model == 'status') {
-    let data: any = statusList.value.find((i: any) => i.value == e);
-    if (data) return data.label;
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
     else return '暂无';
   }
 };
@@ -144,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>

+ 29 - 15
src/views/users/four/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { label: '手机号', model: 'tel', isSearch: true },
-  { label: '用户姓名', model: 'name', isSearch: true },
   { label: '姓名', model: 'name', isSearch: true },
-  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value) },
-  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value) },
-  { label: '所属', model: 'belong', format: (i: any) => getDict(i, belongList.value) },
-  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value) }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -80,7 +84,7 @@ onMounted(async () => {
   loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, code: 'sqry' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, role: 'sqry' };
   const res: IQueryResult = await userAxios.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -91,10 +95,20 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  let data: any = model.find((i: any) => i.value == e);
-  if (data) return data.label;
-  else return '暂无';
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
+    if (data) return data.label;
+    else return '暂无';
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
+    else return '暂无';
+  }
 };
 // 审核
 const toExam = async (data) => {
@@ -116,7 +130,7 @@ const toSave = async (data) => {
 };
 // 修改
 const toEdit = (data) => {
-  router.push({ path: '/users/detail', query: { id: data._id } });
+  router.push({ path: '/users/match/detail', query: { id: data._id } });
 };
 // 删除
 const toDel = async (data: any) => {
@@ -138,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>

+ 23 - 15
src/views/users/one/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { 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: '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') }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -91,14 +95,18 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  if (model == 'role') {
-    let data: any = roleList.value.find((i: any) => i.value == e);
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
-  } else if (model == 'status') {
-    let data: any = statusList.value.find((i: any) => i.value == e);
-    if (data) return data.label;
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
     else return '暂无';
   }
 };
@@ -144,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>

+ 24 - 16
src/views/users/six/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { 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: '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') }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -80,7 +84,7 @@ onMounted(async () => {
   loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, code: 'ld' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, role: 'ld' };
   const res: IQueryResult = await userAxios.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -91,14 +95,18 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  if (model == 'role') {
-    let data: any = roleList.value.find((i: any) => i.value == e);
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
-  } else if (model == 'status') {
-    let data: any = statusList.value.find((i: any) => i.value == e);
-    if (data) return data.label;
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
     else return '暂无';
   }
 };
@@ -144,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>

+ 24 - 16
src/views/users/thr/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { 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: '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') }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -80,7 +84,7 @@ onMounted(async () => {
   loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, code: 'jdry' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, role: 'jdry' };
   const res: IQueryResult = await userAxios.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -91,14 +95,18 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  if (model == 'role') {
-    let data: any = roleList.value.find((i: any) => i.value == e);
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
-  } else if (model == 'status') {
-    let data: any = statusList.value.find((i: any) => i.value == e);
-    if (data) return data.label;
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
     else return '暂无';
   }
 };
@@ -144,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>

+ 24 - 16
src/views/users/two/index.vue

@@ -32,10 +32,14 @@ import { ElMessage } from 'element-plus';
 import { useRouter } from 'vue-router';
 // 接口
 import { UserStore } from '@/stores/users/user';
+import { OfficeStore } from '@/stores/office/office';
+import { RoleStore } from '@/stores/role/role'; // 角色
 import { DictDataStore } from '@/stores/dict/dictData'; // 字典表
 import type { IQueryResult } from '@/util/types.util';
 const userAxios = UserStore();
 const dictAxios = DictDataStore();
+const officeAxios = OfficeStore();
+const roleAxios = RoleStore();
 const { proxy } = getCurrentInstance() as any;
 // 路由
 const router = useRouter();
@@ -48,12 +52,12 @@ let limit: number = proxy.$limit;
 let fields: Ref<any[]> = ref([
   { label: '微信用户标识', model: 'openid' },
   { 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: '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') }
+  { label: '性别', model: 'gender', format: (i: any) => getDict(i, genderList.value, 'dict') },
+  { label: '角色', model: 'role', format: (i: any) => getDict(i, roleList.value, 'role') },
+  { label: '所属街道', model: 'street', format: (i: any) => getDict(i, belongList.value) },
+  { label: '所属社区', model: 'community', format: (i: any) => getDict(i, belongList.value) },
+  { label: '状态', model: 'status', format: (i: any) => getDict(i, statusList.value, 'dict') }
 ]);
 // 操作
 let opera: Ref<any[]> = ref([
@@ -80,7 +84,7 @@ onMounted(async () => {
   loading.value = false;
 });
 const search = async (e: { skip: number; limit: number }) => {
-  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, code: 'cs' };
+  const info = { skip: e.skip, limit: e.limit, ...searchForm.value, role: 'cs' };
   const res: IQueryResult = await userAxios.query(info);
   if (res.errcode == '0') {
     list.value = res.data;
@@ -91,14 +95,18 @@ const toSearch = (query) => {
   searchForm.value = query;
   search({ skip, limit });
 };
-const getDict = (e, model) => {
-  if (model == 'role') {
-    let data: any = roleList.value.find((i: any) => i.value == e);
+const getDict = (e, model, type) => {
+  if (type == 'dict') {
+    let data: any = model.find((i: any) => i.value == e);
     if (data) return data.label;
     else return '暂无';
-  } else if (model == 'status') {
-    let data: any = statusList.value.find((i: any) => i.value == e);
-    if (data) return data.label;
+  } else if (type == 'role') {
+    let data: any = model.find((i: any) => i.code == e);
+    if (data) return data.name;
+    else return '暂无';
+  } else {
+    let data: any = model.find((i: any) => i._id == e);
+    if (data) return data.name;
     else return '暂无';
   }
 };
@@ -144,16 +152,16 @@ const toClose = () => {
 const searchOther = async () => {
   let res: IQueryResult;
   // 性别
-  res = await dictAxios.query({ type: 'gender' });
+  res = await dictAxios.query({ type: 'gender', is_use: '0' });
   if (res.errcode == '0') genderList.value = res.data;
   // 角色
-  res = await dictAxios.query({ type: 'role' });
+  res = await roleAxios.query({ type: 'role', is_use: '0' });
   if (res.errcode == '0') roleList.value = res.data;
   // 所属
-  res = await dictAxios.query({ type: 'type' });
+  res = await officeAxios.query({ is_use: '0' });
   if (res.errcode == '0') belongList.value = res.data;
   // 状态
-  res = await dictAxios.query({ type: 'status' });
+  res = await dictAxios.query({ type: 'status', is_use: '0' });
   if (res.errcode == '0') statusList.value = res.data;
 };
 </script>