Showing
6 changed files
with
27 additions
and
31 deletions
... | ... | @@ -324,6 +324,7 @@ |
324 | 324 | detail: condition?.triggerCondition?.alarmDetails, |
325 | 325 | entityId: condition?.entityId, |
326 | 326 | deviceProfileId: condition?.deviceProfileId, |
327 | + deviceType: condition?.deviceType, | |
327 | 328 | replaceValue: condition?.triggerCondition?.condition?.spec?.predicate?.defaultValue, |
328 | 329 | time: condition?.triggerCondition?.condition?.spec?.predicate?.defaultValue, |
329 | 330 | timeUnit: condition?.triggerCondition?.condition?.spec?.unit, |
... | ... | @@ -348,7 +349,7 @@ |
348 | 349 | unref(skipUnwrap.conditionItemRefs)[index].setConditionScreeningList([ |
349 | 350 | ...new Array(condition.triggerCondition.condition.condition.length).keys(), |
350 | 351 | ]); |
351 | - // 操作符类型 NUMERIC|String|Boolean|DATE_TIME | |
352 | + // 操作符类型 NUMERIC|String|Boolean|DATorganizeImportsE_TIME | |
352 | 353 | const valueType = condition.triggerCondition?.condition.condition[0].valueType; |
353 | 354 | |
354 | 355 | // 循环设置条件筛选值。TODO:此处设置顺序有问题 |
... | ... | @@ -387,7 +388,6 @@ |
387 | 388 | doActions.forEach((action, index) => { |
388 | 389 | nextTick(() => { |
389 | 390 | const selectProductId = ref(''); |
390 | - console.log('doActions', unref(skipUnwrap.actionItemRefs)); | |
391 | 391 | // 设置执行动作外层值 |
392 | 392 | unref(skipUnwrap.actionItemRefs)[index].setFieldsFormValueFun({ |
393 | 393 | ...action, |
... | ... | @@ -423,6 +423,7 @@ |
423 | 423 | triggered: |
424 | 424 | action.doContext.clearRule[index].triggerCondition.condition.spec.type, |
425 | 425 | device: action.doContext.clearRule[index].entityType, |
426 | + deviceType: action.doContext.clearRule[index].deviceType, | |
426 | 427 | triggerType: action.doContext.clearRule[index].triggerType, |
427 | 428 | type1: |
428 | 429 | action.doContext.clearRule[index].triggerCondition.condition.condition[0].key |
... | ... | @@ -566,10 +567,10 @@ |
566 | 567 | //TODO fengtao |
567 | 568 | setFields(skipUnwrap.triggerItemRefs, true); |
568 | 569 | setFields(skipUnwrap.conditionItemRefs, true); |
569 | - // setFields(skipUnwrap.actionItemRefs, true); | |
570 | + setFields(skipUnwrap.actionItemRefs, true); | |
570 | 571 | const data = await getOrganizationAlarmConfig({ organizationId: newValue }); |
571 | 572 | alarmConfigList.value = data.map((item) => ({ label: item.name, value: item.id })); |
572 | - setFields(skipUnwrap.actionItemRefs, true); | |
573 | + // setFields(skipUnwrap.actionItemRefs, true); | |
573 | 574 | // console.log(unref(organizationIdRef)); |
574 | 575 | // setAlarmConfig(skipUnwrap.actionItemRefs, true); |
575 | 576 | }); | ... | ... |
... | ... | @@ -250,8 +250,7 @@ export const trigger_condition_schema: FormSchema[] = [ |
250 | 250 | getPopupContainer: () => document.body, |
251 | 251 | onChange: async (e) => { |
252 | 252 | if (e) { |
253 | - setFieldsValue({ type2: '' }); | |
254 | - setFieldsValue({ entityId: [] }); | |
253 | + setFieldsValue({ type2: '', entityId: [] }); | |
255 | 254 | const res = await getAttribute(e); |
256 | 255 | const options = ref<TOption[]>([]); |
257 | 256 | useByProductGetAttribute(res, updateSchema, options); |
... | ... | @@ -446,7 +445,6 @@ export const actionSchema: FormSchema[] = [ |
446 | 445 | componentProps: ({ formActionType, formModel }) => { |
447 | 446 | const { setFieldsValue } = formActionType; |
448 | 447 | const deviceType = formModel['deviceType']; |
449 | - console.log(deviceType); | |
450 | 448 | return { |
451 | 449 | api: queryDeviceProfileBy, |
452 | 450 | params: { |
... | ... | @@ -457,8 +455,7 @@ export const actionSchema: FormSchema[] = [ |
457 | 455 | valueField: 'id', |
458 | 456 | getPopupContainer: () => document.body, |
459 | 457 | onChange: () => { |
460 | - setFieldsValue({ deviceId: [] }); | |
461 | - setFieldsValue({ thingsModelId: '' }); | |
458 | + setFieldsValue({ thingsModelId: '', deviceId: [] }); | |
462 | 459 | }, |
463 | 460 | }; |
464 | 461 | }, | ... | ... |
... | ... | @@ -120,7 +120,7 @@ export const genActionData = (actionData) => { |
120 | 120 | triggerType: item.triggerType, |
121 | 121 | entityType: item.device, |
122 | 122 | entityId: item.device === 'PART' ? item.entityId : null, |
123 | - deviceType, | |
123 | + deviceType: item.deviceType, | |
124 | 124 | deviceProfileId: item.deviceProfileId, |
125 | 125 | triggerCondition: { |
126 | 126 | alarmDetails: item.detail, | ... | ... |
... | ... | @@ -101,9 +101,9 @@ |
101 | 101 | return { ...getFieldsValue(), predicate, schedule: alarmScheduleRef.value.scheduleData }; |
102 | 102 | }; |
103 | 103 | |
104 | - const updateFieldDeviceId = (deviceList: any[], _, isUpdate) => { | |
105 | - console.log(deviceList); | |
106 | - console.log(isUpdate); | |
104 | + const updateFieldDeviceId = () => { | |
105 | + // console.log(deviceList); | |
106 | + // console.log(isUpdate); | |
107 | 107 | }; |
108 | 108 | |
109 | 109 | const resetFieldsValueFunc = () => resetFields(); |
... | ... | @@ -157,7 +157,6 @@ |
157 | 157 | alarmScheduleRef.value.scheduleData = { |
158 | 158 | type: value, |
159 | 159 | }; |
160 | - console.log(value); | |
161 | 160 | } |
162 | 161 | currentIndex.value = index; |
163 | 162 | }; | ... | ... |
... | ... | @@ -57,20 +57,20 @@ |
57 | 57 | </div> |
58 | 58 | </template> |
59 | 59 | <script lang="ts" setup> |
60 | - import { ref, provide, nextTick } from 'vue'; | |
60 | + import { Card, Input, Select, Tooltip } from 'ant-design-vue'; | |
61 | + import { cloneDeep } from 'lodash-es'; | |
62 | + import { nextTick, provide, ref } from 'vue'; | |
63 | + import { TOption, trigger_condition_schema } from '../config/config.data'; | |
64 | + import { options, scheduleOptions, timeUnitOptions } from '../config/formatData'; | |
65 | + import useCommonFun from '../hooks/useCommonFun'; | |
66 | + import AlarmSchedule from './AlarmSchedule.vue'; | |
67 | + import ConditionScreening from './ConditionScreening.vue'; | |
68 | + import { getAttribute } from '/@/api/ruleengine/ruleengineApi'; | |
61 | 69 | import { CollapseContainer } from '/@/components/Container/index'; |
62 | 70 | import { BasicForm, useForm } from '/@/components/Form/index'; |
63 | 71 | import { Icon } from '/@/components/Icon'; |
64 | - import { Tooltip, Card, Select, Input } from 'ant-design-vue'; | |
65 | - import { trigger_condition_schema, TOption } from '../config/config.data'; | |
66 | - import { getAttribute } from '/@/api/ruleengine/ruleengineApi'; | |
67 | - import ConditionScreening from './ConditionScreening.vue'; | |
68 | - import { scheduleOptions, timeUnitOptions, options } from '../config/formatData'; | |
69 | - import AlarmSchedule from './AlarmSchedule.vue'; | |
70 | 72 | import { useModal } from '/@/components/Modal'; |
71 | - import { cloneDeep } from 'lodash-es'; | |
72 | 73 | import { useMessage } from '/@/hooks/web/useMessage'; |
73 | - import useCommonFun from '../hooks/useCommonFun'; | |
74 | 74 | |
75 | 75 | const { useByProductGetAttribute } = useCommonFun(); |
76 | 76 | defineProps({ |
... | ... | @@ -203,7 +203,6 @@ |
203 | 203 | alarmScheduleRef.value.scheduleData = { |
204 | 204 | type: value, |
205 | 205 | }; |
206 | - console.log(value); | |
207 | 206 | } |
208 | 207 | currentIndex.value = index; |
209 | 208 | }; |
... | ... | @@ -212,14 +211,14 @@ |
212 | 211 | }; |
213 | 212 | const scheduleData = ref(null); |
214 | 213 | //FT add 2022-10-27 |
215 | - const updateFieldAlarmConfig = (alarmConfigList) => { | |
214 | + const updateFieldAlarmConfig = () => { | |
216 | 215 | //什么也不做 |
217 | - console.log(alarmConfigList); | |
216 | + // console.log(alarmConfigList); | |
218 | 217 | }; |
219 | 218 | //FT add 2022-10-27 |
220 | - const updateEditFieldAlarmConfig = (alarmConfigList) => { | |
219 | + const updateEditFieldAlarmConfig = () => { | |
221 | 220 | //什么也不做 |
222 | - console.log(alarmConfigList); | |
221 | + // console.log(alarmConfigList); | |
223 | 222 | }; |
224 | 223 | |
225 | 224 | defineExpose({ | ... | ... |
... | ... | @@ -19,7 +19,8 @@ |
19 | 19 | @dropdown-visible-change="handleDropdownVisibleChange" |
20 | 20 | placeholder="请选择执行动作" |
21 | 21 | allowClear |
22 | - /></template> | |
22 | + /> | |
23 | + </template> | |
23 | 24 | <template #alarmConfigSlot="{ model, field }"> |
24 | 25 | <a-select |
25 | 26 | allowClear |
... | ... | @@ -169,6 +170,7 @@ |
169 | 170 | }, |
170 | 171 | ]; |
171 | 172 | }); |
173 | + | |
172 | 174 | const changeOutTarget = () => { |
173 | 175 | emit('getActionFormArr'); |
174 | 176 | }; |
... | ... | @@ -262,8 +264,6 @@ |
262 | 264 | }; |
263 | 265 | |
264 | 266 | const setFieldsFormValueFun = (fieldsValue) => { |
265 | - console.log(getFieldsValue()); | |
266 | - | |
267 | 267 | setFieldsValue({ |
268 | 268 | ...fieldsValue, |
269 | 269 | ...(isNumber(fieldsValue.commandType) | ... | ... |