Merge branch 'master' of http://113.200.75.45:82/monitor_v3/hg-monitor-web into master-v32-xwx
Showing
4 changed files
with
74 additions
and
40 deletions
@@ -123,8 +123,7 @@ const routes = [{ | @@ -123,8 +123,7 @@ const routes = [{ | ||
123 | { | 123 | { |
124 | path: '/fault/index', | 124 | path: '/fault/index', |
125 | name: 'faultIndex', | 125 | name: 'faultIndex', |
126 | - // component: () => myImport('views/faultDiagnosis/index') | ||
127 | - component: () => myImport('views/faultDiagnosis/components/faultForm/index') | 126 | + component: () => myImport('views/faultDiagnosis/index') |
128 | }, | 127 | }, |
129 | { | 128 | { |
130 | path: '/fault/faultForm', | 129 | path: '/fault/faultForm', |
@@ -4,7 +4,8 @@ export default { | @@ -4,7 +4,8 @@ export default { | ||
4 | components: {}, | 4 | components: {}, |
5 | data () { | 5 | data () { |
6 | return { | 6 | return { |
7 | - // chartInstance: null | 7 | + timer: null, |
8 | + domainName:sessionStorage.getItem('domainName'), | ||
8 | titleFontSize: 80, | 9 | titleFontSize: 80, |
9 | // 千万位数 | 10 | // 千万位数 |
10 | mustBit: 0, | 11 | mustBit: 0, |
@@ -82,11 +83,12 @@ export default { | @@ -82,11 +83,12 @@ export default { | ||
82 | 83 | ||
83 | }, | 84 | }, |
84 | mounted () { | 85 | mounted () { |
85 | - // this.startInterval() | ||
86 | // this.initChart() | 86 | // this.initChart() |
87 | this.getData(this) | 87 | this.getData(this) |
88 | window.addEventListener('resize', this.screenAdapter) | 88 | window.addEventListener('resize', this.screenAdapter) |
89 | this.screenAdapter() | 89 | this.screenAdapter() |
90 | + this.startInterval() | ||
91 | + | ||
90 | }, | 92 | }, |
91 | unmounted () { | 93 | unmounted () { |
92 | window.removeEventListener('resize', this.screenAdapter) | 94 | window.removeEventListener('resize', this.screenAdapter) |
@@ -146,12 +148,12 @@ export default { | @@ -146,12 +148,12 @@ export default { | ||
146 | } | 148 | } |
147 | }, | 149 | }, |
148 | getData (that) { | 150 | getData (that) { |
149 | - const { proxy } = Vue.getCurrentInstance(); | 151 | + // const { proxy } = Vue.getCurrentInstance(); |
150 | var params = { | 152 | var params = { |
151 | kipValue1: that.kipValue1, | 153 | kipValue1: that.kipValue1, |
152 | kipValue2: that.kipValue2 | 154 | kipValue2: that.kipValue2 |
153 | }; | 155 | }; |
154 | - proxy.$http.get("/api-web/bigScreen/digitalBoardData", params, function (res) { | 156 | + $.get(that.domainName +"/api-web/bigScreen/digitalBoardData"+'?access_token='+localStorage.getItem('access_token'), params, function (res) { |
155 | if(res.success){ | 157 | if(res.success){ |
156 | const map = res.map | 158 | const map = res.map |
157 | // 左边数 | 159 | // 左边数 |
@@ -176,11 +178,17 @@ export default { | @@ -176,11 +178,17 @@ export default { | ||
176 | this.titleFontSize = document.getElementById('digitalboard_down_ref').offsetWidth / 100 * 3.6 | 178 | this.titleFontSize = document.getElementById('digitalboard_down_ref').offsetWidth / 100 * 3.6 |
177 | }, | 179 | }, |
178 | startInterval () { | 180 | startInterval () { |
181 | + let that=this; | ||
182 | + if (this.timer) { | ||
183 | + clearInterval(this.timer) | ||
184 | + | ||
185 | + } | ||
179 | // 单元测试 数字板增长 | 186 | // 单元测试 数字板增长 |
180 | setInterval(() => { | 187 | setInterval(() => { |
181 | this.declaredAmountNumber += 10 | 188 | this.declaredAmountNumber += 10 |
182 | - this.initChart() | ||
183 | - }, 2000) | 189 | + that.getData(that) |
190 | + | ||
191 | + }, 10000) | ||
184 | }, | 192 | }, |
185 | numberFilter(val,places = 2) { | 193 | numberFilter(val,places = 2) { |
186 | //value为传进来的数据 比如 12345.6789 | 194 | //value为传进来的数据 比如 12345.6789 |
@@ -4,7 +4,8 @@ export default { | @@ -4,7 +4,8 @@ export default { | ||
4 | components: {}, | 4 | components: {}, |
5 | data () { | 5 | data () { |
6 | return { | 6 | return { |
7 | - // chartInstance: null | 7 | + timer: null, |
8 | + domainName:sessionStorage.getItem('domainName'), | ||
8 | titleFontSize: 80, | 9 | titleFontSize: 80, |
9 | // 千万位数 | 10 | // 千万位数 |
10 | mustBit: 0, | 11 | mustBit: 0, |
@@ -87,8 +88,11 @@ export default { | @@ -87,8 +88,11 @@ export default { | ||
87 | this.getData(this) | 88 | this.getData(this) |
88 | window.addEventListener('resize', this.screenAdapter) | 89 | window.addEventListener('resize', this.screenAdapter) |
89 | this.screenAdapter() | 90 | this.screenAdapter() |
91 | + this.startInterval() | ||
92 | + | ||
90 | }, | 93 | }, |
91 | unmounted () { | 94 | unmounted () { |
95 | + clearInterval(this.timer) | ||
92 | window.removeEventListener('resize', this.screenAdapter) | 96 | window.removeEventListener('resize', this.screenAdapter) |
93 | }, | 97 | }, |
94 | methods: { | 98 | methods: { |
@@ -146,12 +150,12 @@ export default { | @@ -146,12 +150,12 @@ export default { | ||
146 | } | 150 | } |
147 | }, | 151 | }, |
148 | getData (that) { | 152 | getData (that) { |
149 | - const { proxy } = Vue.getCurrentInstance(); | 153 | + // const { proxy } = Vue.getCurrentInstance(); |
150 | var params = { | 154 | var params = { |
151 | kipValue1: that.kipValue1, | 155 | kipValue1: that.kipValue1, |
152 | kipValue2: that.kipValue2 | 156 | kipValue2: that.kipValue2 |
153 | }; | 157 | }; |
154 | - proxy.$http.get("/api-web/bigScreen/digitalBoardData", params, function (res) { | 158 | + $.get(that.domainName +"/api-web/bigScreen/digitalBoardData"+'?access_token='+localStorage.getItem('access_token'), params, function (res) { |
155 | if(res.success){ | 159 | if(res.success){ |
156 | const map = res.map | 160 | const map = res.map |
157 | // 左边数 | 161 | // 左边数 |
@@ -176,11 +180,16 @@ export default { | @@ -176,11 +180,16 @@ export default { | ||
176 | this.titleFontSize = document.getElementById('digitalboard_top_ref').offsetWidth / 100 * 3.6 | 180 | this.titleFontSize = document.getElementById('digitalboard_top_ref').offsetWidth / 100 * 3.6 |
177 | }, | 181 | }, |
178 | startInterval () { | 182 | startInterval () { |
183 | + let that=this; | ||
184 | + if (this.timer) { | ||
185 | + clearInterval(this.timer) | ||
186 | + | ||
187 | + } | ||
179 | // 单元测试 数字板增长 | 188 | // 单元测试 数字板增长 |
180 | - setInterval(() => { | ||
181 | - this.declaredAmountNumber += 10 | ||
182 | - this.initChart() | ||
183 | - }, 2000) | 189 | + this.timer=setInterval(() => { |
190 | + that.declaredAmountNumber += 10 | ||
191 | + that.getData(that) | ||
192 | + }, 10000) | ||
184 | }, | 193 | }, |
185 | numberFilter(val,places = 2) { | 194 | numberFilter(val,places = 2) { |
186 | //value为传进来的数据 比如 12345.6789 | 195 | //value为传进来的数据 比如 12345.6789 |
@@ -8,6 +8,7 @@ export default { | @@ -8,6 +8,7 @@ export default { | ||
8 | }, | 8 | }, |
9 | data(){ | 9 | data(){ |
10 | return { | 10 | return { |
11 | + timer:null,//定时刷新 | ||
11 | domainName:sessionStorage.getItem('domainName'), | 12 | domainName:sessionStorage.getItem('domainName'), |
12 | apiUrl:'/api-web/bigScreen/digitalBoardData',//本月已申报/未申报 | 13 | apiUrl:'/api-web/bigScreen/digitalBoardData',//本月已申报/未申报 |
13 | apiUrl1:'/api-web/bigScreen/findPortfolio',//今日业务量 | 14 | apiUrl1:'/api-web/bigScreen/findPortfolio',//今日业务量 |
@@ -69,29 +70,8 @@ export default { | @@ -69,29 +70,8 @@ export default { | ||
69 | 70 | ||
70 | } | 71 | } |
71 | }); | 72 | }); |
72 | - $.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBF&kipValue2=KPIDA0ACBBD'+'&access_token='+localStorage.getItem('access_token'),function (res) { | ||
73 | - const data = res; | ||
74 | - if(data && data.map){ | ||
75 | - let reportableMonth=data.map.rightNumber; | ||
76 | - proxy.declaredMonth=data.map.leftNumber; | ||
77 | - proxy.reportableMonth=proxy.numberFilter(reportableMonth,-1); | ||
78 | - | ||
79 | - // let reportable=parseInt(data.map.rightNumber)+parseInt(data.map.leftNumber); | ||
80 | - // proxy.reportable=proxy.numberFilter(reportable,-1); | ||
81 | - | ||
82 | - | ||
83 | - } | ||
84 | - | ||
85 | - }) | ||
86 | - | ||
87 | - $.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBS&kipValue2=KPIDA0ACBBE'+'&access_token='+localStorage.getItem('access_token'),function (res) { | ||
88 | - const data = res; | ||
89 | - if(data && data.map){ | ||
90 | - let reportableToday=data.map.rightNumber; | ||
91 | - proxy.declaredToday=data.map.leftNumber; | ||
92 | - proxy.reportableToday=proxy.numberFilter(reportableToday,-1); | ||
93 | - } | ||
94 | - }) | 73 | + proxy.getDeclareData(); |
74 | + proxy.startInterval(); | ||
95 | 75 | ||
96 | //业务量 | 76 | //业务量 |
97 | $.get(proxy.domainName +proxy.apiUrl1+'?access_token='+localStorage.getItem('access_token'),function (res) { | 77 | $.get(proxy.domainName +proxy.apiUrl1+'?access_token='+localStorage.getItem('access_token'),function (res) { |
@@ -135,6 +115,39 @@ export default { | @@ -135,6 +115,39 @@ export default { | ||
135 | }) | 115 | }) |
136 | 116 | ||
137 | }) | 117 | }) |
118 | + const startInterval=()=>{ | ||
119 | + if (proxy.timer) { | ||
120 | + clearInterval(proxy.timer) | ||
121 | + | ||
122 | + } | ||
123 | + proxy.timer=setInterval(function (){ | ||
124 | + proxy.getDeclareData(); | ||
125 | + },10000) | ||
126 | + } | ||
127 | + const getDeclareData=()=>{ | ||
128 | + $.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBF&kipValue2=KPIDA0ACBBD'+'&access_token='+localStorage.getItem('access_token'),function (res) { | ||
129 | + const data = res; | ||
130 | + if(data && data.map){ | ||
131 | + let reportableMonth=data.map.rightNumber; | ||
132 | + proxy.declaredMonth=data.map.leftNumber; | ||
133 | + proxy.reportableMonth=proxy.numberFilter(reportableMonth,-1); | ||
134 | + | ||
135 | + // let reportable=parseInt(data.map.rightNumber)+parseInt(data.map.leftNumber); | ||
136 | + // proxy.reportable=proxy.numberFilter(reportable,-1); | ||
137 | + } | ||
138 | + | ||
139 | + }) | ||
140 | + | ||
141 | + $.get(proxy.domainName +proxy.apiUrl+'?kipValue1=KPIDA0ACBBS&kipValue2=KPIDA0ACBBE'+'&access_token='+localStorage.getItem('access_token'),function (res) { | ||
142 | + const data = res; | ||
143 | + if(data && data.map){ | ||
144 | + let reportableToday=data.map.rightNumber; | ||
145 | + proxy.declaredToday=data.map.leftNumber; | ||
146 | + proxy.reportableToday=proxy.numberFilter(reportableToday,-1); | ||
147 | + } | ||
148 | + }) | ||
149 | + | ||
150 | + } | ||
138 | const eleWidthNum=(num,maxNum)=>{ | 151 | const eleWidthNum=(num,maxNum)=>{ |
139 | let widthNum=Math.ceil((num*150)/maxNum) | 152 | let widthNum=Math.ceil((num*150)/maxNum) |
140 | let widthData=0; | 153 | let widthData=0; |
@@ -170,7 +183,12 @@ export default { | @@ -170,7 +183,12 @@ export default { | ||
170 | 183 | ||
171 | return{ | 184 | return{ |
172 | numberFilter, | 185 | numberFilter, |
173 | - eleWidthNum | 186 | + eleWidthNum, |
187 | + getDeclareData, | ||
188 | + startInterval | ||
174 | } | 189 | } |
175 | - } | 190 | + }, |
191 | + unmounted () { | ||
192 | + clearInterval(this.timer) | ||
193 | + }, | ||
176 | } | 194 | } |
-
Please register or login to post a comment