Commit 2cc73ce7b8f075ed3f3d579706370b48dc9cb13f
Merge branch 'perf/history-data-query-form' into 'main_dev'
perf: 调整历史数据表单顺序调整 See merge request yunteng/thingskit-front!984
Showing
4 changed files
with
28 additions
and
27 deletions
@@ -99,7 +99,7 @@ | @@ -99,7 +99,7 @@ | ||
99 | size: 'small', | 99 | size: 'small', |
100 | }); | 100 | }); |
101 | 101 | ||
102 | - const getTableList = async (orderBy?: string) => { | 102 | + const getTableList = async (orderBy?: OrderByEnum) => { |
103 | // 表单验证 | 103 | // 表单验证 |
104 | await method.validate(); | 104 | await method.validate(); |
105 | const value = method.getFieldsValue(); | 105 | const value = method.getFieldsValue(); |
@@ -124,9 +124,9 @@ | @@ -124,9 +124,9 @@ | ||
124 | await setColumns(unref(columns)); | 124 | await setColumns(unref(columns)); |
125 | if (sorter.field == 'ts') { | 125 | if (sorter.field == 'ts') { |
126 | if (sorter.order == 'descend') { | 126 | if (sorter.order == 'descend') { |
127 | - getTableList('DESC'); | 127 | + getTableList(OrderByEnum.DESC); |
128 | } else { | 128 | } else { |
129 | - getTableList('ASC'); | 129 | + getTableList(OrderByEnum.ASC); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | }; | 132 | }; |
@@ -5,6 +5,7 @@ import { copyTransFun } from '/@/utils/fnUtils'; | @@ -5,6 +5,7 @@ import { copyTransFun } from '/@/utils/fnUtils'; | ||
5 | import { getDeviceDataKeys } from '/@/api/alarm/position'; | 5 | import { getDeviceDataKeys } from '/@/api/alarm/position'; |
6 | import { deviceProfile } from '/@/api/device/deviceManager'; | 6 | import { deviceProfile } from '/@/api/device/deviceManager'; |
7 | import { EChartsOption } from 'echarts'; | 7 | import { EChartsOption } from 'echarts'; |
8 | +import { OrderByEnum, OrderByNameEnum, SchemaFiled } from './cpns/TimePeriodForm/config'; | ||
8 | 9 | ||
9 | export enum AggregateDataEnum { | 10 | export enum AggregateDataEnum { |
10 | MIN = 'MIN', | 11 | MIN = 'MIN', |
@@ -487,6 +488,18 @@ export const selectDeviceAttrSchema: FormSchema[] = [ | @@ -487,6 +488,18 @@ export const selectDeviceAttrSchema: FormSchema[] = [ | ||
487 | getPopupContainer: () => document.body, | 488 | getPopupContainer: () => document.body, |
488 | }, | 489 | }, |
489 | }, | 490 | }, |
491 | + { | ||
492 | + field: SchemaFiled.ORDER_BY, | ||
493 | + label: '数据排序', | ||
494 | + component: 'Select', | ||
495 | + defaultValue: OrderByEnum.ASC, | ||
496 | + componentProps: { | ||
497 | + options: Object.values(OrderByEnum).map((value) => ({ | ||
498 | + value, | ||
499 | + label: OrderByNameEnum[value], | ||
500 | + })), | ||
501 | + }, | ||
502 | + }, | ||
490 | ]; | 503 | ]; |
491 | 504 | ||
492 | export const eChartOptions = (series: EChartsOption['series'], keys: string[]): EChartsOption => { | 505 | export const eChartOptions = (series: EChartsOption['series'], keys: string[]): EChartsOption => { |
@@ -41,18 +41,6 @@ export enum AggregateDataEnum { | @@ -41,18 +41,6 @@ export enum AggregateDataEnum { | ||
41 | } | 41 | } |
42 | export const defaultSchemas: FormSchema[] = [ | 42 | export const defaultSchemas: FormSchema[] = [ |
43 | { | 43 | { |
44 | - field: SchemaFiled.ORDER_BY, | ||
45 | - label: '数据排序', | ||
46 | - component: 'Select', | ||
47 | - defaultValue: OrderByEnum.ASC, | ||
48 | - componentProps: { | ||
49 | - options: Object.values(OrderByEnum).map((value) => ({ | ||
50 | - value, | ||
51 | - label: OrderByNameEnum[value], | ||
52 | - })), | ||
53 | - }, | ||
54 | - }, | ||
55 | - { | ||
56 | field: SchemaFiled.WAY, | 44 | field: SchemaFiled.WAY, |
57 | label: '查询方式', | 45 | label: '查询方式', |
58 | component: 'RadioGroup', | 46 | component: 'RadioGroup', |
@@ -39,18 +39,6 @@ export enum AggregateDataEnum { | @@ -39,18 +39,6 @@ export enum AggregateDataEnum { | ||
39 | export const formSchema = (): FormSchema[] => { | 39 | export const formSchema = (): FormSchema[] => { |
40 | return [ | 40 | return [ |
41 | { | 41 | { |
42 | - field: SchemaFiled.ORDER_BY, | ||
43 | - label: '数据排序', | ||
44 | - component: 'Select', | ||
45 | - defaultValue: OrderByEnum.ASC, | ||
46 | - componentProps: { | ||
47 | - options: Object.values(OrderByEnum).map((value) => ({ | ||
48 | - value, | ||
49 | - label: OrderByNameEnum[value], | ||
50 | - })), | ||
51 | - }, | ||
52 | - }, | ||
53 | - { | ||
54 | field: SchemaFiled.DEVICE_ID, | 42 | field: SchemaFiled.DEVICE_ID, |
55 | label: '设备名称', | 43 | label: '设备名称', |
56 | component: 'Select', | 44 | component: 'Select', |
@@ -213,6 +201,18 @@ export const formSchema = (): FormSchema[] => { | @@ -213,6 +201,18 @@ export const formSchema = (): FormSchema[] => { | ||
213 | getPopupContainer: () => document.body, | 201 | getPopupContainer: () => document.body, |
214 | }, | 202 | }, |
215 | }, | 203 | }, |
204 | + { | ||
205 | + field: SchemaFiled.ORDER_BY, | ||
206 | + label: '数据排序', | ||
207 | + component: 'Select', | ||
208 | + defaultValue: OrderByEnum.ASC, | ||
209 | + componentProps: { | ||
210 | + options: Object.values(OrderByEnum).map((value) => ({ | ||
211 | + value, | ||
212 | + label: OrderByNameEnum[value], | ||
213 | + })), | ||
214 | + }, | ||
215 | + }, | ||
216 | ]; | 216 | ]; |
217 | }; | 217 | }; |
218 | 218 |