Commit ff263d2433886b2a36c8a6eb5ee76db7ac2c1864

Authored by fengtao
1 parent 746dfafa

fix:修改场景联动,选择设备为全部,属性下拉框无数据问题

... ... @@ -169,6 +169,8 @@
169 169 organizationId,
170 170 triggers.map((m) => m.entityId).join(',')
171 171 );
  172 + watchAttrList.value = await getAttribute(organizationId, null);
  173 +
172 174 // 生成回显时对应得组件数量
173 175 triggerData.value = [...new Array(triggers.length).keys()];
174 176 conditionData.value = [...new Array(doConditions.length).keys()];
... ... @@ -514,7 +516,7 @@
514 516 // 监听组织变化更新设备列表
515 517 const deviceList = ref([]);
516 518 const alarmConfigList = ref([]);
517   - let watchAttrList = [];
  519 + const watchAttrList = ref([]);
518 520 const deviceExcludeDoAction = ref([]);
519 521 watch(organizationId, async (newValue: string) => {
520 522 if (!newValue) return;
... ... @@ -526,7 +528,7 @@
526 528 value: item.tbDeviceId,
527 529 }));
528 530 deviceList.value = items.map((item) => ({ label: item.name, value: item.id }));
529   - watchAttrList = await getAttribute(newValue, null);
  531 + watchAttrList.value = await getAttribute(newValue, null);
530 532 setFields(skipUnwrap.triggerItemRefs, true);
531 533 setFields(skipUnwrap.conditionItemRefs, true);
532 534 setFields(skipUnwrap.actionItemRefs, true);
... ... @@ -541,10 +543,10 @@
541 543 isOrganizationChange && item.resetFieldsValueFunc();
542 544 if (item.isTriggerAndConditionFlag == 'isTriggerAndConditionFlag') {
543 545 item.updateExcludeActionFieldDeviceId(deviceExcludeDoAction);
  546 + item.updateFieldAttr(watchAttrList);
544 547 } else {
545 548 item.updateFieldDeviceId(deviceList);
546 549 }
547   - // item.updateFieldAttr(watchAttrList);
548 550 });
549 551 }
550 552 function setAlarmConfig(linkAge, isOrganizationChange = false) {
... ...
... ... @@ -112,7 +112,7 @@
112 112 });
113 113 };
114 114 const updateFieldAttr = (attrList: any[]) => {
115   - const attrMapList = attrList?.map((m) => {
  115 + const attrMapList = attrList.value?.map((m) => {
116 116 return {
117 117 label: m,
118 118 value: m,
... ...