diff --git a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue index f3358af0a8..b95073cb59 100644 --- a/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue +++ b/core/core-frontend/src/views/dashboard/MobileConfigPanel.vue @@ -208,7 +208,13 @@ const save = () => { 开启移动端 - + diff --git a/core/core-frontend/src/views/mobile/directory/index.vue b/core/core-frontend/src/views/mobile/directory/index.vue index a622eb04fa..bb465b1b78 100644 --- a/core/core-frontend/src/views/mobile/directory/index.vue +++ b/core/core-frontend/src/views/mobile/directory/index.vue @@ -81,6 +81,13 @@ const dataClick = val => { directId.value.push(val.id) } +const handleDir = index => { + if (index === directId.value.length - 1) return + directId.value = directId.value.slice(0, index + 1) + directName.value = directName.value.slice(0, index + 1) + activeDirectName.value = directName.value[directName.value.length - 1] +} + const getTree = async () => { const request = { busiFlag: 'dashboard' } as BusiTreeRequest await interactiveStore.setInteractive(request) @@ -127,8 +134,10 @@ onMounted(() => { -
- {{ ele }} +
+ {{ + ele + }} @@ -168,16 +177,20 @@ onMounted(() => { padding: 12px 16px; color: #646a73; display: flex; + width: 100%; + overflow-x: auto; align-items: center; & > div { display: flex; align-items: center; + white-space: nowrap; } .label { font-size: 14px; font-weight: 400; line-height: 20px; + max-width: 250px; } .ed-icon { diff --git a/core/core-frontend/src/views/mobile/personal/index.vue b/core/core-frontend/src/views/mobile/personal/index.vue index a1019b0679..db60c608cc 100644 --- a/core/core-frontend/src/views/mobile/personal/index.vue +++ b/core/core-frontend/src/views/mobile/personal/index.vue @@ -48,11 +48,47 @@ const findName = () => { } } } + +let directIdCopy = [] +let directNameCopy = [] + +const dfsOrgTree = (arr, depth) => { + arr.forEach(item => { + const { name, id } = item + if (depth <= directIdCopy.length) { + if (depth < directIdCopy.length) { + directIdCopy = directIdCopy.slice(0, depth) + directNameCopy = directNameCopy.slice(0, depth) + } + directIdCopy.splice(directIdCopy.length - 1, 1, id) + directNameCopy.splice(directNameCopy.length - 1, 1, name) + } else { + directIdCopy.push(id) + directNameCopy.push(name) + } + + let nextDepth = depth + 1 + + if (id === userStore.getOid) { + directName.value = [...directNameCopy] + directId.value = [...directIdCopy] + nextDepth = 999 + } + if (item?.children?.length && nextDepth !== 999) { + dfsOrgTree(item?.children, nextDepth) + } + }) +} + onMounted(() => { mountedOrg().then(res => { orgOption = res.data as OrgTreeNode[] tableData.value = res.data as OrgTreeNode[] findName() + dfsOrgTree(orgOption, 1) + directName.value.pop() + directId.value.pop() + activeDirectName.value = directName.value[directName.value.length - 1] }) }) @@ -84,6 +120,13 @@ const orgCellClick = (type, val) => { } } +const handleDir = index => { + if (index === directId.value.length - 1) return + directId.value = directId.value.slice(0, index + 1) + directName.value = directName.value.slice(0, index + 1) + activeDirectName.value = directName.value[directName.value.length - 1] +} + const tableData = ref([]) const directName = ref([]) const directId = ref([]) @@ -134,8 +177,13 @@ const activeTableData = computed(() => { @click-left="onClickLeft" />
-
- {{ ele }} +
+ {{ ele }} @@ -202,6 +250,14 @@ const activeTableData = computed(() => { display: flex; align-items: center; + & > div { + white-space: nowrap; + } + + .ellipsis { + max-width: 250px; + } + .active { color: var(--ed-color-primary); }