|
@@ -48,14 +48,39 @@
|
|
|
cellspacing="0"
|
|
|
>
|
|
|
<tbody>
|
|
|
- <tr>
|
|
|
+
|
|
|
+ <tr>
|
|
|
<td style="width: 4vh"></td>
|
|
|
- <template v-for="(x, i) of MhsLists" :key="i">
|
|
|
+ <template v-for="(x, i) of GsList" :key="i">
|
|
|
<td style="width: 3vh">本期</td>
|
|
|
<td style="width: 3vh">同期</td>
|
|
|
</template>
|
|
|
</tr>
|
|
|
- <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 class="td-item" style="width: 4vh">麻黄山</td>
|
|
|
<template v-for="(item, index) of MhsLists" :key="index">
|
|
|
<td style="width: 3vh">
|
|
@@ -75,8 +100,8 @@
|
|
|
{{ item.sameperiod }}
|
|
|
</td>
|
|
|
</template>
|
|
|
- </tr>
|
|
|
- <tr>
|
|
|
+ </tr> -->
|
|
|
+ <!-- <tr>
|
|
|
<td class="td-item" style="width: 4vh">牛首山</td>
|
|
|
<template v-for="(item, index) of NshList" :key="index">
|
|
|
<td style="width: 3vh">
|
|
@@ -180,7 +205,7 @@
|
|
|
{{ item.sameperiod }}
|
|
|
</td>
|
|
|
</template>
|
|
|
- </tr>
|
|
|
+ </tr> -->
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
@@ -234,6 +259,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ stations: {},
|
|
|
monthData: [],
|
|
|
MhsLists: [],
|
|
|
NshList: [],
|
|
@@ -316,10 +342,18 @@ export default {
|
|
|
}
|
|
|
const site = ["compare", "year", "month"];
|
|
|
|
|
|
- api.specificFnlylList({
|
|
|
+ api
|
|
|
+ .specificFnlylList({
|
|
|
year: year,
|
|
|
- }).then((res) => {
|
|
|
- console.log(res);
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let stations = {}
|
|
|
+ let company ={
|
|
|
+ id:'0',
|
|
|
+ name:'公司',
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+ console.log(res);
|
|
|
this.list = res.data.map((item) => {
|
|
|
for (let key in item) {
|
|
|
if (!site.includes(key)) {
|
|
@@ -331,22 +365,45 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (item.wpid === "MHS_FDC") {
|
|
|
- MhsLists.push(item);
|
|
|
- } else if (item.wpid === "NSS_FDC") {
|
|
|
- NshList.push(item);
|
|
|
- } else if (item.wpid === "QS_FDC") {
|
|
|
- QshList.push(item);
|
|
|
- } else if (item.wpid === "NSS_FDC") {
|
|
|
- NshList.push(item);
|
|
|
- } else if (item.wpid === "SBQ_FDC") {
|
|
|
- SbaqList.push(item);
|
|
|
- } else if (item.wpid === "XS_FDC") {
|
|
|
- XshList.push(item);
|
|
|
- } else {
|
|
|
- GsList.push(item);
|
|
|
+
|
|
|
+ if(item.wpid === "0"){
|
|
|
+ company.children.push(item)
|
|
|
}
|
|
|
+ if(!stations[item.wpid] && item.wpid !== "0" ){
|
|
|
+ stations[item.wpid] = {
|
|
|
+ id:item.wpid,
|
|
|
+ name:item.wpname||'',
|
|
|
+ children: []
|
|
|
+ }
|
|
|
+ }
|
|
|
+ stations[item.wpid]?.children.push(item)
|
|
|
+ if (item.wpid === "0") {
|
|
|
+ GsList.push(item);
|
|
|
+ }
|
|
|
+
|
|
|
+ // if (item.wpid === "MHS_FDC") {
|
|
|
+ // MhsLists.push(item);
|
|
|
+ // } else if (item.wpid === "NSS_FDC") {
|
|
|
+ // NshList.push(item);
|
|
|
+ // } else if (item.wpid === "QS_FDC") {
|
|
|
+ // QshList.push(item);
|
|
|
+ // } else if (item.wpid === "NSS_FDC") {
|
|
|
+ // NshList.push(item);
|
|
|
+ // } else if (item.wpid === "SBQ_FDC") {
|
|
|
+ // SbaqList.push(item);
|
|
|
+ // } else if (item.wpid === "XS_FDC") {
|
|
|
+ // XshList.push(item);
|
|
|
+ // } else {
|
|
|
+ // GsList.push(item);
|
|
|
+ // }
|
|
|
});
|
|
|
+ stations.company = company
|
|
|
+ for (const item in stations) {
|
|
|
+ stations[item].children = stations[item].children.sort(this.compare("month"));
|
|
|
+ }
|
|
|
+ console.log(stations);
|
|
|
+ this.stations = stations
|
|
|
+
|
|
|
|
|
|
this.MhsLists = MhsLists.sort(this.compare("month"));
|
|
|
this.NshList = NshList.sort(this.compare("month"));
|
|
@@ -400,7 +457,7 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
};
|
|
|
- });
|
|
|
+ });
|
|
|
|
|
|
// _this.API.requestData({
|
|
|
// showLoading,
|