Browse Source

修改图例接口传参规则

shaun-sheep 4 years ago
parent
commit
16ec5c7081

+ 4 - 27
src/views/legendLibrary/addForm.vue

@@ -27,7 +27,6 @@
             <div class='input-right' ref='graph' v-show='ruleForm.Type=="Zone" || ruleForm.Type=="Image" || ruleForm.Type =="Line"'>
                 <div v-show=' ruleForm.Type=="Image" && ruleForm.Url' class='input-right'>
                     <img :src='`/serve/topology-wanda/Picture/query/${ruleForm.Url}`' alt />
-                    <!-- {{ruleForm.Url}} -->
                 </div>
                 <canvas id='canvas' :width='canvasWidth' :height='canvasHeight' v-show='!(ruleForm.Type=="Image" && ruleForm.Url)'></canvas>
             </div>
@@ -87,17 +86,9 @@
         <div v-if='ruleForm.Type!="None"' class='form4'>
             <div class='form4-top'>
                 <span class='form4-span1'>专业/设备、位置类型:</span>
-                <!-- <span class='form4-span1'>对应工程信息化中的位置/设备分类</span>
-                <span class='form4-span2'>工程信息化的专业</span>-->
                 <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-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>-->
                 <span class='device-list'>
                     <TreeSelect
                         tipPlace='top'
@@ -111,19 +102,6 @@
                         :hideClear='true'
                     />
                 </span>
-
-                <!-- <TreeSelect
-                    tipPlace='top'
-                    width='200'
-                    style=' margin-right:48px;'
-                    :notNull='true'
-                    :returnParentNode='false'
-                    :isShowAllChoice='true'
-                    :choseArea='true'
-                    :data='majorList'
-                    @change='treeConfirmMajor'
-                />-->
-
                 <TreeSelect
                     tipPlace='top'
                     width='200'
@@ -169,7 +147,7 @@ export default {
             ],
             options1: [],
             options2: [],
