Browse Source

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

shaun-sheep 4 years ago
parent
commit
f67b9b5454

+ 29 - 6
src/components/business_space/business/handsontable.vue

@@ -99,7 +99,8 @@ import dialogZone from "../../ledger/addDialog/dialogZone";
 export default {
   props: {
     id: {},
-    zoneCode: {}
+    zoneCode: {},
+    otherType: String
   },
   components: {
     qrcode, //二维码页面
@@ -819,7 +820,16 @@ export default {
     },
     /**  页面中的按钮事件--------------------------- */
     addSp() {
-      this.myDialog.addSpace = true
+      this.myDialog.addSpace = true;
+      if (this.zoneCode && this.zoneCode != 'OtherZone') {
+        this.$nextTick(() => {
+          this.$refs.cascader.setValue([this.zoneCode])
+        })
+      } else if (this.zoneCode == 'OtherZone' && this.OtherValue) {
+        this.$nextTick(() => {
+          this.$refs.cascader.setValue([this.zoneCode,this.OtherValue])
+        })
+      }
       // if (this.main && this.main.length && this.main[0].RoomID) {
       //   this.hot.destroy()
       //   this.hot = null
@@ -846,10 +856,19 @@ export default {
       }
     },
     //选择业务空间类型-添加业务空间
-    changeAddType(val, item) {
-      this.addData.spaceType = val;
-      this.addData.spaceName = item.Name;
-      this.addData.showType = this.showType;
+    changeAddType(val, item, value) {
+      if (value.length == 2 && value[0] == "OtherZone") {
+        this.addData.spaceType = val;
+        this.addData.otherType = value[0]
+        this.addData.spaceName = `其他分区-${item.Name}`;
+        this.addData.showType = this.showType;
+        this.addData.buildFloorSelectd = this.buildFloorSelectd;
+      } else {
+        this.addData.spaceType = val;
+        this.addData.spaceName = item.Name;
+        this.addData.showType = this.showType;
+        this.addData.buildFloorSelectd = this.buildFloorSelectd;
+      }
     },
     //刷新
     reset() {
@@ -909,6 +928,10 @@ export default {
         } else {
           this.OtherList = []
         }
+        if (this.otherType) {
+          this.OtherValue = this.otherType
+          this.changeOtherZone(this.otherType)
+        }
       })
     },
     // 其他类型下拉change

+ 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;
       })

+ 1 - 1
src/components/dialogs/config/infoPoint.vue

@@ -4,7 +4,7 @@
       <el-form-item label="方案:">
         <el-radio-group v-model="form.SchemeId">
           <el-radio label="schemeZero">全新设定</el-radio>
-          <el-radio label="schemeOne">预置方案1</el-radio>
+          <el-radio label="schemeOne">预置方案</el-radio>
           <el-radio label="schemeTwo">万达专用方案</el-radio>
         </el-radio-group>
       </el-form-item>

+ 7 - 2
src/components/ledger/lib/spaceSelect.vue

@@ -14,7 +14,7 @@
 </template>
 
 <script>
-import { queryDictionaryHead, queryAllZoneType } from '@/api/scan/request';
+import { queryAllZoneType } from '@/api/scan/request';
 import { mapGetters } from 'vuex'
 export default {
   computed: {
@@ -37,11 +37,16 @@ export default {
     }
   },
   methods: {
+    setValue(val) {
+      this.value = val;
+      this.changeVal(val);
+    },
     //获取下拉框数据
     getOptionData() {
       let params1 = {Cascade: [{ Name: 'zoneType', Filters: `ProjectId='${this.projectId}'` }]}
       queryAllZoneType(params1, res => {
         this.options = res.Content;
+        this.changeVal(this.value);
       })
     },
     //改变空间
@@ -61,7 +66,7 @@ export default {
           }
         }
       })
-      this.$emit('change', val, space)
+      this.$emit('change', val, space, value)
     }
   },
   created() {

+ 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;
 }

