Просмотр исходного кода

!392 1,修改字典页面,类型分页接口引用问题
Merge pull request !392 from 适可而止/next

zuohuaijun 3 лет назад
Родитель
Сommit
690706fd27

+ 1 - 1
Vben2/src/views/sys/admin/dict/dictdata/dictData.data.ts

@@ -79,7 +79,7 @@ export const formSchema: FormSchema[] = [
     field: 'order',
     label: '排序',
     required: true,
-    component: 'Input',
+    component: 'InputNumber',
   },
   {
     label: '备注',

+ 21 - 19
Vben2/src/views/sys/admin/dict/dictdata/index.vue

@@ -10,25 +10,27 @@
       <template #toolbar>
         <a-button type="primary" @click="handleCreate"> 新增值 </a-button>
       </template>
-      <template #action="{ record }">
-        <TableAction
-          :actions="[
-            {
-              icon: 'clarity:note-edit-line',
-              onClick: handleEdit.bind(null, record),
-              label: '编辑',
-            },
-            {
-              icon: 'ant-design:delete-outlined',
-              color: 'error',
-              label: '删除',
-              popConfirm: {
-                title: '是否确认删除',
-                confirm: handleDelete.bind(null, record),
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.key === 'action'">
+          <TableAction
+            :actions="[
+              {
+                icon: 'clarity:note-edit-line',
+                onClick: handleEdit.bind(null, record),
+                label: '编辑',
               },
-            },
-          ]"
-        />
+              {
+                icon: 'ant-design:delete-outlined',
+                color: 'error',
+                label: '删除',
+                popConfirm: {
+                  title: '是否确认删除',
+                  confirm: handleDelete.bind(null, record),
+                },
+              },
+            ]"
+          />
+        </template>
       </template>
     </BasicTable>
   </BasicModal>
@@ -72,7 +74,7 @@
           width: 150,
           title: '操作',
           dataIndex: 'action',
-          slots: { customRender: 'action' },
+          //slots: { customRender: 'action' },
           fixed: undefined,
         },
         size: 'small',

+ 28 - 26
Vben2/src/views/sys/admin/dict/index.vue

@@ -4,30 +4,32 @@
       <template #toolbar>
         <a-button type="primary" @click="handleCreate"> 新增类型 </a-button>
       </template>
-      <template #action="{ record }">
-        <TableAction
-          :actions="[
-            {
-              icon: 'clarity:note-edit-line',
-              onClick: handleEdit.bind(null, record),
-              label: '编辑',
-            },
-            {
-              icon: 'arcticons:colordict',
-              label: '字典',
-              onClick: handleDictData.bind(null, record),
-            },
-            {
-              icon: 'ant-design:delete-outlined',
-              color: 'error',
-              label: '删除',
-              popConfirm: {
-                title: '是否确认删除',
-                confirm: handleDelete.bind(null, record),
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.key === 'action'">
+          <TableAction
+            :actions="[
+              {
+                icon: 'clarity:note-edit-line',
+                onClick: handleEdit.bind(null, record),
+                label: '编辑',
               },
-            },
-          ]"
-        />
+              {
+                icon: 'arcticons:colordict',
+                label: '字典',
+                onClick: handleDictData.bind(null, record),
+              },
+              {
+                icon: 'ant-design:delete-outlined',
+                color: 'error',
+                label: '删除',
+                popConfirm: {
+                  title: '是否确认删除',
+                  confirm: handleDelete.bind(null, record),
+                },
+              },
+            ]"
+          />
+        </template>
       </template>
     </BasicTable>
     <DcitModal @register="registerModal" @success="handleSuccess" />
@@ -38,7 +40,7 @@
   import { defineComponent } from 'vue';
   import { BasicTable, useTable, TableAction } from '/@/components/Table';
   import { columns, searchFormSchema } from './dict.data';
-  import { getDictTypeList, deleteDictType } from '/@/api/sys/admin';
+  import { getDictTypePageList, deleteDictType } from '/@/api/sys/admin';
   import { useModal } from '/@/components/Modal';
   import DcitModal from './DictModal.vue';
   import DcitDataModal from './dictdata/index.vue';
@@ -50,7 +52,7 @@
       const [registerDictDataModal, { openModal: openDictDataModal }] = useModal();
       const [registerTable, { reload }] = useTable({
         title: '字典列表',
-        api: getDictTypeList,
+        api: getDictTypePageList,
         columns: columns,
         formConfig: {
           labelWidth: 120,
@@ -68,7 +70,7 @@
           width: 250,
           title: '操作',
           dataIndex: 'action',
-          slots: { customRender: 'action' },
+          // slots: { customRender: 'action' },
           fixed: undefined,
         },
       });