添加菜单配置,修复bug

This commit is contained in:
jiayu 2024-12-30 09:34:23 +08:00
parent c8796dfd5b
commit f4fb5a65f5
5 changed files with 321 additions and 310 deletions

View File

@ -3,7 +3,7 @@ NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用) # 本地环境接口地址(/api/index.ts文件中使用)
# 后端本地 # 后端本地
VITE_API_URL = 'http://192.168.34.155:19111' # VITE_API_URL = 'http://192.168.34.155:19111'
# VITE_API_URL = 'http://192.168.34.221:19112' #雄哥本地 # VITE_API_URL = 'http://192.168.34.221:19112' #雄哥本地
# VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地 # VITE_API_URL = 'http://192.168.34.221:28890' #雄哥本地
# VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程 # VITE_API_URL = 'http://182.90.224.237:51234' #雄哥远程
@ -36,7 +36,7 @@ VITE_API_URL = 'http://192.168.34.155:19111'
# 中科安信 # 中科安信
# VITE_API_URL = 'http://8.136.222.164:8808' # VITE_API_URL = 'http://8.136.222.164:8808'
# 中科佳成 # 中科佳成
# VITE_API_URL = 'http://1.13.185.209:8089' VITE_API_URL = 'http://1.13.185.209:8089'
# 九柱 # 九柱
# VITE_API_URL = 'http://jxjzw.zhgdyun.com:11111' # VITE_API_URL = 'http://jxjzw.zhgdyun.com:11111'
# 四川网诚 # 四川网诚

View File

@ -13,7 +13,7 @@ NODE_ENV = "production"
# VITE_API_URL = "http://183.249.224.118:9003" # VITE_API_URL = "http://183.249.224.118:9003"
# 百色 新项目通用地址 # 百色 新项目通用地址
VITE_API_URL = 'http://101.43.164.214:11111' # VITE_API_URL = 'http://101.43.164.214:11111'
# 七参数标准版(演示平台) # 七参数标准版(演示平台)
# VITE_API_URL = 'http://jxj.zhgdyun.com:9809' # VITE_API_URL = 'http://jxj.zhgdyun.com:9809'
@ -29,7 +29,7 @@ VITE_API_URL = 'http://101.43.164.214:11111'
# 中科安信 # 中科安信
# VITE_API_URL = 'http://8.136.222.164:8808' # VITE_API_URL = 'http://8.136.222.164:8808'
# 中科佳成 # 中科佳成
# VITE_API_URL = 'http://1.13.185.209:8089' VITE_API_URL = 'http://1.13.185.209:8089'
# 合肥启程(乌丹) # 合肥启程(乌丹)
# VITE_API_URL = 'http://192.168.100.4:9809' # VITE_API_URL = 'http://192.168.100.4:9809'
# 九柱 # 九柱
@ -46,6 +46,7 @@ VITE_API_URL = 'http://101.43.164.214:11111'
# VITE_API_URL = 'http://101.43.164.214:11126' # VITE_API_URL = 'http://101.43.164.214:11126'
# 新能源智慧基建管理平台 # 新能源智慧基建管理平台
# VITE_API_URL = 'http://121.37.106.37:9820' # VITE_API_URL = 'http://121.37.106.37:9820'
# VITE_API_URL = 'http://121.37.106.37:9809'
# 打包 # 打包
VITE_ULD_API_URL = 'http://jxj.zhgdyun.com:8012/onlinePreview?url=' VITE_ULD_API_URL = 'http://jxj.zhgdyun.com:8012/onlinePreview?url='

View File

