...
|
...
|
@@ -7,94 +7,130 @@ |
7
|
7
|
width="1000px"
|
8
|
8
|
@ok="handleSubmit"
|
9
|
9
|
>
|
10
|
|
- <BasicForm @register="registerForm" />
|
11
|
|
- <!-- 触发器 -->
|
12
|
10
|
<div>
|
13
|
|
- <template v-for="(item, index) in addTriggerPushData" :key="index">
|
14
|
|
- <div>
|
15
|
|
- <AddTriggerForm :deviceInfo="getDeviceInfo" ref="refTriggerChild" />
|
16
|
|
- </div>
|
17
|
|
- <div style="height: 3vh"></div>
|
18
|
|
- </template>
|
19
|
|
- <div
|
20
|
|
- style="
|
21
|
|
- display: flex;
|
22
|
|
- width: 13vw;
|
23
|
|
- height: 4vh;
|
24
|
|
- flex-direction: row;
|
25
|
|
- justify-content: space-between;
|
26
|
|
- "
|
27
|
|
- >
|
28
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
29
|
|
- <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addTrigger"
|
30
|
|
- ><PlusCircleOutlined />新增触发器</Button
|
31
|
|
- >
|
32
|
|
- </div>
|
33
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
34
|
|
- <Button type="error" style="border-radius: 10px" class="mt-5" @click="removeTrigger"
|
35
|
|
- ><PlusCircleOutlined />删除</Button
|
36
|
|
- >
|
|
11
|
+ <BasicForm @register="registerForm" />
|
|
12
|
+ <!-- 触发器 -->
|
|
13
|
+ <div>
|
|
14
|
+ <template
|
|
15
|
+ v-for="(item, index) in isUpdate == false ? addTriggerPushData : editTriggerPushData"
|
|
16
|
+ :key="index"
|
|
17
|
+ >
|
|
18
|
+ <span style="display: none">{{ item + index }}</span>
|
|
19
|
+ <span style="position: relative; top: 3.2vh; left: 0.3vw">触发器{{ index + 1 }}</span>
|
|
20
|
+ <div v-if="isUpdate == true">
|
|
21
|
+ <AddTriggerForm
|
|
22
|
+ :editTriggerFather="item"
|
|
23
|
+ :deviceInfo="getDeviceInfo"
|
|
24
|
+ ref="refTriggerChild"
|
|
25
|
+ />
|
|
26
|
+ </div>
|
|
27
|
+ <div v-if="isUpdate == false">
|
|
28
|
+ <AddTriggerForm :deviceInfo="getDeviceInfo" ref="refTriggerChild" />
|
|
29
|
+ </div>
|
|
30
|
+ <div style="height: 3vh"></div>
|
|
31
|
+ </template>
|
|
32
|
+ <div
|
|
33
|
+ style="
|
|
34
|
+ display: flex;
|
|
35
|
+ width: 11vw;
|
|
36
|
+ height: 4vh;
|
|
37
|
+ flex-direction: row;
|
|
38
|
+ justify-content: space-between;
|
|
39
|
+ "
|
|
40
|
+ >
|
|
41
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
42
|
+ <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addTrigger"
|
|
43
|
+ >新增触发器</Button
|
|
44
|
+ >
|
|
45
|
+ </div>
|
|
46
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
47
|
+ <Button
|
|
48
|
+ type="default"
|
|
49
|
+ style="border-radius: 10px; background-color: rgba(237, 111, 111, 1)"
|
|
50
|
+ class="mt-5"
|
|
51
|
+ @click="removeTrigger"
|
|
52
|
+ >
|
|
53
|
+ <span style="color: white">删除</span></Button
|
|
54
|
+ >
|
|
55
|
+ </div>
|
37
|
56
|
</div>
|
38
|
57
|
</div>
|
39
|
|
- </div>
|
40
|
|
- <div style="height: 5vh"></div>
|
41
|
|
- <!-- 执行条件 -->
|
42
|
|
- <div>
|
43
|
|
- <template v-for="(item, index) in addConditionPushData" :key="index">
|
44
|
|
- <div>
|
45
|
|
- <AddConditiForm :deviceInfo1="getDeviceInfo1" ref="refConditionChild" />
|
46
|
|
- </div>
|
47
|
|
- <div style="height: 3vh"></div>
|
48
|
|
- </template>
|
49
|
|
- <div
|
50
|
|
- style="
|
51
|
|
- display: flex;
|
52
|
|
- width: 13vw;
|
53
|
|
- height: 4vh;
|
54
|
|
- flex-direction: row;
|
55
|
|
- justify-content: space-between;
|
56
|
|
- "
|
57
|
|
- >
|
58
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
59
|
|
- <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addCondition"
|
60
|
|
- ><PlusCircleOutlined />新增执行条件</Button
|
61
|
|
- >
|
62
|
|
- </div>
|
63
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
64
|
|
- <Button type="error" style="border-radius: 10px" class="mt-5" @click="removeCondition"
|
65
|
|
- ><PlusCircleOutlined />删除</Button
|
66
|
|
- >
|
|
58
|
+ <div style="height: 5vh"></div>
|
|
59
|
+ <!-- 执行条件 -->
|
|
60
|
+ <div>
|
|
61
|
+ <template v-for="(item, index) in addConditionPushData" :key="index">
|
|
62
|
+ <span style="display: none">{{ item + index }}</span>
|
|
63
|
+ <span style="position: relative; top: 3.2vh; left: 0.3vw">执行条件{{ index + 1 }}</span>
|
|
64
|
+
|
|
65
|
+ <div>
|
|
66
|
+ <AddConditiForm :deviceInfo1="getDeviceInfo1" ref="refConditionChild" />
|
|
67
|
+ </div>
|
|
68
|
+ <div style="height: 3vh"></div>
|
|
69
|
+ </template>
|
|
70
|
+ <div
|
|
71
|
+ style="
|
|
72
|
+ display: flex;
|
|
73
|
+ width: 11vw;
|
|
74
|
+ height: 4vh;
|
|
75
|
+ flex-direction: row;
|
|
76
|
+ justify-content: space-between;
|
|
77
|
+ "
|
|
78
|
+ >
|
|
79
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
80
|
+ <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addCondition"
|
|
81
|
+ >新增执行条件</Button
|
|
82
|
+ >
|
|
83
|
+ </div>
|
|
84
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
85
|
+ <Button
|
|
86
|
+ style="border-radius: 10px; background-color: rgba(237, 111, 111, 1)"
|
|
87
|
+ type="default"
|
|
88
|
+ class="mt-5"
|
|
89
|
+ @click="removeCondition"
|
|
90
|
+ >
|
|
91
|
+ <span style="color: white">删除</span></Button
|
|
92
|
+ >
|
|
93
|
+ </div>
|
67
|
94
|
</div>
|
68
|
95
|
</div>
|
69
|
|
- </div>
|
70
|
|
- <!-- 执行动作 -->
|
71
|
|
- <div style="height: 5vh"></div>
|
72
|
|
- <div>
|
73
|
|
- <template v-for="(item, index) in addActionPushData" :key="index">
|
74
|
|
- <div>
|
75
|
|
- <AddActionForm :deviceInfo2="getDeviceInfo2" ref="refActionChild" />
|
76
|
|
- </div>
|
77
|
|
- <div style="height: 3vh"></div>
|
78
|
|
- </template>
|
79
|
|
- <div
|
80
|
|
- style="
|
81
|
|
- display: flex;
|
82
|
|
- width: 13vw;
|
83
|
|
- height: 4vh;
|
84
|
|
- flex-direction: row;
|
85
|
|
- justify-content: space-between;
|
86
|
|
- "
|
87
|
|
- >
|
88
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
89
|
|
- <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addAction"
|
90
|
|
- ><PlusCircleOutlined />新增执行动作</Button
|
91
|
|
- >
|
92
|
|
- </div>
|
93
|
|
- <div style="display: flex; width: 4vw; height: 4vh">
|
94
|
|
- <Button type="error" style="border-radius: 10px" class="mt-5" @click="removeAction"
|
95
|
|
- ><PlusCircleOutlined />删除</Button
|
96
|
|
- >
|
|
96
|
+ <!-- 执行动作 -->
|
|
97
|
+ <div style="height: 5vh"></div>
|
|
98
|
+ <div>
|
|
99
|
+ <template v-for="(item, index) in addActionPushData" :key="index">
|
|
100
|
+ <span style="display: none">{{ item + index }}</span>
|
|
101
|
+ <span style="position: relative; top: 4.2vh; left: 0.65vw">执行动作{{ index + 1 }}</span>
|
|
102
|
+
|
|
103
|
+ <div>
|
|
104
|
+ <AddActionForm :deviceInfo2="getDeviceInfo2" ref="refActionChild" />
|
|
105
|
+ </div>
|
|
106
|
+ <div style="height: 3vh"></div>
|
|
107
|
+ </template>
|
|
108
|
+ <div
|
|
109
|
+ style="
|
|
110
|
+ display: flex;
|
|
111
|
+ width: 11vw;
|
|
112
|
+ height: 4vh;
|
|
113
|
+ flex-direction: row;
|
|
114
|
+ justify-content: space-between;
|
|
115
|
+ "
|
|
116
|
+ >
|
|
117
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
118
|
+ <Button type="primary" style="border-radius: 10px" class="mt-5" @click="addAction"
|
|
119
|
+ >新增执行动作</Button
|
|
120
|
+ >
|
|
121
|
+ </div>
|
|
122
|
+ <div style="display: flex; width: 4vw; height: 4vh">
|
|
123
|
+ <Button
|
|
124
|
+ style="border-radius: 10px; background-color: rgba(237, 111, 111, 1)"
|
|
125
|
+ type="default"
|
|
126
|
+ class="mt-5"
|
|
127
|
+ @click="removeAction"
|
|
128
|
+ >
|
|
129
|
+ <span style="color: white">删除</span></Button
|
|
130
|
+ >
|
|
131
|
+ </div>
|
97
|
132
|
</div>
|
|
133
|
+ <div style="height: 5vh"></div>
|
98
|
134
|
</div>
|
99
|
135
|
</div>
|
100
|
136
|
</BasicDrawer>
|
...
|
...
|
@@ -104,11 +140,7 @@ |
104
|
140
|
import { BasicForm, useForm } from '/@/components/Form';
|
105
|
141
|
import { formSchema, getData } from './config';
|
106
|
142
|
import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
|
107
|
|
- import {
|
108
|
|
- screenLinkPageAddApi,
|
109
|
|
- // screenLinkPageUpdateApi,
|
110
|
|
- // screenLinkPageByDeptIdGetDevice,
|
111
|
|
- } from '/@/api/ruleengine/ruleengineApi';
|
|
143
|
+ import { screenLinkPageAddApi, screenLinkPageUpdateApi } from '/@/api/ruleengine/ruleengineApi';
|
112
|
144
|
import { useMessage } from '/@/hooks/web/useMessage';
|
113
|
145
|
import AddTriggerForm from './addForm/trigger.vue';
|
114
|
146
|
import AddConditiForm from './addForm/condition.vue';
|
...
|
...
|
@@ -118,10 +150,19 @@ |
118
|
150
|
|
119
|
151
|
export default defineComponent({
|
120
|
152
|
name: 'ConfigDrawer',
|
121
|
|
- components: { BasicDrawer, BasicForm, AddTriggerForm, AddConditiForm, AddActionForm, Button },
|
|
153
|
+ components: {
|
|
154
|
+ BasicDrawer,
|
|
155
|
+ BasicForm,
|
|
156
|
+ AddTriggerForm,
|
|
157
|
+ AddConditiForm,
|
|
158
|
+ AddActionForm,
|
|
159
|
+ Button,
|
|
160
|
+ },
|
122
|
161
|
emits: ['success', 'register', 'registerForm'],
|
123
|
162
|
setup(_, { emit }) {
|
|
163
|
+ const { proxy } = getCurrentInstance();
|
124
|
164
|
const lastRefTriggerChildDataArray = ref<[]>([]);
|
|
165
|
+ const lastEditRefTriggerChildDataArray = ref<[]>([]);
|
125
|
166
|
const lastRefConditionChildDataArray = ref<[]>([]);
|
126
|
167
|
const lastRefActionChildDataArray = ref<[]>([]);
|
127
|
168
|
const lastRefTriggerChildData: any = ref({});
|
...
|
...
|
@@ -159,7 +200,8 @@ |
159
|
200
|
const addTriggerPushData = ref<[]>([]);
|
160
|
201
|
const addConditionPushData = ref<[]>([]);
|
161
|
202
|
const addActionPushData = ref<[]>([]);
|
162
|
|
- const { proxy } = getCurrentInstance();
|
|
203
|
+ //edit data
|
|
204
|
+ const editTriggerPushData = ref<[]>([]);
|
163
|
205
|
const getChildData = ref(null);
|
164
|
206
|
const refTriggerChild = ref(null);
|
165
|
207
|
const refConditionChild = ref(null);
|
...
|
...
|
@@ -167,13 +209,14 @@ |
167
|
209
|
const getConditionChildData = ref(null);
|
168
|
210
|
const { createMessage } = useMessage();
|
169
|
211
|
const isUpdate = ref(true);
|
170
|
|
- let getAllFormData: any = reactive({});
|
|
212
|
+ const getAllFormData: any = reactive({});
|
171
|
213
|
let getValuesFormData: any = reactive({});
|
172
|
|
- let getId = ref('');
|
173
|
|
- let getTenantId = ref('');
|
174
|
|
- let getDeviceInfo = ref(null);
|
175
|
|
- let getDeviceInfo1 = ref(null);
|
176
|
|
- let getDeviceInfo2 = ref(null);
|
|
214
|
+ const getId = ref('');
|
|
215
|
+ const getTenantId = ref('');
|
|
216
|
+ const getDeviceInfo = ref(null);
|
|
217
|
+ const getDeviceInfo1 = ref(null);
|
|
218
|
+ const getDeviceInfo2 = ref(null);
|
|
219
|
+ const editReveiveData = ref<[]>([]);
|
177
|
220
|
|
178
|
221
|
const [registerForm, { resetFields, setFieldsValue, validateFields }] = useForm({
|
179
|
222
|
labelWidth: 120,
|
...
|
...
|
@@ -195,13 +238,16 @@ |
195
|
238
|
return e;
|
196
|
239
|
}
|
197
|
240
|
}
|
198
|
|
- //编辑
|
199
|
241
|
if (unref(isUpdate)) {
|
|
242
|
+ //编辑
|
|
243
|
+ clearAllArrayFunc();
|
200
|
244
|
getId.value = data.record.id;
|
201
|
245
|
getTenantId.value = data.record.tenantId;
|
202
|
246
|
await setFieldsValue({
|
203
|
247
|
...data.record,
|
204
|
248
|
});
|
|
249
|
+ editReveiveData.value = data.record.triggers;
|
|
250
|
+ editTriggerPushData.value = editReveiveData.value;
|
205
|
251
|
}
|
206
|
252
|
});
|
207
|
253
|
const getTitle = computed(() => (!unref(isUpdate) ? '新增场景联动' : '编辑场景联动'));
|
...
|
...
|
@@ -213,6 +259,7 @@ |
213
|
259
|
lastRefTriggerChildDataArray.value.length = 0;
|
214
|
260
|
lastRefConditionChildDataArray.value.length = 0;
|
215
|
261
|
lastRefActionChildDataArray.value.length = 0;
|
|
262
|
+ // lastEditRefTriggerChildDataArray.value.length = 0;
|
216
|
263
|
};
|
217
|
264
|
const resetActionsAllArrayFunc = () => {
|
218
|
265
|
try {
|
...
|
...
|
@@ -259,69 +306,120 @@ |
259
|
306
|
}
|
260
|
307
|
};
|
261
|
308
|
|
262
|
|
- const getDefaultValue = async () => {
|
263
|
|
- getValuesFormData = await validateFields();
|
264
|
|
- refTriggerChildDataFunc();
|
265
|
|
- refConditionChildDataFunc();
|
266
|
|
- refActionChildDataFunc();
|
267
|
|
- lastRefTriggerChildDataArray.value.push(refTriggerChildData.value);
|
268
|
|
- lastRefConditionChildDataArray.value.push(refConditionChildData.value);
|
269
|
|
- lastRefActionChildDataArray.value.push(refActionChildData.value);
|
270
|
|
- const triggersObj = {
|
271
|
|
- triggers: lastRefTriggerChildDataArray.value,
|
272
|
|
- };
|
273
|
|
- const conditionsObj = {
|
274
|
|
- conditions: lastRefConditionChildDataArray.value,
|
275
|
|
- };
|
276
|
|
- const actionsObj = {
|
277
|
|
- actions: lastRefActionChildDataArray.value,
|
278
|
|
- };
|
279
|
|
- Object.assign(getAllFormData, getValuesFormData, triggersObj, conditionsObj, actionsObj);
|
|
309
|
+ const getDefaultValue = () => {
|
280
|
310
|
if (!unref(isUpdate)) {
|
281
|
311
|
delete getAllFormData.id;
|
282
|
312
|
delete getAllFormData.getTenantId;
|
|
313
|
+ refTriggerChildDataFunc();
|
|
314
|
+ refConditionChildDataFunc();
|
|
315
|
+ refActionChildDataFunc();
|
|
316
|
+ lastRefTriggerChildDataArray.value.push(refTriggerChildData.value as never);
|
|
317
|
+ lastRefConditionChildDataArray.value.push(refConditionChildData.value as never);
|
|
318
|
+ lastRefActionChildDataArray.value.push(refActionChildData.value as never);
|
|
319
|
+ //删除第一个
|
|
320
|
+ lastRefTriggerChildDataArray.value.shift();
|
|
321
|
+ lastRefConditionChildDataArray.value.shift();
|
|
322
|
+ lastRefActionChildDataArray.value.shift();
|
|
323
|
+ const triggersObj = {
|
|
324
|
+ triggers: lastRefTriggerChildDataArray.value,
|
|
325
|
+ };
|
|
326
|
+ const conditionsObj = {
|
|
327
|
+ doConditions: lastRefConditionChildDataArray.value,
|
|
328
|
+ };
|
|
329
|
+ const actionsObj = {
|
|
330
|
+ doActions: lastRefActionChildDataArray.value,
|
|
331
|
+ };
|
|
332
|
+ Object.assign(getAllFormData, triggersObj, conditionsObj, actionsObj);
|
|
333
|
+ } else {
|
|
334
|
+ refTriggerChildDataFunc();
|
|
335
|
+ refConditionChildDataFunc();
|
|
336
|
+ refActionChildDataFunc();
|
|
337
|
+ lastEditRefTriggerChildDataArray.value.push(refTriggerChildData.value as never);
|
|
338
|
+ lastRefConditionChildDataArray.value.push(refConditionChildData.value as never);
|
|
339
|
+ lastRefActionChildDataArray.value.push(refActionChildData.value as never);
|
|
340
|
+ const triggersObj = {
|
|
341
|
+ triggers: lastEditRefTriggerChildDataArray.value,
|
|
342
|
+ };
|
|
343
|
+ const conditionsObj = {
|
|
344
|
+ doConditions: lastRefConditionChildDataArray.value,
|
|
345
|
+ };
|
|
346
|
+ const actionsObj = {
|
|
347
|
+ doActions: lastRefActionChildDataArray.value,
|
|
348
|
+ };
|
|
349
|
+ Object.assign(getAllFormData, triggersObj, conditionsObj, actionsObj);
|
283
|
350
|
}
|
284
|
351
|
};
|
285
|
352
|
|
286
|
|
- async function handleSubmit() {
|
|
353
|
+ const handleSubmit = async () => {
|
287
|
354
|
if (!unref(isUpdate)) {
|
288
|
355
|
getDefaultValue();
|
289
|
|
- console.log(getAllFormData);
|
|
356
|
+ getValuesFormData = await validateFields();
|
|
357
|
+ if (!getValuesFormData) return;
|
|
358
|
+ Object.assign(getAllFormData, getValuesFormData);
|
290
|
359
|
await screenLinkPageAddApi(getAllFormData);
|
291
|
360
|
createMessage.success('场景联动新增成功');
|
292
|
361
|
closeDrawer();
|
293
|
362
|
emit('success');
|
294
|
363
|
} else {
|
295
|
364
|
getDefaultValue();
|
|
365
|
+ getValuesFormData = await validateFields();
|
|
366
|
+ if (!getValuesFormData) return;
|
|
367
|
+ Object.assign(getAllFormData, getValuesFormData);
|
|
368
|
+ getAllFormData.id = getId.value;
|
|
369
|
+ getAllFormData.tenantId = getTenantId.value;
|
|
370
|
+ await screenLinkPageUpdateApi(getAllFormData);
|
296
|
371
|
createMessage.success('场景联动编辑成功');
|
297
|
372
|
closeDrawer();
|
298
|
373
|
emit('success');
|
299
|
374
|
}
|
300
|
|
- }
|
|
375
|
+ };
|
|
376
|
+
|
301
|
377
|
//新增触发器
|
302
|
378
|
const addTrigger = () => {
|
303
|
|
- unref(addTriggerPushData).push(addTriggerData);
|
304
|
|
- refTriggerChildDataFunc();
|
305
|
|
- lastRefTriggerChildData.value = refTriggerChildData.value;
|
306
|
|
- lastRefTriggerChildDataArray.value.push(lastRefTriggerChildData.value);
|
|
379
|
+ if (!unref(isUpdate)) {
|
|
380
|
+ unref(addTriggerPushData).push(addTriggerData as never);
|
|
381
|
+ refTriggerChildDataFunc();
|
|
382
|
+ lastRefTriggerChildData.value = refTriggerChildData.value;
|
|
383
|
+ lastRefTriggerChildDataArray.value.push(lastRefTriggerChildData.value as never);
|
|
384
|
+ } else {
|
|
385
|
+ unref(editTriggerPushData).push(addTriggerData as never);
|
|
386
|
+ refTriggerChildDataFunc();
|
|
387
|
+ lastRefTriggerChildData.value = refTriggerChildData.value;
|
|
388
|
+ lastEditRefTriggerChildDataArray.value.push(lastRefTriggerChildData.value as never);
|
|
389
|
+ }
|
307
|
390
|
};
|
308
|
391
|
const removeTrigger = () => {
|
309
|
|
- unref(addTriggerPushData).splice(0, 1);
|
310
|
|
- lastRefTriggerChildDataArray.value.splice(0, 1);
|
311
|
|
- getAllFormData.triggers.splice(0, 1);
|
|
392
|
+ if (!unref(isUpdate)) {
|
|
393
|
+ try {
|
|
394
|
+ unref(addTriggerPushData).splice(0, 1);
|
|
395
|
+ lastRefTriggerChildDataArray.value.splice(0, 1);
|
|
396
|
+ } catch (e) {
|
|
397
|
+ return e;
|
|
398
|
+ }
|
|
399
|
+ } else {
|
|
400
|
+ try {
|
|
401
|
+ unref(editTriggerPushData).splice(0, 1);
|
|
402
|
+ lastEditRefTriggerChildDataArray.value.splice(0, 1);
|
|
403
|
+ } catch (e) {
|
|
404
|
+ return e;
|
|
405
|
+ }
|
|
406
|
+ }
|
312
|
407
|
};
|
313
|
408
|
|
314
|
409
|
//新增执行条件
|
315
|
410
|
const addCondition = () => {
|
316
|
|
- unref(addConditionPushData).push(addConditionData);
|
|
411
|
+ unref(addConditionPushData).push(addConditionData as never);
|
317
|
412
|
refConditionChildDataFunc();
|
318
|
413
|
lastRefConditionChildData.value = refConditionChildData.value;
|
319
|
|
- lastRefConditionChildDataArray.value.push(lastRefConditionChildData.value);
|
|
414
|
+ lastRefConditionChildDataArray.value.push(lastRefConditionChildData.value as never);
|
320
|
415
|
};
|
321
|
416
|
const removeCondition = () => {
|
322
|
|
- unref(addConditionPushData).splice(0, 1);
|
323
|
|
- lastRefConditionChildDataArray.value.splice(0, 1);
|
324
|
|
- getAllFormData.conditions.splice(0, 1);
|
|
417
|
+ try {
|
|
418
|
+ unref(addConditionPushData).splice(0, 1);
|
|
419
|
+ lastRefConditionChildDataArray.value.splice(0, 1);
|
|
420
|
+ } catch (e) {
|
|
421
|
+ return e;
|
|
422
|
+ }
|
325
|
423
|
};
|
326
|
424
|
|
327
|
425
|
//新增执行动作
|
...
|
...
|
@@ -331,18 +429,23 @@ |
331
|
429
|
}
|
332
|
430
|
};
|
333
|
431
|
const addAction = () => {
|
334
|
|
- unref(addActionPushData).push(addActionData);
|
|
432
|
+ unref(addActionPushData).push(addActionData as never);
|
335
|
433
|
refActionChildDataFunc();
|
336
|
434
|
lastRefActionChildData.value = refActionChildData.value;
|
337
|
|
- lastRefActionChildDataArray.value.push(lastRefActionChildData.value);
|
|
435
|
+ lastRefActionChildDataArray.value.push(lastRefActionChildData.value as never);
|
338
|
436
|
};
|
339
|
437
|
const removeAction = () => {
|
340
|
|
- unref(addActionPushData).splice(0, 1);
|
341
|
|
- lastRefActionChildDataArray.value.splice(0, 1);
|
342
|
|
- getAllFormData.actions.splice(0, 1);
|
|
438
|
+ try {
|
|
439
|
+ unref(addActionPushData).splice(0, 1);
|
|
440
|
+ lastRefActionChildDataArray.value.splice(0, 1);
|
|
441
|
+ } catch (e) {
|
|
442
|
+ return e;
|
|
443
|
+ }
|
343
|
444
|
};
|
344
|
445
|
|
345
|
446
|
return {
|
|
447
|
+ editTriggerPushData,
|
|
448
|
+ isUpdate,
|
346
|
449
|
clearActionsAllDevice,
|
347
|
450
|
getDeviceInfo,
|
348
|
451
|
getDeviceInfo1,
|
...
|
...
|
|