From 649f76187291a6613d7c2c026259a1122b066603 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 30 八月 2023 18:05:09 +0800
Subject: [PATCH] bug修复
---
src/components/experiment/checkTheReport/index.vue | 35 ++++++++++++++++++++++++++++++-----
1 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/src/components/experiment/checkTheReport/index.vue b/src/components/experiment/checkTheReport/index.vue
index 3c005d9..3f4d022 100644
--- a/src/components/experiment/checkTheReport/index.vue
+++ b/src/components/experiment/checkTheReport/index.vue
@@ -40,13 +40,15 @@
<td>妫�娴嬬粨鏋�</td>
<td>鍗曢」鍒ゆ柇</td>
</tr>
- <tr v-for="(item,index) in reportData.products" :key="item">
+ <tr v-for="(item,index) in arr" :key="index">
<td>{{index+1}}</td>
<td>{{item.ipName}}</td>
<td>{{item.unit}}</td>
<td>{{item.required}}</td>
<td>{{item.testValue}}</td>
- <td>{{item.testState === 1 ? "鈭�" : "X"}}</td>
+ <td >
+ {{isIfState(item.testState) }}
+ </td>
</tr>
<tr>
<td colspan="6">妫�楠岀粨璁猴細{{reportData.type == 1 ? "鍚堟牸" : "涓嶅悎鏍�"}}</td>
@@ -71,10 +73,28 @@
</template>
<script>
export default({
+ name: 'Preview',
data() {
return {
logoSrc : require("@/assets/404_images/logo.png"),
- now: new Date().toLocaleDateString()
+ now: new Date().toLocaleDateString(),
+ arr: []
+ }
+ },
+ mounted(){
+ this.arr = this.reportData.products;
+ if(this.reportData.products.length < 10){
+ let size = this.reportData.products.length;
+ let num=10-size
+ for(let i=0;i< num;i++){
+ this.arr.push({
+ code: null,
+ ipName: "",
+ required: "",
+ testState: null,
+ testValue: "",
+ unit: ""})
+ }
}
},
methods:{
@@ -84,6 +104,11 @@
let month = (dt.getMonth() + 1).toString().padStart(2,'0');
let date = dt.getDate().toString().padStart(2,'0');
return `${year}-${month}-${date}`;
+ },
+ isIfState(val){
+ if(val===1)return "鈭�"
+ else if(val===null || val=== undefined) return null
+ else return "X"
}
},
props:["reportData"]
@@ -117,7 +142,7 @@
border: 2px solid black;
}
tr,td,th{
- padding: 10px 10px;
+ padding: 15px 10px;
}
.date-group{
width: 90%;
@@ -135,7 +160,7 @@
margin-left: 5%;
color: lightgray;
text-align: center;
- margin-top: 250px;
+ margin-top: 300px;
}
}
}
--
Gitblit v1.9.3