Browse Source

Merge branch 'dev' of git.sagacloud.cn:web/ibms into dev

zhangyu 4 years ago
parent
commit
7806a16c0d

+ 15 - 1
src/api/scan/request.js

@@ -1180,7 +1180,16 @@ export function queryEquip(param, success) {
   let url = `${baseUrl}/datacenter/equip/query`;
   http.postJson(url, param, success)
 }
-
+// //资产清单 - 查询资产信息
+// export function queryProperty(param, success) {
+//   let url = `${baseUrl}/datacenter/property/query`;
+//   http.postJson(url, param, success)
+// }
+//资产清单 - 更新资产
+// export function updateProperty(param, success) {
+//   let url = `${baseUrl}/datacenter/property/update`;
+//   http.postJson(url, param, success)
+// }
 //查询项目下的设备或部件-根据项目、建筑、楼层、设备或部件分类、业务空间实例筛选设备 然后通过计算匹配资产
 export function equipCategoryProperty(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/equip-category-property?category=${param.category}${param.spaceIdList?param.spaceIdList:''}`;
@@ -1218,6 +1227,11 @@ export function queryUpdate(param, success) {
   let url = `${baseUrl}/equip-component/equip-query/update`;
   http.postJson(url, param, success)
 }
+// 修改资产的附件功能
+export function propertyUpdate(param, success) {
+  let url = `${baseUrl}/equip-component/property/update`;
+  http.postJson(url, param, success)
+}
 //查询资产 同时关联设备信息
 export function propertyLinkEq(param, success) {
   let url = `${baseUrl}/equip-component/property/property-query`;

+ 25 - 6
src/components/config_point/step3_edit/index.vue

@@ -50,7 +50,7 @@
             </p>
             <!-- components -->
             <no-handle :ref='"noHandle"+index' v-if='it.DataRuleType == "无需处理,直接使用"' :noHandleShow='noHandleShow'></no-handle>
-            <auto-handle :ref='"autoHandle"+index' v-else-if='it.DataRuleType == "需自动单位转换"' :unitObj='it' :autoHandleShow='autoHandleShow'>
+            <auto-handle :ref='"autoHandle"+index' v-else-if='it.DataRuleType == "需自动单位转换"' :unitObj='it.unitObj' :autoHandleShow='autoHandleShow'>
             </auto-handle>
             <enum-handle :ref='"enumHandle"+index' v-else-if='it.DataRuleType == "需按设置枚举转换"' :enumHandleShow='enumHandleShow'></enum-handle>
             <formula-handle :ref='"formulaHandle"+index' v-else-if='it.DataRuleType == "需按公式转换"' :formulaHandleShow='formulaHandleShow'>
@@ -213,7 +213,7 @@ export default {
                 let componsplitHandle = `splitHandle${i}`
                 this.$refs[componsplitHandle][0].getForm(splitHandle => {
                   if (splitHandle) {
-                    this.typeList[i].other = formulaHandle
+                    this.typeList[i].other = splitHandle
                     // this.saveForm(this.form, splitHandle)
                   } else {
                     this.errMsg()
@@ -500,8 +500,6 @@ export default {
       let length = val.RelationList.length
       let eqMark = this.editData.Point.EquipmentMark
       this.form.EquipmentMark = eqMark;
-      console.log('-------------')
-      console.log(val)
       if (length) {
         var data = val.RelationList[0]
         let dict = [data.SpecialtyCode, data.SystemCode, data.EquipmentTypeCode]
@@ -511,19 +509,29 @@ export default {
           let eachData = [];
           if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
             eachData = [t.TypeCode, t.EquipmentTypeCode, t.InfomationPointCode]
+            if (this.pointToRelationID[`${t.TypeCode}-${t.EquipmentTypeCode}-${t.InfomationPointCode}`]) {
+              return undefined
+            }
             this.pointToRelationID[`${t.TypeCode}-${t.EquipmentTypeCode}-${t.InfomationPointCode}`] = t.Id
           } else if (t.TypeCode == 'Sy') {
             eachData = [t.TypeCode, t.SpecialtyCode, t.SystemCode, t.InfomationPointCode]
+            if (this.pointToRelationID[`${t.TypeCode}-${t.SpecialtyCode}-${t.SystemCode}-${t.InfomationPointCode}`]) {
+              return undefined
+            }
             this.pointToRelationID[`${t.TypeCode}-${t.SpecialtyCode}-${t.SystemCode}-${t.InfomationPointCode}`] = t.Id
           } else {
             eachData = [t.TypeCode, t.InfomationPointCode]
+            if (this.pointToRelationID[`${t.TypeCode}-${t.InfomationPointCode}`]) {
+              return undefined
+            }
             this.pointToRelationID[`${t.TypeCode}-${t.InfomationPointCode}`] = t.Id
           }
           return eachData;
-        })
+        }).filter(item => item)
         this.$nextTick(() => {
           this.$refs.dictionaryCas.setCascaderVal(tempArr);
         })
+        let typeTempList = []
         this.typeList = val.RelationList.map(t => {
           if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
             t.name = `${t.Type}-${t.EquipmentType}-${t.InfomationPoint}`
@@ -532,8 +540,12 @@ export default {
           } else {
             t.name = `${t.Type}-${t.InfomationPoint}`
           }
+          if (typeTempList.indexOf(t.name) > -1) {
+            return undefined
+          }
+          typeTempList.push(t.name)
           return t;
-        });
+        }).filter(item => item);
         this.form.DataRuleType = data.DataRuleType
         // this.handleItemChange(dict, () => {
         // this.unitObj = this.infoDict[data.InfomationPointCode]
@@ -690,6 +702,13 @@ export default {
         })
       }
       this.typeList = this.typeList.map((t, i) => {
+        t.unitObj = {
+          infoPointCode: data[val[i][val[i].length - 1]].InfoPointCode,
+          infoPointName: data[val[i][val[i].length - 1]].InfoPointName,
+          dataSource: data[val[i][val[i].length - 1]].DataSource || '',
+          type: data[val[i][val[i].length - 1]].Type,
+          unit: data[val[i][val[i].length - 1]].Unit
+        }
         t.ValueDescription = this.delDataSource(data[val[i][val[i].length - 1]].DataSource)
         return t;
       })

+ 18 - 7
src/components/dialogs/list/batchDialog.vue

@@ -138,6 +138,7 @@
 <script>
   import myPagination from "@/components/ledger/lib/myPagination"
   import tools from "@/utils/buildfloor/tools";
+
   export default {
     name: "batchDialog",
     props: ['firmName', 'allObject', 'page', 'information','newEnclosure'],
@@ -360,24 +361,31 @@
           }
         })
         let insurance = this.checkedCities.filter(item => item.num === 42)
+        let param = {}
+        this.newEnclosure.forEach(({Path, value}) => param[Path] = value)
+        let file = param['LedgerParam.InsuranceDoc.InsuranceFile']
         if (insurance.length) {
           insurance.forEach(i => {  //保险
             if (i.info) {
+
               let {website, name, venderId} = i.info
               single.InsuranceDoc = {
                 Insurer: name,
                 InsurerWeb: website,
-                InsuranceFile: this.information.insuranceFile.InsuranceFile.length && this.radio === 2 ? this.information.insuranceFile.InsuranceFile : undefined
+                InsuranceFile: file && file.length > 0 && this.radio === 2 ? file : ''
               }
               Id.DPInsurerID = venderId
+
             }
           })
         } else {
-          if (this.radio === 2 && this.information.insuranceFile.InsuranceFile.length) {
+
+          if (this.radio === 2 && file && file.length > 0) {
             single.InsuranceDoc = {
-              InsuranceFile: this.information.insuranceFile.InsuranceFile.length ? this.information.insuranceFile.InsuranceFile : undefined
+              InsuranceFile: file
             }
           }
+
         }
 
         // this.information 多选信息
@@ -398,13 +406,16 @@
           this.$emit('upDataDevice', 1, arr1, arr2)
         }
         if (this.radio === 2) {
-          let param = {}
-          this.newEnclosure.forEach(({Path,value})=>param[Path] = value)
-          param =  tools.formatData(param)
+          let param = {},singleList = {}
+          this.newEnclosure.forEach(({Path, value}) => param[Path] = value)
+          singleList.LedgerParam = {...single}
+          let pa = Object.assign(param,singleList)
+          pa = tools.formatData(pa)
           let arr3 = this.deepCopy(arr).map(item => ({
             ...Id,
             ...item,
-            ...param
+            ...pa,
+
           }))
           this.$emit('upDataDevice', 2, arr3)
         }

+ 0 - 1
src/components/dialogs/list/firm.vue

@@ -177,7 +177,6 @@ export default {
                         this.tableData = res.content
                     })
                 }
-                console.log(this.tableData)
             },
             handleChangeType(item) {
                 this.page.total = 0

+ 129 - 47
src/components/ledger/handsontables/assets.vue

@@ -15,24 +15,31 @@
         <el-option v-for="item in showTypes" :key="item.value" :label="item.label" :value="item.value"></el-option>
       </el-select>
       <el-button size="small" style="width: 80px;" @click="addDevice" icon="iconfont icon-tianjia">添加资产</el-button>
-<!--      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点-->
-<!--      </el-button>-->
+      <el-button size="small" @click="Batch" v-show="!onlyRead" :disabled="!(tableData && tableData.length)">批量维护信息点
+      </el-button>
       <el-button size="small" style="width: 80px;" @click="reset" icon="iconfont icon-shuaxin">刷新</el-button>
       <el-button v-show="!onlyRead" size="small" style="width: 80px;" @click="undo" icon="iconfont icon-undo">撤销
       </el-button>
     </div>
     <qrcode :qrcodeUrl="qrcodeUrl" :dialog="myDialog" :addBody="true" ref="qrcode"/>
-    <firm   :firmDataType="firmDataType" ref="firm" :mess="mess" @changeFirm="firmChange" :dialog="myDialog"/>
+    <firm
+      :firmDataType="firmDataType"
+      ref="firm"
+      :mess="mess"
+      @changeFirm="firmChange"
+      :dialog="myDialog"
+    />
     <supply-dialog @change="supplyChange" ref="supply" :id="id" :dialog="myDialog"/>
-    <supplier-dialog   :firmDataType="firmDataType" ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
+    <supplier-dialog :firmDataType="firmDataType" ref="supplier" @changeSupplier="supplierChange" :dialog="myDialog"/>
     <guarantee-dialog @change="guaranteeChange" :id="id" ref="guarantee" :dialog="myDialog"/>
     <upload-files-dialog
-        :read="onlyRead ? true : false"
-        ref="upload"
-        @changeFile="fileChange"
-        :keysArr="filesArr"
-        :dialog="myDialog"
-        :firmDataType="firmDataType"
+      :read="onlyRead ? true : false"
+      ref="upload"
+      @changeFile="fileChange"
+      :keysArr="filesArr"
+      :dialog="myDialog"
+      :firmDataType="firmDataType"
+      :infoType="infoType"
     />
     <upload-img-dialog
         :read="onlyRead ? true : false"
@@ -40,6 +47,7 @@
         :keysArr="imgsArr"
         :dialog="myDialog"
         :firmDataType="firmDataType"
+        :infoType="infoType"
     />
     <maintainer-dialog
         @changeMaintainer="changeMaintainer"
@@ -59,6 +67,7 @@
       :keysArr="picsArr"
       @change="changePics"
       :firmDataType="firmDataType"
+      :infoType="infoType"
     />
     <div class="center middle_sty" style="height: 91%" v-show="!mess.deviceId && (!tableData || !tableData.length)">
       <p>
@@ -139,28 +148,34 @@
     deleteProperty,
     getDataDictionary,
     propertyLinkEq,
-    updateProperty,
-    queryEquip, //替换掉
-    queryUpdate,//替换掉
-    updateEquip//替换掉
+    queryProperty,
+    propertyUpdate,
+    updateProperty
   } from "@/api/scan/request";
 
   import tools from "@/utils/scan/tools"
   import handsonUtils from "@/utils/scan/hasontableUtils"
   import showTools from "@/utils/handsontable/notShow"
   import buildFloor from '@/utils/handsontable/buildFloorData'
+  import firm from "@/components/dialogs/list/firm"
+  import supplierDialog from "@/components/dialogs/list/supplierDialog"
+  import uploadFilesDialog from "@/components/dialogs/list/filesDialog"
+  import uploadImgDialog from "@/components/dialogs/list/uploadImgDialog"
+  import maintainerDialog from "@/components/dialogs/list/maintainerDialog"
+  import insurerDialog from "@/components/dialogs/list/insurerDialog"
+  import picDialog from "@/components/dialogs/list/picDialog"
 
   import qrcode from "@/components/business_space/lib/qrcode"
-  import firm from "@/components/business_space/dialogs/list/firm"
+  // import firm from "@/components/business_space/dialogs/list/firm"
   import supplyDialog from "@/components/business_space/dialogs/list/supplyDialog"
-  import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog"
-  import maintainerDialog from "@/components/business_space/dialogs/list/maintainerDialog"
-  import insurerDialog from "@/components/business_space/dialogs/list/insurerDialog"
+  // import supplierDialog from "@/components/business_space/dialogs/list/supplierDialog"
+  // import maintainerDialog from "@/components/business_space/dialogs/list/maintainerDialog"
+  // import insurerDialog from "@/components/business_space/dialogs/list/insurerDialog"
   import guaranteeDialog from "@/components/business_space/dialogs/list/guaranteeDialog"
-  import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
-  import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
+  // import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
+  // import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
   // import detailsDialog from "@/components/business_space/lib/detailsDia"
-  import picDialog from "@/components/business_space/dialogs/list/picDialog"
+  // import picDialog from "@/components/business_space/dialogs/list/picDialog"
   import myPagination from "@/components/common/myPagination"
   import myCascader from "@/components/ledger/lib/assets"
   import floorCascader from "@/components/ledger/lib/floorCascader"
@@ -209,6 +224,7 @@
     },
     data() {
       return {
+        infoType: '',
         batchPage: {
           size: 50,
           sizes: [10, 30, 50, 100, 150, 200],
@@ -317,7 +333,7 @@
               }
             })
             this.getTableData()
-            this.getTableData()
+            this.getAllData()
             //  信息维护
             this.newEnclosure = res.Content.filter(i=>i.InputMode =='F2')
           });
@@ -373,30 +389,34 @@
           let params = {
             "Cascade": [
               {
-                "Name": "property",
-                "Projection": [
-                  "Family", "EquipLocalName", "EquipLocalID", "EquipID", "CodeType"
+                "Name":"building",
+                "Projection":[
+                  "BuildLocalName",
+                  "BuildName",
+                  "BuildID"
                 ]
               },
               {
-                "Name": "building",
-                "Projection": [
-                  "BuildLocalName", "BuildName", "BuildID"
-                ]
-              },
-              {
-                "Name": "floor",
-                "Projection": [
-                  "FloorLocalName", "FloorName", "FloorID"
+                "Name":"floor",
+                "Projection":[
+                  "FloorLocalName",
+                  "FloorName",
+                  "FloorID"
                 ]
               }
             ],
-            Filters: `category='${this.mess.deviceId}'`,
+            Filters: `Family='${this.mess.deviceId}'`,
             PageSize: this.batchPage.size,
             Orders: "createTime desc, EquipID desc",
             PageNumber: this.batchPage.currentPage,
             "Projection": [
-              "BuildingId", "FloorId", "Category", "EquipLocalName", "EquipLocalID", "EquipID", "BIMID"
+              "BuildingId",
+              "FloorId",
+              "Family",
+              "EquipLocalName",
+              "EquipLocalID",
+              "EquipID",
+              "BIMID"
             ]
           };
           if (this.mess.buildId == "noKnow") {
@@ -410,7 +430,7 @@
           } else if (this.mess.floorId && this.mess.floorId != "all") {
             params.Filters += `;floorId='${this.mess.floorId}'`
           }
-          queryEquip(params, res => {
+          queryProperty(params, res => {
             this.allObject = res.Content
             this.batchPage.total = res.Total
           })
@@ -846,6 +866,7 @@
         let inputData = this.inputMap[val];
         this.row = row.row;
         this.messKey = val;
+        this.firmDataType = 'row'
         switch (val) {
           //操作
           case 'caozuo':
@@ -1045,7 +1066,11 @@
         return a;
       },
       //如果选择供应商之后
-      supplierChange(data) {
+      supplierChange(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 8}
+          this.firmName = firm
+        } else {
         tools.setDataForKey(this.tableData[this.row], "DPSupplierID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.SupplyPurchase.Supplier", data.name)
         this.handleUpdataTable(
@@ -1056,6 +1081,7 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.SupplyPurchase.Supplier", null, data.name]], "edit")
+        }
       },
       //供应合同编号
       supplyChange(data) {
@@ -1074,7 +1100,20 @@
         }
       },
       //选择型号修改
-      firmChange(data) {
+      firmChange(data,type) {
+        if (type === 'dialog') { // 如果是批量信息维护
+          let venderName = data.venderName ? data.venderName : '空'
+          let brandName = data.brandName ? data.brandName : '空'
+          let name = data.name ? data.name : '空'
+          let firm = {
+            ...data,
+            num: 2,
+            Specification: data.name,
+            name: `${venderName}/${brandName}/${name}`
+          }
+          this.firmName = firm //批量维护dialog显示对象的字段
+        } else {
+
         tools.setDataForKey(this.tableData[this.row], "DPManufacturerID", data.venderId)//生产商ID
         tools.setDataForKey(this.tableData[this.row], "DPBrandID", data.brandId)//品牌ID
         tools.setDataForKey(this.tableData[this.row], "DPSpecificationID", data.specificationId)//型号ID
@@ -1094,9 +1133,14 @@
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Brand", null, data.brand]], "edit")
         // this.handleUpdataTable([[this.row, "LedgerParam.EquipManufactor.Specification", null, data.name]], "edit")
+        }
       },
       //保险商变更
-      changeInsurer(data) {
+      changeInsurer(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 42}
+          this.firmName = firm
+        } else {
         tools.setDataForKey(this.tableData[this.row], "DPInsurerID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.InsuranceDoc.Insurer", data.name)
         this.handleUpdataTable(
@@ -1107,9 +1151,15 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.InsuranceDoc.Insurer", null, data.name]], "edit")
+        }
       },
       //维修商变更
-      changeMaintainer(data) {
+      changeMaintainer(data,type) {
+        if (type === 'dialog') {
+          let firm = {...data, num: 35}
+          this.firmName = firm
+        } else {
+
         tools.setDataForKey(this.tableData[this.row], "DPMaintainerID", data.venderId)
         tools.setDataForKey(this.tableData[this.row], "LedgerParam.OperationMainte.Maintainer", data.name)
         this.handleUpdataTable(
@@ -1120,6 +1170,7 @@
           "edit"
         )
         // this.handleUpdataTable([[this.row, "LedgerParam.OperationMainte.Maintainer", null, data.name]], "edit")
+        }
       },
       //修改关联的资产
       changeProperty(val) {
@@ -1127,20 +1178,51 @@
         this.setDataToMain(val.LinkEquipLocalName, 'LinkEquipLocalName', this.row);
       },
       //上传文件弹窗触发事件
-      fileChange(keys) {
+      fileChange(keys,type,file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
+
+        } else {
         this.setDataToMain(keys, this.messKey, this.row);
+        }
       },
       //上传图片弹窗触发事件
-      imgChange(keys) {
+      imgChange(keys,type, file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
+        } else {
         this.setDataToMain(keys, this.messKey, this.row);
+        }
       },
       //关联系统更改
       changeSystemType(data) {
         tools.setDataForKey(this.tableData[this.row], "LinkSystem", data)
       },
       //资产图片弹窗改变事件
-      changePics(keys) {
+      changePics(keys,type,file) {
+        if (type === 'dialog') {
+          // this.information = keys
+          this.newEnclosure.forEach(i => {
+            if (i.Path == keys) {
+              this.$set(i, 'value', file)
+            }
+            return i
+          })
+        } else {
         this.setDataToMain(keys, this.messKey, this.row);
+        }
       },
       utilToKey(key, name, data, messName) {
         if (key == name) {
@@ -1302,12 +1384,12 @@
           let filterParam = this.filterCheck(param, 'sole')
           let filterParam1 = this.filterCheck(param1, 'multiple')
           if (filterParam) {
-            updateEquip(param, res => {
+            updateProperty(param, res => {
             });
           }
           if (filterParam1) {
             setTimeout(() => {
-              queryUpdate(param1, res => {
+              propertyUpdate(param1, res => {
               })
             })
 
@@ -1316,7 +1398,7 @@
         if (type === 2) {//覆盖
           let filterParams = this.filterCheck(param, 'sole')
           if (filterParams) {
-            updateEquip(param, res => {
+            updateProperty(param, res => {
             });
           }
         }

+ 21 - 17
src/components/ledger/handsontables/device.vue

@@ -49,26 +49,30 @@
     />
     <!--      上传图片-->
     <upload-img-dialog
-        :read="onlyRead ? true : false"
-        @changeFile="imgChange"
-        :keysArr="imgsArr"
-        :dialog="myDialog"
-        :firmDataType="firmDataType"
-        :information="information"
-        :infoType="infoType"
+      :read="onlyRead ? true : false"
+      @changeFile="imgChange"
+      :keysArr="imgsArr"
+      :dialog="myDialog"
+      :firmDataType="firmDataType"
+      :information="information"
+      :infoType="infoType"
     />
     <!--      维修商信息-->
-    <maintainer-dialog @changeMaintainer="changeMaintainer" :firmDataType="firmDataType" ref="maintainer"
-                       :dialog="myDialog"/>
+    <maintainer-dialog
+      @changeMaintainer="changeMaintainer"
+      :firmDataType="firmDataType"
+      ref="maintainer"
+      :dialog="myDialog"
+    />
     <insurer-dialog @changeInsurer="changeInsurer" :firmDataType="firmDataType" ref="insurer" :dialog="myDialog"/>
     <pic-dialog
-        :read="onlyRead ? true : false"
-        :dialog="myDialog"
-        :keysArr="picsArr"
-        @change="changePics"
-        :firmDataType="firmDataType"
-        :information="information"
-        :infoType="infoType"
+      :read="onlyRead ? true : false"
+      :dialog="myDialog"
+      :keysArr="picsArr"
+      @change="changePics"
+      :firmDataType="firmDataType"
+      :information="information"
+      :infoType="infoType"
     />
     <div class=" middle_sty" style="height: 91%; text-align:center"
          v-show="!mess.deviceId && (!tableData || !tableData.length)">
@@ -1357,7 +1361,7 @@
         } else {
           this.setDataToMain(keys, this.messKey, this.row);
         }
-        this.$forceUpdate()
+
       },
       //上传图片弹窗触发事件
       imgChange(keys, type, file) {

+ 69 - 8
src/components/point/report/dataSource.vue

@@ -3,7 +3,7 @@
   <div id="dataSource" v-loading="loading">
     <div class="data-item" v-for="form in forms" :key="form.id">
       <el-form :model="form" label-width="150px">
-        <el-form-item label="数据源名称">
+        <el-form-item label="数据源名称:">
           {{form.Name || '--'}}
         </el-form-item>
         <el-form-item label="值单位说明:">
@@ -12,14 +12,17 @@
         <el-form-item label="原始点位值:">
           {{form.Data || '--'}}
         </el-form-item>
-        <el-form-item label="原始点位描述">
+        <el-form-item label="原始点位描述:">
           {{form.Description || '--'}}
         </el-form-item>
-        <el-form-item label="位置标签">
+        <el-form-item label="位置标签:">
           {{form.LocationFlag.toString() || '--'}}
         </el-form-item>
-        <el-form-item label="原始值处理规则详情:">
-          {{form.DataRuleContent  || '--'}}
+        <el-form-item label="原始值处理方式:">
+          {{form.DataRuleType  || '--'}}
+        </el-form-item>
+        <el-form-item label="原始值处理规则详情:">
+          {{form.des  || '--'}}
         </el-form-item>
       </el-form>
     </div>
@@ -35,7 +38,13 @@ export default {
     return {
       forms: [
       ],
-      loading: true
+      loading: true,
+      toMap: {
+        plus: '+',
+        minus: '-',
+        time: '*',
+        divide: '/',
+      }
     }
   },
   methods: {
@@ -46,9 +55,61 @@ export default {
         Filters: "Infos='" + this.tabFunNum + "'"
       };
       getTabFunNumSourceData(pa, res => {
-        this.forms = res.Content;
+        this.forms = res.Content.map(t => {
+          if (t.DataRuleContent) {
+            t.des = this.formatContent(t.DataRuleType, t.DataRuleContent, t.EquipmentMark);
+          }
+          return t;
+        });
         this.loading = false;
       });
+    },
+    formatContent(type, data, EquipmentMark) {
+      let str = '', json = JSON.parse(data);
+      if (type == '需按设置枚举转换') {
+        try {
+          json[0].content.forEach(t => {
+            str += `如果原始值为${t.from}时,则转换为标准值${t.to};`
+          })
+        } catch (err) {
+          console.log(err)
+        }
+      } else if (type == '需自动单位转换') {
+        try {
+          json[0].content.forEach(t => {
+            str = `原始值单位转换为${t.from};`
+          })
+        } catch (err) {
+          console.log(err)
+        }
+      } else if (type == '需按公式转换') {
+        try {
+          json.forEach(t => {
+            if (t.ruletype == "type4") {
+              str += `截取原始值第${t.content[0].from}位-第${t.content[0].to}位;`
+            } else if (t.ruletype == "type5") {
+              str += `仅提取其中的数值;`
+            } else if (t.ruletype == "type6") {
+              str += `数值用公式计算:(公式为:数值${this.toMap[t.content[0].calculationtype]}${t.content[0].value}公式计算);`
+            }
+          })
+        } catch (err) {
+          console.log(err)
+        }
+      } else if (type == '需拆分处理') {
+        try {
+          json.forEach(t => {
+            if (t.ruletype == "type4") {
+              str += `截取原始值第${t.content[0].from}位-第${t.content[0].to}位,为对象标识${EquipmentMark};`
+            } else if (t.ruletype == "type2") {
+              str += `如果截取部分的原始值为${t.content[0].from}时,则转换为标准值${t.content[0].to};`
+            }
+          })
+        } catch (err) {
+          console.log(err)
+        }
+      }
+      return str;
     }
   },
   props: {
@@ -72,7 +133,7 @@ export default {
 }
 .data-item {
   margin: 15px 10px;
-  box-shadow: 0px 4px 10px 0px rgba(0,0,0,0.2);
+  box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.2);
   background-color: white;
   padding: 10px 10px;
 }

+ 25 - 15
src/views/point/config_point/steps/step3.vue

@@ -161,23 +161,33 @@
                         if (item.RelationList.length) {
                             item.Point.DataRuleType = item.RelationList[0].DataRuleType
                             item.Point.PhysicalRelated = '';
-                            item.RelationList.forEach(t => {
-                                if (item.Point.PhysicalRelated) {
-                                    item.Point.PhysicalRelated += '/' + t.Type;
-                                } else {
-                                    item.Point.PhysicalRelated = t.Type;
-                                }
-                                //设备-部件-空间
+                            let tempArr =  item.RelationList.map(t => {
                                 if(t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp'){
-                                    item.Point.PhysicalRelated += '-' + t.EquipmentType
-                                }
-                                //系统
-                                if(t.TypeCode == 'Sy'){
-                                    item.Point.PhysicalRelated += '-' + t.Specialty
-                                    item.Point.PhysicalRelated += '-' + t.System
+                                    //设备-部件-空间
+                                    let str = `${t.Type}-${t.EquipmentType}-${t.InfomationPoint}`
+                                    if(item.Point.PhysicalRelated.indexOf(str)>-1){
+                                        return undefined
+                                    }
+                                    item.Point.PhysicalRelated += str
+                                    return str;
+                                } else if(t.TypeCode == 'Sy'){
+                                    //系统
+                                    let str = `${t.Type}-${t.Specialty}-${t.System}-${t.InfomationPoint}`
+                                    if(item.Point.PhysicalRelated.indexOf(str)>-1){
+                                        return undefined
+                                    }
+                                    item.Point.PhysicalRelated += str
+                                    return str
+                                } else {
+                                    let str = `${t.Type}-${t.InfomationPoint}`
+                                    if(item.Point.PhysicalRelated.indexOf(str)>-1){
+                                        return undefined
+                                    }
+                                    item.Point.PhysicalRelated += str
+                                    return str
                                 }
-                                item.Point.PhysicalRelated += '-' + t.InfomationPoint
-                            })
+                            }).filter(data => data)
+                            item.Point.PhysicalRelated = tempArr.join('/');
                         }
                         return item
                     })