Commit 638ea938 authored by 李苏's avatar 李苏 💬

首页调整

parent ce25947e
...@@ -4,9 +4,11 @@ ...@@ -4,9 +4,11 @@
<div class="bigTitle"> <div class="bigTitle">
<div class="menus"> <div class="menus">
<div v-for="(item,index) in menusItems" :key="index" @click="changeItem(index)" class="menusItem" :class="{ <div v-for="(item,index) in menusItems" :key="index" @click="changeItem(index)" class="menusItem" :class="{
'menusItemActive':index==active 'menusItemActive':index==active,
'gsIndex':index==0,
'nogsIndex':index!=0
}"> }">
{{item.bmmc}} {{item.name}}
</div> </div>
</div> </div>
<span class='kbtime'>{{newTime}}</span> <span class='kbtime'>{{newTime}}</span>
...@@ -401,9 +403,50 @@ ...@@ -401,9 +403,50 @@
this.newTime = this.$moment(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss') this.newTime = this.$moment(new Date().getTime()).format('YYYY-MM-DD HH:mm:ss')
}, 1000) }, 1000)
/* 初始化公司*/ /* 初始化公司*/
this.$post('jcsj/common/bm/queryGs', {}).then(res => { this.$post('aqgl/jcsj/ubm/query', {}).then(res => {
this.menusItems = res.data.records || [] let bmList= res.data.records || []
this.changeItem(0) let bmMap = new Map(bmList.map(item=>{
if(item.bmmc=='生产单位'){
item.bmmc='公司'
}
return [item.bmmc,item.id]
}))
this.menusItems.forEach(item=>{
if( bmMap.get(item.name)){
item.id = bmMap.get(item.name)
}
})
if(this.superuser){
this.changeItem(0)
}else{
/* 选中个人orgName*/
let index=0
this.$post('aqgl/aqhd/ubzhzy/queryBmWithUser',{
bmId:this.orgname
}).then(res=>{
let bmmc =res.data.records.bmmc
this.menusItems.forEach((item,itemIndex)=>{
if(item.name==bmmc){
index=itemIndex
console.log('存在部门')
}
})
this.changeItem(index)
})
}
this.allInitTimer = setInterval(() => { this.allInitTimer = setInterval(() => {
this.initAll() this.initAll()
}, 1000 * 60 * 5) }, 1000 * 60 * 5)
...@@ -440,7 +483,36 @@ ...@@ -440,7 +483,36 @@
newTime: null, newTime: null,
timer1: null, timer1: null,
allInitTimer: null, allInitTimer: null,
menusItems: [], menusItems: [{
name:'公司',
id:'4028909F8F806101018F99D332040062',
type:'gsId'
},
{
name:'采矿作业区',
id:'4028909F8F775B76018F79D1A62C0046',
type:'bmId'
},
{
name:'第一选矿车间',
id:'4028909F8F775B76018F79D1E8ED0048',
type:'bmId'
},
{
name:'第二焙烧车间',
id:'4028909F8F806101018F99E09C40008C',
type:'bmId'
},
{
name:'质量计量控制中心',
id:'4028909F8F775B76018F79D23B22004A',
type:'bmId'
},
{
name:'加油站',
id:'4028909F8F775B76018F79CEFC4F0037',
type:'bmId'
}],
active: 0, active: 0,
/* 仪表盘*/ /* 仪表盘*/
colors: [{ colors: [{
...@@ -603,15 +675,8 @@ ...@@ -603,15 +675,8 @@
/* 公司级安全培训*/ /* 公司级安全培训*/
initFxgk(){ initFxgk(){
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/fxgk', params).then(res => { this.$post('aqgl/homepage/fxgk', params).then(res => {
this.fxgkList = res.data.records || [] this.fxgkList = res.data.records || []
}) })
...@@ -619,15 +684,8 @@ ...@@ -619,15 +684,8 @@
/* 查询安全天数*/ /* 查询安全天数*/
initAqts() { initAqts() {
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/aqts', params).then(res => { this.$post('aqgl/homepage/aqts', params).then(res => {
this.aqts = res.data.records || 0 this.aqts = res.data.records || 0
}) })
...@@ -637,15 +695,8 @@ ...@@ -637,15 +695,8 @@
}, },
/* 应急管理*/ /* 应急管理*/
initEyjgl() { initEyjgl() {
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/yjgl', params).then(res => { this.$post('aqgl/homepage/yjgl', params).then(res => {
let records = res.data.records let records = res.data.records
let KeyList = Object.keys(records) let KeyList = Object.keys(records)
...@@ -657,15 +708,8 @@ ...@@ -657,15 +708,8 @@
}, },
/* 安全培训*/ /* 安全培训*/
initEaqpx() { initEaqpx() {
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/aqpx', params).then(res => { this.$post('aqgl/homepage/aqpx', params).then(res => {
let records = res.data.records || [] let records = res.data.records || []
let KeyList = Object.keys(records) let KeyList = Object.keys(records)
...@@ -676,15 +720,8 @@ ...@@ -676,15 +720,8 @@
}) })
}, },
initlzgl() { initlzgl() {
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/lzgl', params).then(res => { this.$post('aqgl/homepage/lzgl', params).then(res => {
let records = _.cloneDeep(res.data.records || []) let records = _.cloneDeep(res.data.records || [])
let keyList = Object.keys(records) let keyList = Object.keys(records)
...@@ -773,15 +810,8 @@ ...@@ -773,15 +810,8 @@
}, },
/* 持证预警*/ /* 持证预警*/
initscyj() { initscyj() {
let gsId = this.menusItems[this.active]['id'] let params={}
let params = { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
}
if (this.superuser) {
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/czyj', params).then(res => { this.$post('aqgl/homepage/czyj', params).then(res => {
let records = res.data.records let records = res.data.records
/* x 轴*/ /* x 轴*/
...@@ -886,15 +916,10 @@ ...@@ -886,15 +916,10 @@
}) })
}, },
inityhpc() { inityhpc() {
let gsId = this.menusItems[this.active]['id']
let params = {
} let params={}
if (this.superuser) { params[this.menusItems[this.active]['type']]=this.menusItems[this.active]['id']
params.gsId = gsId
} else {
params.bmId = gsId
}
this.$post('aqgl/homepage/yhpc', params).then(res => { this.$post('aqgl/homepage/yhpc', params).then(res => {
let records = res.data.records let records = res.data.records
let xData = Object.keys(records) let xData = Object.keys(records)
...@@ -1027,13 +1052,14 @@ ...@@ -1027,13 +1052,14 @@
height: 60px; height: 60px;
.menusItem { .menusItem {
font-size: 16px; font-size: 13px;
font-weight: 700; font-weight: 700;
float: left; float: left;
width: 142px; width: 148px;
height: 48; height: 48;
margin: 5px 6px 0; margin: 5px 6px 0;
background: url(./static/dhbg.png) no-repeat; background: url(./static/dhbg.png) no-repeat;
background-size: 100% 100%;
text-align: center; text-align: center;
line-height: 48px; line-height: 48px;
cursor: pointer; cursor: pointer;
...@@ -1050,7 +1076,8 @@ ...@@ -1050,7 +1076,8 @@
} }
.menusItemActive { .menusItemActive {
color: #3279d5; color: #55d5c6 !important;
text-shadow: 0 0 .5rem #00d8ff;
} }
} }
} }
...@@ -1161,4 +1188,11 @@ ...@@ -1161,4 +1188,11 @@
background-image: url(./static/gs.jpg); background-image: url(./static/gs.jpg);
background-size: 100% 100%; background-size: 100% 100%;
} }
.gsIndex{
font-size: 15px!important;
font-weight: 800
}
.nogsIndex{
font-style: italic;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment