Commit d43b242da6d453f39ef345784ee6e50e0b68b17b

Authored by xp.Huang
2 parents 3378ef5b 8728b6b9

Merge branch 'ww' into 'main'

fix: date range picker && rename max value && data board list not request on reset

See merge request huang/yun-teng-iot-front!323
... ... @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = /
14 14 # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]]
15 15 # 线上测试环境
16 16 # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]]
17   -# VITE_PROXY = [["/api","https://dev.thingskit.com/api"],["/thingskit-drawio","http://localhost:3000/"]]
  17 +VITE_PROXY = [["/api","https://dev.thingskit.com/api"],["/thingskit-drawio","http://localhost:3000/"]]
18 18 # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]]
19   -VITE_PROXY = [["/api","http://192.168.10.111:8080/api"],["/thingskit-drawio","http://192.168.10.106:8080/api"]]
  19 +# VITE_PROXY = [["/api","http://192.168.10.111:8080/api"],["/thingskit-drawio","http://192.168.10.106:8080/api"]]
20 20
21 21 # 实时数据的ws地址
22 22 # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token=
... ...
... ... @@ -148,7 +148,7 @@ export const defaultSchemas: FormSchema[] = [
148 148 },
149 149 {
150 150 field: SchemaFiled.LIMIT,
151   - label: '最大',
  151 + label: '最大条数',
152 152 component: 'InputNumber',
153 153 // defaultValue: 7,
154 154 ifShow({ values }) {
... ...
... ... @@ -91,7 +91,9 @@
91 91 gutter: 10,
92 92 },
93 93 labelWidth: 120,
94   - fieldMapToTime: [[SchemaFiled.DATE_RANGE, [SchemaFiled.START_TS, SchemaFiled.END_TS]]],
  94 + fieldMapToTime: [
  95 + [SchemaFiled.DATE_RANGE, [SchemaFiled.START_TS, SchemaFiled.END_TS], 'YYYY-MM-DD HH:ss'],
  96 + ],
95 97 submitButtonOptions: {
96 98 loading: loading as unknown as boolean,
97 99 },
... ... @@ -100,7 +102,6 @@
100 102 await method.validate();
101 103 const value = method.getFieldsValue();
102 104 const searchParams = getSearchParams(value);
103   -
104 105 if (!hasDeviceAttr()) return;
105 106 // 发送请求
106 107 loading.value = true;
... ...
  1 +import moment from 'moment';
1 2 import { Moment } from 'moment';
2 3 import { getDeviceAttributes } from '/@/api/dataBoard';
3 4 import { FormSchema } from '/@/components/Form';
... ... @@ -107,7 +108,9 @@ export const formSchema: FormSchema[] = [
107 108 const { setFieldsValue } = formActionType;
108 109 let dates: Moment[] = [];
109 110 return {
110   - showTime: true,
  111 + showTime: {
  112 + defaultValue: [moment('00:00:00', 'HH:mm:ss'), moment('23:59:59', 'HH:mm:ss')],
  113 + },
111 114 onCalendarChange(value: Moment[]) {
112 115 dates = value;
113 116 },
... ... @@ -167,7 +170,7 @@ export const formSchema: FormSchema[] = [
167 170 },
168 171 {
169 172 field: SchemaFiled.LIMIT,
170   - label: '最大',
  173 + label: '最大条数',
171 174 component: 'InputNumber',
172 175 // defaultValue: 7,
173 176 ifShow({ values }) {
... ...
... ... @@ -40,6 +40,12 @@
40 40 },
41 41 submitFunc: async () => {
42 42 try {
  43 + const params = searchFormMethod.getFieldsValue();
  44 + await getDatasource(params);
  45 + } catch (error) {}
  46 + },
  47 + resetFunc: async () => {
  48 + try {
43 49 await getDatasource();
44 50 } catch (error) {}
45 51 },
... ... @@ -101,10 +107,9 @@
101 107 return basicMenu;
102 108 });
103 109
104   - const getDatasource = async () => {
  110 + const getDatasource = async (params: Recordable = {}) => {
105 111 try {
106 112 loading.value = true;
107   - const params = searchFormMethod.getFieldsValue() || {};
108 113 const { total, items } = await getDataBoardList({
109 114 page: unref(paginationProp).current,
110 115 pageSize: unref(paginationProp).pageSize,
... ...