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

点位配置一对多.处理方式等

haojianlong 5 лет назад
Родитель
Сommit
92f5029b98

+ 14 - 8
src/components/config_point/dictionaryCascader.vue

@@ -2,8 +2,9 @@
   <div>
     <el-form ref="form" :rules='rules' :model="form">
       <el-form-item prop="dict" class="cascader-container">
-        <el-cascader :options='options' v-model='form.dict' :props='props' filterable @change="changeSelect" ref="dictCas">
-        </el-cascader>
+        <el-cascader-multi :data='options' v-model='form.dict' :value-key='props.value' :label-key='props.label' :children-key='props.children'
+          filterable :popper-class="'select'" @change="changeSelect" ref="dictCas" :only-last="true" :no-data-text='"无数据"'>
+        </el-cascader-multi>
         <el-tooltip class="item" effect="dark" :content="`于${cacheTime}缓存,点击重新缓存`" placement="top">
           <el-button icon="el-icon-refresh" class="update-button" @click="getDictionary"></el-button>
         </el-tooltip>
@@ -52,9 +53,13 @@ export default {
     },
     changeSelect(val) {
       setTimeout(() => {
-        if (this.$refs.dictCas.getCheckedNodes()[0]) {
-          let labels = this.$refs.dictCas.getCheckedNodes()[0].pathLabels;
-          let data = this.$refs.dictCas.getCheckedNodes()[0].data;
+        if (this.$refs.dictCas) {
+          let labels = this.$refs.dictCas.selectedLabels;
+          let data = {};
+          this.$refs.dictCas.selectedNodes.forEach(t => {
+            let key = t.InfoPointCode;
+            data[key] = t;
+          });
           this.$emit('change', { val: val, labels: labels, data: data })
         }
       }, 500)
@@ -79,17 +84,18 @@ export default {
 <style lang="less" scoped>
 .cascader-container.el-form-item--small.el-form-item {
   margin-bottom: 0;
-  /deep/ .el-cascader {
-    width: 89%;
+  .el-form-item__content div:nth-child(1) {
+    width: 89% !important;
     display: block;
     float: left;
-    .el-input .el-input__inner {
+    /deep/ .el-input .el-input__inner {
       border-radius: 4px 0 0 4px;
       vertical-align: bottom;
     }
   }
   .update-button {
     display: block;
+    height: 32px;
     float: left;
     border-left: 0;
     border-radius: 0 4px 4px 0;

+ 3 - 3
src/components/config_point/step3_edit/auto_handle.vue

@@ -1,8 +1,8 @@
 <template>
     <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-        <el-form-item v-if='devFlag' ref='form' label='对象标识' prop='EquipmentMark'>
+        <!-- <el-form-item v-if='devFlag' ref='form' label='对象标识' prop='EquipmentMark'>
             <el-input v-model='form.EquipmentMark'></el-input>
-        </el-form-item>
+        </el-form-item> -->
         <el-form-item
             label='原始点位值单位'
             prop='unit'
@@ -31,7 +31,7 @@ export default {
                 unit: [],
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
             }
         }
     },

+ 3 - 3
src/components/config_point/step3_edit/enum_handle.vue

@@ -1,9 +1,9 @@
 <template>
     <div class='edit-box'>
         <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-            <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
+            <!-- <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
                 <el-input v-model='form.EquipmentMark'></el-input>
-            </el-form-item>
+            </el-form-item> -->
 
             <ul class='point-box'>
                 <span class='left'>如果</span>
@@ -47,7 +47,7 @@ export default {
                 pointArr: [{ from: '', to: '' }]
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
             }
         }
     },

+ 3 - 3
src/components/config_point/step3_edit/formula_handle.vue

@@ -1,9 +1,9 @@
 <template>
     <div class='edit-box'>
         <el-form ref='form' :rules='rules' :model='form' label-width='140px'>
-            <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
+            <!-- <el-form-item v-if='devFlag' label='对象标识' prop='EquipmentMark'>
                 <el-input v-model='form.EquipmentMark'></el-input>
-            </el-form-item>
+            </el-form-item> -->
         </el-form>
         <div class='formula-box'>
             <p>原始点位</p>
@@ -53,7 +53,7 @@ export default {
             },
             extract: true,
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }]
             },
             subStrVal: false,
             from: 1,

+ 320 - 235
src/components/config_point/step3_edit/index.vue

@@ -32,23 +32,32 @@
       <el-form class='form' :rules='rules' ref='form' :model='form' label-width='140px'>
         <el-form-item label='对应数据字典' prop='diction'>
           <dictionary-cas @change="changeDictionaryCas" ref="dictionaryCas"></dictionary-cas>
-          <div class='dict'>
+        </el-form-item>
+        <el-form-item label='对象标识' prop="EquipmentMark">
+          <el-input v-model='form.EquipmentMark'></el-input>
+        </el-form-item>
+        <template v-for="(it,index) in typeList">
+          <div class='dict' :key="index">
+            <label class="el-form-item__label" style="width:140px;">信息点名称:</label><span style="line-height:40px">{{it.name||''}}</span>
             <p class='btm'>
-              <el-input readonly type='textarea' :rows='2' placeholder='信息点的单位及值的说明' v-model='ValueDescription'></el-input>
+              <el-input readonly type='textarea' :rows='2' placeholder='信息点的单位及值的说明' v-model='it.ValueDescription'>
+              </el-input>
+              <el-form-item style="margin-top:15px;" label='值处理方式' prop='DataRuleType'>
+                <el-select v-model='it.DataRuleType' placeholder='请选择'>
+                  <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
+                </el-select>
+              </el-form-item>
             </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>
+            <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'>
+            </formula-handle>
+            <split-handle :ref='"splitHandle"+index' v-else-if='it.DataRuleType == "需拆分处理"' :splitHandleShow='splitHandleShow'></split-handle>
           </div>
