jc
fanluyan 1 year ago
parent ed45fe4e3e
commit ba6492eb52

@ -170,6 +170,7 @@ export default {
this.$nextTick(() => {
this.activeIndex = this.$route.path; //
console.log(this.activeIndex);
localStorage.setItem("menuActive", this.activeIndex);
});
},
@ -185,6 +186,7 @@ export default {
};
const assetManagementSubs = []; //
const systemManagementSubs = []; //
const weatherManagementSubs = []; //
const newArray = [];
//
@ -226,12 +228,26 @@ export default {
index: "/" + index,
title: processedDesc,
});
} else if (["weather", "icing"].includes(index)) {
//
weatherManagementSubs.push({
index: "/" + index,
title: processedDesc,
});
} else {
//
newArray.push({ icon, index: "/" + index, title: processedDesc });
}
});
//
if (weatherManagementSubs.length > 0) {
newArray.push({
icon: "iconfont icon-fubing",
index: "weatherIce",
title: "气象覆冰",
subs: weatherManagementSubs,
});
}
//
if (assetManagementSubs.length > 0) {
newArray.push({

@ -8,10 +8,22 @@ export function getICEdyTreeList(data) {
data,
});
}
//气象相关的接口
export function weatherLastJoggle(data) {
//查询附带天气
export function weatherJoggle(data) {
return request({
url: "/xymanager/terminal/listWithWeather",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查询天气列表
export function weatherListJoggle(data) {
return request({
url: "/xymanager/weather/latest",
url: "/xymanager/weather/list",
method: "get",
params: data,
headers: {
@ -19,11 +31,22 @@ export function weatherLastJoggle(data) {
},
});
}
//查询附带覆冰拉力
//获取数据接口
export function getDataListJoggle(data) {
export function LeadPullJoggle(data) {
return request({
url: "/xymanager/terminal/listWithLeadPull",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//查询覆冰拉力列表
export function leadpullsListJoggle(data) {
return request({
url: "/xapi/query.php",
url: "/xymanager/leadpulls/list",
method: "get",
params: data,
headers: {

@ -97,7 +97,7 @@ export default {
children: "list",
label: "name",
},
currentData: {}, //
icecurrentData: {}, //
currentNodekey: "", //,
role: "",
};
@ -108,8 +108,8 @@ export default {
},
},
created() {
// this.getLineTreeList(); //
// this.companyVal = this.companyOptions[0].value;
this.getLineTreeList(); //
//this.companyVal = this.companyOptions[0].value;
},
methods: {
handleClick(val) {
@ -136,16 +136,29 @@ export default {
getLineTreeList() {
this.role = localStorage.getItem("role");
console.log(this.role);
const menuName = localStorage.getItem("menuActive");
console.log(menuName);
this.treeLoading = true;
let devtypeList;
//
if (menuName == "/weather") {
devtypeList = [2];
}
//
if (menuName == "/icing") {
devtypeList = [3];
}
console.log(devtypeList);
getICEdyTreeList({
type: -1,
devtype: [2, 3],
devtype: devtypeList,
})
.then((res) => {
this.lineTreeData = res.data.list;
this.treeLoading = false;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
this.icecurrentData = JSON.parse(
localStorage.getItem("icecurrentData")
);
this.lineTreeData.forEach((node) => {
if (node.list) {
node.list.forEach((child) => {
@ -164,15 +177,15 @@ export default {
if (this.lineTreeData[0].list[0].list.length > 0) {
}
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
this.icecurrentData !== null &&
Object.keys(this.icecurrentData).length !== 0
) {
this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData);
this.currentNodekey = this.icecurrentData.id;
this.handleNodeClick(this.icecurrentData);
} else {
this.currentData = this.lineTreeData[0]; //
this.icecurrentData = this.lineTreeData[0]; //
this.currentNodekey = this.lineTreeData[0].id; //
this.handleNodeClick(this.currentData);
this.handleNodeClick(this.icecurrentData);
}
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
@ -184,8 +197,8 @@ export default {
},
//treenode
handleNodeClick(data) {
this.currentData = data;
this.$parent.getCurrentData(this.currentData);
this.icecurrentData = data;
this.$parent.getCurrentData(this.icecurrentData);
},
},
};

@ -199,7 +199,7 @@
</template>
<script>
import leftTree from "../components/leftTree.vue";
import { getDataListJoggle, funccodeJoggle } from "@/utils/api/iceApi";
import { LeadPullJoggle, leadpullsListJoggle } from "@/utils/api/iceApi";
export default {
name: "icing",
components: {
@ -258,47 +258,67 @@ export default {
getCurrentData(data) {
console.log("执行父组件", data);
this.paramsData = data;
let pullParams;
console.log(data);
if (data.dyValue) {
console.log("电压-公司");
this.qt = "all";
this.id = data.id;
this.getIcingData(data);
pullParams = {
dyId: data.id,
pageNum: this.page,
pageSize: this.pageSize,
};
this.getIcingData(pullParams);
this.termalFlag = false;
} else if (data.bsManufacturer) {
console.log("线路-电压");
this.qt = "line";
this.id = data.id;
this.getIcingData(data);
pullParams = {
lineId: data.id,
pageNum: this.page,
pageSize: this.pageSize,
};
this.getIcingData(pullParams);
this.termalFlag = false;
} else {
console.log("装置-杆塔");
this.qt = "tower";
this.id = data.towerid;
this.termId = data.id;
this.getIcingData(data);
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
pullParams = {
lineId: data.lineId,
termId: data.id,
towerId: data.towerId,
start: sTime,
end: eTime,
pageNum: data.childpage,
pageSize: data.childpageSize,
};
this.getIcingListData(pullParams);
this.termalFlag = true;
}
},
//
getIcingData(data) {
console.log(data, this.qt);
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
console.log(data);
this.loading = true;
getDataListJoggle({
act: "ice_weight",
qt: this.qt,
id: this.id,
bt: sTime,
et: eTime,
p: this.page,
ps: this.pageSize,
})
LeadPullJoggle(data)
.then((res) => {
console.log(res);
this.tableData = res.data;
this.total = Number(res.page.totalRecords);
this.tableData = res.data.list;
this.total = res.data.total;
this.loading = false;
this.echartsShow = false;
})
.catch((err) => {
console.log(err); //
});
},
getIcingListData(data) {
console.log(data);
this.loading = true;
leadpullsListJoggle(data)
.then((res) => {
console.log(res);
this.tableData = res.data.list;
this.total = res.data.total;
this.loading = false;
this.echartsShow = false;
})
@ -306,7 +326,6 @@ export default {
console.log(err); //
});
},
lookLineCharts() {
//
this.echartsShow = true;
@ -317,18 +336,18 @@ export default {
},
//
getchartsData(data) {
console.log(data, this.qt);
console.log(data);
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
this.loading = true;
getDataListJoggle({
act: "ice_weight",
qt: this.qt,
id: this.id,
bt: sTime,
et: eTime,
p: 1,
ps: 10000000,
leadpullsListJoggle({
lineId: data.lineId,
termId: data.id,
towerId: data.towerId,
start: sTime,
end: eTime,
pageNum: 1,
pageSize: 10000000,
})
.then((res) => {
console.log(res);

@ -17,9 +17,9 @@
<el-table-column prop="updateTime" label="时间">
<template slot-scope="scope">
<span v-if="scope.row.updateTime">
<span v-if="scope.row.lastWeathers.updateTime !== null">
{{
$moment(scope.row.updateTime * 1000).format(
$moment(scope.row.lastWeathers.updateTime * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}</span
@ -27,57 +27,60 @@
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="temperature" label="温度(℃)">
<el-table-column label="温度(℃)">
<template slot-scope="scope">
<span v-if="scope.row.temperature">{{
scope.row.temperature
<span v-if="scope.row.lastWeathers.airTemperature !== null">{{
scope.row.lastWeathers.airTemperature
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="humidity" label="湿度(%RH)">
<template slot-scope="scope">
<span v-if="scope.row.humidity">{{
scope.row.humidity
<span v-if="scope.row.lastWeathers.humidity !== null">{{
scope.row.lastWeathers.humidity
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="windSpeed" label="瞬时风速(m/s)">
<el-table-column prop="maxWindSpeed" label="最大风速(m/s)">
<template slot-scope="scope">
<span v-if="scope.row.windSpeed">{{
scope.row.windSpeed
<span v-if="scope.row.lastWeathers.maxWindSpeed !== null">{{
scope.row.lastWeathers.maxWindSpeed
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="windDirection" label="瞬时风向(°)">
<template slot-scope="scope">
<span v-if="scope.row.windDirection">{{
scope.row.windDirection
<span v-if="scope.row.lastWeathers.windDirection !== null">{{
scope.row.lastWeathers.windDirection
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="rain" label="雨量(mm/hour)">
<el-table-column prop="precipitation" label="雨量(mm/hour)">
<template slot-scope="scope">
<span v-if="scope.row.rain">{{ scope.row.rain }}</span>
<span v-if="scope.row.lastWeathers.precipitation !== null">{{
scope.row.lastWeathers.precipitation
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="airPressure" label="气压(hPa(百帕))">
<template slot-scope="scope">
<span v-if="scope.row.airPressure">{{
scope.row.airPressure
<span v-if="scope.row.lastWeathers.airPressure !== null">{{
scope.row.lastWeathers.airPressure
}}</span>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="radiationIntensity" label="日照(W/m2)">
<template slot-scope="scope">
<span v-if="scope.row.radiationIntensity">{{
scope.row.radiationIntensity
}}</span>
<span
v-if="scope.row.lastWeathers.radiationIntensity !== null"
>{{ scope.row.lastWeathers.radiationIntensity }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
@ -86,7 +89,7 @@
<el-button
type="text"
@click="moreDataClick(scope.row)"
v-if="scope.row.updateTime"
v-if="scope.row.lastWeathers.updateTime"
>更多历史数据</el-button
>
<span v-else> </span>
@ -183,7 +186,7 @@
</template>
</el-table-column>
<el-table-column
prop="temperature"
prop="airTemperature"
label="温度(℃)"
></el-table-column>
<el-table-column
@ -191,7 +194,7 @@
label="湿度(%RH)"
></el-table-column>
<el-table-column
prop="windSpeed"
prop="maxWindSpeed"
label="瞬时风速(m/s)"
></el-table-column>
<el-table-column
@ -211,23 +214,23 @@
label="日照(W/m2)"
></el-table-column>
<el-table-column
prop="avgWindSpeed1Min"
prop="avgWindDir1min"
label="1分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="avgWindDir1Min"
prop="avgWindSpeed1min"
label="1分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="avgWindSpeed10Min"
prop="avgWindSpeed10min"
label="10分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="avgWindDir10Min"
prop="avgWindDir10min"
label="10分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="maxSpeed10Min"
prop="maxWindSpeed"
label="10分钟最大风速(m/s)"
></el-table-column>
</el-table>
@ -251,7 +254,7 @@
</template>
<script>
import leftTree from "../components/leftTree";
import { getDataListJoggle, weatherLastJoggle } from "@/utils/api/iceApi";
import { weatherJoggle, weatherListJoggle } from "@/utils/api/iceApi";
export default {
name: "weather",
components: {
@ -267,8 +270,7 @@ export default {
page: 1, //
pageSize: 20, //
total: 0, //
qt: "",
id: "",
paramsData: "",
childpage: 1, //
childpageSize: 20, //
@ -307,38 +309,44 @@ export default {
getCurrentData(data) {
console.log("执行父组件", data);
this.paramsData = data;
let weatherParams;
console.log(data);
if (data.dyValue) {
console.log("电压-公司");
this.qt = "all";
this.id = data.id;
this.getWeatherData(data);
weatherParams = {
dyId: data.id,
pageNum: this.page,
pageSize: this.pageSize,
};
this.getWeatherData(weatherParams);
} else if (data.bsManufacturer) {
console.log("线路-电压");
this.qt = "line";
this.id = data.id;
this.getWeatherData(data);
weatherParams = {
lineId: data.id,
pageNum: this.page,
pageSize: this.pageSize,
};
this.getWeatherData(weatherParams);
} else {
console.log("装置-杆塔");
this.qt = "tower";
this.id = data.towerid;
this.getWeatherData(data);
weatherParams = {
pageNum: this.page,
pageSize: this.pageSize,
towerId: data.towerid,
};
this.getWeatherData(weatherParams);
}
//this.getAllData(data);
},
getWeatherData(data) {
console.log(data);
weatherLastJoggle({
dyId: 8,
lineId: data.lineid,
pageNum: this.page,
pageSize: this.pageSize,
towerId: data.towerid,
})
this.childFlag = false;
this.loading = true;
weatherJoggle(data)
.then((res) => {
console.log(res);
this.tableData = res.data;
this.total = Number(res.page.totalRecords);
this.tableData = res.data.list;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {
@ -346,28 +354,6 @@ export default {
});
},
// getWeatherData(data) {
// this.childFlag = false;
// console.log(data, this.qt);
// this.loading = true;
// getDataListJoggle({
// act: "meteo",
// qt: this.qt,
// id: this.id,
// p: this.page,
// ps: this.pageSize,
// latest: 1,
// })
// .then((res) => {
// console.log(res);
// this.tableData = res.data;
// this.total = Number(res.page.totalRecords);
// this.loading = false;
// })
// .catch((err) => {
// console.log(err); //
// });
// },
//
handleCurrentChange(val) {
this.page = val;
@ -394,8 +380,7 @@ export default {
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.$set(this.formdata, "endtime", currentDate.getTime());
this.qt = "terminal";
this.id = row.termId;
this.childParma = row;
this.getchildWeatherData(row);
},
@ -407,21 +392,22 @@ export default {
getchildWeatherData(row) {
this.loading = true;
this.childMsg = row;
console.log("我是子数据", row);
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
getDataListJoggle({
act: "meteo",
qt: this.qt,
id: this.id,
bt: sTime,
et: eTime,
p: this.childpage,
ps: this.childpageSize,
weatherListJoggle({
lineId: row.lineId,
termId: row.id,
towerId: row.towerId,
start: sTime,
end: eTime,
pageNum: this.childpage,
pageSize: this.childpageSize,
})
.then((res) => {
console.log(res);
this.childTableDate = res.data;
this.childtotal = Number(res.page.totalRecords);
this.childTableDate = res.data.list;
//this.childtotal = Number(res.page.totalRecords);
this.loading = false;
//线
this.getAllData(row);
@ -433,18 +419,18 @@ export default {
getAllData(row) {
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
getDataListJoggle({
act: "meteo",
qt: this.qt,
id: this.id,
bt: sTime,
et: eTime,
p: this.childpage,
ps: 1000,
weatherListJoggle({
lineId: row.lineId,
termId: row.id,
towerId: row.towerId,
start: sTime,
end: eTime,
pageNum: this.childpage,
pageSize: 1000,
})
.then((res) => {
console.log(res);
this.echartsData = res.data;
this.echartsData = res.data.list;
//线
this.getEchart4(this.echartsData);
this.getEchart5(this.echartsData);
@ -478,7 +464,7 @@ export default {
xData = wd.map((item) =>
this.$moment(item.updateTime * 1000).format("HH:mm:ss")
);
yData = wd.map((item) => item.temperature);
yData = wd.map((item) => item.airTemperature);
let option = {
tooltip: {
trigger: "axis",

@ -877,6 +877,7 @@ export default {
handleclose() {
this.isShow = false;
this.sureloading = false;
this.deviceTimeLoading = false;
this.activeName = "1"; //
this.selectChannel = ""; //
this.channelList = []; //

@ -22,12 +22,12 @@ module.exports = defineConfig({
"/api": {
//表示拦截以/api开头的请求路径
//target: "http://180.166.218.222:40080", //dell
//target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
//target: "http://192.168.50.7:8093", //liu 本机ip 需要去掉/Api
target: "http://192.168.111.211:80", //东视
//target: "http://192.168.111.211:80", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的
},
},
},

Loading…
Cancel
Save