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,6 +169,8 @@ | ||
| 169 | organizationId, | 169 | organizationId, |
| 170 | triggers.map((m) => m.entityId).join(',') | 170 | triggers.map((m) => m.entityId).join(',') |
| 171 | ); | 171 | ); |
| 172 | + watchAttrList.value = await getAttribute(organizationId, null); | ||
| 173 | + | ||
| 172 | // 生成回显时对应得组件数量 | 174 | // 生成回显时对应得组件数量 |
| 173 | triggerData.value = [...new Array(triggers.length).keys()]; | 175 | triggerData.value = [...new Array(triggers.length).keys()]; |
| 174 | conditionData.value = [...new Array(doConditions.length).keys()]; | 176 | conditionData.value = [...new Array(doConditions.length).keys()]; |
| @@ -514,7 +516,7 @@ | @@ -514,7 +516,7 @@ | ||
| 514 | // 监听组织变化更新设备列表 | 516 | // 监听组织变化更新设备列表 |
| 515 | const deviceList = ref([]); | 517 | const deviceList = ref([]); |
| 516 | const alarmConfigList = ref([]); | 518 | const alarmConfigList = ref([]); |
| 517 | - let watchAttrList = []; | 519 | + const watchAttrList = ref([]); |
| 518 | const deviceExcludeDoAction = ref([]); | 520 | const deviceExcludeDoAction = ref([]); |
| 519 | watch(organizationId, async (newValue: string) => { | 521 | watch(organizationId, async (newValue: string) => { |
| 520 | if (!newValue) return; | 522 | if (!newValue) return; |
| @@ -526,7 +528,7 @@ | @@ -526,7 +528,7 @@ | ||
| 526 | value: item.tbDeviceId, | 528 | value: item.tbDeviceId, |
| 527 | })); | 529 | })); |
| 528 | deviceList.value = items.map((item) => ({ label: item.name, value: item.id })); | 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 | setFields(skipUnwrap.triggerItemRefs, true); | 532 | setFields(skipUnwrap.triggerItemRefs, true); |
| 531 | setFields(skipUnwrap.conditionItemRefs, true); | 533 | setFields(skipUnwrap.conditionItemRefs, true); |
| 532 | setFields(skipUnwrap.actionItemRefs, true); | 534 | setFields(skipUnwrap.actionItemRefs, true); |
| @@ -541,10 +543,10 @@ | @@ -541,10 +543,10 @@ | ||
| 541 | isOrganizationChange && item.resetFieldsValueFunc(); | 543 | isOrganizationChange && item.resetFieldsValueFunc(); |
| 542 | if (item.isTriggerAndConditionFlag == 'isTriggerAndConditionFlag') { | 544 | if (item.isTriggerAndConditionFlag == 'isTriggerAndConditionFlag') { |
| 543 | item.updateExcludeActionFieldDeviceId(deviceExcludeDoAction); | 545 | item.updateExcludeActionFieldDeviceId(deviceExcludeDoAction); |
| 546 | + item.updateFieldAttr(watchAttrList); | ||
| 544 | } else { | 547 | } else { |
| 545 | item.updateFieldDeviceId(deviceList); | 548 | item.updateFieldDeviceId(deviceList); |
| 546 | } | 549 | } |
| 547 | - // item.updateFieldAttr(watchAttrList); | ||
| 548 | }); | 550 | }); |
| 549 | } | 551 | } |
| 550 | function setAlarmConfig(linkAge, isOrganizationChange = false) { | 552 | function setAlarmConfig(linkAge, isOrganizationChange = false) { |
| @@ -112,7 +112,7 @@ | @@ -112,7 +112,7 @@ | ||
| 112 | }); | 112 | }); |
| 113 | }; | 113 | }; |
| 114 | const updateFieldAttr = (attrList: any[]) => { | 114 | const updateFieldAttr = (attrList: any[]) => { |
| 115 | - const attrMapList = attrList?.map((m) => { | 115 | + const attrMapList = attrList.value?.map((m) => { |
| 116 | return { | 116 | return { |
| 117 | label: m, | 117 | label: m, |
| 118 | value: m, | 118 | value: m, |
| @@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
| 14 | v-model:value="model[field]" | 14 | v-model:value="model[field]" |
| 15 | :treeData="organizationTreeData" | 15 | :treeData="organizationTreeData" |
| 16 | :checked-keys="checkGroup" | 16 | :checked-keys="checkGroup" |
| 17 | - default-expand-all | 17 | + :expandedKeys="treeExpandData" |
| 18 | ref="basicTreeRef" | 18 | ref="basicTreeRef" |
| 19 | checkable | 19 | checkable |
| 20 | toolbar | 20 | toolbar |
| @@ -46,6 +46,7 @@ | @@ -46,6 +46,7 @@ | ||
| 46 | const organizationTreeData = ref<TreeItem[]>([]); | 46 | const organizationTreeData = ref<TreeItem[]>([]); |
| 47 | const basicTreeRef = ref(); | 47 | const basicTreeRef = ref(); |
| 48 | const checkGroup = ref<string[]>([]); | 48 | const checkGroup = ref<string[]>([]); |
| 49 | + const treeExpandData = ref([]); | ||
| 49 | const olderPhoneNumber = ref(); | 50 | const olderPhoneNumber = ref(); |
| 50 | const postData = reactive({}); | 51 | const postData = reactive({}); |
| 51 | const singleEditPostPhoneNumber = reactive({ | 52 | const singleEditPostPhoneNumber = reactive({ |
| @@ -63,6 +64,13 @@ | @@ -63,6 +64,13 @@ | ||
| 63 | span: 18, | 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 | const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { | 75 | const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { |
| 68 | await resetFields(); | 76 | await resetFields(); |
| @@ -72,6 +80,9 @@ | @@ -72,6 +80,9 @@ | ||
| 72 | if (!unref(organizationTreeData).length) { | 80 | if (!unref(organizationTreeData).length) { |
| 73 | copyTransTreeFun(groupListModel); | 81 | copyTransTreeFun(groupListModel); |
| 74 | organizationTreeData.value = groupListModel; | 82 | organizationTreeData.value = groupListModel; |
| 83 | + const getAllIds = findForAllId(organizationTreeData.value as any, []); | ||
| 84 | + //设置要展开的id | ||
| 85 | + treeExpandData.value = getAllIds; | ||
| 75 | } | 86 | } |
| 76 | if (unref(isUpdate)) { | 87 | if (unref(isUpdate)) { |
| 77 | rowId.value = data.record.id; | 88 | rowId.value = data.record.id; |
| @@ -149,6 +160,7 @@ | @@ -149,6 +160,7 @@ | ||
| 149 | organizationTreeData, | 160 | organizationTreeData, |
| 150 | checkGroup, | 161 | checkGroup, |
| 151 | basicTreeRef, | 162 | basicTreeRef, |
| 163 | + treeExpandData, | ||
| 152 | }; | 164 | }; |
| 153 | }, | 165 | }, |
| 154 | }); | 166 | }); |
| @@ -71,7 +71,7 @@ export const columns: BasicColumn[] = [ | @@ -71,7 +71,7 @@ export const columns: BasicColumn[] = [ | ||
| 71 | dataIndex: 'createdTime', | 71 | dataIndex: 'createdTime', |
| 72 | width: 180, | 72 | width: 180, |
| 73 | format: (_, record) => { | 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,7 +72,7 @@ export const columns: BasicColumn[] = [ | ||
| 72 | dataIndex: 'createdTime', | 72 | dataIndex: 'createdTime', |
| 73 | width: 180, | 73 | width: 180, |
| 74 | format: (_, record) => { | 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 | ]; |
| @@ -42,6 +42,11 @@ | @@ -42,6 +42,11 @@ | ||
| 42 | columns, | 42 | columns, |
| 43 | showIndexColumn: false, | 43 | showIndexColumn: false, |
| 44 | clickToRowSelect: false, | 44 | clickToRowSelect: false, |
| 45 | + beforeFetch: (T) => { | ||
| 46 | + if (T.actionType == 'ALL') { | ||
| 47 | + delete T.actionType; | ||
| 48 | + } | ||
| 49 | + }, | ||
| 45 | formConfig: { | 50 | formConfig: { |
| 46 | labelWidth: 120, | 51 | labelWidth: 120, |
| 47 | schemas: searchFormSchema, | 52 | schemas: searchFormSchema, |
| @@ -40,7 +40,7 @@ export const columns: BasicColumn[] = [ | @@ -40,7 +40,7 @@ export const columns: BasicColumn[] = [ | ||
| 40 | dataIndex: 'createdTime', | 40 | dataIndex: 'createdTime', |
| 41 | width: 180, | 41 | width: 180, |
| 42 | format: (_, record) => { | 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 | ]; |