Selaa lähdekoodia

核查结果,图片渲染逻辑优化。

DESKTOP-6LTVLN7\Liumouren 2 vuotta sitten
vanhempi
commit
e422efa215
1 muutettua tiedostoa jossa 17 lisäystä ja 53 poistoa
  1. 17 53
      src/components/common/BottomForm/VerificationResult.vue

+ 17 - 53
src/components/common/BottomForm/VerificationResult.vue

@@ -8,7 +8,7 @@
       </div>
     </template>
     <!-- app-任务搜索条件 -->
-    <el-form :inline="true" ref="myTaskForm" :model="formInline">
+    <el-form :inline="true" ref="myTaskForm" :model="formInline" v-loading="tableInitInfoLoading">
       <el-form-item label="已读状态">
         <el-select size="mini" v-model="formInline.auditStatus" placeholder="已读状态" clearable>
           <el-option label="全部" value="-1"></el-option>
@@ -24,14 +24,7 @@
     <!-- tabsBOX -->
     <el-tabs tab-position="top" type="card" height="calc(60vh)" v-if="tableData" :value="tabsValue">
       <!-- item-tab -->
-      <el-tab-pane
-        v-for="item in tableData"
-        :key="item.title"
-        :label="item.title"
-        :name="item.title"
-        v-loading="tableInitLoading"
-        :lazy="true"
-      >
+      <el-tab-pane v-for="item in tableData" :key="item.title" :label="item.title" :name="item.title" :lazy="true">
         <!-- 描述列表 -->
         <el-descriptions class="margin-top" :column="3" size="small">
           <el-descriptions-item>
@@ -59,14 +52,7 @@
           </el-descriptions-item>
         </el-descriptions>
         <!-- tableBox -->
-        <el-table
-          v-if="testVIfState"
-          :data="tableDataList[item.title]"
-          height="30vh"
-          stripe
-          v-loading="tableInitInfoLoading"
-          @row-click="ToView"
-        >
+        <el-table v-if="testVIfState" :data="tableDataList[item.title]" height="30vh" stripe @row-click="ToView">
           <el-table-column type="index" width="50" label="序号"> </el-table-column>
           <el-table-column label="疑点标题">
             <template slot-scope="scope">
@@ -86,32 +72,17 @@
           </el-table-column>
           <el-table-column prop="pointsJson.properties.state" label="核查图片" width="220px">
             <template slot-scope="scope">
-              <!-- <span>{{ scope.row.pointsJson.fileUrlList ? scope.row.pointsJson.fileUrlList : "null" }}</span> -->
-              <!-- <span
-                v-for="(fileName, index) in scope.row.pointsJson.fileUrlList"
-                :key="scope.row.id + 'fileList' + index"
-                :index="index"
-              >
-                {{ index }}
-              </span> -->
-              <!-- <el-image
-                v-for="fileUrl in scope.row.pointsJson.fileUrlList"
-                :key="fileUrl"
-                style="width: 100px; height: 100px"
-                :src="fileUrl"
-                fit="cover"
-                :preview-src-list="srcList(scope.row.pointsJson.fileUrlList)"
-              > -->
               <el-image
-                v-if="scope.row.pointsJson.fileUrlList"
+                v-if="scope.row.pointsJson.fileUrlLists"
                 style="width: 100px; height: 100px"
                 fit="cover"
-                :src="srcList(scope.row.pointsJson.fileUrlList)[0]"
-                :preview-src-list="srcList(scope.row.pointsJson.fileUrlList)"
+                :src="scope.row.pointsJson.fileUrlLists[0]"
+                :preview-src-list="scope.row.pointsJson.fileUrlLists"
               >
-                <!-- :preview-src-list="srcList(scope.row.pointsJson.fileUrlList)" -->
               </el-image>
-              <span v-if="scope.row.pointsJson.fileUrlList && srcList(scope.row.pointsJson.fileUrlList).length > 1"> …… </span>
+              <span v-if="scope.row.pointsJson.fileUrlLists && scope.row.pointsJson.fileUrlLists.length > 1">
+                ({{ scope.row.pointsJson.fileUrlLists.length }})…
+              </span>
             </template>
           </el-table-column>
           <el-table-column prop="pointsJson.properties.state" label="核查状态">
@@ -263,13 +234,6 @@ export default {
       }
       console.log("ToView", val);
     },
-    srcList(fileList) {
-      let fileSrcList = [];
-      for (let fileName in fileList) {
-        fileSrcList.push(fileList[fileName]);
-      }
-      return fileSrcList;
-    },
     // 数据字典对照显示
     getSelectByIndex(selectName, index) {
       let slotValue = "";
@@ -342,6 +306,7 @@ export default {
     // 查询事件
     onSubmit() {
       if (!this.tableInitLoading) {
+        this.tableInitInfoLoading = true;
         this.tableInitLoading = true;
         let params = new FormData();
         params.append("columnId", "1794");
@@ -378,7 +343,7 @@ export default {
         }
         if (this.formInline.auditStatus && this.formInline.auditStatus >= 0) {
           let param2 = {
-            field: "c_app_state",
+            field: "state",
             searchType: "1",
             content: {
               value: this.formInline.auditStatus
@@ -395,17 +360,18 @@ export default {
             if (res.code === 200 && res.content.data.length > 0) {
               this.tableData = res.content.data;
               this.tableInitLoading = false;
-              this.tableInitInfoLoading = true;
               this.getAppTaskInfo();
               this.paginationData.total = res.content.count;
             } else {
               this.tableData = [];
+              this.tableInitInfoLoading = false;
               this.tableInitLoading = false;
               this.$message.error(res.message);
             }
           },
           error => {
             this.tableData = [];
+            this.tableInitInfoLoading = false;
             this.tableInitLoading = false;
             this.$message.error(error);
           }
@@ -472,18 +438,17 @@ export default {
                       // 判断是否存在图片并保存到新的对象中;
                       let fileItemList = resItem.pointsJson.properties.fileList;
                       if (fileItemList != undefined) {
-                        let fileUrlList = {};
+                        resItem.pointsJson.fileUrlLists = [];
                         for (let fileItem in fileItemList) {
                           this.getAppTaskImage(fileItemList[fileItem]).then(
                             fileUrl => {
-                              fileUrlList[fileItemList[fileItem]] = fileUrl;
+                              resItem.pointsJson.fileUrlLists.push(fileUrl);
                             },
                             error => {
                               console.log(error);
                             }
                           );
                         }
-                        resItem.pointsJson.fileUrlList = fileUrlList;
                       }
                       // 判断是否存在图片并保存到新的对象中;end
                     }
@@ -498,12 +463,11 @@ export default {
                 if (resDataNum == this.tableData.length) {
                   // 所有数据加载完成后直接显示
                   setTimeout(() => {
-                    console.log(this.tableDataList);
+                    this.tableInitInfoLoading = false;
                     this.tabsValue = this.tableData[0].title;
                     this.testVIfState = true;
-                  }, 100);
+                  }, 2000);
                 }
-                this.tableInitInfoLoading = false;
               } else {
                 this.tableDataList[item.title] = [];
                 this.$message.error(res.message);