Commit dbc34653ef7cf44dc36fdbbdc12ef63e3f75e250

Authored by fengtao
1 parent 822bee42

fix:修复场景联动,编辑,然后设备回显问题

... ... @@ -11,7 +11,7 @@
11 11 >
12 12 <div class="step-form-form">
13 13 <a-steps :current="current">
14   - <a-step title="选择转换方式" />
  14 + <a-step title="选择流转方式" />
15 15 <a-step title="完善配置参数" />
16 16 </a-steps>
17 17 </div>
... ... @@ -70,7 +70,7 @@
70 70 const refTransferConfigMode = ref(null);
71 71 const getModeSelectVal = ref({});
72 72 const isUpdate = ref(true);
73   - const getTitle = computed(() => (!unref(isUpdate) ? '新增转换配置' : '编辑数据转换'));
  73 + const getTitle = computed(() => (!unref(isUpdate) ? '新增流转配置' : '编辑数据流转'));
74 74 const current = ref(0);
75 75 const editPostId = ref('');
76 76 const editType = reactive({
... ... @@ -200,14 +200,14 @@
200 200 if (!unref(isUpdate)) {
201 201 await addOrEditFunc();
202 202 await postAddConvertApi(allPostForm);
203   - createMessage.success('数据转换新增成功');
  203 + createMessage.success('数据流转新增成功');
204 204 emit('success');
205 205 defineClearFunc();
206 206 closeModal();
207 207 } else {
208 208 await addOrEditFunc();
209 209 await postAddConvertApi(allPostForm);
210   - createMessage.success('数据转换编辑成功');
  210 + createMessage.success('数据流转编辑成功');
211 211 emit('success');
212 212 defineClearFunc();
213 213 closeModal();
... ...
... ... @@ -4,7 +4,7 @@ import { Tag } from 'ant-design-vue';
4 4
5 5 export const columns: BasicColumn[] = [
6 6 {
7   - title: '数据转换名称',
  7 + title: '数据流转名称',
8 8 dataIndex: 'name',
9 9 width: 200,
10 10 },
... ...
... ... @@ -127,6 +127,7 @@ export const modeKafkaForm: FormSchema[] = [
127 127 } else {
128 128 if (values.name != undefined) {
129 129 isExistDataManagerNameApi({
  130 + id: '',
130 131 name: value,
131 132 type:
132 133 typeValue.value == ''
... ... @@ -152,7 +153,7 @@ export const modeKafkaForm: FormSchema[] = [
152 153 },
153 154 {
154 155 field: 'topicPattern',
155   - label: 'Topic',
  156 + label: '消息次数',
156 157 colProps: { span: 12 },
157 158 required: true,
158 159 component: 'Input',
... ... @@ -164,7 +165,7 @@ export const modeKafkaForm: FormSchema[] = [
164 165 },
165 166 {
166 167 field: 'bootstrapServers',
167   - label: 'Bootstrap',
  168 + label: '服务器',
168 169 colProps: { span: 12 },
169 170 component: 'Input',
170 171 defaultValue: 'localhost:9092',
... ... @@ -176,7 +177,7 @@ export const modeKafkaForm: FormSchema[] = [
176 177 },
177 178 {
178 179 field: 'retries',
179   - label: 'Retries',
  180 + label: '重连次数',
180 181 colProps: { span: 12 },
181 182 component: 'InputNumber',
182 183 defaultValue: 0,
... ... @@ -187,7 +188,7 @@ export const modeKafkaForm: FormSchema[] = [
187 188 },
188 189 {
189 190 field: 'batchSize',
190   - label: 'BatchSize',
  191 + label: '生产者并发',
191 192 colProps: { span: 12 },
192 193 component: 'InputNumber',
193 194 defaultValue: 16384,
... ... @@ -198,7 +199,7 @@ export const modeKafkaForm: FormSchema[] = [
198 199 },
199 200 {
200 201 field: 'linger',
201   - label: 'Linger',
  202 + label: '缓存时间',
202 203 colProps: { span: 12 },
203 204 component: 'InputNumber',
204 205 defaultValue: 0,
... ... @@ -209,7 +210,7 @@ export const modeKafkaForm: FormSchema[] = [
209 210 },
210 211 {
211 212 field: 'bufferMemory',
212   - label: 'BufferMemory',
  213 + label: '最大缓存',
213 214 colProps: { span: 12 },
214 215 component: 'InputNumber',
215 216 defaultValue: 33554432,
... ... @@ -221,7 +222,7 @@ export const modeKafkaForm: FormSchema[] = [
221 222 {
222 223 field: 'acks',
223 224 component: 'Select',
224   - label: 'Acks',
  225 + label: '响应码',
225 226 colProps: { span: 12 },
226 227 defaultValue: '-1',
227 228 componentProps: {
... ... @@ -236,7 +237,7 @@ export const modeKafkaForm: FormSchema[] = [
236 237 },
237 238 {
238 239 field: 'keySerializer',
239   - label: 'Key',
  240 + label: '键序列化',
240 241 colProps: { span: 12 },
241 242 required: true,
242 243 component: 'Input',
... ... @@ -248,7 +249,7 @@ export const modeKafkaForm: FormSchema[] = [
248 249 },
249 250 {
250 251 field: 'valueSerializer',
251   - label: 'Value',
  252 + label: '值序列化',
252 253 colProps: { span: 12 },
253 254 required: true,
254 255 component: 'Input',
... ... @@ -270,7 +271,7 @@ export const modeKafkaForm: FormSchema[] = [
270 271 label: '选择',
271 272 colProps: { span: 12 },
272 273 component: 'Checkbox',
273   - renderComponentContent: 'Add Message metadata key-value pairs to Kafka record headers',
  274 + renderComponentContent: '将消息的元数据以键值对的方式添加到Kafka消息头中',
274 275 },
275 276 {
276 277 field: 'kafkaHeadersCharset',
... ...
... ... @@ -114,6 +114,7 @@
114 114 const otherPropertiesValues = reactive({
115 115 otherProperties: {},
116 116 });
  117 + const clearName = ref('');
117 118
118 119 const [register, { validate, setFieldsValue, resetFields: defineClearFunc, clearValidate }] =
119 120 useForm({
... ... @@ -144,6 +145,7 @@
144 145 };
145 146
146 147 const setStepTwoFieldsValueFunc = async (v, v1) => {
  148 + clearName.value = v1;
147 149 setFieldsValue(v);
148 150 vType.value = v1;
149 151 setFieldsValue({
... ... @@ -222,7 +224,7 @@
222 224 .root {
223 225 width: 47.55vw;
224 226 border: 1px solid #d9d9d9;
225   - display: flex;
  227 + // display: flex;
226 228 margin-top: 1vh;
227 229 margin-left: 1.5vw;
228 230 border-radius: 8px;
... ...
... ... @@ -7,7 +7,7 @@
7 7 :rowSelection="{ type: 'checkbox' }"
8 8 >
9 9 <template #toolbar>
10   - <a-button type="primary" @click="handleAdd"> 添加转换 </a-button>
  10 + <a-button type="primary" @click="handleAdd"> 添加流转 </a-button>
11 11 <a-button
12 12 :disabled="disabledStatus1"
13 13 @click="handleDelete"
... ... @@ -174,11 +174,11 @@
174 174 }
175 175 const res = await isEnableOrDisableApi(enableObj as never);
176 176 if (res !== '') {
177   - createMessage.success('转换配置启用成功');
  177 + createMessage.success('流转配置启用成功');
178 178 setLoading(false);
179 179 reload();
180 180 } else {
181   - createMessage.error('转换配置启用失败');
  181 + createMessage.error('流转配置启用失败');
182 182 }
183 183 } catch (e) {
184 184 return e;
... ... @@ -197,11 +197,11 @@
197 197 }
198 198 const res = await isEnableOrDisableApi(enableObj as never);
199 199 if (res !== '') {
200   - createMessage.success('转换配置禁用成功');
  200 + createMessage.success('流转配置禁用成功');
201 201 setLoading(false);
202 202 reload();
203 203 } else {
204   - createMessage.error('转换配置禁用失败');
  204 + createMessage.error('流转配置禁用失败');
205 205 }
206 206 } catch (e) {
207 207 } finally {
... ... @@ -282,11 +282,11 @@
282 282 });
283 283 const res = await isEnableOrDisableApi(enableObj as never);
284 284 if (res !== '') {
285   - createMessage.success('转换配置多项禁用成功');
  285 + createMessage.success('流转配置多项禁用成功');
286 286 setLoading(false);
287 287 reload();
288 288 } else {
289   - createMessage.error('转换配置多项禁用失败');
  289 + createMessage.error('流转配置多项禁用失败');
290 290 }
291 291 } catch (e) {
292 292 return e;
... ... @@ -309,11 +309,11 @@
309 309 });
310 310 const res = await isEnableOrDisableApi(enableObj as never);
311 311 if (res !== '') {
312   - createMessage.success('转换配置多项启用成功');
  312 + createMessage.success('流转配置多项启用成功');
313 313 setLoading(false);
314 314 reload();
315 315 } else {
316   - createMessage.error('转换配置多项启用失败');
  316 + createMessage.error('流转配置多项启用失败');
317 317 }
318 318 } catch (e) {
319 319 return e;
... ...
... ... @@ -25,6 +25,7 @@
25 25
26 26 setup(props) {
27 27 const fieldValue: any = ref({});
  28 + const option = ref<[]>([]);
28 29 const [registerCondition, { setFieldsValue, getFieldsValue, updateSchema, resetFields }] =
29 30 useForm({
30 31 labelWidth: 100,
... ... @@ -39,19 +40,40 @@
39 40 resetFields();
40 41 };
41 42 const updateFieldDeviceId = (v) => {
42   - const option = v;
43   - setTimeout(() => {
  43 + if (v.length == 0 || v.length > 0) {
  44 + option.value = v;
44 45 updateSchema({
45 46 field: 'entityId',
46 47 componentProps: {
47   - options: option,
  48 + options: option.value,
48 49 onChange(e) {
49   - updateFieldType2Func(e);
  50 + if (e) {
  51 + setTimeout(() => {
  52 + updateFieldType2Func(e);
  53 + }, 10);
  54 + }
50 55 },
51 56 },
52 57 });
53   - }, 10);
  58 + } else if (v.length == undefined) {
  59 + setTimeout(() => {
  60 + updateSchema({
  61 + field: 'entityId',
  62 + componentProps: {
  63 + options: v.item,
  64 + onChange(e) {
  65 + if (e) {
  66 + setTimeout(() => {
  67 + updateFieldType2Func(e);
  68 + }, 10);
  69 + }
  70 + },
  71 + },
  72 + });
  73 + }, 10);
  74 + }
54 75 };
  76 +
55 77 const updateFieldType2Func = async (e) => {
56 78 const data1 = await screenLinkPageByDeviceIdGetAttribut('DEVICE', e);
57 79 const data = data1.map((m) => {
... ...
... ... @@ -24,6 +24,7 @@
24 24
25 25 setup(props) {
26 26 const fieldValue: any = ref({});
  27 + const option = ref<[]>([]);
27 28 const [registerAction, { setFieldsValue, getFieldsValue, resetFields, updateSchema }] =
28 29 useForm({
29 30 labelWidth: 100,
... ... @@ -38,14 +39,24 @@
38 39 resetFields();
39 40 };
40 41 const updateFieldDeviceId = (v) => {
41   - setTimeout(() => {
  42 + if (v.length == 0 || v.length > 0) {
  43 + option.value = v;
42 44 updateSchema({
43 45 field: 'deviceId',
44 46 componentProps: {
45   - options: v,
  47 + options: option.value,
46 48 },
47 49 });
48   - }, 10);
  50 + } else if (v.length == undefined) {
  51 + setTimeout(() => {
  52 + updateSchema({
  53 + field: 'deviceId',
  54 + componentProps: {
  55 + options: v.item,
  56 + },
  57 + });
  58 + }, 10);
  59 + }
49 60 };
50 61
51 62 //回显数据
... ...
... ... @@ -26,6 +26,8 @@
26 26 props: ['deviceInfo', 'editTriggerFather', 'newFilterMapFather'],
27 27 setup(props) {
28 28 const fieldValue: any = ref({});
  29 + const option = ref<[]>([]);
  30 + const data = ref<[]>([]);
29 31 const [registerTrigger, { resetFields, setFieldsValue, getFieldsValue, updateSchema }] =
30 32 useForm({
31 33 labelWidth: 100,
... ... @@ -37,67 +39,81 @@
37 39 return fieldValue.value;
38 40 };
39 41 const updateFieldDeviceId = (v) => {
40   - const option = v;
41   - console.log(option);
42   - setTimeout(() => {
  42 + if (v.length == 0 || v.length > 0) {
  43 + option.value = v;
43 44 updateSchema({
44 45 field: 'entityId',
45   - componentProps() {
46   - return {
47   - options: option,
48   - onChange(e) {
49   - updateFieldType2Func(e);
50   - },
51   - };
  46 + componentProps: {
  47 + options: option.value,
  48 + onChange(e) {
  49 + if (e) {
  50 + setTimeout(() => {
  51 + updateFieldType2Func(e);
  52 + }, 10);
  53 + }
  54 + },
52 55 },
53 56 });
54   - }, 10);
  57 + } else if (v.length == undefined) {
  58 + setTimeout(() => {
  59 + updateSchema({
  60 + field: 'entityId',
  61 + componentProps: {
  62 + options: v.item,
  63 + onChange(e) {
  64 + if (e) {
  65 + setTimeout(() => {
  66 + updateFieldType2Func(e);
  67 + }, 10);
  68 + }
  69 + },
  70 + },
  71 + });
  72 + }, 10);
  73 + }
55 74 };
56 75
57 76 const updateFieldType2Func = async (e) => {
58 77 const data1 = await screenLinkPageByDeviceIdGetAttribut('DEVICE', e);
59   - const data = data1.map((m) => {
  78 + data.value = data1.map((m) => {
60 79 return {
61 80 label: m,
62 81 value: m,
63 82 };
64 83 });
65   - setTimeout(() => {
66   - updateSchema({
67   - field: 'type2',
68   - componentProps() {
69   - return {
70   - placeholder: '请选择属性',
71   - options: data,
72   - onChange(e) {
73   - if (e) {
74   - updateSchema([
75   - {
76   - field: 'operation',
77   - ifShow: true,
78   - },
79   - {
80   - field: 'value',
81   - ifShow: true,
82   - },
83   - ]);
84   - } else {
85   - updateSchema([
86   - {
87   - field: 'operation',
88   - ifShow: false,
89   - },
90   - {
91   - field: 'value',
92   - ifShow: false,
93   - },
94   - ]);
95   - }
96   - },
97   - };
  84 +
  85 + updateSchema({
  86 + field: 'type2',
  87 + componentProps: {
  88 + placeholder: '请选择属性',
  89 + options: data.value,
  90 + onChange(e) {
  91 + if (e) {
  92 + updateSchema([
  93 + {
  94 + field: 'operation',
  95 + ifShow: true,
  96 + },
  97 + {
  98 + field: 'value',
  99 + ifShow: true,
  100 + },
  101 + ]);
  102 + } else {
  103 + updateSchema([
  104 + {
  105 + field: 'operation',
  106 + ifShow: false,
  107 + },
  108 + {
  109 + field: 'value',
  110 + ifShow: false,
  111 + },
  112 + ]);
  113 + }
98 114 },
99   - });
100   - }, 10);
  115 + },
  116 + });
101 117 };
102 118 const updateOperatorAndValue = () => {
103 119 updateSchema([
... ...
... ... @@ -267,10 +267,8 @@ export const useTriggerDrawerSchema: FormSchema[] = [
267 267 field: 'entityId',
268 268 label: '',
269 269 component: 'Select',
270   - componentProps() {
271   - return {
272   - placeholder: '请选择设备',
273   - };
  270 + componentProps: {
  271 + placeholder: '请选择设备',
274 272 },
275 273 ifShow: ({ values }) =>
276 274 !isTime(Reflect.get(values, 'triggerType')) &&
... ... @@ -311,13 +309,11 @@ export const useTriggerDrawerSchema: FormSchema[] = [
311 309 field: 'type2',
312 310 label: '',
313 311 component: 'Select',
314   - componentProps() {
315   - return {
316   - placeholder: '请选择属性',
317   - onChange(v) {
318   - console.log(v);
319   - },
320   - };
  312 + componentProps: {
  313 + placeholder: '请选择属性',
  314 + onChange(v) {
  315 + console.log(v);
  316 + },
321 317 },
322 318 ifShow: ({ values }) =>
323 319 !isTime(Reflect.get(values, 'triggerType')) &&
... ... @@ -341,6 +337,10 @@ export const useTriggerDrawerSchema: FormSchema[] = [
341 337 ],
342 338 },
343 339 ifShow: ({ values }) => isType2(Reflect.get(values, 'type2')),
  340 + show: ({ values }) =>
  341 + !isTime(Reflect.get(values, 'triggerType')) &&
  342 + !isScene(Reflect.get(values, 'triggerType')) &&
  343 + !isHand(Reflect.get(values, 'triggerType')),
344 344 colProps: { span: 12 },
345 345 },
346 346 {
... ... @@ -353,26 +353,30 @@ export const useTriggerDrawerSchema: FormSchema[] = [
353 353 placeholder: '请输入比较值',
354 354 },
355 355 ifShow: ({ values }) => isType2(Reflect.get(values, 'type2')),
  356 + show: ({ values }) =>
  357 + !isTime(Reflect.get(values, 'triggerType')) &&
  358 + !isScene(Reflect.get(values, 'triggerType')) &&
  359 + !isHand(Reflect.get(values, 'triggerType')),
356 360 colProps: {
357 361 span: 12,
358 362 },
359 363 },
360   - {
361   - field: 'sceneLinkageId',
362   - label: '',
363   - component: 'Select',
364   - colProps: {
365   - span: 12,
366   - },
367   - componentProps: {
368   - placeholder: '请选择场景',
369   - options: [
370   - { label: '场景触发器1', value: '' },
371   - { label: '场景触发器2', value: '' },
372   - ],
373   - },
374   - ifShow: ({ values }) => isScene(Reflect.get(values, 'triggerType')),
375   - },
  364 + // {
  365 + // field: 'sceneLinkageId',
  366 + // label: '',
  367 + // component: 'Select',
  368 + // colProps: {
  369 + // span: 12,
  370 + // },
  371 + // componentProps: {
  372 + // placeholder: '请选择场景',
  373 + // options: [
  374 + // { label: '场景触发器1', value: '' },
  375 + // { label: '场景触发器2', value: '' },
  376 + // ],
  377 + // },
  378 + // ifShow: ({ values }) => isScene(Reflect.get(values, 'triggerType')),
  379 + // },
376 380 ];
377 381
378 382 export const useConditionDrawerSchema: FormSchema[] = [
... ... @@ -509,8 +513,23 @@ export const useActionDrawerSchema: FormSchema[] = [
509 513 label: '',
510 514 componentProps: {
511 515 maxLength: 255,
512   - placeholder:
513   - '请输入下发指定(JSON格式:{"method": "setDOValue","params": {"devID": "492S211218028819","data": {"DO1": 1}})',
  516 + placeholder: '请输入下发指定',
  517 + },
  518 + ifShow: ({ values }) =>
  519 + !isScene(Reflect.get(values, 'outTarget')) && !isMsg(Reflect.get(values, 'outTarget')),
  520 + colProps: {
  521 + span: 12,
  522 + },
  523 + },
  524 + {
  525 + field: 'no',
  526 + component: 'InputTextArea',
  527 + label: '',
  528 + defaultValue:
  529 + '(可复制)下发指定格式(JSON格式:{"method": "setDOValue","params": {"devID": "492S211218028819","data": {"DO1": 1}})',
  530 + componentProps: {
  531 + maxLength: 255,
  532 + disabled: true,
514 533 },
515 534 ifShow: ({ values }) =>
516 535 !isScene(Reflect.get(values, 'outTarget')) && !isMsg(Reflect.get(values, 'outTarget')),
... ...
... ... @@ -252,6 +252,8 @@
252 252 let kongTriggerObj = {};
253 253 let kongConditionObj = {};
254 254 let kongActionObj = {};
  255 + let optionsEditArray = ref<[]>([]);
  256 + const oldOrigzaition = ref('');
255 257
256 258 const [registerForm, { resetFields, setFieldsValue, validateFields }] = useForm({
257 259 labelWidth: 120,
... ... @@ -290,27 +292,27 @@
290 292 addActionPushData.value.length = 0;
291 293 handleClose();
292 294 optionsItemArray.value.length = 0;
  295 + optionsItemArray.value = [];
  296 + optionsEditArray.value = [];
  297 + optionsEditArray.value.length = 0;
293 298 try {
294   - setTimeout(() => {
295   - proxy.$refs.refTriggerChild?.resetFieldsValueFunc();
296   - proxy.$refs.refTriggerChild?.clearSelectDevice();
297   - proxy.$refs.refTriggerChild?.clearSelectAttribute();
298   - proxy.$refs.refConditionChild?.resetFieldsValueFunc();
299   - proxy.$refs.refConditionChild?.clearSelectDevice();
300   - proxy.$refs.refActionChild?.resetFieldsValueFunc();
301   - proxy.$refs.refActionChild?.clearSelectDevice();
302   - clearActionsAllDevice();
303   - resetActionsAllArrayFunc();
304   - }, 10);
305   - } catch (e) {
306   - return e;
307   - }
  299 + proxy.$refs.refTriggerChild?.resetFieldsValueFunc();
  300 + proxy.$refs.refTriggerChild?.clearSelectDevice();
  301 + proxy.$refs.refTriggerChild?.clearSelectAttribute();
  302 + proxy.$refs.refConditionChild?.resetFieldsValueFunc();
  303 + proxy.$refs.refConditionChild?.clearSelectDevice();
  304 + proxy.$refs.refActionChild?.resetFieldsValueFunc();
  305 + proxy.$refs.refActionChild?.clearSelectDevice();
  306 + clearActionsAllDevice();
  307 + resetActionsAllArrayFunc();
  308 + } catch {}
308 309 } catch (e) {
309 310 return e;
310 311 }
311 312 } else {
312 313 try {
313   - emit('success');
  314 + optionsEditArray.value = [];
  315 + optionsEditArray.value.length = 0;
314 316 kongTriggerObj = {};
315 317 kongConditionObj = {};
316 318 kongActionObj = {};
... ... @@ -373,16 +375,18 @@
373 375 }
374 376 });
375 377 });
376   -
377   - optionsItemArray.value = options.items.map((v) => {
  378 + optionsEditArray.value = options.items.map((v) => {
378 379 return {
379 380 value: v.tbDeviceId,
380 381 label: v.name,
381 382 };
382 383 });
383   - proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsItemArray.value);
384   - proxy.$refs.refConditionChild?.updateFieldDeviceId(optionsItemArray.value);
385   - proxy.$refs.refActionChild?.updateFieldDeviceId(optionsItemArray.value);
  384 + setTimeout(() => {
  385 + proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsEditArray.value);
  386 + proxy.$refs.refConditionChild?.updateFieldDeviceId(optionsEditArray.value);
  387 + proxy.$refs.refActionChild?.updateFieldDeviceId(optionsEditArray.value);
  388 + }, 20);
  389 + emit('success');
386 390 } catch (e) {
387 391 return e;
388 392 }
... ... @@ -434,7 +438,9 @@
434 438 return e;
435 439 }
436 440 };
  441 +
437 442 watch(getData, async (newV: string) => {
  443 + oldOrigzaition.value = newV;
438 444 const options = await screenLinkPageByDeptIdGetDevice({ organizationId: newV });
439 445 optionsItemArray.value = options.items.map((v) => {
440 446 return {
... ... @@ -442,23 +448,13 @@
442 448 label: v.name,
443 449 };
444 450 });
445   - // optionsItemArray.value = options.items;
446   - updateDeviceIdFunc(optionsItemArray.value);
447   - proxy.$refs.refActionChild?.updateFieldDeviceId(optionsItemArray.value);
448   - proxy.$refs.refConditionChild?.updateFieldDeviceId(optionsItemArray.value);
449   - proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsItemArray.value);
  451 + setTimeout(() => {
  452 + proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsItemArray.value);
  453 + proxy.$refs.refConditionChild?.updateFieldDeviceId(optionsItemArray.value);
  454 + proxy.$refs.refActionChild?.updateFieldDeviceId(optionsItemArray.value);
  455 + }, 10);
450 456 });
451 457
452   - const updateDeviceIdFunc = (v) => {
453   - try {
454   - proxy.$refs.refTriggerChild?.updateFieldDeviceId(v);
455   - proxy.$refs.refConditionChild?.updateFieldDeviceId(v);
456   - proxy.$refs.refActionChild?.updateFieldDeviceId(v);
457   - } catch (e) {
458   - return e;
459   - }
460   - };
461   -
462 458 //获取触发器方法
463 459 const refTriggerChildDataFunc = () => {
464 460 try {
... ... @@ -503,11 +499,8 @@
503 499 key: m.type2 == null ? 'CO2' : m.type2,
504 500 type: m.type1 == null ? 'TIME_SERIES' : m.type1,
505 501 },
506   - // valueType: m.type2 == null ? 'NUMERIC' : m.type2,
507 502 valueType: 'NUMERIC',
508   - // value: {},
509 503 predicate: {
510   - // type: m.type2 == null ? 'NUMERIC' : m.type2,
511 504 type: 'NUMERIC',
512 505 value: {
513 506 defaultValue: Number(m.value),
... ... @@ -642,44 +635,9 @@
642 635 if (!unref(isUpdate)) {
643 636 refTriggerChildDataFunc();
644 637 unref(addTriggerPushData).push(refTriggerChildData as never);
645   - (addTriggerPushData.value as any) = addTriggerPushData.value.map((m: any) => {
646   - return {
647   - triggerType: m?.triggerType,
648   - entityId: m?.entityId || m?.entityId1,
649   - sceneLinkageId: m?.sceneLinkageId,
650   - triggerCondition: {
651   - condition: [
652   - {
653   - key: {
654   - key: m.type2 == null ? 'CO2' : m.type2,
655   - type: m.type1 == null ? 'TIME_SERIES' : m.type1,
656   - },
657   - // valueType: m.type2 == null ? 'NUMERIC' : m.type2,
658   - valueType: 'NUMERIC',
659   - // value: {},
660   - predicate: {
661   - // type: m.type2 == null ? 'NUMERIC' : m.type2,
662   - type: 'NUMERIC',
663   - value: {
664   - defaultValue: Number(m.value),
665   - },
666   - operation: m.operation == null ? 'EQUAL' : m.operation,
667   - },
668   - },
669   - ],
670   - spec: {
671   - type: 'SIMPLE',
672   - },
673   - },
674   - };
675   - });
676   - try {
677   - setTimeout(() => {
678   - proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsItemArray.value);
679   - }, 10);
680   - } catch (e) {
681   - return e;
682   - }
  638 + setTimeout(() => {
  639 + proxy.$refs.refTriggerChild?.updateFieldDeviceId(optionsItemArray.value);
  640 + }, 20);
683 641 } else {
684 642 isNoChange.value = false;
685 643 unref(editTriggerPushData).push(refTriggerChildData as never);
... ... @@ -693,15 +651,14 @@
693 651 condition: [
694 652 {
695 653 key: {
696   - key: m.key1 == null ? 'CO2' : m.key1,
  654 + key: m.type2 == null ? 'CO2' : m.type2,
697 655 type: m.type1 == null ? 'TIME_SERIES' : m.type1,
698 656 },
699   - valueType: m.type2 == null ? 'NUMERIC' : m.type2,
700   - value: {},
  657 + valueType: 'NUMERIC',
701 658 predicate: {
702   - type: m.type2 == null ? 'NUMERIC' : m.type2,
  659 + type: 'NUMERIC',
703 660 value: {
704   - defaultValue: Number(m.value) == null ? 0 : Number(m.value),
  661 + defaultValue: Number(m.value),
705 662 },
706 663 operation: m.operation == null ? 'EQUAL' : m.operation,
707 664 },
... ... @@ -715,8 +672,11 @@
715 672 });
716 673 try {
717 674 setTimeout(() => {
718   - proxy.$refs.refTriggerChild.updateFieldDeviceId(optionsItemArray.value);
719   - }, 50);
  675 + proxy.$refs.refTriggerChild?.updateFieldDeviceId({
  676 + status: 'edit',
  677 + item: optionsEditArray.value,
  678 + });
  679 + }, 20);
720 680 } catch (e) {
721 681 return e;
722 682 }
... ... @@ -744,38 +704,10 @@
744 704 if (!unref(isUpdate)) {
745 705 refConditionChildDataFunc();
746 706 unref(addConditionPushData).push(refConditionChildData as never);
747   - (addConditionPushData.value as any) = addConditionPushData.value.map((m: any) => {
748   - return {
749   - triggerType: m?.triggerType,
750   - entityId: m?.entityId,
751   - triggerCondition: {
752   - condition: [
753   - {
754   - key: {
755   - key: m.type == null ? 'CO2' : m.type,
756   - type: 'TIME_SERIES',
757   - },
758   - valueType: 'NUMERIC',
759   - // value: {},
760   - predicate: {
761   - type: 'NUMERIC',
762   - value: {
763   - defaultValue: Number(m.value) == null ? 0 : Number(m.value),
764   - },
765   - operation: m.operation,
766   - },
767   - },
768   - ],
769   - spec: {
770   - type: 'SIMPLE',
771   - },
772   - },
773   - };
774   - });
775 707 try {
776 708 setTimeout(() => {
777   - proxy.$refs.refConditionChild.updateFieldDeviceId(optionsItemArray.value);
778   - }, 50);
  709 + proxy.$refs.refConditionChild?.updateFieldDeviceId(optionsItemArray.value);
  710 + }, 20);
779 711 } catch (e) {
780 712 return e;
781 713 }
... ... @@ -792,32 +724,17 @@
792 724 condition: [
793 725 {
794 726 key: {
  727 + key: m.type == null ? 'CO2' : m.type,
795 728 type: 'TIME_SERIES',
796   - key: 'CO2',
797 729 },
798   - valueType:
799   - m.type == 'NUMERIC1'
800   - ? 'NUMERIC'
801   - : m.type == 'NUMERIC2'
802   - ? 'NUMERIC'
803   - : 'NUMERIC',
804   - value: {},
  730 + valueType: 'NUMERIC',
  731 + // value: {},
805 732 predicate: {
806   - type:
807   - m.type == 'NUMERIC1'
808   - ? 'NUMERIC'
809   - : m.type == 'NUMERIC2'
810   - ? 'NUMERIC'
811   - : 'NUMERIC',
  733 + type: 'NUMERIC',
812 734 value: {
813   - defaultValue:
814   - Number(m.value1) == null
815   - ? 0
816   - : Number(m.value1) || Number(m.value2) == null
817   - ? 0
818   - : Number(m.value2),
  735 + defaultValue: Number(m.value) == null ? 0 : Number(m.value),
819 736 },
820   - operation: m.operation1 || m.operatio2,
  737 + operation: m.operation,
821 738 },
822 739 },
823 740 ],
... ... @@ -829,8 +746,11 @@
829 746 });
830 747 try {
831 748 setTimeout(() => {
832   - proxy.$refs.refConditionChild.updateFieldDeviceId(optionsItemArray.value);
833   - }, 50);
  749 + proxy.$refs.refConditionChild?.updateFieldDeviceId({
  750 + status: 'edit',
  751 + item: optionsEditArray.value,
  752 + });
  753 + }, 20);
834 754 } catch (e) {
835 755 return e;
836 756 }
... ... @@ -867,7 +787,7 @@
867 787 try {
868 788 setTimeout(() => {
869 789 proxy.$refs.refActionChild.updateFieldDeviceId(optionsItemArray.value);
870   - }, 50);
  790 + }, 20);
871 791 } catch (e) {
872 792 return e;
873 793 }
... ... @@ -878,8 +798,11 @@
878 798 pushEditActionArray.value.push(refActionChildData);
879 799 try {
880 800 setTimeout(() => {
881   - proxy.$refs.refActionChild.updateFieldDeviceId(optionsItemArray.value);
882   - }, 50);
  801 + proxy.$refs.refActionChild.updateFieldDeviceId({
  802 + status: 'edit',
  803 + item: optionsEditArray.value,
  804 + });
  805 + }, 20);
883 806 } catch (e) {
884 807 return e;
885 808 }
... ... @@ -903,7 +826,6 @@
903 826 };
904 827
905 828 return {
906   - updateDeviceIdFunc,
907 829 handleClose,
908 830 newFilterMap,
909 831 newConditionFilterMap,
... ...