fix: BUG修改

This commit is contained in:
kun 2024-04-08 14:08:44 +08:00
parent c07d10fef8
commit 285cb814b8
6 changed files with 408 additions and 185 deletions

View File

@ -2,22 +2,48 @@
<!-- v-if="headerShow" -->
<div class="title">
<div class="title_l flex">
<img v-if="systemInfo.platformLogo" :src="systemInfo.platformLogo" class="logo" height="25" />
<img v-else-if="LOGO_white" :src="'./img/logo/' + LOGO_white + '.png'" class="logo" height="25" />
<img
v-if="systemInfo.platformLogo"
:src="systemInfo.platformLogo"
class="logo"
height="25"
/>
<img
v-else-if="LOGO_white"
:src="'./img/logo/' + LOGO_white + '.png'"
class="logo"
height="25"
/>
<!-- <span v-if="$route.path.indexOf('/firm/')!=-1">{{headerName}}</span> -->
<!-- 南昌头部样式 -->
<span class="canClick" v-if="company == 'nanchang'" @click="changeArea(-1)">{{ titleName }}</span>
<span class="canClick" v-if="$route.path.indexOf('/firm/') == -1 && company == 'nanchang'" @click="changeArea(-1)">{{
titleName ? '' : headerName
}}</span>
<span
class="canClick"
v-if="company == 'nanchang'"
@click="changeArea(-1)"
>{{ titleName }}</span
>
<span
class="canClick"
v-if="$route.path.indexOf('/firm/') == -1 && company == 'nanchang'"
@click="changeArea(-1)"
>{{ titleName ? "" : headerName }}</span
>
<!-- 以上南昌头部样式 -->
<span class="canClick" v-if="$route.path.indexOf('/firm/') != -1 && company != 'nanchang'" @click="changeArea(-1)">{{
systemInfo.platformName
}}</span>
<span class="canClick" v-if="$route.path.indexOf('/firm/') == -1 && company != 'nanchang'" @click="changeArea(-1)">{{
titleName ? systemInfo.platformName + ' - ' + titleName : headerName
}}</span>
<span
class="canClick"
v-if="$route.path.indexOf('/firm/') != -1 && company != 'nanchang'"
@click="changeArea(-1)"
>{{ systemInfo.platformName }}</span
>
<span
class="canClick"
v-if="$route.path.indexOf('/firm/') == -1 && company != 'nanchang'"
@click="changeArea(-1)"
>{{
titleName ? systemInfo.platformName + " - " + titleName : headerName
}}</span
>
<span
class="canClick"
v-show="$route.path.indexOf('/firm/') != -1 && company != 'nanchang'"
@ -27,15 +53,20 @@
>>{{ item.name }}</span
>
</div>
<div class="title_near flex">
<userChange></userChange>
</div>
<div class="title_near-tow flex">
<div class="divider-line"></div>
<centerChange></centerChange>
</div>
<div class="title_near flex" v-if="$store.state.userInfo.accountType != 11">
<userChange></userChange>
</div>
<div class="title_near-tow flex">
<div class="divider-line"></div>
<centerChange></centerChange>
</div>
<div class="headerRight">
<el-popover placement="bottom" width="200" v-show="showQrCode && $store.state.userInfo.inputQrCode == 0" trigger="click">
<el-popover
placement="bottom"
width="200"
v-show="showQrCode && $store.state.userInfo.inputQrCode == 0"
trigger="click"
>
<div id="qrCode" ref="qrCodeDiv"></div>
<el-button slot="reference" type="text" style="color: #fff; padding: 0"
>人员录入二维码 <i class="el-icon-arrow-down"></i
@ -55,7 +86,11 @@
</div>
</div>
<p
v-show="$route.path.indexOf('firm/') != -1 && $store.state.userInfo.companyBigScreen == 0 && company == 'longguang'"
v-show="
$route.path.indexOf('firm/') != -1 &&
$store.state.userInfo.companyBigScreen == 0 &&
company == 'longguang'
"
class="header-btn"
@click="toOverview4()"
>
@ -84,12 +119,22 @@
企业大屏
</p>
<!-- 横琴大屏使用龙光大屏样式 -->
<p v-show="$route.path.indexOf('firm/') != -1 && $store.state.userInfo.companyBigScreen == 0" class="header-btn" @click="toOverview4()">
<p
v-show="
$route.path.indexOf('firm/') != -1 &&
$store.state.userInfo.companyBigScreen == 0
"
class="header-btn"
@click="toOverview4()"
>
<img src="@/assets/images/icon-bigData.png" alt srcset />
综合监管大屏
</p>
<p
v-show="$route.path.indexOf('projectIndex') != -1 && $store.state.userInfo.projectKanban == 0"
v-show="
$route.path.indexOf('projectIndex') != -1 &&
$store.state.userInfo.projectKanban == 0
"
class="header-btn"
@click="toOverview2()"
>
@ -121,7 +166,10 @@
塔吊可视大屏
</p> -->
<message @sendMsg="sendMessage"></message>
<div class="title_r" v-if="showR && $route.path.indexOf('/equipmentCenter/') == -1">
<div
class="title_r"
v-if="showR && $route.path.indexOf('/equipmentCenter/') == -1"
>
<!-- <changeTheme></changeTheme> -->
<!-- <language></language> -->
<account v-if="!uid"></account>
@ -130,137 +178,153 @@
</div>
</template>
<script>
import bus from '@/util/eventBus.js'
import language from './language'
import account from './account'
import changeTheme from './changeTheme'
import message from './message'
import QRCode from 'qrcodejs2'
import bus from "@/util/eventBus.js";
import language from "./language";
import account from "./account";
import changeTheme from "./changeTheme";
import message from "./message";
import QRCode from "qrcodejs2";
import userChange from "@/components/userChange.vue";
import centerChange from "@/components/centerChange.vue";
import { getProjectDetail } from '@/assets/js/api/baseInfo.js'
import { getProjectDetail } from "@/assets/js/api/baseInfo.js";
export default {
props: ['titleName', 'showR'],
props: ["titleName", "showR"],
data() {
return {
getNewBigScreen: null,
newBigScreen: null,
headerShow,
LOGO_white: LOGO_white,
headerName: '',
headerName: "",
isShowAudio: false,
loginData: {},
systemInfo: {
loginBackgroundImage: '',
loginLogo: '',
platformLogo: '',
platformName: '智慧工地云平台'
loginBackgroundImage: "",
loginLogo: "",
platformLogo: "",
platformName: "智慧工地云平台",
},
showQrCode: false,
uid: this.$store.state.uid, // true 退
company: '',
mp3Url: '',
company: "",
mp3Url: "",
isLoop: true,
timer: null,
jumpToken: ''
}
jumpToken: "",
};
},
components: {
language,
account,
changeTheme,
message,
userChange,
centerChange,
},
components: { language, account, changeTheme, message, userChange, centerChange },
watch: {
$route: {
handler(newVal) {
if (newVal.path == '/project/labor/personManage') {
this.showQrCode = true
this.bindQRCode()
if (newVal.path == "/project/labor/personManage") {
this.showQrCode = true;
this.bindQRCode();
} else {
this.showQrCode = false
this.showQrCode = false;
}
}
},
},
newBigScreen(newVal) {
this.newBigScreen = newVal
}
this.newBigScreen = newVal;
},
},
beforeDestroy() {
this.newBigScreen = null
console.log('当前数据看板地址', this.newBigScreen)
this.newBigScreen = null;
console.log("当前数据看板地址", this.newBigScreen);
},
created() {
this.company = COMPANY
console.log('this.company', this.company)
console.log('COMPANY', COMPANY)
this.company = COMPANY;
console.log("this.company", this.company);
console.log("COMPANY", COMPANY);
if (this.$store.state.projectSn) {
this.getProjectDetail()
this.getProjectDetail();
}
this.loginData = JSON.parse(localStorage.getItem('systemInfo'))
this.loginData = JSON.parse(localStorage.getItem("systemInfo"));
// console.log('',this.loginData)\
},
mounted() {
if (localStorage.getItem('systemInfo')) {
this.systemInfo = JSON.parse(localStorage.getItem('systemInfo'))
if (localStorage.getItem("systemInfo")) {
this.systemInfo = JSON.parse(localStorage.getItem("systemInfo"));
}
console.log('进入页面显示的企业头部名称', this.systemInfo)
this.headerName = this.systemInfo.platformName
if (this.$route.path.indexOf('equipmentCenter/') != -1) {
this.headerName += ' - 设备中台'
console.log("进入页面显示的企业头部名称", this.systemInfo);
this.headerName = this.systemInfo.platformName;
if (this.$route.path.indexOf("equipmentCenter/") != -1) {
this.headerName += " - 设备中台";
}
if (this.$store.state.currentProDetail) {
this.headerName += ' - ' + this.$store.state.currentProDetail.projectName
this.headerName += " - " + this.$store.state.currentProDetail.projectName;
}
if (this.$store.state.currentMoudle) {
this.headerName += ' - ' + this.$store.state.currentMoudle.moduleName
if (COMPANY == 'nanchang') {
this.headerName = this.$store.state.currentMoudle.moduleName
this.headerName += " - " + this.$store.state.currentMoudle.moduleName;
if (COMPANY == "nanchang") {
this.headerName = this.$store.state.currentMoudle.moduleName;
}
}
if (this.$route.path == '/project/labor/personManage') {
this.showQrCode = true
this.bindQRCode()
if (this.$route.path == "/project/labor/personManage") {
this.showQrCode = true;
this.bindQRCode();
} else {
this.showQrCode = false
this.showQrCode = false;
}
},
methods: {
//()
closeAudio() {
this.isShowAudio = false
this.isShowAudio = false;
},
sendMessage(val) {
this.isShowAudio = false
console.log(val, this.isShowAudio)
this.isShowAudio = false;
console.log(val, this.isShowAudio);
// let url = "https://dss2.bdstatic.com/6Ot1bjeh1BF3odCf/it/u=2746545937,1203007354&fm=218&app=92&f=PNG?w=121&h=75&s=B59079335D03484B4CD997F10300C027"
if (this.$store.state.userInfo.accountType == 5 || this.$store.state.userInfo.accountType == 6) {
console.log(localStorage.getItem('soundList'))
if (localStorage.getItem('soundList')) {
let arr = JSON.parse(localStorage.getItem('soundList'))
arr.forEach(item => {
if (item.type == val.type && val.type != '8') {
console.log(1, item)
clearTimeout(this.timer)
this.mp3Url = this.$store.state.FILEURL + item.fileUrl
this.isLoop = item.playType == 2 ? true : false
let _this = this
if (
this.$store.state.userInfo.accountType == 5 ||
this.$store.state.userInfo.accountType == 6
) {
console.log(localStorage.getItem("soundList"));
if (localStorage.getItem("soundList")) {
let arr = JSON.parse(localStorage.getItem("soundList"));
arr.forEach((item) => {
if (item.type == val.type && val.type != "8") {
console.log(1, item);
clearTimeout(this.timer);
this.mp3Url = this.$store.state.FILEURL + item.fileUrl;
this.isLoop = item.playType == 2 ? true : false;
let _this = this;
this.timer = setTimeout(() => {
_this.isShowAudio = true
}, 500)
_this.isShowAudio = true;
}, 500);
}
if (item.type == val.type && val.type == '8' && (val.itemType == '0' || val.itemType == '1' || val.itemType == '2')) {
console.log(2, item)
clearTimeout(this.timer)
this.mp3Url = this.$store.state.FILEURL + item.fileUrl
this.isLoop = item.playType == 2 ? true : false
let _this = this
if (
item.type == val.type &&
val.type == "8" &&
(val.itemType == "0" ||
val.itemType == "1" ||
val.itemType == "2")
) {
console.log(2, item);
clearTimeout(this.timer);
this.mp3Url = this.$store.state.FILEURL + item.fileUrl;
this.isLoop = item.playType == 2 ? true : false;
let _this = this;
this.timer = setTimeout(() => {
_this.isShowAudio = true
}, 500)
console.log(this.isShowAudio)
console.log(this.mp3Url)
_this.isShowAudio = true;
}, 500);
console.log(this.isShowAudio);
console.log(this.mp3Url);
}
})
});
}
}
// this.$notify({
@ -271,111 +335,129 @@ export default {
},
//
bindQRCode: function() {
console.log('人员录入二维码')
document.getElementById('qrCode').innerHTML = ''
let httpUrl = window.location.origin
let userId = this.$store.state.userInfo.userId
let projectSn = this.$store.state.projectSn
console.log("人员录入二维码");
document.getElementById("qrCode").innerHTML = "";
let httpUrl = window.location.origin;
let userId = this.$store.state.userInfo.userId;
let projectSn = this.$store.state.projectSn;
new QRCode(this.$refs.qrCodeDiv, {
text: httpUrl + '/doc/h5/index.html?userId=' + userId + '&projectSn=' + projectSn,
text:
httpUrl +
"/doc/h5/index.html?userId=" +
userId +
"&projectSn=" +
projectSn,
width: 200,
height: 200,
colorDark: '#333333', //
colorLight: '#ffffff', //
correctLevel: QRCode.CorrectLevel.L //L/M/H
})
colorDark: "#333333", //
colorLight: "#ffffff", //
correctLevel: QRCode.CorrectLevel.L, //L/M/H
});
},
changeArea(index) {
var accountType = this.$store.state.userInfo.accountType
bus.$emit('headerAeraSn')
if (this.$route.path.indexOf('/firm/') != -1) {
if ((accountType != 2 && index == -1) || (accountType > 3 && index == 0) || (accountType == 7 && index < 2)) {
return false
var accountType = this.$store.state.userInfo.accountType;
bus.$emit("headerAeraSn");
if (this.$route.path.indexOf("/firm/") != -1) {
if (
(accountType != 2 && index == -1) ||
(accountType > 3 && index == 0) ||
(accountType == 7 && index < 2)
) {
return false;
}
if (index == -1) {
this.$store.commit('setMapBackArr', [])
this.$store.commit("setMapBackArr", []);
} else {
var arr = this.$store.state.mapBackArr
arr = arr.splice(0, index + 1)
this.$store.commit('setMapBackArr', arr)
var arr = this.$store.state.mapBackArr;
arr = arr.splice(0, index + 1);
this.$store.commit("setMapBackArr", arr);
}
} else if (window.location.href.indexOf('equipmentCenter.html') != -1) {
console.log(window.location.href)
if (COMPANY == 'nanchang') {
window.open('/index.html#/firm/projectManage', '_self')
} else if (window.location.href.indexOf("equipmentCenter.html") != -1) {
console.log(window.location.href);
if (COMPANY == "nanchang") {
window.open("/index.html#/firm/projectManage", "_self");
} else {
window.open('/#/firm/projectManage', '_self')
window.open("/#/firm/projectManage", "_self");
}
} else {
//
if (accountType != 2 && index == -1 && accountType != 7 && accountType != 3 && accountType != 4) {
return false
if (
accountType != 2 &&
index == -1 &&
accountType != 7 &&
accountType != 3 &&
accountType != 4
) {
return false;
}
this.$store.commit('setIsShowBackIndex', false)
this.$store.commit('setMenuList', this.$store.state.projectManageMenuList)
this.$store.commit("setIsShowBackIndex", false);
this.$store.commit(
"setMenuList",
this.$store.state.projectManageMenuList
);
let routeUrl = this.$router.resolve({
path: '/firm/projectManage'
})
window.open(routeUrl.href, '_self')
path: "/firm/projectManage",
});
window.open(routeUrl.href, "_self");
//
location.reload()
location.reload();
}
},
//绿
toOverview(url) {
let routeUrl = this.$router.resolve({
path: url
})
if (COMPANY != 'longguang' && url != '/project/bigSiteVisualization') {
window.open(routeUrl.href, '_blank')
} else if (COMPANY == 'jlw') {
window.open(this.$router.resolve(routeUrl).href, '_blank')
path: url,
});
if (COMPANY != "longguang" && url != "/project/bigSiteVisualization") {
window.open(routeUrl.href, "_blank");
} else if (COMPANY == "jlw") {
window.open(this.$router.resolve(routeUrl).href, "_blank");
} else {
window.location.href = routeUrl.href + '?COMPANY=' + COMPANY
window.location.href = routeUrl.href + "?COMPANY=" + COMPANY;
// window.open('#/project/dataBoard/environment?COMPANY=' + COMPANY, "_blank");
}
},
getProjectDetail() {
let data = {
projectSn: this.$store.state.projectSn
}
getProjectDetail(data).then(res => {
projectSn: this.$store.state.projectSn,
};
getProjectDetail(data).then((res) => {
if (res.result) {
this.getNewBigScreen = res.result.newBigScreen
console.log('接口获取数据看板地址', this.getNewBigScreen)
this.getNewBigScreen = res.result.newBigScreen;
console.log("接口获取数据看板地址", this.getNewBigScreen);
}
})
});
},
toOverview2() {
this.$forceUpdate()
this.newBigScreen = this.getNewBigScreen
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 => {
let arr = this.$store.state.userInfo.menuAuthority.moduleList;
let arr2 = [];
arr.forEach((element) => {
if (element.moduleType == 4) {
arr2.push(element)
return
arr2.push(element);
return;
}
})
});
// 访
if (!arr2.length) {
return this.$message.warning('暂无权限')
return this.$message.warning("暂无权限");
}
let routeUrl = this.$router.resolve({
path: arr2[0].modulePath
})
window.location.href = routeUrl.href
window._paq.push(['trackEvent', '点击', '数据看板', '进入数据看板'])
path: arr2[0].modulePath,
});
window.location.href = routeUrl.href;
window._paq.push(["trackEvent", "点击", "数据看板", "进入数据看板"]);
} else {
console.log('当前跳转链接', this.newBigScreen)
console.log("当前跳转链接", this.newBigScreen);
//--------------------
this.jumpToken = localStorage.getItem('jumpToken')
window.open(this.newBigScreen + '?token=' + this.jumpToken, '_self')
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
}
// if (this.newBigScreen != null) {
@ -441,21 +523,21 @@ export default {
// }
},
toOverview3() {
if (COMPANY == 'shenbai') {
if (COMPANY == "shenbai") {
let routeUrl = this.$router.resolve({
path: '/companyAdmin/shenbaiBigScreen'
})
path: "/companyAdmin/shenbaiBigScreen",
});
// window.open(routeUrl.href, "_blank");
} else if (COMPANY == 'henan') {
} else if (COMPANY == "henan") {
let routeUrl = this.$router.resolve({
path: '/companyAdmin/heNanBigScreen'
})
window.open(routeUrl.href, '_blank')
path: "/companyAdmin/heNanBigScreen",
});
window.open(routeUrl.href, "_blank");
} else {
let routeUrl = this.$router.resolve({
path: '/companyAdmin/bigScreen'
})
window.open(routeUrl.href, '_blank')
path: "/companyAdmin/bigScreen",
});
window.open(routeUrl.href, "_blank");
}
},
//
@ -466,24 +548,24 @@ export default {
// });
// 3.0
let routeUrl = this.$router.resolve({
path: '/companyAdmin/longguangBigScreen2'
})
path: "/companyAdmin/longguangBigScreen2",
});
// let routeUrl = this.$router.resolve({
// path: "/companyAdmin/heNanBigScreen",
// });
window.open(routeUrl.href, '_self')
window._paq.push(['trackEvent', '点击', '龙光企业大屏', '进入企业大屏'])
window.open(routeUrl.href, "_self");
window._paq.push(["trackEvent", "点击", "龙光企业大屏", "进入企业大屏"]);
},
toOverview5(val) {
let routeUrl = this.$router.resolve({
path: val
})
path: val,
});
// window.open(routeUrl.href, "_blank");
window.location.href = routeUrl.href
}
}
}
window.location.href = routeUrl.href;
},
},
};
</script>
<style lang="less" scoped>
.flex {
@ -501,7 +583,7 @@ export default {
height: 61px;
display: flex;
align-items: center;
justify-content: flex-end
justify-content: flex-end;
}
.title_l {
font-family: PingFangSC-Semibold;
@ -513,14 +595,14 @@ export default {
margin-right: 14px;
}
}
.title_near{
.title_near {
margin-right: 50px;
}
.title_near-tow{
.divider-line{
.title_near-tow {
.divider-line {
width: 1px;
height: 16px;
background: #FFFFFF;
background: #ffffff;
margin-right: 50px;
}
}
@ -552,7 +634,7 @@ p {
.headerRight {
display: inline-flex;
align-items: center;
margin-left: auto
margin-left: auto;
}
.canClick {
cursor: pointer;

View File

@ -90,6 +90,7 @@ export default {
methods: {
//
selectProject(obj) {
if(!obj.list) return;
if (obj.list && obj.list.length > 0) {
obj.list.map((item) => {
this.selectProject(item);
@ -113,6 +114,7 @@ export default {
//
getGroupTreeData() {
this.groupListData = this.$store.state.groupTreeList;
if(!this.groupListData) return;
this.isUserList = false;
let findItem = this.groupListData.find(
(item) => item.sn == this.$store.state.selectedGroupSn

View File

@ -334,6 +334,7 @@ router.beforeEach((to, form, next) => {
next()
} else if (
!store.state.userInfo &&
to.path != '/resetPassword' &&
to.path != '/login' &&
to.path != '/' &&
to.path != '/sign' &&

View File

@ -605,6 +605,7 @@ export default {
},
//
goReset(){
console.log(666)
this.$router.push({ path: "/resetPassword" });
},
//

View File

@ -0,0 +1,137 @@
<template>
<div class="reportForm">
<div class="left">
<div class="menu-list">
<div
class="menu-item"
:class="{ 'active-menu': activeNav == 1 }"
@click="checkNav(1)"
>
<!-- 实时数据 -->
{{ $t("message.unload.realData") }}
</div>
</div>
</div>
<div class="right">
<div class="reportTable">
</div>
</div>
</div>
</template>
<script>
export default {
name: "reportForm",
data() {
return {
activeNav: 1
};
},
methods: {
checkNav(val) {
this.activeNav = val;
},
},
};
</script>
<style lang="less" scoped>
.reportForm {
width: 100%;
height: 100%;
.left {
float: left;
width: 188px;
margin-right: 0;
padding-top: 28px;
box-sizing: border-box;
height: 100%;
background: #fff;
.menu-list {
.menu-item {
color: #7c829e;
padding-left: 28px;
width: 100%;
height: 30px;
box-sizing: border-box;
line-height: 30px;
margin-bottom: 10px;
cursor: pointer;
position: relative;
}
.menu-item:hover {
background: rgba(78, 124, 255, 0.1);
color: #4e7cff;
}
.active-menu {
background: rgba(78, 124, 255, 0.25) !important;
color: #4e7cff;
}
.active-menu::before {
content: "";
width: 3px;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: #4e7cff;
}
}
}
.right {
float: right;
width: calc(100% - 208px);
height: 100%;
margin-left: 20px;
}
}
.reportTable {
width: 100%;
height: 100%;
.left {
float: left;
width: 188px;
margin-right: 0;
padding-top: 28px;
box-sizing: border-box;
height: 100%;
background: #fff;
.menu-list {
.menu-item {
color: #7c829e;
padding-left: 28px;
width: 100%;
height: 30px;
box-sizing: border-box;
line-height: 30px;
margin-bottom: 10px;
cursor: pointer;
position: relative;
}
.menu-item:hover {
background: rgba(78, 124, 255, 0.1);
color: #4e7cff;
}
.active-menu {
background: rgba(78, 124, 255, 0.25) !important;
color: #4e7cff;
}
.active-menu::before {
content: "";
width: 3px;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: #4e7cff;
}
}
}
.right {
float: right;
width: calc(100% - 208px);
height: 100%;
margin-left: 20px;
}
}
</style>

View File

@ -90,7 +90,7 @@
};
getGroupListApi(data).then((res) => {
// console.log(res);
if (res.code == 200) {
if (res.code == 200 && res.result) {
this.groupListData = res.result;
this.$store.commit("setGroupTreeList", res.result); //
}