Переглянути джерело

fix pointconfig bugs in transfer data

haojianlong 5 роки тому
батько
коміт
cba10656bc

+ 3 - 2
src/components/point/dynamicdata/dataSource.vue

@@ -15,7 +15,8 @@ export default {
     };
   },
   props: {
-    Related: {}
+    Related: {},
+    typeName: {}
   },
   created() {
     this.init();
@@ -26,7 +27,7 @@ export default {
   methods: {
     init() {
       this.Datasource = [];
-      let param = { Related: this.Related };
+      let param = { Related: this.Related, typeName: this.typeName };
       //数据源
       dynamicDataSource(param, res => {
         if (res.Result == "success") {

+ 3 - 2
src/components/point/dynamicdata/dictionaryDevice.vue

@@ -21,7 +21,8 @@ export default {
     };
   },
   props: {
-    Related: {}
+    Related: {},
+    typeName: {}
   },
   created() {
     this.init();
@@ -31,7 +32,7 @@ export default {
   },
   methods: {
     init() {
-      let param = { Related: this.Related };
+      let param = { Related: this.Related, typeName: this.typeName };
       //数据字典
       dynamicDynEquipList(param, res => {
         if (res.Result == "success") {

+ 3 - 3
src/components/point/dynamicdata/equipRules.vue

@@ -16,14 +16,14 @@
               </div>
               <div class="query-item">
                 <label style="padding-right:9px">数据源</label>
-                <dataSource :Related="true" @change="changeDataSource"></dataSource>
+                <dataSource :Related="null" @change="changeDataSource" :typeName="typeName"></dataSource> 
               </div>
               <div class="query-item">
-                <dictionary-device @change="changeDictionary" :Related="false"></dictionary-device>
+                <dictionary-device @change="changeDictionary" :Related="null" :typeName="typeName"></dictionary-device>
               </div>
               <div class="query-item">
                 <label style="padding-right:9px">位置标签</label>
-                <locationFlag :Related="true" @change="changeLocationFlag"></locationFlag>
+                <locationFlag :Related="null" @change="changeLocationFlag" :typeName="typeName"></locationFlag>
               </div>
             </el-row>
           </el-form>

+ 22 - 6
src/components/point/dynamicdata/locationCascader.vue

@@ -22,23 +22,39 @@ export default {
     this.init();
   },
   props: {
-    Related: {}
+    Related: {},
+    typeName: {}
   },
   computed: {
     ...mapGetters("layout", ["projectId"])
   },
   methods: {
     init() {
-      let param = { Related: this.Related };
+      let param = { Related: this.Related, typeName: this.typeName };
       dynamicLocationList(param, res => {
         this.LocationList = res.Content[0].List;
+        //添加未明确对象
+        this.LocationList.map(item => {
+          if (item.List && item.List.length) {
+            item.List.map(child => {
+              child.List.unshift({ Name: "未明确业务空间" })
+            })
+            item.List.unshift({ Name: '未明确楼层' })
+          }
+        })
+        this.LocationList.unshift({ Name: '未明确建筑' })
+        //结束
       });
     },
     changeCascader(val) {
       clearTimeout(this.timer);
       this.timer = setTimeout(() => {
-        this.$emit("change", val);
-      }, 500);
+        let tempVal = JSON.parse(JSON.stringify(val));
+        if (tempVal[tempVal.length - 1].indexOf('未明确') > -1) {
+          tempVal.splice(tempVal.length - 1, 1, '')
+        }
+        this.$emit("change", tempVal);
+      }, 800);
     }
   },
   watch: {
@@ -49,9 +65,9 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-.location{
+.location {
   width: 100%;
-  /deep/ .el-input__inner{
+  /deep/ .el-input__inner {
     vertical-align: baseline;
   }
 }

+ 3 - 2
src/components/point/dynamicdata/locationFlag.vue

@@ -15,7 +15,8 @@ export default {
     };
   },
   props: {
-    Related: {}
+    Related: {},
+    typeName: {}
   },
   created() {
     this.init();
@@ -26,7 +27,7 @@ export default {
   methods: {
     init() {
       this.Datasource = [];
-      let param = { Related: this.Related };
+      let param = { Related: this.Related, typeName: this.typeName };
       // 位置标签
       dynamicLocFlagList(param, res => {
         if (res.Result == "success") {

+ 0 - 1
src/views/point/config_point/edit_origin/index.vue

@@ -117,7 +117,6 @@
             getDataSouse() {
                 let param = {
                     Filters: {
-                        ProjectId: this.projectId,
                         Id: this.id
                     },
                     "PageNumber": 1,

+ 3 - 3
src/views/point/dynamicdata/addRelation/equipRela/index.vue

@@ -31,11 +31,11 @@
           </div>
           <div class="query-item">
             <label>数据源</label>
-            <dataSource :Related="false" @change="changeDataSource"></dataSource>
+            <dataSource :Related="false" @change="changeDataSource" :typeName="typeName"></dataSource>
           </div>
           <div class="query-item">
             <label>位置标签</label>
-            <locationFlag :Related="false" @change="changeLocationFlag"></locationFlag>
+            <locationFlag :Related="false" @change="changeLocationFlag" :typeName="typeName"></locationFlag>
           </div>
         </div>
         <!-- 左侧列表 -->
@@ -84,7 +84,7 @@
           </div>
           <div class="query-item">
             <label>所在位置</label>
-            <location-cas @change="changeLocation" :Related="false"></location-cas>
+            <location-cas @change="changeLocation" :Related="false" :typeName="typeName"></location-cas>
           </div>
         </div>
         <!-- 右侧列表 -->