代码提交

This commit is contained in:
lixiaobang 2022-11-24 17:05:57 +08:00
parent 05e275d857
commit 1b85112ddd
26 changed files with 101 additions and 27 deletions

View File

@ -9,16 +9,16 @@
</div>
<div class="right">
<div class="time">
<span>11月30日 周一</span>
<span>{{this.$moment().format("MM月DD日")}} {{week}}</span>
<span style="font-size:24px;margin-top: 3px;">{{this.$moment().format("YYYY-MM-DD")}}</span>
</div>
<div class="weather" v-for="(item,index) in weatherArr" :key="index">
<div class="pic">
<img :src="item.pic" alt="">
<img :src="item.pic" alt="" style="height:100%;width:100%">
</div>
<div class="date">
<span>{{item.day}}</span>
<span style="font-size:24px;margin-top: 3px;">{{item.temperature}}</span>
<span>{{item.date}}</span>
<span style="font-size:24px;margin-top: 3px;">{{item.high}}-{{item.low}}</span>
</div>
</div>
</div>
@ -32,6 +32,7 @@
<script>
import MinxinItem from "./mixins"
import axios from 'axios'
import {getWather} from "./api/index.js";
export default {
name: 'home',
mixins:[MinxinItem],
@ -44,20 +45,77 @@ export default {
{day:'12月01日',temperature:'27℃-19℃',pic:require('./assets/images/union.png')},
{day:'12月02日',temperature:'27℃-19℃',pic:require('./assets/images/windy.png')}
],
weekList:['周日','周一','周二','周三','周四','周五','周六'],
week:'',
}
},
mounted(){
// this.handleWather()
this.handleWather()
let week = new Date(this.$moment().format("YYYY-MM-DD")).getDay()
this.week = this.weekList[week]
},
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');
// axios({url:"http://www.jcznedu.com:5000/weather/prediction/?city=&&limit=3",methods:'GET'}).then(res=>{
// })
getWather({
city:'盐都',
limit:'3'
}).then((res)=>{
this.weatherArr = res.data.data.daly;
this.weatherArr[0].date = '今天';
for (let i = 0; i < this.weatherArr.length; i++) {
this.Onweather(this.weatherArr[i].weather,i)
}
})
},
//
Onweather(name,index){
switch (name) {
case "多云":
return this.weatherArr[index].pic = require('./assets/weather/Cloudy .png');
case "阴":
return this.weatherArr[index].pic = require('./assets/weather/Cloudy .png')
case "暴雨":
return this.weatherArr[index].pic = require('./assets/weather/rainstorm.png')
case "冰雹":
return this.weatherArr[index].pic = require('./assets/weather/hail.png')
case "大风":
return this.weatherArr[index].pic = require('./assets/weather/gale.png')
case "大雪":
return this.weatherArr[index].pic = require('./assets/weather/bigsnow.png')
case "大雨":
return this.weatherArr[index].pic = require('./assets/weather/bigrain.png')
case "雷电":
return this.weatherArr[index].pic = require('./assets/weather/thunder.png')
case "雷阵雨":
return this.weatherArr[index].pic = require('./assets/weather/shower.png')
case "沙尘暴":
return this.weatherArr[index].pic = require('./assets/weather/sand.png')
case "晴":
return this.weatherArr[index].pic = require('./assets/weather/sun.png')
case "雾霾":
return this.weatherArr[index].pic = require('./assets/weather/smog.png')
case "小雪":
return this.weatherArr[index].pic = require('./assets/weather/snow.png')
case "小雨":
return this.weatherArr[index].pic = require('./assets/weather/rain.png')
case "雪":
return this.weatherArr[index].pic = require('./assets/weather/rainlitter.png')
case "多云":
return this.weatherArr[index].pic = require('./assets/weather/night.png')
case "雨夹雪":
return this.weatherArr[index].pic = require('./assets/weather/rainsnow.png')
case "月亮":
return this.weatherArr[index].pic = require('./assets/weather/moon.png')
case "中雪":
return this.weatherArr[index].pic = require('./assets/weather/mieddlesnow.png')
case "中雨":
return this.weatherArr[index].pic = require('./assets/weather/middlerain.png')
}
},
handleChange(index){
let that = this;
this.routerActive = index

View File

@ -1,57 +1,63 @@
import axios from 'axios'
if (process.env.NODE_ENV === 'development') {
axios.defaults.baseURL = '/api'
} else if (process.env.NODE_ENV === 'production') {
axios.defaults.baseURL = '/api'
}
// if (process.env.NODE_ENV === 'development') {
// axios.defaults.baseURL = '/api'
// } else if (process.env.NODE_ENV === 'production') {
// axios.defaults.baseURL = '/api'
// }
//设置请求头参数 common 为设置所有的接口 post为设置post请求的接口
// axios.defaults.headers.common['Authorization'] = `Bearer ${localStorage.getItem('access_token')}`;
// 电力概况
export const getCompanyInfo = (params) => {
return axios.get('/Handler/Company.ashx', {
return axios.get('api/Handler/Company.ashx', {
params
})
};
// 路线查询 下拉
export const getLine = (params) => {
return axios.get('/Handler/Line.ashx', {
return axios.get('api/Handler/Line.ashx', {
params
})
};
// 查询设备素材
export const getDevice = (params) => {
return axios.get('/Handler/Device.ashx', {
return axios.get('api/Handler/Device.ashx', {
params
})
};
//班组故障查询
export const getBanzugz = (params) => {
return axios.get('/Handler/Banzugz.ashx', {
return axios.get('api/Handler/Banzugz.ashx', {
params
})
};
//查询工单统计
export const getGdtj = (params) => {
return axios.get('/Handler/gdtj.ashx', {
return axios.get('api/Handler/gdtj.ashx', {
params
})
};
//查询单位本周故障
export const getDwbzgz = (params) => {
return axios.get('/Handler/Dwbzgz.ashx', {
return axios.get('api/Handler/Dwbzgz.ashx', {
params
})
};
//查询供电所供电质量情况
export const getGdsgdzl = (params) => {
return axios.get('/Handler/Gdsgdzl.ashx', {
return axios.get('api/Handler/Gdsgdzl.ashx', {
params
})
};
//查询配变停运情况
export const getPbtyqk = (params) => {
return axios.get('/Handler/Pbtyqk.ashx', {
return axios.get('api/Handler/Pbtyqk.ashx', {
params
})
};
//查询天气
export const getWather = (params) => {
return axios.get('aps/weather/prediction/', {
params
})
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/weather/gale.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/assets/weather/hail.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/weather/moon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/weather/rain.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/weather/sand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/weather/smog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
src/assets/weather/snow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/assets/weather/sun.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -24,7 +24,7 @@
<div class="informationContent">环网柜名称&nbsp;&nbsp;&nbsp;&nbsp;{{ringMainUnit}}</div>
<div class="informationContent">环网柜编号&nbsp;&nbsp;&nbsp;&nbsp;{{deviceInformation.deivce_bianhao}}</div>
<div class="informationContent">IP地址&nbsp;&nbsp;&nbsp;&nbsp;{{deviceInformation.deivce_ip}}</div>
<div class="informationContent">总间隔&nbsp;&nbsp;&nbsp;&nbsp;XXXXXXXX</div>
<div class="informationContent">总间隔&nbsp;&nbsp;&nbsp;&nbsp;{{deviceInformation.zjg}}</div>
</div>
</div>
</div>

View File

@ -1819,8 +1819,9 @@ export default {
.topContent{
width: 30%;
display: flex;
justify-content: space-around;
align-items: center
justify-content: flex-start;
align-items: center;
white-space: nowrap;
}
}
}

View File

@ -1,6 +1,6 @@
<template>
<div class="thirtyFiveKV">
momomo
thirtyFiveKV
</div>
</template>

View File

@ -1,6 +1,6 @@
<template>
<div class="twentyKV">
momomo
twentyKV
</div>
</template>

View File

@ -15,13 +15,22 @@ module.exports = {
// port: 8989, // 开发服务器运行端口号
proxy: {
'/api': { //代理的名字
target:' http://111.229.30.246:3111/',
target:'http://111.229.30.246:3111/',
// target: 'http://172.16.1.254:3111/',
ws: true,
changeOrigin: true,
pathRewrite:{
'^/api':'',
}
},
'/aps': { //代理的名字
target:'http://www.jcznedu.com:5000/',
// target: 'http://172.16.1.254:3111/',
ws: true,
changeOrigin: true,
pathRewrite:{
'^/aps':'',
}
}
}
}