瀏覽代碼

Merge branch 'master' of http://git.cc-lotus.info/zkzx/zkzx_admin

YY 2 年之前
父節點
當前提交
35482b1391
共有 1 個文件被更改,包括 15 次插入12 次删除
  1. 15 12
      src/views/system/role/detail.vue

+ 15 - 12
src/views/system/role/detail.vue

@@ -17,10 +17,10 @@
             ></el-cascader>
           </template>
           <template #account_type>
-            <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            <el-option v-for="i in typeList" :key="i.value" :label="i.label" :value="i.value"></el-option>
           </template>
           <template #is_use>
-            <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
+            <el-option v-for="i in is_useList" :key="i.value" :label="i.label" :value="i.value"></el-option>
           </template>
         </cForm>
       </el-col>
@@ -37,8 +37,11 @@ import type { FormRules } from 'element-plus';
 import { ElMessage } from 'element-plus';
 // 接口
 import { RoleStore } from '@common/src/stores/system/role';
+import { DictDataStore } from '@common/src/stores/system/dictData';
+
 import type { IQueryResult } from '@/util/types.util';
 const roleAxios = RoleStore();
+const dictAxios = DictDataStore();
 
 // 路由
 let route = useRoute();
@@ -47,8 +50,8 @@ const fields: Ref<any> = ref([
   { label: '角色名称', model: 'name' },
   { label: '角色编码', model: 'code' },
   { label: '简介', model: 'brief' },
-  { label: '菜单', model: 'menu', custom: true },
   { label: '账号类型', model: 'account_type', type: 'select' },
+  { label: '菜单', model: 'menu', custom: true },
   { label: '是否使用', model: 'is_use', type: 'select' }
 ]);
 const form: Ref<any> = ref({});
@@ -92,16 +95,16 @@ const toSave = async (data) => {
 // 查询其他信息
 const searchOther = async () => {
   let res: IQueryResult;
-  console.log(res + '查询字典表');
   // 是否使用
-  // res = await dictAxios.query({ dict_type: 'common_use' });
-  // if (res.errcode == '0') is_useList.value = res.data;
-  // // 类型
-  // res = await dictAxios.query({ dict_type: 'role_type' });
-  // if (res.errcode == '0') typeList.value = res.data;
-  // // 菜单
-  // res = await roleAxios.am();
-  // if (res.errcode == '0') menuList.value = res.data;
+  res = await dictAxios.query({ type: 'common_use' });
+  if (res.errcode == '0') is_useList.value = res.data;
+  // 账号类型
+  res = await dictAxios.query({ type: 'account_type' });
+  if (res.errcode == '0') typeList.value = res.data;
+  // 菜单
+  res = await roleAxios.am();
+  console.log(res.data);
+  if (res.errcode == '0') menuList.value = res.data;
 };
 
 // 返回上一页