瀏覽代碼

修改bug 2766 联调bug2763 2764

haojianlong 4 年之前
父節點
當前提交
b06eb234b6
共有 2 個文件被更改,包括 24 次插入2 次删除
  1. 4 0
      src/components/config_point/location_flag.vue
  2. 20 2
      src/components/config_point/step3_edit/index.vue

+ 4 - 0
src/components/config_point/location_flag.vue

@@ -97,6 +97,10 @@
                     this.$message("请确定输入字符不为空")
                     this.$message("请确定输入字符不为空")
                     return false
                     return false
                 }
                 }
+                let flag = this.queryLocaltionArr.map(item => item.Name).indexOf(param.Name) > -1;
+                if (flag) {
+                    return this.$message.warning('已添加过此标签');
+                }
                 addLocaltionFlag(param,res => {
                 addLocaltionFlag(param,res => {
                     this.queryData()
                     this.queryData()
                     this.$message.success("添加成功")
                     this.$message.success("添加成功")

+ 20 - 2
src/components/config_point/step3_edit/index.vue

@@ -131,7 +131,8 @@ export default {
       formulaHandleShow: {},
       formulaHandleShow: {},
       splitHandleShow: {},
       splitHandleShow: {},
       dictionaryData: [],
       dictionaryData: [],
-      typeList: []
+      typeList: [],
+      pointToRelationID: {}, //保存信息点->relationid map
     }
     }
   },
   },
   props: {
   props: {
@@ -253,6 +254,10 @@ export default {
           //设备-部件-空间
           //设备-部件-空间
           eachData.EquipmentTypeCode = temp[1]
           eachData.EquipmentTypeCode = temp[1]
           eachData.EquipmentType = tempNames[1]
           eachData.EquipmentType = tempNames[1]
+          let key = `${eachData.TypeCode}-${eachData.EquipmentTypeCode}-${eachData.InfomationPointCode}`
+          if (this.pointToRelationID[key]) {
+            eachData.Id = this.pointToRelationID[key]
+          }
         } else if (temp.length == 4) {
         } else if (temp.length == 4) {
           eachData.SpecialtyCode = temp[1]
           eachData.SpecialtyCode = temp[1]
           eachData.Specialty = tempNames[1]
           eachData.Specialty = tempNames[1]
@@ -260,6 +265,15 @@ export default {
           eachData.System = tempNames[2]
           eachData.System = tempNames[2]
           eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
           eachData.EquipmentTypeCode = eachData.SystemCode  //为了配置从动参取值存储
           eachData.EquipmentType = eachData.System
           eachData.EquipmentType = eachData.System
+          let key = `${eachData.TypeCode}-${eachData.SpecialtyCode}-${eachData.SystemCode}-${eachData.InfomationPointCode}`
+          if (this.pointToRelationID[key]) {
+            eachData.Id = this.pointToRelationID[key]
+          }
+        } else if (temp.length == 2) {
+          let key = `${eachData.TypeCode}-${eachData.InfomationPointCode}`
+          if (this.pointToRelationID[key]) {
+            eachData.Id = this.pointToRelationID[key]
+          }
         }
         }
         let type = t.DataRuleType;
         let type = t.DataRuleType;
         updateParams.data.Content[0].EquipmentMark = eachData.EquipmentMark
         updateParams.data.Content[0].EquipmentMark = eachData.EquipmentMark
@@ -491,15 +505,19 @@ export default {
       if (length) {
       if (length) {
         var data = val.RelationList[0]
         var data = val.RelationList[0]
         let dict = [data.SpecialtyCode, data.SystemCode, data.EquipmentTypeCode]
         let dict = [data.SpecialtyCode, data.SystemCode, data.EquipmentTypeCode]
-        //回显字典
+        //回显字典--并保存信息点->relationid map
+        this.pointToRelationID = {}
         let tempArr = val.RelationList.map(t => {
         let tempArr = val.RelationList.map(t => {
           let eachData = [];
           let eachData = [];
           if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
           if (t.TypeCode == 'Eq' || t.TypeCode == 'Ec' || t.TypeCode == 'Sp') {
             eachData = [t.TypeCode, t.EquipmentTypeCode, t.InfomationPointCode]
             eachData = [t.TypeCode, t.EquipmentTypeCode, t.InfomationPointCode]
+            this.pointToRelationID[`${t.TypeCode}-${t.EquipmentTypeCode}-${t.InfomationPointCode}`] = t.Id
           } else if (t.TypeCode == 'Sy') {
           } else if (t.TypeCode == 'Sy') {
             eachData = [t.TypeCode, t.SpecialtyCode, t.SystemCode, t.InfomationPointCode]
             eachData = [t.TypeCode, t.SpecialtyCode, t.SystemCode, t.InfomationPointCode]
+            this.pointToRelationID[`${t.TypeCode}-${t.SpecialtyCode}-${t.SystemCode}-${t.InfomationPointCode}`] = t.Id
           } else {
           } else {
             eachData = [t.TypeCode, t.InfomationPointCode]
             eachData = [t.TypeCode, t.InfomationPointCode]
+            this.pointToRelationID[`${t.TypeCode}-${t.InfomationPointCode}`] = t.Id
           }
           }
           return eachData;
           return eachData;
         })
         })