浏览代码

更改文件状态

YaolongHan 5 年之前
父节点
当前提交
a6ed72e545
共有 2 个文件被更改,包括 40 次插入15 次删除
  1. 39 14
      src/components/model/file/floorTable.vue
  2. 1 1
      src/views/model/file/index.vue

+ 39 - 14
src/components/model/file/floorTable.vue

@@ -19,11 +19,29 @@
     <el-table-column prop="address" align="center" label="操作">
       <template slot-scope="scope">
         <div class="operate" v-show="!scope.row.isDown">
-          <el-button type="primary" size="mini" class="iconfont icon-download" @click="downloadModel(scope.row)" ></el-button>
-          <el-button type="primary" size="mini" class="iconfont icon-replace" @click="repliaceModel(scope.row)" ></el-button>
-          <el-button type="primary" size="mini" class="iconfont icon-Log" @click="queryModelLog(scope.row)" ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-download"
+            @click="downloadModel(scope.row)"
+          ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-replace"
+            @click="repliaceModel(scope.row)"
+          ></el-button>
+          <el-button
+            type="primary"
+            size="mini"
+            class="iconfont icon-Log"
+            @click="queryModelLog(scope.row)"
+          ></el-button>
         </div>
-        <div :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? 'upLoad-loading':'','upLoad']" v-show="scope.row.isDown" >
+        <div
+          :class="[scope.row.Status == 1 ||scope.row.Status == 2 ? '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"
@@ -39,9 +57,9 @@
               class="iconfont icon-termination"
               @click="closeUpdate(scope.row)"
               circle
-            ></el-button> -->
+            ></el-button>-->
             <span v-show="scope.row.Status == 1">等待检查...</span>
-            <span v-show="scope.row.Status == 2">模型检查中</span>
+            <span v-show="scope.row.Status == 10">模型检查中</span>
           </div>
         </div>
       </template>
@@ -70,7 +88,15 @@ export default {
     },
     // 替换日志
     repliaceModel(item) {
-      this.$emit("replaceModel", item);
+      if (item.row.Status == 2) {
+        this.$alert("正在识别模型对象,请稍后再替换。", "替换模型", {
+          confirmButtonText: "确定",
+          callback: action => {
+          }
+        });
+      } else {
+        this.$emit("replaceModel", item);
+      }
     },
     filterTag(Id, precent) {
       this.$refs.filterTable.data.map(item => {
@@ -105,11 +131,11 @@ export default {
     },
     // 停止上传
     closeUpdate(item) {
-      if (this.userInfo.username ==item.UserName ) {
+      if (this.userInfo.username == item.UserName) {
         this.$emit("closeUpdateFile", item);
       } else {
         this.$message({
-          message:"您不是该文件的上传者,不能停止该文件上传!",
+          message: "您不是该文件的上传者,不能停止该文件上传!",
           type: "error"
         });
       }
@@ -147,7 +173,7 @@ export default {
     }
   }
   .icon-termination {
-    color: #F56C6C;
+    color: #f56c6c;
     background: #fff;
     padding: 0;
     border: 0;
@@ -168,7 +194,6 @@ export default {
       height: 20px;
       line-height: 20px;
     }
-
   }
   .upLoad-loading {
     position: relative;
@@ -194,10 +219,10 @@ export default {
   display: none;
 }
 /deep/ .upLoad-loading .el-progress-bar {
-    padding-right: 44px;
-    margin-right: -44px;
+  padding-right: 44px;
+  margin-right: -44px;
 }
 /deep/ .el-progress-bar__inner {
-    text-align: center;
+  text-align: center;
 }
 </style>

+ 1 - 1
src/views/model/file/index.vue

@@ -259,7 +259,7 @@ export default {
       return new Promise((resolve, reject) => {
         request.queryFloorList(data, res => {
           res.Content.map(item => {
-            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1:等待检查;Status == 2:模型检查中; Status == 3 文件上传完成
+            // 显示进度条:Status == 0 || null 正在上传 ;:Status == 1: 等待检查;Status == 10 正在检查中 ;Status == 2 已通过检查(展示按钮,不可以替换模型); Status == 3 || Status == 4 (可以替换模型文件)
             if (item.Status == 3) {
               Object.assign(item, { isDown: false, precent: 0 });
             } else {