Browse Source

修改 部分bug

chuwu 6 years ago
parent
commit
fbfd1931fd

+ 1 - 1
config/index.js

@@ -7,7 +7,7 @@ const path = require('path')
 const proxyTable = {
     '/api': {
         // target: 'http://mbi.sagacloud.cn:8080', //扫楼revit
-        target: 'http://172.16.3.12:8080', //扫楼revit
+        target: 'http://172.16.0.141:8080', //扫楼revit
         changeOrigin: true,
         pathRewrite: {
             '^/api': ''

+ 7 - 1
src/api/request.js

@@ -499,6 +499,12 @@ export function getBussines(param) {
         // return fetch({ method: "POST", url: `/test/object/outside_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
 }
 
+//替代前一个接口
+export function getBussines2(param) {
+    let data = param.data
+    return fetch({ method: "POST", url: `${physics}${dataForm}/fast/object/in_query?projectId=${param.ProjId}&secret=${param.secret}`, data })
+}
+
 //查询业务空间下的元空间
 export function getRelation(param) {
     let data = param.criterias
@@ -748,7 +754,7 @@ export function getListForBuss(param, success) {
 
 //获取产品list
 export function getProductList(param, success) {
-    let url = `${physics}/venders/manufacturer/product/query`
+    let url = `${physics}/venders/manufacturer/product/queryByType`
     http.postJson(url, param, success)
 }
 

+ 148 - 33
src/components/buildData/recommend.vue

@@ -24,18 +24,18 @@
           <saga-button
             v-if="!isChangeVender"
             @click="create"
-          >增加 {{obj.name}} “ {{fm.Infos[key] || ""}} ”</saga-button>
+          >增加 {{obj.name}} “ {{val ? val : fm.Infos[key]}} ”</saga-button>
           <saga-button v-if="isChangeVender" @click="changeVender">更新厂商库中此{{obj.name}}对应值</saga-button>
         </template>
         <!-- <template v-else>
           <p>{{ !!message ? message : "请确定该信息点内有值"}}</p>
         </template>-->
       </div>
-      <div class="saga-change-name">
+      <div class="saga-change-name" v-if="elseBtnsShow">
         <h3 class="saga-gray saga-explain">您可能需要其他快捷操作</h3>
         <!-- <saga-button @click="checkVenders">先维护 xxx 信息点</saga-button> -->
         <saga-button @click="checkVenders" v-if="showBtn">批量维护 {{!!obj ? obj.name : ""}} 相关信息点</saga-button>
-        <saga-button v-if="!showBtn">先维护 {{!!obj ? obj.name : ""}} 信息点</saga-button>
+        <saga-button v-if="!showBtn">先维护 {{objMsg}}</saga-button>
         <!-- <saga-button @click="checkVenders"></saga-button> -->
       </div>
     </div>
@@ -97,7 +97,11 @@ export default {
       isChangeFor: false,
       isChangeVender: false,
       isChangeId: true,//是否为修改id
-      noIdChangeVal: ""
+      noIdChangeVal: "",
+      elseBtnsShow: true, //是否显示修改按钮
+      msgTable: true,
+      content: {},//厂商库信息点
+      objMsg: "相关信息点"
     }
   },
   created() { },
@@ -183,8 +187,9 @@ export default {
       this.message = ""
       this.key = infosKey.split(".")[1]
       this.obj = getJson(this.infosKey.split(".")[1])
-      console.log(this.obj)
+      console.log("数据请求", this.obj)
       if (!!this.obj) {
+        console.log("有data")
         this.hasData = true
         this.getDataForm()
       } else {
@@ -200,44 +205,56 @@ export default {
         keysArr = ["DPInsurerID", "DPSupplierID", "DPMaintainerID"]
       //如果是三大厂商的网址
       if (webArr.indexOf(this.key) > -1) {
-        console.log("三大网址")
         let param = {
           venderId: this.fm.Infos[this.obj.infosKey],
           website: this.fm.Infos[this.key]
         }
-        console.log(param, "param")
         this.obj.updateVender(param, res => {
-          this.loadFm()
+          this.updateKey(this.key, this.fm)
         })
         return false
       } else if (keysArr.indexOf(this.obj.infosKey) > -1) {
-        console.log("三大厂商的联系人")
         let param = {
           venderId: this.fm.Infos[this.obj.infosKey],
-          projectId: this.$route.query.projId,
-          [this.getKey(this.obj.options, this.key)]: this.fm.Infos[this.key]
+          projectId: this.$route.query.projId
+        }
+        //如果存在content的联系人
+        console.log(this.content, "content")
+        if (this.content.hasOwnProperty("contact")) {
+          let contents = this.content.contact
+          for (let k in contents) {
+            param[k] = contents[k]
+          }
         }
-        console.log(param, "param")
+        param[[this.getKey(this.obj.options, this.key)]] = this.fm.Infos[this.key]
         this.obj.update(param, res => {
-          this.loadFm()
+          this.updateKey(this.key, this.fm)
         })
         return false
       } else {
-        console.log("型号")
         let param = {
           specificationId: this.fm.Infos.DPSpecificationID,
           infos: {
             [this.key]: this.fm.Infos[this.key]
           }
         }
-        console.log(param, "param")
-        this.obj.updateVenderSpecification(param, res => {
-          this.loadFm()
+        this.obj.updateVender(param, res => {
+          this.updateKey(this.key, this.fm)
         })
         return false
       }
     },
 
+    updateKey(key, obj) {
+      let param = {
+        FmId: obj.FmId,
+        Infos: {
+          [key]: null
+        }
+      }
+      this.updateMain(param)
+    },
+
     /**
      * @param arr 传入的数组
      * @param key 传入的key
@@ -269,7 +286,7 @@ export default {
     },
     //falg为是否存在id
     falgChange(falg) {
-      if (!!this.fm.Infos[this.key]) {
+      if (this.val || !!this.fm.Infos[this.key]) {
 
         //存在id且单元格存在值
         if (falg) {
@@ -285,19 +302,24 @@ export default {
         }
       } else {
         //不存在值
-        this.changeList = []
-        this.changeMsg = "请确定该单元格内存在值"
+        // this.isChangeFor = false
+        // this.isSameForCreate = true
+        // this.changeList = []
+        this.noIdDo()
+        // this.changeMsg = "请确定该单元格内存在值"
       }
     },
 
     //没有id执行
     noIdDo() {
-      this.createShow = true
-      this.showBtn = false
+      console.log("没有id")
       let param = {
         infoCode: this.key,
         infoValue: this.val || this.fm.Infos[this.key]
-      }
+      }, falg = true
+      this.createShow = true
+      this.showBtn = false
+      this.elseBtnsShow = true
       if (this.key == "Brand") {
         param.manufacturerID = this.fm.Infos.DPManufacturerID
       }
@@ -306,29 +328,111 @@ export default {
         param.brandID = this.fm.Infos.DPBrandID
         param.eqFamily = this.fm.Family
       }
+
+      for (let k in param) {
+        if (!param[k]) {
+          falg = false
+        }
+      }
+      console.log(falg, "falg")
+      //如果传参中某个值为空不发生请求
+      if (!falg) {
+        this.noShowTop12()
+        return false
+      } else {
+        this.elseBtnsShow = false
+      }
+
       console.log(this.obj.infosArr[0], this.infosKey, "this.infosKey")
       if (this.obj.infosArr[0] != this.key) {
-        this.isSameForCreate = true
-        this.isChangeFor = true
+        console.log("其他信息点")
+        this.noShowTop12()
         return false
       }
 
       getVenderRecommend(param, res => {
         this.changeList = res.content || []
+        this.isChangeId = true
         this.isSameForCreate = false
         this.isChangeFor = false
+        console.log(this.changeList, "changeList")
         if (!!this.changeList && this.changeList.length == 1) {
           if (this.changeList[0].value == this.fm.Infos[this.key]
             && this.changeList[0].id == this.fm.Infos["DP" + this.key + "ID"]) {
             this.isSameForCreate = true
             this.isChangeFor = true
+            if (!!this.val && this.val != this.fm.Infos[this.key]) {
+              this.isChangeFor = false
+              this.isSameForCreate = false
+            }
           }
         }
-        if (this.changeList.length < 0) {
+        if (this.changeList.length <= 0) {
           this.changeMsg = "该生产商下不存在符合条件的推荐"
         }
       })
     },
+
+    //第一栏第二栏不显示
+    noShowTop12() {
+      this.elseBtnsShow = true
+      console.log(this.obj.infosKey, this.fm.Infos)
+      //型号
+      if (this.obj.infosKey == "DPSpecificationID") {
+        if (!this.fm.Infos.DPManufacturerID) {
+          this.objMsg = "生产厂家"
+        } else if (!this.fm.Infos.DPBrandID) {
+          this.objMsg = "品牌"
+        } else if (!this.DPSpecificationID) {
+          this.objMsg = "设备型号"
+        }
+      }
+
+      if (!this.val && !this.fm.Infos[this.key]) {
+        this.elseBtnsShow = false
+      }
+
+      //品牌
+      if (this.obj.infosKey == "DPBrandID") {
+        if (!this.fm.Infos.DPManufacturerID) {
+          this.objMsg = "生产厂家"
+        }
+      }
+
+      //生产厂家
+      if (this.obj.infosKey == "DPManufacturerID") {
+        this.elseBtnsShow = false
+      }
+
+      //供应商
+      if (this.obj.infosKey == "DPSupplierID") {
+        if (!this.fm.Infos.DPSupplierID) {
+          console.log("没有供应商id")
+          this.elseBtnsShow = true
+          this.objMsg = "供应商单位名称"
+        }
+      }
+      //维修商
+      if (this.obj.infosKey == "DPMaintainerID") {
+        if (!this.fm.Infos.DPMaintainerID) {
+          console.log("没有维修商id")
+          this.elseBtnsShow = true
+          this.objMsg = "维修商单位名称"
+        }
+      }
+
+      //保险公司
+      if (this.obj.infosKey == "DPInsurerID") {
+        if (!this.fm.Infos.DPInsurerID) {
+          console.log("没有保险id")
+          this.elseBtnsShow = true
+          this.objMsg = "保险公司名称"
+        }
+      }
+      this.isSameForCreate = true
+      this.isChangeFor = true
+    },
+
     //当前单元格内存在id且单元格存在值
     getVendersList() {
       //四大厂商名称
@@ -337,6 +441,7 @@ export default {
         vendersArr = ["Manufacturer", "Supplier", "Maintainer", "Insurer", "Brand"],
         infosKey = this.obj.infosKey
       this.showBtn = true
+      this.elseBtnsShow = true
       //获取label
       let ownLabel = ""
       this.obj.options.map(item => {
@@ -362,21 +467,27 @@ export default {
           } else {
             optContent = res.content[optArr[0]][optArr[1]]
           }
-          console.log(optContent, this.val, this.fm.Infos[this.key])
           if (optContent == (this.val || this.fm.Infos[this.key])) {
             //厂商库中的值与现有的值相等
             this.isChangeFor = true
             this.isSameForCreate = true
+            let keysBtns = ["DPBrandID", "DPManufacturerID"]
+            if (keysBtns.indexOf(this.obj.infosKey) > -1) {
+              this.elseBtnsShow = false
+            }
           } else {
             if (!optContent) {
               //如果厂商库中没有值
               console.log("没有该信息点")
-              this.isChangeFor = false
+              this.isChangeFor = true
+              this.isChangeVender = true
+              this.isSameForCreate = false
             } else {
               //有值
               console.log("有值,且值不同")
               this.isChangeId = false
               this.hasData = true
+              this.content = res.content
               //修改的值(其实做置空操作)
               this.noIdChangeVal = optContent
               this.isChangeFor = false
@@ -393,15 +504,19 @@ export default {
         }
         this.obj.getList(paramData, res => {
           let optContent = res.content.infos[this.key]
-          console.log(optContent, "optContent")
-          if (optContent == (this.val || this.fm.Infos.Specification)) {
+          console.log(optContent, this.val, this.fm.Infos[this.key], "optContent")
+          if (optContent == (this.val || this.fm.Infos[this.key])) {
+            console.log("有值,且值相同")
             this.isChangeFor = true
             this.isSameForCreate = true
+            this.elseBtnsShow = false
           } else {
             if (!optContent) {
               //如果厂商库中没有值
               console.log("没有该信息点")
-              this.isChangeFor = false
+              this.isChangeFor = true
+              this.isChangeVender = true
+              this.isSameForCreate = false
             } else {
               //有值
               console.log("有值,且值不同")
@@ -448,9 +563,9 @@ export default {
         Infos: {
         }
       }
-      console.log(this.obj, "obj")
+      console.log(this.obj, "obj", this.obj.options[0].optLabel, this.key)
       param.Infos[this.obj.infosKey] = data.id
-      param.Infos[this.obj.options[0].optLabel] = null
+      //   param.Infos[this.obj.options[0].optLabel] = null
       if (this.obj.infosKey == "DPManufacturerID") {
         param.Infos.DPSpecificationID = null
         param.Infos.DPBrandID = null

+ 57 - 35
src/components/buildData/vendersChange.vue

@@ -46,9 +46,9 @@
             </div>
           </div>
           <div class="saga-ipnput-view">
-            <template v-for="item in labelList" v-if="obj.infosKey != 'DPSpecificationID'">
+            <template v-for="(item,index) in labelList" v-if="obj.infosKey != 'DPSpecificationID' ">
               <data-fill
-                v-if="item.key"
+                v-if="isShow(item,index)"
                 :isCreated="create"
                 :renderData="item"
                 @change="changefillData"
@@ -58,7 +58,7 @@
               <div v-for="item in labelList">
                 <!-- 一级标签 -->
                 <h3 style="line-height:32px; color: green;">{{item.FirstTag}}</h3>
-                <div v-for="child in item.details">
+                <div v-if="child.SecondTag != '设备厂家' || create" v-for="child in item.details">
                   <!-- 二级标签 -->
                   <h4 style="line-height:32px;padding-left:20px;color: #409EFF;">{{child.SecondTag}}</h4>
                   <div v-for="detail in child.details">
@@ -130,17 +130,34 @@ export default {
       isCreateProduct: true,
       productName: "",
       productId: "",
-      productOptions: []
+      productOptions: [],
+      fm: {
+        Infos: {}
+      }
     }
   },
   created() { },
   mounted() { },
   methods: {
+    isShow(item, index) {
+      let falg = false
+      console.log(item, index)
+      if (!item.key || index == 0) {
+        falg = false
+      } else {
+        falg = true
+      }
+      if (this.create) {
+        falg = true
+      }
+      return falg
+    },
     //修改开关
     changeSwitch() {
       if (!this.isCreateProduct) {
         let param = {
-          brandId: this.fmData.Infos.DPBrandID
+          brandId: this.fm.Infos.DPBrandID,
+          familyCode: this.fm.Family
         }
         getProductList(param, res => {
           this.productOptions = res.content
@@ -149,11 +166,13 @@ export default {
     },
     //获取创建信息
     getCreateData() {
+      this.fm = tools.deepCopyObj(this.fmData)
+      console.log(this.gm, this.fmData, "fmData")
       this.obj = getJson(this.infosKey.split(".")[1])
       if (this.obj.infosKey != "DPSpecificationID") {
         this.labelList = this.obj.options.map(item => {
           let keyArr = item.key.split("."), data = ""
-          item.value = this.fmData.Infos[item.optLabel] || ""
+          item.value = this.fm.Infos[item.optLabel] || ""
           return item
         })
       } else {
@@ -163,7 +182,7 @@ export default {
             item.details.map(child => {
               if (child.details && child.details.length) {
                 child.details.map(details => {
-                  details.value = this.fmData.Infos[details.optLabel] || ""
+                  details.value = this.fm.Infos[details.optLabel] || ""
                   return details
                 })
               }
@@ -177,6 +196,7 @@ export default {
     //创建请求
     createOwn() {
       let venderIdArr = ["DPManufacturerID", "DPSupplierID", "DPInsurerID", "DPMaintainerID", "DPBrandID"]
+      console.log(this.fm)
       if (venderIdArr.indexOf(this.obj.infosKey) > -1) {
         let param = {}
         param.name = this.getMess('vender.name')
@@ -186,13 +206,13 @@ export default {
         //当其id为品牌id
         if (this.obj.infosKey == "DPBrandID") {
           param.name = this.getMess('content.name')
-          param.venderId = this.fmData.Infos.DPManufacturerID
+          param.venderId = this.fm.Infos.DPManufacturerID
         }
         //新建
         this.obj.createFunc(param, res => {
-          this.fmData.Infos[this.obj.infosKey] = res.id
+          this.fm.Infos[this.obj.infosKey] = res.id
           param = {}
-          param.venderId = this.fmData.Infos[this.obj.infosKey]
+          param.venderId = this.fm.Infos[this.obj.infosKey]
           param.projectId = this.$route.query.projId
           //如果存在联系人请求
           if (!!this.obj.update) {
@@ -207,30 +227,30 @@ export default {
             //发起请求
             this.obj.update(param, res => {
               for (let k in this.labelList) {
-                this.changeFmData(this.labelList[k].optLabel, this.fmData.Infos)
+                this.changeFmData(this.labelList[k].optLabel, this.fm.Infos)
               }
-              this.updateFm(this.fmData)
+              this.updateFm(this.fm)
             })
           } else {
             for (let k in this.labelList) {
-              this.changeFmData(this.labelList[k].optLabel, this.fmData.Infos)
+              this.changeFmData(this.labelList[k].optLabel, this.fm.Infos)
             }
             if (this.obj.infosKey == "DPBrandID") {
-              this.fmData.Infos.Brand = this.getMess('content.name')
-              this.fmData.Infos.DPSpecificationID = null
+              this.fm.Infos.Brand = this.getMess('content.name')
+              this.fm.Infos.DPSpecificationID = null
             }
             //如果修改的是生产厂家,品牌型号清空
             if (this.obj.infosKey == "DPManufacturerID") {
-              this.fmData.Infos.DPBrandID = null
-              this.fmData.Infos.DPSpecificationID = null
+              this.fm.Infos.DPBrandID = null
+              this.fm.Infos.DPSpecificationID = null
             }
-            this.updateFm(this.fmData)
+            this.updateFm(this.fm)
           }
         })
       }
-      let brandId = this.fmData.Infos.DPBrandID
+      let brandId = this.fm.Infos.DPBrandID
       if (this.obj.infosKey == "DPSpecificationID") {
-        let param = tools.deepCopyObj(this.fmData)
+        let param = tools.deepCopyObj(this.fm)
         param.Infos = {}
         //取infos中的数据
         this.labelList.map(item => {
@@ -269,7 +289,7 @@ export default {
           let produceParam = {
             brandId: brandId,
             name: this.productName,
-            eqFamily: this.fmData.Family
+            eqFamily: this.fm.Family
           }
           this.obj.createProduct(produceParam, res => {
             let speParam = {
@@ -291,7 +311,7 @@ export default {
     },
     createSpecification(param) {
       this.obj.createFunc(param, res => {
-        let updateParam = tools.deepCopyObj(this.fmData)
+        let updateParam = tools.deepCopyObj(this.fm)
         updateParam.Infos = {}
         updateParam.Infos.DPSpecificationID = res.id
         this.labelList.map(item => {
@@ -329,24 +349,25 @@ export default {
       })
     },
     getData() {
+      this.fm = tools.copyArr(this.fmData)
+      console.log(this.fmData, this.fm)
       this.isCreateShow = false
       this.obj = {}
       this.obj = getJson(this.infosKey.split(".")[1])
-      console.log(this.obj)
       let venders = ["DPSupplierID", "DPInsurerID", "DPManufacturerID"]
       if (!!this.obj) {
         let param = {
-          venderId: this.fmData.Infos[this.obj.infosKey],
+          venderId: this.fm.Infos[this.obj.infosKey],
           projectId: this.$route.query.projId
         }
         if (this.obj.infosKey == "DPBrandID") {
           param = {
-            brandId: this.fmData.Infos[this.obj.infosKey]
+            brandId: this.fm.Infos[this.obj.infosKey]
           }
         }
         if (this.obj.infosKey == "DPSpecificationID") {
           param = {
-            specificationId: this.fmData.Infos[this.obj.infosKey]
+            specificationId: this.fm.Infos[this.obj.infosKey]
           }
         }
         this.obj.getList(param, res => {
@@ -379,7 +400,7 @@ export default {
                         }
                       }
                       details.value = data
-                      details.oldValue = this.fmData.Infos[details.optLabel]
+                      details.oldValue = this.fm.Infos[details.optLabel]
                       return details
                     })
                   }
@@ -402,7 +423,7 @@ export default {
                 }
               }
               item.value = data || ""
-              item.oldValue = this.fmData.Infos[item.optLabel] || ""
+              item.oldValue = this.fm.Infos[item.optLabel] || ""
               return item
             })
           }
@@ -424,7 +445,7 @@ export default {
     updateSpecification() {
       console.log("修改型号", this.obj)
       let param = {
-        specificationId: this.fmData.Infos.DPSpecificationID,
+        specificationId: this.fm.Infos.DPSpecificationID,
         name: "",
         infos: {}
       }
@@ -466,13 +487,13 @@ export default {
     //修改
     updateVender() {
       let param = {}
-      param.venderId = this.fmData.Infos[this.obj.infosKey]
+      param.venderId = this.fm.Infos[this.obj.infosKey]
       param.projectId = this.$route.query.projId
       param.name = this.getMess('vender.name')
       param.website = this.getMess('vender.website')
       if (this.obj.infosKey == "DPBrandID") {
         param = {
-          brandId: this.fmData.Infos[this.obj.infosKey],
+          brandId: this.fm.Infos[this.obj.infosKey],
           name: this.getMess('content.name')
         }
       }
@@ -484,7 +505,7 @@ export default {
     //修改厂商联系人信息
     updatePhone() {
       let param = {}
-      param.venderId = this.fmData.Infos[this.obj.infosKey]
+      param.venderId = this.fm.Infos[this.obj.infosKey]
       param.projectId = this.$route.query.projId
       if (this.obj.name == "生产商") {
         param.name = this.getMess('vender.name')
@@ -496,18 +517,19 @@ export default {
       }
       this.obj.update(param, res => {
         for (let k in this.labelList) {
-          this.changeFmData(this.labelList[k].optLabel, this.fmData.Infos)
+          this.changeFmData(this.labelList[k].optLabel, this.fm.Infos)
         }
         // this.dialog.visible = false
-        this.updateFm(this.fmData)
+        this.updateFm(this.fm)
       })
     },
     //修改资产
     updateFm(param) {
+      let list = tools.copyArr(param)
       upDateTableMain({
         ProjId: this.$route.query.projId,
         UserId: this.$route.query.userId
-      }, [param]).then(res => {
+      }, [list]).then(res => {
         if (res.data.Result == "success") {
           this.$emit("change")
           console.log("venderChange")

+ 2 - 1
src/components/business/handsontable.vue

@@ -104,10 +104,11 @@ export default {
         id: this.buildMess.code,
         type: ["Sp"],
         data: {
+          customInfo: true,
           criteria: {
             floor: this.buildMess.code, // 必填, 指定楼层id
             business_type: this.activeType.code, // 必填, 楼层下某个类型的业务空间PowerSupplyZone, 默认是空字符串
-            rel_type: this.activeType.rel_type // 必填, 指定业务类型的关系类型(参考数据平台),
+            rel_type: this.activeType.rel_type, // 必填, 指定业务类型的关系类型(参考数据平台),
             // 数字型字符串, 例如: 通用是99
           }
         },

+ 2 - 2
src/components/dialogs/addDialog/dialogAssets.vue

@@ -210,8 +210,8 @@ export default {
             if (!!item.children && item.children.length) {
               item.children.map(child => {
                 floorData.push({
-                  code: item.value + "-" + child.value,
-                  name: item.label + "-" + child.label
+                  Code: item.value + "-" + child.value,
+                  Name: item.label + "-" + child.label
                 })
               })
             }

+ 4 - 3
src/components/dialogs/addDialog/dialogDevice.vue

@@ -257,13 +257,14 @@ export default {
             if (!!item.children && item.children.length) {
               item.children.map(child => {
                 floorData.push({
-                  code: item.value + "-" + child.value,
-                  name: item.label + "-" + child.label
+                  Code: item.value + "-" + child.value,
+                  Name: item.label + "-" + child.label
                 })
               })
             }
           })
           this.floorData = floorData
+          console.log(this.floorData)
         } else {
           this.$message.error(res.data.ResultMsg)
         }
@@ -393,7 +394,7 @@ export default {
           item.floor_id = item.flowBuild.split("-")[1] || null
           //不存在floor字段去除floor
           if (!item.floor_id) {
-            delete item.relation.floor
+            delete item.floor_id
           }
           delete item.flowBuild
         }

+ 2 - 2
src/components/dialogs/addDialog/dialogSystem.vue

@@ -182,8 +182,8 @@ export default {
           let data = this.changeArr(res.data.Content), floorData = []
           data.map(item => {
             floorData.push({
-              code: item.value,
-              name: item.label
+              Code: item.value,
+              Name: item.label
             })
           })
           this.floorData = floorData

+ 1 - 0
src/components/dialogs/changeRea.vue

@@ -295,6 +295,7 @@ export default {
       console.log(param)
       getBussines(param).then(res => {
         this.tableData = res.data.Content
+        console.log(this.tableData, "this.tableData")
         this.page.total = res.data.Count
       })
     },

+ 2 - 2
src/components/dialogs/detailsDialog.vue

@@ -37,8 +37,8 @@
     <div v-show="step == 2">
       <add-equip :activeTabType="activeTabType" ref="addEquip"></add-equip>
     </div>
-    <div id="detailsDialog" v-show="step == 3">
-      <iframe height="400px" width="100%" :src="iframeSrc2"></iframe>
+    <div id="detailsDialog" v-if="step == 3">
+      <iframe v-if="step == 3" height="400px" width="100%" :src="iframeSrc2"></iframe>
     </div>
   </el-dialog>
 </template>

+ 39 - 17
src/components/graphy/business.vue

@@ -231,7 +231,7 @@ import {
   createBusiness, //添加业务空间
   createRelation, //添加关系
   getGraphyId, //获取图类型
-  getBussines, //获取业务空间
+  getBussines2, //获取业务空间
   getRelation, //获取业务空间下的元空间id
   deleteRelation, //删除关系
   isAbut
@@ -332,20 +332,32 @@ export default {
 
     //查询绑定了元空间的业务空间
     getHasSpace() {
-      getBussines({
+      console.log(this.spaceType, "spaceType")
+      let param = {
         data: {
           criteria: {
             id: this.buildMess.code,
-            graphId: this.graphyId,
-            relType: this.spaceType.rel_type,
-            exclude: false,
-            side: 1,
-            type: ["Sp"]
-          }
+            // graphId: this.graphyId,
+            // relType: this.spaceType.rel_type,
+            // exclude: false,
+            // side: 1,
+            type: [this.spaceType.code],
+            "include": [            // 可选, 只查询指定图/关系中的对象
+              {
+                "graphId": this.graphyId,
+                "graphType": this.spaceType.code,
+                "relType": this.spaceType.rel_type,
+                "side": "toId",
+                // "fromId": "",                 // 选填
+                // "toId": ""                    // 选填
+              }
+            ]
+          },
         },
         ProjId: this.param.ProjId,
         secret: this.param.secret
-      })
+      }
+      getBussines2(param)
         .then(res => {
           if (res.data.Result == "success") {
             this.restaurants = res.data.Content;
@@ -386,16 +398,26 @@ export default {
 
     //查询未绑定元空间的业务空间
     getNoSpace() {
-      getBussines({
+      getBussines2({
         data: {
           criteria: {
             id: this.buildMess.code,
-            graphId: this.graphyId,
-            relType: this.spaceType.rel_type,
-            exclude: true,
-            side: 1,
-            type: [this.spaceType.code == "GeneralZone" ? "Sp" : this.spaceType.code]
-          }
+            // graphId: this.graphyId,
+            // relType: this.spaceType.rel_type,
+            // exclude: false,
+            // side: 1,
+            type: [this.spaceType.code],
+            "exclude": [            // 可选, 只查询指定图/关系中的对象
+              {
+                "graphId": this.graphyId,
+                "graphType": this.spaceType.code,
+                "relType": this.spaceType.rel_type,
+                "side": "toId",
+                // "fromId": "",                 // 选填
+                // "toId": ""                    // 选填
+              }
+            ]
+          },
         },
         ProjId: this.param.ProjId,
         secret: this.param.secret
@@ -446,7 +468,7 @@ export default {
             // console.log(unGzipData, "atob")
             data = unGzipData
             _this.dataMax = tools.getPoint(data);
-            console.log(unGzipData,data)
+            console.log(unGzipData, data)
             if (data.WallList && data.WallList.length) {
               tools.changeMap(data.WallList, -1, "PointList");
             }

+ 89 - 2
src/components/handsontables/device.vue

@@ -98,7 +98,7 @@
   </div>
 </template>
 <script>
-import { getTableHeader, getEquipmentFamily, getBillEquipList, BeatchQueryParam, delBatchList, updateBusiness } from "@/api/request";
+import { getTableHeader, getSpaceFloor, getEquipmentFamily, getBillEquipList, BeatchQueryParam, delBatchList, updateBusiness } from "@/api/request";
 
 
 import tools from "@/assets/js/tools";
@@ -195,14 +195,77 @@ export default {
       qrcodeUrl: "",//二维码图片地址
       loading: false,
       EquipmentList: [],//资产族
-      deviceType: {}
+      deviceType: {},
+      floorData: []
     };
   },
   created() {
     this.getEquipmentFamilyList()
+    this.getFloorData()
   },
   mounted() { },
   methods: {
+    //获取楼层数据
+    getFloorData() {
+      let param = {
+        ProjId: this.$route.query.projId,
+        secret: this.$route.query.secret
+      }
+      getSpaceFloor(param).then(res => {
+        if (res.data.Result == 'success') {
+          let data = this.changeArr(res.data.Content), floorData = []
+          data.map(item => {
+            if (!!item.children) {
+              item.children.unshift({
+                value: '',
+                label: "未明确楼层"
+              })
+            }
+            return item
+          })
+          data.map(item => {
+            if (!!item.children && item.children.length) {
+              item.children.map(child => {
+                floorData.push({
+                  Code: item.value + "-" + child.value,
+                  Name: item.label + "-" + child.label
+                })
+              })
+            }
+          })
+          this.floorData = floorData
+          console.log(this.floorData)
+        } else {
+          this.$message.error(res.data.ResultMsg)
+        }
+      }).catch(() => {
+        this.$message.error("请求出错")
+      })
+    },
+    //将数组转换成optiosn格式
+    changeArr(arr) {
+      return arr.map(item => {
+        if (item.floors && item.floors.length) {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: item.floors.map(i => {
+              return {
+                value: i.id,
+                label: i.infos.FloorLocalName || "未知",
+              }
+            })
+          }
+        } else {
+          return {
+            value: item.id,
+            label: item.infos.BuildLocalName,
+            children: null,
+            isChilren: 1,
+          }
+        }
+      })
+    },
     changeRead() {
       this.onlyRead = !this.onlyRead
       this.getMain()
@@ -350,6 +413,9 @@ export default {
         })
         if (param.data.criterias.length) {
           BeatchQueryParam(param, res => {
+            if (!this.onlyRead) {
+              return false
+            }
             this.main = data.map(item => {
               res.Content.map(child => {
                 if (item.id == child.id) {
@@ -491,6 +557,15 @@ export default {
           readOnly: true
         }
       );
+      //   data.splice(1, 0, {
+      //     data: "flowBuild",
+      //     renderer: tools.customDropdownRenderer,
+      //     editor: "chosen",
+      //     chosenOptions: {
+      //       // multiple: true,//多选
+      //       data: this.floorData
+      //     }
+      //   })
       if (!!this.onlyRead) {
         data.map(item => {
           item.readOnly = true
@@ -837,6 +912,18 @@ export default {
 
     // 修改
     updateBusiness(data, change) {
+      console.log(data)
+      //   data.map(item => {
+      //       if (!!item.flowBuild) {
+      //       item.building_id = item.flowBuild.split("-")[0]
+      //       item.floor_id = item.flowBuild.split("-")[1] || null
+      //       //不存在floor字段去除floor
+      //       if (!item.floor_id) {
+      //         delete item.floor_id
+      //       }
+      //       delete item.flowBuild
+      //     }
+      //   })
       let param = {
         ProjId: this.mess.ProjId,
         secret: this.mess.secret,

+ 3 - 0
src/components/handsontables/system.vue

@@ -568,6 +568,9 @@ export default {
         })
         if (param.data.criterias.length) {
           BeatchQueryParam(param, res => {
+            if (!this.onlyRead) {
+              return false
+            }
             this.main = data.map(item => {
               res.Content.map(child => {
                 if (item.id == child.id) {

+ 40 - 15
src/components/table/businessTable.vue

@@ -43,7 +43,7 @@
 </template>
 
 <script>
-import { getBussines, createRelation } from "@/api/request";
+import { getBussines2, createRelation } from "@/api/request";
 import myPagination from "@/components/lib/myPagination.vue";
 export default {
   name: "equip-table",
@@ -80,20 +80,45 @@ export default {
       this.list = list;
       this.graphy = graphy;
       this.code = code
-      getBussines({
-        data: {
-          criteria: {
-            id: build.code,
-            graphId: graphy,
-            relType: !!code ? code.rel_type : "99",
-            exclude: "false",
-            side: 1,
-            type: [code.code == "GeneralZone" ? "Sp" : code.code]
-          }
-        },
-        ProjId: this.$route.query.projId,
-        secret: this.$route.query.secret
-      })
+      getBussines2(
+        //       {
+        //     data: {
+        //       criteria: {
+        //         id: build.code,
+        //         graphId: graphy,
+        //         relType: !!code ? code.rel_type : "99",
+        //         exclude: "false",
+        //         side: 1,
+        //         type: [code.code]
+        //       }
+        //     },
+        //     ProjId: this.$route.query.projId,
+        //     secret: this.$route.query.secret
+        //   }
+        {
+          data: {
+            criteria: {
+              id: build.code,
+              // graphId: this.graphyId,
+              // relType: this.spaceType.rel_type,
+              // exclude: false,
+              // side: 1,
+              type: [code.code],
+              "exclude": [            // 可选, 只查询指定图/关系中的对象
+                {
+                  "graphId": graphy,
+                  "graphType": code.code,
+                  "relType": !!code ? code.rel_type : "99",
+                  "side": "toId",
+                  // "fromId": "",                 // 选填
+                  // "toId": ""                    // 选填
+                }
+              ]
+            },
+          },
+          ProjId: this.$route.query.projId,
+          secret: this.$route.query.secret
+        })
         .then(res => {
           if (res.data.Result == "success") {
             this.allData = res.data.Content || [];

+ 1 - 1
src/components/table/equipTable.vue

@@ -265,7 +265,7 @@ export default {
             item.content.map(i => {
               if (i.code == system) {
                 i.content.map(e => {
-                  if ((e.code = last)) {
+                  if ((e.code == last)) {
                     text = e.facility;
                   }
                 });

+ 6 - 0
src/utils/hansontable/notShow.js

@@ -267,6 +267,9 @@ const showTools = {
                     return undefined
                 }
             }
+            if (item.InfoPointCode == "BIMLocation") {
+                return undefined
+            }
             if (item.Visible || !allMess) {
                 //固定不显示的code
                 if (!showTools.cantShow(item.InfoPointCode) && !onlyRead && !taizhang) {
@@ -368,6 +371,9 @@ const showTools = {
                     return undefined
                 }
             }
+            if (item.InfoPointCode == "BIMLocation") {
+                return undefined
+            }
             if (!!typeArr && typeArr.indexOf(item.InputMode) > -1) {
                 return undefined
             }

+ 25 - 4
src/views/buildingData1.vue

@@ -688,8 +688,16 @@ export default {
       };
       getdelMain(param).then(res => {
         if (res.data.Result == "success") {
-          this.myHotArr[this.tabChecked].loadData(res.data.FmList)
-          this.myHotMainArr[this.tabChecked] = res.data.FmList
+          let data = res.data.FmList
+          if (data && data.length) {
+            //如果数据存在,有localname取localname,否则取随机生成name
+            data = data.map(item => {
+              item.Infos.EquipLocalName = item.Infos.EquipLocalName || item.Infos.EquipName
+              return item
+            })
+          }
+          this.myHotArr[this.tabChecked].loadData(data)
+          this.myHotMainArr[this.tabChecked] = data
         } else {
           this.$message.error("请求错误:" + res.data.ResultMsg)
         }
@@ -1605,7 +1613,7 @@ export default {
         let venderParam = {
           "infoCode": splitArr[1],          //四种厂商类型名称[Manufacturer,Supplier,Maintainer,Insurer],品牌类型名称(Brand),型号类型名称(Specification)
           "infoValue": param[0][splitArr[0]][splitArr[1]],
-        }
+        }, falg = false, venderData = ""
         if (splitArr[1] == "Brand") {
           venderParam.manufacturerID = data[0].Infos.DPManufacturerID
         }
@@ -1613,7 +1621,14 @@ export default {
           venderParam.brandID = data[0].Infos.DPBrandID || null
           venderParam.eqFamily = data[0].Family
         }
-        let venderData = await this.getIdForVender(venderParam)
+        for (let k in venderParam) {
+          if (!venderParam[k]) {
+            falg = true
+          }
+        }
+        if (!falg) {
+          venderData = await this.getIdForVender(venderParam)
+        }
         if (!!venderData && venderData.hasOwnProperty("id")) {
           param.map(item => {
             if (item.Infos.hasOwnProperty(splitArr[1])) {
@@ -1870,6 +1885,7 @@ export default {
     },
 
     afterDocumentKeyDown(e) {
+      console.log(this.myHotArr[this.tabChecked].getActiveEditor())
       let activeEditer = this.myHotArr[this.tabChecked].getActiveEditor(),
         td = activeEditer.TD,
         row = activeEditer.row,
@@ -1907,6 +1923,7 @@ export default {
         this.$refs.recommend.randerData(infos, prop, this.myHotHeaderArr[this.tabChecked], true, val)
       })
     },
+
     //获取被筛选掉的行号
     trimmedRows() {
       // var plugin = hot.getPlugin('trimRows').trimmedRows;//获取被筛选掉的行号
@@ -1930,6 +1947,7 @@ export default {
       //     DataArray.push(this.myHotArr[this.tabChecked].getSourceDataAtRow(plugin[i]));
       // }
     },
+
     //去除数组中相同的元素
     array_diff(a, b) {
       for (var i = 0; i < b.length; i++) {
@@ -1942,6 +1960,7 @@ export default {
       }
       return a;
     },
+
     //清空所有实例
     clearHot() {
       this.myHotArr = this.myHotArr.map(item => {
@@ -1952,6 +1971,7 @@ export default {
         }
       });
     },
+
     //处理头部header方法
     delHeader(arr) {
       let readArr = ["A1", "A2", "B1", "C5", "D1", "D2", "X", "L", "L1", "L2"]
@@ -1960,6 +1980,7 @@ export default {
       console.log(data)
       return data;
     },
+
     //通过header生成columns
     getType(arr) {
       let data = showTools.changeTypes(arr, false, false, true, true, true)

File diff suppressed because it is too large
+ 345 - 760
src/views/coldside.vue