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

修改调用接口,定时查询

parent e7a162c0
......@@ -194,77 +194,20 @@
Yszx
},
mounted() {
/* 地图后端数据*/
doQueryRepDetail({
"sjlx": 'HJ'
}).then(res => {
if (res && res.success) {
/* 获取数据后操作*/
let {
records
} = 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
this.mounted()
/* 刷新频率*/
const DELAY=1000*60*30
this.DELAYNUM=setInterval(()=>{
this.mounted()
},DELAY)
},
destroyed() {
clearInterval(this.DELAYNUM)
},
data() {
return {
/* 定时器id*/
DELAYNUM:null,
/* 两区农电预算一览 */
lqndylName1: '',
lqndylName2: '',
......@@ -327,72 +270,127 @@
}
},
methods: {
initLqnd() {
this.$post('hafms/yszhcxlog/query', {
lx: 'A'
mounted(){
/*初始化*/
/* 地图后端数据*/
doQueryRepDetail({
"sjlx": 'HJ'
}).then(res => {
if (res && res.success && res.data.records && res.data.records.length > 0) {
let newData = res.data.records[0]
this.$post('hafms/yszhcxlog/queryDetail', {
mid: newData.id,
}).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])
if (res && res.success) {
/* 获取数据后操作*/
let {
records
} = 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.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() {
this.$post('hafms/yszhcxlog/query', {
lx: 'B'
this.$post('hafms/yszhcxlog/queryRepDetail', {
lx: 'B'
}).then(res => {
if (res && res.success && res.data.records && res.data.records.length > 0) {
let newData = res.data.records[0]
this.$post('hafms/yszhcxlog/queryDetail', {
mid: newData.id,
}).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.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])
if (res.success && res.data.records) {
const {
records
} = res.data
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])
}
}
})
},
......
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