Commit 2150d0bacd05f233681f4f5c597afe90536b4904

Authored by fengwotao
1 parent 1d2a03a5

pref:TCP 脚本必填

... ... @@ -79,7 +79,7 @@
79 79 @click="goDeviceProfile(record.deviceProfile.name)"
80 80 style="white-space: normal; height: auto"
81 81 >
82   - {{ record.deviceProfile.name }}
  82 + <span style="color: #377dff">{{ record.deviceProfile.name }}</span>
83 83 </CheckableTag>
84 84 </template>
85 85
... ...
... ... @@ -7,6 +7,7 @@ export const tcpSchemas: FormSchema[] = [
7 7 component: 'Input',
8 8 slot: 'upScriptId',
9 9 colProps: { span: 24 },
  10 + required: true,
10 11 },
11 12 {
12 13 field: 'authScriptId',
... ... @@ -14,6 +15,7 @@ export const tcpSchemas: FormSchema[] = [
14 15 component: 'Input',
15 16 slot: 'authScriptId',
16 17 colProps: { span: 24 },
  18 + required: true,
17 19 },
18 20 ];
19 21
... ...
... ... @@ -111,7 +111,7 @@
111 111 }
112 112 };
113 113
114   - const [register, { getFieldsValue, resetFields, setFieldsValue }] = useForm({
  114 + const [register, { validate, resetFields, setFieldsValue }] = useForm({
115 115 labelWidth: 180,
116 116 schemas: tcpSchemas,
117 117 actionColOptions: {
... ... @@ -171,8 +171,9 @@
171 171 }
172 172 };
173 173
174   - const getFormData = () => {
175   - const values = getFieldsValue();
  174 + const getFormData = async () => {
  175 + const values = await validate();
  176 + if (!values) return;
176 177 return {
177 178 ...values,
178 179 type: 'TCP',
... ...