+ 4 - 3
src/views/ledger/spacelist/index.vue

@@ -45,7 +45,7 @@
           @updateState="updateStateSuc"></graphy>
       </div>
       <div v-show="isMyTab == 2">
-        <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :id="`handsontable${activeName}`"></handsontable-main>
+        <handsontable-main @lookEqu="lookEqu" ref="handsontable" :zoneCode="activeName" :otherType="otherType" :id="`handsontable${activeName}`"></handsontable-main>
       </div>
       <div class="infectedTips" v-show="isMyTab==1&&infectedTotal>0">
         <p>因底图变化而受影响的业务空间{{infectedTotal.toString()}}个<span v-show="buildFloorSelectd.length>1">,本层受影响的业务空间{{infectedCurfloor.toString()}}个</span></p>
@@ -131,7 +131,8 @@ export default {
       needCalculate: false, // 关系是否需要计算
       mutiCount: 0,
       infectedTotal: 0,
-      infectedCurfloor: 0
+      infectedCurfloor: 0,
+      otherType: ''
     };
   },
   created() {
@@ -214,9 +215,9 @@ export default {
         }).filter(item => item);
         if (this.childBackParam.zone) {
           this.activeName = this.childBackParam.zone;
-
           this.buildFloorSelectd = this.childBackParam.buildFloorSelectd;
           this.isMyTab = this.childBackParam.isMyTab;
+          this.otherType = this.childBackParam.otherType;
         } else if (this.activeName == '0') {
           this.activeName = 'GeneralZone';
         }

+ 26 - 4
src/views/ledger/spacelist/spaceadd/index.vue

@@ -104,7 +104,27 @@ export default {
     };
   },
   computed: {
-    ...mapGetters("layout", ["projectId", "secret", "userId"])
+    ...mapGetters("layout", ["projectId", "secret", "userId"]),
+    flowBuild() {
+      let buildFloorSelectd = this.space.buildFloorSelectd
+      if (buildFloorSelectd && buildFloorSelectd.length == 0) {
+        return ""
+      } else if (buildFloorSelectd && buildFloorSelectd.length == 1){
+        let build = buildFloorSelectd[0]
+        if (build == 'all' && build == 'noKnow') {
+          return ""
+        } else {
+          return build
+        }
+      } else if (buildFloorSelectd && buildFloorSelectd.length == 2) {
+        let build = buildFloorSelectd[0], floor = buildFloorSelectd[1];
+        if (build && (floor == 'all' || floor == 'noKnow')) {
+          return build
+        } else {
+          return `${build}-${floor}`
+        }
+      }
+    }
   },
   created() {
     this.space = this.$route.query;
@@ -129,6 +149,7 @@ export default {
             this.inputMap[item.Path] = item
           }
         })
+        this.tableData[0].flowBuild = this.flowBuild
         this.initTable();
       });
     },
@@ -180,9 +201,10 @@ export default {
         this.$router.push({
           name: "spacelist",
           params: {
-            zone: this.space.spaceType,
+            zone: this.space.otherType?this.space.otherType:this.space.spaceType,
             buildFloorSelectd: ['all'],
-            isMyTab: '2'
+            isMyTab: '2',
+            otherType: this.space.otherType?this.space.spaceType:''
           }
         });
       })
@@ -196,7 +218,7 @@ export default {
     handleAddTableRow() {
       let addRowLength = this.addNum;
       for (let i = 0; i < addRowLength; i++) {
-        this.tableData.push({ Checked: 1 });
+        this.tableData.push({flowBuild:this.flowBuild});
       }
       this.initTable();
       this.formaTableData();

+ 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
                     })

+ 4 - 0
src/views/ready/collectsetting/index.vue

@@ -1142,6 +1142,10 @@
               white-space: nowrap;
               text-overflow: ellipsis;
             }
+
+            /deep/ .el-checkbox__label {
+              display: initial;
+            }
           }
         }
       }