diff --git a/.env.development b/.env.development index 1622c3b..58cd583 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ NODE_ENV = 'development' # 本地环境接口地址(/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:28890' #雄哥本地 # 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://1.13.185.209:8089' +VITE_API_URL = 'http://1.13.185.209:8089' # 九柱 # VITE_API_URL = 'http://jxjzw.zhgdyun.com:11111' # 四川网诚 diff --git a/.env.production b/.env.production index 327ef6b..ca58d4c 100644 --- a/.env.production +++ b/.env.production @@ -13,7 +13,7 @@ NODE_ENV = "production" # 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' @@ -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://1.13.185.209:8089' +VITE_API_URL = 'http://1.13.185.209:8089' # 合肥启程(乌丹) # 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://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=' diff --git a/src/api/modules/login.ts b/src/api/modules/login.ts index 2de8e36..9a50875 100644 --- a/src/api/modules/login.ts +++ b/src/api/modules/login.ts @@ -58,3 +58,7 @@ export const jumpLargeByUserIdApi = (params?: any) => { export const getAllModule = (params?: any) => { return http.post(BASEURL + `/xmgl/baseModule/getModuleAndMenuList`, params); }; + +export const getScreenAuthModuleAndMenuApi = (params?: any) => { + return http.get(BASEURL + "/xmgl/screenAuth/getModuleAndMenu", params); +}; diff --git a/src/config/config.ts b/src/config/config.ts index 61c89bc..f66512b 100644 --- a/src/config/config.ts +++ b/src/config/config.ts @@ -23,7 +23,7 @@ export const BAIDU_MAP_KEY: string = ""; 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 = "zsbf"; //中水北方 // export const COMPANY: string = "as"; //鞍山项目 @@ -38,7 +38,7 @@ export const COMPANY: string = ""; //标准版 // export const COMPANY: string = "agjtProjectKanban"; //鞍钢集团项目看板大屏 // export const COMPANY: string = "agjtOverviewScreen"; //鞍钢集团项目总览 // export const COMPANY: string = "agjtLocationLive"; //鞍钢集团人员定位大屏 -// export const COMPANY: string = "zkjc"; //中科佳成项目 +export const COMPANY: string = "zkjc"; //中科佳成项目 // export const COMPANY: string = "cqna"; //重庆南岸项目 // export const COMPANY: string = "slx"; //苏立信项目 // export const COMPANY: string = "hfqc"; //合肥启程(乌丹)项目 diff --git a/src/views/sevenLargeScreen/indexL.vue b/src/views/sevenLargeScreen/indexL.vue index 3b33ddf..a6b7472 100644 --- a/src/views/sevenLargeScreen/indexL.vue +++ b/src/views/sevenLargeScreen/indexL.vue @@ -133,9 +133,10 @@ const toggleMapSwitch = () => { // 大屏模块-- 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 { jumpLargeUserInfoApi, jumpLargeByUserIdApi, getAllModule } from "@/api/modules/login"; +import { jumpLargeUserInfoApi, jumpLargeByUserIdApi, getAllModule, getScreenAuthModuleAndMenuApi } from "@/api/modules/login"; import { JSYCMenu, XJNBMenu, @@ -231,293 +232,264 @@ function getNowDate() { let showUserBox = ref(false as any); let adminName = ref("" as any); +let menuList = ref([]); // let menuList = ref([ // { -// moduleName: "工程概况", -// modulePath: "/projectOverview" +// moduleName: "综合管理", +// modulePath: "/projectOverview", +// menuList: [ +// { +// menuName: "工程概况", +// companyPath: "/projectOverview" +// }, +// { +// menuName: "智慧党建", +// companyPath: "/smartPartyBuilding" +// }, +// { +// menuName: "双碳管理", +// companyPath: "/projectioter" +// } +// // { +// // menuName: "工程概况-1", +// // companyPath: "/projectOverviewer" +// // } +// ] // }, // { -// moduleName: "智慧党建", -// modulePath: "/smartPartyBuilding" -// }, -// { -// moduleName: "扬尘噪声", -// modulePath: "/headNoise" +// 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" +// modulePath: "/laborManagement", +// menuList: [ +// { +// menuName: "劳务管理", +// companyPath: "/laborManagement" +// } +// ] // }, // { -// moduleName: "视频管理", -// modulePath: "/videoManagement" +// 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: "/distributionMonitoring" +// moduleName: "质量管理", +// modulePath: "/qualityManagement", +// menuList: [ +// { +// menuName: "质量管理", +// companyPath: "/qualityManagement" +// }, +// { +// menuName: "混凝土测温", +// companyPath: "/concreteMonitor" +// }, +// { +// menuName: "进度计划", +// companyPath: "/schedulePlan" +// } +// ] // }, // { -// moduleName: "AI预警", -// modulePath: "/aIEarlyWarning" -// } +// 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 activeTab = ref(0); const activeTab2 = ref(0); @@ -542,9 +514,11 @@ const navigateTo = (path, type) => { console.log("点击的路由---", path, type); if (type == 1) { activeTab.value = path.modulePath; - activeTab2.value = path.modulePath; + activeTab2.value = path.menuList.length ? path.menuList[0].companyPath : path.modulePath; itemList.value = path.menuList; - router.push(path.modulePath); + router.push({ + path: activeTab2.value + }); } else { activeTab2.value = path.companyPath; router.push({ @@ -555,14 +529,34 @@ const navigateTo = (path, type) => { // 获取动态菜单 const getModuleMenu = async () => { - const res = await getAllModule({ moduleType: 8, userId: store.userId, projectSn: store.sn }); + const res = await getScreenAuthModuleAndMenuApi(); console.info(res, "allModule"); if (res.code == 200) { - const { moduleList } = res.result; - if (moduleList.length) { - menuList.value = moduleList; + const list = res.result || []; + if (list.length) { + 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 () => { if (window.location.href.indexOf("token") != -1) { @@ -669,6 +663,14 @@ onMounted(async () => { } console.log("配置菜单", menuList.value); console.log("当前跳转的路由", router.currentRoute.value); + adminName.value = store.account; + if (!menuList.value.length) { + // 暂无权限,请联系管理员配置权限 + return ElMessage({ + message: "暂无权限,请联系管理员配置权限", + type: "warning" + }); + } // await getAllModelMenu(); // activeTab2.value = router.currentRoute.value; activeTab.value = menuList.value[0].modulePath; @@ -678,32 +680,34 @@ onMounted(async () => { navigateTo(menuList.value[0], 1); // console.log("进入页面, "); - adminName.value = store.account; // console.log("store数据", store.account); // menuClick(menuList.value[0], activeIndex.value); getNowTime(); document.addEventListener("click", bodyCloseMenus); - const subMenus = document.querySelectorAll(".menStyle"); - const dataBoardContent = document.querySelector(".dataBoardContent"); - if (subMenus.length >= 5 && COMPANY !== "hfqc") { - subMenus[4].style.marginLeft = "30%"; - } - if (COMPANY === "hfqc") { - subMenus[3].style.marginLeft = "44%"; - } - if (COMPANY === "zhzrf") { - // subMenus[4].style.marginLeft = "34%"; - } - if (COMPANY === "agjt") { - dataBoardContent.style.height = "85%"; - dataBoardContent.style.margin = "30px auto 16px auto"; - } - if (COMPANY === "zkjc") { - subMenus[1].style.marginLeft = "5%"; - subMenus[1].style.marginRight = "auto"; - subMenus[2].style.marginRight = "5%"; - subMenus[3].style.marginRight = "5%"; - } + nextTick(async () => { + const subMenus = document.querySelectorAll(".menStyle"); + const dataBoardContent = document.querySelector(".dataBoardContent"); + if (subMenus.length >= 5 && COMPANY !== "hfqc") { + subMenus[4].style.marginLeft = "30%"; + } + if (COMPANY === "hfqc") { + subMenus[3].style.marginLeft = "44%"; + } + if (COMPANY === "zhzrf") { + // subMenus[4].style.marginLeft = "34%"; + } + if (COMPANY === "agjt") { + dataBoardContent.style.height = "85%"; + dataBoardContent.style.margin = "30px auto 16px auto"; + } + if (COMPANY === "zkjc") { + console.info(subMenus, "=========="); + subMenus[1].style.marginLeft = "5%"; + subMenus[1].style.marginRight = "auto"; + subMenus[2].style.marginRight = "5%"; + subMenus[3].style.marginRight = "5%"; + } + }); await getProjectInfo(); calculateAspectRatio(); @@ -751,7 +755,9 @@ function jumpBgd() { const envList = ["agjt", "zkax", "zkjc", "hfqc", "cpgs", "cqna", "jzjt", "tj", "scwc", "bthg", "zmml"]; // 环境标识 // 标准版——跳转演示平台项目后台 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") { window.location.replace("http://192.168.110.220:9809/#/login?token=" + store.token); } else if (COMPANY === "as") {