Ver código fonte

验收问题修改

zhangyu 5 anos atrás
pai
commit
16c6f33614

+ 3 - 4
src/api/scan/httpUtil.js

@@ -20,11 +20,10 @@ function successResponse(vm, response, success, failed) {
 }
 
 function errorResponse(vm, response, err) {
-    let json = JSON.stringify(response)
-    json = JSON.parse(json)
+    let json = JSON.parse(JSON.stringify(response))
     console.error(response)
-    if (err) {
-        Message.error({ message: '接口:' + json.config.url + '请求错误' })
+    if (json.response) {
+        Message.error({ message: `接口:${json.response.config.url}请求错误,错误状态为:${json.response.status}` })
     } else {
         console.error(vm, response, err)
         Message.error({ message: '请求错误' });

+ 28 - 22
src/components/model/file/addFloorDialog.vue

@@ -78,6 +78,7 @@ export default {
   props: {
     addFloorFileVisible: Boolean,
     FolderName: String,
+    floorList: Array,
     FolderId: String
   },
   computed: {
@@ -133,17 +134,18 @@ export default {
   },
   methods: {
     onSubmit() {
+      let FloorName = null;
       if (this.form.file == null) {
         this.$message.error("模型文件不能为空!");
       } else {
         let FloorName = null;
         // 根据是否有夹层拼接楼层名
-        if (this.haveInterlayer) {
+        if (this.form.haveInterlayer) {
           if (this.form.floorTypeVal == "RF") {
-            FloorName = this.form.floorTypeVal + interlayerType;
+            FloorName = this.form.floorTypeVal + this.form.interlayerTypeVal;
           } else {
             FloorName =
-              this.form.floorTypeVal + this.form.floorNum + interlayerType;
+              this.form.floorTypeVal + this.form.floorNum + this.form.interlayerTypeVal;
           }
         } else {
           if (this.form.floorTypeVal == "RF") {
@@ -152,25 +154,29 @@ export default {
             FloorName = this.form.floorTypeVal + this.form.floorNum;
           }
         }
-        let data = {
-          ProjectId: this.projectId,
-          FolderId: this.FolderId,
-          FloorName: FloorName,
-          Form: this.form,
-          userName:this.userInfo.username
-        };
-        request.createFloor(data).then(res => {
-          if (res.Result == "success") {
-            //  创建成功
-            this.$emit("finishCreateFloor", {
-              FloorModelId: res.FloorModelId,
-              CurrentModelId:res.CurrentModelId,
-              Form: this.form
-            });
-            this.handleClose();
-            // this.submitUpload(res.FloorModelId);
-          }
-        });
+        if(this.floorList.some((item) => {return item.FloorName == FloorName})) {
+          this.$message.error('该楼层名称已存在,请勿重复创建!');
+        } else {
+          let data = {
+            ProjectId: this.projectId,
+            FolderId: this.FolderId,
+            FloorName: FloorName,
+            Form: this.form,
+            userName:this.userInfo.username
+          };
+          request.createFloor(data).then(res => {
+            if (res.Result == "success") {
+              //  创建成功
+              this.$emit("finishCreateFloor", {
+                FloorModelId: res.FloorModelId,
+                CurrentModelId:res.CurrentModelId,
+                Form: this.form
+              });
+              this.handleClose();
+              // this.submitUpload(res.FloorModelId);
+            }
+          });
+        }
       }
     },
     // /上传到服务器/

+ 4 - 4
src/components/model/file/floorTable.vue

@@ -16,7 +16,7 @@
     <el-table-column prop="Version" label="版本号"></el-table-column>
     <el-table-column prop="AcceptTime" label="上传时间"></el-table-column>
     <el-table-column prop="UserName" label="上传人"></el-table-column>
-    <el-table-column prop="address" align="center" label="操作">
+    <el-table-column prop="address" align="center" label="操作"  width="240">
       <template slot-scope="scope">
         <div class="operate" v-show="!scope.row.isDown">
           <el-button
@@ -74,7 +74,7 @@ export default {
   props: {
     tableData: Array,
     persentList: Array,
-    modelFileName: String
+    modelFolderName: String
   },
   data() {
     return {
@@ -91,7 +91,7 @@ export default {
     },
     // 替换日志
     repliaceModel(item) {
-      if (item.Status == 2 || item.Status == 20 || item.Status == 21) {//临时(后续只有状态为4时可以替换模型 item.Status != 4)
+      if (item.Status != 4) {
         this.$alert("正在识别模型对象,请稍后再替换。", "替换模型", {
           confirmButtonText: "确定",
           callback: action => {
@@ -126,7 +126,7 @@ export default {
       if (item.Url) {
         let a = document.createElement("a");
         a.href = item.Url;
-        // a.download =`${this.modelFileName}${item.FloorName}模型文件v${item.Version}.rvt`;
+        a.download =`${this.modelFolderName}${item.FloorName}模型文件v${item.Version}.rvt`;
         a.click();
       } else {
         this.$message({

+ 2 - 1
src/components/model/file/modelLog.vue

@@ -29,6 +29,7 @@ import request from "@/api/model/file.js";
 export default {
   props: {
     modelLogVisible: Boolean,
+    modelFolderName: String,
     logData: Array
   },
   data() {
@@ -58,7 +59,7 @@ export default {
       if (item.Url) {
         let a = document.createElement("a");
         a.href = item.Url;
-        // a.download =`${this.modelFileName}${item.FloorName}模型文件v${item.Version}.rvt`;
+        a.download =`${this.modelFolderName}${item.FloorName}模型文件v${item.Version}.rvt`;
         a.click();
       } else {
         this.$message({

+ 6 - 1
src/framework/layout/PageHeader.vue

@@ -66,7 +66,12 @@ export default {
         }
     },
     created() {
-        this.selectedProjectId = this.projectId
+        let localProjectId = localStorage.getItem('projectId')
+        if(this.projects.some((item) => {return item.id == localProjectId})) {
+            this.selectedProjectId = localProjectId
+        } else {
+            this.selectedProjectId = this.projectId
+        }
     },
     mounted() {},
     components: {}

+ 2 - 2
src/views/ledger/rentlist/index.vue

@@ -122,8 +122,8 @@ export default {
     ]),
     showTypes () {
       return this.onlyRead?
-        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}]: 
-        [{value: "all", label: '全部'}, {value: "Visible", label: '只看采集信息'}, {value: "partInfo", label: '隐藏信息点'}]
+        [{value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]: 
+        [{value: "partInfo", label: '隐藏信息点'}, {value: "Visible", label: '只看采集信息'}, {value: "all", label: '全部'}]
     }
   },
   created() {

+ 9 - 2
src/views/model/file/index.vue

@@ -54,7 +54,7 @@
         <floorTable
           ref="floorTable"
           :tableData="tableData"
-          :modelFileName="currentFolderName"
+          :modelFolderName="currentFolderName"
           @openModelLog="queryModelLog"
           @replaceModel="repliaceModel"
           @closeUpdateFile="removePersentList"
@@ -68,6 +68,7 @@
     <!-- 模型日志弹窗 -->
     <modelLog
       :modelLogVisible="modelLogVisible"
+      :modelFolderName="currentFolderName"
       @deleteFinish="updataLog"
       @CloseModelLogDia="modelLogVisible=false"
       :logData="logData"
@@ -82,6 +83,7 @@
     <!-- 新增楼层 -->
     <addFloorDialog
       :addFloorFileVisible="addFloorFileVisible"
+      :floorList="tableData"
       :FolderName="currentFolderName"
       :FolderId="currentFolderId"
       @closeAddFloorDia="addFloorFileVisible=false"
@@ -121,7 +123,7 @@ export default {
     console.log(this.uploadClassList);
     if (this.uploadClassList.length) {
       this.$alert(
-        "当前页有下载内容,切换到其他页面下载将会失败。您确定要切换页面吗?",
+        "您有正在上传的模型文件,切换菜单会中断上传,是否继续?",
         "提示",
         {
           confirmButtonText: "确定",
@@ -251,6 +253,8 @@ export default {
           this.currentFolderName = this.navigationModel[0].Name;
           this.currentFolderId = this.navigationModel[0].Id;
           this.queryFloorFile(this.currentFolderId);
+        } else {
+          this.tableData = []
         }
       });
     },
@@ -550,6 +554,9 @@ export default {
       handler: function(val) {
         console.log(val);
       }
+    },
+    projectId() {
+      this.queryModel()
     }
   },
   mounted() {