浏览代码

fix(文件模块): 文件列表优化排序、优化存储器查询

shizhongming 2 年之前
父节点
当前提交
7206519e44

+ 13 - 11
src/modules/smart-file/views/SmartFile/SmartFileListView.config.ts

@@ -1,6 +1,8 @@
 import type { SmartColumn, SmartSearchFormSchema } from '@/components/SmartTable';
 import type { FormSchema } from '@/components/Form';
 
+import { listApi } from '../SmartFileStorage/SmartFileStorageListView.api';
+
 /**
  * 表格列表
  */
@@ -158,21 +160,21 @@ export const getSearchFormSchemas = (t: Function): SmartSearchFormSchema[] => {
     {
       field: 'fileStorageId',
       label: t('system.views.file.title.fileStorageId'),
-      component: 'SmartApiSelectTable',
+      component: 'ApiSelect',
       componentProps: {
         style: {
           width: '150px',
         },
-        modelClassName: 'com.smart.file.manager.model.SmartFileStoragePO',
-        valueFieldName: 'id',
-        labelFieldName: 'storageName',
-        params: {
-          sortName: 'seq',
-          parameter: {
-            'deleteYn@<>': true,
-            'useYn@=': true,
-          },
-        },
+        api: () =>
+          listApi({
+            sortName: 'seq',
+            parameter: {
+              'deleteYn@<>': true,
+              'useYn@=': true,
+            },
+          }),
+        labelField: 'storageName',
+        valueField: 'id',
       },
       searchSymbol: '=',
     },

+ 2 - 0
src/modules/smart-file/views/SmartFile/SmartFileListView.vue

@@ -66,6 +66,7 @@
     border: true,
     pagerConfig: true,
     useSearchForm: true,
+    showOverflow: 'tooltip',
     rowConfig: {
       keyField: 'fileId',
       isCurrent: true,
@@ -76,6 +77,7 @@
     columnConfig: {
       resizable: true,
     },
+    sortConfig: { remote: true, defaultSort: { field: 'createTime', order: 'desc' } },
     searchFormConfig: {
       schemas: getSearchFormSchemas(t),
       searchWithSymbol: true,