Commit 825b3beef75784df9913029b3615889097e754ad

Authored by ww
1 parent 3157fb2a

fix: 任务中心运行任务运行全部任务缺失参数

@@ -63,8 +63,9 @@ export const formSchemas: FormSchema[] = [ @@ -63,8 +63,9 @@ export const formSchemas: FormSchema[] = [
63 { 63 {
64 field: FormFieldsEnum.TARGET_IDS, 64 field: FormFieldsEnum.TARGET_IDS,
65 component: 'ApiSelect', 65 component: 'ApiSelect',
66 - label: '定目标设备', 66 + label: '定目标设备',
67 ifShow: ({ model }) => model[FormFieldsEnum.EXECUTE_TARGET_TYPE] === TargetType.ASSIGN, 67 ifShow: ({ model }) => model[FormFieldsEnum.EXECUTE_TARGET_TYPE] === TargetType.ASSIGN,
  68 + rules: [{ required: true, message: '请选择指定目标设备' }],
68 componentProps: ({ formModel }) => { 69 componentProps: ({ formModel }) => {
69 const record = JSON.parse(formModel[FormFieldsEnum.TASK_RECORD]) as TaskRecordType; 70 const record = JSON.parse(formModel[FormFieldsEnum.TASK_RECORD]) as TaskRecordType;
70 const isDevices = record.targetType === TaskTargetEnum.DEVICES; 71 const isDevices = record.targetType === TaskTargetEnum.DEVICES;
@@ -24,7 +24,7 @@ @@ -24,7 +24,7 @@
24 } 24 }
25 }); 25 });
26 26
27 - const [registerForm, { setFieldsValue, getFieldsValue, resetFields }] = useForm({ 27 + const [registerForm, { setFieldsValue, getFieldsValue, resetFields, validate }] = useForm({
28 schemas: formSchemas, 28 schemas: formSchemas,
29 showActionButtonGroup: false, 29 showActionButtonGroup: false,
30 }); 30 });
@@ -37,7 +37,8 @@ @@ -37,7 +37,8 @@
37 ? TaskTargetEnum.DEVICES 37 ? TaskTargetEnum.DEVICES
38 : unref(dataSource)!.targetType, 38 : unref(dataSource)!.targetType,
39 id: unref(dataSource)!.id, 39 id: unref(dataSource)!.id,
40 - targetIds, 40 + targetIds:
  41 + executeTarget === TargetType.ASSIGN ? targetIds : unref(dataSource)?.executeTarget.data,
41 cronExpression: unref(dataSource)!.executeTime.cron, 42 cronExpression: unref(dataSource)!.executeTime.cron,
42 name: unref(dataSource)!.name, 43 name: unref(dataSource)!.name,
43 }; 44 };
@@ -46,6 +47,7 @@ @@ -46,6 +47,7 @@
46 const loading = ref(false); 47 const loading = ref(false);
47 const { createMessage } = useMessage(); 48 const { createMessage } = useMessage();
48 const handleOk = async () => { 49 const handleOk = async () => {
  50 + await validate();
49 const record = getFieldsValue() as FormValue; 51 const record = getFieldsValue() as FormValue;
50 const value = composeData(record); 52 const value = composeData(record);
51 try { 53 try {