Просмотр исходного кода

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

yangjunjing 5 лет назад
Родитель
Сommit
dd38405e58

+ 1 - 1
config/dev.env.js

@@ -4,7 +4,7 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
     NODE_ENV: '"development"',
-    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
+    BASE_URL: '"http://192.168.20.236"', //测试iframe地址
     SSO_SERVER: '"http://192.168.20.102:8080"', //(新)测试环境
     MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
     // SSO_SERVER: '"http://sso.sagacloud.cn"',  //正式环境

+ 1 - 1
config/prod.env.js

@@ -1,7 +1,7 @@
 'use strict'
 module.exports = {
     NODE_ENV: '"production"',
-    BASE_URL: '"http://192.168.20.215"', //测试iframe地址
+    BASE_URL: '"http://192.168.20.236"', //测试iframe地址
     SSO_SERVER: '"http://192.168.20.102:8080"', //(新)测试环境
     MQTT_SERVICE: '"ws://192.168.20.225:61614/stomp/"' //MQ测试环境地址
     // BASE_URL: '"http://mbi.sagacloud.cn"', //线上iframe地址

+ 2 - 1
src/api/model/file.js

@@ -210,7 +210,8 @@ let api = {
      */
     deleteModelFileList(params, success) {
         let data = {
-            Id:params
+            Id:params.Id,
+            Force: params.Force?params.Force:false
         } 
         return httputils.postJson(`${baseUrl}/model-file/delete-file`, data, success)
     },

+ 6 - 0
src/api/scan/request.js

@@ -1272,6 +1272,12 @@ export function createGeneralSys(param, success) {
   http.postJson(url, param, success)
 }
 
+//创建系统---处理建筑楼层(一对多)
+export function createSystemBuildFloor(param, success) {
+    let url = `${baseUrl}/datacenter/general—system/create-bd-fl`
+    http.postJson(url, param, success)
+}
+
 //查询不在当前系统下的设备
 export function getEquipNotInSys(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/equip-sys?sysId=${param.sysId}`;

+ 2 - 2
src/components/globaluploader/index.vue

@@ -2,7 +2,7 @@
  * @Author: zhangyu
  * @Date: 2019-11-28 10:05:28
  * @Info: 
- * @LastEditTime : 2019-12-24 18:35:44
+ * @LastEditTime : 2019-12-25 17:48:31
  -->
 <template>
   <div id="global-uploader">
@@ -213,7 +213,7 @@ export default {
       },1))
       this.setUploaderList(this.uploaderList);
       if(file.modelId && !file.isComplete()) {
-        request.deleteModelFileList(file.modelId, res => {
+        request.deleteModelFileList({Id: file.modelId, Force: true}, res => {
           console.log('删除错误模型:',file.modelId);
           Bus.$emit('modelStatusChange')
         })

+ 12 - 0
src/components/ledger/lib/editSysFloor.vue

@@ -27,6 +27,11 @@ export default {
   components: {
     bfCascader
   },
+  props: {
+    isCreate: {
+      default: false
+    }
+  },
   methods: {
     showDialog(system) {
       this.system = system;
@@ -48,6 +53,13 @@ export default {
       })
     },
     save() {
+      // 如果是创建
+      if (this.isCreate) {
+        let data = this.$refs.bfCascader.getSelectedNodes();
+        this.connectDialogVis = false;
+        this.$emit('relateSuccess', data);
+        return
+      }
       let arr = this.$refs.bfCascader.value;
       let buildIds = [], floorIds = [];
       arr.map(t => {

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

@@ -103,7 +103,7 @@ export default {
         }
       )
         .then(() => {
-          request.deleteModelFileList(item.Id, res => {
+          request.deleteModelFileList({Id: item.Id}, res => {
             if (res.Result == "success") {
               //  刷新页面
               this.$emit("deleteFinish");

+ 51 - 133
src/views/ledger/system/addsystem.vue

@@ -1,9 +1,9 @@
 <template>
   <div id="deviceList">
     <el-row class="right">
-      <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
+      <!-- <span style="width:20px;float:left;display:block;height:20px;cursor: pointer;" @click="changeAssetsFalg">
         <i class="el-icon-fa  el-icon-fa-compass"></i>
-      </span>
+      </span> -->
       <span style="float:left;">当前选择的系统类型:{{category.CategoryName}}</span>
       <el-select v-model="showType" @change="initTable" style="width:125px;margin-right:10px;vertical-align:bottom;">
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
@@ -27,6 +27,9 @@
     <el-row class="center">
       <el-button type="primary" size="medium" @click="handleCreateTableData" class="create_button">创建系统</el-button>
     </el-row>
+
+    <!-- 关联楼层 -->
+    <editSysfloor ref="editFloor" @relateSuccess="relateSuccess" :isCreate="true"></editSysfloor>
   </div>
 </template>
 <script>
@@ -36,10 +39,11 @@ import showTools from "@/utils/handsontable/notShow";
 import text from "@/utils/handsontable/mainText";
 import session from "@/framework/utils/storage";
 
+import editSysfloor from "@/components/ledger/lib/editSysFloor";
 import handsonTable from "@/components/common/handsontable";
 import {
   getDataDictionary,
-  createGeneralSys,
+  createSystemBuildFloor,
   buildingQuery
 } from "@/api/scan/request";
 import { mapGetters, mapActions } from "vuex";
@@ -47,7 +51,8 @@ import { mapGetters, mapActions } from "vuex";
 import qrcode from "@/components/ledger/lib/qrcode";
 export default {
   components: {
-    handsonTable
+    handsonTable,
+    editSysfloor
   },
   data() {
     return {
@@ -100,24 +105,24 @@ export default {
   },
   methods: {
     //维护建筑
-    changeAssetsFalg() {
-      if (this.floorFlag) {
-        this.floorFlag = false
-      } else {
-        this.$confirm('<p>维护设备所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
-          dangerouslyUseHTMLString: true,
-          confirmButtonText: '就要维护设备所属建筑楼层',
-          cancelButtonText: '暂时不搞了',
-          confirmButtonClass: 'confirmButtonClass',
-          cancelButtonClass: 'cancelButtonClass'
-        }).then(_ => {
-          this.floorFlag = true
-          this.getTableHeader()
-        }).catch(_ => {
-          this.$message("取消")
-        })
-      }
-    },
+    // changeAssetsFalg() {
+    //   if (this.floorFlag) {
+    //     this.floorFlag = false
+    //   } else {
+    //     this.$confirm('<p>维护设备所在建筑楼层后,对后续数据影响较大,如业务空间中的所在关系or其他?暂未梳理明白……</p><p>后续要修改设备所属建筑楼层,只能通过模型中的待建模清单操作</p>', '提示', {
+    //       dangerouslyUseHTMLString: true,
+    //       confirmButtonText: '就要维护设备所属建筑楼层',
+    //       cancelButtonText: '暂时不搞了',
+    //       confirmButtonClass: 'confirmButtonClass',
+    //       cancelButtonClass: 'cancelButtonClass'
+    //     }).then(_ => {
+    //       this.floorFlag = true
+    //       this.getTableHeader()
+    //     }).catch(_ => {
+    //       this.$message("取消")
+    //     })
+    //   }
+    // },
     //获取建筑数据
     getBuildData() {
       let param = {
@@ -179,10 +184,6 @@ export default {
         if (!item.SysLocalName) {
           flag = true;
         }
-        // 处理建筑
-        if (item.flowBuild) {
-          item.BuildingId = item.flowBuild
-        }
         item.Category = this.category.Category
       })
       if (flag) {
@@ -190,7 +191,9 @@ export default {
         return;
       }
       params.Content = newData
-      createGeneralSys(params, res => {
+      console.log(params)
+      // return
+      createSystemBuildFloor(params, res => {
         this.$message.success('创建成功')
         session.remove("systemAddData")
         this.$router.push({
@@ -237,7 +240,7 @@ export default {
     formatHeaderData(list) {
       let arr = tools.copyArr(list);
       let data = showTools.headerTextFilter(arr, 'system', this.onlyRead, this.showType);
-      data.unshift("所属建筑");
+      data.unshift("所属建筑楼层");
       return data;
     },
     formatHeaderType(list) {
@@ -245,13 +248,8 @@ export default {
       let arr = tools.copyArr(list);
       let data = showTools.headerTypeFilter(arr, 'system', this.onlyRead, this.showType);
       data.unshift({
-        data: "flowBuild",
-        renderer: tools.customDropdownRenderer,
-        editor: "chosen",
-        chosenOptions: {
-          // multiple: true,//多选
-          data: this.buildingData
-        }
+        data: "BuildingFloorInfoList",
+        renderer: text.sysInBuildFloor
       });
       return data;
     },
@@ -266,10 +264,14 @@ export default {
         contextMenu: this.onlyRead ? false :{
           items: {
             remove_row: {
-              name: "删除设备"
+              name: "删除该系统"
             }
           }
         },
+        autoColumnSize: true,
+        language: "zh-CN",
+        manualColumnResize: true,
+        manualColumnMove: true,
         // 事件
         afterChange: this.handleUpdataTable, //修改后
         afterFilter: this.trimmedRows, //排序前
@@ -338,7 +340,8 @@ export default {
     },
     getInfors(infos, row) {
       let val = this.tableExample.colToProp(row.col);
-      console.log(val)
+      this.row = row.row;
+      this.messKey = val;
       switch (val) {
         //操作
         case 'caozuo':
@@ -354,112 +357,27 @@ export default {
             this.$message("此设备没有设备二维码");
           }
           break;
-        //关联系统
-        case 'linkSystem':
-          if (!this.onlyRead) {
-            this.systemList = this.tableData[row.row].LinkSystem || [];
-            this.myDialog.systemType = true;
-          }
-          break;
-        //关联资产
-        case 'LinkEquipLocalName':
-          if (this.linkNameFalg) {
-            this.myDialog.changeRea = true;
-          }
-          break;
-        //品牌型号弹窗
-        case 'DPManufacturerID':
-          if (!this.onlyRead) {
-            this.myDialog.firm = true;
-          }
-          break;
-        //供应商信息弹窗
-        case 'DPSupplierID':
-          if (!this.onlyRead) {
-            this.myDialog.supplier = true;
-          }
-          break;
-        //维修商信息弹窗
-        case 'DPMaintainerID':
-          if (!this.onlyRead) {
-            this.myDialog.maintainer = true;
-          }
-          break;
-        //保险公司信息
-        case 'DPInsurerID':
-          if (!this.onlyRead) {
-            this.myDialog.insurer = true;
-          }
-          break;
-        //供应合同编号
-        case 'LedgerParam.SupplyPurchase.SupplierContractID':
+        //关联设备数量
+        case 'Count':
           if (!this.onlyRead) {
-            let ContractIDflag = null;
-            let DPSdata = this.tableData[row.row].DPSupplierID;
-            if (DPSdata) {
-              ContractIDflag = DPSdata.split("-")[0];
-            }
-            if (!!ContractIDflag) {
-              this.id = ContractIDflag;
-              this.myDialog.supply = true;
-            } else {
-              this.$message("请先选择供应商");
-            }
+            this.myDialog.relevance = true
           }
           break;
-        //保险单号
-        case 'LedgerParam.InsuranceDoc.InsuranceNum':
+        //所属建筑楼层
+        case 'BuildingFloorInfoList':
           if (!this.onlyRead) {
-            let DPInsurerIDflag = null;
-            let DPIdata = this.tableData[row.row].DPInsurerID;
-            if (DPIdata) {
-              DPInsurerIDflag = DPIdata.split("-")[0];
-            }
-            if (!!DPInsurerIDflag) {
-              this.id = DPInsurerIDflag;
-              this.myDialog.guarantee = true;
-            } else {
-              this.$message("请先选择保险商");
-            }
-          }
-          break;
-        //保险文件--设备文档--安装质检报告
-        case 'LedgerParam.InsuranceDoc.InsuranceFile':
-        case 'LedgerParam.PhotoDoc.Archive':
-        case 'LedgerParam.Siteinstall.CheckReport':
-          let IPSdata = tools.dataForKey(this.tableData[row.row], val);
-          this.filesArr = IPSdata ? IPSdata : [];
-          this.myDialog.uploadFiles = true;
-          break;
-        //安装照片--安装图纸--设备铭牌照片--设备图纸
-        case 'LedgerParam.Siteinstall.InstallPic':
-        case 'LedgerParam.Siteinstall.InstallDrawing':
-        case 'LedgerParam.PhotoDoc.Nameplate':
-        case 'LedgerParam.PhotoDoc.Drawing':
-          let SSPPdata = tools.dataForKey(this.tableData[row.row], val);
-          this.imgsArr = SSPPdata ? SSPPdata : [];
-          this.myDialog.uploadImgs = true;
-          break;
-        //设备照片
-        case 'LedgerParam.PhotoDoc.Pic':
-          let Pdata = tools.dataForKey(this.tableData[row.row], val);
-          this.picsArr = Pdata ? Pdata : [];
-          this.myDialog.pic = true;
-          break;
-        //包含的部件字段
-        case 'Count':
-          if (this.onlyRead) {
-            this.$router.push({ path: '/ledger/parts', query: { deviceId: infos.EquipID } });
-          } else {
-            this.$router.push({ path: '/ledger/partsmanage', query: { deviceId: infos.EquipID, typeId: this.mess.deviceId } });
+            this.$refs.editFloor.showDialog(this.tableData[row.row]);
           }
           break;
         default:
           break;
       }
-      this.row = row.row;
-      this.messKey = val;
     },
+    //建筑楼层
+    relateSuccess(data) {
+      this.tableData[this.row].BuildingFloorInfoList = data
+      this.tableExample.render()
+    }
   }
 };
 </script>

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

@@ -246,7 +246,7 @@ export default {
               //删除错误模型(多人登录会有问题)
               /****状态为0,上传人为本人并且上传列表无对应的模型文件 */
               // if (item.Status == 0 && item.UserName == this.userInfo.userName && !this.uploaderList.some(file => {return file.modelId == item.CurrentModelId})) {
-              //   request.deleteModelFileList(item.CurrentModelId, res => {console.log('删除错误模型:',item.CurrentModelId)})
+              //   request.deleteModelFileList({Id: item.CurrentModelId}, res => {console.log('删除错误模型:',item.CurrentModelId)})
               // }
             });
             this.tableData = res.Content;

+ 1 - 1
src/views/ready/buildfloor/addFloor/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-dialog :title="title" :visible.sync="dialogVisible" width="40%" @close="handleClose" id="messageDialog">
+  <el-dialog :title="title" :visible.sync="dialogVisible" width="45%" @close="handleClose" id="messageDialog">
     <el-row>
       <formItems :type="'Floor'" ref="formItems"></formItems>
     </el-row>