Commit 63dde208 authored by 李苏's avatar 李苏 💬

修改调用接口,定时查询

parent e7a162c0
...@@ -194,77 +194,20 @@ ...@@ -194,77 +194,20 @@
Yszx Yszx
}, },
mounted() { mounted() {
/* 地图后端数据*/ this.mounted()
doQueryRepDetail({ /* 刷新频率*/
"sjlx": 'HJ' const DELAY=1000*60*30
}).then(res => { this.DELAYNUM=setInterval(()=>{
if (res && res.success) { this.mounted()
},DELAY)
/* 获取数据后操作*/ },
let { destroyed() {
records clearInterval(this.DELAYNUM)
} = res.data
let haRecord = records.filter(item => {
return item.gsbz == 'Y'
})
if (haRecord.length != 0) {
/* 取第一条*/
this.hapm = haRecord[0].pm
}
/* 其他部门数据 目前按照部门名称进行过滤 */
let habbList = records.filter(item => {
return item.bmName == '淮安供电公司本部'
})
let jhxList = records.filter(item => {
return item.bmName == '金湖县供电公司'
})
let xyxList = records.filter(item => {
return item.bmName == '盱眙县供电公司'
})
let hzxList = records.filter(item => {
return item.bmName == '洪泽县供电公司'
})
let lsxList = records.filter(item => {
return item.bmName == '涟水县供电公司'
})
// 初始地图JSON数据
this.$nextTick(() => {
document.getElementById("szkb").addEventListener('dblclick', function(e) {
fullScreen(document.getElementById("szkb"));
}, false);
/* 初始化地图*/
this.szkbmapCharts = this.initSzkbmapCharts({
habbList: habbList,
jhxList: jhxList,
xyxList: xyxList,
hzxList: hzxList,
lsxList: lsxList
})
this.sdtCharts = this.initsdt()
this.szkbmapCharts.on("click", (params) => {
if (params.data) {
//获取到定义的数据
let info = params.data.data
/* 弹框传参查询*/
this.dialog.bmid = info.bmid
this.dialog.DialogTitle = info.bmName
this.dialog.showDialog = true
}
});
})
}
})
this.initLqnd()
this.initLqnd2()
this.initslt()
this.isLoading = false
}, },
data() { data() {
return { return {
/* 定时器id*/
DELAYNUM:null,
/* 两区农电预算一览 */ /* 两区农电预算一览 */
lqndylName1: '', lqndylName1: '',
lqndylName2: '', lqndylName2: '',
...@@ -327,72 +270,127 @@ ...@@ -327,72 +270,127 @@
} }
}, },
methods: { methods: {
initLqnd() { mounted(){
this.$post('hafms/yszhcxlog/query', { /*初始化*/
lx: 'A' /* 地图后端数据*/
doQueryRepDetail({
"sjlx": 'HJ'
}).then(res => { }).then(res => {
if (res && res.success && res.data.records && res.data.records.length > 0) { if (res && res.success) {
let newData = res.data.records[0]
this.$post('hafms/yszhcxlog/queryDetail', { /* 获取数据后操作*/
mid: newData.id, let {
}).then(res => { records
if (res.success && res.data.records) { } = res.data
const { let haRecord = records.filter(item => {
records return item.gsbz == 'Y'
} = res.data })
if (records.length != 0) { if (haRecord.length != 0) {
let lxh1 = records.filter(item => { /* 取第一条*/
if (item.lxh == '1') { this.hapm = haRecord[0].pm
this.lqndylName1 = item.gsname }
return true /* 其他部门数据 目前按照部门名称进行过滤 */
} let habbList = records.filter(item => {
}) return item.bmName == '淮安供电公司本部'
let lxh2 = records.filter(item => { })
if (item.lxh == '2') { let jhxList = records.filter(item => {
this.lqndylName2 = item.gsname return item.bmName == '金湖县供电公司'
return true })
} let xyxList = records.filter(item => {
}) return item.bmName == '盱眙县供电公司'
this.lg1 = this.initlg1(lxh1[0]) })
this.lg2 = this.initlg2(lxh2[0]) let hzxList = records.filter(item => {
return item.bmName == '洪泽县供电公司'
})
let lsxList = records.filter(item => {
return item.bmName == '涟水县供电公司'
})
// 初始地图JSON数据
this.$nextTick(() => {
document.getElementById("szkb").addEventListener('dblclick', function(e) {
fullScreen(document.getElementById("szkb"));
}, false);
/* 初始化地图*/
this.szkbmapCharts = this.initSzkbmapCharts({
habbList: habbList,
jhxList: jhxList,
xyxList: xyxList,
hzxList: hzxList,
lsxList: lsxList
})
this.sdtCharts = this.initsdt()
this.szkbmapCharts.on("click", (params) => {
if (params.data) {
//获取到定义的数据
let info = params.data.data
/* 弹框传参查询*/
this.dialog.bmid = info.bmid
this.dialog.DialogTitle = info.bmName
this.dialog.showDialog = true
} }
} });
}) })
this.isLoading = false
}
})
this.initLqnd()
this.initLqnd2()
this.initslt()
},
initLqnd() {
this.$post('hafms/yszhcxlog/queryRepDetail', {
lx: 'A'
}).then(res => {
if (res.success && res.data.records) {
const {
records
} = res.data
if (records.length != 0) {
let lxh1 = records.filter(item => {
if (item.lxh == '1') {
this.lqndylName1 = item.gsname
return true
}
})
let lxh2 = records.filter(item => {
if (item.lxh == '2') {
this.lqndylName2 = item.gsname
return true
}
})
this.lg1 = this.initlg1(lxh1[0])
this.lg2 = this.initlg2(lxh2[0])
}
} }
}) })
}, },
initLqnd2() { initLqnd2() {
this.$post('hafms/yszhcxlog/query', { this.$post('hafms/yszhcxlog/queryRepDetail', {
lx: 'B' lx: 'B'
}).then(res => { }).then(res => {
if (res && res.success && res.data.records && res.data.records.length > 0) { if (res.success && res.data.records) {
let newData = res.data.records[0] const {
this.$post('hafms/yszhcxlog/queryDetail', { records
mid: newData.id, } = res.data
}).then(res => { if (records.length != 0) {
if (res.success && res.data.records) { let lxh1 = records.filter(item => {
const { if (item.lxh == '1') {
records this.lhName1 = item.gsname
} = res.data return true
if (records.length != 0) {
let lxh1 = records.filter(item => {
if (item.lxh == '1') {
this.lhName1 = item.gsname
return true
}
})
let lxh2 = records.filter(item => {
if (item.lxh == '2') {
this.lhName2 = item.gsname
return true
}
})
this.lg3 = this.initlg3(lxh1[0])
this.lg4 = this.initlg4(lxh2[0])
} }
} })
}) let lxh2 = records.filter(item => {
if (item.lxh == '2') {
this.lhName2 = item.gsname
return true
}
})
this.lg3 = this.initlg3(lxh1[0])
this.lg4 = this.initlg4(lxh2[0])
}
} }
}) })
}, },
......
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