恢复文件

prv
haha 2023-10-09 22:48:28 +08:00
parent 8ca7da71b8
commit 30c443bdf7
16 changed files with 205 additions and 549 deletions

View File

@ -16,13 +16,11 @@
"emittery": "^0.8.1", "emittery": "^0.8.1",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"js-cookie": "^3.0.5", "js-cookie": "^3.0.5",
"nprogress": "0.2.0",
"less": "^4.1.3", "less": "^4.1.3",
"less-loader": "^11.1.3", "less-loader": "^11.1.3",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"logt": "^1.4.1", "logt": "^1.4.1",
"vue": "^2.6.14", "vue": "^2.6.14",
"vuex": "3.6.0",
"vue-router": "^3.1.3" "vue-router": "^3.1.3"
}, },
"devDependencies": { "devDependencies": {

View File

@ -165,7 +165,8 @@ table{
width: 45%; width: 45%;
text-align: center; text-align: center;
} }
.head-title-weather{ .head-title-weather{
width: 55%;
display: flex; display: flex;
align-items: center; align-items: center;
} }

View File

@ -2,9 +2,9 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询流程表单列表 // 查询流程表单列表
const list=(roleId)=> { const list=()=> {
return request({ return request({
url: 'bgscreen/dept/list?roleId='+(roleId||1), url: 'bgscreen/dept/list',
method: 'get' method: 'get'
}) })
} }

View File

@ -1,47 +0,0 @@
import request from '@/utils/request'
// 登录方法
function login(username, password, code, uuid) {
const data = {
username,
password,
code,
uuid
}
return request({
url: '/login',
headers: {
isToken: false
},
method: 'post',
data: data
})
}
// 获取用户详细信息
function getInfo() {
return request({
url: '/getInfo',
method: 'get'
})
}
// 退出方法
function logout() {
return request({
url: '/logout',
method: 'post'
})
}
export {
login,
logout,
getInfo
}
export default {
login,
logout,
getInfo
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,318 +1,259 @@
<template> <template>
<div :class="red ? 'head-title red-head' : 'head-title'" class="main-header"> <div :class="red?'head-title red-head':'head-title'" class="main-header">
<div class="head-title-label"> <div class="head-title-label">
北跨泾河-产发工程数字管理平台 北跨泾河-产发工程数字管理平台
</div> </div>
<div class="head-title-tab"> <div class="head-title-tab">
<div :class="nav == 1 ? 'head-nav active' : 'head-nav'" @click="pageJump(1, '#/')">项目概况</div> <div :class="nav==1?'head-nav active':'head-nav'" @click="pageJump(1,'#/')"></div>
<div :class="nav == 2 ? 'head-nav active' : 'head-nav'" @click="pageJump(2, '#/detail')">项目详情</div> <div :class="nav==2?'head-nav active':'head-nav'" @click="pageJump(2,'#/detail')"></div>
<div :class="nav == 3 ? 'head-nav active' : 'head-nav'" @click="pageJump(3, '#/safety')">安全管理</div> <div :class="nav==3?'head-nav active':'head-nav'" @click="pageJump(3,'#/safety')"></div>
<div :class="nav == 4 ? 'head-nav active' : 'head-nav'" @click="pageJump(4, '#/quality')">质量管理</div> <div :class="nav==4?'head-nav active':'head-nav'" @click="pageJump(4,'#/quality')"></div>
<div :class="nav == 5 ? 'head-nav active' : 'head-nav'" @click="pageJump(5, '#/progress')">进度管理</div> <div :class="nav==5?'head-nav active':'head-nav'" @click="pageJump(5,'#/progress')"></div>
<div :class="nav == 61 || nav == 62 ? 'head-nav active' : 'head-nav'" style="position: relative;" class="has-submenu"> <div :class="nav==61||nav==62?'head-nav active':'head-nav'" style="position: relative;" class="has-submenu">
<div>视频管理</div> <div>视频管理</div>
<div class="header-btn-list"> <div class="header-btn-list">
<div class="header-btn-list-arrow"></div> <div class="header-btn-list-arrow"></div>
<div class="header-btn-list-item" style="width: 276px;"> <div class="header-btn-list-item" style="width: 276px;"><div class="header-btn-list-padding">
<div class="header-btn-list-padding"> <button type="button" :class="nav==61?'active':''" class="sub-btn" @click="pageJump(61,'#/video')"></button>
<button type="button" :class="nav == 61 ? 'active' : ''" class="sub-btn" <button type="button" :class="nav==62?'active':''" class="sub-btn" @click="pageJump(62,'#/aiVideo')">AI</button></div></div></div>
@click="pageJump(61, '#/video')">视频监控</button> </div>
<button type="button" :class="nav == 62 ? 'active' : ''" class="sub-btn" <div :class="nav==7?'head-nav active':'head-nav'" @click="pageJump(7,'#/engin')"></div>
@click="pageJump(62, '#/aiVideo')">AI识别监控</button> </div>
</div> <div class="head-title-select" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
</div> <div class="head-select">
<input type="text" :value="dept1" @click="showScreenUlSel1" placeholder="请选择公司" readonly>
</div>
<el-collapse-transition>
<ul class="header-screen-ul" v-show="showSel1" ref="selectUl">
<li v-for="item in depts" @click="setScreenLiSel1(item)" :title="item.text" >{{item.text}}</li>
</ul>
</el-collapse-transition>
</div>
<div class="head-title-select" @mouseleave="hideScreenUlSel2" v-if="localStorage2">
<div class="head-select">
<input type="text" :value="dept2" @click="showScreenUlSel2" placeholder="请选择项目" readonly>
</div>
<el-collapse-transition>
<ul class="header-screen-ul" v-show="showSel2" ref="selectUl">
<li v-for="item in data" @click="setScreenLiSel2(item)" :title="item.text">{{item.text}}</li>
</ul>
</el-collapse-transition>
</div>
<div class="head-title-date">
<div class="head-title-time">
<div class="head-title-date-con">{{date}}</div>
<div class="head-title-time-con">{{time}}</div>
</div>
<div class="head-title-weather">
<img :src="condCode">
<span>{{condTxt}}</span>
<span>{{temperature}}</span>
</div> </div>
</div> </div>
<div :class="nav == 7 ? 'head-nav active' : 'head-nav'" @click="pageJump(7, '#/engin')">工程管理</div> <i class="set-fullscreen set-font-size" style="margin-left: 16px;position: absolute;top: 4px;right: 16px;" @click="toggleFullScreen">
<svg class="icon" v-if="!isFullScreen" style="width: 24px; vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3304"><path d="M145.066667 85.333333h153.6c25.6 0 42.666667-17.066667 42.666666-42.666666S324.266667 0 298.666667 0H34.133333C25.6 0 17.066667 8.533333 8.533333 17.066667 0 25.6 0 34.133333 0 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666666s42.666667-17.066667 42.666666-42.666666V145.066667l230.4 230.4c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733334L145.066667 85.333333z m170.666666 563.2L162.133333 802.133333l-76.8 76.8V725.333333C85.333333 699.733333 68.266667 682.666667 42.666667 682.666667s-42.666667 17.066667-42.666667 42.666666v256c0 25.6 17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666666-42.666667s-17.066667-42.666667-42.666666-42.666666H145.066667l76.8-76.8 153.6-153.6c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0z m665.6 34.133334c-25.6 0-42.666667 17.066667-42.666666 42.666666v153.6l-76.8-76.8-153.6-153.6c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733334l153.6 153.6 76.8 76.8H725.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666s17.066667 42.666667 42.666666 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666666z m0-682.666667h-256c-25.6 0-42.666667 17.066667-42.666666 42.666667s17.066667 42.666667 42.666666 42.666666h153.6l-76.8 76.8-153.6 153.6c-17.066667 17.066667-17.066667 42.666667 0 59.733334 17.066667 17.066667 42.666667 17.066667 59.733334 0l153.6-153.6 76.8-76.8v153.6c0 25.6 17.066667 42.666667 42.666666 42.666666s42.666667-17.066667 42.666667-42.666666v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z" fill="" p-id="3305"></path></svg>
<svg class="icon" v-else style="width: 24px; vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3952"><path d="M384 597.333333h-256c-25.6 0-42.666667 17.066667-42.666667 42.666667s17.066667 42.666667 42.666667 42.666667h153.6L17.066667 947.2c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733333 0L341.333333 742.4v153.6c0 25.6 17.066667 42.666667 42.666667 42.666667s42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z m358.4 85.333334h153.6c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667h-256c-25.6 0-42.666667 17.066667-42.666667 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666667s42.666667-17.066667 42.666667-42.666667V742.4l264.533333 264.533333c17.066667 17.066667 42.666667 17.066667 59.733333 0 17.066667-17.066667 17.066667-42.666667 0-59.733333L742.4 682.666667zM640 426.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667H742.4L1006.933333 76.8c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733333 0L682.666667 281.6V128c0-25.6-17.066667-42.666667-42.666667-42.666667s-42.666667 17.066667-42.666667 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666667z m-256-341.333334c-25.6 0-42.666667 17.066667-42.666667 42.666667v153.6L76.8 8.533333C59.733333 0 25.6 0 8.533333 8.533333 0 25.6 0 59.733333 8.533333 76.8L281.6 341.333333H128c-25.6 0-42.666667 17.066667-42.666667 42.666667s17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z" p-id="3953"></path></svg>
</i>
</div> </div>
<div class="head-title-select" @mouseleave="hideScreenUlSel1" v-if="localStorage1">
<div class="head-select">
<input type="text" :value="dept1" @click="showScreenUlSel1" placeholder="请选择公司" readonly>
</div>
<el-collapse-transition>
<ul class="header-screen-ul" v-show="showSel1" ref="selectUl">
<li v-for="item in depts" @click="setScreenLiSel1(item)" :title="item.text">{{ item.text }}</li>
</ul>
</el-collapse-transition>
</div>
<div class="head-title-select" @mouseleave="hideScreenUlSel2" v-if="localStorage2">
<div class="head-select">
<input type="text" :value="dept2" @click="showScreenUlSel2" placeholder="请选择项目" readonly>
</div>
<el-collapse-transition>
<ul class="header-screen-ul" v-show="showSel2" ref="selectUl">
<li v-for="item in data" @click="setScreenLiSel2(item)" :title="item.text">{{ item.text }}</li>
</ul>
</el-collapse-transition>
</div>
<div class="head-title-date">
<div class="head-title-time" v-if="1 == 2">
<div class="head-title-date-con">{{ date }}</div>
<div class="head-title-time-con">{{ time }}</div>
</div>
<div class="head-title-weather">
<img :src="condCode">
<span>{{ condTxt }}</span>
<span>{{ temperature }}</span>
</div>
<div class="header-title-user" style="margin-left:12px;">
{{ getName() }}
<i @click="doLogout" title="退出" style="margin-left:12px;cursor: pointer;">
<svg class="icon"
style=" width:20px;height: 20px;vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 1072 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3432">
<path
d="M1057.279808 548.106418a47.221004 47.221004 0 0 1-7.674052 5.499737l-198.681223 199.525368a51.160351 51.160351 0 0 1-72.366316-72.340736l117.157204-117.668807L357.38063 562.763858a51.160351 51.160351 0 1 1 0-102.320701l540.713747 0.409282-119.58732-120.226824a51.160351 51.160351 0 0 1 72.366316-72.366316l199.83233 200.753216a48.09073 48.09073 0 0 1 6.574105 4.37421 54.511354 54.511354 0 0 1 0 74.719693zM972.046664 256.543579a51.160351 51.160351 0 0 1-51.160351-51.160351v-10.564612c-1.50923-72.289576-20.259499-91.85841-100.197547-92.421174l-627.430541 0.332542c-75.154555 2.148735-89.760835 24.173266-89.760835 101.885839L102.320701 157.57388l0.332543 685.369639c3.862606 61.597062 25.580175 77.968375 103.139267 77.968374l-103.088107-0.665084v1.099947l818.565612-0.409283-0.204642-66.943318-0.460443 66.227074-103.216007 0.690664c83.08441 0 102.0649-19.133971 103.59971-92.523494v-10.564612a51.160351 51.160351 0 0 1 102.320701 0L1023.386076 869.725962H1023.207015v51.160351a102.320701 102.320701 0 0 1-102.320702 102.320702h-54.357873l-709.849866 0.358122V1023.207015H102.320701a102.09048 102.09048 0 0 1-101.860258-97.767431L0 101.911419A102.03932 102.03932 0 0 1 97.74185 0.460443L921.244436 0A102.320701 102.320701 0 0 1 1023.207015 102.320701v51.160351h0.179061L1023.207015 205.383228a51.160351 51.160351 0 0 1-51.160351 51.160351zM102.320701 102.781145v0.179061l31.438036-0.204642H102.320701zM834.246259 102.320701l86.307512 0.588344 0.460443 66.227075L921.218855 102.320701z"
fill="#0090FF" p-id="3433"></path>
</svg>
</i>
</div>
</div>
<i class="set-fullscreen set-font-size" style="margin-left: 16px;position: absolute;top: 30px;right: 24px;"
@click="toggleFullScreen">
<svg class="icon" v-if="!isFullScreen"
style="width: 24px; vertical-align: middle;fill: currentColor;overflow: hidden;" viewBox="0 0 1024 1024"
version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3304">
<path
d="M145.066667 85.333333h153.6c25.6 0 42.666667-17.066667 42.666666-42.666666S324.266667 0 298.666667 0H34.133333C25.6 0 17.066667 8.533333 8.533333 17.066667 0 25.6 0 34.133333 0 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666666s42.666667-17.066667 42.666666-42.666666V145.066667l230.4 230.4c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733334L145.066667 85.333333z m170.666666 563.2L162.133333 802.133333l-76.8 76.8V725.333333C85.333333 699.733333 68.266667 682.666667 42.666667 682.666667s-42.666667 17.066667-42.666667 42.666666v256c0 25.6 17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666666-42.666667s-17.066667-42.666667-42.666666-42.666666H145.066667l76.8-76.8 153.6-153.6c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0z m665.6 34.133334c-25.6 0-42.666667 17.066667-42.666666 42.666666v153.6l-76.8-76.8-153.6-153.6c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733334l153.6 153.6 76.8 76.8H725.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666s17.066667 42.666667 42.666666 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666666z m0-682.666667h-256c-25.6 0-42.666667 17.066667-42.666666 42.666667s17.066667 42.666667 42.666666 42.666666h153.6l-76.8 76.8-153.6 153.6c-17.066667 17.066667-17.066667 42.666667 0 59.733334 17.066667 17.066667 42.666667 17.066667 59.733334 0l153.6-153.6 76.8-76.8v153.6c0 25.6 17.066667 42.666667 42.666666 42.666666s42.666667-17.066667 42.666667-42.666666v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z"
fill="" p-id="3305"></path>
</svg>
<svg class="icon" v-else style="width: 24px; vertical-align: middle;fill: currentColor;overflow: hidden;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3952">
<path
d="M384 597.333333h-256c-25.6 0-42.666667 17.066667-42.666667 42.666667s17.066667 42.666667 42.666667 42.666667h153.6L17.066667 947.2c-17.066667 17.066667-17.066667 42.666667 0 59.733333 17.066667 17.066667 42.666667 17.066667 59.733333 0L341.333333 742.4v153.6c0 25.6 17.066667 42.666667 42.666667 42.666667s42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z m358.4 85.333334h153.6c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667h-256c-25.6 0-42.666667 17.066667-42.666667 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666667s42.666667-17.066667 42.666667-42.666667V742.4l264.533333 264.533333c17.066667 17.066667 42.666667 17.066667 59.733333 0 17.066667-17.066667 17.066667-42.666667 0-59.733333L742.4 682.666667zM640 426.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667s-17.066667-42.666667-42.666667-42.666667H742.4L1006.933333 76.8c17.066667-17.066667 17.066667-42.666667 0-59.733333-17.066667-17.066667-42.666667-17.066667-59.733333 0L682.666667 281.6V128c0-25.6-17.066667-42.666667-42.666667-42.666667s-42.666667 17.066667-42.666667 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666667z m-256-341.333334c-25.6 0-42.666667 17.066667-42.666667 42.666667v153.6L76.8 8.533333C59.733333 0 25.6 0 8.533333 8.533333 0 25.6 0 59.733333 8.533333 76.8L281.6 341.333333H128c-25.6 0-42.666667 17.066667-42.666667 42.666667s17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z"
p-id="3953"></path>
</svg>
</i>
</div>
</template> </template>
<script> <script>
import { mapGetters } from 'vuex'
export default { export default {
props: { props: {
red: { red:{
type: String type:String
}, },
item: { item:{
type: Number type:Number
}, },
}, },
data() { data() {
return { return {
nav: 1, nav:1,
dept1: '', dept1:'',
dept2: '', dept2:'',
showSel1: false, showSel1:false,
showSel2: false, showSel2:false,
data: [], data:[],
depts: [], depts:[],
timerID: undefined, timerID:undefined,
time: '', time: '',
date: '', date: '',
week: '', week:'',
selDept: '', selDept:'',
localStorage1: JSON.parse(localStorage.getItem("data1")), localStorage1: JSON.parse(localStorage.getItem("data1")),
localStorage2: JSON.parse(localStorage.getItem("data2")), localStorage2: JSON.parse(localStorage.getItem("data2")),
isFullScreen: false, isFullScreen:false,
temperature: 20, temperature:20,
condTxt: '', condTxt:'',
condCode: '', condCode:'',
} }
}, },
async mounted() { mounted(){
window.headerApp = this
await this.initMe();
this.getWeather(); this.getWeather();
if (location.hash.indexOf("#/detail") >= 0) { this.nav = 2; } if(location.hash.indexOf("#/detail")>=0){this.nav=2;}
else if (location.hash.indexOf("#/safety") >= 0) { this.nav = 3; } else if(location.hash.indexOf("#/safety")>=0){this.nav=3;}
else if (location.hash.indexOf("#/quality") >= 0) { this.nav = 4; } else if(location.hash.indexOf("#/quality")>=0){this.nav=4;}
else if (location.hash.indexOf("#/progress") >= 0) { this.nav = 5; } else if(location.hash.indexOf("#/progress")>=0){this.nav=5;}
else if (location.hash.indexOf("#/video") >= 0) { this.nav = 61; } else if(location.hash.indexOf("#/video")>=0){this.nav=61;}
else if (location.hash.indexOf("#/aiVideo") >= 0) { this.nav = 62; } else if(location.hash.indexOf("#/aiVideo")>=0){this.nav=62;}
else if (location.hash.indexOf("#/engin") >= 0) { this.nav = 7; } else if(location.hash.indexOf("#/engin")>=0){this.nav=7;}
else { this.nav = 1; } else{this.nav=1;}
this.setTitle(); this.setTitle();
this.timerID = setInterval(this.updateTime, 1000); this.timerID = setInterval(this.updateTime, 1000);
this.updateTime(); this.updateTime();
this.init(); this.init()
this.$api.dept.list(this.$store.getters.roleId).then(d => { this.$api.dept.list().then(d=>{
this.$root.hasInitHeader = true; this.$root.hasInitHeader=true;
this.depts = [{ text: '产发集团', id: 0 }, ...(d?.data || []).map(it => { this.depts=[{text:'产发集团',id:0},...(d?.data||[]).map(it=>{
it.text = it.deptName; it.text=it.deptName;
it.id = it.deptId; it.id=it.deptId;
return it; return it;
})] })]
this.deptChange(); this.deptChange();
}); });
}, },
methods: { methods: {
initMe(){ getWeather(){
return new Promise(resolve=>{ let url=`https://widget-api.heweather.net/s6/plugin/view?key=fcd4fc1e48a144a483b7af74284229b8&location=CN101110101&lang=zh`;
let func=()=>{ this.$api.http.get(url).then(d=>{
if(!this.$store.getters.roles||this.$store.getters.roles.length==0){ let info=d?.data?.now||{};
setTimeout(func,400); this.temperature=info.tmp||20;
return; this.condTxt=info.cond_txt||'晴';
} this.condCode=info.cond_code||100;
resolve(true); this.condCode=`//widget-s.qweather.net/img/plugin/190516/icon/c/${this.condCode}n.png`
};
func();
});
},
doLogout() {
this.$confirm('确定注销并退出系统吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/';
})
}).catch(() => { });
},
getName() {
return this.$store?.getters?.nickName || '';
},
getWeather() {
let url = `https://widget-api.heweather.net/s6/plugin/view?key=fcd4fc1e48a144a483b7af74284229b8&location=CN101110101&lang=zh`;
this.$api.http.get(url).then(d => {
let info = d?.data?.now || {};
this.temperature = info.tmp || 20;
this.condTxt = info.cond_txt || '晴';
this.condCode = info.cond_code || 100;
this.condCode = `//widget-s.qweather.net/img/plugin/190516/icon/c/${this.condCode}n.png`
}); });
}, },
toggleFullScreen() { toggleFullScreen(){
let el = document.body; let el=document.body;
this.$toggleFullScreen(el); this.$toggleFullScreen(el);
setTimeout(() => { setTimeout(()=>{
this.isFullScreen = document.fullscreenElement == el; this.isFullScreen=document.fullscreenElement==el;
}, 400); },400);
}, },
init() { init(){
try { try{
this.localStorage1 = JSON.parse(localStorage.getItem("data1")) this.localStorage1=JSON.parse(localStorage.getItem("data1"))
this.localStorage2 = JSON.parse(localStorage.getItem("data2")) this.localStorage2=JSON.parse(localStorage.getItem("data2"))
} catch (e) { }catch(e){
} }
if (!this.localStorage1) { if(!this.localStorage1){
this.localStorage1 = { this.localStorage1={
} }
} }
if (!this.localStorage2) { if(!this.localStorage2){
this.localStorage2 = {} this.localStorage2={}
} }
this.dept1 = this.localStorage1?.text || ''; this.dept1=this.localStorage1?.text||'';
this.dept2 = this.localStorage2?.text || ''; this.dept2=this.localStorage2?.text||'';
if (this.dept1) { if(this.dept1){
this.loadProject(true); this.loadProject(true);
} }
}, },
deptChange() { deptChange(){
let tmps = this.depts.filter(d => d.text == this.dept1); let tmps=this.depts.filter(d=>d.text==this.dept1);
if (tmps.length > 0) { if(tmps.length>0){
this.$bus.$emit("deptChange", tmps[0]) this.$bus.$emit("deptChange",tmps[0])
this.$root.dept = tmps[0]; this.$root.dept=tmps[0];
} }
}, },
setTitle() { setTitle(){
let titls = ['', '项目概况', '项目详情', '安全管理', '质量管理', '进度管理', '视频管理', '工程管理'] let titls=['','项目概况','项目详情','安全管理','质量管理','进度管理','视频管理','工程管理']
let title = titls[this.nav]; let title=titls[this.nav];
if (title) { if(title){
window.document.title = title; window.document.title=title;
} else { }else{
window.document.title = '北跨泾河-产发工程数字管理平台-大屏'; window.document.title='北跨泾河-产发工程数字管理平台-大屏';
} }
}, },
// //
pageJump(n, url) { pageJump(n,url){
this.nav = n; this.nav=n;
this.setTitle(); this.setTitle();
if (url) { if(url){
location.href = url location.href = url
} else { }else{
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: '页面开发中,敬请期待!', message: '页面开发中,敬请期待!',
type: 'warning' type: 'warning'
}); });
} }
}, },
showScreenUlSel1() { showScreenUlSel1(){
this.showSel1 = true this.showSel1 = true
}, },
showScreenUlSel2() { showScreenUlSel2(){
this.showSel2 = true this.showSel2 = true
}, },
hideScreenUlSel1() { hideScreenUlSel1(){
this.showSel1 = false this.showSel1 = false
}, },
hideScreenUlSel2() { hideScreenUlSel2(){
this.showSel2 = false this.showSel2 = false
}, },
setScreenLiSel1(item) { setScreenLiSel1(item){
localStorage.setItem("data1", JSON.stringify(item)) localStorage.setItem("data1",JSON.stringify(item))
this.localStorage1 = JSON.parse(localStorage.getItem("data1")) this.localStorage1=JSON.parse(localStorage.getItem("data1"))
this.$emit('itemdata', item); this.$emit('itemdata',item);
this.showSel1 = false this.showSel1 = false
this.dept1 = item.text; this.dept1=item.text;
this.deptChange(); this.deptChange();
this.loadProject(); this.loadProject();
}, },
loadProject(init) { loadProject(init){
this.$api.project.findProjectByDept( this.localStorage1.id).then(d=>{
this.$api.project.findProjectByDept(this.localStorage1.id).then(d => { let objs=(d?.data||[]).map(it=>{
let objs = (d?.data || []).map(it => { it.text=it.projectName;
it.text = it.projectName; return it;
return it; }).filter(it=>+it.progressVisible==0);
}).filter(it => +it.progressVisible == 0); this.data=[{id:0,text:'所有项目'},...objs];
this.data = [{ id: 0, text: '所有项目' }, ...objs]; this.$bus.$emit("loadProjects",this.data);
this.$bus.$emit("loadProjects", this.data); this.$root.projects=this.data;
this.$root.projects = this.data; if(this.data.length>0){
if (this.data.length > 0) { this.setScreenLiSel2(this.data[0],init);
this.setScreenLiSel2(this.data[0], init); }else{
} else { this.setScreenLiSel2(null);
this.setScreenLiSel2(null);
} }
}); });
}, },
setScreenLiSel2(item, init) { setScreenLiSel2(item,init){
if (item) { if(item){
this.showSel2 = false; this.showSel2 = false;
if (!init) { if(!init){
localStorage.setItem("data2", JSON.stringify(item)) localStorage.setItem("data2",JSON.stringify(item))
this.localStorage2 = JSON.parse(localStorage.getItem("data2")) this.localStorage2=JSON.parse(localStorage.getItem("data2"))
this.$emit('itemdata', item); this.$emit('itemdata',item);
this.dept2 = item.text; this.dept2=item.text;
} }
this.$root.project = this.localStorage2; this.$root.project=this.localStorage2;
this.$bus.$emit("projectChange", this.localStorage2); this.$bus.$emit("projectChange",this.localStorage2);
} else { }else{
localStorage.removeItem("data2"); localStorage.removeItem("data2");
this.localStorage2 = {}; this.localStorage2={};
this.showSel2 = false; this.showSel2 = false;
this.dept2 = ''; this.dept2='';
} }
}, },
// //
updateTime() { updateTime(){
var cd = new Date(); var cd = new Date();
this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2); this.time = this.zeroPadding(cd.getHours(), 2) + ':' + this.zeroPadding(cd.getMinutes(), 2) + ':' + this.zeroPadding(cd.getSeconds(), 2);
this.date = this.zeroPadding(cd.getFullYear(), 4) + '年' + this.zeroPadding(cd.getMonth() + 1, 2) + '月' + this.zeroPadding(cd.getDate(), 2) + '日'; this.date = this.zeroPadding(cd.getFullYear(), 4) + '年' + this.zeroPadding(cd.getMonth()+1, 2) + '月' + this.zeroPadding(cd.getDate(), 2)+'日';
}, },
zeroPadding(num, digit) { zeroPadding(num, digit) {
var zero = ''; var zero = '';
for (var i = 0; i < digit; i++) { for(var i = 0; i < digit; i++) {
zero += '0'; zero += '0';
} }
return (zero + num).slice(-digit); return (zero + num).slice(-digit);
@ -322,28 +263,28 @@ export default {
}; };
</script> </script>
<style lang="less">.main-header { <style lang="less">
.head-title-tab { .main-header{
.has-submenu { .head-title-tab{
&:hover { .has-submenu{
.header-btn-list { &:hover{
.header-btn-list{
display: block; display: block;
} }
} }
.header-btn-list{
.header-btn-list { display: none;
display: none; .header-btn-list-item{
.sub-btn{
.header-btn-list-item { &.active{
.sub-btn { color:#fff;
&.active {
color: #fff;
}
} }
}
} }
} }
} }
} }
}</style> }
</style>

View File

@ -1,14 +1,11 @@
import Vue from 'vue' import Vue from 'vue'
import App from './App.vue' import App from './App.vue'
import store from './store'
import router from './router' import router from './router'
import './permission'
import './pages/init.js' import './pages/init.js'
Vue.config.productionTip = false Vue.config.productionTip = false
new Vue({ new Vue({
router, router,
store,
render: h => h(App) render: h => h(App)
}).$mount('#app') }).$mount('#app')

View File

@ -131,17 +131,4 @@
} }
} }
} }
}
.el-message-box{
background-color: rgba(1, 169, 255,0.5);
border: solid 1px rgba(1, 169, 255,1);
}
.el-message-box__title{
color: #000;
}
.el-message-box__btns{
text-align: center;
}
.el-message-box__content{
color: #fff;
} }

