|
@@ -14,6 +14,7 @@ import {
|
|
|
getProtocolStandardParam,
|
|
|
updateProtocolParam,
|
|
|
} from '@/api';
|
|
|
+import { getTablePageSorts } from '@/utils';
|
|
|
import { DictCode, ProtocolRecognitionResult, ProtocolType } from '@/constants';
|
|
|
|
|
|
import CustomParams from './CustomParams.vue';
|
|
@@ -22,12 +23,11 @@ import SelectStandardParams from './SelectStandardParams.vue';
|
|
|
|
|
|
import type { FormInstance, TableProps } from 'ant-design-vue';
|
|
|
import type { DefaultOptionType, SelectValue } from 'ant-design-vue/es/select';
|
|
|
-import type { Key, SorterResult } from 'ant-design-vue/es/table/interface';
|
|
|
+import type { Key } from 'ant-design-vue/es/table/interface';
|
|
|
import type {
|
|
|
CheckedType,
|
|
|
FormRules,
|
|
|
PageParams,
|
|
|
- PageSorts,
|
|
|
ProtocolBaseInfo,
|
|
|
ProtocolCandidateResult,
|
|
|
ProtocolParamInfo,
|
|
@@ -263,31 +263,7 @@ const handleParamTableChange: TableProps['onChange'] = (pagination, filters, sor
|
|
|
recognizeResult = (filters.recognizeResult as string[] | null) || [];
|
|
|
pageParams.value.pageIndex = pagination.current || 1;
|
|
|
pageParams.value.pageSize = pagination.pageSize || 10;
|
|
|
-
|
|
|
- let sorts: SorterResult[];
|
|
|
-
|
|
|
- if (Array.isArray(sorter)) {
|
|
|
- sorts = sorter;
|
|
|
- } else {
|
|
|
- sorts = [sorter];
|
|
|
- }
|
|
|
-
|
|
|
- sorts = sorts.filter((item) => item.field !== undefined && item.order !== undefined);
|
|
|
-
|
|
|
- if (sorts.length) {
|
|
|
- pageParams.value.pageSorts = sorts.map<PageSorts>((item) => ({
|
|
|
- column: item.field as string,
|
|
|
- asc: item.order === 'ascend',
|
|
|
- }));
|
|
|
- } else {
|
|
|
- pageParams.value.pageSorts = [
|
|
|
- {
|
|
|
- column: 'id',
|
|
|
- asc: true,
|
|
|
- },
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
+ pageParams.value.pageSorts = getTablePageSorts(sorter);
|
|
|
selectedParamIds.value = [];
|
|
|
getCurrentProtocolParams();
|
|
|
};
|