|
@@ -54,9 +54,9 @@
|
|
|
popper-class="search-select"
|
|
|
:options="cascaderOptions"
|
|
|
:props="cascaderProps"
|
|
|
- @change="getCascaderChange"
|
|
|
+ v-model="cascaderSel"
|
|
|
collapse-tags
|
|
|
- clearable
|
|
|
+ :clearable="true"
|
|
|
></el-cascader>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -69,10 +69,9 @@
|
|
|
<panel-3 class="table-panel">
|
|
|
<table-3 :data="tableData" :height="'85vh'">
|
|
|
<template v-for="(item, i) in column" :key="i" #[item]="scope">
|
|
|
- <div class="bar">
|
|
|
+ <div class="bar" @click="showChart(scope)">
|
|
|
<div
|
|
|
class="bar-percent"
|
|
|
- @click="showChart(scope)"
|
|
|
:style="{
|
|
|
width:
|
|
|
(scope.data.count &&
|
|
@@ -85,10 +84,9 @@
|
|
|
>{{ scope.data.count && scope.data.count }} 次数</span
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="bar">
|
|
|
+ <div class="bar" @click="showChart(scope)">
|
|
|
<div
|
|
|
class="bar-percent"
|
|
|
- @click="showChart(scope)"
|
|
|
:style="{
|
|
|
width:
|
|
|
(scope.data.count &&
|
|
@@ -113,8 +111,13 @@
|
|
|
:close-on-click-modal="false"
|
|
|
>
|
|
|
<div class="searchForm">
|
|
|
+ <div class="choose">
|
|
|
+ <button class="btn green">等间隔</button>
|
|
|
+ <!-- <button :class="chooseStatus?'btn green':'btn'" @click="switchChange(1,'original')">原始数据</button> -->
|
|
|
+ </div>
|
|
|
<el-select
|
|
|
- @change="searchTime(selectValue)"
|
|
|
+ v-if="!chooseStatus"
|
|
|
+ @change="switchChange(selectValue)"
|
|
|
class="inputs"
|
|
|
v-model="selectValue"
|
|
|
placeholder="请选择"
|
|
@@ -127,12 +130,7 @@
|
|
|
>
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
- <div class="choose">
|
|
|
- <button class="btn" @click="switchChange(60)">等间隔</button>
|
|
|
- <button class="btn" @click="switchChange(0)">原始数据</button>
|
|
|
- </div>
|
|
|
</div>
|
|
|
-
|
|
|
<multiple-y-line-chart-normal
|
|
|
height="500px"
|
|
|
:list="Analysis"
|
|
@@ -147,13 +145,14 @@
|
|
|
import Panel3 from "../../components/coms/panel/panel3.vue";
|
|
|
import Table3 from "../../components/coms/table/table3.vue";
|
|
|
import MultipleYLineChartNormal from "./multiple-y-line-chart-normal.vue";
|
|
|
+import BASE from '@tools/basicTool.js';
|
|
|
export default {
|
|
|
components: { Panel3, Table3, MultipleYLineChartNormal },
|
|
|
data() {
|
|
|
return {
|
|
|
dialogTitle: "",
|
|
|
+ chooseStatus: false,
|
|
|
dialogVisible: false,
|
|
|
- switchFlag: false,
|
|
|
chooseTime: [],
|
|
|
wpvalue: "",
|
|
|
wpid: "",
|
|
@@ -302,23 +301,19 @@ export default {
|
|
|
that.dialogTitle = column.column.name;
|
|
|
that.wtId = column.row.name;
|
|
|
that.descName = column.column.name;
|
|
|
- // console.log('column:',column)
|
|
|
- // console.log('name:',column.column.name)
|
|
|
- // console.log('wtid:',column.row.name)
|
|
|
- // console.log('starttime:',new Date(that.startdate).getTime())
|
|
|
- // console.log('endtime:',new Date(that.enddate).getTime())
|
|
|
- that.dialogVisible = true;
|
|
|
+
|
|
|
that.requestDetailData(
|
|
|
that.wpvalue,
|
|
|
that.startdate,
|
|
|
that.enddate,
|
|
|
- 0,
|
|
|
+ 60,
|
|
|
column.row.name,
|
|
|
column.column.name
|
|
|
);
|
|
|
},
|
|
|
requestDetailData(station, startTs, endTs, interval, wtId, name) {
|
|
|
let that = this;
|
|
|
+ BASE.showLoading();
|
|
|
that.API.requestData({
|
|
|
method: "GET",
|
|
|
subUrl: "/analysis/detail",
|
|
@@ -331,16 +326,16 @@ export default {
|
|
|
// wtId: column.row.name,
|
|
|
// name: column.column.name,
|
|
|
station: station,
|
|
|
- startTs: new Date(startTs).getTime(),
|
|
|
- endTs: new Date(endTs).getTime(),
|
|
|
+ startTs: new Date(new Date(startTs).formatDate("yyyy/MM/dd")).getTime(),
|
|
|
+ endTs: new Date(new Date(endTs).formatDate("yyyy/MM/dd")).getTime(),
|
|
|
interval: interval,
|
|
|
wtId: wtId,
|
|
|
name: name,
|
|
|
},
|
|
|
success(res) {
|
|
|
- console.log("resAnalysis:", res);
|
|
|
- let anKey = ["doubleValue"];
|
|
|
if (res.data.length == 1) {
|
|
|
+ that.dialogVisible = true;
|
|
|
+ BASE.closeLoading();
|
|
|
let yaxises = [
|
|
|
{
|
|
|
name: "",
|
|
@@ -353,7 +348,6 @@ export default {
|
|
|
// yaxises.name = res.data[0].name;
|
|
|
yaxises.unit = res.data[0].unit;
|
|
|
that.AnalysisYAxises = yaxises;
|
|
|
- console.log("AnalysisYAxises:", that.AnalysisYAxises);
|
|
|
let aKey1 = ["doubleValue"];
|
|
|
let aList1 = [
|
|
|
{
|
|
@@ -364,7 +358,6 @@ export default {
|
|
|
},
|
|
|
];
|
|
|
aKey1.forEach((keyEle, keyIndex) => {
|
|
|
- // console.log('keyindex:',res.data[keyIndex]);
|
|
|
aList1[keyIndex].title = res.data[keyIndex].name;
|
|
|
res.data[keyIndex].data.forEach((rEle) => {
|
|
|
aList1[keyIndex].value.push({
|
|
@@ -373,21 +366,10 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
- // aKey1.forEach((keyEle, keyIndex) => {
|
|
|
- // res.data.forEach((rEle) => {
|
|
|
- // rEle.data.forEach((tEle) => {
|
|
|
- // alist1[keyIndex].yAxisIndex = keyIndex;
|
|
|
- // aList1[keyIndex].title = res.data[0].name;
|
|
|
- // aList1[keyIndex].value.push({
|
|
|
- // text: new Date(tEle.ts).formatDate("hh:mm"),
|
|
|
- // value: tEle[keyEle],
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
that.Analysis = aList1;
|
|
|
- console.log("that.Analysis1:", that.Analysis);
|
|
|
} else if (res.data.length == 2) {
|
|
|
+ that.dialogVisible = true;
|
|
|
+ BASE.closeLoading();
|
|
|
let aKey2 = ["doubleValue", "doubleValue"];
|
|
|
let aList2 = [
|
|
|
{
|
|
@@ -421,16 +403,12 @@ export default {
|
|
|
];
|
|
|
yaxises1.forEach((aEle, aIndex) => {
|
|
|
res.data.forEach((rEle) => {
|
|
|
- // console.log('rEleName:',rEle.name)
|
|
|
- // console.log('rEle.unit:',rEle.unit)
|
|
|
// aEle.name = rEle.name;
|
|
|
aEle.unit = rEle.unit;
|
|
|
});
|
|
|
});
|
|
|
that.AnalysisYAxises = yaxises1;
|
|
|
- console.log("AnalysisYAxises:", that.AnalysisYAxises);
|
|
|
aKey2.forEach((keyEle, keyIndex) => {
|
|
|
- // console.log('keyindex:',res.data[keyIndex]);
|
|
|
aList2[keyIndex].title = res.data[keyIndex].name;
|
|
|
res.data[keyIndex].data.forEach((rEle) => {
|
|
|
aList2[keyIndex].value.push({
|
|
@@ -440,14 +418,12 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
// res.data.forEach((rEle,rIndex)=>{
|
|
|
- // console.log('rele:',rEle)
|
|
|
// })
|
|
|
// aKey2.forEach((keyEle, keyIndex) => {
|
|
|
// res.data.forEach((rEle) => {
|
|
|
// // alist2[keyIndex].yAxisIndex = keyIndex;
|
|
|
// aList2[keyIndex].title = res.data[keyIndex].name;
|
|
|
// rEle.data.forEach((tEle,tIndex) => {
|
|
|
- // console.log('res.data[keyIndex].data[tIndex].doubleValue2:',res.data)
|
|
|
// aList2[keyIndex].value.push({
|
|
|
// text: new Date(tEle.ts).formatDate("hh:mm"),
|
|
|
// // value: tEle[keyEle],
|
|
@@ -459,8 +435,9 @@ export default {
|
|
|
// });
|
|
|
|
|
|
that.Analysis = aList2;
|
|
|
- console.log("that.Analysis2:", that.Analysis);
|
|
|
} else if (res.data.length == 4) {
|
|
|
+ that.dialogVisible = true;
|
|
|
+ BASE.closeLoading();
|
|
|
let aKey4 = [
|
|
|
"doubleValue",
|
|
|
"doubleValue",
|
|
@@ -511,16 +488,12 @@ export default {
|
|
|
];
|
|
|
yaxises2.forEach((aEle, aIndex) => {
|
|
|
res.data.forEach((rEle) => {
|
|
|
- // console.log('rEleName:',rEle.name)
|
|
|
- // console.log('rEle.unit:',rEle.unit)
|
|
|
// aEle.name = rEle.name;
|
|
|
aEle.unit = rEle.unit;
|
|
|
});
|
|
|
});
|
|
|
that.AnalysisYAxises = yaxises2;
|
|
|
- console.log("AnalysisYAxises:", that.AnalysisYAxises);
|
|
|
aKey4.forEach((keyEle, keyIndex) => {
|
|
|
- // console.log('keyindex:',res.data[keyIndex]);
|
|
|
aList4[keyIndex].title = res.data[keyIndex].name;
|
|
|
res.data[keyIndex].data.forEach((rEle) => {
|
|
|
aList4[keyIndex].value.push({
|
|
@@ -529,24 +502,10 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
- // aKey4.forEach((keyEle, keyIndex) => {
|
|
|
- // res.data.forEach((rEle) => {
|
|
|
- // // aList4[keyIndex].yAxisIndex = keyIndex;
|
|
|
- // aList4[keyIndex].title = res.data[keyIndex].name;
|
|
|
- // rEle.data.forEach((tEle,tIndex) => {
|
|
|
- // console.log('res.data[keyIndex].data[tIndex].doubleValue4:',res.data)
|
|
|
- // aList4[keyIndex].value.push({
|
|
|
- // text: new Date(tEle.ts).formatDate("hh:mm"),
|
|
|
- // // value: tEle[keyEle],
|
|
|
- // // value:res.data[keyIndex].data[tIndex].doubleValue
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
that.Analysis = aList4;
|
|
|
- console.log("that.Analysis4:", that.Analysis);
|
|
|
} else if (res.data.length == 0) {
|
|
|
that.dialogVisible = false;
|
|
|
+ BASE.closeLoading();
|
|
|
that.BASE.showMsg({
|
|
|
type: "warning",
|
|
|
msg: "暂无数据",
|
|
@@ -555,79 +514,23 @@ export default {
|
|
|
},
|
|
|
});
|
|
|
},
|
|
|
- getCascaderChange(res) {
|
|
|
- this.cascaderSel=res || [];
|
|
|
- },
|
|
|
//切换数据类型
|
|
|
- switchChange(interval) {
|
|
|
- if (interval == 0) {
|
|
|
- this.requestDetailData(
|
|
|
- this.wpvalue,
|
|
|
- this.startdate,
|
|
|
- this.enddate,
|
|
|
- 0,
|
|
|
- this.wtId,
|
|
|
- this.descName
|
|
|
- );
|
|
|
- } else if (interval == 60) {
|
|
|
- this.requestDetailData(
|
|
|
+ switchChange(interval,status) {
|
|
|
+ if(status === 'interval') {
|
|
|
+ this.chooseStatus = false
|
|
|
+ this.selectValue = '60'
|
|
|
+ }else if(status === 'original'){
|
|
|
+ this.chooseStatus = true
|
|
|
+ }
|
|
|
+ this.requestDetailData(
|
|
|
this.wpvalue,
|
|
|
this.startdate,
|
|
|
this.enddate,
|
|
|
- 60,
|
|
|
+ interval,
|
|
|
this.wtId,
|
|
|
this.descName
|
|
|
);
|
|
|
- }
|
|
|
- // this.switchFlag = !this.switchFlag;
|
|
|
- // this.selectValue = "60";
|
|
|
- // this.searchTime();
|
|
|
- // const loading = this.$loading({
|
|
|
- // lock: true,
|
|
|
- // text: "数据加载中",
|
|
|
- // spinner: "el-icon-loading",
|
|
|
- // background: "rgba(0, 0, 0, 0.7)",
|
|
|
- // });
|
|
|
- // setTimeout(() => {
|
|
|
- // loading.close();
|
|
|
- // }, 1000);
|
|
|
- },
|
|
|
- searchTime(values) {
|
|
|
- console.log("values:", values);
|
|
|
- this.requestDetailData(
|
|
|
- this.wpvalue,
|
|
|
- this.startdate,
|
|
|
- this.enddate,
|
|
|
- values,
|
|
|
- this.wtId,
|
|
|
- this.descName
|
|
|
- );
|
|
|
- // let times = [];
|
|
|
- // this.chooseTime.forEach((item) => {
|
|
|
- // times.push(dayjs(item).valueOf());
|
|
|
- // });
|
|
|
- // times.length > 0
|
|
|
- // ? this.switchFlag
|
|
|
- // ? this.$emit("original-data", times)
|
|
|
- // : this.$emit("search-data", times, Number(this.selectValue))
|
|
|
- // : this.$message({
|
|
|
- // showClose: true,
|
|
|
- // message: "请选择查询日期",
|
|
|
- // center: true,
|
|
|
- // type: "error",
|
|
|
- // });
|
|
|
- // if (values) {
|
|
|
- // this.$message({
|
|
|
- // showClose: true,
|
|
|
- // center: true,
|
|
|
- // message: '下载中'
|
|
|
- // });
|
|
|
- // setTimeout(() => {
|
|
|
- // this.export()
|
|
|
- // }, 2000)
|
|
|
- // }
|
|
|
},
|
|
|
- tabSelect(tab) {},
|
|
|
|
|
|
async search() {
|
|
|
const { data } = await this.API.requestData({
|
|
@@ -677,7 +580,6 @@ export default {
|
|
|
});
|
|
|
////////
|
|
|
const resData = data.data;
|
|
|
- // console.log("resData:", resData);
|
|
|
// const resData =this.resdata;
|
|
|
const column = this.columnObj;
|
|
|
let dataAll = []; // 总数据集合
|
|
@@ -701,11 +603,8 @@ export default {
|
|
|
});
|
|
|
dataAll.push(obj);
|
|
|
});
|
|
|
- // console.log('wpid:',this.wpid)
|
|
|
this.tableData.column = column;
|
|
|
- // console.log('column:',column)
|
|
|
this.tableData.data = dataAll;
|
|
|
- // console.log('dataAll:',dataAll)
|
|
|
///////////////////// 获取规则list
|
|
|
const map = {};
|
|
|
var windNum = [];
|
|
@@ -764,7 +663,6 @@ export default {
|
|
|
root[f].fobj = fobj;
|
|
|
}
|
|
|
}
|
|
|
- // console.log("cascaderOptions:", cascaderOptions);
|
|
|
this.cascaderOptions = cascaderOptions;
|
|
|
},
|
|
|
},
|
|
@@ -802,6 +700,7 @@ export default {
|
|
|
.searchForm {
|
|
|
display: flex;
|
|
|
margin-left: 36px;
|
|
|
+ flex-direction: row-reverse;
|
|
|
.inputs {
|
|
|
width: 15%;
|
|
|
margin-right: 18px;
|