-            options3: [],
+
             borderLineOption: [
                 {
                     id: 'solid',
@@ -390,10 +368,7 @@ export default {
             //console.log(data, 'data')
             this.$set(this.ruleForm, 'InfoTypeId', data)
         },
-        //专业
-        // treeConfirmMajor(id, info) {
-        //     // this.$set(this.ruleForm, 'InfoSystem', data)
-        // },
+
         //位置/设备
         treeConfirmDevice(id, info) {
             // this.$set(this.ruleForm, 'InfoLocal', data)
@@ -403,9 +378,11 @@ export default {
                 let type = info[i]
                 if (type.name.includes('/')) {
                     InfoLocal.push(type)
+                    //位置/设备
                     this.$set(this.ruleForm, 'InfoLocal', InfoLocal)
                 } else {
                     InfoSystem.push(type)
+                    //专业
                     this.$set(this.ruleForm, 'InfoSystem', InfoSystem)
                 }
             }

+ 24 - 20
src/views/legendLibrary/index.vue

@@ -48,7 +48,7 @@
                         width='280'
                         style='margin:0 12px'
                         :isShowAllChoice='true'
-                        :returnParentNode='false'
+                        :returnParentNode='true'
                         :choseArea='true'
                         :data='deviceList'
                         :hideClear='true'
@@ -108,18 +108,26 @@
                     <template slot-scope='{row}'>{{row.Unit || '--'}}</template>
                 </el-table-column>
                 <el-table-column prop='position' label='对应广场说明书的位置'>
-                    <template slot-scope='{row}'>{{row.position || '--'}}</template>
+                    <template slot-scope='{row}'>
+                        <span v-for='item in row.GraphCategorys ' :key='item.Name'>{{item.Name}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column label='对应工程信息化' align='center'>
-                    <el-table-column prop='type' label='位置/设备分类' width='240'>
-                        <template slot-scope='{row}'>{{row.InfoLocal || '--'}}</template>
+                    <el-table-column prop='type' label='位置/设备分类' width='240' :show-overflow-tooltip='true'>
+                        <template slot-scope='{row}'>
+                            <span v-for='item in row.InfoLocal ' :key='item.name'>{{item.name}}</span>
+                        </template>
                     </el-table-column>
                     <el-table-column prop='system' label='专业'>
-                        <template slot-scope='{row}'>{{row.InfoSystem || '--'}}</template>
+                        <template slot-scope='{row}'>
+                            <span v-for='(item,index) in row.InfoSystem ' :key='index'>{{item}}</span>
+                        </template>
                     </el-table-column>
                 </el-table-column>
                 <el-table-column prop='typeId' resizable label='铺位可视化typeid' width='140'>
-                    <template slot-scope='{row}'>{{row.InfoSystem || '--'}}</template>
+                    <template slot-scope='{row}'>
+                        <span v-for='(item,index) in row.InfoTypeId ' :key='index'>{{item}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column label='操作' width='100' v-if='state==1'>
                     <template slot-scope='scope' v-if='state==1'>
@@ -353,20 +361,16 @@ export default {
         // },
         //位置/设备
         treeConfirmDevice(id, info) {
-            // console.log(id, info)
-            // var a = []
-            // var d = []
-            // for (let i = 0; i < info.length; i++) {
-            //     let type = info[i]
-            //     if (type.name.includes('/')) {
-            //         a.push(type)
-            //     } else {
-            //         d.push(type)
-            //     }
-            // }
-            // console.log('a:', a, 'd:', d)
-
-            this.InfoLocals = id
+            this.InfoSystems = []
+            this.InfoLocals = []
+            for (let i = 0; i < info.length; i++) {
+                let type = info[i]
+                if (type.name.includes('/')) {
+                    this.InfoLocals.push(type.id)
+                } else {
+                    this.InfoSystems.push(type.id)
+                }
+            }
             this.getTableList()
         },
         //说明书位置

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

@@ -38,6 +38,16 @@
                         </template>
                     </el-table-column>
                 </el-table>
+                <!-- <Table
+                    :head='headList2'
+                    :source='tableData'
+                    :toolButtons='toolBtns'
+                    :selectWidth='180'
+                    height='100%'
+                    @tool-button-click='buttonClickHandle'
+                >
+                    <img slot-scope='{col, row}' v-if='col.key==="Url"' class='img' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
+                </Table>-->
             </div>
         </div>
         <add-legend ref='addLegend' @mesg='mesg'></add-legend>
@@ -57,10 +67,55 @@ export default {
                 children: 'Category',
                 title: 'Name',
                 key: 'Id'
-            }
+            }, //test
+            // 可筛选表格表头列表
+            headList2: [
+                {
+                    title: '图例名称', // 列的名称
+                    key: 'Name', // 列的标识
+                    show: true // 是否显示该列
+                },
+                {
+                    title: '图例样式',
+                    key: 'Url',
+                    show: true
+                },
+                {
+                    title: '单位',
+                    key: 'Unit',
+                    show: true
+                }
+            ],
+            // 操作按钮组 (非必填)
+            toolBtns: [
+                {
+                    icon: 'copy',
+                    name: '上移'
+                },
+                {
+                    icon: 'print',
+                    name: '下移'
+                },
+                {
+                    icon: 'pending',
+                    name: '删除'
+                }
+            ]
         }
     },
     methods: {
+        /**
+         * 点击工具栏按钮回调方法
+         * @param {Object} Obj {tool:{icon:'icon组件名称',name:'按钮名称',type:'icon组件type'},item:当前行数据}
+         */
+        buttonClickHandle(obj) {
+            console.log(obj)
+            if (obj.tool.name == '删除') {
+                this.deleteClick(obj.item)
+                return
+            }
+        },
+
         handleNodeClick(data, e) {
             this.GraphCategoryId = [e.node.eventKey]
             this.getData()