jc
fanluyan 1 year ago
parent ed45fe4e3e
commit ba6492eb52

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

@ -8,10 +8,22 @@ export function getICEdyTreeList(data) {
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({ return request({
url: "/xymanager/weather/latest", url: "/xymanager/weather/list",
method: "get", method: "get",
params: data, params: data,
headers: { headers: {
@ -19,11 +31,22 @@ export function weatherLastJoggle(data) {
}, },
}); });
} }
//查询附带覆冰拉力
//获取数据接口 export function LeadPullJoggle(data) {
export function getDataListJoggle(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({ return request({
url: "/xapi/query.php", url: "/xymanager/leadpulls/list",
method: "get", method: "get",
params: data, params: data,
headers: { headers: {

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

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

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

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

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

Loading…
Cancel
Save