Browse Source

Merge branch 'master' of ssh://gogs.hanyiyun.com:2222/liangxuying/LabCenter

梁旭颖 1 year ago
parent
commit
cc06d9a534
1 changed files with 11 additions and 4 deletions
  1. 11 4
      src/views/openOrder/components/detailDialog.vue

+ 11 - 4
src/views/openOrder/components/detailDialog.vue

@@ -101,7 +101,7 @@
             </el-table-column>
           </el-table>
           <el-button
-            v-if="detail.use_data.length > 3"
+            v-if="detail.use_data && detail.use_data.length > 3"
             style="width: 100%; border-top: none"
             @click="showAllData"
           >
@@ -164,9 +164,16 @@
       }),
       // 计算属性,根据showAll状态切换显示的数据
       filteredData() {
-        return this.showAll
-          ? this.detail.use_data
-          : this.detail.use_data.slice(0, 3)
+        if (
+          !this.showAll &&
+          this.detail.use_data &&
+          this.detail.use_data.length > 3
+        ) {
+          return this.detail.use_data.slice(0, 3)
+        } else {
+          // 否则返回完整的数据
+          return this.detail.use_data
+        }
       },
       showButtonText() {
         return this.showAll ? '收起' : '更多'