-        </el-form-item>
-        <el-form-item label='值处理方式' prop='DataRuleType'>
-          <el-select v-model='form.DataRuleType' placeholder='请选择'>
-            <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- components -->
-        <no-handle ref='noHandle' v-if='form.DataRuleType == "无需处理,直接使用"' :noHandleShow='noHandleShow'></no-handle>
-        <auto-handle ref='autoHandle' v-else-if='form.DataRuleType == "需自动单位转换"' :unitObj='unitObj' :autoHandleShow='autoHandleShow'></auto-handle>
-        <enum-handle ref='enumHandle' v-else-if='form.DataRuleType == "需按设置枚举转换"' :enumHandleShow='enumHandleShow'></enum-handle>
-        <formula-handle ref='formulaHandle' v-else-if='form.DataRuleType == "需按公式转换"' :formulaHandleShow='formulaHandleShow'></formula-handle>
-        <split-handle ref='splitHandle' v-else-if='form.DataRuleType == "需拆分处理"' :splitHandleShow='splitHandleShow'></split-handle>
+        </template>
       </el-form>
       <div class='btn-box'>
         <el-button type='primary' @click='save'>保存</el-button>
@@ -82,14 +91,16 @@ export default {
       dataDict: {}, //数据字典
       InfomationPoint: null, //信息点
       unitObj: {}, //传给自动单位转换的obj
-      ValueDescription: '', //值/点位描述
+      ValueDescription: {}, //值/点位描述
       form: {
         diction: '1',//占位
-        DataRuleType: '无需处理,直接使用'
+        DataRuleType: '无需处理,直接使用',
+        EquipmentMark: ''
       },
       rules: {
         DataRuleType: [{ required: true, message: '请选择值处理方式', trigger: 'change' }],
-        diction: [{ required: true }]
+        diction: [{ required: true }],
+        EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
       },
       handleTypeArr: [
         {
@@ -119,7 +130,8 @@ export default {
       enumHandleShow: {},
       formulaHandleShow: {},
       splitHandleShow: {},
-      dictionaryData: []
+      dictionaryData: [],
+      typeList: []
     }
   },
   props: {
@@ -141,207 +153,234 @@ export default {
     save() {
       this.$refs.dictionaryCas.validate(valid => {
         if (valid) {
-          var flag = this.form.DataRuleType
-          switch (flag) {
-            case '无需处理,直接使用':
-              this.$refs['noHandle'].getForm(noHandle => {
-                if (noHandle) {
-                  this.saveForm(this.form, noHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需自动单位转换':
-              this.$refs['autoHandle'].getForm(autoHandle => {
-                if (autoHandle) {
-                  this.saveForm(this.form, autoHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需按设置枚举转换':
-              this.$refs['enumHandle'].getForm(enumHandle => {
-                if (enumHandle) {
-                  this.saveForm(this.form, enumHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需按公式转换':
-              this.$refs['formulaHandle'].getForm(formulaHandle => {
-                if (formulaHandle) {
-                  this.saveForm(this.form, formulaHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
-            case '需拆分处理':
-              this.$refs['splitHandle'].getForm(splitHandle => {
-                if (splitHandle) {
-                  this.saveForm(this.form, splitHandle)
-                } else {
-                  this.errMsg()
-                }
-              })
-              break
+          for (let i = 0; i < this.typeList.length; i++) {
+            let flag = this.typeList[i].DataRuleType
+            switch (flag) {
+              case '无需处理,直接使用':
+                let componnoHandle = `noHandle${i}`
+                this.$refs[componnoHandle][0].getForm(noHandle => {
+                  if (noHandle) {
+                    this.typeList[i].other = noHandle
+                    // this.saveForm(this.form, noHandle)
+                  } else {
+                    this.errMsg();
+                    return false;
+                  }
+                })
+                break
+              case '需自动单位转换':
+                let componautoHandle = `autoHandle${i}`
+                this.$refs[componautoHandle][0].getForm(autoHandle => {
+                  if (autoHandle) {
+                    this.typeList[i].other = autoHandle
+                    // this.saveForm(this.form, autoHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需按设置枚举转换':
+                let componenumHandle = `enumHandle${i}`
+                this.$refs[componenumHandle][0].getForm(enumHandle => {
+                  if (enumHandle) {
+                    this.typeList[i].other = enumHandle
+                    // this.saveForm(this.form, enumHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需按公式转换':
+                let componformulaHandle = `formulaHandle${i}`
+                this.$refs[componformulaHandle][0].getForm(formulaHandle => {
+                  if (formulaHandle) {
+                    this.typeList[i].other = formulaHandle
+                    // this.saveForm(this.form, formulaHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+              case '需拆分处理':
+                let componsplitHandle = `splitHandle${i}`
+                this.$refs[componsplitHandle][0].getForm(splitHandle => {
+                  if (splitHandle) {
+                    this.typeList[i].other = formulaHandle
+                    // this.saveForm(this.form, splitHandle)
+                  } else {
+                    this.errMsg()
+                    return false;
+                  }
+                })
+                break
+            }
           }
+          this.saveForm()
         } else {
           this.errMsg()
           return false
         }
       })
     },
-    saveForm(basic, other) {
-      let type = basic.DataRuleType
-      let basicParams = {
-        InfomationPointCode: this.dictionaryData[this.dictionaryData.length - 1], //信息点code
-        InfomationPoint: this.dictionaryNames[this.dictionaryNames.length - 1], //信息点名称
-        DataRuleType: basic.DataRuleType, //值处理方式
-        DataSourceId: this.datasourceId, //数据源id
-        PointId: this.editData.Point.Id, //点位ID
-        Type: this.dictionaryNames[0], //一级分类名称
-        TypeCode: this.dictionaryData[0], //一级分类code
-      }
-      if (this.dictionaryData.length == 3) {
-        //设备-部件-空间
-        basicParams.EquipmentTypeCode = this.dictionaryData[1]
-        basicParams.EquipmentType = this.dictionaryNames[1]
-      } else if (this.dictionaryData.length == 4) { //专业系统
-        basicParams.SpecialtyCode = this.dictionaryData[1]
-        basicParams.Specialty = this.dictionaryNames[1]
-        basicParams.SystemCode = this.dictionaryData[2]
-        basicParams.System = this.dictionaryNames[2]
-        basicParams.EquipmentTypeCode = basicParams.SystemCode  //为了配置从动参取值存储
-        basicParams.EquipmentType = basicParams.System
-      }
+    saveForm() {
       let updateParams = {
         data: {
           Content: [{ Id: this.editData.Point.Id }]
         },
         type: this.protocolType
       }
-      let otherParams = {}
-      switch (type) {
-        case '无需处理,直接使用':
-          otherParams = {
-            EquipmentMark: other.EquipmentMark
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需自动单位转换':
-          let DataRuleContent1 = JSON.stringify([
-            {
-              seq: 1,
-              ruletype: 'type1',
-              content: [
-                {
-                  from: other.unit[0] + '-' + other.unit[1],
-                  to: this.unitObj.unit
-                }
-              ]
+      let params = this.typeList.map((t, i) => {
+        let temp = this.dictionaryData[i],
+          tempNames = t.name.split('-');
+        let eachData = {
+          InfomationPointCode: temp[temp.length - 1],
+          InfomationPoint: tempNames[tempNames.length - 1],
+          DataRuleType: t.DataRuleType,
+          DataSourceId: this.datasourceId, //数据源id
+          PointId: this.editData.Point.Id, //点位ID
+          TypeCode: temp[0],
+          Type: tempNames[0],
+          EquipmentMark: this.form.EquipmentMark
+        }
+        if (temp.length == 3) {
+          //设备-部件-空间
+          eachData.EquipmentTypeCode = temp[1]
+          eachData.EquipmentType = temp[1]
+        } else if (temp.length == 4) {
+          eachData.SpecialtyCode = temp[1]
+          eachData.Specialty = tempNames[1]
+          eachData.SystemCode = temp[2]
+          eachData.System = tempNames[2]
+          eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
+          eachData.EquipmentType = eachData.System
+        }
+        let type = t.DataRuleType;
+        updateParams.data.Content[0].EquipmentMark = eachData.EquipmentMark
+        switch (type) {
+          case '无需处理,直接使用':
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需自动单位转换':
+            let DataRuleContent1 = JSON.stringify([
+              {
+                seq: 1,
+                ruletype: 'type1',
+                content: [
+                  {
+                    from: t.other.unit[0] + '-' + t.other.unit[1],
+                    to: this.unitObj[eachData.InfomationPointCode].unit
+                  }
+                ]
+              }
+            ])
+            eachData.DataRuleContent = DataRuleContent1;
+            // otherParams = {
+            //   DataRuleContent: DataRuleContent1,
+            //   EquipmentMark: other.EquipmentMark
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需按设置枚举转换':
+            let DataRuleContent2 = t.other.pointArr.length
+              ? JSON.stringify([{ seq: 1, ruletype: 'type2', content: t.other.pointArr }])
+              : undefined
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark,
+            //   DataRuleContent: DataRuleContent2
+            // }
+            eachData.DataRuleContent = DataRuleContent2;
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需按公式转换':
+            let subRule = t.other.from
+              ? {
+                seq: 1,
+                ruletype: 'type4',
+                content: [
+                  {
+                    from: t.other.from,
+                    to: t.other.to
+                  }
+                ]
+              }
+              : undefined
+            let extractRule = {
+              seq: 2,
+              ruletype: 'type5',
+              content: t.other.extract
+                ? [
+                  {
+                    extract: 'number'
+                  }
+                ]
+                : []
             }
-          ])
-          otherParams = {
-            DataRuleContent: DataRuleContent1,
-            EquipmentMark: other.EquipmentMark
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需按设置枚举转换':
-          let DataRuleContent2 = other.pointArr.length
-            ? JSON.stringify([{ seq: 1, ruletype: 'type2', content: other.pointArr }])
-            : undefined
-          otherParams = {
-            EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent2
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需按公式转换':
-          let subRule = other.from
-            ? {
-              seq: 1,
-              ruletype: 'type4',
-              content: [
-                {
-                  from: other.from,
-                  to: other.to
-                }
-              ]
+            let countRule = t.other.mark
+              ? {
+                seq: 3,
+                ruletype: 'type6',
+                content: [
+                  {
+                    calculationtype: t.other.mark,
+                    value: t.other.markValue
+                  }
+                ]
+              }
+              : undefined
+
+            let DataRuleContent3 = []
+            if (subRule) {
+              DataRuleContent3.push(subRule)
             }
-            : undefined
-          let extractRule = {
-            seq: 2,
-            ruletype: 'type5',
-            content: other.extract
-              ? [
-                {
-                  extract: 'number'
-                }
-              ]
-              : []
-          }
-          let countRule = other.mark
-            ? {
-              seq: 3,
-              ruletype: 'type6',
-              content: [
-                {
-                  calculationtype: other.mark,
-                  value: other.markValue
-                }
-              ]
+            DataRuleContent3.push(extractRule)
+            if (countRule) {
+              DataRuleContent3.push(countRule)
             }
-            : undefined
-
-          let DataRuleContent3 = []
-          if (subRule) {
-            DataRuleContent3.push(subRule)
-          }
-          DataRuleContent3.push(extractRule)
-          if (countRule) {
-            DataRuleContent3.push(countRule)
-          }
-          DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
-          otherParams = {
-            EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent3
-          }
-          updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
-          break
-        case '需拆分处理':
-          let SplitPoints = other.devArr.length ? other.devArr : undefined
-          let DataRuleContent4 = undefined
-          var enum5 = null
-          if (other.tranfVal) {
-            enum5 = { seq: 2, ruletype: 'type2', content: other.pointArr }
-          } else {
-            enum5 = { seq: 2, ruletype: 'type2', content: [] }
-          }
-          SplitPoints.forEach(ele => {
-            let cutStr = {
-              seq: 1,
-              ruletype: 'type4',
-              content: [
-                {
-                  from: ele.SplitStart,
-                  to: ele.SplitEnd
-                }
-              ]
+            DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
+            eachData.DataRuleContent = DataRuleContent3;
+            // otherParams = {
+            //   EquipmentMark: other.EquipmentMark,
+            //   DataRuleContent: DataRuleContent3
+            // }
+            // updateParams.data.Content[0].EquipmentMark = other.EquipmentMark
+            break
+          case '需拆分处理':
+            let SplitPoints = t.other.devArr.length ? t.other.devArr : undefined
+            let DataRuleContent4 = undefined
+            var enum5 = null
+            if (t.other.tranfVal) {
+              enum5 = { seq: 2, ruletype: 'type2', content: t.other.pointArr }
+            } else {
+              enum5 = { seq: 2, ruletype: 'type2', content: [] }
             }
-            ele.DataRuleContent = JSON.stringify([cutStr, enum5])
-          })
-          otherParams = {
-            SplitPoints: SplitPoints
-          }
-          updateParams.data.Content[0].EquipmentMark = other.eqMark
-          break
-      }
-      let params = [Object.assign(basicParams, otherParams)]
+            SplitPoints.forEach(ele => {
+              let cutStr = {
+                seq: 1,
+                ruletype: 'type4',
+                content: [
+                  {
+                    from: ele.SplitStart,
+                    to: ele.SplitEnd
+                  }
+                ]
+              }
+              ele.DataRuleContent = JSON.stringify([cutStr, enum5])
+            })
+            eachData.SplitPoints = SplitPoints;
+            // otherParams = {
+            // SplitPoints: SplitPoints
+            // }
+            updateParams.data.Content[0].EquipmentMark = t.other.eqMark
+            break
+        }
+        return eachData;
+      })
       updatePoint(updateParams, res => { this.create(params) })
     },
     create(params) {
@@ -367,7 +406,7 @@ export default {
     },
     handleItemChange(val, cb) {
       if (val.length == 3) {
-        if(val[2]!='null'){
+        if (val[2] != 'null') {
           let params = { type: val[2] }
           getQueryProperty(params, res => {
             if (res.Result == 'success') {
@@ -435,46 +474,61 @@ export default {
     },
     init() {
       //获取所有的设备
-      this.getEqAll()
+      // this.getEqAll()
     },
     //回显数值
     async showValue(val) {
       // await this.getEqAll()
       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]
         //回显字典
-        let tempArr = []
-        if (data.TypeCode == 'Eq' || data.TypeCode == 'Ec' || data.TypeCode == 'Sp') {
-          tempArr = [data.TypeCode, data.EquipmentTypeCode, data.InfomationPointCode]
-        } else if (data.TypeCode == 'Sy') {
-          tempArr = [data.TypeCode, data.SpecialtyCode, data.SystemCode, data.InfomationPointCode]
-        } else {
-          tempArr = [data.TypeCode, data.InfomationPointCode]
-        }
+        let tempArr = val.RelationList.map(t => {
+          let eachData = [];
+          if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
+            eachData = [t.TypeCode, t.EquipmentTypeCode, t.InfomationPointCode]
+          } else if (t.TypeCode == 'Sy') {
+            eachData = [t.TypeCode, t.SpecialtyCode, t.SystemCode, t.InfomationPointCode]
+          } else {
+            eachData = [t.TypeCode, t.InfomationPointCode]
+          }
+          return eachData;
+        })
         this.$nextTick(() => {
-          this.$refs.dictionaryCas.setCascaderVal(tempArr)
+          this.$refs.dictionaryCas.setCascaderVal(tempArr);
         })
-
-          this.form.DataRuleType = data.DataRuleType
+        this.typeList = val.RelationList.map(t => {
+          if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
+            t.name = `${t.Type}-${t.EquipmentType}-${t.InfomationPoint}`
+          } else if (t.TypeCode == 'Sy') {
+            t.name = `${t.Type}-${t.Specialty}-${t.System}-${t.InfomationPoint}`
+          } else {
+            t.name = `${t.Type}-${t.InfomationPoint}`
+          }
+          return t;
+        });
+        this.form.DataRuleType = data.DataRuleType
         // this.handleItemChange(dict, () => {
-          // this.unitObj = this.infoDict[data.InfomationPointCode]
-          // this.InfomationPoint = this.unitObj.infoPointName || '--'
-          // if (typeof this.unitObj.dataSource == 'string') {
-          //   if (this.unitObj.dataSource.length) {
-          //     this.ValueDescription = this.unitObj.dataSource
-          //   } else {
-          //     this.ValueDescription = '无信息点单位及值说明'
-          //   }
-          // } else {
-          //   let str = ''
-          //   this.unitObj.dataSource.forEach(ele => {
-          //     str += ele.code + '.' + ele.name + ' '
-          //   })
-          //   this.ValueDescription = str
-          // }
+        // this.unitObj = this.infoDict[data.InfomationPointCode]
+        // this.InfomationPoint = this.unitObj.infoPointName || '--'
+        // if (typeof this.unitObj.dataSource == 'string') {
+        //   if (this.unitObj.dataSource.length) {
+        //     this.ValueDescription = this.unitObj.dataSource
+        //   } else {
+        //     this.ValueDescription = '无信息点单位及值说明'
+        //   }
+        // } else {
+        //   let str = ''
+        //   this.unitObj.dataSource.forEach(ele => {
+        //     str += ele.code + '.' + ele.name + ' '
+        //   })
+        //   this.ValueDescription = str
+        // }
         // })
         if (length == 1) {
           let flag = data.DataRuleType
@@ -585,11 +639,41 @@ export default {
     //对应数据字典变化
     changeDictionaryCas({ val, labels, data }) {
       this.dictionaryData = val;
-      this.dictionaryNames = labels
+      this.dictionaryNames = labels || '';
+      this.unitObj = data || {}
+      if (this.typeList.length) {
+        this.typeList = this.typeList.map(t => {
+          if (labels.indexOf(t.name) < 0) {
+            return undefined
+          }
+          return t;
+        }).filter(item => item)
+        let temp = this.typeList.map(t => {
+          return t.name;
+        })
+        for (let i = 0; i < labels.length; i++) {
+          if (temp.indexOf(labels[i]) < 0) {
+            this.typeList.push({
+              name: labels[i],
+              DataRuleType: '无需处理,直接使用'
+            })
+          }
+        }
+      } else {
+        this.typeList = labels.map(t => {
+          return {
+            name: t,
+            DataRuleType: '无需处理,直接使用'
+          }
+        })
+      }
+      this.typeList = this.typeList.map((t, i) => {
+        t.ValueDescription = this.delDataSource(data[val[i][val[i].length - 1]].DataSource)
+        return t;
+      })
       // this.infoDict = this.$refs.dictionaryCas.pointDataSource
-      this.unitObj = data
-      this.InfomationPoint = this.unitObj.InfoPointName || ''
-      this.ValueDescription = this.delDataSource(this.unitObj.DataSource)
+      // this.InfomationPoint = this.unitObj.InfoPointName || ''
+      // this.ValueDescription = this.delDataSource(this.unitObj.DataSource)
     }
   },
   mounted() {
@@ -626,7 +710,7 @@ export default {
       span:nth-of-type(2) {
         width: calc(100% - 120px);
         overflow: hidden;
-        text-overflow:ellipsis;
+        text-overflow: ellipsis;
         white-space: nowrap;
       }
     }
@@ -644,6 +728,7 @@ export default {
         }
         .btm {
           margin-top: 5px;
+          margin-left: 140px;
         }
       }
     }

+ 3 - 3
src/components/config_point/step3_edit/no_handle.vue

@@ -1,8 +1,8 @@
 <template>
     <el-form ref='form' :model='form' :rules='rules' label-width='140px'>
-        <el-form-item v-if='devFlag' label='对象标识' prop="EquipmentMark">
+        <!-- <el-form-item v-if='devFlag' label='对象标识' prop="EquipmentMark">
             <el-input v-model='form.EquipmentMark'></el-input>
-        </el-form-item>
+        </el-form-item> -->
     </el-form>
 </template>
 
@@ -15,7 +15,7 @@ export default {
                 EquipmentMark: ''
             },
             rules: {
-                EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
+                // EquipmentMark: [{ required: true, message: '请输入对象标识', trigger: 'blur' }],
             }
         }
     },

+ 296 - 245
src/components/config_point/step3_point/3_temps.vue

@@ -11,14 +11,16 @@
           <dictionary-cas @change="changeDictionaryCas" ref="dictionaryCas"></dictionary-cas>
         </el-form-item>
       </el-form>
-      <div class="flex-around">
-        <div class="point-despoint">
-          <p class="center">原始点位说明</p>
-          <p class="p10">{{pointDes}}</p>
-        </div>
-        <div class="point-despoint">
-          <p class="center">数据字典值说明</p>
-          <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
+      <div>
+        <div class="flex-around" v-for="(it,ind) in typeList" :key="ind">
+          <div class="point-despoint">
+            <p class="center">原始点位说明</p>
+            <p class="p10">{{pointDes}}</p>
+          </div>
+          <div class="point-despoint">
+            <p class="center">数据字典值说明</p>
+            <p class="content-view p10">{{delDataSource(it.unitObj.DataSource)}}</p>
+          </div>
         </div>
       </div>
       <div class="center" style="margin-top:20px;">
@@ -26,29 +28,31 @@
       </div>
     </div>
     <div class="collapse-item" v-if="activeName == 1">
-      <div class="flex-around">
-        <div class="point-despoint">
-          <p class="center">原始点位说明</p>
-          <p class="p10">{{pointDes}}</p>
-        </div>
-        <div class="point-despoint">
-          <p class="center">数据字典值说明</p>
-          <p class="content-view p10">{{delDataSource(unitObj.DataSource)}}</p>
+      <div v-for="(it,ind) in typeList" :key="ind">
+        <div class="flex-around">
+          <div class="point-despoint">
+            <p class="center">原始点位说明</p>
+            <p class="p10">{{pointDes}}</p>
+          </div>
+          <div class="point-despoint">
+            <p class="center">数据字典值说明</p>
+            <p class="content-view p10">{{delDataSource(it.unitObj.DataSource)}}</p>
+          </div>
         </div>
+        <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
+          <el-form-item label='值处理方式' prop='DataRuleType'>
+            <el-select v-model='it.DataRuleType' placeholder='请选择'>
+              <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
+            </el-select>
+          </el-form-item>
+          <!-- components -->
+          <div :ref='"noHandle"+ind' v-if='it.DataRuleType == "无需处理,直接使用"'></div>
+          <auto-handle :devFlag="false" :ref='"autoHandle"+ind' v-else-if='it.DataRuleType == "需自动单位转换"' :unitObj='it.unitObj'></auto-handle>
+          <enum-handle :devFlag="false" :ref='"enumHandle"+ind' v-else-if='it.DataRuleType == "需按设置枚举转换"'></enum-handle>
+          <formula-handle :devFlag="false" :ref='"formulaHandle"+ind' v-else-if='it.DataRuleType == "需按公式转换"'></formula-handle>
+          <!-- <split-handle :devFlag="false" ref='splitHandle' v-else-if='form2.DataRuleType == "需按拆分枚举转换"'></split-handle> -->
+        </el-form>
       </div>
-      <el-form class="form" :rules="rules" ref="form2" :model="form2" label-width="140px">
-        <el-form-item label='值处理方式' prop='DataRuleType'>
-          <el-select v-model='form2.DataRuleType' placeholder='请选择'>
-            <el-option v-for='item in handleTypeArr' :key='item.value' :label='item.label' :value='item.value'></el-option>
-          </el-select>
-        </el-form-item>
-        <!-- components -->
-        <div ref='noHandle' v-if='form2.DataRuleType == "无需处理,直接使用"'></div>
-        <auto-handle :devFlag="false" ref='autoHandle' v-else-if='form2.DataRuleType == "需自动单位转换"' :unitObj='unitObj'></auto-handle>
-        <enum-handle :devFlag="false" ref='enumHandle' v-else-if='form2.DataRuleType == "需按设置枚举转换"'></enum-handle>
-        <formula-handle :devFlag="false" ref='formulaHandle' v-else-if='form2.DataRuleType == "需按公式转换"'></formula-handle>
-        <!-- <split-handle :devFlag="false" ref='splitHandle' v-else-if='form2.DataRuleType == "需按拆分枚举转换"'></split-handle> -->
-      </el-form>
       <div class="center" style="margin-top:20px;">
         <el-button @click="undo">上一步</el-button>
         <el-button @click="next">下一步</el-button>
@@ -151,7 +155,7 @@ export default {
         //     value: '需按拆分枚举转换'
         // }
       ],
-      dealType: {}, //处理方式
+      dealType: [], //处理方式
       form2: {
         ValueDescription: '',
         DataRuleType: '无需处理,直接使用'
@@ -164,7 +168,8 @@ export default {
         }],
         dict: [{ required: true }]
       },
-      pointDes: ""
+      pointDes: "",
+      typeList: []
     }
   },
   created() { },
@@ -185,7 +190,7 @@ export default {
     getMain(param, pagechange) {
       if (!pagechange) {
         this.activeName = 0
-        this.dealType = {}
+        this.dealType = []
         this.form1 = {
           dict: 1
         }
@@ -236,14 +241,18 @@ export default {
       // } else {
       //   this.createParam(params)
       // }
-      let pa = Object.assign({
-        DataSourceId: this.queryParam.DataSourceId,
-        KeyEquipmentParameter: this.queryParam.EquipmentParameter,
-        KeyEquipmentType: this.queryParam.EquipmentType,
-      }, this.dealType);
-      groupCreatePointRelation(pa, res => {
-        this.$message.success("处理成功")
-        this.$emit("changed")
+      this.dealType.forEach((t, i) => {
+        let pa = Object.assign({
+          DataSourceId: this.queryParam.DataSourceId,
+          KeyEquipmentParameter: this.queryParam.EquipmentParameter,
+          KeyEquipmentType: this.queryParam.EquipmentType,
+        }, t);
+        groupCreatePointRelation(pa, res => {
+          if (i == this.dealType.length - 1) {
+            this.$message.success("处理成功")
+            this.$emit("changed")
+          }
+        })
       })
     },
     confirm(assage, params) {
@@ -291,221 +300,235 @@ export default {
           }
         })
       } else if (this.activeName == 1) {
-        this.$refs.form2.validate(valid => {
-          if (valid) {
-            var flag = this.form2.DataRuleType
-            var isNext = true;
-            switch (flag) {
-              case '无需处理,直接使用':
-                this.saveForm(this.form2, {})
-                break
-              case '需自动单位转换':
-                this.$refs.autoHandle.getForm(autoHandle => {
-                  if (autoHandle) {
-                    this.saveForm(this.form2, autoHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              case '需按设置枚举转换':
-                this.$refs.enumHandle.getForm(enumHandle => {
-                  if (enumHandle) {
-                    this.saveForm(this.form2, enumHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              case '需按公式转换':
-                this.$refs.formulaHandle.getForm(formulaHandle => {
-                  if (formulaHandle) {
-                    this.saveForm(this.form2, formulaHandle)
-                  } else {
-                    isNext = false
-                    this.errMsg()
-                  }
-                })
-                break
-              // case '需按拆分枚举转换':
-              //     this.$refs.splitHandle.getForm(splitHandle => {
-              //         if (splitHandle) {
-              //             this.saveForm(this.form2, splitHandle)
-              //         } else {
-              //             isNext = false
-              //             this.errMsg()
-              //         }
-              //     })
-              //     break
-            }
-            if (isNext) {
-              this.activeName += 1
-              let setting = {
-                data: this.renderData,
-                maxRows: 1000,
-                colHeaders: ['对象标识', '原始点位描述', '位置标签', '备注'],
-                columns: [{
-                  data: 'EquipmentMark'
-                },
-                {
-                  data: 'Description',
-                  readOnly: true
-                },
-                {
-                  data: 'LocationFlag',
-                  readOnly: true
-                },
-                {
-                  data: 'Remarks',
-                  readOnly: true
+        let isNext = true;
+        for (let i = 0; i < this.typeList.length; i++) {
+          let flag = this.typeList[i].DataRuleType
+          let compon = '';
+          switch (flag) {
+            case '无需处理,直接使用':
+              this.typeList[i].other = {}
+              // this.saveForm(this.form2, {})
+              break
+            case '需自动单位转换':
+              compon = `autoHandle${i}`
+              this.$refs[compon][0].getForm(autoHandle => {
+                if (autoHandle) {
+                  this.typeList[i].other = autoHandle;
+                  // this.saveForm(this.form2, autoHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
                 }
-                ]
-              }
-              if (this.renderData.length) {
-                this.$nextTick(_ => {
-                  this.hot = this.$refs.handsontable.init(setting)
-                })
-              }
+              })
+              break
+            case '需按设置枚举转换':
+              compon = `enumHandle${i}`
+              this.$refs[compon][0].getForm(enumHandle => {
+                if (enumHandle) {
+                  this.typeList[i].other = enumHandle;
+                  // this.saveForm(this.form2, enumHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
+                }
+              })
+              break
+            case '需按公式转换':
+              compon = `formulaHandle${i}`
+              this.$refs[compon][0].getForm(formulaHandle => {
+                if (formulaHandle) {
+                  this.typeList[i].other = formulaHandle;
+                  // this.saveForm(this.form2, formulaHandle)
+                } else {
+                  isNext = false
+                  this.errMsg()
+                }
+              })
+              break
+            // case '需按拆分枚举转换':
+            //     this.$refs.splitHandle.getForm(splitHandle => {
+            //         if (splitHandle) {
+            //             this.saveForm(this.form2, splitHandle)
+            //         } else {
+            //             isNext = false
+            //             this.errMsg()
+            //         }
+            //     })
+            //     break
+          }
+        }
+        if (isNext) {
+          this.saveForm();
+          this.activeName += 1
+          let setting = {
+            data: this.renderData,
+            maxRows: 1000,
+            colHeaders: ['对象标识', '原始点位描述', '位置标签', '备注'],
+            columns: [{
+              data: 'EquipmentMark'
+            },
+            {
+              data: 'Description',
+              readOnly: true
+            },
+            {
+              data: 'LocationFlag',
+              readOnly: true
+            },
+            {
+              data: 'Remarks',
+              readOnly: true
             }
-
-          } else {
-            this.errMsg()
-            return false
+            ]
           }
-        })
+          if (this.renderData.length) {
+            this.$nextTick(_ => {
+              this.hot = this.$refs.handsontable.init(setting)
+            })
+          }
+        }
       }
     },
-    saveForm(basic, other) {
-      let type = basic.DataRuleType
-      let basicParams = {
-        InfomationPointCode: this.dictionaryData[this.dictionaryData.length - 1], //信息点code
-        InfomationPoint: this.dictionaryNames[this.dictionaryNames.length - 1], //信息点名称
-        DataRuleType: basic.DataRuleType, //值处理方式
-        Type: this.dictionaryNames[0], //一级分类名称
-        TypeCode: this.dictionaryData[0], //一级分类code
-      }
-      if (this.dictionaryData.length == 3) {
-        //设备-部件-空间
-        basicParams.EquipmentTypeCode = this.dictionaryData[1]
-        basicParams.EquipmentType = this.dictionaryNames[1]
-      } else if (this.dictionaryData.length == 4) { //专业系统
-        basicParams.SpecialtyCode = this.dictionaryData[1]
-        basicParams.Specialty = this.dictionaryNames[1]
-        basicParams.SystemCode = this.dictionaryData[2]
-        basicParams.System = this.dictionaryNames[2]
-        basicParams.EquipmentTypeCode = basicParams.SystemCode //为了配置从动参取值存储
-        basicParams.EquipmentType = basicParams.System
-      }
-      let otherParams = {}
-      switch (type) {
-        case '无需处理,直接使用':
-          otherParams = {
-            // EquipmentMark: other.EquipmentMark
-          }
-          break
-        case '需自动单位转换':
-          let DataRuleContent1 = JSON.stringify([{
-            seq: 1,
-            ruletype: 'type1',
-            content: [{
-              from: other.unit[0] + '-' + other.unit[1],
-              to: this.unitObj.unit
-            }]
-          }])
-          otherParams = {
-            DataRuleContent: DataRuleContent1,
+    saveForm() {
+      let params = this.typeList.map((t, i) => {
+        let temp = this.dictionaryData[i],
+          tempNames = t.name.split('-');
+        let eachData = {
+          InfomationPointCode: temp[temp.length - 1],
+          InfomationPoint: tempNames[tempNames.length - 1],
+          DataRuleType: t.DataRuleType,
+          // DataSourceId: this.datasourceId, //数据源id
+          // PointId: this.editData.Point.Id, //点位ID
+          TypeCode: temp[0],
+          Type: tempNames[0],
+          // EquipmentMark: this.form.EquipmentMark
+        }
+        if (temp.length == 3) {
+          //设备-部件-空间
+          eachData.EquipmentTypeCode = temp[1]
+          eachData.EquipmentType = temp[1]
+        } else if (temp.length == 4) {
+          eachData.SpecialtyCode = temp[1]
+          eachData.Specialty = tempNames[1]
+          eachData.SystemCode = temp[2]
+          eachData.System = tempNames[2]
+          eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
+          eachData.EquipmentType = eachData.System
+        }
+        let type = t.DataRuleType;
+        switch (type) {
+          case '无需处理,直接使用':
+            // otherParams = {
             // EquipmentMark: other.EquipmentMark
-          }
-          break
-        case '需按设置枚举转换':
-          let DataRuleContent2 = other.pointArr.length ?
-            JSON.stringify([{
+            // }
+            break
+          case '需自动单位转换':
+            let DataRuleContent1 = JSON.stringify([{
               seq: 1,
-              ruletype: 'type2',
-              content: other.pointArr
-            }]) :
-            undefined
-          otherParams = {
-            // EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent2
-          }
-          break
-        case '需按公式转换':
-          let subRule = other.from ? {
-            seq: 1,
-            ruletype: 'type4',
-            content: [{
-              from: other.from,
-              to: other.to
-            }]
-          } :
-            undefined
-          let extractRule = {
-            seq: 2,
-            ruletype: 'type5',
-            content: other.extract ? [{
-              extract: 'number'
-            }] : []
-          }
-          let countRule = other.mark ? {
-            seq: 3,
-            ruletype: 'type6',
-            content: [{
-              calculationtype: other.mark,
-              value: other.markValue
-            }]
-          } :
-            undefined
-          let DataRuleContent3 = []
-          if (subRule) {
-            DataRuleContent3.push(subRule)
-          }
-          DataRuleContent3.push(extractRule)
-          if (countRule) {
-            DataRuleContent3.push(countRule)
-          }
-          DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
-          otherParams = {
+              ruletype: 'type1',
+              content: [{
+                from: other.unit[0] + '-' + other.unit[1],
+                to: this.unitObj.unit
+              }]
+            }])
+            eachData.DataRuleContent = DataRuleContent1;
+            // otherParams = {
+            // DataRuleContent: DataRuleContent1,
+            // EquipmentMark: other.EquipmentMark
+            // }
+            break
+          case '需按设置枚举转换':
+            let DataRuleContent2 = other.pointArr.length ?
+              JSON.stringify([{
+                seq: 1,
+                ruletype: 'type2',
+                content: other.pointArr
+              }]) :
+              undefined
+            eachData.DataRuleContent = DataRuleContent2;
+            // otherParams = {
             // EquipmentMark: other.EquipmentMark,
-            DataRuleContent: DataRuleContent3
-          }
-          break
-        case '需拆分处理':
-          let SplitPoints = other.devArr.length ? other.devArr : undefined
-          let DataRuleContent4 = undefined
-          var enum5 = null
-          if (other.tranfVal) {
-            enum5 = {
-              seq: 2,
-              ruletype: 'type2',
-              content: other.pointArr
-            }
-          } else {
-            enum5 = {
-              seq: 2,
-              ruletype: 'type2',
-              content: []
-            }
-          }
-          SplitPoints.forEach(ele => {
-            let cutStr = {
+            // DataRuleContent: DataRuleContent2
+            // }
+            break
+          case '需按公式转换':
+            let subRule = other.from ? {
               seq: 1,
               ruletype: 'type4',
               content: [{
-                from: ele.SplitStart,
-                to: ele.SplitEnd
+                from: other.from,
+                to: other.to
               }]
+            } :
+              undefined
+            let extractRule = {
+              seq: 2,
+              ruletype: 'type5',
+              content: other.extract ? [{
+                extract: 'number'
+              }] : []
             }
-            ele.DataRuleContent = JSON.stringify([cutStr, enum5])
-          })
-          otherParams = {
-            SplitPoints: SplitPoints
-          }
-          break
-      }
-      this.dealType = Object.assign(basicParams, otherParams)
+            let countRule = other.mark ? {
+              seq: 3,
+              ruletype: 'type6',
+              content: [{
+                calculationtype: other.mark,
+                value: other.markValue
+              }]
+            } :
+              undefined
+            let DataRuleContent3 = []
+            if (subRule) {
+              DataRuleContent3.push(subRule)
+            }
+            DataRuleContent3.push(extractRule)
+            if (countRule) {
+              DataRuleContent3.push(countRule)
+            }
+            DataRuleContent3 = DataRuleContent3.length ? JSON.stringify(DataRuleContent3) : undefined
+            eachData.DataRuleContent = DataRuleContent3;
+            // otherParams = {
+            // EquipmentMark: other.EquipmentMark,
+            // DataRuleContent: DataRuleContent3
+            // }
+            break
+          case '需拆分处理':
+            let SplitPoints = other.devArr.length ? other.devArr : undefined
+            let DataRuleContent4 = undefined
+            var enum5 = null
+            if (other.tranfVal) {
+              enum5 = {
+                seq: 2,
+                ruletype: 'type2',
+                content: other.pointArr
+              }
+            } else {
+              enum5 = {
+                seq: 2,
+                ruletype: 'type2',
+                content: []
+              }
+            }
+            SplitPoints.forEach(ele => {
+              let cutStr = {
+                seq: 1,
+                ruletype: 'type4',
+                content: [{
+                  from: ele.SplitStart,
+                  to: ele.SplitEnd
+                }]
+              }
+              ele.DataRuleContent = JSON.stringify([cutStr, enum5])
+            })
+            eachData.SplitPoints = SplitPoints;
+            // otherParams = {
+            //   SplitPoints: SplitPoints
+            // }
+            break
+        }
+        return eachData;
+      })
+      this.dealType = params
       // this.create(params)
     },
     validateDict(rule, value, cb) {
@@ -601,10 +624,38 @@ export default {
     //对应数据字典变化
     changeDictionaryCas({ val, labels, data }) {
       this.dictionaryData = val;
-      this.dictionaryNames = labels
-      // this.infoDict = this.$refs.dictionaryCas.pointDataSource
+      this.dictionaryNames = labels;
       this.unitObj = data
-      this.InfomationPoint = this.unitObj.InfoPointName || ''
+      if (this.typeList.length) {
+        this.typeList = this.typeList.map(t => {
+          if (labels.indexOf(t.name) < 0) {
+            return undefined
+          }
+          return t;
+        }).filter(item => item)
+        let temp = this.typeList.map(t => {
+          return t.name;
+        })
+        for (let i = 0; i < labels.length; i++) {
+          if (temp.indexOf(labels[i]) < 0) {
+            this.typeList.push({
+              name: labels[i],
+              DataRuleType: '无需处理,直接使用'
+            })
+          }
+        }
+      } else {
+        this.typeList = labels.map(t => {
+          return {
+            name: t,
+            DataRuleType: '无需处理,直接使用'
+          }
+        })
+      }
+      this.typeList = this.typeList.map((t, i) => {
+        t.unitObj = data[val[i][val[i].length - 1]];
+        return t;
+      })
     },
     //分页发生更改
     changePage() {

+ 18 - 11
src/views/point/config_point/steps/step3.vue

@@ -160,17 +160,24 @@
                     let content = res.Content.map(item => {
                         if (item.RelationList.length) {
                             item.Point.DataRuleType = item.RelationList[0].DataRuleType
-                            item.Point.PhysicalRelated = item.RelationList[0].Type
-                            //设备-部件-空间
-                            if(item.RelationList[0].TypeCode == 'Eq' || item.RelationList[0].TypeCode == 'Ec' || item.RelationList[0].TypeCode == 'Sp'){
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].EquipmentType
-                            }
-                            //系统
-                            if(item.RelationList[0].TypeCode == 'Sy'){
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].Specialty
-                                item.Point.PhysicalRelated += '-' + item.RelationList[0].System
-                            }
-                            item.Point.PhysicalRelated += '-' + item.RelationList[0].InfomationPoint
+                            item.Point.PhysicalRelated = '';
+                            item.RelationList.forEach(t => {
+                                if (item.Point.PhysicalRelated) {
+                                    item.Point.PhysicalRelated += '/' + t.Type;
+                                } else {
+                                    item.Point.PhysicalRelated = t.Type;
+                                }
+                                //设备-部件-空间
+                                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
+                                }
+                                item.Point.PhysicalRelated += '-' + t.InfomationPoint
+                            })
                         }
                         return item
                     })