fix:coding#410

This commit is contained in:
shijing 2024-05-10 13:36:52 +08:00
parent 5302c5a5fd
commit c16743f9a5
3 changed files with 37 additions and 27 deletions

View File

@ -52,40 +52,40 @@
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in tableDatas" :key="index"> <tr v-for="(item, index) in tableDatas" :key="index">
<td class="numCell" v-if="index == 0" rowspan="4"> <td class="numCell" v-if="index == 0">
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 4" v-else-if="index == 1"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 9" v-else-if="index == 6"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 14" v-else-if="index == 11"
rowspan="4" rowspan="4"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 18" v-else-if="index == 15"
rowspan="3" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 21" v-else-if="index == 17"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
@ -93,7 +93,7 @@
<td <td
class="numCell" class="numCell"
v-else-if=" v-else-if="
index == 26 || index == 27 || index == 28 index == 22 || index == 23 || index == 24
" "
> >
{{ item[0] }} {{ item[0] }}
@ -279,7 +279,7 @@ export default {
need_display: 1, need_display: 1,
ordering: "report_sortstr", ordering: "report_sortstr",
material__code: "elec", material__code: "elec",
query: { id, name, nickname, mgroup_name, unit }, query: "{ id, name, nickname, mgroup_name, unit }",
}) })
.then((res) => { .then((res) => {
let data = res.slice(3); let data = res.slice(3);

View File

@ -52,40 +52,40 @@
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in tableDatas" :key="index"> <tr v-for="(item, index) in tableDatas" :key="index">
<td class="numCell" v-if="index == 0" rowspan="4"> <td class="numCell" v-if="index == 0">
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 4" v-else-if="index == 1"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 9" v-else-if="index == 6"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 14" v-else-if="index == 11"
rowspan="4" rowspan="4"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 18" v-else-if="index == 15"
rowspan="3" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 21" v-else-if="index == 17"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
@ -93,7 +93,7 @@
<td <td
class="numCell" class="numCell"
v-else-if=" v-else-if="
index == 26 || index == 27 || index == 28 index == 22 || index == 23 || index == 24
" "
> >
{{ item[0] }} {{ item[0] }}
@ -328,6 +328,7 @@ export default {
// } // }
let nowDate = new Date(); let nowDate = new Date();
that.timeStamp = nowDate.getTime(); that.timeStamp = nowDate.getTime();
that.getLengthData();
that.dataLoop(); that.dataLoop();
}, },
getMPoints() { getMPoints() {
@ -339,7 +340,7 @@ export default {
need_display: 1, need_display: 1,
ordering: "report_sortstr", ordering: "report_sortstr",
material__code: "elec", material__code: "elec",
query: { id, name, nickname, mgroup_name, unit }, query: "{ id, name, nickname, mgroup_name, unit }",
}) })
.then((res) => { .then((res) => {
let data = res.slice(3); let data = res.slice(3);
@ -347,6 +348,15 @@ export default {
that.dataLoop(); that.dataLoop();
}); });
}, },
getLengthData() {
let that = this;
let arrs = [];
that.mpointList.forEach((item, index) => {
if (arrs.indexOf(item.mgroup_name) == -1) {
arrs.push(item.mgroup_name);
}
});
},
dataLoop() { dataLoop() {
let that = this; let that = this;
that.tableDatas = []; that.tableDatas = [];

View File

@ -52,40 +52,40 @@
</tr> </tr>
</thead> </thead>
<tr v-for="(item, index) in tableDatas" :key="index"> <tr v-for="(item, index) in tableDatas" :key="index">
<td class="numCell" v-if="index == 0" rowspan="4"> <td class="numCell" v-if="index == 0">
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 4" v-else-if="index == 1"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 9" v-else-if="index == 6"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 14" v-else-if="index == 11"
rowspan="4" rowspan="4"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 18" v-else-if="index == 15"
rowspan="3" rowspan="2"
> >
{{ item[0] }} {{ item[0] }}
</td> </td>
<td <td
class="numCell" class="numCell"
v-else-if="index == 21" v-else-if="index == 17"
rowspan="5" rowspan="5"
> >
{{ item[0] }} {{ item[0] }}
@ -93,7 +93,7 @@
<td <td
class="numCell" class="numCell"
v-else-if=" v-else-if="
index == 26 || index == 27 || index == 28 index == 22 || index == 23 || index == 24
" "
> >
{{ item[0] }} {{ item[0] }}
@ -269,7 +269,7 @@ export default {
need_display: 1, need_display: 1,
ordering: "report_sortstr", ordering: "report_sortstr",
material__code: "elec", material__code: "elec",
query: { id, name, nickname, mgroup_name, unit }, query: "{ id, name, nickname, mgroup_name, unit }",
}) })
.then((res) => { .then((res) => {
let data = res.slice(3); let data = res.slice(3);