代码提交

This commit is contained in:
lixiaobang 2022-11-16 09:49:06 +08:00
parent c81a3cbcc6
commit 05e275d857
4 changed files with 31 additions and 10 deletions

View File

@ -31,6 +31,7 @@
</template> </template>
<script> <script>
import MinxinItem from "./mixins" import MinxinItem from "./mixins"
import axios from 'axios'
export default { export default {
name: 'home', name: 'home',
mixins:[MinxinItem], mixins:[MinxinItem],
@ -42,12 +43,21 @@ export default {
{day:'今天',temperature:'27℃-19℃',pic:require('./assets/images/sun.png')}, {day:'今天',temperature:'27℃-19℃',pic:require('./assets/images/sun.png')},
{day:'12月01日',temperature:'27℃-19℃',pic:require('./assets/images/union.png')}, {day:'12月01日',temperature:'27℃-19℃',pic:require('./assets/images/union.png')},
{day:'12月02日',temperature:'27℃-19℃',pic:require('./assets/images/windy.png')} {day:'12月02日',temperature:'27℃-19℃',pic:require('./assets/images/windy.png')}
] ],
} }
}, },
mounted(){ mounted(){
// this.handleWather()
}, },
methods:{ methods:{
//
handleWather(){
axios({url:'https://restapi.amap.com/v3/weather/weatherInfo?key=bc2b906032fdd8a63cbd0790d656b1d7&city=320903',methods:''}).then(res=>{
this.weatherArr[0] = res.data.lives[0]
console.log(res.data,'asdsads');
})
},
handleChange(index){ handleChange(index){
let that = this; let that = this;
this.routerActive = index this.routerActive = index

View File

@ -4,6 +4,9 @@ if (process.env.NODE_ENV === 'development') {
} else if (process.env.NODE_ENV === 'production') { } else if (process.env.NODE_ENV === 'production') {
axios.defaults.baseURL = '/api' axios.defaults.baseURL = '/api'
} }
//设置请求头参数 common 为设置所有的接口 post为设置post请求的接口
// axios.defaults.headers.common['Authorization'] = `Bearer ${localStorage.getItem('access_token')}`;
// 电力概况 // 电力概况
export const getCompanyInfo = (params) => { export const getCompanyInfo = (params) => {
return axios.get('/Handler/Company.ashx', { return axios.get('/Handler/Company.ashx', {

View File

@ -358,6 +358,7 @@ export default {
}else if (tab.index == 1) { }else if (tab.index == 1) {
this.activeName = 'second' this.activeName = 'second'
getDevice({ getDevice({
action : 'querydevice', action : 'querydevice',
device_name : that.ringMainUnit device_name : that.ringMainUnit

View File

@ -310,7 +310,7 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div style="height:20px;width:20px;position: fixed"> <!-- <div style="height:20px;width:20px" class="icon">
<img src="../assets/images/btnFangDa.png"/> <img src="../assets/images/btnFangDa.png"/>
</div> --> </div> -->
<div class="componentShow" v-if="modelOthers"> <div class="componentShow" v-if="modelOthers">
@ -386,15 +386,15 @@ export default {
topContent:[ topContent:[
{ {
name:'配变数量', name:'配变数量',
count:'6,573' count:''
}, },
{ {
name:'重复停运台次', name:'重复停运台次',
count:'6,573' count:''
}, },
{ {
name:'配变重复停运率', name:'配变重复停运率',
count:'0.22%' count:''
}, },
], ],
device:'' device:''
@ -459,16 +459,17 @@ export default {
let dataPbty = []; let dataPbty = [];
dataPbty = res.data.data dataPbty = res.data.data
this.detailedFive(dataPbty); this.detailedFive(dataPbty);
console.log(dataPbty,'配变停运');
let dataPb = []; let dataPb = [];
let dataCf = []; let dataCf = [];
let dataCfl = [];
for (let i = 0; i < dataPbty.length; i++) { for (let i = 0; i < dataPbty.length; i++) {
dataPb.push(dataPbty[i].pbsl); dataPb.push(dataPbty[i].pbsl);
dataCf.push(dataPbty[i].cftytc); dataCf.push(dataPbty[i].cftytc);
dataCfl.push(dataPbty[i].pbcftyl)
} }
this.topContent[0].count = dataPb.reduce((x, y) => x + y) this.topContent[0].count = dataPb.reduce((x, y) => x + y)
this.topContent[1].count = dataCf.reduce((x, y) => x + y) this.topContent[1].count = dataCf.reduce((x, y) => x + y)
console.log(dataCf.reduce((x, y) => x + y),'总数'); this.topContent[2].count = dataCfl.reduce((x, y) => x + y) + '%'
}) })
this.handleDate(0); this.handleDate(0);
let that = this; let that = this;
@ -553,7 +554,8 @@ export default {
type: "value", type: "value",
data:[0,2,4,6,8,10], data:[0,2,4,6,8,10],
nameTextStyle:{ nameTextStyle:{
color:'#ffffff' color:'#ffffff',
// padding:[25,0,0,0]
}, },
axisLabel:{ axisLabel:{
color:'#ffffff' color:'#ffffff'
@ -1994,6 +1996,11 @@ export default {
line-height: 26px; line-height: 26px;
} }
} }
.icon{
position: absolute;
bottom: 0;
right: 0;
}
</style> </style>
<style lang="less"> <style lang="less">
.el-select{ .el-select{