Commit 69438a23a57debe01a2475fe432b4eefb5d78c91
Merge branch 'f-dev' into 'main'
fix:修改Teambition上所属问题 See merge request huang/yun-teng-iot-front!235
Showing
7 changed files
with
27 additions
and
8 deletions
| ... | ... | @@ -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) { | ... | ... |
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | v-model:value="model[field]" |
| 15 | 15 | :treeData="organizationTreeData" |
| 16 | 16 | :checked-keys="checkGroup" |
| 17 | - default-expand-all | |
| 17 | + :expandedKeys="treeExpandData" | |
| 18 | 18 | ref="basicTreeRef" |
| 19 | 19 | checkable |
| 20 | 20 | toolbar |
| ... | ... | @@ -46,6 +46,7 @@ |
| 46 | 46 | const organizationTreeData = ref<TreeItem[]>([]); |
| 47 | 47 | const basicTreeRef = ref(); |
| 48 | 48 | const checkGroup = ref<string[]>([]); |
| 49 | + const treeExpandData = ref([]); | |
| 49 | 50 | const olderPhoneNumber = ref(); |
| 50 | 51 | const postData = reactive({}); |
| 51 | 52 | const singleEditPostPhoneNumber = reactive({ |
| ... | ... | @@ -63,6 +64,13 @@ |
| 63 | 64 | span: 18, |
| 64 | 65 | }, |
| 65 | 66 | }); |
| 67 | + //获取所有父级id | |
| 68 | + function findForAllId(data = [], arr = []) { | |
| 69 | + for (const item of data) { | |
| 70 | + arr.push(item.id); | |
| 71 | + } | |
| 72 | + return arr; | |
| 73 | + } | |
| 66 | 74 | |
| 67 | 75 | const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
| 68 | 76 | await resetFields(); |
| ... | ... | @@ -72,6 +80,9 @@ |
| 72 | 80 | if (!unref(organizationTreeData).length) { |
| 73 | 81 | copyTransTreeFun(groupListModel); |
| 74 | 82 | organizationTreeData.value = groupListModel; |
| 83 | + const getAllIds = findForAllId(organizationTreeData.value as any, []); | |
| 84 | + //设置要展开的id | |
| 85 | + treeExpandData.value = getAllIds; | |
| 75 | 86 | } |
| 76 | 87 | if (unref(isUpdate)) { |
| 77 | 88 | rowId.value = data.record.id; |
| ... | ... | @@ -149,6 +160,7 @@ |
| 149 | 160 | organizationTreeData, |
| 150 | 161 | checkGroup, |
| 151 | 162 | basicTreeRef, |
| 163 | + treeExpandData, | |
| 152 | 164 | }; |
| 153 | 165 | }, |
| 154 | 166 | }); | ... | ... |
| ... | ... | @@ -71,7 +71,7 @@ export const columns: BasicColumn[] = [ |
| 71 | 71 | dataIndex: 'createdTime', |
| 72 | 72 | width: 180, |
| 73 | 73 | format: (_, record) => { |
| 74 | - return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); | |
| 74 | + return moment(record.createdTime).format('YYYY-MM-DD HH:MM:ss'); | |
| 75 | 75 | }, |
| 76 | 76 | }, |
| 77 | 77 | ]; | ... | ... |
| ... | ... | @@ -72,7 +72,7 @@ export const columns: BasicColumn[] = [ |
| 72 | 72 | dataIndex: 'createdTime', |
| 73 | 73 | width: 180, |
| 74 | 74 | format: (_, record) => { |
| 75 | - return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); | |
| 75 | + return moment(record.createdTime).format('YYYY-MM-DD HH:MM:ss'); | |
| 76 | 76 | }, |
| 77 | 77 | }, |
| 78 | 78 | ]; | ... | ... |
| ... | ... | @@ -40,7 +40,7 @@ export const columns: BasicColumn[] = [ |
| 40 | 40 | dataIndex: 'createdTime', |
| 41 | 41 | width: 180, |
| 42 | 42 | format: (_, record) => { |
| 43 | - return moment(record.createdTime).format('YYYY-MM-DD-HH-MM-ss'); | |
| 43 | + return moment(record.createdTime).format('YYYY-MM-DD HH:MM:ss'); | |
| 44 | 44 | }, |
| 45 | 45 | }, |
| 46 | 46 | ]; | ... | ... |