@ -58,3 +58,7 @@ export const jumpLargeByUserIdApi = (params?: any) => {
export const getAllModule = (params?: any) => { export const getAllModule = (params?: any) => {
return http.post(BASEURL + `/xmgl/baseModule/getModuleAndMenuList`, params); return http.post(BASEURL + `/xmgl/baseModule/getModuleAndMenuList`, params);
}; };
export const getScreenAuthModuleAndMenuApi = (params?: any) => {
return http.get(BASEURL + "/xmgl/screenAuth/getModuleAndMenu", params);
};

View File

@ -23,7 +23,7 @@ export const BAIDU_MAP_KEY: string = "";
export const BASE_IMAGE_URL = import.meta.env.VITE_BASE_IMAGE_URL; export const BASE_IMAGE_URL = import.meta.env.VITE_BASE_IMAGE_URL;
// 项目环境标识配置 部署时需更改对应的项目 // 项目环境标识配置 部署时需更改对应的项目
export const COMPANY: string = ""; //标准版 // export const COMPANY: string = ""; //标准版
// export const COMPANY: string = "zhzrf"; //中海·臻如府 // export const COMPANY: string = "zhzrf"; //中海·臻如府
// export const COMPANY: string = "zsbf"; //中水北方 // export const COMPANY: string = "zsbf"; //中水北方
// export const COMPANY: string = "as"; //鞍山项目 // export const COMPANY: string = "as"; //鞍山项目
@ -38,7 +38,7 @@ export const COMPANY: string = ""; //标准版
// export const COMPANY: string = "agjtProjectKanban"; //鞍钢集团项目看板大屏 // export const COMPANY: string = "agjtProjectKanban"; //鞍钢集团项目看板大屏
// export const COMPANY: string = "agjtOverviewScreen"; //鞍钢集团项目总览 // export const COMPANY: string = "agjtOverviewScreen"; //鞍钢集团项目总览
// export const COMPANY: string = "agjtLocationLive"; //鞍钢集团人员定位大屏 // export const COMPANY: string = "agjtLocationLive"; //鞍钢集团人员定位大屏
// export const COMPANY: string = "zkjc"; //中科佳成项目 export const COMPANY: string = "zkjc"; //中科佳成项目
// export const COMPANY: string = "cqna"; //重庆南岸项目 // export const COMPANY: string = "cqna"; //重庆南岸项目
// export const COMPANY: string = "slx"; //苏立信项目 // export const COMPANY: string = "slx"; //苏立信项目
// export const COMPANY: string = "hfqc"; //合肥启程(乌丹)项目 // export const COMPANY: string = "hfqc"; //合肥启程(乌丹)项目

View File

@ -133,9 +133,10 @@ const toggleMapSwitch = () => {
// -- // --
import ScaleBox from "vue3-scale-box"; import ScaleBox from "vue3-scale-box";
import { ref, reactive, onMounted, onBeforeUnmount, computed } from "vue"; import { ElMessage } from "element-plus";
import { ref, reactive, onMounted, onBeforeUnmount, computed, nextTick } from "vue";
import { getTaskTimeDetail } from "@/api/modules/schedulePlan"; import { getTaskTimeDetail } from "@/api/modules/schedulePlan";
import { jumpLargeUserInfoApi, jumpLargeByUserIdApi, getAllModule } from "@/api/modules/login"; import { jumpLargeUserInfoApi, jumpLargeByUserIdApi, getAllModule, getScreenAuthModuleAndMenuApi } from "@/api/modules/login";
import { import {
JSYCMenu, JSYCMenu,
XJNBMenu, XJNBMenu,
@ -231,293 +232,264 @@ function getNowDate() {
let showUserBox = ref(false as any); let showUserBox = ref(false as any);
let adminName = ref("" as any); let adminName = ref("" as any);
let menuList = ref([]);
// let menuList = ref([ // let menuList = ref([
// { // {
// moduleName: "", // moduleName: "",
// modulePath: "/projectOverview" // modulePath: "/projectOverview",
// menuList: [
// {
// menuName: "",
// companyPath: "/projectOverview"
// }, // },
// { // {
// moduleName: "", // menuName: "",
// modulePath: "/smartPartyBuilding" // companyPath: "/smartPartyBuilding"
// }, // },
// { // {
// moduleName: "", // menuName: "",
// modulePath: "/headNoise" // companyPath: "/projectioter"
// }
// // {
// // menuName: "-1",
// // companyPath: "/projectOverviewer"
// // }
// ]
// },
// {
// moduleName: "",
// modulePath: "/videoManagement",
// menuList: [
// {
// menuName: "",
// companyPath: "/videoManagement"
// },
// {
// menuName: "AI",
// companyPath: "/aIEarlyWarning"
// },
// {
// menuName: "",
// companyPath: "/loadometerManage"
// },
// {
// menuName: "",
// companyPath: "/vehicleManagement"
// },
// {
// menuName: "",
// companyPath: "/vehicleManagspeed"
// },
// {
// menuName: "",
// companyPath: "/distributionMonitoring"
// },
// {
// menuName: "",
// companyPath: "/standardCureRoom"
// },
// {
// menuName: "",
// companyPath: "/carPosition"
// },
// {
// menuName: "",
// companyPath: "/equipmentPosition"
// },
// {
// menuName: "",
// companyPath: "/smartSafeHat"
// },
// {
// menuName: "",
// companyPath: "/smartSafeHater"
// }
// ]
// }, // },
// { // {
// moduleName: "", // moduleName: "",
// modulePath: "/laborManagement" // modulePath: "/laborManagement",
// }, // menuList: [
// { // {
// moduleName: "", // menuName: "",
// modulePath: "/videoManagement" // companyPath: "/laborManagement"
// },
// {
// moduleName: "",
// modulePath: "/distributionMonitoring"
// },
// {
// moduleName: "AI",
// modulePath: "/aIEarlyWarning"
// } // }
// ]
// },
// {
// moduleName: "",
// modulePath: "/securityManagement",
// menuList: [
// {
// menuName: "",
// companyPath: "/securityManagement"
// },
// {
// companyPath: "/foundationPitMonitor",
// menuName: ""
// },
// {
// menuName: "",
// companyPath: "/tunnelPosition"
// },
// {
// menuName: "",
// companyPath: "/edgeProtection"
// },
// {
// menuName: "",
// companyPath: "/toxicGasMonitor"
// },
// {
// menuName: "",
// companyPath: "/highFormwork"
// },
// {
// menuName: "",
// companyPath: "/highSlope"
// },
// {
// menuName: "",
// companyPath: "/smokeSensor"
// },
// {
// menuName: "",
// companyPath: "/safeEducation"
// },
// {
// menuName: "",
// companyPath: "/wallScaffold2"
// },
// {
// menuName: "",
// companyPath: "/newEdgeProtection"
// }
// ]
// },
// {
// moduleName: "",
// modulePath: "/qualityManagement",
// menuList: [
// {
// menuName: "",
// companyPath: "/qualityManagement"
// },
// {
// menuName: "",
// companyPath: "/concreteMonitor"
// },
// {
// menuName: "",
// companyPath: "/schedulePlan"
// }
// ]
// },
// {
// moduleName: "绿",
// modulePath: "/headNoise",
// menuList: [
// {
// menuName: "",
// companyPath: "/headNoise"
// },
// {
// companyPath: "/electricityMonitor",
// menuName: ""
// },
// {
// companyPath: "/waterMonitor",
// menuName: ""
// },
// {
// companyPath: "/sewageMonitor",
// menuName: ""
// },
// {
// companyPath: "/rainfallMonitoring",
// menuName: ""
// }
// ]
// },
// {
// moduleName: "",
// modulePath: "/towerCraneMonitoring",
// menuList: [
// {
// menuName: "",
// companyPath: "/towerCraneMonitoring"
// },
// {
// menuName: "",
// companyPath: "/cathangCrane"
// },
// {
// menuName: "",
// companyPath: "/trackCrane"
// },
// {
// menuName: "",
// companyPath: "/elevatorMonitoring"
// },
// {
// menuName: "",
// companyPath: "/unloadPlatform"
// },
// {
// menuName: "",
// companyPath: "/concreteMixingPlant"
// },
// {
// menuName: "",
// companyPath: "/gantryCrane"
// },
// {
// companyPath: "/erectCrane",
// menuName: ""
// },
// {
// companyPath: "/hangBasket",
// menuName: ""
// },
// {
// companyPath: "/pressureTestMachine",
// menuName: ""
// },
// {
// companyPath: "/universalTestMachine",
// menuName: ""
// },
// {
// companyPath: "/compressionIntegrate",
// menuName: ""
// },
// {
// companyPath: "/asphaltMixer",
// menuName: ""
// },
// {
// companyPath: "/waterStabilizedMixer",
// menuName: ""
// },
// {
// companyPath: "/intelligentTension",
// menuName: ""
// },
// {
// companyPath: "/intelligentGrout",
// menuName: ""
// },
// {
// companyPath: "/roadPaving",
// menuName: ""
// },
// {
// companyPath: "/roadCompaction",
// menuName: ""
// }
// ]
// },
// { moduleName: "BIM", modulePath: "/bImModel" }
// ]); // ]);
let menuList = ref([
{
moduleName: "综合管理",
modulePath: "/projectOverview",
menuList: [
{
menuName: "工程概况",
companyPath: "/projectOverview"
},
{
menuName: "智慧党建",
companyPath: "/smartPartyBuilding"
},
{
menuName: "双碳管理",
companyPath: "/projectioter"
}
// {
// menuName: "-1",
// companyPath: "/projectOverviewer"
// }
]
},
{
moduleName: "数字工地",
modulePath: "/videoManagement",
menuList: [
{
menuName: "视频管理",
companyPath: "/videoManagement"
},
{
menuName: "AI预警",
companyPath: "/aIEarlyWarning"
},
{
menuName: "地磅管理",
companyPath: "/loadometerManage"
},
{
menuName: "车辆管理",
companyPath: "/vehicleManagement"
},
{
menuName: "车辆测速",
companyPath: "/vehicleManagspeed"
},
{
menuName: "配电箱监测",
companyPath: "/distributionMonitoring"
},
{
menuName: "标养室监测",
companyPath: "/standardCureRoom"
},
{
menuName: "车辆定位",
companyPath: "/carPosition"
},
{
menuName: "机械设备定位",
companyPath: "/equipmentPosition"
},
{
menuName: "智能安全帽",
companyPath: "/smartSafeHat"
},
{
menuName: "新智能安全帽",
companyPath: "/smartSafeHater"
}
]
},
{
moduleName: "劳务管理",
modulePath: "/laborManagement",
menuList: [
{
menuName: "劳务管理",
companyPath: "/laborManagement"
}
]
},
{
moduleName: "安全管理",
modulePath: "/securityManagement",
menuList: [
{
menuName: "安全管理",
companyPath: "/securityManagement"
},
{
companyPath: "/foundationPitMonitor",
menuName: "基坑监测"
},
{
menuName: "隧道定位监测",
companyPath: "/tunnelPosition"
},
{
menuName: "临边防护网",
companyPath: "/edgeProtection"
},
{
menuName: "有毒气体监测",
companyPath: "/toxicGasMonitor"
},
{
menuName: "高支模监测",
companyPath: "/highFormwork"
},
{
menuName: "高边坡监测",
companyPath: "/highSlope"
},
{
menuName: "烟感监测",
companyPath: "/smokeSensor"
},
{
menuName: "安全教育",
companyPath: "/safeEducation"
},
{
menuName: "外墙脚手架",
companyPath: "/wallScaffold2"
},
{
menuName: "临边防护",
companyPath: "/newEdgeProtection"
}
]
},
{
moduleName: "质量管理",
modulePath: "/qualityManagement",
menuList: [
{
menuName: "质量管理",
companyPath: "/qualityManagement"
},
{
menuName: "混凝土测温",
companyPath: "/concreteMonitor"
},
{
menuName: "进度计划",
companyPath: "/schedulePlan"
}
]
},
{
moduleName: "绿色施工",
modulePath: "/headNoise",
menuList: [
{
menuName: "扬尘噪声",
companyPath: "/headNoise"
},
{
companyPath: "/electricityMonitor",
menuName: "用电监测"
},
{
companyPath: "/waterMonitor",
menuName: "用水监测"
},
{
companyPath: "/sewageMonitor",
menuName: "污水监测"
},
{
companyPath: "/rainfallMonitoring",
menuName: "雨量监测"
}
]
},
{
moduleName: "大型机械",
modulePath: "/towerCraneMonitoring",
menuList: [
{
menuName: "塔吊监测",
companyPath: "/towerCraneMonitoring"
},
{
menuName: "汽车吊监测",
companyPath: "/cathangCrane"
},
{
menuName: "履带吊监测",
companyPath: "/trackCrane"
},
{
menuName: "升降机监测",
companyPath: "/elevatorMonitoring"
},
{
menuName: "卸料平台",
companyPath: "/unloadPlatform"
},
{
menuName: "混凝土拌合站",
companyPath: "/concreteMixingPlant"
},
{
menuName: "龙门吊监测",
companyPath: "/gantryCrane"
},
{
companyPath: "/erectCrane",
menuName: "架桥机"
},
{
companyPath: "/hangBasket",
menuName: "挂篮监测"
},
{
companyPath: "/pressureTestMachine",
menuName: "压力试验机"
},
{
companyPath: "/universalTestMachine",
menuName: "万能试验机"
},
{
companyPath: "/compressionIntegrate",
menuName: "抗压一体机"
},
{
companyPath: "/asphaltMixer",
menuName: "沥青拌合站"
},
{
companyPath: "/waterStabilizedMixer",
menuName: "水稳拌合站"
},
{
companyPath: "/intelligentTension",
menuName: "智能张拉"
},
{
companyPath: "/intelligentGrout",
menuName: "智能压浆"
},
{
companyPath: "/roadPaving",
menuName: "路面摊铺"
},
{
companyPath: "/roadCompaction",
menuName: "路面压实"
}
]
},
{ moduleName: "BIM模型", modulePath: "/bImModel" }
]);
const itemList = ref([]); const itemList = ref([]);
const activeTab = ref(0); const activeTab = ref(0);
const activeTab2 = ref(0); const activeTab2 = ref(0);
@ -542,9 +514,11 @@ const navigateTo = (path, type) => {
console.log("点击的路由---", path, type); console.log("点击的路由---", path, type);
if (type == 1) { if (type == 1) {
activeTab.value = path.modulePath; activeTab.value = path.modulePath;
activeTab2.value = path.modulePath; activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath;
itemList.value = path.menuList; itemList.value = path.menuList;
router.push(path.modulePath); router.push({
path: activeTab2.value
});
} else { } else {
activeTab2.value = path.companyPath; activeTab2.value = path.companyPath;
router.push({ router.push({
@ -555,14 +529,34 @@ const navigateTo = (path, type) => {
// //
const getModuleMenu = async () => { const getModuleMenu = async () => {
const res = await getAllModule({ moduleType: 8, userId: store.userId, projectSn: store.sn }); const res = await getScreenAuthModuleAndMenuApi();
console.info(res, "allModule"); console.info(res, "allModule");
if (res.code == 200) { if (res.code == 200) {
const { moduleList } = res.result; const list = res.result || [];
if (moduleList.length) { if (list.length) {
menuList.value = moduleList; menuList.value = list.map(item => {
let childrenList = item.children?.map(val => {
return {
menuName: val.name,
companyPath: val.routePath
};
});
return {
moduleName: item.name,
modulePath: item.routePath,
menuList: childrenList
};
});
} }
} }
// const res = await getAllModule({ moduleType: 8, userId: store.userId, projectSn: store.sn });
// console.info(res, "allModule");
// if (res.code == 200) {
// const { moduleList } = res.result;
// if (moduleList.length) {
// menuList.value = moduleList;
// }
// }
}; };
onMounted(async () => { onMounted(async () => {
if (window.location.href.indexOf("token") != -1) { if (window.location.href.indexOf("token") != -1) {
@ -669,6 +663,14 @@ onMounted(async () => {
} }
console.log("配置菜单", menuList.value); console.log("配置菜单", menuList.value);
console.log("当前跳转的路由", router.currentRoute.value); console.log("当前跳转的路由", router.currentRoute.value);
adminName.value = store.account;
if (!menuList.value.length) {
//
return ElMessage({
message: "暂无权限,请联系管理员配置权限",
type: "warning"
});
}
// await getAllModelMenu(); // await getAllModelMenu();
// activeTab2.value = router.currentRoute.value; // activeTab2.value = router.currentRoute.value;
activeTab.value = menuList.value[0].modulePath; activeTab.value = menuList.value[0].modulePath;
@ -678,11 +680,11 @@ onMounted(async () => {
navigateTo(menuList.value[0], 1); navigateTo(menuList.value[0], 1);
// console.log(" "); // console.log(" ");
adminName.value = store.account;
// console.log("store", store.account); // console.log("store", store.account);
// menuClick(menuList.value[0], activeIndex.value); // menuClick(menuList.value[0], activeIndex.value);
getNowTime(); getNowTime();
document.addEventListener("click", bodyCloseMenus); document.addEventListener("click", bodyCloseMenus);
nextTick(async () => {
const subMenus = document.querySelectorAll(".menStyle"); const subMenus = document.querySelectorAll(".menStyle");
const dataBoardContent = document.querySelector(".dataBoardContent"); const dataBoardContent = document.querySelector(".dataBoardContent");
if (subMenus.length >= 5 && COMPANY !== "hfqc") { if (subMenus.length >= 5 && COMPANY !== "hfqc") {
@ -699,11 +701,13 @@ onMounted(async () => {
dataBoardContent.style.margin = "30px auto 16px auto"; dataBoardContent.style.margin = "30px auto 16px auto";
} }
if (COMPANY === "zkjc") { if (COMPANY === "zkjc") {
console.info(subMenus, "==========");
subMenus[1].style.marginLeft = "5%"; subMenus[1].style.marginLeft = "5%";
subMenus[1].style.marginRight = "auto"; subMenus[1].style.marginRight = "auto";
subMenus[2].style.marginRight = "5%"; subMenus[2].style.marginRight = "5%";
subMenus[3].style.marginRight = "5%"; subMenus[3].style.marginRight = "5%";
} }
});
await getProjectInfo(); await getProjectInfo();
calculateAspectRatio(); calculateAspectRatio();
@ -751,7 +755,9 @@ function jumpBgd() {
const envList = ["agjt", "zkax", "zkjc", "hfqc", "cpgs", "cqna", "jzjt", "tj", "scwc", "bthg", "zmml"]; // const envList = ["agjt", "zkax", "zkjc", "hfqc", "cpgs", "cqna", "jzjt", "tj", "scwc", "bthg", "zmml"]; //
// //
if (COMPANY == "") { if (COMPANY == "") {
window.location.replace("http://jxj.zhgdyun.com:100/#/login?token=" + store.token); // window.location.replace("http://192.168.34.216:8080/#/login?token=" + store.token);
// window.location.replace("http://jxj.zhgdyun.com:100/#/login?token=" + store.token);
window.location.replace(BASEURL + "/#/login?token=" + store.token);
} else if (COMPANY === "tj") { } else if (COMPANY === "tj") {
window.location.replace("http://192.168.110.220:9809/#/login?token=" + store.token); window.location.replace("http://192.168.110.220:9809/#/login?token=" + store.token);
} else if (COMPANY === "as") { } else if (COMPANY === "as") {