汪钰 пре 3 година
родитељ
комит
ded66e53c9
1 измењених фајлова са 41 додато и 40 уклоњено
  1. 41 40
      ele-admin-template/src/views/system/dictionary/components/dict-data.vue

+ 41 - 40
ele-admin-template/src/views/system/dictionary/components/dict-data.vue

@@ -5,6 +5,8 @@
       ref="table"
       :columns="columns"
       :datasource="datasource"
+      :need-page="true"
+      :toolkit="[]"
       :selection.sync="selection"
       height="calc(100vh - 265px)"
       full-height="calc(100vh - 116px)"
@@ -12,7 +14,7 @@
       cache-key="systemDictDataTable"
     >
       <!-- 表头工具栏 -->
-      <template v-slot:toolbar>
+      <!-- <template v-slot:toolbar>
         <dict-data-search @search="reload">
           <el-button
             size="small"
@@ -33,7 +35,7 @@
             删除
           </el-button>
         </dict-data-search>
-      </template>
+      </template> -->
       <!-- 操作列 -->
       <template v-slot:action="{ row }">
         <el-link
@@ -58,12 +60,7 @@
       </template>
     </ele-pro-table>
     <!-- 编辑弹窗 -->
-    <dict-data-edit
-      :visible.sync="showEdit"
-      :data="current"
-      :dict-id="dictId"
-      @done="reload"
-    />
+    <dict-edit :visible.sync="showEdit" :id="id" @done="reload" />
   </div>
 </template>
 
@@ -75,13 +72,11 @@
     removeDictionaryData,
     removeDictionaryDataBatch
   } from '@/api/system/dictionary-data';
+  import { listDictionaries, removeDictionary } from '@/api/system/dictionary';
+  import DictEdit from './dict-edit.vue';
 
   export default {
-    components: { DictDataSearch, DictDataEdit },
-    props: {
-      // 字典id
-      dictId: Number
-    },
+    components: { DictDataSearch, DictDataEdit, DictEdit },
     data() {
       return {
         // 表格列配置
@@ -100,30 +95,39 @@
             showOverflowTooltip: true
           },
           {
-            prop: 'dictDataName',
-            label: '字典项名称',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            minWidth: 120
+            prop: 'code',
+            label: '字典编码',
+            showOverflowTooltip: true
           },
           {
-            prop: 'dictDataCode',
-            label: '字典项值',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            minWidth: 110
+            prop: 'name',
+            label: '字典名称',
+
+            showOverflowTooltip: true
           },
+          // {
+          //   prop: 'appType',
+          //   label: '字典类型',
+
+          //   showOverflowTooltip: true,
+          //   minWidth: 110
+          // },
           {
-            prop: 'sortNumber',
-            label: '排序号',
-            sortable: 'custom',
-            showOverflowTooltip: true,
-            width: 90
+            prop: 'appType',
+            label: '应用类型',
+
+            showOverflowTooltip: true
+          },
+          {
+            prop: 'remark',
+            label: '描述',
+
+            showOverflowTooltip: true
           },
           {
             prop: 'createTime',
             label: '创建时间',
-            sortable: 'custom',
+
             showOverflowTooltip: true,
             minWidth: 110,
             formatter: (_row, _column, cellValue) => {
@@ -145,19 +149,15 @@
         // 当前编辑数据
         current: null,
         // 是否显示编辑弹窗
-        showEdit: false
+        showEdit: false,
+        id: ''
       };
     },
+
     methods: {
       /* 表格数据源 */
       datasource({ page, limit, where, order }) {
-        return pageDictionaryData({
-          ...where,
-          ...order,
-          page,
-          limit,
-          dictId: this.dictId
-        });
+        return listDictionaries();
       },
       /* 刷新表格 */
       reload(where) {
@@ -165,6 +165,7 @@
       },
       /* 显示编辑 */
       openEdit(row) {
+        this.id = row.id;
         this.current = row;
         this.showEdit = true;
       },
@@ -209,9 +210,9 @@
     },
     watch: {
       // 监听字典id变化
-      dictId() {
-        this.reload();
-      }
+      // dictId() {
+      //   this.reload();
+      // }
     }
   };
 </script>