|
|
@@ -205,6 +205,8 @@ import { Base64 } from 'js-base64'
|
|
|
import PmsTree from './PmsTree.vue'
|
|
|
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
|
|
|
import { IotInfoClassifyApi } from '@/api/pms/info'
|
|
|
+import { useUserStore } from '@/store/modules/user'
|
|
|
+import { getUserProfile } from '@/api/system/user/profile'
|
|
|
// import { IotTreeApi } from '@/api/system/tree'
|
|
|
defineOptions({ name: 'IotTree' })
|
|
|
|
|
|
@@ -351,10 +353,22 @@ const clickNodeId = ref('')
|
|
|
const nodeId = ref('')
|
|
|
const deptId = ref('')
|
|
|
const nodeName = ref('')
|
|
|
+const userStore = useUserStore()
|
|
|
|
|
|
-const breadcrumbs = ref<BreadcrumbItem[]>([
|
|
|
- { id: null, name: '科瑞石油技术', type: 'root' } // 根节点
|
|
|
-])
|
|
|
+const breadcrumbs = ref<BreadcrumbItem[]>([{ id: null, name: '科瑞石油技术', type: 'root' }])
|
|
|
+
|
|
|
+const loadRootBreadcrumb = async () => {
|
|
|
+ const currentDeptId = userStore.getUser.deptId
|
|
|
+ if (!currentDeptId) return
|
|
|
+
|
|
|
+ try {
|
|
|
+ const currentDept = await getUserProfile()
|
|
|
+
|
|
|
+ console.log('sssssssssssssssssssssssss', currentDept)
|
|
|
+
|
|
|
+ breadcrumbs.value[0].name = currentDept.dept.name
|
|
|
+ } catch {}
|
|
|
+}
|
|
|
|
|
|
// 共享的面包屑更新逻辑
|
|
|
const updateBreadcrumbs = async (node: FileRow) => {
|
|
|
@@ -497,6 +511,7 @@ const resetQuery = () => {
|
|
|
/** 初始化 */
|
|
|
onMounted(async () => {
|
|
|
id.value = Number(params.id) || 0
|
|
|
+ await loadRootBreadcrumb()
|
|
|
})
|
|
|
</script>
|
|
|
<style scoped>
|