CzRger 10 kuukautta sitten
vanhempi
commit
92f2c0173d

+ 27 - 0
src/api/modules/manage/dict.ts

@@ -8,3 +8,30 @@ export const dictGetAllSysDictsByValue = (params) => handle({
   method: 'get',
   params
 })
+// 查询所有字典项
+export const dictList = () => handle({
+  url: `/${suffix}/api/dict`,
+  method: 'get',
+})
+// 创建字典项
+export const dictAdd = (params: any) => handle({
+  url: `/${suffix}/api/dict`,
+  method: 'post',
+  params
+})
+// 删除字典项
+export const dictDel = (id: any) => handle({
+  url: `/${suffix}/api/dict/${id}`,
+  method: 'delete',
+})
+// 删除字典项
+export const dictInfo = (id: any) => handle({
+  url: `/${suffix}/api/dict/${id}`,
+  method: 'get',
+})
+// 更新字典项
+export const dictEdit = (params: any) => handle({
+  url: `/${suffix}/api/dict`,
+  method: 'put',
+  params
+})

+ 30 - 0
src/api/request.ts

@@ -33,6 +33,36 @@ export class HttpRequest {
       })
     })
   }
+
+  public delete(url: string, params: String, config: Object = {}) {
+    return new Promise((resolve, reject) => {
+      let paramUrl = url
+      if (params) {
+        paramUrl += `?${params}`
+      }
+      this.axios.delete(paramUrl, {
+        ...config
+      }).then((res: any) => {
+        this.resultHandle(res, resolve, reject, url);
+      }).catch((err: { message: any; }) => {
+        console.log(err)
+        reject(err.message);
+      })
+    })
+  }
+  public put(url: string, params: Object, config: Object = {}) {
+    return new Promise((resolve, reject) => {
+      this.axios.put(url, params, {
+        ...config   //  导出添加的下载类型
+      }).then((res: any) => {
+        this.resultHandle(res, resolve, reject, url);
+      }).catch((err: { message: any; }) => {
+        reject(err.message);
+      })
+    })
+  }
+
+
   public resultHandle(res: any, resolve: { (value: unknown): void; (value: unknown): void; (arg0: any): void; },reject: { (value: unknown): void; (value: unknown): void; (arg0: any): void; }, url: string) {
     if (res) {
       if (res.code === 200 || (res.size > 0 && res.type)) {   //  增加blob文件判断

+ 6 - 2
src/stores/dictionary.ts

@@ -19,11 +19,15 @@ export const useDictionaryStore = defineStore('dictionary', {
 			{dictLabel: '2级', dictValue: 2},
 			{dictLabel: '3级', dictValue: 3},
 			{dictLabel: '4级', dictValue: 4},
+		],
+		dictStateList: [
+			{dictLabel: '启用', dictValue: '0'},
+			{dictLabel: '停用', dictValue: '1'},
 		]
 	}),
 	getters: {
-		typeLevelMap() {
-			return listToMap(this.typeLevelList)
+		dictStateMap() {
+			return listToMap(this.dictStateList)
 		},
 	},
 	actions: {

+ 45 - 44
src/views/manage/system/dict/detail.vue

@@ -3,53 +3,45 @@
     :show="show"
     :title="titleCpt"
     @onClose="$emit('update:show', false)"
-    width="1000px"
+    width="400px"
     height="auto"
     @onSubmit="onSubmit"
     :loading="state.loading"
   >
     <div class="__cus-dialog-form">
-      <CusForm ref="ref_form">
+      <CusForm ref="ref_form" label-width="90px">
         <CusFormColumn
           :span="24"
           required
-          label="类型"
-          v-model:param="state.form.labelType"
-          link="radio"
-          :options="DictionaryStore.labelTypeList"
-          :disabled="true"
+          label="字典名称"
+          v-model:param="state.form.dictLabel"
         />
         <CusFormColumn
           :span="24"
           required
-          label="名称"
-          v-model:param="state.form.labelName"
+          label="字典值"
+          v-model:param="state.form.dictValue"
         />
         <CusFormColumn
+          v-if="transfer.mode !== 'parent'"
           :span="24"
           required
-          label="层级"
-          v-model:param="state.form.labelLevel"
-          link="radio"
-          :options="DictionaryStore.typeLevelList"
-          :disabled="true"
+          label="字典状态"
+          v-model:param="state.form.dictState"
+          link="switch"
+          :options="DictionaryStore.dictStateList"
+          active-value="0"
+          inactive-value="1"
         />
         <CusFormColumn
-          :span="8"
+          :span="24"
           required
           label="排序"
-          v-model:param="state.form.labelOrder"
+          v-model:param="state.form.sortCode"
           link="input-number"
           :min="0"
           :max="999"
         />
-        <CusFormColumn
-          :span="24"
-          label="备注"
-          v-model:param="state.form.remark"
-          type="textarea"
-          :rows="5"
-        />
       </CusForm>
     </div>
   </CusDialog>
@@ -59,7 +51,7 @@
 import {computed, getCurrentInstance, nextTick, reactive, ref, watch} from "vue";
 import {useDictionaryStore} from "@/stores";
 import {ElMessage, ElMessageBox} from "element-plus";
-import {sysLabelDetail, sysLabelSave, sysLabelUpdate} from "@/api/modules/manage/type";
+import {dictAdd, dictEdit, dictInfo} from "@/api/modules/manage/dict";
 
 const emit = defineEmits(['update:show', 'refresh'])
 const {proxy} = getCurrentInstance()
@@ -76,9 +68,11 @@ const ref_form = ref()
 const titleCpt = computed(() => {
   let t = ''
   switch (props.transfer.mode) {
-    case 'add': t = '新增分类'
+    case 'parent': t = '新增字典'
+      break
+    case 'add': t = '新增字典项'
       break
-    case 'edit': t = '编辑分类'
+    case 'edit': t = '编辑字典项'
       break
   }
   return t
@@ -92,8 +86,20 @@ const onSubmit = () => {
     } as any).then(() => {
       state.loading = true
       switch (props.transfer.mode) {
+        case 'parent': {
+          dictAdd(state.form).then(res => {
+            if (res.code === 200) {
+              ElMessage.success('新增成功!')
+              emit('update:show', false)
+              emit('refresh', true)
+            } else {
+              ElMessage.error(res.msg)
+            }
+            state.loading = false
+          })
+        } break
         case 'add': {
-          sysLabelSave(state.form).then(res => {
+          dictAdd(state.form).then(res => {
             if (res.code === 200) {
               ElMessage.success('新增成功!')
               emit('update:show', false)
@@ -105,7 +111,7 @@ const onSubmit = () => {
           })
         } break
         case 'edit': {
-          sysLabelUpdate(state.form).then(res => {
+          dictEdit(state.form).then(res => {
             if (res.code === 200) {
               ElMessage.success('编辑成功!')
               emit('update:show', false)
@@ -127,25 +133,22 @@ const onSubmit = () => {
   })
 }
 const initDetail = () => {
-  state.loading = true
-  sysLabelDetail(props.transfer.id).then(res => {
-    if (res.code === 200) {
-      state.form = res.data
-      state.loading = false
-    } else {
-      ElMessage.error(res.msg)
-    }
-  })
+  state.form = props.transfer.row
 }
 watch(() => props.show, (n) => {
   if (n) {
     initDictionary()
-    if (props.transfer.mode === 'add') {
+    if (props.transfer.mode === 'parent') {
+      state.form = {
+        parentId: 0,
+        dictState: '0',
+        sortCode: 999
+      }
+    } else if (props.transfer.mode === 'add') {
       state.form = {
-        labelParentId: props.transfer.labelParentId,
-        labelType: props.transfer.labelType,
-        labelLevel: 3,
-        labelOrder: 999
+        parentId: props.transfer.parentId,
+        dictState: '0',
+        sortCode: 999
       }
     } else {
       initDetail()
@@ -156,8 +159,6 @@ watch(() => props.show, (n) => {
   }
 })
 const initDictionary = () => {
-  DictionaryStore.initDict('label_type')
-  DictionaryStore.initDict('label_level')
 }
 </script>
 

+ 106 - 37
src/views/manage/system/dict/index.vue

@@ -1,8 +1,15 @@
 <template>
   <div class="__cus-manage_content">
     <div class="__cus-manage_content-title"><SvgIcon class="flag" name="flag_1" color="var(--cus-main-color)"/>{{$route.meta.title}}</div>
+    <div class="buttons">
+      <CusButton type="main" title="新增字典" @click="onAddParent()"/>
+      <CusButton title="删除字典" style="margin-left: 10px" @click="onDelParent()"/>
+      <template v-if="state.tree.value?.id">
+        <CusButton type="main" title="新增字典项" style="margin-left: auto" @click="onAdd"/>
+      </template>
+    </div>
     <div class="__cus-manage_content-main" v-loading="state.query.loading">
-      <div class="tree">
+      <div class="tree" v-loading="state.tree.loading">
         <div class="tree-filter">
           <el-input v-model="state.tree.filter"/>
         </div>
@@ -14,6 +21,8 @@
             :props="state.tree.defaultProps"
             default-expand-all
             :filter-node-method="filterNode"
+            @node-click="onTreeClick"
+            :highlight-current="true"
           />
         </div>
       </div>
@@ -24,22 +33,22 @@
           :no-page="true"
           default-expand-all
         >
-          <template #labelType-column-value="{scope}">
-            {{DictionaryStore.labelTypeMap.get(scope.row.labelType)}}
+          <template #dictState-column-value="{scope}">
+            <el-switch
+              v-model="scope.row.dictState"
+              active-value="0"
+              inactive-value="1"
+              @click="onChangeDictState(scope.row)"
+            />
           </template>
           <template #do-column-value="{scope}">
-            <template v-if="scope.row.labelLevel == 2">
-              <CusButton type="table-add" title="新增下级" @click="onAdd(scope.row)"/>
-            </template>
-            <template v-else>
-              <CusButton type="table-edit" @click="onEdit(scope.row)"/>
-              <CusButton type="table-del" @click="onDel(scope.row)"/>
-            </template>
+            <CusButton type="table-edit" @click="onEdit(scope.row)"/>
+            <CusButton type="table-del" @click="onDel(scope.row)"/>
           </template>
         </CusTable>
       </div>
     </div>
-    <DetailCom v-model:show="state.detail.show" :transfer="state.detail.transfer" @refresh="initTree"/>
+    <DetailCom v-model:show="state.detail.show" :transfer="state.detail.transfer" @refresh="flag => flag ? initTree() : initDictList()"/>
   </div>
 </template>
 
@@ -48,7 +57,7 @@ import {getCurrentInstance, onMounted, reactive, ref, watch} from "vue";
 import DetailCom from './detail.vue'
 import {useDictionaryStore} from "@/stores";
 import {ElMessage, ElMessageBox} from "element-plus";
-import {sysLabelDelete, sysLabelGetAllSysLabels} from "@/api/modules/manage/type";
+import {dictDel, dictEdit, dictGetAllSysDictsByValue, dictList} from "@/api/modules/manage/dict";
 
 const {proxy} = getCurrentInstance()
 const DictionaryStore = useDictionaryStore()
@@ -56,13 +65,10 @@ const state: any = reactive({
   query: {
     loading: false,
     tableHead: [
-      {value: "labelName", label: "名称", align: 'left', headerAlign: 'left', minWidth: 400},
-      {value: "labelType", label: "类型", width: 120},
-      {value: "labelOrder", label: "排序", width: 120},
-      {value: "indexNum", label: "索引数量", width: 120},
-      {value: "createTime", label: "创建时间", width: 200},
-      {value: "updateTime", label: "最后修改时间", width: 200},
-      {value: "remark", label: "备注", width: 200},
+      {value: "dictLabel", label: "字典名称"},
+      {value: "dictValue", label: "字典值"},
+      {value: "dictState", label: "字典状态"},
+      {value: "sortCode", label: "排序"},
       {value: "do", label: "操作", width: 220, fixed: 'right'},
     ],
     result: {
@@ -78,75 +84,130 @@ const state: any = reactive({
     transfer: {}
   },
   tree: {
+    value: '',
+    loading: false,
     filter: '',
     defaultProps: {
-      children: 'children',
-      label: 'label',
+      label: 'dictLabel',
+      vaue: 'dictValue',
     },
     options: []
   }
 })
 const ref_tree = ref()
 const initTree = () => {
-  state.query.loading = true
-  sysLabelGetAllSysLabels().then(res => {
+  state.tree.loading = true
+  dictList().then(res => {
     if (res.code === 200) {
-      state.query.result.data = res.data.map(v => ({...v, children: v.sysLabels}))
-      state.query.loading = false
+      state.tree.options = res.data.filter(v => v.parentId == 0)
+      state.tree.loading = false
     } else {
       ElMessage.error(res.msg)
     }
   })
 }
-const onAdd = (row) => {
+const onAddParent = () => {
+  state.detail.transfer = {
+    mode: 'parent',
+  }
+  state.detail.show = true
+}
+const onAdd = () => {
   state.detail.transfer = {
     mode: 'add',
-    labelParentId: row.id,
-    labelType: row.labelType
+    parentId: state.tree.value.id
   }
   state.detail.show = true
 }
 const onEdit = (row) => {
   state.detail.transfer = {
     mode: 'edit',
-    id: row.id,
+    row: JSON.parse(JSON.stringify(row)),
   }
   state.detail.show = true
 }
+const onDelParent = () => {
+  if (state.tree.value?.id) {
+    ElMessageBox.confirm(`请确认是否删除${state.tree.value.dictLabel}?`, "提示", {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    } as any).then(() => {
+      dictDel(state.tree.value.id).then(res => {
+        if (res.code === 200) {
+          ElMessage.success('删除成功!')
+        } else {
+          ElMessage.error(res.msg)
+        }
+        initTree()
+      })
+    }).catch(() => {})
+  } else {
+    ElMessage.warning('请先选择字典!')
+  }
+}
 const onDel = (row) => {
-  ElMessageBox.confirm(`请确认是否删除${row.labelName}?`, "提示", {
+  ElMessageBox.confirm(`请确认是否删除${row.dictLabel}?`, "提示", {
     confirmButtonText: "确定",
     cancelButtonText: "取消",
     type: "warning",
   } as any).then(() => {
-    state.loading = true
-    sysLabelDelete(row.id).then(res => {
+    dictDel(row.id).then(res => {
       if (res.code === 200) {
         ElMessage.success('删除成功!')
       } else {
         ElMessage.error(res.msg)
       }
-      initTree()
+      initDictList()
     })
   }).catch(() => {})
 }
 const filterNode = (value, data) => {
   if (!value) return true
-  return data.label.includes(value)
+  return data.dictLabel.includes(value)
 }
 watch(() => state.tree.filter, (n) => {
   ref_tree.value?.filter(n)
 })
-const initDictionary = () => {
-  DictionaryStore.initDict('label_type')
+const onTreeClick = (row) => {
+  state.tree.value = row
+  initDictList()
+}
+const initDictList = () => {
+  if (state.tree.value?.dictValue) {
+    state.query.loading = true
+    dictGetAllSysDictsByValue(proxy.$util.formatGetParam({dictValue: state.tree.value.dictValue})).then(res => {
+      if (res.code == 200) {
+        state.query.result.data = res.data
+        state.query.loading = false
+      } else {
+        ElMessage.error(res.msg)
+      }
+    })
+  }
+}
+const onChangeDictState = (row) => {
+  const p = JSON.parse(JSON.stringify(row))
+  dictEdit(p).then(res => {
+    if (res.code === 200) {
+      ElMessage.success('修改成功!')
+    } else {
+      ElMessage.error(res.msg)
+    }
+    initDictList()
+  })
 }
 onMounted(() => {
-  initDictionary()
   initTree()
 })
 </script>
 
 <style lang="scss" scoped>
+.buttons {
+  width: 100%;
+  display: flex;
+  margin-bottom: 10px;
+}
 .__cus-manage_content-main {
   display: flex;
   width: 100%;
@@ -154,6 +215,14 @@ onMounted(() => {
   gap: 10px;
   .tree {
     width: 300px;
+    display: flex;
+    flex-direction: column;
+    .tree-filter {
+    }
+    .tree-main {
+      flex: 1;
+      overflow-y: auto;
+    }
   }
   .table {
     overflow: hidden;

+ 136 - 0
src/views/manage/theme/detail.vue

@@ -0,0 +1,136 @@
+<template>
+  <CusDialog
+    :show="show"
+    :title="titleCpt"
+    @onClose="$emit('update:show', false)"
+    width="600px"
+    height="auto"
+    @onSubmit="onSubmit"
+    :loading="state.loading"
+  >
+    <div class="__cus-dialog-form">
+      <CusForm ref="ref_form" label-width="80px">
+        <CusFormColumn
+          :span="24"
+          required
+          label="名称"
+          v-model:param="state.form.indexName"
+        />
+        <CusFormColumn
+          :span="24"
+          required
+          label="类别"
+          v-model:param="state.form.shareMethod"
+          link="select"
+          :options="DictionaryStore.gxMethodList"
+        />
+        <CusFormColumn
+          :span="24"
+          required
+          label="状态"
+          v-model:param="state.form.shareMethod"
+          link="select"
+          :options="DictionaryStore.gxMethodList"
+        />
+        <CusFormColumn
+          :span="24"
+          required
+          label="URL"
+          v-model:param="state.form.shareMethod"
+        />
+        <CusFormColumn
+          :span="24"
+          required
+          label="参数"
+          v-model:param="state.form.shareMethod"
+        />
+      </CusForm>
+    </div>
+  </CusDialog>
+</template>
+
+<script setup lang="ts">
+import {computed, getCurrentInstance, nextTick, reactive, ref, watch} from "vue";
+import {useDictionaryStore} from "@/stores";
+import {ElMessage, ElMessageBox} from "element-plus";
+
+const emit = defineEmits(['update:show', 'refresh'])
+const {proxy} = getCurrentInstance()
+const DictionaryStore = useDictionaryStore()
+const props = defineProps({
+  show: {default: false},
+  transfer: {}
+ })
+const state: any = reactive({
+  form: {},
+  loading: false
+})
+const ref_form = ref()
+const titleCpt = computed(() => {
+  let t = ''
+  switch (props.transfer.mode) {
+    case 'add': t = '新增主题'
+      break
+    case 'edit': t = '编辑主题'
+      break
+  }
+  return t
+})
+const onSubmit = () => {
+  ref_form.value.submit().then(() => {
+    ElMessageBox.confirm("是否提交?", "提示", {
+      confirmButtonText: "确定",
+      cancelButtonText: "取消",
+      type: "warning",
+    } as any).then(() => {
+      // state.loading = true
+      // sysIndexSaveOrUpdate(state.form).then(res => {
+      //   if (res.code === 200) {
+      //     ElMessage.success(props.transfer.mode === 'add' ? '新增成功!' : '编辑成功!')
+      //     emit('update:show', false)
+      //     emit('refresh')
+      //   } else {
+      //     ElMessage.error(res.msg)
+      //   }
+      //   state.loading = false
+      // })
+    }).catch(() => {})
+  }).catch((e) => {
+    ElMessage({
+      message: e[0].message,
+      grouping: true,
+      type: 'warning',
+    })
+  })
+}
+const initDetail = () => {
+  // state.loading = true
+  // sysIndexGetDetail(props.transfer.id).then(res => {
+  //   if (res.code === 200) {
+  //     state.form = res.data
+  //     state.loading = false
+  //   } else {
+  //     ElMessage.error(res.msg)
+  //   }
+  // })
+}
+watch(() => props.show, (n) => {
+  if (n) {
+    initDictionary()
+    if (props.transfer.mode === 'add') {
+      state.form = {}
+    } else {
+      initDetail()
+    }
+    nextTick(() => {
+      ref_form.value.reset()
+    })
+  }
+})
+const initDictionary = () => {
+  DictionaryStore.initDict('gx_method')
+}
+</script>
+
+<style lang="scss" scoped>
+</style>

+ 162 - 4
src/views/manage/theme/index.vue

@@ -1,14 +1,172 @@
 <template>
-  <div>
-    <h1>这是后台-主题设置页面</h1>
+  <div class="__cus-manage_content">
+    <div class="__cus-manage_content-title"><SvgIcon class="flag" name="flag_1" color="var(--cus-main-color)"/>{{$route.meta.title}}</div>
+    <div class="__cus-manage_content-filters">
+      <CusForm labelWidth="50px" @handleEnter="onSearch">
+        <CusFormColumn
+          label-width="80px"
+          :span="4"
+          label="主题名称"
+          v-model:param="state.query.form.keyword"
+        />
+        <CusFormColumn
+          :span="4"
+          label="类别"
+          v-model:param="state.query.form.keyword"
+          link="select"
+          :options="DictionaryStore.trueFalseList"
+        />
+        <CusFormColumn
+          :span="4"
+          label="状态"
+          v-model:param="state.query.form.keyword"
+          link="select"
+          :options="DictionaryStore.trueFalseList"
+        />
+        <CusButton type="main" title="搜索" @click="onSearch"/>
+        <CusButton type="main" title="重置" @click="onReset"/>
+        <CusButton type="main" title="新增" style="margin-left: auto" @click="onAdd"/>
+      </CusForm>
+    </div>
+    <div class="__cus-manage_content-main" v-loading="state.query.loading">
+      <CusTable
+        :page-num="state.query.page.pageNum"
+        :page-size="state.query.page.pageSize"
+        :total="state.query.result.total"
+        :data="state.query.result.data"
+        :table-head="state.query.tableHead"
+        @handlePage="onPage"
+      >
+        <template #shareMethod-column-value="{scope}">
+          {{DictionaryStore.gxMethodMap.get(scope.row.shareMethod)}}
+        </template>
+        <template #do-column-value="{scope}">
+          <CusButton type="table-edit" @click="onEdit(scope.row)"/>
+          <CusButton type="table-del" @click="onDel(scope.row)"/>
+          <CusButton type="table-edit" title="配置" icon="text" @click="onPassword(scope.row)"/>
+          <CusButton type="table" icon="relation" title="索引构成"  @click="onRole(scope.row)"/>
+        </template>
+      </CusTable>
+    </div>
+    <DetailCom v-model:show="state.detail.show" :transfer="state.detail.transfer" @refresh="onSearch"/>
   </div>
 </template>
 
 <script setup lang="ts">
-import {getCurrentInstance, reactive} from "vue";
+import {getCurrentInstance, onMounted, reactive} from "vue";
+import {ElMessage} from "element-plus";
+import DetailCom from "./detail.vue";
+import {useDictionaryStore} from "@/stores";
 
 const {proxy} = getCurrentInstance()
-const state: any = reactive({})
+const DictionaryStore = useDictionaryStore()
+const state: any = reactive({
+  query: {
+    loading: false,
+    page: {
+      pageNum: 1,
+      pageSize: 10
+    },
+    tableHead: [
+      {value: "indexName", label: "主题名称", fixed: 'left'},
+      {value: "indexName", label: "类别"},
+      {value: "dataSource", label: "状态"},
+      {value: "dataSource", label: "请求URL示例",width: 200, popover: true},
+      {value: "createTime", label: "创建时间", width: 200},
+      {value: "indexName", label: "创建人"},
+      {value: "updateTime", label: "最后修改时间", width: 200},
+      {value: "updateTime", label: "最后修改人"},
+      {value: "do", label: "操作", width: 320, fixed: 'right'},
+    ],
+    form: {},
+    formReal: {},
+    result: {
+      total: 0,
+      data: [{}]
+    }
+  },
+  detail: {
+    show: false,
+    transfer: {}
+  },
+  password: {
+    show: false,
+    transfer: {}
+  },
+  role: {
+    show: false,
+    transfer: {}
+  },
+})
+const onPage = (pageNum, pageSize) => {
+  state.query.page = {
+    pageNum: pageNum,
+    pageSize: pageSize
+  }
+  const params = {
+    page: state.query.page.pageNum,
+    size: state.query.page.pageSize,
+  }
+  if (proxy.$util.isValue(state.query.formReal.keyword)) {
+    params.keyword = state.query.formReal.keyword
+  }
+  // state.query.loading = true
+  // sysIndexFindIndexByPage(proxy.$util.formatGetParam(params)).then(res => {
+  //   if (res.code === 200) {
+  //     state.query.result.total = res.data.totalElements
+  //     state.query.result.data = res.data.content
+  //     state.query.loading = false
+  //   } else {
+  //     ElMessage.error(res.msg)
+  //   }
+  // })
+}
+const onSearch = () => {
+  state.query.formReal = JSON.parse(JSON.stringify(state.query.form))
+  onPage(1, state.query.page.pageSize)
+}
+const onReset = () => {
+  state.query.page = {
+    pageNum: 1,
+    pageSize: 10
+  }
+  state.query.form = {}
+  onSearch()
+}
+const onAdd = () => {
+  state.detail.transfer = {
+    mode: 'add'
+  }
+  state.detail.show = true
+}
+const onEdit = (row) => {
+  state.detail.transfer = {
+    mode: 'edit',
+    id: row.id,
+  }
+  state.detail.show = true
+}
+const onPassword = (row) => {
+  state.password.transfer = {
+    id: row.id,
+  }
+  state.password.show = true
+}
+const onRole = (row) => {
+  state.role.transfer = {
+    id: row.id,
+  }
+  state.role.show = true
+}
+const onDel = (row) => {
+}
+const initDictionary = () => {
+  DictionaryStore.initDict('true_false')
+}
+onMounted(() => {
+  initDictionary()
+  onReset()
+})
 </script>
 
 <style lang="scss" scoped>