|
@@ -8,7 +8,7 @@
|
|
|
:value="item.value"
|
|
|
:max="item.max"
|
|
|
height="10vh"
|
|
|
-
|
|
|
+ @click="openDialog(item.dialogTitle)"
|
|
|
/>
|
|
|
</Col>
|
|
|
</Row>
|
|
@@ -19,8 +19,8 @@
|
|
|
import Col from "@/components/coms/grid/col.vue";
|
|
|
import Row from "../../../components/coms/grid/row.vue";
|
|
|
import DashPieChart from "@/components/chart/pie/dash-pie-chart.vue";
|
|
|
-import api from "@api/cockpit/matrix/index.js";
|
|
|
-
|
|
|
+import { FindGroupRealtime } from "@/api/home/home.js";
|
|
|
+import dayjs from "dayjs";
|
|
|
export default {
|
|
|
components: {
|
|
|
Row,
|
|
@@ -32,6 +32,20 @@ export default {
|
|
|
return {
|
|
|
// 功率复核数据
|
|
|
PowerLoad: [],
|
|
|
+ valuelist: [
|
|
|
+ {
|
|
|
+ value: "value1",
|
|
|
+ name: "清洁能源",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "value2",
|
|
|
+ name: "风电功率详情",
|
|
|
+ },
|
|
|
+ {
|
|
|
+ value: "value3",
|
|
|
+ name: "光伏功率详情",
|
|
|
+ },
|
|
|
+ ],
|
|
|
wpId: "",
|
|
|
};
|
|
|
},
|
|
@@ -53,95 +67,26 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- openDialog(dialogTitle, subUrl, targetName, dialogType) {
|
|
|
+ openDialog(dialogTitle) {
|
|
|
let data = {
|
|
|
- id: this.wpId,
|
|
|
- targetName,
|
|
|
+ wpId: this.wpId,
|
|
|
};
|
|
|
- api.findInfos(subUrl, data).then((res) => {
|
|
|
- let powerLineChartData = {
|
|
|
- // 图表所用单位
|
|
|
- units: [""],
|
|
|
- value: [],
|
|
|
- };
|
|
|
-
|
|
|
- res.data.forEach((pEle, pIndex) => {
|
|
|
- powerLineChartData.value.push({
|
|
|
- title: pEle[0].name,
|
|
|
- yAxisIndex: 0,
|
|
|
- smooth: true,
|
|
|
- value: [],
|
|
|
- });
|
|
|
-
|
|
|
- pEle.forEach((cEle) => {
|
|
|
- powerLineChartData.value[pIndex].value.push({
|
|
|
- text: new Date(cEle.time).formatDate("hh:mm:ss"),
|
|
|
- value: cEle.value1,
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
+ let obj = this.valuelist.find((item) => item.name == dialogTitle);
|
|
|
+ FindGroupRealtime(data).then(({ data }) => {
|
|
|
this.$emit("chartClick", {
|
|
|
dialogTitle,
|
|
|
- dialogType,
|
|
|
- data: powerLineChartData,
|
|
|
+ // dialogType,
|
|
|
+ data: data.map((item) => {
|
|
|
+ return {
|
|
|
+ dateTime: dayjs()
|
|
|
+ .startOf("date")
|
|
|
+ .add(item.hours, "hour")
|
|
|
+ .format("MM-DD HH:mm"),
|
|
|
+ value: item[obj.value],
|
|
|
+ };
|
|
|
+ }),
|
|
|
});
|
|
|
});
|
|
|
- // let that = this;
|
|
|
- // that.API.requestData({
|
|
|
- // method: "POST",
|
|
|
- // subUrl,
|
|
|
- // data: {
|
|
|
- // id: that.wpId,
|
|
|
- // targetName,
|
|
|
- // },
|
|
|
- // success(res) {
|
|
|
- // let powerLineChartData = {
|
|
|
- // // 图表所用单位
|
|
|
- // units: [""],
|
|
|
- // value: [],
|
|
|
- // };
|
|
|
-
|
|
|
- // res.data.forEach((pEle, pIndex) => {
|
|
|
- // powerLineChartData.value.push({
|
|
|
- // title: pEle[0].name,
|
|
|
- // yAxisIndex: 0,
|
|
|
- // smooth: true,
|
|
|
- // value: [],
|
|
|
- // });
|
|
|
-
|
|
|
- // pEle.forEach((cEle) => {
|
|
|
- // powerLineChartData.value[pIndex].value.push({
|
|
|
- // text: new Date(cEle.time).formatDate("hh:mm:ss"),
|
|
|
- // value: cEle.value1,
|
|
|
- // });
|
|
|
- // });
|
|
|
- // });
|
|
|
-
|
|
|
- // // let powerLineChartData = [];
|
|
|
-
|
|
|
- // // res.data.forEach((pEle, pIndex) => {
|
|
|
- // // powerLineChartData.push({
|
|
|
- // // title: pEle[0].name,
|
|
|
- // // smooth: true,
|
|
|
- // // value: [],
|
|
|
- // // });
|
|
|
-
|
|
|
- // // pEle.forEach((cEle) => {
|
|
|
- // // powerLineChartData[pIndex].value.push({
|
|
|
- // // text: new Date(cEle.time).formatDate("hh:mm:ss"),
|
|
|
- // // value: cEle.value1,
|
|
|
- // // });
|
|
|
- // // });
|
|
|
- // // });
|
|
|
-
|
|
|
- // that.$emit("chartClick", {
|
|
|
- // dialogTitle,
|
|
|
- // dialogType,
|
|
|
- // data: powerLineChartData,
|
|
|
- // });
|
|
|
- // },
|
|
|
- // });
|
|
|
},
|
|
|
},
|
|
|
|