|
@@ -1,63 +1,189 @@
|
|
|
<template>
|
|
|
- <div class="scada-monitor" style="padding:0;">
|
|
|
+ <div class="scada-monitor" style="padding: 0">
|
|
|
<div class="head-title">条件搜索</div>
|
|
|
<div>
|
|
|
<el-row>
|
|
|
- <el-select v-model="deviceType" size="small" clearable placeholder="请选择设备类型" style="float: left;width:100%;">
|
|
|
- <el-option v-for="item in deviceTypes" :key="item.ccode" :label="item.cname" :value="item.ccode" />
|
|
|
+ <el-select
|
|
|
+ v-model="deviceType"
|
|
|
+ size="small"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择设备类型"
|
|
|
+ style="float: left; width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in deviceTypes"
|
|
|
+ :key="item.ccode"
|
|
|
+ :label="item.cname"
|
|
|
+ :value="item.ccode"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
|
|
|
- <el-input v-model="querySiteName" class="helpInput" style="float: left; width:calc(100% - 46px);margin: 6px 0;" clearable size="small" placeholder="请输入设备名称">
|
|
|
+ <el-input
|
|
|
+ v-model="querySiteName"
|
|
|
+ class="helpInput"
|
|
|
+ style="float: left; width: calc(100% - 46px); margin: 6px 0"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ placeholder="请输入设备名称"
|
|
|
+ >
|
|
|
<template slot-scope="{ item }">
|
|
|
<i class="el-icon-location" />
|
|
|
<span class="name">{{ item.value }}</span>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
- <el-button style="float: left; height: 32px; margin-top: 6px; border-radius: 0px 4px 4px 0px;" type="primary" icon="el-icon-search" size="small" plain @click="querySite" />
|
|
|
+ <el-button
|
|
|
+ style="
|
|
|
+ float: left;
|
|
|
+ height: 32px;
|
|
|
+ margin-top: 6px;
|
|
|
+ border-radius: 0px 4px 4px 0px;
|
|
|
+ "
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-search"
|
|
|
+ size="small"
|
|
|
+ plain
|
|
|
+ @click="querySite"
|
|
|
+ />
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div class="head-title">监测列表</div>
|
|
|
- <el-table :data="siteDataTable" v-loading="tableLoading" height="calc(100% - 140px)" :header-cell-style="{backgroundColor:'#eaf1fd',height:'39px',textAlign:'center',fontWeight:600,color:'#333333'}" stripe style="width: 100%">
|
|
|
- <el-table-column label="序号" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- {{scope.$index+1}}
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="name" label="设备名称" align="center" show-overflow-tooltip />
|
|
|
- <el-table-column fixed="right" label="操作" width="120" align="center">
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="goto(scope.row)">查看</el-button>
|
|
|
- <el-button type="text" size="small">趋势图</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
- <el-dialog :title="siteTitle" :visible.sync="siteVisible" width="1400px" top="calc(50vh - 350px)">
|
|
|
+ <div class="head-title">监测列表
|
|
|
+ <span>
|
|
|
+ <el-checkbox-group v-model="checked" @change="change" style="display: inherit;">
|
|
|
+ <el-checkbox :key="1" :label="1" style="margin-right: 4px;">正常({{ statistic.normal }}个)</el-checkbox>
|
|
|
+ <el-checkbox :key="2" :label="2" style="margin-right: 4px;">报警({{ statistic.police }}个)</el-checkbox>
|
|
|
+ <el-checkbox :key="3" :label="3" style="margin-right: 4px;">离线({{ statistic.offLine }}个)</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ :data="siteDataTable"
|
|
|
+ v-loading="tableLoading"
|
|
|
+ height="calc(100% - 140px)"
|
|
|
+ :header-cell-style="{
|
|
|
+ backgroundColor: '#eaf1fd',
|
|
|
+ height: '39px',
|
|
|
+ textAlign: 'center',
|
|
|
+ fontWeight: 600,
|
|
|
+ color: '#333333',
|
|
|
+ }"
|
|
|
+ stripe
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-table-column label="序号" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="name"
|
|
|
+ label="设备名称"
|
|
|
+ align="center"
|
|
|
+ show-overflow-tooltip
|
|
|
+ />
|
|
|
+ <el-table-column fixed="right" label="操作" width="120" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button type="text" size="small" @click="goto(scope.row, true)">
|
|
|
+ <img
|
|
|
+ v-if="scope.row.status == '0'"
|
|
|
+ src="./images/999999.png"
|
|
|
+ alt="查看"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ v-else-if="scope.row.status == '2'"
|
|
|
+ src="./images/F65252.png"
|
|
|
+ alt="查看"
|
|
|
+ />
|
|
|
+ <img v-else src="./images/2D74E7.png" alt="查看" />
|
|
|
+ </el-button>
|
|
|
+ <el-button type="text" size="small" @click="goto(scope.row, false)">
|
|
|
+ <img src="./images/line.png" alt="趋势图" />
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <el-dialog
|
|
|
+ :title="siteTitle"
|
|
|
+ :visible.sync="siteVisible"
|
|
|
+ width="1400px"
|
|
|
+ top="calc(50vh - 350px)"
|
|
|
+ >
|
|
|
<el-row>
|
|
|
<span class="title2">指标</span>
|
|
|
- <el-select ref="siteSelect" v-model="siteType" style="display: inline-block; margin-left: 3px; margin-right: 5px; width: 150px" size="small" placeholder="请选择">
|
|
|
- <el-option v-for="item in sites" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
+ <el-select
|
|
|
+ ref="siteSelect"
|
|
|
+ v-model="siteType"
|
|
|
+ style="
|
|
|
+ display: inline-block;
|
|
|
+ margin-left: 3px;
|
|
|
+ margin-right: 5px;
|
|
|
+ width: 150px;
|
|
|
+ "
|
|
|
+ size="small"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in sites"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
</el-select>
|
|
|
<span class="title2">时间</span>
|
|
|
- <el-date-picker v-model="timss" size="small" type="daterange" align="right" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd HH:mm:ss" />
|
|
|
- <el-button size="small" type="primary" @click="showResult">查询</el-button>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="timss"
|
|
|
+ size="small"
|
|
|
+ type="daterange"
|
|
|
+ align="right"
|
|
|
+ unlink-panels
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
+ />
|
|
|
+ <el-button size="small" type="primary" @click="showResult"
|
|
|
+ >查询</el-button
|
|
|
+ >
|
|
|
<el-checkbox v-model="dontShow">去除特殊值(-9999)</el-checkbox>
|
|
|
</el-row>
|
|
|
- <div v-loading="loading" style="width:100%;height: 500px;margin-top:8px;display:flex;">
|
|
|
- <div style="width:25%;height: 100%;">
|
|
|
- <el-table v-loading="tableLoading" :data="siteHistoryDataTable" border height="calc(100% - 43px)" style="width: 100%">
|
|
|
+ <div
|
|
|
+ v-loading="loading"
|
|
|
+ style="width: 100%; height: 500px; margin-top: 8px; display: flex"
|
|
|
+ >
|
|
|
+ <div style="width: 25%; height: 100%">
|
|
|
+ <el-table
|
|
|
+ v-loading="tableLoading"
|
|
|
+ :data="siteHistoryDataTable"
|
|
|
+ border
|
|
|
+ height="calc(100% - 43px)"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
<el-table-column prop="scadaTime" label="时间" />
|
|
|
<el-table-column prop="value" label="测量值" />
|
|
|
</el-table>
|
|
|
<el-row style="margin-top: 8px">
|
|
|
<el-col :span="18">
|
|
|
- <el-pagination ref="pagination2" small background layout="total, sizes, prev, next" :page-sizes="[10, 20, 50, 100, 1000]" :total="total2" @current-change="pagRefersh" @size-change="pagRefersh" />
|
|
|
+ <el-pagination
|
|
|
+ ref="pagination2"
|
|
|
+ small
|
|
|
+ background
|
|
|
+ layout="total, sizes, prev, next"
|
|
|
+ :page-sizes="[10, 20, 50, 100, 1000]"
|
|
|
+ :total="total2"
|
|
|
+ @current-change="pagRefersh"
|
|
|
+ @size-change="pagRefersh"
|
|
|
+ />
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <span ref="pageLength2" style="font-size: 13px;" class="el-pagination__total">1/1 页</span>
|
|
|
+ <span
|
|
|
+ ref="pageLength2"
|
|
|
+ style="font-size: 13px"
|
|
|
+ class="el-pagination__total"
|
|
|
+ >1/1 页</span
|
|
|
+ >
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
- <div ref="chart" style="width:75%;height: 100%;"></div>
|
|
|
+ <div ref="chart" style="width: 75%; height: 100%"></div>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -69,10 +195,8 @@ import tfLegend from "@/views/zhpt/common/Legend";
|
|
|
import TableItem from "@/components/Table";
|
|
|
import request from "@/utils/request";
|
|
|
import Echarts from "echarts";
|
|
|
-import { TF_craft } from "./createSiteCraft";
|
|
|
-import { craftConfig } from "./craftConfig";
|
|
|
import { getSysCommonCode } from "@/api/dataCenter";
|
|
|
-import {queryScadaData} from '@/api/shiYuan/scada'
|
|
|
+import { queryScadaData } from "@/api/shiYuan/scada";
|
|
|
export default {
|
|
|
name: "ScadaMonitor",
|
|
|
components: { TableItem, tfLegend, Echarts },
|
|
@@ -101,13 +225,19 @@ export default {
|
|
|
dontShow: true,
|
|
|
resData: [],
|
|
|
deviceTypes: [],
|
|
|
- deviceType: ""
|
|
|
+ deviceType: "",
|
|
|
+ checked: [1, 2, 3],
|
|
|
+ statistic:{
|
|
|
+ normal:0,
|
|
|
+ police:0,
|
|
|
+ offLine:0
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
sidePanelOn() {
|
|
|
return this.$store.state.map.P_editableTabsValue;
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
sidePanelOn(newTab, oldTab) {
|
|
@@ -133,41 +263,30 @@ export default {
|
|
|
}
|
|
|
if (this.timeOut) window.clearTimeout(this.timeOut);
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
created() {
|
|
|
- getSysCommonCode({ pCid: "53400" }).then(res => {
|
|
|
+ getSysCommonCode({ pCid: "53400" }).then((res) => {
|
|
|
this.deviceTypes = res.result[0].codeList;
|
|
|
});
|
|
|
- // queryWaterWorks({}).then(res => {
|
|
|
- // if (res.code !== 1) {
|
|
|
- // this.$message.error('获取水厂信息出错!')
|
|
|
- // return
|
|
|
- // }
|
|
|
- // this.waterList = res.result.records
|
|
|
- // })
|
|
|
},
|
|
|
mounted() {
|
|
|
- // var view = (this.mapView = this.data.mapView);
|
|
|
- // this.floatDiv = view.TF_floatPanel;
|
|
|
- // this.divs = [];
|
|
|
- // this.ids = [];
|
|
|
- // this.siteIndex = {};
|
|
|
- // view.map.add((this.layer = new view.TF_graphicsLayer()));
|
|
|
this.querySite();
|
|
|
},
|
|
|
destroyed() {
|
|
|
this.clearSiteDiv();
|
|
|
- // var view = this.mapView;
|
|
|
- // view.map.remove(this.layer);
|
|
|
},
|
|
|
methods: {
|
|
|
+ change(value){
|
|
|
+ let s = this.checked
|
|
|
+ debugger
|
|
|
+ },
|
|
|
addWatch() {
|
|
|
var view = this.mapView;
|
|
|
var divs = this.divs;
|
|
|
if (this.watch) return;
|
|
|
var ceil = Math.ceil;
|
|
|
- var change = e => {
|
|
|
+ var change = (e) => {
|
|
|
var { xmin, xmax, ymin, ymax } = e;
|
|
|
var center = e.center;
|
|
|
var cx = center.x;
|
|
@@ -193,37 +312,33 @@ export default {
|
|
|
change(view.extent);
|
|
|
},
|
|
|
querySite() {
|
|
|
- // var pages = this.$refs.pagination;
|
|
|
- // const data = { name: this.querySiteName };
|
|
|
this.tableLoading = true;
|
|
|
- // if (this.deviceType != "")
|
|
|
- // Object.assign(data, { deviceType: this.deviceType });
|
|
|
- queryScadaData().then(res => {
|
|
|
- var sites = [];
|
|
|
- // pages.internalCurrentPage = 1;
|
|
|
- if (res.code == 1) {
|
|
|
- res = res.result.filter(item => {
|
|
|
+ let param = {};
|
|
|
+ if (this.deviceType != "")
|
|
|
+ Object.assign(param, { deviceType: this.deviceType });
|
|
|
+ if (this.querySiteName != "")
|
|
|
+ Object.assign(param, { name: this.querySiteName });
|
|
|
+ queryScadaData(param).then((res) => {
|
|
|
+ if (res.code == 1 && res.result != null) {
|
|
|
+ res = res.result.filter((item) => {
|
|
|
return item.allocations;
|
|
|
});
|
|
|
- // this.resData = res; // 保存所有站点数据,用于分页时调用
|
|
|
this.siteDataTable = res; // 保存所有站点数据,用于分页时调用
|
|
|
- // this.total = res.length;
|
|
|
- // for (var i = 0, ii = res.length; i < ii; i++) {
|
|
|
- // var site = res[i];
|
|
|
- // sites.push({
|
|
|
- // id: site.id,
|
|
|
- // site: site.name,
|
|
|
- // x: site.longitude,
|
|
|
- // y: site.latitude,
|
|
|
- // isCraft: false
|
|
|
- // }); // site.iscraft == '1' })
|
|
|
- // }
|
|
|
+ this.statisticStatus();
|
|
|
+ } else {
|
|
|
+ this.siteDataTable = [];
|
|
|
}
|
|
|
- // this.siteData = sites;
|
|
|
- // this.listRefersh(res);
|
|
|
this.tableLoading = false;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 统计状态数据
|
|
|
+ */
|
|
|
+ statisticStatus() {
|
|
|
+ //this.siteDataTable
|
|
|
+ },
|
|
|
+
|
|
|
listRefersh(res) {
|
|
|
this.clearSiteDiv();
|
|
|
var pages = this.$refs.pagination;
|
|
@@ -256,7 +371,7 @@ export default {
|
|
|
ymin: Infinity,
|
|
|
xmax: -Infinity,
|
|
|
ymax: -Infinity,
|
|
|
- spatialReference: sp
|
|
|
+ spatialReference: sp,
|
|
|
};
|
|
|
|
|
|
for (var i = 0, ii = sites.length; i < ii; i++) {
|
|
@@ -282,8 +397,8 @@ export default {
|
|
|
height: "40px",
|
|
|
yoffset: "7px",
|
|
|
xoffset: "6px",
|
|
|
- type: "picture-marker"
|
|
|
- }
|
|
|
+ type: "picture-marker",
|
|
|
+ },
|
|
|
})
|
|
|
);
|
|
|
index[id] = { div, children: [] };
|
|
@@ -298,24 +413,17 @@ export default {
|
|
|
view.center = {
|
|
|
x: extent.xmin,
|
|
|
y: extent.ymin,
|
|
|
- spatialReference: sp
|
|
|
+ spatialReference: sp,
|
|
|
};
|
|
|
} else {
|
|
|
view.extent = extent;
|
|
|
- window.requestAnimationFrame(_ => view.zoom--);
|
|
|
+ window.requestAnimationFrame((_) => view.zoom--);
|
|
|
}
|
|
|
}
|
|
|
layer.addMany(feas);
|
|
|
this.addWatch();
|
|
|
- window.requestAnimationFrame(_ => {
|
|
|
- // request({ url: '/gis/scadaAbout/selectIndex?ids=' + ids.join(','), method: 'get' }).then(res => {
|
|
|
- // if (res.code == 1) {
|
|
|
+ window.requestAnimationFrame((_) => {
|
|
|
this.addAttribute(res);
|
|
|
- // } else {
|
|
|
- // this.$message.error('获取测站指标失败!' + res.message)
|
|
|
- // console.log(res)
|
|
|
- // }
|
|
|
- // })
|
|
|
});
|
|
|
},
|
|
|
clearSiteDiv() {
|
|
@@ -343,7 +451,7 @@ export default {
|
|
|
var di = index[dr.id];
|
|
|
var div = document.createElement("div");
|
|
|
div.setAttribute("data", t);
|
|
|
- div.onclick = function(e) {
|
|
|
+ div.onclick = function (e) {
|
|
|
this.getSiteHistroty(e);
|
|
|
}.bind(this);
|
|
|
div.innerHTML =
|
|
@@ -360,10 +468,10 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- window.requestAnimationFrame(_ => this.loadRealTimeSiteValue());
|
|
|
+ window.requestAnimationFrame((_) => this.loadRealTimeSiteValue());
|
|
|
|
|
|
function compare(key) {
|
|
|
- return function(value1, value2) {
|
|
|
+ return function (value1, value2) {
|
|
|
var val1 = value1[key];
|
|
|
var val2 = value2[key];
|
|
|
return val1 - val2;
|
|
@@ -377,10 +485,10 @@ export default {
|
|
|
request({
|
|
|
url: "/tofly-scada/scada/app/data",
|
|
|
method: "post",
|
|
|
- data: data
|
|
|
- }).then(res => {
|
|
|
+ data: data,
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
- res = res.result.filter(item => {
|
|
|
+ res = res.result.filter((item) => {
|
|
|
return item.allocations;
|
|
|
});
|
|
|
setValue(res);
|
|
@@ -389,7 +497,7 @@ export default {
|
|
|
console.log(res);
|
|
|
}
|
|
|
});
|
|
|
- var setValue = res => {
|
|
|
+ var setValue = (res) => {
|
|
|
var index = this.siteIndex;
|
|
|
for (var item in res) {
|
|
|
if (!index.hasOwnProperty(res[item].id)) continue;
|
|
@@ -410,23 +518,14 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
this.timeOut = window.setTimeout(
|
|
|
- _ => this.loadRealTimeSiteValue(),
|
|
|
+ (_) => this.loadRealTimeSiteValue(),
|
|
|
1000 * 60 * 1
|
|
|
);
|
|
|
};
|
|
|
},
|
|
|
- goto(row) {
|
|
|
- if (row.x) {
|
|
|
- var mapView = this.mapView;
|
|
|
- mapView.center = {
|
|
|
- x: row.x,
|
|
|
- y: row.y,
|
|
|
- spatialReference: mapView.spatialReference
|
|
|
- };
|
|
|
- mapView.zoom = 5;
|
|
|
- } else {
|
|
|
- this.$message("此测站无坐标信息");
|
|
|
- }
|
|
|
+
|
|
|
+ goto(row, type) {
|
|
|
+ this.$emit("selectChange", row, type);
|
|
|
},
|
|
|
getSiteHistroty(e) {
|
|
|
var div = e.currentTarget;
|
|
@@ -443,18 +542,18 @@ export default {
|
|
|
[date1.getFullYear(), date1.getMonth() + 1, date1.getDate()].join("-") +
|
|
|
" 00:00:00",
|
|
|
[date.getFullYear(), date.getMonth() + 1, date.getDate()].join("-") +
|
|
|
- " 00:00:00"
|
|
|
+ " 00:00:00",
|
|
|
];
|
|
|
request({
|
|
|
url: "/tofly-scada/scada/app/data",
|
|
|
method: "post",
|
|
|
- data: { deviceId: stid }
|
|
|
- }).then(res => {
|
|
|
+ data: { deviceId: stid },
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
res = res.result[0];
|
|
|
this.selectSite = res;
|
|
|
var index = (this.selectZBXIndex = {});
|
|
|
- this.sites = res.allocations.map(e => {
|
|
|
+ this.sites = res.allocations.map((e) => {
|
|
|
index[e.variableCode] = [e.displayName, e.unit];
|
|
|
return { value: e.variableCode, label: e.displayName };
|
|
|
});
|
|
@@ -481,16 +580,10 @@ export default {
|
|
|
this.timss[1] +
|
|
|
"&size=" +
|
|
|
10000,
|
|
|
- // '&statisticsType=' + 0,
|
|
|
- method: "get"
|
|
|
- }).then(res => {
|
|
|
+ method: "get",
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
res = res.result.records;
|
|
|
- // this.sites = res.map(e => {
|
|
|
- // index[e.id] = [e.itnm, e.unit]
|
|
|
- // return { value: e.id, label: e.itnm }
|
|
|
- // })
|
|
|
- // this.siteType = zbx || this.sites[0].value
|
|
|
this.chart = Echarts.init(this.$refs.chart);
|
|
|
idDone();
|
|
|
} else {
|
|
@@ -505,6 +598,7 @@ export default {
|
|
|
if (++done == 1) this.showResult();
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
getAllData() {
|
|
|
var stid = this.selectSite.id;
|
|
|
var datt = this.selectZBXIndex[this.siteType];
|
|
@@ -521,8 +615,8 @@ export default {
|
|
|
"&size=" +
|
|
|
10000,
|
|
|
// '&statisticsType=' + 1,
|
|
|
- method: "get"
|
|
|
- }).then(res => {
|
|
|
+ method: "get",
|
|
|
+ }).then((res) => {
|
|
|
var chart = this.chart;
|
|
|
chart.clear();
|
|
|
if (res.code == 1) {
|
|
@@ -543,30 +637,17 @@ export default {
|
|
|
var x = res[i].scadaTime.split(" ")[0];
|
|
|
dataX.push(x);
|
|
|
dataY.push(v);
|
|
|
- // if (v < min) min = v
|
|
|
- // if (v > max) max = v
|
|
|
- // if (x < Xmin) Xmin = x
|
|
|
- // if (x > Xmax) Xmax = x
|
|
|
}
|
|
|
- // if (ii <= 1) symbol = Xmin = Xmax = max = min = undefined
|
|
|
- // else d = max - min, [max, min] = [max + d * 0.2, min - d * 0.2].map(e => parseFloat(e).toFixed(2))
|
|
|
var [type, unit] = datt;
|
|
|
|
|
|
chart.setOption({
|
|
|
title: {
|
|
|
text: type,
|
|
|
left: "center",
|
|
|
- subtext: times[0] + "至" + times[1]
|
|
|
+ subtext: times[0] + "至" + times[1],
|
|
|
},
|
|
|
color: "rgb(45, 116, 231)",
|
|
|
grid: { left: "50px", right: "50px", bottom: "80px" },
|
|
|
- // dataZoom: [{ minSpan: 1, type: 'slider', labelFormatter: (i) => {
|
|
|
- // var date = new Date(i)
|
|
|
- // var time = [date.getHours(), date.getMinutes()]
|
|
|
- // if (time[0] < 10) time[0] = '0' + time[0]
|
|
|
- // if (time[1] < 10) time[1] = '0' + time[1]
|
|
|
- // return [date.getFullYear(), date.getMonth() + 1, date.getDate()].join('-') + '\n' + time.join(':')
|
|
|
- // } }],
|
|
|
toolbox: { feature: { saveAsImage: {} } },
|
|
|
tooltip: {
|
|
|
trigger: "axis",
|
|
@@ -581,7 +662,7 @@ export default {
|
|
|
" " +
|
|
|
unit
|
|
|
);
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
xAxis: [
|
|
|
{
|
|
@@ -589,15 +670,15 @@ export default {
|
|
|
type: "category",
|
|
|
data: dataX,
|
|
|
axisTick: {
|
|
|
- show: false
|
|
|
+ show: false,
|
|
|
},
|
|
|
axisLine: {
|
|
|
- show: false
|
|
|
- }
|
|
|
- }
|
|
|
+ show: false,
|
|
|
+ },
|
|
|
+ },
|
|
|
],
|
|
|
yAxis: [{ name: unit, type: "value" }],
|
|
|
- series: [{ type: "line", symbol, smooth: true, data: dataY }]
|
|
|
+ series: [{ type: "line", symbol, smooth: true, data: dataY }],
|
|
|
});
|
|
|
} else {
|
|
|
this.$message.error("获取指标历史失败!" + res.message);
|
|
@@ -606,6 +687,7 @@ export default {
|
|
|
this.loading = false;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
showResult() {
|
|
|
if (!this.timss) return this.$message.error("请选择时间范围");
|
|
|
this.loading = true;
|
|
@@ -613,10 +695,11 @@ export default {
|
|
|
this.getAllData();
|
|
|
this.siteHistiryQuery = [
|
|
|
this.selectZBXIndex[this.siteType][0],
|
|
|
- this.timss
|
|
|
+ this.timss,
|
|
|
];
|
|
|
this.pagRefersh();
|
|
|
},
|
|
|
+
|
|
|
pagRefersh() {
|
|
|
this.tableLoading = true;
|
|
|
var pages = this.$refs.pagination2;
|
|
@@ -635,8 +718,8 @@ export default {
|
|
|
pages.internalCurrentPage +
|
|
|
"&size=" +
|
|
|
pages.internalPageSize,
|
|
|
- method: "get"
|
|
|
- }).then(res => {
|
|
|
+ method: "get",
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 1) {
|
|
|
res = res.result;
|
|
|
this.siteHistoryDataTable = res.records;
|
|
@@ -653,30 +736,12 @@ export default {
|
|
|
this.tableLoading = false;
|
|
|
});
|
|
|
},
|
|
|
- watchCraft(row) {
|
|
|
- var config = craftConfig[row.id];
|
|
|
- if (config) {
|
|
|
- this.craftVisible = true;
|
|
|
- var image = new Image();
|
|
|
- var modulesFiles = require.context("./images", true, /\.png$/);
|
|
|
- image.src = modulesFiles("./" + config.craftImage);
|
|
|
- image.onload = () => {
|
|
|
- var craft = TF_craft({
|
|
|
- div: this.$refs.craft,
|
|
|
- image: image,
|
|
|
- config: config.config,
|
|
|
- id: row.id
|
|
|
- });
|
|
|
- this.craftRealTime(row.id, craft.index);
|
|
|
- craft.divs.map(e => (e.onclick = this.getSiteHistroty));
|
|
|
- };
|
|
|
- } else this.$message.error("工艺图未配置");
|
|
|
- },
|
|
|
+
|
|
|
craftRealTime(id, index) {
|
|
|
request({
|
|
|
url: "/gis/customDisplay/getSiteInfos?stids=" + id,
|
|
|
- method: "post"
|
|
|
- }).then(res => {
|
|
|
+ method: "post",
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 1 && (res = res.result[id])) {
|
|
|
for (var item in res) {
|
|
|
if (!index.hasOwnProperty(item)) continue;
|
|
@@ -693,12 +758,12 @@ export default {
|
|
|
},
|
|
|
craftClose() {
|
|
|
if (this.craftTimeOut) window.clearTimeout(this.craftTimeOut);
|
|
|
- }
|
|
|
- }
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.scada-monitor{
|
|
|
+.scada-monitor {
|
|
|
height: 100%;
|
|
|
}
|
|
|
.head-title {
|