|
@@ -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">
|
|
@@ -261,7 +264,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- stations:{},
|
|
|
+ stations: {},
|
|
|
monthData: [],
|
|
|
MhsLists: [],
|
|
|
NshList: [],
|
|
@@ -349,13 +352,13 @@ export default {
|
|
|
year: year,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- let stations = {}
|
|
|
- let company ={
|
|
|
- id:'0',
|
|
|
- name:'公司',
|
|
|
- children: []
|
|
|
- }
|
|
|
- this.list = res.data.map((item) => {
|
|
|
+ let stations = {};
|
|
|
+ let company = {
|
|
|
+ id: "0",
|
|
|
+ name: "公司",
|
|
|
+ children: [],
|
|
|
+ };
|
|
|
+ this.list = res.data.map((item) => {
|
|
|
for (let key in item) {
|
|
|
if (!site.includes(key)) {
|
|
|
if (this.isNumber(item[key])) {
|
|
@@ -366,29 +369,30 @@ 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"));
|