|
@@ -1,9 +1,64 @@
|
|
|
<template>
|
|
|
<div class="station">
|
|
|
<div class="btns">
|
|
|
- <button class="btn green">保存</button>
|
|
|
+ <!-- <button class="btn green">保存</button> -->
|
|
|
<button class="btn green" @click="back">返回</button>
|
|
|
- <button class="btn green">表底</button>
|
|
|
+ <button class="btn green" @click="backForm">表底</button>
|
|
|
+ </div>
|
|
|
+ <div class="table-D">
|
|
|
+ <!-- 表格 -->
|
|
|
+ <el-table
|
|
|
+ :data="tableData"
|
|
|
+ style="width: 100%; overflow-y: auto;min-width='80vh';"
|
|
|
+ :cell-style="addClass"
|
|
|
+ max-height="80vh"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="(i, index) in tableClu.slice(0, 2)"
|
|
|
+ :key="index"
|
|
|
+ :prop="i"
|
|
|
+ :label="i"
|
|
|
+ width="240"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ {{ scope.row[i] }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ v-for="(k, index) in tableCluObj"
|
|
|
+ :key="index"
|
|
|
+ :label="k.split('_')[0]"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ v-for="i in tableClu.slice(2 + index * 2, 4 + index * 2)"
|
|
|
+ :key="i"
|
|
|
+ :prop="i"
|
|
|
+ label="当日值"
|
|
|
+
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <!-- <el-input
|
|
|
+ v-if="tableString.indexOf(i) != -1"
|
|
|
+ :disabled="scope.row['是否可编辑'] == 1 || routerData.isConfirm == 1"
|
|
|
+ size="mini"
|
|
|
+ @change="changeNum(scope.row)"
|
|
|
+ v-model="scope.row[i]"
|
|
|
+ ></el-input> -->
|
|
|
+ <el-input
|
|
|
+ v-if="tableString.indexOf(i) != -1"
|
|
|
+ :disabled="true"
|
|
|
+ size="mini"
|
|
|
+ @change="changeNum(scope.row)"
|
|
|
+ v-model="scope.row[i]"
|
|
|
+ ></el-input>
|
|
|
+ <label v-else>{{ scope.row[i] }}</label>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -11,7 +66,17 @@
|
|
|
<script>
|
|
|
import api from "@api/economic/index.js";
|
|
|
export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ tableClu: [],
|
|
|
+ tableCluObj: [],
|
|
|
+ tableString: [],
|
|
|
+ timeNow: this.$route.query,
|
|
|
+ };
|
|
|
+ },
|
|
|
created() {
|
|
|
+ // console.log("xxxxxxxxxxxxxxxxxxxxxxxxx", this.timeNow);
|
|
|
this.getCZList();
|
|
|
},
|
|
|
methods: {
|
|
@@ -19,17 +84,97 @@ export default {
|
|
|
getCZList() {
|
|
|
api
|
|
|
.analysisplusTjfxlist({
|
|
|
- wpid: this.$route.query.wpid,
|
|
|
- theday: this.$route.query.theday,
|
|
|
+ wpid: this.timeNow.wpid,
|
|
|
+ theday: this.timeNow.theday,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- console.log(res);
|
|
|
- // this.tableList = res.data;
|
|
|
+ for (let k of res.data[0] ? Object.keys(res.data[0]) : "") {
|
|
|
+ for (let i of res.data) {
|
|
|
+ if (typeof i[k] == "object") {
|
|
|
+ if (i[k] != null) {
|
|
|
+ for (let p of res.data[0] ? Object.keys(i[k]) : "") {
|
|
|
+ // console.log(i[k][p]);
|
|
|
+ i[k + p] = i[k][p];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.tableData = res.data;
|
|
|
+ // console.log("tableData", this.tableData);
|
|
|
+ for (let i of res.data[0] ? Object.keys(res.data[0]) : "") {
|
|
|
+ if (typeof res.data[0][i] != "object") {
|
|
|
+ if (i != "是否可编辑" && i != "id") {
|
|
|
+ this.tableClu.push(i);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.tableCluObj.push(i);
|
|
|
+ }
|
|
|
+ this.tableClu.sort(function (n, m) {
|
|
|
+ return parseInt(n.split("_")[1]) - parseInt(m.split("_")[1]);
|
|
|
+ });
|
|
|
+ this.tableCluObj.sort(function (n, m) {
|
|
|
+ return parseInt(n.split("_")[1]) - parseInt(m.split("_")[1]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ for (let i of this.tableCluObj) {
|
|
|
+ this.tableString.push(i + "当日值(编辑)");
|
|
|
+ }
|
|
|
+ // console.log("tableClu", this.tableClu);
|
|
|
+ // console.log("tableCluObj", this.tableCluObj);
|
|
|
});
|
|
|
},
|
|
|
back() {
|
|
|
this.$router.push("/decision/statisticAnalysis");
|
|
|
},
|
|
|
+ backForm() {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/decision/statisticAnalysis/form",
|
|
|
+ query: {
|
|
|
+ theday: this.timeNow.theday,
|
|
|
+ wpid: this.timeNow.wpid,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ addClass({ row, column, rowIndex, columnIndex }) {
|
|
|
+ // if(columnIndex === 4){
|
|
|
+ if (parseFloat(row.麻黄山风电场) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.牛首山风电场) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.青山风电场) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.石板泉风电场) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.香山风电场) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.大武口电站) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.平罗光伏电站) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+ if (parseFloat(row.宣和光伏发电站) < 0) {
|
|
|
+ return "background:yellow";
|
|
|
+ }
|
|
|
+
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ changeNum(v) {
|
|
|
+ const date = this.routerData.data.theday;
|
|
|
+ const wpid = this.routerData.data.wpid;
|
|
|
+ v.date = date;
|
|
|
+ v.wpid = wpid;
|
|
|
+ // console.log(this.routerData);
|
|
|
+ this.sendData.push(v);
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -41,4 +186,10 @@ export default {
|
|
|
.btn {
|
|
|
margin: 20px;
|
|
|
}
|
|
|
+.table-D {
|
|
|
+ margin: 20px 20px 0 20px;
|
|
|
+}
|
|
|
+/deep/.el-table thead.is-group th.el-table__cell {
|
|
|
+ background-color: rgb(37, 36, 36);
|
|
|
+}
|
|
|
</style>
|