浏览代码

解决tree重复点击为空问题

shaun-sheep 5 年之前
父节点
当前提交
b17df3ebe0
共有 3 个文件被更改,包括 27 次插入27 次删除
  1. 5 17
      src/views/legendLibrary/addForm.vue
  2. 20 8
      src/views/legendLibrary/addLegend.vue
  3. 2 2
      src/views/legendRules/index.vue

+ 5 - 17
src/views/legendLibrary/addForm.vue

@@ -201,7 +201,7 @@ export default {
             view: null,
             scene: null,
             typeVisualization: [],
-            visualizationList: [], //已选铺位可视化
+
             majorList: [], //专业
             deviceList: []
         }
@@ -210,7 +210,6 @@ export default {
     methods: {
         getFile(file) {
             this.file = file.file
-            console.log(file)
             var formData = new FormData()
             formData.append('file', file.file)
             if (this.ruleForm.Url) {
@@ -218,7 +217,6 @@ export default {
             }
             let postParams = formData
             uploadImg({ postParams }).then(res => {
-                console.log(res)
                 if (res.Result == 'success') {
                     this.$set(this.ruleForm, 'Url', res.EntityList[0])
                     this.$message.success('图标上传成功!')
@@ -232,7 +230,6 @@ export default {
             }
 
             createLegend({ postParams }).then(res => {
-                console.log(res)
                 if (res.Result == 'success') {
                     this.$message.success('添加图例成功!')
                     this.$emit('addSuccess')
@@ -322,14 +319,6 @@ export default {
         //线条宽度
         changeLineWidth(val) {
             this.$set(this.ruleForm, 'LineWidth', val)
-            // this.linepxObject = val && this.linepxOption.find(item => item.id == val)
-            // if (this.$refs.select && this.$refs.select.$el) {
-            //     this.$refs.select.$el.children[0].children[0].setAttribute(
-            //         'style',
-            //         'background:url(' + this.linepxObject.src + ') center center no-repeat;color:transparent;'
-            //     )
-            // }
-
             if (this.view) {
                 this.view.lineWidth = Number(val)
             }
@@ -374,18 +363,17 @@ export default {
                 })
             }
         },
-        // 多选返回的id组
+        // 铺位可视化
         treeConfirm(data) {
-            console.log(data, 'data')
-            this.visualizationList = data
+            this.$set(this.ruleForm, 'InfoTypeId', data)
         },
         //专业
         treeConfirmMajor(id, info) {
-            console.log(id)
+            this.$set(this.ruleForm, 'InfoSystem', data)
         },
         //位置/设备
         treeConfirmDevice(id, info) {
-            console.log(id)
+            this.$set(this.ruleForm, 'InfoLocal', data)
         },
         focusChange(status) {
             // console.log('focusChange', status)

+ 20 - 8
src/views/legendLibrary/addLegend.vue

@@ -39,7 +39,10 @@ export default {
                 FillColor: '',
                 Url: '',
                 LineWidth: '',
-                LineDash: ''
+                LineDash: '',
+                InfoTypeId: [], //铺位可视化typeid
+                InfoLocal: [], //工程信息化位置与设备分类
+                InfoSystem: [] //工程信息化专业/系统
             },
             title: '',
             GraphCategoryId: 'DTXT',
@@ -66,7 +69,10 @@ export default {
                     Type: 'None',
                     Unit: '',
                     FillColor: '',
-                    Url: ''
+                    Url: '',
+                    InfoTypeId: [], //铺位可视化typeid
+                    InfoLocal: [], //工程信息化位置与设备分类
+                    InfoSystem: [] //工程信息化专业/系统
                 }
             } else if (title == '添加图例库') {
                 this.dialogVisible = true
@@ -75,7 +81,10 @@ export default {
                     Type: 'None',
                     Unit: '',
                     FillColor: '',
-                    Url: ''
+                    Url: '',
+                    InfoTypeId: [], //铺位可视化typeid
+                    InfoLocal: [], //工程信息化位置与设备分类
+                    InfoSystem: [] //工程信息化专业/系统
                 }
             } else if (title == '修改图例库') {
                 this.dialogVisible = true
@@ -98,7 +107,10 @@ export default {
                 Type: 'None',
                 Unit: '',
                 FillColor: '',
-                Url: ''
+                Url: '',
+                InfoTypeId: [], //铺位可视化typeid
+                InfoLocal: [], //工程信息化位置与设备分类
+                InfoSystem: [] //工程信息化专业/系统
             }
         },
         mesg() {
@@ -117,7 +129,7 @@ export default {
                 this.$message.info('请填写图例名称')
                 return false
             } else {
-                if (this.info.Type != 'Image') {
+                if (this.info.Type != 'Image' && this.info.Type != 'None') {
                     this.$refs.add.saveImg()
                 } else {
                     if (this.title == '添加图例库') {
@@ -129,9 +141,9 @@ export default {
                     }
                 }
                 this.dialogVisible = false
-                if (!this.title || this.info.Type == 'None') {
-                    this.$refs.add.create()
-                }
+                // if (!this.title || this.info.Type == 'None') {
+                //     this.$refs.add.create()
+                // }
             }
         },
         treeConfirm(ids, dataObj) {

+ 2 - 2
src/views/legendRules/index.vue

@@ -61,8 +61,8 @@ export default {
         }
     },
     methods: {
-        handleNodeClick(data) {
-            this.GraphCategoryId = data
+        handleNodeClick(data, e) {
+            this.GraphCategoryId = [e.node.eventKey]
             this.getData()
         },
         deleteClick(row) {