View File

@ -1,57 +0,0 @@
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
const whiteList = []
router.beforeEach((to, from, next) => {
NProgress.start()
if (getToken()) {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/
if (to.path === '/login') {
next({ path: '/' })
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
next();
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
})
})
} else {
next()
}
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next()
} else {
//next(`/login?redirect=#/index`) // 否则全部重定向到登录页
let base="/";
if(location.host.indexOf("localhost")>=0){
base="/jhapp/"
}
location.href=base+"#/login?redirect=/jhbs/#/";
NProgress.done()
}
}
})
router.afterEach(() => {
NProgress.done()
})

View File

@ -1,13 +0,0 @@
const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
userId: state => state.user.userId,
name: state => state.user.name,
dept:state=>state.user.dept,
introduction: state => state.user.introduction,
roles: state => state.user.roles,
nickName:state=>state.user.nickName,
roleId:state=>state.user.roleId,
permissions: state => state.user.permissions,
}
export default getters

View File

@ -1,17 +0,0 @@
import Vue from 'vue'
import Vuex from 'vuex'
import user from './modules/user'
import getters from './getters'
Vue.use(Vuex)
const store = new Vuex.Store({
modules: {
user
},
getters
})
export default store

View File

@ -1,118 +0,0 @@
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
const user = {
state: {
token: getToken(),
userId:'',
name: '',
nickName:'',
roleId:0,
avatar: '',
dept:null,
roles: [],
permissions: []
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_USER_ID: (state, id) => {
state.userId = id
},
SET_NAME: (state, name) => {
state.name = name
},
SET_NICKNAME: (state, nickName) => {
state.nickName = nickName
},
SET_ROLEID: (state, roleId) => {
state.roleId = roleId
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
},
SET_DEPT: (state, dept) => {
state.dept = dept
}
},
actions: {
// 登录
Login({ commit }, userInfo) {
const username = userInfo.username.trim()
const password = userInfo.password
const code = userInfo.code
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
resolve()
}).catch(error => {
reject(error)
})
})
},
// 获取用户信息
GetInfo({ commit, state }) {
return new Promise(async (resolve, reject) => {
let res=await getInfo()
const user = res.user
const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.png") : process.env.VUE_APP_BASE_API + user.avatar;
if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组
commit('SET_ROLES', res.roles)
commit('SET_PERMISSIONS', res.permissions)
} else {
commit('SET_ROLES', ['ROLE_DEFAULT'])
}
commit('SET_USER_ID', user.userId)
commit('SET_NAME', user.userName)
commit('SET_NICKNAME', user.nickName)
commit('SET_ROLEID', res.roleId)
commit("SET_DEPT",user.dept);
commit('SET_AVATAR', avatar)
resolve(res)
}).catch(error => {
reject(error)
})
},
// 退出系统
LogOut({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit("SET_DEPT",null);
commit('SET_ROLES', [])
commit('SET_PERMISSIONS', [])
removeToken()
resolve()
}).catch(error => {
reject(error)
})
})
},
// 前端 登出
FedLogOut({ commit }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
removeToken()
resolve()
})
}
}
}
export default user

