From 57f2384a82ce8bed9c6292ff6a97296de05325be Mon Sep 17 00:00:00 2001 From: jiayu Date: Mon, 30 Dec 2024 17:03:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E8=8F=9C=E5=8D=95=E5=8F=AF?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/assets/js/api/jxjadmin.js | 6 + src/components/account.vue | 65 ++ src/components/header.vue | 180 ++---- src/components/selectTree/selectTree.vue | 207 +++++++ src/store/index.js | 12 +- src/views/companyAdmin/companyDiagram.vue | 31 +- src/views/jxjadmin/largeScreenConfig.vue | 578 ++++++++++++++++++ src/views/jxjadmin/registerAudit.vue | 34 +- src/views/projectAdmin/projectList.vue | 52 ++ .../projectFront/carManage/vehicleReal.vue | 2 +- .../configManage/personnelAccess.vue | 3 +- .../projectFront/configManage/roleManage.vue | 15 + 13 files changed, 1024 insertions(+), 162 deletions(-) create mode 100644 src/components/selectTree/selectTree.vue create mode 100644 src/views/jxjadmin/largeScreenConfig.vue diff --git a/package.json b/package.json index 3091128e..8151a765 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "vue-seamless-scroll": "^1.1.23", "vue-simple-uploader": "^0.7.6", "vue2-scale-box": "^0.1.7", + "vuedraggable": "^2.24.3", "vuescroll": "^4.16.1", "vuex": "^3.4.0", "vuex-persistedstate": "^3.1.0", diff --git a/src/assets/js/api/jxjadmin.js b/src/assets/js/api/jxjadmin.js index a8eadbd6..699d1d75 100644 --- a/src/assets/js/api/jxjadmin.js +++ b/src/assets/js/api/jxjadmin.js @@ -98,3 +98,9 @@ export const getDictionaryItemPageApi = (data) => get('/xmgl/dictionaryItem/page export const getDictionaryItemBackApi = (data) => post('/xmgl/dictionary/back', data) export const deleteDictionaryItemBackApi = (data) => post('/xmgl/dictionary/deletePhysic', data) export const batchDeleteDictionaryItemBackApi = (data) => post('/xmgl/dictionary/batch/delete', data) + +export const getScreenAuthTreeApi = (data) => post('/xmgl/screenAuth/tree', data) +export const addScreenAuthApi = (data) => post('/xmgl/screenAuth/add', data) +export const getScreenAuthModuleAndMenuTreeApi = (data) => get('/xmgl/screenAuth/moduleAndMenuTree', data) +export const getScreenAuthModuleAndMenuApi = (data) => get('/xmgl/screenAuth/getModuleAndMenu', data) +export const getScreenAuthTypeApi = (data) => post('/xmgl/screenAuth/getType', data) \ No newline at end of file diff --git a/src/components/account.vue b/src/components/account.vue index 2a5eba2f..ecf3b731 100644 --- a/src/components/account.vue +++ b/src/components/account.vue @@ -174,6 +174,18 @@ {{ projectFront }} + +
+ + 数据看板 +
@@ -204,6 +216,8 @@ import { getNewUserAllModulePageApi, } from "@/assets/js/api/jxjadmin.js"; +import { getProjectDetail } from "@/assets/js/api/baseInfo.js"; +import { getScreenAuthModuleAndMenuApi } from '@/assets/js/api/jxjadmin.js' export default { data() { return { @@ -265,6 +279,57 @@ export default { // console.log('企业后台',this.enterpriseBackground) }, methods: { + async getAuthModuleAndMenu() { + let bool = false + const res = await getScreenAuthModuleAndMenuApi() + if (res.code === 200) { + bool = res.result.length ? true : false + } + return bool + }, + toOverview() { + console.info(this.$store.state.userInfo.accountType,'----') + if(![5, 6, 10].includes(this.$store.state.userInfo.accountType)) { + return this.goProjectBackstage() + } + this.toOverview2() + }, + async toOverview2() { + this.$forceUpdate(); + await this.getProjectDetail(); + + if (this.newBigScreen == null || this.newBigScreen == "") { + this.$message({ + message: "当前项目没有看板", + type: "warning", + }); + } else { + const isPermission = await this.getAuthModuleAndMenu() + if(!isPermission) { + return this.$message({ + message: "当前用户没有访问数据看板权限", + type: "warning", + }); + } + console.log("当前跳转链接", this.newBigScreen); + //-------------------- 跳转新版七参数 + this.jumpToken = localStorage.getItem("jumpToken"); + let userId = this.$store.state.userInfo.userId; + window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self"); + // window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//这里是后台跳到大屏的操作,携带token过去 + } + }, + async getProjectDetail() { + let data = { + projectSn: this.$store.state.projectSn, + }; + await getProjectDetail(data).then((res) => { + if (res.result) { + this.newBigScreen = res.result.newBigScreen; + console.log("接口获取数据看板地址", this.newBigScreen); + } + }); + }, // 修改密码 updatePw() { this.$router.push({ diff --git a/src/components/header.vue b/src/components/header.vue index 01461f49..9e4f49aa 100644 --- a/src/components/header.vue +++ b/src/components/header.vue @@ -212,6 +212,7 @@ import centerChange from "@/components/centerChange.vue"; import { getProjectDetail, getProjectExtendInfoApi } from "@/assets/js/api/baseInfo.js"; import { getNewUserAllModulePageApi, + getScreenAuthModuleAndMenuApi } from "@/assets/js/api/jxjadmin.js"; export default { @@ -546,93 +547,51 @@ export default { window.open(this.newBigScreen + "?token=" + this.jumpToken, "_self"); // window.open('http://192.168.34.138:8081/#/large?token=' + this.jumpToken + '&sn=' + this.$store.state.projectSn, "_self")//这里是后台跳到大屏的操作,携带token过去 } - // if (this.newBigScreen != null) { - // console.log("当前跳转链接",this.newBigScreen) - // //-------------------- 跳转新版七参数 - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open(this.newBigScreen + '?token=' + this.jumpToken, '_self') - // // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//这里是后台跳到大屏的操作,携带token过去 - // } else { - // //--------------------原版项目后台跳转数据看板 - - // //看看项目看板内有没有菜单 - // let arr = this.$store.state.userInfo.menuAuthority.moduleList - // let arr2 = [] - // arr.forEach(element => { - // if (element.moduleType == 4) { - // arr2.push(element) - // return - // } - // }) - // // 如果数组为空表示该用户没有权限访问 - // if (!arr2.length) { - // return this.$message.warning('暂无权限') - // } - // let routeUrl = this.$router.resolve({ - // path: arr2[0].modulePath - // }) - // window.location.href = routeUrl.href - // window._paq.push(['trackEvent', '点击', '数据看板', '进入数据看板']) - // } - // if (this.company == 'syhy') { - // //-------------------- 跳转新版七参数 - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://101.43.164.214:45022/#/large?token=' + this.jumpToken, '_self') //沈阳和盈 - // // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//这里是后台跳到大屏的操作,携带token过去 - // } else if (this.company == 'jxwjj') { - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://183.249.224.118:9003/#/large?token=' + this.jumpToken, '_self') //嘉兴王江泾公用码头项目 - // } else if (this.company == 'gxbs') { - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://101.43.164.214:11113/#/large?token=' + this.jumpToken, '_self') //广西百色项目 - // } else { - // //--------------------原版项目后台跳转数据看板 - - // //看看项目看板内有没有菜单 - // let arr = this.$store.state.userInfo.menuAuthority.moduleList - // let arr2 = [] - // arr.forEach(element => { - // if (element.moduleType == 4) { - // arr2.push(element) - // return - // } - // }) - // // 如果数组为空表示该用户没有权限访问 - // if (!arr2.length) { - // return this.$message.warning('暂无权限') - // } - // let routeUrl = this.$router.resolve({ - // path: arr2[0].modulePath - // }) - // window.location.href = routeUrl.href - // window._paq.push(['trackEvent', '点击', '数据看板', '进入数据看板']) - // } }, - toOverview2() { + async getAuthModuleAndMenu() { + let bool = false + const res = await getScreenAuthModuleAndMenuApi() + if (res.code === 200) { + bool = res.result.length ? true : false + } + return bool + }, + async toOverview2() { this.$forceUpdate(); this.newBigScreen = this.getNewBigScreen; if (this.newBigScreen == null || this.newBigScreen == "") { - //--------------------原版项目后台跳转数据看板 - //看看项目看板内有没有菜单 - let arr = this.$store.state.userInfo.menuAuthority.moduleList; - let arr2 = []; - arr.forEach((element) => { - if (element.moduleType == 4) { - arr2.push(element); - return; - } + // //--------------------原版项目后台跳转数据看板 + // //看看项目看板内有没有菜单 + // let arr = this.$store.state.userInfo.menuAuthority.moduleList; + // let arr2 = []; + // arr.forEach((element) => { + // if (element.moduleType == 4) { + // arr2.push(element); + // return; + // } + // }); + // // 如果数组为空表示该用户没有权限访问 + // if (!arr2.length) { + // return this.$message.warning("暂无权限"); + // } + // let routeUrl = this.$router.resolve({ + // path: arr2[0].modulePath, + // }); + // window.location.href = routeUrl.href; + // window._paq.push(["trackEvent", "点击", "数据看板", "进入数据看板"]); + this.$message({ + message: "当前项目没有看板", + type: "warning", }); - // 如果数组为空表示该用户没有权限访问 - if (!arr2.length) { - return this.$message.warning("暂无权限"); - } - let routeUrl = this.$router.resolve({ - path: arr2[0].modulePath, - }); - window.location.href = routeUrl.href; - window._paq.push(["trackEvent", "点击", "数据看板", "进入数据看板"]); } else { + const isPermission = await this.getAuthModuleAndMenu() + if(!isPermission) { + return this.$message({ + message: "当前用户没有访问数据看板权限", + type: "warning", + }); + } console.log("当前跳转链接", this.newBigScreen); //-------------------- 跳转新版七参数 this.jumpToken = localStorage.getItem("jumpToken"); @@ -640,67 +599,6 @@ export default { window.open(this.newBigScreen + "?userId=" + userId + '&sn=' + this.$store.state.projectSn, "_self"); // window.open('http://192.168.34.216:8081/#/large?userId=' + userId + '&sn=' + this.$store.state.projectSn, "_self")//这里是后台跳到大屏的操作,携带token过去 } - // if (this.newBigScreen != null) { - // console.log("当前跳转链接",this.newBigScreen) - // //-------------------- 跳转新版七参数 - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open(this.newBigScreen + '?token=' + this.jumpToken, '_self') - // // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//这里是后台跳到大屏的操作,携带token过去 - // } else { - // //--------------------原版项目后台跳转数据看板 - - // //看看项目看板内有没有菜单 - // let arr = this.$store.state.userInfo.menuAuthority.moduleList - // let arr2 = [] - // arr.forEach(element => { - // if (element.moduleType == 4) { - // arr2.push(element) - // return - // } - // }) - // // 如果数组为空表示该用户没有权限访问 - // if (!arr2.length) { - // return this.$message.warning('暂无权限') - // } - // let routeUrl = this.$router.resolve({ - // path: arr2[0].modulePath - // }) - // window.location.href = routeUrl.href - // window._paq.push(['trackEvent', '点击', '数据看板', '进入数据看板']) - // } - // if (this.company == 'syhy') { - // //-------------------- 跳转新版七参数 - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://101.43.164.214:45022/#/large?token=' + this.jumpToken, '_self') //沈阳和盈 - // // window.open('http://192.168.34.226:8081/#/large?token=' + this.jumpToken, "_self")//这里是后台跳到大屏的操作,携带token过去 - // } else if (this.company == 'jxwjj') { - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://183.249.224.118:9003/#/large?token=' + this.jumpToken, '_self') //嘉兴王江泾公用码头项目 - // } else if (this.company == 'gxbs') { - // this.jumpToken = localStorage.getItem('jumpToken') - // window.open('http://101.43.164.214:11113/#/large?token=' + this.jumpToken, '_self') //广西百色项目 - // } else { - // //--------------------原版项目后台跳转数据看板 - - // //看看项目看板内有没有菜单 - // let arr = this.$store.state.userInfo.menuAuthority.moduleList - // let arr2 = [] - // arr.forEach(element => { - // if (element.moduleType == 4) { - // arr2.push(element) - // return - // } - // }) - // // 如果数组为空表示该用户没有权限访问 - // if (!arr2.length) { - // return this.$message.warning('暂无权限') - // } - // let routeUrl = this.$router.resolve({ - // path: arr2[0].modulePath - // }) - // window.location.href = routeUrl.href - // window._paq.push(['trackEvent', '点击', '数据看板', '进入数据看板']) - // } }, toOverviewCommand() { this.$forceUpdate(); diff --git a/src/components/selectTree/selectTree.vue b/src/components/selectTree/selectTree.vue new file mode 100644 index 00000000..abfb4564 --- /dev/null +++ b/src/components/selectTree/selectTree.vue @@ -0,0 +1,207 @@ + + + + + + diff --git a/src/store/index.js b/src/store/index.js index dc5c3b9f..d0cbcbf7 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -72,17 +72,17 @@ export default new Vuex.Store({ // FILEURL: 'http://8.136.222.164:8808/image/', // 中科安信 // UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色 // FILEURL: 'http://101.43.164.214:11111/image/', // 百色 - UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色 - FILEURL: 'http://101.43.164.214:11111/image/', // 百色 - WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", // 百色 + // UPLOADURL: 'http://101.43.164.214:11111/upload/image/', // 百色 + // FILEURL: 'http://101.43.164.214:11111/image/', // 百色 + // WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", // 百色 // UPLOADURL:'http://182.90.224.237:51234/upload/image/', // FILEURL:'http://182.90.224.237:51234/image/', - // UPLOADURL: "http://192.168.34.155:19111/upload/image/", // 洁本地 - // FILEURL: "http://192.168.34.155:19111/image/", //洁本地 + UPLOADURL: "http://192.168.34.155:19111/upload/image/", // 洁本地 + FILEURL: "http://192.168.34.155:19111/image/", //洁本地 // UPLOADURL: 'http://192.168.34.221:9111/upload/image/', // 郭圣雄本地 // FILEURL: 'http://192.168.34.221:9111/image/', //郭圣雄本地 // WORKFLOWURL: "http://101.43.164.214:11129/#/workspace/forms", //jiayu工作流地址(本地) - // WORKFLOWURL: "http://192.168.34.216:88/#/workspace/forms", //jiayu工作流地址(本地) + WORKFLOWURL: "http://192.168.34.216:88/#/workspace/forms", //jiayu工作流地址(本地) // WORKFLOWURL: "http://192.168.34.138:88/#/workspace/forms", //坤工作流地址(本地) // WORKFLOWURL: "http://192.168.34.129:88/#/workspace/forms", //罗峰工作流地址(本地) CONTRACTORURL: process.env.NODE_ENV == "development" ? "http://192.168.34.129:5174/#/contractorApply" : `${window.location.protocol}//${window.location.host}/contractorApply/index.html#/contractorApply`, //罗峰承包商入场地址(本地) diff --git a/src/views/companyAdmin/companyDiagram.vue b/src/views/companyAdmin/companyDiagram.vue index 4d2677c1..9cc94d7e 100644 --- a/src/views/companyAdmin/companyDiagram.vue +++ b/src/views/companyAdmin/companyDiagram.vue @@ -103,6 +103,13 @@ v-if="treeSelectData.projectName" >权限配置 + 大屏配置 + + diff --git a/src/views/jxjadmin/registerAudit.vue b/src/views/jxjadmin/registerAudit.vue index 8bea78f4..df4e74c0 100644 --- a/src/views/jxjadmin/registerAudit.vue +++ b/src/views/jxjadmin/registerAudit.vue @@ -37,9 +37,13 @@ - +