role1.0
fanluyan 1 year ago
parent a35c1912f2
commit 932f0e968a

@ -78,6 +78,22 @@ export default {
index: "/realTimeSearch",
title: "历史图片",
},
{
icon: "iconfont icon-fubing",
index: "/weatherIce",
title: "气象覆冰",
subs: [
{
index: "/weather",
title: "气象监测",
},
{
index: "/icing",
title: "覆冰监测",
},
],
},
{
icon: "el-icon-files",
index: "/property",
@ -287,6 +303,9 @@ export default {
}
.el-submenu__title {
padding: 0 10px;
.iconfont {
margin-right: 5px;
}
}
.el-dropdown-menu__item,
.el-menu-item,

@ -200,19 +200,24 @@ const routes = [
},
//气象检测
// {
// path: "/weather",
// component: () => import("../views/weather/index.vue"),
// name: "weather",
// meta: { title: "气象检测", icon: "", keepAlive: true },
// },
// //覆冰
// {
// path: "/icing",
// component: () => import("../views/icing/index.vue"),
// name: "icing",
// meta: { title: "覆冰", icon: "", keepAlive: true },
// },
{
path: "/weather",
component: () => import("../views/iceWeather/weather/index.vue"),
name: "weather",
meta: {
title: "气象检测",
icon: "",
keepAlive: true,
requiresAuth: true,
},
},
//覆冰
{
path: "/icing",
component: () => import("../views/iceWeather/icing/index.vue"),
name: "icing",
meta: { title: "覆冰", icon: "", keepAlive: true, requiresAuth: true },
},
],
},
{

@ -668,15 +668,12 @@ export function updateTermCamera(data) {
});
}
//郑州检测左侧树状结构接口
export function getzzdyTreeList(data) {
//郑州左侧树状结构接口
export function getICEdyTreeList(data) {
return request({
url: "/xymanager/getzzdyTreeList",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
method: "post",
data,
});
}
//删除图片

@ -1,5 +1,22 @@
<template>
<div class="leftTreeBox">
<div class="companyBox">
<span class="spanLabel"
><i class="el-icon-office-building"></i>公司</span
>
<el-select v-model="companyVal" placeholder="请选择公司">
<!-- <el-option label="捕鱼达人" value="budr"></el-option> -->
<el-option
v-for="item in companyOptions"
:key="item.value"
:label="item.label"
:value="item.value"
@click.native="handleClick(item.value)"
>
</el-option>
</el-select>
</div>
<el-divider></el-divider>
<div class="searchBar">
<el-input
placeholder="输入关键字进行过滤"
@ -10,11 +27,12 @@
</div>
<el-tree
ref="tree"
v-loading="treeLoading"
:data="lineTreeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultExpandedKeys"
highlight-current
:default-expanded-keys="[9]"
:expand-on-click-node="false"
:filter-node-method="filterNode"
:current-node-key="currentNodekey"
@ -23,7 +41,8 @@
<span class="custom-tree-node" slot-scope="{ node, data }">
<span v-if="node.level === 1">
<span class="iconfont icon-dianli" style="margin-right: 6px"></span>
<span>{{ node.label }} </span>
<!--<span>{{ node.label }} </span>-->
<span>捕鱼达人</span>
</span>
<span v-else-if="node.level === 2">
<span class="iconfont icon-dianlihangye" style="margin-right: 6px">
@ -57,10 +76,18 @@
</div>
</template>
<script>
import { getdyTreeListJoggle } from "@/utils/api/index";
import { getICEdyTreeList } from "@/utils/api/index";
export default {
data() {
return {
treeLoading: false,
companyVal: "", //
companyOptions: [
{
value: "bydr",
label: "捕鱼达人",
},
],
filterText: "", //
lineTreeData: [],
defaultExpandedKeys: [], //
@ -72,22 +99,22 @@ export default {
},
currentData: {}, //
currentNodekey: "", //,
role: "",
};
},
watch: {
// filterText(val) {
// console.log(val);
// this.$refs.tree.filter(val);
// console.log(this.$refs.tree);
// },
filterText(newVal) {
this.handleFilter(); // filterText
},
},
created() {
this.getLineTreeList(); //
this.companyVal = this.companyOptions[0].value;
},
methods: {
handleClick(val) {
console.log(val);
},
handleFilter() {
// 500
setTimeout(() => {
@ -107,9 +134,32 @@ export default {
},
//
getLineTreeList() {
getdyTreeListJoggle({ type: 1 })
this.role = localStorage.getItem("role");
console.log(this.role);
this.treeLoading = true;
getICEdyTreeList({
type: -1,
lineid: [
"234",
"238",
"253",
"242",
"233",
"231",
"243",
"235",
"248",
"230",
"236",
"239",
"257",
"255",
],
})
.then((res) => {
this.lineTreeData = res.data.list;
this.treeLoading = false;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
this.lineTreeData.forEach((node) => {
if (node.list) {
@ -125,9 +175,9 @@ export default {
? JSON.parse(localStorage.getItem("defaultKey"))
: this.defaultExpandedKeys; //defaultKey ;
console.log(this.defaultExpandedKeys);
// if (this.lineTreeData[0].list[0].list.length > 0) {
// }
//console.log(this.defaultExpandedKeys);
if (this.lineTreeData[0].list[0].list.length > 0) {
}
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
@ -147,7 +197,6 @@ export default {
console.log(err); //
});
},
//treenode
handleNodeClick(data) {
this.currentData = data;
@ -162,6 +211,20 @@ export default {
display: flex;
flex-direction: column;
padding: 16px 0;
.companyBox {
display: flex;
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
align-items: center;
.spanLabel {
font-size: 14px;
width: 96px;
}
}
.el-divider--horizontal {
margin: 0px 0px 8px 0px;
}
.searchBar {
width: 94%;
margin: 0 auto;
@ -184,17 +247,20 @@ export default {
align-items: center;
}
.num {
color: #169e8c;
color: #1c77ac;
}
}
}
.disconnect {
color: #d3d3d3;
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #169e8c;
background: #1c77ac;
.custom-tree-node {
color: #fff;
//overflow: hidden;
@ -212,9 +278,14 @@ export default {
}
}
}
.disconnect {
color: #d3d3d3;
}
.el-table thead {
color: #333;
th {
font-weight: 400;
}
}
.el-table {
color: #666;
}
</style>

@ -0,0 +1,714 @@
<template>
<div class="icingBox">
<div class="icingContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="childBox">
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changedate"
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="exportExcl"
>导出数据</el-button
>
</el-form-item>
<el-form-item v-if="termalFlag">
<el-button
v-if="!echartsShow"
type="primary"
@click="lookLineCharts"
>曲线图</el-button
>
<el-button
v-if="echartsShow"
type="primary"
@click="lookTableCharts"
>列表数据</el-button
>
</el-form-item>
</el-form>
</div>
<div class="childTableShowBox" v-if="!echartsShow">
<el-table
:data="tableData"
style="width: 100%"
v-loading="loading"
height="calc(100% - 0px)"
>
<el-table-column
prop="cmdid"
label="监测终端编号"
></el-table-column>
<el-table-column
prop="updateTime"
label="时间"
min-width="120px"
>
<template slot-scope="scope">
<span v-if="scope.row.updateTime">
{{
$moment(scope.row.updateTime * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="funcCode" label="功能单元识别码">
<template slot-scope="scope">
<span v-if="scope.row.funcCodeName && scope.row.funcCode">
{{ scope.row.funcCodeName }}({{
scope.row.funcCodeHex
}})</span
><span v-else-if="scope.row.funcCodeHex"
>({{ scope.row.funcCodeHex }})</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="maxPull" label="最大拉力(Kg)">
<template slot-scope="scope">
<span v-if="scope.row.maxPull != 65535">
{{ scope.row.maxPull }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column
prop="maxPullWind"
label="最大拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="maxPullTilt"
label="最大拉力时倾斜角(°)"
></el-table-column>
<el-table-column prop="minPull" label="最小拉力(Kg)">
<template slot-scope="scope">
<span v-if="scope.row.minPull != 65535">
{{ scope.row.minPull }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column
prop="minPullWind"
label="最小拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="minPullTilt"
label="最小拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWind"
label="最大风偏角(°)"
></el-table-column>
<el-table-column
prop="maxWindTilt"
label="最大风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindPull"
label="最大风偏角时拉力(Kg)"
>
<template slot-scope="scope">
<span v-if="scope.row.maxWindPull != 65535">
{{ scope.row.maxWindPull }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column
prop="minWind"
label="最小风偏角(°)"
></el-table-column>
<el-table-column
prop="minWindTilt"
label="最小风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minWindPull"
label="最小风偏角时拉力(Kg)"
>
<template slot-scope="scope">
<span v-if="scope.row.minWindPull != 65535">
{{ scope.row.minWindPull }}</span
>
<span v-else> - </span>
</template>
</el-table-column>
</el-table>
</div>
<div class="pageNation" v-if="!echartsShow">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
<div class="graphBox" v-if="echartsShow">
<div
class="codeBox1"
v-for="(item, index) in codeList"
:key="index"
>
<h3>相位(标识): ({{ item }})</h3>
<div class="codeBox">
<div :id="'lineEchart' + index" class="lineChartBox"></div>
</div>
</div>
<div class="noDatabox" v-if="codeList.length == 0">
<img src="../../assets/img/nopic1.jpg" />
<p>暂无图表</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../components/leftTree.vue";
import { getDataListJoggle, funccodeJoggle } from "@/utils/api/index";
export default {
name: "icing",
components: {
leftTree,
},
data() {
return {
loading: false,
tableData: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
qt: "",
id: "",
termId: "",
paramsData: "",
termalFlag: false, // 线
echartsShow: false, //线
codeList: [], //
chartsData: [],
};
},
watch: {
endtime(newVal) {
if (newVal) {
const date = new Date(newVal);
date.setHours(23);
date.setMinutes(59);
date.setSeconds(59);
this.formdata.endtime = date.getTime();
}
},
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
const currentDate = new Date(); //
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.$set(this.formdata, "endtime", currentDate.getTime());
},
mounted() {},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
this.paramsData = data;
console.log(data);
if (data.dyValue) {
console.log("电压-公司");
this.qt = "all";
this.id = data.id;
this.getIcingData(data);
this.termalFlag = false;
} else if (data.bsManufacturer) {
console.log("线路-电压");
this.qt = "line";
this.id = data.id;
this.getIcingData(data);
this.termalFlag = false;
} else {
console.log("装置-杆塔");
this.qt = "tower";
this.id = data.towerid;
this.termId = data.id;
this.getIcingData(data);
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);
this.loading = true;
getDataListJoggle({
act: "ice_weight",
qt: this.qt,
id: this.id,
bt: sTime,
et: eTime,
p: this.page,
ps: this.pageSize,
})
.then((res) => {
console.log(res);
this.tableData = res.data;
this.total = Number(res.page.totalRecords);
this.loading = false;
this.echartsShow = false;
})
.catch((err) => {
console.log(err); //
});
},
lookLineCharts() {
//
this.echartsShow = true;
console.log("点击了曲线");
this.$nextTick(() => {
this.getchartsData(this.paramsData);
});
},
//
getchartsData(data) {
console.log(data, this.qt);
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,
})
.then((res) => {
console.log(res);
this.chartsData = res.data;
this.$nextTick(() => {
this.drawLine();
});
})
.catch((err) => {
console.log(err); //
});
},
lookTableCharts() {
this.echartsShow = false;
this.loading = false;
},
drawLine() {
console.log(this.chartsData);
var timeXData = [];
var legendData = [
"最大拉力",
"最大拉力时风偏角",
"最大拉力时倾斜角",
"最小拉力",
"最小拉力时风偏角",
"最小拉力时倾斜角",
"最大风偏角",
"最大风偏角时倾斜角",
"最大风偏角时拉力",
"最小风偏角",
"最小风偏角时倾斜角",
"最小风偏角时拉力",
];
timeXData = this.chartsData.map((item) =>
this.$moment(item.updateTime * 1000).format("YYYY-MM-DD HH:mm:ss")
);
timeXData = [...new Set(timeXData)];
//console.log(timeXData);
// var codename = [
// ...new Set(this.chartsData.map((item) => item.funcCodeName)),
// ];
var code = [...new Set(this.chartsData.map((item) => item.funcCodeHex))];
this.codeList = code;
// var finalData = [];
console.log(this.codeList);
const groupedData = this.chartsData.reduce((acc, item) => {
if (!acc[item.funcCodeHex]) {
acc[item.funcCodeHex] = [];
}
acc[item.funcCodeHex].push(item);
return acc;
}, []);
const result = Object.values(groupedData)
.map((arr) => [...arr])
.reverse();
console.log(result);
this.$nextTick(() => {
var roseCharts = document.querySelectorAll(".codeBox");
console.log(roseCharts);
for (var i = 0; i < roseCharts.length; i++) {
// console.log(result[i]);
// console.log(
// "",
// result[i].map((item) => item.minWindPull)
// );
// forclassdom
var myChart = this.$echarts.init(roseCharts[i]);
var option = {
// toolbox: {
// feature: {
// dataZoom: {
// yAxisIndex: "none",
// },
// restore: {},
// saveAsImage: {},
// },
// },
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
animation: false,
label: {
backgroundColor: "#505765",
},
},
},
legend: {
data: legendData,
selected: {
最大拉力: true,
最大拉力时风偏角: false,
最大拉力时倾斜角: false,
最小拉力: false,
最小拉力时风偏角: false,
最小拉力时倾斜角: false,
最大风偏角: false,
最大风偏角时倾斜角: false,
最大风偏角时拉力: false,
最小风偏角: false,
最小风偏角时倾斜角: false,
最小风偏角时拉力: false,
},
// left: 10,
},
dataZoom: [
{
show: true,
realtime: true,
start: 0,
end: 100,
},
{
type: "inside",
realtime: true,
start: 0,
end: 100,
},
],
xAxis: [
{
type: "category",
boundaryGap: false,
axisLine: { onZero: false },
// prettier-ignore
data: timeXData,
},
],
yAxis: [
{
name: "拉力(Kg)",
type: "value",
},
{
name: "偏角(°)",
alignTicks: true,
type: "value",
// inverse: true
},
],
series: [
{
name: "最大拉力",
type: "line",
data: result[i].map((item) =>
item.maxPull == 65535 ? "" : item.maxPull
),
},
{
name: "最小拉力",
type: "line",
data: result[i].map((item) =>
item.minPull == 65535 ? "" : item.minPull
),
},
{
name: "最大风偏角时拉力",
type: "line",
data: result[i].map((item) =>
item.maxWindPull == 65535 ? "" : item.maxWindPull
),
},
{
name: "最小风偏角时拉力",
type: "line",
data: result[i].map((item) =>
item.minWindPull == 65535 ? "" : item.minWindPull
),
},
{
name: "最大拉力时风偏角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.maxPullWind),
},
{
name: "最大拉力时倾斜角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.maxPullTilt),
},
{
name: "最小拉力时风偏角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.minPullWind),
},
{
name: "最小拉力时倾斜角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.minPullTilt),
},
{
name: "最大风偏角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data:result[i].map((item) => item.maxWind),
},
{
name: "最大风偏角时倾斜角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data:result[i].map((item) => item.maxWindTilt),
},
{
name: "最小风偏角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.minWind),
},
{
name: "最小风偏角时倾斜角",
type: "line",
yAxisIndex: 1,
// prettier-ignore
data: result[i].map((item) => item.minWindTilt),
},
],
};
myChart.setOption(option);
console.log("我执行了");
window.addEventListener("resize", () => {
myChart.resize();
});
}
});
},
//
changedate() {
console.log(new Date(this.formdata.endtime));
const currentDate = new Date(this.formdata.endtime); //
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.formdata.endtime = currentDate;
console.log("结束时间", this.formdata.endtime);
},
exportExcl() {
const sTime = Math.floor(this.formdata.starttime / 1000);
const eTime = Math.floor(this.formdata.endtime / 1000);
// window.location.href = "/api/api/getOnlineTerminalListExcel?type=" + val;
window.location.href =
"/api/xapi/query.php?act=ice_weight&qt=" +
this.qt +
"&id=" +
this.id +
"&bt=" +
sTime +
"&et=" +
eTime +
"&p=1&ps=20&exp=xls";
},
onSubmit() {
console.log(this.formdata.starttime, this.formdata.endtime);
// if (
// new Date(this.formdata.starttime).getDate() ===
// new Date(this.formdata.endtime).getDate()
// ) {
// this.getIcingData(this.paramsData);
// console.log("");
// } else {
// this.$message({
// duration: 1500,
// showClose: true,
// message: "",
// type: "warning",
// });
// return;
// console.log("");
// }
this.getIcingData(this.paramsData);
},
//
handleCurrentChange(val) {
this.page = val;
this.tableData = [];
this.getIcingData(this.paramsData);
},
//
handleSizeChange(val) {
this.pageSize = val;
this.tableData = [];
this.getIcingData(this.paramsData);
},
},
};
</script>
<style lang="less">
.icingBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.icingContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.el-table .el-table__cell {
text-align: center;
}
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
// .fatherTableShowBox {
// height: calc(100% - 0px);
// }
.childBox {
height: calc(100% - 0px);
.childTableShowBox {
height: calc(100% - 91px);
}
}
.graphBox {
margin: 0 auto;
height: calc(100% - 54px);
overflow: auto;
.codeBox1 {
width: 100%;
height: 500px;
h3 {
font-size: 14px;
color: #333;
margin-top: 8px;
margin-bottom: 8px;
font-weight: normal;
text-align: center;
}
.codeBox {
width: 100%;
height: 450px;
}
.lineChartBox {
width: 100%;
height: 372px;
}
}
.noDatabox {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
img {
width: 400px;
}
p {
font-size: 16px;
}
}
}
}
}
</style>

@ -0,0 +1,700 @@
<template>
<div class="weatherBox">
<div class="weatherContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="fatherTableShowBox" v-if="!childFlag">
<el-table
:data="tableData"
style="width: 100%"
v-loading="loading"
height="calc(100% - 40px)"
>
<el-table-column prop="lineName" label="线路"> </el-table-column>
<el-table-column prop="towerName" label="杆塔"> </el-table-column>
<el-table-column prop="cmdid" label="终端"> </el-table-column>
<el-table-column prop="updateTime" label="时间">
<template slot-scope="scope">
<span v-if="scope.row.updateTime">
{{
$moment(scope.row.updateTime * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="temperature" label="温度(℃)">
<template slot-scope="scope">
<span v-if="scope.row.temperature">{{
scope.row.temperature
}}</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>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="windSpeed" label="瞬时风速(m/s)">
<template slot-scope="scope">
<span v-if="scope.row.windSpeed">{{
scope.row.windSpeed
}}</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>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column prop="rain" label="雨量(mm/hour)">
<template slot-scope="scope">
<span v-if="scope.row.rain">{{ scope.row.rain }}</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>
<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-else> - </span>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
type="text"
@click="moreDataClick(scope.row)"
v-if="scope.row.updateTime"
>更多历史数据</el-button
>
<span v-else> </span>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
<div class="childBox" v-else>
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changedate"
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="termalBox">
<h3>当前监测终端</h3>
<el-descriptions direction="vertical" :column="4" border>
<el-descriptions-item label="线路">{{
childMsg.lineName
}}</el-descriptions-item>
<el-descriptions-item label="杆塔">{{
childMsg.towerName
}}</el-descriptions-item>
<el-descriptions-item label="终端">{{
childMsg.cmdid
}}</el-descriptions-item>
</el-descriptions>
</div>
<div class="echartsBox">
<div class="btnbox">
<el-button type="primary" @click="onWdLine"
>温度变化趋势</el-button
>
<el-button type="primary" @click="onSdLine"
>湿度变化趋势</el-button
>
<el-button type="primary" @click="onHidden"></el-button>
</div>
<div id="wDechart" class="chartClass" v-show="wdFlag"></div>
<div id="sDechart" class="chartClass" v-show="sdFlag"></div>
</div>
<div class="childTableShowBox">
<h3>气象数据列表</h3>
<el-table
:data="childTableDate"
style="width: 100%"
v-loading="loading"
height="calc(100% - 40px)"
>
<el-table-column prop="updateTime" label="时间">
<template slot-scope="scope">
<span v-if="scope.row.updateTime">
{{
$moment(scope.row.updateTime * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}</span
>
<span v-else> - </span>
</template>
</el-table-column>
<el-table-column
prop="temperature"
label="温度(℃)"
></el-table-column>
<el-table-column
prop="humidity"
label="湿度(%RH)"
></el-table-column>
<el-table-column
prop="windSpeed"
label="瞬时风速(m/s)"
></el-table-column>
<el-table-column
prop="windDirection"
label="瞬时风向(°)"
></el-table-column>
<el-table-column
prop="precipitation"
label="雨量(mm/hour)"
></el-table-column>
<el-table-column
prop="airPressure"
label="气压(hPa(百帕))"
></el-table-column>
<el-table-column
prop="radiationIntensity"
label="日照(W/m2)"
></el-table-column>
<el-table-column
prop="avgWindSpeed1Min"
label="1分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="avgWindDir1Min"
label="1分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="avgWindSpeed10Min"
label="10分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="avgWindDir10Min"
label="10分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="maxSpeed10Min"
label="10分钟最大风速(m/s)"
></el-table-column>
</el-table>
</div>
<div class="pageNation">
<el-pagination
@current-change="handlechildCurrentChange"
@size-change="handlechildSizeChange"
:current-page="childpage"
:page-size="childpageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="childtotal"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../components/leftTree";
import { getDataListJoggle } from "@/utils/api/index";
export default {
name: "weather",
components: {
leftTree,
},
data() {
return {
loading: false,
childFlag: false,
tableData: [],
childTableDate: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
qt: "",
id: "",
paramsData: "",
childpage: 1, //
childpageSize: 20, //
childtotal: 0, //
childParma: "",
childMsg: "",
echartsData: "", //echarts
wdFlag: true,
sdFlag: false,
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
watch: {
endtime(newVal) {
if (newVal) {
const date = new Date(newVal);
date.setHours(23);
date.setMinutes(59);
date.setSeconds(59);
this.formdata.endtime = date.getTime();
}
},
},
mounted() {
//this.getWeatherData();
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
this.paramsData = data;
console.log(data);
if (data.dyValue) {
console.log("电压-公司");
this.qt = "all";
this.id = data.id;
this.getWeatherData(data);
} else if (data.bsManufacturer) {
console.log("线路-电压");
this.qt = "line";
this.id = data.id;
this.getWeatherData(data);
} else {
console.log("装置-杆塔");
this.qt = "tower";
this.id = data.towerid;
this.getWeatherData(data);
}
//this.getAllData(data);
},
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;
this.tableData = [];
this.getWeatherData(this.paramsData);
},
//
handleSizeChange(val) {
this.pageSize = val;
this.tableData = [];
this.getWeatherData(this.paramsData);
},
//
moreDataClick(row) {
this.childFlag = true;
console.log(row);
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
const currentDate = new Date(); //
currentDate.setHours(23); // 23
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);
},
//
onSubmit() {
this.getchildWeatherData(this.childParma);
},
getchildWeatherData(row) {
this.loading = true;
this.childMsg = 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,
})
.then((res) => {
console.log(res);
this.childTableDate = res.data;
this.childtotal = Number(res.page.totalRecords);
this.loading = false;
//线
this.getAllData(row);
})
.catch((err) => {
console.log(err); //
});
},
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,
})
.then((res) => {
console.log(res);
this.echartsData = res.data;
//线
this.getEchart4(this.echartsData);
this.getEchart5(this.echartsData);
})
.catch((err) => {
console.log(err); //
});
},
onWdLine() {
this.wdFlag = true;
this.sdFlag = false;
},
onSdLine() {
this.wdFlag = false;
this.sdFlag = true;
},
onHidden() {
this.wdFlag = false;
this.sdFlag = false;
},
//
getEchart4(wd) {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("wDechart"));
this.mywDechart = this.$echarts.init(
document.getElementById("wDechart")
);
console.log(wd);
var xData = [];
var yData = [];
xData = wd.map((item) =>
this.$moment(item.updateTime * 1000).format("HH:mm:ss")
);
yData = wd.map((item) => item.temperature);
let option = {
tooltip: {
trigger: "axis",
},
grid: {
//left: "6%", //
//right: "6%", //
bottom: "6%", //
//top: "2%", //
},
title: {
text: "温度变化趋势",
x: "center", //
textStyle: {
//
color: "#333", //
fontSize: 16, //
fontWeight: "normal",
},
},
toolbox: {
show: true,
feature: {
dataView: { readOnly: false },
magicType: { type: ["line", "bar"] },
restore: {},
saveAsImage: {},
},
},
xAxis: {
name: "时间", //
type: "category",
boundaryGap: false,
data: xData,
},
yAxis: {
name: "温度", //
type: "value",
axisLabel: {
formatter: "{value} °C",
},
},
series: [
{
name: "温度",
symbol: "none",
type: "line",
data: yData,
},
],
};
this.mywDechart.setOption(option);
window.addEventListener("resize", () => {
this.mywDechart.resize();
});
});
},
getEchart5(sd) {
this.$nextTick(() => {
this.$echarts.init(document.getElementById("sDechart"));
this.mysDechart = this.$echarts.init(
document.getElementById("sDechart")
);
console.log(sd);
var xData = [];
var yData = [];
xData = sd.map((item) =>
this.$moment(item.updateTime * 1000).format("HH:mm:ss")
);
yData = sd.map((item) => item.humidity);
let option = {
tooltip: {
trigger: "axis",
},
grid: {
//left: "6%", //
//right: "6%", //
bottom: "6%", //
//top: "2%", //
},
title: {
text: "湿度变化趋势",
x: "center", //
textStyle: {
//
color: "#333", //
fontSize: 16, //
fontWeight: "normal",
},
},
toolbox: {
show: true,
feature: {
dataView: { readOnly: false },
magicType: { type: ["line", "bar"] },
restore: {},
saveAsImage: {},
},
},
xAxis: {
name: "时间", //
type: "category",
boundaryGap: false,
data: xData,
},
yAxis: {
name: "湿度", //
type: "value",
axisLabel: {
formatter: "{value} %RH",
},
},
series: [
{
name: "湿度",
symbol: "none",
type: "line",
data: yData,
},
],
};
this.mysDechart.setOption(option);
window.addEventListener("resize", () => {
this.mysDechart.resize();
});
});
},
changedate() {
console.log(new Date(this.formdata.endtime));
const currentDate = new Date(this.formdata.endtime); //
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.formdata.endtime = currentDate;
console.log("结束时间", this.formdata.endtime);
},
//child
handlechildCurrentChange(val) {
this.childpage = val;
this.childTableDate = [];
this.getchildWeatherData(this.childParma);
},
//child
handlechildSizeChange(val) {
this.childpageSize = val;
this.childTableDate = [];
this.getchildWeatherData(this.childParma);
},
},
};
</script>
<style lang="less">
.weatherBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.weatherContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: auto;
border-left: 1px solid #ddd;
.el-table .el-table__cell {
text-align: center;
}
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
.fatherTableShowBox {
height: calc(100% - 0px);
}
.childBox {
height: 100%;
.echartsBox {
display: flex;
flex-direction: column;
align-items: center;
.btnbox {
display: flex;
margin-bottom: 8px;
.el-button--primary {
width: auto;
}
}
.chartClass {
height: 450px;
width: 800px;
}
}
.childTableShowBox {
h3 {
font-size: 16px;
font-weight: normal;
margin-bottom: 8px;
text-align: center;
color: #666;
margin-top: 16px;
}
height: calc(100% - 200px);
}
.termalBox {
h3 {
font-size: 16px;
font-weight: normal;
margin-bottom: 4px;
text-align: center;
color: #666;
}
.el-descriptions {
margin-bottom: 16px;
.el-descriptions-item__label.is-bordered-label {
color: #333;
}
.el-descriptions__body
.el-descriptions__table
.el-descriptions-item__cell {
text-align: center;
}
}
}
}
}
}
</style>

@ -1,326 +0,0 @@
<template>
<div class="icingBox">
<div class="icingContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="childBox">
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"
>导出数据</el-button
>
</el-form-item>
</el-form>
</div>
<div class="childTableShowBox">
<el-table :data="tableData" style="width: 100%">
<el-table-column
prop="terminalNumber"
label="监测终端编号"
></el-table-column>
<el-table-column prop="time" label="时间"></el-table-column>
<el-table-column
prop="functionalUnitIdentifier"
label="功能单元识别码"
></el-table-column>
<el-table-column
prop="maxPullForceKg"
label="最大拉力(Kg)"
></el-table-column>
<el-table-column
prop="maxPullForceWindBiasAngle"
label="最大拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="maxPullForceTiltAngle"
label="最大拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minPullForceKg"
label="最小拉力(Kg)"
></el-table-column>
<el-table-column
prop="minPullForceWindBiasAngle"
label="最小拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="minPullForceTiltAngle"
label="最小拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngle"
label="最大风偏角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngleTiltAngle"
label="最大风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAnglePullForceKg"
label="最大风偏角时拉力(Kg)"
></el-table-column>
<el-table-column
prop="minWindBiasAngle"
label="最小风偏角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAngleTiltAngle"
label="最小风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAnglePullForceKg"
label="最小风偏角时拉力(Kg)"
></el-table-column>
</el-table>
</div>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../../fubingCommon/leftTree";
export default {
name: "icing",
components: {
leftTree,
},
data() {
return {
msg: "",
childFlag: false,
tableData: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
if (data.dyValue) {
console.log("电压");
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
} else if (data.bsManufacturer) {
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
} else {
console.log("杆塔");
this.tableData = [
{
terminalNumber: "终端A",
time: "2023-03-15 08:00:00",
functionalUnitIdentifier: "功能单元1",
maxPullForceKg: "20Kg",
maxPullForceWindBiasAngle: "60°",
maxPullForceTiltAngle: "30°",
minPullForceKg: "5Kg",
minPullForceWindBiasAngle: "30°",
minPullForceTiltAngle: "20°",
maxWindBiasAngle: "70°",
maxWindBiasAngleTiltAngle: "45°",
maxWindBiasAnglePullForceKg: "15Kg",
minWindBiasAngle: "20°",
minWindBiasAngleTiltAngle: "30°",
minWindBiasAnglePullForceKg: "8Kg",
},
];
}
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
},
},
};
</script>
<style lang="less">
.icingBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.icingContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
// .fatherTableShowBox {
// height: calc(100% - 0px);
// }
.childBox {
height: calc(100% - 50px);
.childTableShowBox {
height: calc(100% - 50px);
}
}
}
}
</style>

@ -1,541 +0,0 @@
<template>
<div class="realsideBar">
<div class="searchBar">
<el-input
placeholder="输入关键字进行过滤"
v-model="filterText"
prefix-icon="el-icon-search"
>
</el-input>
</div>
<div class="deviceNum">
<el-statistic title="装置在线 / 总数">
<template slot="formatter">
<span>{{ onlineNum ? onlineNum : 0 }}</span> /
<span>{{ totalNum ? totalNum : 0 }}</span
>
</template>
</el-statistic>
</div>
<div class="radioFilter">
<el-radio-group v-model="zzradio" @input="getRadio">
<el-radio :label="-1">全部</el-radio>
<el-radio :label="1">在线</el-radio>
<el-radio :label="0">离线</el-radio>
</el-radio-group>
<el-button
class="refresh"
@click="getLineTreeStatus"
type="text"
icon="el-icon-refresh-right"
>刷新</el-button
>
</div>
<el-tree
ref="tree"
:data="lineTreeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultExpandIds"
highlight-current
:expand-on-click-node="false"
:filter-node-method="filterNode"
:current-node-key="currentNodekey"
@node-click="handleNodeClick"
@node-expand="handleNodeExpand"
@node-collapse="handleNodeCollapse"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<!-- v-if="node.name === '收藏夹'" -->
<span>
<span>
<span
v-if="node.label === '收藏夹'"
class="el-icon-collection"
style="margin-right: 6px"
></span>
<span
v-if="node.level === 1 && node.label !== '收藏夹'"
class="iconfont icon-dianli"
style="margin-right: 6px"
></span>
<span
v-if="node.level === 2 && data.bsManufacturer"
class="iconfont icon-dianlihangye"
style="margin-right: 6px"
>
</span>
<span
v-if="
node.label !== '收藏夹' && !data.bsManufacturer && !data.dyValue
"
>
<span
class="iconfont icon-shexiangtoulixian"
v-if="data.onlinestatus == 0"
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
<span
class="iconfont icon-shexiangtou-lixian"
v-else
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
</span>
<span :class="data.onlinestatus == 0 ? 'disconnect' : ''"
>{{ node.label }}
</span>
</span>
</span>
<!-- <span v-else>
<span v-if="node.level === 1">
<span class="iconfont icon-dianli" style="margin-right: 6px"></span>
<span>{{ node.label }} </span>
</span>
<span v-else-if="node.level === 2">
<span class="iconfont icon-dianlihangye" style="margin-right: 6px">
</span>
<span
>{{ node.label }}
<span class="num">({{ data.list.length }}) </span></span
>
</span>
<span v-else>
<span
class="iconfont icon-shexiangtoulixian"
v-if="data.onlinestatus == 0"
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
<span
class="iconfont icon-shexiangtou-lixian"
v-else
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
style="margin-right: 6px"
></span>
<span
:id="data.id"
:class="data.onlinestatus == 0 ? 'disconnect' : ''"
>{{ node.label }}</span
>
</span>
</span> -->
</span>
</el-tree>
</div>
</template>
<script>
import EventBus from "@/utils/event-bus";
import { getdyTreeListJoggle, getzzdyTreeList } from "@/utils/api/index";
export default {
data() {
return {
filterText: "", //
onlineNum: "", //线
totalNum: "", //
zzradio: -1, //线
lineTreeData: [],
defaultExpandIds: [], //
defaultProps: {
//
children: "list",
label: "name",
},
currentData: {}, //
currentNodekey: "", //,
role: "",
treeStatustimer: null,
isfavorList: [],
};
},
components: {},
watch: {
// filterText(val) {
// console.log(val);
// this.$refs.tree.filter(val);
// console.log(this.$refs.tree);
// },
filterText(newVal) {
this.handleFilter(); // filterText
},
},
mounted() {},
created() {
this.zzradio =
JSON.parse(localStorage.getItem("radio")) !== null
? JSON.parse(localStorage.getItem("radio"))
: -1; //radio
this.role = localStorage.getItem("role");
console.log("用户管理");
console.log(this.role);
this.getRadio(); //线线
this.getLineTreeList(); //
this.treeStatustimer = setInterval(this.getLineTreeStatus, 60000); // 60
EventBus.$on("treelist", this.getLineTreeStatus);
},
methods: {
//radio
getRadio() {
console.log(this.zzradio);
this.filterText = "";
localStorage.setItem("radio", JSON.stringify(this.zzradio));
this.getLineTreeStatus();
},
//tree
getLineTreeStatus() {
console.log("点击了刷新");
if (this.filterText !== "") {
this.$refs.tree.filter(this.filterText);
} else {
if (this.role == 4) {
getzzdyTreeList({ type: this.zzradio, lineid: 259 })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
if (this.zzradio == 0) {
console.log("装置为离线");
this.$nextTick(() => {
console.log(this.lineTreeData);
this.currentData = this.lineTreeData[0];
console.log(this.currentData);
this.handleNodeClick(this.currentData);
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentData.id); //
this.scrollView();
});
});
} else {
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentData.id); //
this.scrollView();
});
}
})
.catch((err) => {
console.log(err); //
});
} else {
getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
console.log(res);
this.lineTreeData = res.data.list;
this.isfavorList = res.data.favorlist;
this.lineTreeData.unshift({
id: 0,
name: "收藏夹",
bsManufacturer: "收藏夹",
list: this.isfavorList,
});
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(
localStorage.getItem("currentData")
);
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentData.id); //
});
})
.catch((err) => {
console.log(err); //
});
}
}
},
handleFilter() {
// 500
setTimeout(() => {
this.$refs.tree.filter(this.filterText);
}, 500);
},
//
filterNode(value, data, node) {
//
if (!value) return true;
this.searchName = data.name + data.cmdid;
//console.log(this.searchName);
// valuedatalabel
if (this.searchName.indexOf(value) !== -1) {
return true;
}
let nowval = data[this.defaultProps.label].toUpperCase();
return nowval.indexOf(value.toUpperCase()) !== -1;
},
//
getLineTreeList() {
console.log(this.zzradio);
if (this.role == 4) {
getzzdyTreeList({ type: this.zzradio, lineid: 259 })
.then((res) => {
this.lineTreeData = res.data.list;
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
this.defaultExpandIds =
JSON.parse(localStorage.getItem("defultkeys")) !== null
? JSON.parse(localStorage.getItem("defultkeys"))
: []; //defaultKey ;
if (this.lineTreeData[0].list[0].list.length > 0) {
}
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
) {
this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData);
} else {
this.currentData = this.lineTreeData[0]; //
this.currentNodekey = this.lineTreeData[0].id; //
this.handleNodeClick(this.currentData);
}
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
this.scrollView();
});
})
.catch((err) => {
console.log(err); //
});
} else {
getdyTreeListJoggle({ type: this.zzradio })
.then((res) => {
this.lineTreeData = res.data.list;
this.isfavorList = res.data.favorlist;
this.lineTreeData.unshift({
id: 0,
name: "收藏夹",
bsManufacturer: "收藏夹",
list: this.isfavorList,
});
this.onlineNum = res.data.onlineNum;
this.totalNum = res.data.totalNum;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
// if (this.lineTreeData[0].list[0].list.length > 0) {
// }
if (
this.currentData !== null &&
Object.keys(this.currentData).length !== 0
) {
this.currentNodekey = this.currentData.id;
this.handleNodeClick(this.currentData);
} else {
this.currentData = this.lineTreeData[1]; //
this.currentNodekey = this.lineTreeData[1].id; //
this.handleNodeClick(this.currentData);
}
this.defaultExpandIds =
JSON.parse(localStorage.getItem("defultkeys")) !== null
? JSON.parse(localStorage.getItem("defultkeys"))
: []; //defaultKey ;
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.currentNodekey); //
this.scrollView();
});
})
.catch((err) => {
console.log(err); //
});
}
},
//
handleNodeExpand(data) {
//
let flag = false;
this.defaultExpandIds.some((item) => {
if (item === data.id) {
//
flag = true;
return true;
}
});
if (!flag) {
//
this.defaultExpandIds.push(data.id);
localStorage.setItem(
"defultkeys",
JSON.stringify(this.defaultExpandIds)
);
}
},
//
handleNodeCollapse(data) {
//
this.defaultExpandIds.some((item, i) => {
if (item === data.id) {
this.defaultExpandIds.splice(i, 1);
localStorage.setItem(
"defultkeys",
JSON.stringify(this.defaultExpandIds)
);
}
});
this.removeChildrenIds(data); //
},
//
removeChildrenIds(data) {
console.log("我还有子节点");
const ts = this;
console.log(data);
if (data.list) {
console.log(data.list);
data.list.forEach(function (item) {
const index = ts.defaultExpandIds.indexOf(item.id);
if (index > 0) {
ts.defaultExpandIds.splice(index, 1);
}
ts.removeChildrenIds(item);
console.log(ts.defaultExpandIds);
});
localStorage.setItem(
"defultkeys",
JSON.stringify(this.defaultExpandIds)
);
}
},
//treenode
handleNodeClick(data) {
if (data.name == "收藏夹") {
return;
}
if (data.isfavor == 0 || data.isfavor == null) {
this.collectFlag = false;
} else {
this.collectFlag = true;
}
this.currentData = data;
//this.scrollView();
this.$store.commit("currentData", this.currentData); //currentDatavuex
this.$store.commit("termId", this.currentData.id); //currentDatavuex
this.$store.commit("protocol", this.currentData.protocol); //currentDatavuex
this.$store.commit("cmdId", this.currentData.cmdid); //currentDatavuex
this.$parent.getCurrentData();
//this.$refs.tree.scrollTo(data);
// localStorage.setItem("currentData", JSON.stringify(this.currentData));
},
scrollView() {
if (this.currentData) {
this.$nextTick(() => {
let treeComponent = this.$refs.tree.$el;
let node = treeComponent.querySelector(".is-current");
console.log(node);
if (node) {
node.scrollIntoView({ behavior: "smooth" });
}
});
}
},
},
beforeDestroy() {
//
clearInterval(this.treeStatustimer);
this.treeStatustimer = null;
},
};
</script>
<style lang="less">
.realsideBar {
width: 300px;
display: flex;
flex-direction: column;
padding: 16px 0px;
.searchBar {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
}
.deviceNum {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
height: 20px;
line-height: 20px;
font-size: 12px;
.el-statistic {
display: flex;
justify-content: center;
align-items: center;
.head {
}
.con {
color: #169e8c;
}
}
}
.radioFilter {
width: 94%;
margin: 0 auto;
margin-bottom: 8px;
font-size: 12px;
display: flex;
justify-content: space-around;
.refresh {
}
.el-radio-group {
display: flex;
align-items: center;
justify-content: center;
.el-radio {
margin-right: 16px;
}
}
}
.el-tree {
overflow-y: scroll;
overflow-x: hidden;
.el-tree-node__content {
height: 32px;
font-size: 12px;
}
.custom-tree-node {
color: #333;
overflow: hidden;
span {
display: flex;
display: inline-table;
overflow: hidden;
align-items: center;
}
.num {
color: #169e8c;
}
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #169e8c;
.custom-tree-node {
color: #fff;
//overflow: hidden;
span {
display: flex;
//overflow: hidden;
align-items: center;
.num {
color: #fff;
}
.iconfont {
//width: 30px;
display: inline-table;
}
}
}
}
.disconnect {
color: #d3d3d3;
}
}
</style>

@ -106,7 +106,7 @@
</template>
<script>
import EventBus from "@/utils/event-bus";
import { getdyTreeListJoggle, getzzdyTreeList } from "@/utils/api/index";
import { getdyTreeListJoggle } from "@/utils/api/index";
export default {
data() {
return {

@ -1,389 +0,0 @@
<template>
<div class="weatherBox">
<div class="weatherContain">
<leftTree ref="sideTree"></leftTree>
<div class="rightTable">
<div class="dataBox">
<div class="fatherTableShowBox" v-if="!childFlag">
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 40px)"
>
<el-table-column prop="line" label="线路"> </el-table-column>
<el-table-column prop="pole" label="杆塔"> </el-table-column>
<el-table-column prop="terminal" label="终端"> </el-table-column>
<el-table-column prop="time" label="时间"> </el-table-column>
<el-table-column prop="temperature" label="温度(℃)">
</el-table-column>
<el-table-column prop="humidity" label="湿度(%RH)">
</el-table-column>
<el-table-column prop="windSpeed" label="瞬时风速(m/s)">
</el-table-column>
<el-table-column prop="windDirection" label="瞬时风向(°)">
</el-table-column>
<el-table-column prop="rainfall" label="雨量(mm/hour)">
</el-table-column>
<el-table-column prop="pressure" label="气压(hPa(百帕))">
</el-table-column>
<el-table-column prop="sunlight" label="日照(W/m2)">
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
<div class="childBox" v-else>
<div class="searchBox" ref="searchref">
<el-form
:inline="true"
:model="formdata"
class="demo-form-inline"
>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="date"
placeholder="开始日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="childTableShowBox">
<el-table :data="childTableDate" style="width: 100%">
<el-table-column prop="time" label="时间"></el-table-column>
<el-table-column
prop="temperature"
label="温度(℃)"
></el-table-column>
<el-table-column
prop="humidity"
label="湿度(%RH)"
></el-table-column>
<el-table-column
prop="windSpeed"
label="瞬时风速(m/s)"
></el-table-column>
<el-table-column
prop="windDirection"
label="瞬时风向(°)"
></el-table-column>
<el-table-column
prop="rainfall"
label="雨量(mm/hour)"
></el-table-column>
<el-table-column
prop="pressure"
label="气压(hPa(百帕))"
></el-table-column>
<el-table-column
prop="sunlight"
label="日照(W/m2)"
></el-table-column>
<el-table-column
prop="minuteAverageWindSpeed"
label="1分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="minuteAverageWindDirection"
label="1分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindSpeed"
label="10分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindDirection"
label="10分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteMaxWindSpeed"
label="10分钟最大风速(m/s)"
></el-table-column>
</el-table>
</div>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
>
</el-pagination>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import leftTree from "../../fubingCommon/leftTree";
export default {
name: "weather",
components: {
leftTree,
},
data() {
return {
msg: "",
childFlag: false,
tableData: [],
childTableDate: [],
formdata: {},
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
if (data.dyValue) {
console.log("电压");
this.msg = "公司所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路A",
pole: "杆塔1",
terminal: "终端1",
time: "2023-03-15 08:00:00",
temperature: "25℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "120°",
rainfall: "0mm/hour",
pressure: "1015hPa",
sunlight: "500W/m2",
},
{
line: "线路B",
pole: "杆塔2",
terminal: "终端2",
time: "2023-03-15 09:00:00",
temperature: "23℃",
humidity: "70%",
windSpeed: "0.3m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1013hPa",
sunlight: "350W/m2",
},
{
line: "线路C",
pole: "杆塔3",
terminal: "终端3",
time: "2023-03-15 10:00:00",
temperature: "27℃",
humidity: "55%",
windSpeed: "0.7m/s",
windDirection: "60°",
rainfall: "0mm/hour",
pressure: "1017hPa",
sunlight: "650W/m2",
},
{
line: "线路D",
pole: "杆塔4",
terminal: "终端4",
time: "2023-03-15 11:00:00",
temperature: "24℃",
humidity: "65%",
windSpeed: "0.4m/s",
windDirection: "30°",
rainfall: "0mm/hour",
pressure: "1016hPa",
sunlight: "450W/m2",
},
{
line: "线路E",
pole: "杆塔5",
terminal: "终端5",
time: "2023-03-15 12:00:00",
temperature: "28℃",
humidity: "50%",
windSpeed: "0.6m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1018hPa",
sunlight: "750W/m2",
},
];
} else if (data.bsManufacturer) {
this.msg = "杆塔下所有数据";
this.childFlag = false;
this.tableData = [
{
line: "线路F",
pole: "杆塔6",
terminal: "终端6",
time: "2023-03-15 13:00:00",
temperature: "26℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "150°",
rainfall: "0mm/hour",
pressure: "1017hPa",
sunlight: "600W/m2",
},
{
line: "线路G",
pole: "杆塔7",
terminal: "终端7",
time: "2023-03-15 14:00:00",
temperature: "29℃",
humidity: "45%",
windSpeed: "0.7m/s",
windDirection: "180°",
rainfall: "mm/hour, ",
pressure: "184hPa百帕 ",
sunlight: "789W/m²",
},
{
line: "线路H",
pole: "杆塔8 ",
terminal: "终端8 ",
time: "24-Mar-23 16:45 ",
temperature: "24℃摄氏度 ",
humidity: "78% (百分比) ",
windSpeed: "1.8m/s米/秒) ",
windDirection: "88 °(度) ",
rainfall: "至今无数据 ",
pressure: "184hPa百帕 ",
sunlight: " 无数据 ",
comment: " 天气晴朗,适合户外活动。",
},
];
} else {
console.log("杆塔");
this.msg = "装置当天数据";
this.childFlag = true;
this.childTableDate = [
{
time: "2023-03-15 08:00:00",
temperature: "25℃",
humidity: "60%",
windSpeed: "0.5m/s",
windDirection: "120°",
rainfall: "0mm/hour",
pressure: "1015hPa",
sunlight: "500W/m2",
minuteAverageWindSpeed: "无数据",
minuteAverageWindDirection: "无数据",
tenMinuteAverageWindSpeed: "无数据",
tenMinuteAverageWindDirection: "无数据",
tenMinuteMaxWindSpeed: "无数据",
},
{
time: "2023-03-15 09:00:00",
temperature: "23℃",
humidity: "70%",
windSpeed: "0.3m/s",
windDirection: "90°",
rainfall: "0mm/hour",
pressure: "1013hPa",
sunlight: "350W/m2",
minuteAverageWindSpeed: "无数据",
minuteAverageWindDirection: "无数据",
tenMinuteAverageWindSpeed: "无数据",
tenMinuteAverageWindDirection: "无数据",
tenMinuteMaxWindSpeed: "无数据",
},
];
}
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
},
},
};
</script>
<style lang="less">
.weatherBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.weatherContain {
display: flex;
height: 100%;
box-sizing: border-box;
background: #fff;
border: 1px solid #ddd;
border-radius: 4px;
}
.rightTable {
display: flex;
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
border-left: 1px solid #ddd;
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
}
.fatherTableShowBox {
height: calc(100% - 0px);
}
.childBox {
height: calc(100% - 50px);
.childTableShowBox {
height: calc(100% - 50px);
}
}
}
}
</style>
Loading…
Cancel
Save