|
@@ -48,34 +48,37 @@
|
|
|
cellspacing="0"
|
|
|
>
|
|
|
<tbody>
|
|
|
- <tr>
|
|
|
+ <tr>
|
|
|
<td style="width: 4vh"></td>
|
|
|
<template v-for="(x, i) of GsList" :key="i">
|
|
|
<td style="width: 3vh">本期</td>
|
|
|
<td style="width: 3vh">同期</td>
|
|
|
</template>
|
|
|
</tr>
|
|
|
- <tr v-for="(items,key,index) in stations" :key="index">
|
|
|
- <td class="td-item" style="width: 4vh">{{items.name}}</td>
|
|
|
- <template v-for="(item, index) of items.children" :key="index">
|
|
|
- <td style="width: 3vh">
|
|
|
- {{ item.current }}
|
|
|
- <template v-if="item.compare === -1">
|
|
|
- <span class="svg-icon svg-icon-yellow">
|
|
|
- <svg-icon svgid="svg-arrow-dpwn-1" />
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- <template v-if="item.compare === 1">
|
|
|
- <span class="svg-icon svg-icon-green">
|
|
|
- <svg-icon svgid="svg-arrow-up-1" />
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </td>
|
|
|
- <td style="width: 3vh">
|
|
|
- {{ item.sameperiod }}
|
|
|
- </td>
|
|
|
- </template>
|
|
|
- </tr>
|
|
|
+ <tr v-for="(items, key, index) in stations" :key="index">
|
|
|
+ <td class="td-item" style="width: 4vh">{{ items.name }}</td>
|
|
|
+ <template
|
|
|
+ v-for="(item, index) of items.children"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <td style="width: 3vh">
|
|
|
+ {{ item.current }}
|
|
|
+ <template v-if="item.compare === -1">
|
|
|
+ <span class="svg-icon svg-icon-yellow">
|
|
|
+ <svg-icon svgid="svg-arrow-dpwn-1" />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template v-if="item.compare === 1">
|
|
|
+ <span class="svg-icon svg-icon-green">
|
|
|
+ <svg-icon svgid="svg-arrow-up-1" />
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </td>
|
|
|
+ <td style="width: 3vh">
|
|
|
+ {{ item.sameperiod }}
|
|
|
+ </td>
|
|
|
+ </template>
|
|
|
+ </tr>
|
|
|
<!-- <tr>
|
|
|
<td style="width: 4vh"></td>
|
|
|
<template v-for="(x, i) of MhsLists" :key="i">
|
|
@@ -262,13 +265,13 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- stations:{},
|
|
|
+ stations: {},
|
|
|
monthData: [],
|
|
|
- MhsLists: [],
|
|
|
- NshList: [],
|
|
|
- QshList: [],
|
|
|
- SbaqList: [],
|
|
|
- XshList: [],
|
|
|
+ // MhsLists: [],
|
|
|
+ // NshList: [],
|
|
|
+ // QshList: [],
|
|
|
+ // SbaqList: [],
|
|
|
+ // XshList: [],
|
|
|
GsList: [],
|
|
|
units: [],
|
|
|
nowCurrent: 1,
|
|
@@ -330,13 +333,13 @@ export default {
|
|
|
return typeof val === "number" && !isNaN(val);
|
|
|
},
|
|
|
getLists(showLoading) {
|
|
|
- let MhsLists = [];
|
|
|
- let NshList = [];
|
|
|
- let QshList = [];
|
|
|
- let SbaqList = [];
|
|
|
- let XshList = [];
|
|
|
+ // let MhsLists = [];
|
|
|
+ // let NshList = [];
|
|
|
+ // let QshList = [];
|
|
|
+ // let SbaqList = [];
|
|
|
+ // let XshList = [];
|
|
|
let GsList = [];
|
|
|
- let _this = this;
|
|
|
+ // let _this = this;
|
|
|
let year = "";
|
|
|
if (typeof this.monthValue === "string") {
|
|
|
year = this.monthValue;
|
|
@@ -345,17 +348,19 @@ export default {
|
|
|
}
|
|
|
const site = ["compare", "year", "month"];
|
|
|
|
|
|
- api.specificMtbfList({
|
|
|
- year: year,
|
|
|
- }).then((res) => {
|
|
|
- let stations = {}
|
|
|
- let company ={
|
|
|
- id:'0',
|
|
|
- name:'公司',
|
|
|
- children: []
|
|
|
- }
|
|
|
+ api
|
|
|
+ .specificMtbfList({
|
|
|
+ year: year,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let stations = {};
|
|
|
+ let company = {
|
|
|
+ id: "0",
|
|
|
+ name: "公司",
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
|
|
|
- this.list = res.data.map((item) => {
|
|
|
+ this.list = res.data.map((item) => {
|
|
|
for (let key in item) {
|
|
|
if (!site.includes(key)) {
|
|
|
if (this.isNumber(item[key])) {
|
|
@@ -367,36 +372,35 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- if(item.wpid === "0"){
|
|
|
- company.children.push(item)
|
|
|
+ if (item.wpid === "0") {
|
|
|
+ company.children.push(item);
|
|
|
}
|
|
|
- if(!stations[item.wpid] && item.wpid !== "0" ){
|
|
|
+ if (!stations[item.wpid] && item.wpid !== "0") {
|
|
|
stations[item.wpid] = {
|
|
|
- id:item.wpid,
|
|
|
- name:item.wpname||'',
|
|
|
- children: []
|
|
|
- }
|
|
|
+ id: item.wpid,
|
|
|
+ name: item.wpname || "",
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
}
|
|
|
- stations[item.wpid]?.children.push(item)
|
|
|
+ stations[item.wpid]?.children.push(item);
|
|
|
if (item.wpid === "0") {
|
|
|
GsList.push(item);
|
|
|
- }
|
|
|
+ }
|
|
|
});
|
|
|
- stations.company = company
|
|
|
+ stations.company = company;
|
|
|
for (const item in stations) {
|
|
|
- stations[item].children = stations[item].children.sort(this.compare("month"));
|
|
|
+ stations[item].children = stations[item].children.sort(
|
|
|
+ this.compare("month")
|
|
|
+ );
|
|
|
}
|
|
|
console.log(stations);
|
|
|
- this.stations = stations
|
|
|
-
|
|
|
+ this.stations = stations;
|
|
|
|
|
|
- this.MhsLists = MhsLists.sort(this.compare("month"));
|
|
|
- this.NshList = NshList.sort(this.compare("month"));
|
|
|
- this.QshList = QshList.sort(this.compare("month"));
|
|
|
- this.SbaqList = SbaqList.sort(this.compare("month"));
|
|
|
- this.XshList = XshList.sort(this.compare("month"));
|
|
|
+ // this.MhsLists = MhsLists.sort(this.compare("month"));
|
|
|
+ // this.NshList = NshList.sort(this.compare("month"));
|
|
|
+ // this.QshList = QshList.sort(this.compare("month"));
|
|
|
+ // this.SbaqList = SbaqList.sort(this.compare("month"));
|
|
|
+ // this.XshList = XshList.sort(this.compare("month"));
|
|
|
this.GsList = GsList.sort(this.compare("month"));
|
|
|
|
|
|
let nowCureent = [];
|
|
@@ -466,9 +470,7 @@ export default {
|
|
|
// this.bardata.area = monthData;
|
|
|
// this.bardata.data[0] = sameCureent;
|
|
|
// this.bardata.data[1] = nowCureent;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
+ });
|
|
|
|
|
|
// _this.API.requestData({
|
|
|
// showLoading,
|