|
@@ -32,7 +32,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, computed, onMounted, onBeforeUnmount,getCurrentInstance } from 'vue'
|
|
|
+import { ref, computed, onMounted, onBeforeUnmount, getCurrentInstance } from 'vue'
|
|
|
import { useMenuStore } from "@/stores/menu.js"
|
|
|
import { useRoute, useRouter } from "vue-router";
|
|
|
import { getSessionVar, clearSessionVar, saveSessionVar } from '@/utils/session'
|
|
@@ -67,66 +67,65 @@ const fetchOrgList = async () => {
|
|
|
const { records } = await proxy.$http.get('/open-platform/sys/loadSURO')
|
|
|
orgList.value = records
|
|
|
// 默认选中第一个
|
|
|
- const res = await proxy.$http.get('/open-platform/sys/currSURO')
|
|
|
- console.log('当前机构11:', res)
|
|
|
- currentOrg.value = res
|
|
|
- saveSessionVar('org_id', res)
|
|
|
+ const res = await proxy.$http.get('/open-platform/sys/currSURO')
|
|
|
+ // console.log('当前机构11:', res)
|
|
|
+ currentOrg.value = res
|
|
|
+ saveSessionVar('org_id', res)
|
|
|
|
|
|
- console.log('机构列表:', orgList.value)
|
|
|
- console.log('当前机构:', currentOrg.value)
|
|
|
+ // console.log('机构列表:', orgList.value)
|
|
|
+ // console.log('当前机构:', currentOrg.value)
|
|
|
}
|
|
|
|
|
|
// 切换机构
|
|
|
const changeOrg = async (orgId) => {
|
|
|
// 可调用后端切换机构接口
|
|
|
- const res = await proxy.$http.post(`/open-platform/sys/changeSURO/${orgId}`)
|
|
|
- console.log('切换机构结果:', res)
|
|
|
+ const res = await proxy.$http.post(`/open-platform/sys/changeSURO/${orgId}`)
|
|
|
+ console.log('切换机构结果:', res)
|
|
|
saveSessionVar('org_id', orgId)
|
|
|
- saveSessionVar("knowledageSystem", '');
|
|
|
- saveSessionVar('routeList', '')
|
|
|
+ saveSessionVar("knowledageSystem", '');
|
|
|
+ saveSessionVar('routeList', '')
|
|
|
// 可选:刷新页面或重新拉取权限/菜单等
|
|
|
updateRouteList([]);
|
|
|
let knowledageSystem = '';
|
|
|
- let routeList = [{
|
|
|
- path: '/kmplatform/home',
|
|
|
- name: 'kmplatform-home',
|
|
|
- title: "主页",
|
|
|
- children: []
|
|
|
- }]
|
|
|
- res.records[0].menu_permissions.sort((a, b) => {
|
|
|
- return a.id - b.id;
|
|
|
- });
|
|
|
- res.records[0].menu_permissions.forEach((item) => {
|
|
|
- if (item.menu_name == "知识更新管理") {
|
|
|
- knowledageSystem = 'true';
|
|
|
- routeList.push({
|
|
|
- path: knowledgeGraphAddr,
|
|
|
- name: '',
|
|
|
- title: item.name,
|
|
|
- children: item.children,
|
|
|
- });
|
|
|
- } else if (item.menu_route) {
|
|
|
- routeList.push({
|
|
|
- path: item.menu_route,
|
|
|
- name: item.menu_route.split("/")[2],
|
|
|
- title: item.name,
|
|
|
- children: item.children,
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- console.log("knowledageSystem", knowledageSystem);
|
|
|
- saveSessionVar("knowledageSystem", knowledageSystem);
|
|
|
- saveSessionVar('routeList', JSON.stringify(routeList))
|
|
|
+ let routeList = [{
|
|
|
+ path: '/kmplatform/home',
|
|
|
+ name: 'kmplatform-home',
|
|
|
+ title: "主页",
|
|
|
+ children: []
|
|
|
+ }]
|
|
|
+ res.records[0].menu_permissions.sort((a, b) => {
|
|
|
+ return a.id - b.id;
|
|
|
+ });
|
|
|
+ res.records[0].menu_permissions.forEach((item) => {
|
|
|
+ if (item.menu_name == "知识更新管理") {
|
|
|
+ knowledageSystem = 'true';
|
|
|
+ routeList.push({
|
|
|
+ path: knowledgeGraphAddr,
|
|
|
+ name: '',
|
|
|
+ title: item.name,
|
|
|
+ children: item.children,
|
|
|
+ });
|
|
|
+ } else if (item.menu_route) {
|
|
|
+ routeList.push({
|
|
|
+ path: item.menu_route,
|
|
|
+ name: item.menu_route.split("/")[2],
|
|
|
+ title: item.name,
|
|
|
+ children: item.children,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log("knowledageSystem", knowledageSystem);
|
|
|
+ saveSessionVar("knowledageSystem", knowledageSystem);
|
|
|
+ saveSessionVar('routeList', JSON.stringify(routeList))
|
|
|
+ updateRouteList(routeList);
|
|
|
|
|
|
- updateRouteList(routeList);
|
|
|
-
|
|
|
// 刷新页面
|
|
|
window.location.href = '/kmplatform/home';
|
|
|
}
|
|
|
|
|
|
let editPassShow = ref(false)
|
|
|
const currentPath = computed(() => {
|
|
|
- console.log('当前路由:', route)
|
|
|
+ // console.log('当前路由:', route)
|
|
|
let temp = ""
|
|
|
for (let i = 0; i < routeList.length; i++) {
|
|
|
for (let j = 0; j < route.matched.length; j++) {
|