Compare commits
3 Commits
0f9122a80b
...
df68891c60
Author | SHA1 | Date |
---|---|---|
|
df68891c60 | |
|
72b90a584f | |
|
4d3c0c59fb |
|
@ -32,7 +32,7 @@
|
|||
<script>
|
||||
import MinxinItem from "./mixins"
|
||||
import axios from 'axios'
|
||||
import {getWather} from "./api/index.js";
|
||||
import {getWather,Weather} from "./api/index.js";
|
||||
export default {
|
||||
name: 'home',
|
||||
mixins:[MinxinItem],
|
||||
|
@ -60,9 +60,8 @@ export default {
|
|||
handleWather(){
|
||||
// axios({url:"http://www.jcznedu.com:5000/weather/prediction/?city=盐都&&limit=3",methods:'GET'}).then(res=>{
|
||||
// })
|
||||
getWather({
|
||||
city:'盐都',
|
||||
limit:'3'
|
||||
Weather({
|
||||
|
||||
}).then((res)=>{
|
||||
this.weatherArr = res.data.data.daly;
|
||||
this.weatherArr[0].date = '今天';
|
||||
|
|
|
@ -55,9 +55,15 @@ export const getPbtyqk = (params) => {
|
|||
params
|
||||
})
|
||||
};
|
||||
// //查询天气
|
||||
// export const getWather = (params) => {
|
||||
// return axios.get('aps/weather/prediction/', {
|
||||
// params
|
||||
// })
|
||||
// };
|
||||
//查询天气
|
||||
export const getWather = (params) => {
|
||||
return axios.get('aps/weather/prediction/', {
|
||||
export const Weather = (params) => {
|
||||
return axios.get('api/Handler/Weather.ashx', {
|
||||
params
|
||||
})
|
||||
};
|
|
@ -452,25 +452,32 @@ export default {
|
|||
dataGdzl = res.data.data
|
||||
this.detailedTwo(dataGdzl);
|
||||
})
|
||||
//配变停运
|
||||
getPbtyqk({
|
||||
action:"week"
|
||||
}).then((res)=>{
|
||||
let dataPbty = [];
|
||||
dataPbty = res.data.data
|
||||
this.detailedFive(dataPbty);
|
||||
let dataPb = [];
|
||||
let dataCf = [];
|
||||
let dataCfl = [];
|
||||
for (let i = 0; i < dataPbty.length; i++) {
|
||||
dataPb.push(dataPbty[i].pbsl);
|
||||
dataCf.push(dataPbty[i].cftytc);
|
||||
dataCfl.push(dataPbty[i].pbcftyl)
|
||||
}
|
||||
this.topContent[0].count = dataPb.reduce((x, y) => x + y)
|
||||
this.topContent[1].count = dataCf.reduce((x, y) => x + y)
|
||||
this.topContent[2].count = dataCfl.reduce((x, y) => x + y) + '%'
|
||||
})
|
||||
// //配变停运
|
||||
// getPbtyqk({
|
||||
// action:"week"
|
||||
// }).then((res)=>{
|
||||
// let dataPbty = [];
|
||||
// dataPbty = res.data.data
|
||||
// console.log(dataPbty,'dataPbty');
|
||||
// this.detailedFive(dataPbty);
|
||||
// let dataPb = [];
|
||||
// let dataCf = [];
|
||||
// let dataCfl = [];
|
||||
// for (let i = 0; i < dataPbty.length; i++) {
|
||||
// dataPb.push(dataPbty[i].pbsl);
|
||||
// dataCf.push(dataPbty[i].cftytc);
|
||||
// dataCfl.push(dataPbty[i].pbcftyl)
|
||||
// }
|
||||
// this.topContent[0].count = dataPb.reduce((x, y) => x + y)
|
||||
// this.topContent[1].count = dataCf.reduce((x, y) => x + y)
|
||||
// let pbCount = (this.topContent[1].count/this.topContent[0].count)*100
|
||||
// let pbCountString = pbCount.toString()
|
||||
// if (pbCountString.indexOf(".") != -1) {
|
||||
// this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
|
||||
// }else{
|
||||
// this.topContent[2].count = pbCountString +'%'
|
||||
// }
|
||||
// })
|
||||
this.handleDate(0);
|
||||
let that = this;
|
||||
window.addEventListener('message', function (e) {
|
||||
|
@ -1462,10 +1469,10 @@ export default {
|
|||
},
|
||||
handleDate(index){
|
||||
this.currentIndex = index
|
||||
if (index == 0) {
|
||||
// if (index == 0) {
|
||||
//周配变停运
|
||||
getPbtyqk({
|
||||
action:"week"
|
||||
action: index==0?"week":'month'
|
||||
}).then((res)=>{
|
||||
let dataPbty = [];
|
||||
dataPbty = res.data.data
|
||||
|
@ -1478,25 +1485,39 @@ export default {
|
|||
}
|
||||
this.topContent[0].count = dataPb.reduce((x, y) => x + y)
|
||||
this.topContent[1].count = dataCf.reduce((x, y) => x + y)
|
||||
})
|
||||
}else if (index == 1) {
|
||||
//月配变停运
|
||||
getPbtyqk({
|
||||
action:"month"
|
||||
}).then((res)=>{
|
||||
let dataPbty = [];
|
||||
dataPbty = res.data.data
|
||||
this.detailedFive(dataPbty);
|
||||
let dataPb = [];
|
||||
let dataCf = [];
|
||||
for (let i = 0; i < dataPbty.length; i++) {
|
||||
dataPb.push(dataPbty[i].pbsl);
|
||||
dataCf.push(dataPbty[i].cftytc);
|
||||
let pbCount = (this.topContent[1].count/this.topContent[0].count)*100
|
||||
let pbCountString = pbCount.toString()
|
||||
if (pbCountString.indexOf(".") != -1) {
|
||||
this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
|
||||
}else{
|
||||
this.topContent[2].count = pbCountString +'%'
|
||||
}
|
||||
this.topContent[0].count = dataPb.reduce((x, y) => x + y)
|
||||
this.topContent[1].count = dataCf.reduce((x, y) => x + y)
|
||||
})
|
||||
}
|
||||
// }else if (index == 1) {
|
||||
// //月配变停运
|
||||
// getPbtyqk({
|
||||
// action:"month"
|
||||
// }).then((res)=>{
|
||||
// let dataPbty = [];
|
||||
// dataPbty = res.data.data
|
||||
// this.detailedFive(dataPbty);
|
||||
// let dataPb = [];
|
||||
// let dataCf = [];
|
||||
// for (let i = 0; i < dataPbty.length; i++) {
|
||||
// dataPb.push(dataPbty[i].pbsl);
|
||||
// dataCf.push(dataPbty[i].cftytc);
|
||||
// }
|
||||
// this.topContent[0].count = dataPb.reduce((x, y) => x + y)
|
||||
// this.topContent[1].count = dataCf.reduce((x, y) => x + y)
|
||||
// let pbCount = (this.topContent[1].count/this.topContent[0].count)*100
|
||||
// let pbCountString = pbCount.toString()
|
||||
// if (pbCountString.indexOf(".") != -1) {
|
||||
// this.topContent[2].count = pbCountString.substring(0,pbCountString.indexOf(".")+3) + '%'
|
||||
// }else{
|
||||
// this.topContent[2].count = pbCountString +'%'
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
},
|
||||
addColor(index){
|
||||
if(this.currentIndex == index) {
|
||||
|
|
|
@ -23,15 +23,15 @@ module.exports = {
|
|||
'^/api':'',
|
||||
}
|
||||
},
|
||||
'/aps': { //代理的名字
|
||||
target:'http://www.jcznedu.com:5000/',
|
||||
// target: 'http://172.16.1.254:3111/',
|
||||
ws: true,
|
||||
changeOrigin: true,
|
||||
pathRewrite:{
|
||||
'^/aps':'',
|
||||
}
|
||||
}
|
||||
// '/aps': { //代理的名字
|
||||
// target:'http://www.jcznedu.com:5000/',
|
||||
// // target: 'http://172.16.1.254:3111/',
|
||||
// ws: true,
|
||||
// changeOrigin: true,
|
||||
// pathRewrite:{
|
||||
// '^/aps':'',
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue