Commit d43b242da6d453f39ef345784ee6e50e0b68b17b
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
Showing
5 changed files
with
18 additions
and
9 deletions
| @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = / | @@ -14,9 +14,9 @@ VITE_PUBLIC_PATH = / | ||
| 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
| 15 | # 线上测试环境 | 15 | # 线上测试环境 |
| 16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 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 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] | 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 | # 实时数据的ws地址 | 21 | # 实时数据的ws地址 |
| 22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= | 22 | # VITE_WEB_SOCKET = ws://localhost:8080/api/ws/plugins/telemetry?token= |
| @@ -148,7 +148,7 @@ export const defaultSchemas: FormSchema[] = [ | @@ -148,7 +148,7 @@ export const defaultSchemas: FormSchema[] = [ | ||
| 148 | }, | 148 | }, |
| 149 | { | 149 | { |
| 150 | field: SchemaFiled.LIMIT, | 150 | field: SchemaFiled.LIMIT, |
| 151 | - label: '最大值', | 151 | + label: '最大条数', |
| 152 | component: 'InputNumber', | 152 | component: 'InputNumber', |
| 153 | // defaultValue: 7, | 153 | // defaultValue: 7, |
| 154 | ifShow({ values }) { | 154 | ifShow({ values }) { |
| @@ -91,7 +91,9 @@ | @@ -91,7 +91,9 @@ | ||
| 91 | gutter: 10, | 91 | gutter: 10, |
| 92 | }, | 92 | }, |
| 93 | labelWidth: 120, | 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 | submitButtonOptions: { | 97 | submitButtonOptions: { |
| 96 | loading: loading as unknown as boolean, | 98 | loading: loading as unknown as boolean, |
| 97 | }, | 99 | }, |
| @@ -100,7 +102,6 @@ | @@ -100,7 +102,6 @@ | ||
| 100 | await method.validate(); | 102 | await method.validate(); |
| 101 | const value = method.getFieldsValue(); | 103 | const value = method.getFieldsValue(); |
| 102 | const searchParams = getSearchParams(value); | 104 | const searchParams = getSearchParams(value); |
| 103 | - | ||
| 104 | if (!hasDeviceAttr()) return; | 105 | if (!hasDeviceAttr()) return; |
| 105 | // 发送请求 | 106 | // 发送请求 |
| 106 | loading.value = true; | 107 | loading.value = true; |
| 1 | +import moment from 'moment'; | ||
| 1 | import { Moment } from 'moment'; | 2 | import { Moment } from 'moment'; |
| 2 | import { getDeviceAttributes } from '/@/api/dataBoard'; | 3 | import { getDeviceAttributes } from '/@/api/dataBoard'; |
| 3 | import { FormSchema } from '/@/components/Form'; | 4 | import { FormSchema } from '/@/components/Form'; |
| @@ -107,7 +108,9 @@ export const formSchema: FormSchema[] = [ | @@ -107,7 +108,9 @@ export const formSchema: FormSchema[] = [ | ||
| 107 | const { setFieldsValue } = formActionType; | 108 | const { setFieldsValue } = formActionType; |
| 108 | let dates: Moment[] = []; | 109 | let dates: Moment[] = []; |
| 109 | return { | 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 | onCalendarChange(value: Moment[]) { | 114 | onCalendarChange(value: Moment[]) { |
| 112 | dates = value; | 115 | dates = value; |
| 113 | }, | 116 | }, |
| @@ -167,7 +170,7 @@ export const formSchema: FormSchema[] = [ | @@ -167,7 +170,7 @@ export const formSchema: FormSchema[] = [ | ||
| 167 | }, | 170 | }, |
| 168 | { | 171 | { |
| 169 | field: SchemaFiled.LIMIT, | 172 | field: SchemaFiled.LIMIT, |
| 170 | - label: '最大值', | 173 | + label: '最大条数', |
| 171 | component: 'InputNumber', | 174 | component: 'InputNumber', |
| 172 | // defaultValue: 7, | 175 | // defaultValue: 7, |
| 173 | ifShow({ values }) { | 176 | ifShow({ values }) { |
| @@ -40,6 +40,12 @@ | @@ -40,6 +40,12 @@ | ||
| 40 | }, | 40 | }, |
| 41 | submitFunc: async () => { | 41 | submitFunc: async () => { |
| 42 | try { | 42 | try { |
| 43 | + const params = searchFormMethod.getFieldsValue(); | ||
| 44 | + await getDatasource(params); | ||
| 45 | + } catch (error) {} | ||
| 46 | + }, | ||
| 47 | + resetFunc: async () => { | ||
| 48 | + try { | ||
| 43 | await getDatasource(); | 49 | await getDatasource(); |
| 44 | } catch (error) {} | 50 | } catch (error) {} |
| 45 | }, | 51 | }, |
| @@ -101,10 +107,9 @@ | @@ -101,10 +107,9 @@ | ||
| 101 | return basicMenu; | 107 | return basicMenu; |
| 102 | }); | 108 | }); |
| 103 | 109 | ||
| 104 | - const getDatasource = async () => { | 110 | + const getDatasource = async (params: Recordable = {}) => { |
| 105 | try { | 111 | try { |
| 106 | loading.value = true; | 112 | loading.value = true; |
| 107 | - const params = searchFormMethod.getFieldsValue() || {}; | ||
| 108 | const { total, items } = await getDataBoardList({ | 113 | const { total, items } = await getDataBoardList({ |
| 109 | page: unref(paginationProp).current, | 114 | page: unref(paginationProp).current, |
| 110 | pageSize: unref(paginationProp).pageSize, | 115 | pageSize: unref(paginationProp).pageSize, |