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

调整

parent 1196f534
...@@ -271,7 +271,7 @@ ...@@ -271,7 +271,7 @@
</div> </div>
<div class="full flex"> <div class="full flex">
<!-- 占比图--> <!-- 占比图-->
<div class="flex1"> <div v-show='active==0' class="flex1">
<div class="full" ref='gsjyjgl'> <div class="full" ref='gsjyjgl'>
</div> </div>
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
<div class="full flex"> <div class="full flex">
<!-- 占比图--> <!-- 占比图-->
<div class="flex1"> <div v-show="active==0" class="flex1">
<div class="full" ref='gsjaqpx'> <div class="full" ref='gsjaqpx'>
</div> </div>
...@@ -385,8 +385,12 @@ ...@@ -385,8 +385,12 @@
} }
}, },
async mounted() { 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 res = await this.$post('jcsj/common/vaild/homePage', {})
let sign = res.data.records let sign = res.data.records
...@@ -499,22 +503,33 @@ ...@@ -499,22 +503,33 @@
}); });
}) })
/* 自动 */
this.timer2 = setInterval(() => {
this.resize()
}, 100)
}) })
}, },
beforeDestroy() { beforeDestroy() {
clearInterval(this.timer1) clearInterval(this.timer1)
clearInterval(this.timer2)
clearInterval(this.allInitTimer) clearInterval(this.allInitTimer)
}, },
data() { data() {
return { return {
yhpcKsrq:'',
yhpcJsrq:'',
yhlxMap: {},
clztMap: {},
orgname: allUserInfo.orgname, orgname: allUserInfo.orgname,
superuser: allUserInfo.superuser, superuser: allUserInfo.superuser,
fxgkList: [], fxgkList: [],
aqts: 0, aqts: 0,
newTime: null, newTime: null,
timer1: null, timer1: null,
timer2: null,
allInitTimer: null, allInitTimer: null,
menusItems: [{ menusItems: [{
name: '公司', name: '公司',
...@@ -566,6 +581,19 @@ ...@@ -566,6 +581,19 @@
}, },
methods: { 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) { changeItem(index) {
this.active = index this.active = index
this.initAll() this.initAll()
...@@ -574,6 +602,9 @@ ...@@ -574,6 +602,9 @@
}, },
initAll() { initAll() {
this.initAqts() this.initAqts()
this.inityhpc() this.inityhpc()
this.initscyj() this.initscyj()
...@@ -711,7 +742,7 @@ ...@@ -711,7 +742,7 @@
initFxgk() { initFxgk() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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 || []
}) })
...@@ -721,7 +752,7 @@ ...@@ -721,7 +752,7 @@
initAqts() { initAqts() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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
}) })
...@@ -733,7 +764,7 @@ ...@@ -733,7 +764,7 @@
initEyjgl() { initEyjgl() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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)
...@@ -747,7 +778,7 @@ ...@@ -747,7 +778,7 @@
initEaqpx() { initEaqpx() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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 || []
if (('公司级' in records) == false) { if (('公司级' in records) == false) {
...@@ -787,7 +818,7 @@ ...@@ -787,7 +818,7 @@
initlzgl() { initlzgl() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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)
...@@ -877,7 +908,8 @@ ...@@ -877,7 +908,8 @@
/* 持证预警*/ /* 持证预警*/
initscyj() { initscyj() {
let params = {} 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 => { this.$post('aqgl/homepage/czyj', params).then(res => {
let records = res.data.records let records = res.data.records
/* x 轴*/ /* x 轴*/
...@@ -984,10 +1016,32 @@ ...@@ -984,10 +1016,32 @@
inityhpc() { inityhpc() {
let params = {} 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) Object.keys(params).includes('gsId') && (delete params.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 = ['人员违章', '设备设施', '环境影响', '管理缺陷'] 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 = [] let yhList = []
xData.forEach(key => { xData.forEach(key => {
yhList.push(records[key]) yhList.push(records[key])
...@@ -1001,7 +1055,7 @@ ...@@ -1001,7 +1055,7 @@
} }
}, },
color: ['#15c9ff', '#FF7474', '#91cc75'], color: [ '#ffb56b','#FF7474','#ffae6b','#91cc75'],
grid: { grid: {
top: '10%', top: '10%',
left: '3%', left: '3%',
...@@ -1045,16 +1099,49 @@ ...@@ -1045,16 +1099,49 @@
}], }],
series: [{ series: [{
name: '隐患数量', name: '待分配',
type: 'bar', type: 'bar',
data: yhList, data: iList,
label: { label: {
show: true, show: true,
position: 'top', // 数字显示在柱子上方 position: 'top', // 数字显示在柱子上方
color: '#fff' color: '#fff'
}, },
barWidth: '15px' 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); 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