View File

@ -51,6 +51,7 @@ service.interceptors.request.use(config => {
const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交 const interval = 1000; // 间隔时间(ms),小于此时间视为重复提交
if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) { if (s_data === requestObj.data && requestObj.time - s_time < interval && s_url === requestObj.url) {
const message = '数据正在处理,请勿重复提交'; const message = '数据正在处理,请勿重复提交';
//console.warn(`[${s_url}]: ` + message+",",config,s_url)
console.warn("--->",s_data,requestObj.data,s_url) console.warn("--->",s_data,requestObj.data,s_url)
return Promise.reject(new Error(message)) return Promise.reject(new Error(message))
} else { } else {
@ -80,7 +81,7 @@ service.interceptors.response.use(res => {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false; isRelogin.show = false;
if(location.href.indexOf("localhost")>=0){ if(location.href.indexOf("localhost")>=0){
//location.href = `/#/login?redirect=${encodeURIComponent("/jhbs/")}`; //location.href = `/#/login?redirect=${encodeURIComponent("http://localhost:3000/jhbs/")}`;
location.href=`http://localhost/#/login?redirect=${encodeURI('http://localhost:3000/jhbs/')}` location.href=`http://localhost/#/login?redirect=${encodeURI('http://localhost:3000/jhbs/')}`
}else{ }else{
location.href = `/#/login?redirect=${encodeURIComponent("/jhbs/")}`; location.href = `/#/login?redirect=${encodeURIComponent("/jhbs/")}`;

View File

@ -1,7 +1,7 @@
const { defineConfig } = require('@vue/cli-service') const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({ module.exports = defineConfig({
transpileDependencies: true, transpileDependencies: true,
publicPath :'/jhbs' , publicPath :'./' ,
productionSourceMap:false, productionSourceMap:false,
devServer: { devServer: {
host: '0.0.0.0', host: '0.0.0.0',
@ -15,13 +15,6 @@ module.exports = defineConfig({
'^/jhapi/profile':'/' '^/jhapi/profile':'/'
} }
}, },
'/jhapp':{
target: `http://62.234.3.186/`,
changeOrigin: true,
pathRewrite: {
'^/jhapp':'/'
}
},
'/cesium':{ '/cesium':{
target: `http://62.234.3.186/cesium/`, target: `http://62.234.3.186/cesium/`,
changeOrigin: true, changeOrigin: true,

View File

@ -4450,11 +4450,6 @@ npm-run-path@^4.0.1:
dependencies: dependencies:
path-key "^3.0.0" path-key "^3.0.0"
nprogress@0.2.0:
version "0.2.0"
resolved "https://registry.npmmirror.com/nprogress/-/nprogress-0.2.0.tgz#cb8f34c53213d895723fcbab907e9422adbcafb1"
integrity sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==
nth-check@^2.0.1: nth-check@^2.0.1:
version "2.1.1" version "2.1.1"
resolved "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz" resolved "https://registry.npmmirror.com/nth-check/-/nth-check-2.1.1.tgz"
@ -6006,11 +6001,6 @@ vue@^2.6.14:
"@vue/compiler-sfc" "2.7.14" "@vue/compiler-sfc" "2.7.14"
csstype "^3.1.0" csstype "^3.1.0"
vuex@3.6.0:
version "3.6.0"
resolved "https://registry.npmmirror.com/vuex/-/vuex-3.6.0.tgz#95efa56a58f7607c135b053350833a09e01aa813"
integrity sha512-W74OO2vCJPs9/YjNjW8lLbj+jzT24waTo2KShI8jLvJW8OaIkgb3wuAMA7D+ZiUxDOx3ubwSZTaJBip9G8a3aQ==
watchpack@^2.4.0: watchpack@^2.4.0:
version "2.4.0" version "2.4.0"
resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz" resolved "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz"