Pārlūkot izejas kodu

添加说明书位置接口,更换说明书位置组件

shaun-sheep 4 gadi atpakaļ
vecāks
revīzija
47e371a1f7
1 mainītis faili ar 40 papildinājumiem un 15 dzēšanām
  1. 40 15
      src/views/legendLibrary/index.vue

+ 40 - 15
src/views/legendLibrary/index.vue

@@ -18,7 +18,7 @@
                     :placeholder='"请选择"'
                     @change='getTableList'
                 ></Select>
-                <Select
+                <!-- <Select
                     width='180'
                     tipPlace='top'
                     caption='说明书位置:'
@@ -28,7 +28,18 @@
                     :placeholder='"请选择"'
                     style='margin:0 12px'
                     @confirm='getTableListPosition'
-                ></Select>
+                ></Select>-->
+                <TreeSelect
+                    caption='说明书位置:'
+                    tipPlace='top'
+                    height='180'
+                    style='margin:0 12px'
+                    :returnParentNode='false'
+                    :isShowAllChoice='true'
+                    :choseArea='true'
+                    :data='positionSelect'
+                    @change='treeConfirmPosition'
+                />
                 <!-- <Select width='180' tipPlace='top' caption='位置/设备分类:' :selectdata='dataSelect2' @change='getTableList' :placeholder='"请选择"'></Select> -->
                 <TreeSelect
                     caption='位置/设备分类:'
@@ -141,7 +152,7 @@
 <script>
 import addLegend from './addLegend'
 import Select from '@/components/Select/Select.vue'
-import { queryLegend, deleteLegend, queryTypeId, getVisualization, queryRelation } from '@/api/legendLibrary.js'
+import { getLegendTree, queryLegend, deleteLegend, queryTypeId, getVisualization, queryRelation } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend, Select },
     data() {
@@ -183,17 +194,18 @@ export default {
             currentPage: 1,
             state: '1',
             position: [],
-            positionSelect: [
-                { id: 'GDXT', name: '供电系统-楼层分布' },
-                { id: 'FZQZL', name: '暖通空调-原理图' },
-                { id: 'NTXT', name: '暖通空调-楼层分布' },
-                { id: 'XFBFYCFL', name: '消防系统-系统概况' },
-                { id: 'XFXT', name: '消防系统-楼层分布' },
-                { id: 'RDXT', name: '弱电系统-楼层分布' },
-                { id: 'DTXT', name: '电梯系统-楼层分布' },
-                { id: 'RQXT', name: '燃气系统-楼层分布' },
-                { id: 'SCPZ', name: '土建装饰-石材铺装' }
-            ],
+            // positionSelect: [
+            //     { id: 'GDXT', name: '供电系统-楼层分布' },
+            //     { id: 'FZQZL', name: '暖通空调-原理图' },
+            //     { id: 'NTXT', name: '暖通空调-楼层分布' },
+            //     { id: 'XFBFYCFL', name: '消防系统-系统概况' },
+            //     { id: 'XFXT', name: '消防系统-楼层分布' },
+            //     { id: 'RDXT', name: '弱电系统-楼层分布' },
+            //     { id: 'DTXT', name: '电梯系统-楼层分布' },
+            //     { id: 'RQXT', name: '燃气系统-楼层分布' },
+            //     { id: 'SCPZ', name: '土建装饰-石材铺装' }
+            // ],
+            positionSelect: [],
             keyword: '',
             typeVisualization: [],
             visualizationList: [], //已选铺位可视化
@@ -202,6 +214,13 @@ export default {
         }
     },
     methods: {
+        //说明书位置
+        instruction() {
+            let getParams = {}
+            getLegendTree({ getParams }).then(res => {
+                this.positionSelect = res.Content && res.Content.map(i => this.getTree(i))
+            })
+        },
         dumpRules() {
             this.$router.push('/home/legendRules')
         },
@@ -217,10 +236,11 @@ export default {
             })
         },
         getTree(data) {
+            let child = data.Children || data.Category
             return {
                 id: data.Id,
                 name: data.Name,
-                children: data.Children ? data.Children.map(i => this.getTree(i)) : []
+                children: child ? child.map(i => this.getTree(i)) : []
             }
         },
         add() {
@@ -326,12 +346,17 @@ export default {
         treeConfirmDevice(id, info) {
             console.log(id)
         },
+        //说明书位置
+        treeConfirmPosition(id, info) {
+            console.log(id)
+        },
         focusChange(status) {
             // console.log('focusChange', status)
         }
     },
     mounted() {
         this.getTypeId()
+        this.instruction()
         this.visualization()
         this.getTableList()
     }