master
fanluyan 2 years ago
parent 04f64d3a72
commit 1b82ef8e5a

@ -1,24 +1,29 @@
# my
# 覆冰项目
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -63,31 +63,31 @@ export default {
index: "/icing",
title: "覆冰监测",
},
{
icon: "el-icon-s-marketing",
index: "/equipmentStatus",
title: "设备状态",
},
// {
// icon: "el-icon-files",
// index: "/property",
// title: "",
// subs: [
// {
// index: "/lineInformation",
// title: "线",
// },
// {
// index: "/towerInformation",
// title: "",
// icon: "el-icon-s-marketing",
// index: "/equipmentStatus",
// title: "",
// },
{
icon: "el-icon-files",
index: "/property",
title: "资产管理",
subs: [
{
index: "/lineInformation",
title: "线路管理",
},
{
index: "/towerInformation",
title: "杆塔管理",
},
// {
// index: "/photographicDevice",
// title: "",
// },
// ],
// },
{
index: "/photographicDevice",
title: "监测终端管理",
},
],
},
],
};
},

@ -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">
@ -61,6 +80,14 @@ import { getdyTreeListJoggle } from "@/utils/api/index";
export default {
data() {
return {
treeLoading: false,
companyVal: "", //
companyOptions: [
{
value: "bydr",
label: "捕鱼达人",
},
],
filterText: "", //
lineTreeData: [],
defaultExpandedKeys: [], //
@ -75,19 +102,18 @@ export default {
};
},
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,51 +133,11 @@ export default {
},
//
getLineTreeList() {
getdyTreeListJoggle({ type: 1 })
this.treeLoading = true;
getdyTreeListJoggle({ type: -1 })
.then((res) => {
//this.lineTreeData = res.data.list;
this.lineTreeData = [
{
id: 4,
name: "公司名称",
dyValue: 220,
list: [
{
id: 209,
name: "线路",
bsManufacturer: "电力公司2",
list: [
{
id: 10323,
towerid: 295,
cmdid: "装置1",
equipname: "XYIGQ10D221000100",
name: "装置1",
address: "上海",
protocol: 65283,
displayname: "XYIGQ10D221000100",
model: null,
onlinestatus: 1,
hasPan: null,
},
{
id: 10556,
towerid: 532,
cmdid: "装置2",
equipname: "",
name: "装置2",
address: null,
protocol: 65283,
displayname: "XYIGQ10C230100005",
model: "",
onlinestatus: 1,
hasPan: 0,
},
],
},
],
},
];
this.lineTreeData = res.data.list;
this.treeLoading = false;
this.currentData = JSON.parse(localStorage.getItem("currentData"));
this.lineTreeData.forEach((node) => {
if (node.list) {
@ -189,7 +175,6 @@ export default {
console.log(err); //
});
},
//treenode
handleNodeClick(data) {
this.currentData = data;
@ -204,6 +189,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;
@ -230,6 +229,9 @@ export default {
}
}
}
.disconnect {
color: #d3d3d3;
}
.el-tree--highlight-current
.el-tree-node.is-current
@ -254,9 +256,14 @@ export default {
}
}
}
.disconnect {
color: #d3d3d3;
}
.el-table thead {
color: #333;
th {
font-weight: 400;
}
}
.el-table {
color: #666;
}
</style>

@ -16,6 +16,7 @@ import "./assets/fonts/iconfont.css"; //按钮
//引入Echarts;
import * as echarts from "echarts";
Vue.prototype.$echarts = echarts;
//引入日期// 注册全局 moment
import moment from "moment";
Vue.prototype.$moment = moment;

@ -19,13 +19,15 @@ export function getdyTreeListJoggle(data) {
});
}
//导出数据
export function getOnlineTerminalListExcel() {
export function ExportExcel() {
return request({
url: "/api/getOnlineTerminalListExcel",
method: "post",
url: "/xapi/query.php",
method: "get",
params: data,
responseType: "blob",
});
}
//修改用户
export function updateUserApi(data) {
return request({
@ -43,7 +45,28 @@ export function updateUserApi(data) {
// params: data,
// });
// }
//获取数据接口
export function getDataListJoggle(data) {
return request({
url: "/xapi/query.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//获取相位码
export function funccodeJoggle(data) {
return request({
url: "/xapi/funccode.php",
method: "get",
params: data,
headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//线路
//1.线路列表信息
export function getLineListJoggle(data) {
@ -173,3 +196,11 @@ export function getProtocolList(data) {
params: data,
});
}
//获取电压-线路-杆塔等信息
export function getSearchInfo(data) {
return request({
url: "/api/getLineAndGt",
method: "post",
data,
});
}

@ -32,34 +32,35 @@ service.interceptors.response.use(
(response) => {
const res = response.data;
if (res.code !== 200) {
// if (res.code !== 200) {
// // Message({
// // showClose: true,
// // message: res.msg || "Error",
// // type: "error",
// // duration: 5 * 1000,
// // });
// if (res.code === 401) {
// Message({ message: res.msg, type: "error", duration: 1500 });
// router.push("/login");
// }
// if (res.code === 400) {
// Message({ message: res.msg, type: "error", duration: 1500 });
// }
// if (res.code === 500) {
// Message({
// showClose: true,
// message: res.msg || "Error",
// message: 服务器错误(500),
// type: "error",
// duration: 5 * 1000,
// duration: 1500,
// });
if (res.code === 401) {
Message({ message: res.msg, type: "error", duration: 1500 });
router.push("/login");
}
if (res.code === 400) {
Message({ message: res.msg, type: "error", duration: 1500 });
}
if (res.code === 500) {
Message({
showClose: true,
message: 服务器错误(500),
type: "error",
duration: 1500,
});
}
return Promise.reject(new Error(res.msg || "Error"));
} else {
// }
// return Promise.reject(new Error(res.msg || "Error"));
// } else {
// return res;
// }
return res;
}
},
(error) => {
Message({

@ -8,6 +8,7 @@
<el-table
:data="tableData"
style="width: 100%"
v-loading="loading"
height="calc(100% - 40px)"
>
<el-table-column prop="line" label="线路"></el-table-column>
@ -149,7 +150,7 @@ export default {
},
data() {
return {
msg: "",
loading: false,
childFlag: false,
tableData: [],
childTableDate: [],

@ -21,6 +21,7 @@
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changedate"
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
@ -32,78 +33,116 @@
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"
<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">
<div class="childTableShowBox" v-if="!echartsShow">
<el-table
:data="tableData"
style="width: 100%"
height="calc(100% - 40px)"
v-loading="loading"
height="calc(100% - 0px)"
>
<el-table-column
prop="terminalNumber"
prop="cmdid"
label="监测终端编号"
></el-table-column>
<el-table-column prop="time" label="时间"></el-table-column>
<el-table-column
prop="functionalUnitIdentifier"
label="功能单元识别码"
></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="maxPullForceKg"
prop="maxPull"
label="最大拉力(Kg)"
></el-table-column>
<el-table-column
prop="maxPullForceWindBiasAngle"
prop="maxPullWind"
label="最大拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="maxPullForceTiltAngle"
prop="maxPullTilt"
label="最大拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minPullForceKg"
prop="minPull"
label="最小拉力(Kg)"
></el-table-column>
<el-table-column
prop="minPullForceWindBiasAngle"
prop="minPullWind"
label="最小拉力时风偏角(°)"
></el-table-column>
<el-table-column
prop="minPullForceTiltAngle"
prop="minPullTilt"
label="最小拉力时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngle"
prop="maxWind"
label="最大风偏角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAngleTiltAngle"
prop="maxWindTilt"
label="最大风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="maxWindBiasAnglePullForceKg"
prop="maxWindPull"
label="最大风偏角时拉力(Kg)"
></el-table-column>
<el-table-column
prop="minWindBiasAngle"
prop="minWind"
label="最小风偏角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAngleTiltAngle"
prop="minWindTilt"
label="最小风偏角时倾斜角(°)"
></el-table-column>
<el-table-column
prop="minWindBiasAnglePullForceKg"
prop="minWindPull"
label="最小风偏角时拉力(Kg)"
></el-table-column>
</el-table>
</div>
<div class="pageNation">
<div class="pageNation" v-if="!echartsShow">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
@ -114,6 +153,20 @@
>
</el-pagination>
</div>
<div class="graphBox" v-if="echartsShow">
<div
class="codeBox"
v-for="(item, index) in codeList"
:key="index"
>
<h3>相位(标识): ({{ item }})</h3>
<div :id="'lineEchart' + index" class="lineChartBox"></div>
</div>
<div class="noDatabox" v-if="codeList.length == 0">
<img src="../../assets/img/nopic1.jpg" />
<p>暂无图表</p>
</div>
</div>
</div>
</div>
</div>
@ -122,6 +175,7 @@
</template>
<script>
import leftTree from "../../components/leftTree";
import { getDataListJoggle, funccodeJoggle } from "@/utils/api/index";
export default {
name: "icing",
components: {
@ -129,15 +183,33 @@ export default {
},
data() {
return {
msg: "",
childFlag: false,
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) {
@ -146,145 +218,381 @@ export default {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().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("电压");
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: this.page,
ps: 1000,
})
.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("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.tableData = [
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]);
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: [
{
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",
show: true,
realtime: true,
start: 0,
end: 85,
},
{
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",
type: "inside",
realtime: true,
start: 0,
end: 85,
},
],
xAxis: [
{
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",
type: "category",
boundaryGap: false,
axisLine: { onZero: false },
// prettier-ignore
data: timeXData,
},
];
} else if (data.bsManufacturer) {
this.tableData = [
],
yAxis: [
{
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",
name: "拉力(Kg)",
type: "value",
},
{
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",
name: "偏角(°)",
alignTicks: true,
type: "value",
// inverse: true
},
];
} else {
console.log("杆塔");
this.tableData = [
],
series: [
{
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",
name: "最大拉力",
type: "line",
data: result[i].map((item) => item.maxPull),
},
];
{
name: "最小拉力",
type: "line",
data: result[i].map((item) => item.minPull),
},
{
name: "最大风偏角时拉力",
type: "line",
data: result[i].map((item) => item.maxWindPull),
},
{
name: "最小风偏角时拉力",
type: "line",
data: result[i].map((item) => 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);
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
this.tableData = [];
this.getIcingData(this.paramsData);
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
this.tableData = [];
this.getIcingData(this.paramsData);
},
},
};
@ -310,6 +618,9 @@ export default {
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);
@ -325,6 +636,41 @@ export default {
height: calc(100% - 91px);
}
}
.graphBox {
margin: 0 auto;
height: calc(100% - 54px);
overflow: auto;
.codeBox {
width: 100%;
height: 400px;
h3 {
font-size: 14px;
color: #333;
margin-top: 8px;
margin-bottom: 8px;
font-weight: normal;
text-align: center;
}
.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>

@ -7,7 +7,21 @@
>新增</el-button
>
</div>
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路名称或公司名称"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</el-form>
</div>
<div class="lineTable">
<el-table
ref="multipleTable"
@ -127,10 +141,23 @@ export default {
pageSize: 20, //
total: 0, //
loading: true,
formdata: {},
formdata: {
search: "",
},
};
},
created() {},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
// console.log(this.$route.query);
// this.formdata.search = this.$route.query.lineName;
// console.log(this.formdata.search);
},
mounted() {
this.lineList();
},
@ -159,7 +186,18 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
onSubmit() {
this.page = 1;
this.lineList();
},
//
onReset() {
this.formdata = {};
this.page = 1;
this.pageSize = 20;
this.lineList();
},
//
handleAddLine() {
this.lineDialogTitle = "新增";
@ -236,6 +274,24 @@ export default {
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
.searchBox {
margin-top: 8px;
.ml10 {
margin-left: 10px;
}
.el-form {
.dybox {
.el-form-item__content {
width: 120px;
}
}
.xlbox {
.el-form-item__content {
width: 160px;
}
}
}
}
}
.lineBtnGroup {
@ -245,8 +301,8 @@ export default {
}
.lineTable {
margin-top: 16px;
height: calc(100% - 46px);
//margin-top: 16px;
height: calc(100% - 94px);
}
}
</style>

@ -241,6 +241,9 @@ export default {
new Date(this.formInfo.workingDate).getTime()
);
console.log(this.formInfo.workingDate);
if (this.formInfo.workingDate == 0) {
this.$set(this.formInfo, "workingDate", new Date().getTime());
}
},
//
changeHandle() {

@ -2,7 +2,7 @@
<div class="photoGraphicDevice">
<div class="photoBox">
<div class="photoGraphicBtnGroup">
<h4>监测终端管理</h4>
<h4>终端设备管理</h4>
<div>
<el-button
type="primary"
@ -10,9 +10,73 @@
@click="handleAddPhoto()"
>新增</el-button
>
<el-button
type="primary"
icon="el-icon-document"
@click="handleExport()"
>导出</el-button
>
</div>
</div>
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称" class="xlbox">
<el-select
v-model="formdata.lineId"
@change="getSearchgt"
filterable
>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
<el-select v-model="formdata.towerId" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="是否在线" class="isonLineClass">
<el-select v-model="formdata.isonline" filterable>
<el-option
v-for="item in onlineOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/设备编号"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</el-form>
</div>
<div class="photoGraphicTable">
<el-table
ref="multipleTable"
@ -57,13 +121,7 @@
}}</el-link>
</template>
</el-table-column>
<el-table-column
prop="equipName"
label="设备名称"
show-overflow-tooltip
min-width="150"
>
</el-table-column>
<el-table-column
prop="cmdId"
label="设备编号"
@ -97,8 +155,6 @@
>
</el-table-column>
<el-table-column prop="sim" label="SIM卡号" show-overflow-tooltip>
</el-table-column>
<el-table-column
prop="netType"
label="网络类型"
@ -142,8 +198,7 @@
{{ scope.row.status == 1 ? "运行中" : "已删除" }}
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="120">
<el-table-column label="操作">
<template slot-scope="scope">
<el-button
@click.native.stop="handleRevisePhoto(scope.row)"
@ -155,7 +210,15 @@
type="text"
class="deleteText"
@click.native.stop="handleDelete(scope.row)"
>删除</el-button
v-if="scope.row.status == 1"
>关闭</el-button
>
<el-button
type="text"
class="deleteText"
@click.native.stop="handleOpen(scope.row)"
v-if="scope.row.status == 0"
>打开</el-button
>
</template>
</el-table-column>
@ -185,22 +248,41 @@
</div>
</template>
<script>
import { getTerminalJoggle, deleteTerminalJoggle } from "@/utils/api/index";
import {
getTerminalJoggle,
deleteTerminalJoggle,
getSearchInfo,
getTerminalListExcel,
} from "@/utils/api/index";
import moment from "moment";
import addPhotoDialog from "./components/addPhotoDialog.vue";
import addLineDialog from "./components/addLineDialog.vue";
import towerDialog from "./components/towerDialog.vue";
export default {
name: "photographicDevice",
components: {
addPhotoDialog,
addLineDialog,
towerDialog,
},
data() {
return {
formdata: {},
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
onlineOptions: [
{ id: -1, name: "全部" },
{ id: 1, name: "在线" },
{ id: 0, name: "离线" },
],
formdata: {
dyId: 9,
lineId: -1,
towerId: -1,
search: "",
isonline: -1,
},
roleUser: "",
terminalTableData: [], //
photoDialog: false, //
@ -212,13 +294,36 @@ export default {
pageSize: 20, //
total: 0, //
loading: true,
gpsOptions: [
{
value: "1",
label: "GPS关闭",
},
{
value: "2",
label: "GPS开启",
},
],
gpsvalue: "1",
};
},
created() {
this.roleUser = localStorage.getItem("role");
console.log(this.roleUser);
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
console.log(this.$route.query);
this.formdata.search = this.$route.query.name;
console.log(this.formdata.search);
},
mounted() {
this.getSearchdy();
this.terminalList();
},
methods: {
@ -241,7 +346,57 @@ export default {
query: { lineName: val.lineName, name: val.towerName },
});
},
//
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = [{ id: -1, name: "全部" }];
this.dyOptions = this.dyOptions.concat(res.data.list);
this.formdata.dyId = this.dyOptions[1].id;
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyId })
.then((res) => {
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
this.formdata.lineId = this.xlOptions[0].id;
this.getSearchgt();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineId })
.then((res) => {
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
this.formdata.towerId = this.gtOptions[0].id;
})
.catch((err) => {});
},
//
onSubmit() {
this.page = 1;
this.terminalList();
},
//
onReset() {
this.formdata = {
isonline: -1,
};
this.getSearchdy();
this.page = 1;
this.pageSize = 20;
this.terminalList();
},
////
terminalList() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
@ -265,12 +420,24 @@ export default {
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
dateFormat(row, column) {
var date = row[column.property];
if (date == undefined) {
return "";
}
return moment(date).format("YYYY-MM-DD HH:mm:ss");
},
//
handleAddPhoto() {
this.photoDialogTitle = "新增";
this.$refs.addPhotoDialogref.display();
this.$refs.addPhotoDialogref.getdataform(null);
},
//
handleExport() {
window.location.href = "/api/api/getTerminalListExcel";
},
handleLine(data) {
this.$refs.addlineDialogref.display();
this.$refs.addlineDialogref.getdataform(data);
@ -286,6 +453,49 @@ export default {
this.$refs.addPhotoDialogref.getdataform(data);
console.log(data);
},
//线
handlepicture(data) {
console.log(data);
this.$refs.picturetagsref.display(data);
},
//
handleSearchCommand(command, row) {
console.log(command, row);
switch (command) {
case "info":
this.$refs.baseInfor_ref.display();
break;
case "workStatus":
this.$refs.workStatus_ref.display();
break;
case "runStatus":
this.$refs.runStatus_ref.display();
break;
case "GPS":
this.$refs.gpsSite_ref.display();
break;
default:
break;
}
},
//
handleParameterSet(data) {
this.$refs.parameterSetref.display(data);
},
// //handleAddPhoto
// handleAddPhoto() {
// this.photoDialog = true;
// this.photoDialogTitle = "";
// },
// //handleRevisePhoto
// handleRevisePhoto(data) {
// this.photoDialog = true;
// this.photoDialogTitle = "";
// this.formphotoInfo = Object.assign({}, data);
// },
//
handleDelete(data) {
console.log(data);
@ -323,7 +533,43 @@ export default {
// });
});
},
//
handleOpen(data) {
console.log(data);
this.deleteArr.push({
termid: data.id,
});
console.log(this.deleteArr);
this.$confirm("确定要打开该装置?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "success",
})
.then(() => {
//
deleteTerminalJoggle({ list: this.deleteArr, type: 1 }).then(
(res) => {
console.log(res);
this.deleteArr = [];
this.terminalList(); //
}
);
this.$message({
duration: 1500,
type: "success",
message: "打开成功!",
showClose: true,
});
})
.catch(() => {
// this.$message({
// duration: 1500,
// type: "info",
// message: "",
// showClose: true,
// });
});
},
//
handleCurrentChange(val) {
this.page = val;
@ -348,15 +594,64 @@ export default {
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
.searchBox {
.ml10 {
margin-left: 10px;
}
.el-form {
.dybox {
.el-form-item__content {
width: 120px;
}
}
.xlbox {
.el-form-item__content {
width: 160px;
}
}
.isonLineClass {
.el-form-item__content {
width: 120px;
}
}
}
}
}
.photoGraphicBtnGroup {
display: flex;
justify-content: space-between;
align-items: center;
}
.searchBox {
margin-top: 8px;
}
.photoGraphicTable {
margin-top: 16px;
height: calc(100% - 46px);
// margin-top: 16px;
//margin-top: 36px;
height: calc(100% - 94px);
}
.dropgps {
color: #169e8c;
// margin-left: 16px;
// margin-right: 16px;
cursor: pointer;
font-size: 12px;
width: 80px;
.el-input__inner {
padding: 0px;
border: none;
color: #169e8c;
font-size: 12px;
background-color: transparent;
}
}
}
.gpsdropbox {
.el-select-dropdown__item {
line-height: 27px;
padding: 0 15px;
font-size: 12px;
height: 27px;
}
}
</style>

@ -10,7 +10,55 @@
>新增</el-button
>
</div>
<div class="searchBox">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<!-- <el-form-item label="电压等级" class="dybox">
<el-select v-model="formdata.dyId" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称" class="xlbox">
<el-select
v-model="formdata.lineId"
@change="getSearchgt"
filterable
>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
<el-select v-model="formdata.towerId" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/地址"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary" @click="onReset"></el-button>
</el-form-item>
</el-form>
</div>
<div class="deviceTable">
<el-table
ref="multipleTable"
@ -128,11 +176,32 @@ export default {
pageSize: 20, //
total: 0, //
loading: true,
formdata: {},
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
formdata: {
dyId: -1,
lineId: -1,
towerId: -1,
search: "",
},
};
},
created() {},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
console.log(this.$route.query);
this.formdata.search = this.$route.query.name;
console.log(this.formdata.search);
},
mounted() {
//this.getSearchdy();
this.deviceList();
},
@ -156,7 +225,50 @@ export default {
query: { lineName: val.lineName, name: val.name },
});
},
//
// getSearchdy() {
// getSearchInfo({ type: 1 })
// .then((res) => {
// this.dyOptions = [{ id: -1, name: "" }];
// this.dyOptions = this.dyOptions.concat(res.data.list);
// this.formdata.dyId = this.dyOptions[0].id;
// this.getSearchxl();
// })
// .catch((err) => {});
// },
// //线
// getSearchxl() {
// getSearchInfo({ type: 2, id: this.formdata.dyId })
// .then((res) => {
// this.xlOptions = [{ id: -1, name: "" }];
// this.xlOptions = this.xlOptions.concat(res.data.list);
// this.formdata.lineId = this.xlOptions[0].id;
// this.getSearchgt();
// })
// .catch((err) => {});
// },
// //
// getSearchgt() {
// getSearchInfo({ type: 3, id: this.formdata.lineId })
// .then((res) => {
// this.gtOptions = [{ id: -1, name: "" }];
// this.gtOptions = this.gtOptions.concat(res.data.list);
// this.formdata.towerId = this.gtOptions[0].id;
// })
// .catch((err) => {});
// },
//
onSubmit() {
this.page = 1;
this.deviceList();
},
//
onReset() {
this.formdata = {};
this.page = 1;
this.pageSize = 20;
this.deviceList();
},
//
deviceList() {
this.loading = true;
@ -249,6 +361,24 @@ export default {
height: calc(100% - 24px);
padding: 12px;
border-radius: 4px;
.searchBox {
margin-top: 8px;
.ml10 {
margin-left: 10px;
}
.el-form {
.dybox {
.el-form-item__content {
width: 120px;
}
}
.xlbox {
.el-form-item__content {
width: 160px;
}
}
}
}
}
.deviceBtnGroup {
display: flex;
@ -256,8 +386,7 @@ export default {
align-items: center;
}
.deviceTable {
margin-top: 16px;
height: calc(100% - 46px);
height: calc(100% - 94px);
//background: #fcc;
}
}

@ -8,25 +8,89 @@
<el-table
:data="tableData"
style="width: 100%"
v-loading="loading"
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="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="rainfall" label="雨量(mm/hour)">
<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="pressure" label="气压(hPa(百帕))">
<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="sunlight" label="日照(W/m2)">
<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">
@ -58,6 +122,7 @@
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changedate"
v-model="formdata.endtime"
type="date"
placeholder="结束日期"
@ -70,13 +135,53 @@
</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="time" 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="温度(℃)"
@ -94,47 +199,47 @@
label="瞬时风向(°)"
></el-table-column>
<el-table-column
prop="rainfall"
prop="precipitation"
label="雨量(mm/hour)"
></el-table-column>
<el-table-column
prop="pressure"
prop="airPressure"
label="气压(hPa(百帕))"
></el-table-column>
<el-table-column
prop="sunlight"
prop="radiationIntensity"
label="日照(W/m2)"
></el-table-column>
<el-table-column
prop="minuteAverageWindSpeed"
prop="avgWindSpeed1Min"
label="1分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="minuteAverageWindDirection"
prop="avgWindDir1Min"
label="1分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindSpeed"
prop="avgWindSpeed10Min"
label="10分钟平均风速(m/s)"
></el-table-column>
<el-table-column
prop="tenMinuteAverageWindDirection"
prop="avgWindDir10Min"
label="10分钟平均风向(°)"
></el-table-column>
<el-table-column
prop="tenMinuteMaxWindSpeed"
prop="maxSpeed10Min"
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"
@current-change="handlechildCurrentChange"
@size-change="handlechildSizeChange"
:current-page="childpage"
:page-size="childpageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
:total="childtotal"
>
</el-pagination>
</div>
@ -146,6 +251,7 @@
</template>
<script>
import leftTree from "../../components/leftTree";
import { getDataListJoggle } from "@/utils/api/index";
export default {
name: "weather",
components: {
@ -153,7 +259,7 @@ export default {
},
data() {
return {
msg: "",
loading: false,
childFlag: false,
tableData: [],
childTableDate: [],
@ -161,6 +267,17 @@ export default {
page: 1, //
pageSize: 20, //
total: 0, //
qt: "",
id: "",
paramsData: "",
childpage: 1, //
childpageSize: 20, //
childtotal: 0, //
childParma: "",
childMsg: "",
echartsData: "", //echarts
wdFlag: true,
sdFlag: false,
};
},
created() {
@ -172,182 +289,323 @@ export default {
}
};
},
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.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.$set(this.formdata, "endtime", new Date().getTime());
//this.getWeatherData();
},
methods: {
getCurrentData(data) {
console.log("执行父组件", data);
this.paramsData = data;
console.log(data);
if (data.dyValue) {
console.log("电压");
this.msg = "公司所有数据";
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;
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",
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); //
});
},
{
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",
//
handleCurrentChange(val) {
this.page = val;
this.tableData = [];
this.getWeatherData(this.paramsData);
},
{
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",
//
handleSizeChange(val) {
this.pageSize = val;
this.tableData = [];
this.getWeatherData(this.paramsData);
},
{
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",
//
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);
},
{
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",
//
onSubmit() {
this.getchildWeatherData(this.childParma);
},
{
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²",
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: [
{
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: "无数据",
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: [
{
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: "无数据",
},
];
}
name: "湿度",
symbol: "none",
type: "line",
data: yData,
},
onSubmit() {},
//
handleCurrentChange(val) {
this.page = val;
// this.picList = [];
// this.getPicData();
],
};
this.mysDechart.setOption(option);
window.addEventListener("resize", () => {
this.mysDechart.resize();
});
});
},
//
handleSizeChange(val) {
this.pageSize = val;
//this.getPicData();
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);
},
},
};
@ -358,6 +616,7 @@ export default {
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.weatherContain {
display: flex;
height: 100%;
@ -371,8 +630,11 @@ export default {
width: 100%;
height: 100%;
flex: 1;
overflow: hidden;
overflow: auto;
border-left: 1px solid #ddd;
.el-table .el-table__cell {
text-align: center;
}
.dataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
@ -384,8 +646,53 @@ export default {
}
.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 {
height: calc(100% - 91px);
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;
}
}
}
}
}

@ -21,8 +21,9 @@ module.exports = defineConfig({
proxy: {
"/api": {
//表示拦截以/api开头的请求路径
//target: "http://47.96.238.157:8093", //阿里云服务器环境
target: "http://180.166.218.222:40080", //dell
//target: "http://180.166.218.222:40080", //覆冰项目
target: "http://180.166.218.222:9910", //覆冰项目
// target: "http://192.168.50.42:81", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {

Loading…
Cancel
Save