Browse Source

Merge branch 'infoPoint' of http://39.106.8.246:3003/web/ibms into infoPoint

haojianlong 5 years ago
parent
commit
ba8e64c674
2 changed files with 41 additions and 34 deletions
  1. 5 3
      src/components/model/file/floorTable.vue
  2. 36 31
      src/views/model/file/index.vue

+ 5 - 3
src/components/model/file/floorTable.vue

@@ -39,15 +39,15 @@
           ></el-button>
         </div>
         <div
-          :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? 'upLoad-loading':'','upLoad']"
+          :class="[scope.row.Status == 1 ||scope.row.Status == 10 ? 'upLoad-loading':'','upLoad']"
           v-show="scope.row.isDown"
         >
           <div class="progress">
             <el-progress
-              :text-inside="scope.row.Status == 1 || scope.row.Status == 2 ?false:true"
+              :text-inside="scope.row.Status == 1 || scope.row.Status == 10 ?false:true"
               :stroke-width="20"
               :percentage="scope.row.precent"
-              :color="scope.row.Status == 1 || scope.row.Status == 2 ?'#909399':'#67C23A'"
+              :color="scope.row.Status == 1 || scope.row.Status == 10 ?'#909399':'#67C23A'"
             ></el-progress>
           </div>
           <div class="progress-right">
@@ -58,8 +58,10 @@
               @click="closeUpdate(scope.row)"
               circle
             ></el-button>-->
+            <span v-show="scope.row.Status == 0">上传中</span>
             <span v-show="scope.row.Status == 1">等待检查...</span>
             <span v-show="scope.row.Status == 10">模型检查中</span>
+            <span v-show="scope.row.Status == 11">未通过检查</span>
           </div>
         </div>
       </template>

+ 36 - 31
src/views/model/file/index.vue

@@ -266,15 +266,23 @@ export default {
       return new Promise((resolve, reject) => {
         request.queryFloorList(data, res => {
           res.Content.map(item => {
-            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1: 等待检查;Status == 10 正在检查中 ;Status == 2 已通过检查(展示按钮,不可以替换模型); Status == 3 || Status == 4 (可以替换模型文件)
-            if (item.Status == 3) {
+            /**
+             * @info: 状态显示说明
+             * 0: 上传中(上传的用户可操作:中止)
+             * 1: 等待检查
+             * 10: 模型检查中
+             * 11: 未通过检查
+             * 2、20、21: 正常(所有用户可操作:下载、查看历史)
+             * 3、31、4: 正常(所有用户可操作:下载、替换、查看历史)
+             */
+            if (item.Status == 2 || item.Status == 20 || item.Status == 21 || item.Status == 3 || item.Status == 31 || item.Status == 4) {
               Object.assign(item, { isDown: false, precent: 0 });
             } else {
               Object.assign(item, { isDown: true, precent: 100 });
               if (this.persentList.length != 0) {
                 this.persentList.forEach(pItem => {
                   if (item.Id == pItem.Id) {
-                    Object.assign(item, { isDown: true, precent: 0 });
+                    Object.assign(item, { isDown: true, precent: pItem.precent?pItem.precent:0 });
                   }
                 });
               }
@@ -363,32 +371,29 @@ export default {
               val => {
                 if (val.data.Result === "success") {
                   if (that.persentList.length != 0) {
-                    that.persentList.forEach((item, index) => {
+                    //深拷贝
+                    let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
+                    persentListCopy.forEach((item, index) => {
                       if (item.Id == data.FloorModelId) {
-                        item.precent = 101;
-                        setTimeout(() => {
-                          that.persentList.splice(index, 1);
-                          that.uploadClassList.splice(index, 1);
-                        }, 100);
+                        // item.precent = 101;
+                        that.persentList.splice(index, 1);
+                        that.uploadClassList.splice(index, 1);
                         return;
                       }
                     });
                   }
-                  that.$message({
-                    message: "文件上传成功",
-                    type: "success"
-                  });
+                  that.$message({ message: "文件上传成功", type: "success" });
                   //  刷新list列表
                   that.queryFloorFile(that.currentFolderId);
                 } else {
                   if (that.persentList.length != 0) {
-                    that.persentList.forEach((item, index) => {
+                    //深拷贝
+                    let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
+                    persentListCopy.forEach((item, index) => {
                       if (item.Id == data.FloorModelId) {
-                        item.precent = 101;
-                        setTimeout(() => {
-                          that.persentList.splice(index, 1);
-                          that.uploadClassList.splice(index, 1);
-                        }, 100);
+                        // item.precent = 101;
+                        that.persentList.splice(index, 1);
+                        that.uploadClassList.splice(index, 1);
                         return;
                       }
                     });
@@ -457,13 +462,13 @@ export default {
             val => {
               if (val.data.Result === "success") {
                 if (that.persentList.length != 0) {
-                  that.persentList.forEach((item, index) => {
+                  //深拷贝
+                  let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
+                  persentListCopy.forEach((item, index) => {
                     if (item.Id == data.replaceModelItem.Id) {
-                      item.precent = 101;
-                      setTimeout(() => {
-                        that.persentList.splice(index, 1);
-                        that.uploadClassList.splice(index, 1);
-                      }, 100);
+                      // item.precent = 101;
+                      that.persentList.splice(index, 1);
+                      that.uploadClassList.splice(index, 1);
                       return;
                     }
                   });
@@ -476,13 +481,13 @@ export default {
                 that.queryFloorFile(that.currentFolderId);
               } else {
                 if (that.persentList.length != 0) {
-                  that.persentList.forEach((item, index) => {
+                  //深拷贝
+                  let persentListCopy = JSON.parse(JSON.stringify(that.persentList))
+                  persentListCopy.forEach((item, index) => {
                     if (item.Id == data.FloorModelId) {
-                      item.precent = 101;
-                      setTimeout(() => {
-                        that.persentList.splice(index, 1);
-                        that.uploadClassList.splice(index, 1);
-                      }, 100);
+                      // item.precent = 101;
+                      that.persentList.splice(index, 1);
+                      that.uploadClassList.splice(index, 1);
                       return;
                     }
                   });