|
@@ -10,7 +10,11 @@ import { get } from 'lodash-es';
|
|
|
* @param deviceOptions 用于初始化设备下拉框
|
|
|
* @returns
|
|
|
*/
|
|
|
-export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[]) => FormSchema[] = (dictOptions: any[], deviceOptions: any[]) => {
|
|
|
+export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[], onDeviceChange?: Function) => FormSchema[] = (
|
|
|
+ dictOptions: any[],
|
|
|
+ deviceOptions: any[],
|
|
|
+ onDeviceChange?: Function
|
|
|
+) => {
|
|
|
const device = get(deviceOptions, '[0].value', '');
|
|
|
const dictcode = get(dictOptions, '[0].value', '');
|
|
|
const isRedis = get(deviceOptions, '[0].stationtype', 'redis') === 'redis';
|
|
@@ -50,16 +54,12 @@ export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[]) => Fo
|
|
|
field: 'gdeviceids',
|
|
|
component: 'Select',
|
|
|
required: true,
|
|
|
- defaultValue: isRedis ? device : [device],
|
|
|
+ defaultValue: VENT_PARAM.historyIsMultiple ? [device] : device,
|
|
|
componentProps: {
|
|
|
options: deviceOptions,
|
|
|
- // onChange: (e, option) => {
|
|
|
- mode: isRedis ? undefined : 'multiple',
|
|
|
+ mode: VENT_PARAM.historyIsMultiple ? 'multiple' : undefined,
|
|
|
maxTagCount: 'responsive',
|
|
|
- // nextTick(async () => {
|
|
|
- // await getDataSource();
|
|
|
- // });
|
|
|
- // },
|
|
|
+ onChange: onDeviceChange,
|
|
|
},
|
|
|
colProps: {
|
|
|
span: 6,
|