Przeglądaj źródła

更换图例库树形组件

shaun-sheep 4 lat temu
rodzic
commit
9c33672b89

+ 41 - 11
src/views/legendLibrary/addForm.vue

@@ -82,16 +82,40 @@
                 <span class='form4-span3'>铺位可视化typeid</span>
             </div>
             <div class='form3-bottom'>
-                <el-select v-model='value' placeholder='请选择' size='small' style='width:200px;margin-right:48px;'>
+                <!-- <el-select v-model='value' placeholder='请选择' size='small' style='width:200px;margin-right:48px;'>
                     <el-option v-for='item in options1' :key='item.value' :label='item.label' :value='item.value'></el-option>
                 </el-select>
                 <el-select v-model='value' placeholder='请选择' size='small' style='width:200px;margin-right:48px'>
                     <el-option v-for='item in options2' :key='item.value' :label='item.label' :value='item.value'></el-option>
-                </el-select>
+                </el-select>-->
+
+                <TreeSelect
+                    tipPlace='top'
+                    width='200'
+                    style=' margin-right:48px;'
+                    :notNull='true'
+                    :returnParentNode='false'
+                    :isShowAllChoice='true'
+                    :choseArea='true'
+                    :data='deviceList'
+                    @change='treeConfirmDevice'
+                />
+
+                <TreeSelect
+                    tipPlace='top'
+                    width='200'
+                    style=' margin-right:48px;'
+                    :notNull='true'
+                    :returnParentNode='false'
+                    :isShowAllChoice='true'
+                    :choseArea='true'
+                    :data='majorList'
+                    @change='treeConfirmMajor'
+                />
 
                 <TreeSelect
                     tipPlace='top'
-                    height='200'
+                    width='200'
                     :notNull='true'
                     :returnParentNode='false'
                     :isShowAllChoice='true'
@@ -176,7 +200,9 @@ export default {
             view: null,
             scene: null,
             typeVisualization: [],
-            visualizationList: [] //已选铺位可视化
+            visualizationList: [], //已选铺位可视化
+            majorList: [], //专业
+            deviceList: []
         }
     },
     props: ['ruleForm', 'title'],
@@ -341,10 +367,19 @@ export default {
         },
         // 多选返回的id组
         treeConfirm(data) {
-            console.log(data)
+            console.log(data, 'data')
+            this.visualizationList = data
+        },
+        //专业
+        treeConfirmMajor(id, info) {
+            console.log(id)
+        },
+        //位置/设备
+        treeConfirmDevice(id, info) {
+            console.log(id)
         },
         focusChange(status) {
-            console.log('focusChange', status)
+            // console.log('focusChange', status)
         },
         visualization() {
             getVisualization({}).then(res => {
@@ -359,11 +394,6 @@ export default {
                 children: data.Children ? data.Children.map(i => this.getTree(i)) : []
             }
         },
-        treeConfirm(id) {
-            this.visualizationList = id.map(i => {
-                return { id: i }
-            })
-        },
         focusChange(status) {
             console.log('focusChange', status)
         }

+ 41 - 10
src/views/legendLibrary/index.vue

@@ -29,8 +29,19 @@
                     style='margin:0 12px'
                     @confirm='getTableListPosition'
                 ></Select>
-                <Select width='180' tipPlace='top' caption='位置/设备分类:' :selectdata='dataSelect2' @change='getTableList' :placeholder='"请选择"'></Select>
-                <Select
+                <!-- <Select width='180' tipPlace='top' caption='位置/设备分类:' :selectdata='dataSelect2' @change='getTableList' :placeholder='"请选择"'></Select> -->
+                <TreeSelect
+                    caption='位置/设备分类:'
+                    tipPlace='top'
+                    height='180'
+                    style='margin:0 12px'
+                    :returnParentNode='false'
+                    :isShowAllChoice='true'
+                    :choseArea='true'
+                    :data='deviceList'
+                    @change='treeConfirmDevice'
+                />
+                <!-- <Select
                     width='180'
                     tipPlace='top'
                     caption='专业:'
@@ -38,7 +49,18 @@
                     :placeholder='"请选择"'
                     @change='getTableList'
                     style='margin:0 12px'
-                ></Select>
+                ></Select>-->
+                <TreeSelect
+                    caption='专业:'
+                    tipPlace='top'
+                    height='180'
+                    style='margin:0 12px'
+                    :returnParentNode='false'
+                    :isShowAllChoice='true'
+                    :choseArea='true'
+                    :data='majorList'
+                    @change='treeConfirmMajor'
+                />
 
                 <TreeSelect
                     caption='铺位可视化:'
@@ -174,7 +196,9 @@ export default {
             ],
             keyword: '',
             typeVisualization: [],
-            visualizationList: [] //已选铺位可视化
+            visualizationList: [], //已选铺位可视化
+            majorList: [], //专业
+            deviceList: []
         }
     },
     methods: {
@@ -190,12 +214,11 @@ export default {
         visualization() {
             getVisualization({}).then(res => {
                 this.typeVisualization = res.Data && res.Data.map(i => this.getTree(i))
-                console.log(this.typeVisualization, 'typeVisualization')
             })
         },
         getTree(data) {
             return {
-                id: data.Type,
+                id: data.Id,
                 name: data.Name,
                 children: data.Children ? data.Children.map(i => this.getTree(i)) : []
             }
@@ -289,14 +312,22 @@ export default {
         addSuccess() {
             this.getTableList()
         },
+        // 铺位可视化
         treeConfirm(id, info) {
-            this.visualizationList = info.map(i => i.id)
-            console.log(info)
+            // this.visualizationList = info.map(i => i.id)
+            console.log(id, 'id')
             // this.getTableList()
-            console.log(this.visualizationList, '==visualizationList=visualizationListvisualizationList')
+        },
+        //专业
+        treeConfirmMajor(id, info) {
+            console.log(id)
+        },
+        //位置/设备
+        treeConfirmDevice(id, info) {
+            console.log(id)
         },
         focusChange(status) {
-            console.log('focusChange', status)
+            // console.log('focusChange', status)
         }
     },
     mounted() {

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

@@ -7,7 +7,7 @@
         </div>
         <div class='legend-rules-bottom'>
             <div class='legend-rules-left'>
-                <p>楼层功能</p>
+                <!-- <p>楼层功能</p> -->
                 <!-- <el-tree :data='treeData' :default-checked-keys='`GDXT`' :props='defaultProps' default-expand-all @node-click='handleNodeClick'></el-tree> -->
                 <a-tree
                     :tree-data='treeData'