Authored by 王涛

Merge branch 'master-v32-lushangqing' into 'master'

大屏及电子税务局申报数定时刷新



See merge request !108
... ... @@ -123,8 +123,7 @@ const routes = [{
{
path: '/fault/index',
name: 'faultIndex',
// component: () => myImport('views/faultDiagnosis/index')
component: () => myImport('views/faultDiagnosis/components/faultForm/index')
component: () => myImport('views/faultDiagnosis/index')
},
{
path: '/fault/faultForm',
... ...
... ... @@ -4,7 +4,8 @@ export default {
components: {},
data () {
return {
// chartInstance: null
timer: null,
domainName:sessionStorage.getItem('domainName'),
titleFontSize: 80,
// 千万位数
mustBit: 0,
... ... @@ -82,11 +83,12 @@ export default {
},
mounted () {
// this.startInterval()
// this.initChart()
this.getData(this)
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
this.startInterval()
},
unmounted () {
window.removeEventListener('resize', this.screenAdapter)
... ... @@ -146,12 +148,12 @@ export default {
}
},
getData (that) {
const { proxy } = Vue.getCurrentInstance();
// const { proxy } = Vue.getCurrentInstance();
var params = {
kipValue1: that.kipValue1,
kipValue2: that.kipValue2
};
proxy.$http.get("/api-web/bigScreen/digitalBoardData", params, function (res) {
$.get(that.domainName +"/api-web/bigScreen/digitalBoardData"+'?access_token='+localStorage.getItem('access_token'), params, function (res) {
if(res.success){
const map = res.map
// 左边数
... ... @@ -176,11 +178,17 @@ export default {
this.titleFontSize = document.getElementById('digitalboard_down_ref').offsetWidth / 100 * 3.6
},
startInterval () {
let that=this;
if (this.timer) {
clearInterval(this.timer)
}
// 单元测试 数字板增长
setInterval(() => {
this.declaredAmountNumber += 10
this.initChart()
}, 2000)
that.getData(that)
}, 10000)
},
numberFilter(val,places = 2) {
//value为传进来的数据 比如 12345.6789
... ...
... ... @@ -4,7 +4,8 @@ export default {
components: {},
data () {
return {
// chartInstance: null
timer: null,
domainName:sessionStorage.getItem('domainName'),
titleFontSize: 80,
// 千万位数
mustBit: 0,
... ... @@ -87,8 +88,11 @@ export default {
this.getData(this)
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
this.startInterval()
},
unmounted () {
clearInterval(this.timer)
window.removeEventListener('resize', this.screenAdapter)
},
methods: {
... ... @@ -146,12 +150,12 @@ export default {
}
},
getData (that) {
const { proxy } = Vue.getCurrentInstance();
// const { proxy } = Vue.getCurrentInstance();
var params = {
kipValue1: that.kipValue1,
kipValue2: that.kipValue2
};
proxy.$http.get("/api-web/bigScreen/digitalBoardData", params, function (res) {
$.get(that.domainName +"/api-web/bigScreen/digitalBoardData"+'?access_token='+localStorage.getItem('access_token'), params, function (res) {
if(res.success){
const map = res.map
// 左边数
... ... @@ -176,11 +180,16 @@ export default {
this.titleFontSize = document.getElementById('digitalboard_top_ref').offsetWidth / 100 * 3.6
},
startInterval () {
let that=this;
if (this.timer) {
clearInterval(this.timer)
}
// 单元测试 数字板增长
setInterval(() => {
this.declaredAmountNumber += 10
this.initChart()
}, 2000)
this.timer=setInterval(() => {
that.declaredAmountNumber += 10
that.getData(that)
}, 10000)
},
numberFilter(val,places = 2) {
//value为传进来的数据 比如 12345.6789
... ...
... ... @@ -8,6 +8,7 @@ export default {
},
data(){
return {
timer:null,//定时刷新
domainName:sessionStorage.getItem('domainName'),
apiUrl:'/api-web/bigScreen/digitalBoardData',//本月已申报/未申报
apiUrl1:'/api-web/bigScreen/findPortfolio',//今日业务量
... ... @@ -69,29 +70,8 @@ export default {
}
});
$.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBF&kipValue2=KPIDA0ACBBD'+'&access_token='+localStorage.getItem('access_token'),function (res) {
const data = res;
if(data && data.map){
let reportableMonth=data.map.rightNumber;
proxy.declaredMonth=data.map.leftNumber;
proxy.reportableMonth=proxy.numberFilter(reportableMonth,-1);
// let reportable=parseInt(data.map.rightNumber)+parseInt(data.map.leftNumber);
// proxy.reportable=proxy.numberFilter(reportable,-1);
}
})
$.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBS&kipValue2=KPIDA0ACBBE'+'&access_token='+localStorage.getItem('access_token'),function (res) {
const data = res;
if(data && data.map){
let reportableToday=data.map.rightNumber;
proxy.declaredToday=data.map.leftNumber;
proxy.reportableToday=proxy.numberFilter(reportableToday,-1);
}
})
proxy.getDeclareData();
proxy.startInterval();
//业务量
$.get(proxy.domainName +proxy.apiUrl1+'?access_token='+localStorage.getItem('access_token'),function (res) {
... ... @@ -135,6 +115,39 @@ export default {
})
})
const startInterval=()=>{
if (proxy.timer) {
clearInterval(proxy.timer)
}
proxy.timer=setInterval(function (){
proxy.getDeclareData();
},10000)
}
const getDeclareData=()=>{
$.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBF&kipValue2=KPIDA0ACBBD'+'&access_token='+localStorage.getItem('access_token'),function (res) {
const data = res;
if(data && data.map){
let reportableMonth=data.map.rightNumber;
proxy.declaredMonth=data.map.leftNumber;
proxy.reportableMonth=proxy.numberFilter(reportableMonth,-1);
// let reportable=parseInt(data.map.rightNumber)+parseInt(data.map.leftNumber);
// proxy.reportable=proxy.numberFilter(reportable,-1);
}
})
$.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBS&kipValue2=KPIDA0ACBBE'+'&access_token='+localStorage.getItem('access_token'),function (res) {
const data = res;
if(data && data.map){
let reportableToday=data.map.rightNumber;
proxy.declaredToday=data.map.leftNumber;
proxy.reportableToday=proxy.numberFilter(reportableToday,-1);
}
})
}
const eleWidthNum=(num,maxNum)=>{
let widthNum=Math.ceil((num*150)/maxNum)
let widthData=0;
... ... @@ -170,7 +183,12 @@ export default {
return{
numberFilter,
eleWidthNum
}
eleWidthNum,
getDeclareData,
startInterval
}
},
unmounted () {
clearInterval(this.timer)
},
}
... ...