Commit 8b6b4813 authored by 李苏's avatar 李苏 💬

调整

parent 1196f534
......@@ -271,7 +271,7 @@
</div>
<div class="full flex">
<!-- 占比图-->
<div class="flex1">
<div v-show='active==0' class="flex1">
<div class="full" ref='gsjyjgl'>
</div>
......@@ -336,7 +336,7 @@
<div class="full flex">
<!-- 占比图-->
<div class="flex1">
<div v-show="active==0" class="flex1">
<div class="full" ref='gsjaqpx'>
</div>
......@@ -385,8 +385,12 @@
}
},
async mounted() {
this.yhlxMap = await this.$match({
url: "aqgl/yhgl/yhfl/query"
})
this.clztMap = await this.$match({
url: "aqgl/yhgl/yhjl/init/zt"
})
/* 获取当前登录人的信息*/
let res = await this.$post('jcsj/common/vaild/homePage', {})
let sign = res.data.records
......@@ -499,22 +503,33 @@
});
})
/* 自动 */
this.timer2 = setInterval(() => {
this.resize()
}, 100)
})
},
beforeDestroy() {
clearInterval(this.timer1)
clearInterval(this.timer2)
clearInterval(this.allInitTimer)
},
data() {
return {
yhpcKsrq:'',
yhpcJsrq:'',
yhlxMap: {},
clztMap: {},
orgname: allUserInfo.orgname,
superuser: allUserInfo.superuser,
fxgkList: [],
aqts: 0,
newTime: null,
timer1: null,
timer2: null,
allInitTimer: null,
menusItems: [{
name: '公司',
......@@ -566,6 +581,19 @@
},
methods: {
resize() {
this.eyhpc.resize()
this.eczyj.resize()
this.egsjaqpx.resize()
this.ecjjaqpx.resize()
this.ebzjaqpx.resize()
this.egsjyjgl.resize()
this.ecjjyjgl.resize()
this.ebzjyjgl.resize()
this.elzgl.resize()
},
changeItem(index) {
this.active = index
this.initAll()
......@@ -574,6 +602,9 @@
},
initAll() {
this.initAqts()
this.inityhpc()
this.initscyj()
......@@ -711,7 +742,7 @@
initFxgk() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/fxgk', params).then(res => {
this.fxgkList = res.data.records || []
})
......@@ -721,7 +752,7 @@
initAqts() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/aqts', params).then(res => {
this.aqts = res.data.records || 0
})
......@@ -733,7 +764,7 @@
initEyjgl() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/yjgl', params).then(res => {
let records = res.data.records
let KeyList = Object.keys(records)
......@@ -747,7 +778,7 @@
initEaqpx() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/aqpx', params).then(res => {
let records = res.data.records || []
if (('公司级' in records) == false) {
......@@ -787,7 +818,7 @@
initlzgl() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/lzgl', params).then(res => {
let records = _.cloneDeep(res.data.records || [])
let keyList = Object.keys(records)
......@@ -877,7 +908,8 @@
/* 持证预警*/
initscyj() {
let params = {}
// params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/czyj', params).then(res => {
let records = res.data.records
/* x 轴*/
......@@ -984,10 +1016,32 @@
inityhpc() {
let params = {}
params[this.menusItems[this.active]['type']] = this.menusItems[this.active]['id']
Object.keys(params).includes('gsId')&&(delete params.gsId)
Object.keys(params).includes('gsId') && (delete params.gsId)
this.$post('aqgl/homepage/yhpc', params).then(res => {
let records = res.data.records
let xData = ['人员违章', '设备设施', '环境影响', '管理缺陷']
let xData = []
let iList = []
let zList = []
let cList = []
let fList = []
this.yhpcJsrq=records['jsrq']
this.yhpcKsrq=records['ksrq']
Object.keys(records).forEach(key => {
if (key != 'jsrq' && key != 'ksrq') {
/* 处理其他数据*/
iList.push(records[key].I)
zList.push(records[key].Z)
cList.push(records[key].C)
fList.push(records[key].F)
xData.push(this.yhlxMap[key])
}
})
console.log(iList)
let yhList = []
xData.forEach(key => {
yhList.push(records[key])
......@@ -1001,7 +1055,7 @@
}
},
color: ['#15c9ff', '#FF7474', '#91cc75'],
color: [ '#ffb56b','#FF7474','#ffae6b','#91cc75'],
grid: {
top: '10%',
left: '3%',
......@@ -1045,16 +1099,49 @@
}],
series: [{
name: '隐患数量',
name: '待分配',
type: 'bar',
data: yhList,
data: iList,
label: {
show: true,
position: 'top', // 数字显示在柱子上方
color: '#fff'
},
barWidth: '15px'
}, ]
},
{
name: '待整改',
type: 'bar',
data: zList,
label: {
show: true,
position: 'top', // 数字显示在柱子上方
color: '#fff'
},
barWidth: '15px'
},
{
name: '待复查',
type: 'bar',
data: fList,
label: {
show: true,
position: 'top', // 数字显示在柱子上方
color: '#fff'
},
barWidth: '15px'
},
{
name: '完成',
type: 'bar',
data: cList,
label: {
show: true,
position: 'top', // 数字显示在柱子上方
color: '#fff'
},
barWidth: '15px'
}]
};
this.eyhpc.setOption(option);
......
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