Kaynağa Gözat

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-bm-guide into develop

shaun-sheep 4 yıl önce
ebeveyn
işleme
2af4d78439

+ 31 - 3
src/api/legendLibrary.js

@@ -1,13 +1,41 @@
 import httputils from "@/api/httputils"
 // 图例库-查询
 export function queryLegend({ postParams }) {
-    return httputils.postJson(`/api/graphElement/query`, postParams)
+    return httputils.postJson(`/serve/graphElement/query`, postParams)
 }
 // 图例库-新增
 export function createLegend({ postParams }) {
-    return httputils.postJson(`/api/graphElement/create`, postParams)
+    return httputils.postJson(`/serve/graphElement/create`, postParams)
 }
 //图例库-更新
 export function updateLegend({ postParams }) {
-    return httputils.postJson(`/api/graphElement/update`, postParams)
+    return httputils.postJson(`/serve/graphElement/update`, postParams)
+}
+//图例库-作废
+export function deleteLegend({ postParams }) {
+    return httputils.postJson(`/serve/graphElement/deleteByFlag`, postParams)
+}
+//图例库-系统tree查询
+export function getLegendTree({ getParams }) {
+    return httputils.getJson(`/serve/graphCategory/queryByGroup`, getParams)
+}
+//图例库-系统tree相关表格查询
+export function queryRelation({ postParams }) {
+    return httputils.postJson(`/serve/graphRelation/query`, postParams)
+}
+//图例库-更新关系图
+export function updateRelation({ postParams }) {
+    return httputils.postJson(`/serve/graphRelation/update`, postParams)
+}
+//图例库-系统tree相关表格删除
+export function deleteRelation({ postParams }) {
+    return httputils.postJson(`/serve/graphRelation/delete`, postParams)
+}
+//图例库-上传图片
+export function uploadImg({ postParams }) {
+    return httputils.postJson(`/serve/Picture/create`, postParams)
+}
+//图例库-穿梭框的搜索
+export function getTransfer({ getParams }) {
+    return httputils.getJson(`/serve/graphElement/search`, getParams)
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 337 - 337
src/utils/plugins/components.js


+ 14 - 6
src/views/equipment/eqDialog.vue

@@ -15,13 +15,13 @@
                         v-for='(value,index) in dialogInfo.children'
                         :key='"u"+index'
                         :label='`${value.label}`'
-                        :name='`${value.param.CLASSSTRUCTUREID}`'
+                        :name='`${value.param.classstructureid}`'
                     >
                         <div v-if='value.id.slice(2,4)=="YL"' style='width:100%;height:600px;overflow:hidden'>
                             <rotation :rotationImg='rotationImg'></rotation>
                         </div>
-                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' ref='list' :param='param' major='弱电'></tableList>
-                        <tableList v-else-if='value.id.slice(0,4)=="NTQD"' ref='list' :param='param' major='暖通'></tableList>
+                        <tableList v-else-if='value.id.slice(0,4)=="RDQD"' ref='list1' :param='param' major='弱电'></tableList>
+                        <tableList v-else-if='value.id.slice(0,4)=="NTQD"' ref='list2' :param='param' major='暖通'></tableList>
                         <wb-table v-else-if='value.id.slice(2,4)=="WX"' param major='维修'></wb-table>
                         <zw-table v-else-if='value.id.slice(2,4)=="ZW"' param major='专维'></zw-table>
                         <wb-table v-else-if='value.id.slice(2,4)=="WB"' param major='维保'></wb-table>
@@ -49,14 +49,19 @@ export default {
             rotationImg: [require('@/assets/imgs/eq.jpg'), require('@/assets/imgs/survey_pop2.png'), require('@/assets/imgs/survey_pop1.png')]
         }
     },
-    mounted() {},
+    mounted() {
+        console.log(this.$refs)
+        if (this.$refs.list1) {
+            this.$refs.list1.getList(this.activeName)
+        }
+    },
     components: { tableList, tjTable, wbTable, zwTable, lookPage, GDQDTable },
     methods: {
         showModal(item) {
             this.visible = true
             this.dialogInfo = item
             if (Object.keys(this.dialogInfo).length > 0 && this.dialogInfo.children.length > 0) {
-                this.activeName = this.dialogInfo.children[0].param.CLASSSTRUCTUREID
+                this.activeName = this.dialogInfo.children[0].param.classstructureid
             }
         },
         handleClick(tab) {
@@ -114,7 +119,10 @@ export default {
         color: rgba(31, 36, 41, 1);
         border: 1px solid rgba(195, 199, 203, 1);
     }
-
+    .el-tabs,
+    .el-tabs__content {
+        height: 700px;
+    }
     .el-tabs__active-bar {
         background-color: transparent !important;
     }

+ 0 - 1
src/views/equipment/table/computerTable.vue

@@ -76,7 +76,6 @@ export default {
         position: absolute;
         height: 32px;
         right: 26px;
-        bottom: 20px;
     }
     td {
         overflow: hidden;

+ 0 - 1
src/views/equipment/table/lookPageTable.vue

@@ -82,7 +82,6 @@ export default {
         position: absolute;
         height: 32px;
         right: 26px;
-        bottom: 20px;
     }
     td {
         overflow: hidden;

+ 5 - 4
src/views/equipment/table/tjTable.vue

@@ -2,7 +2,7 @@
 <template>
     <div class='tj-list'>
         <div class='eq-list-top'>
-            <a-input-search placeholder='请按照类别或品牌搜索' style='width: 192px;margin-left:12px;height:32px;' @search='onSearch' />
+            <a-input-search placeholder='请按照类别或品牌搜索' v-model='keyword' style='width: 192px;margin-left:12px;height:32px;' @search='onSearch' />
         </div>
         <el-table :data='tableData' style='width: 100%'>
             <el-table-column type='index' label='序号' width='80'></el-table-column>
@@ -33,7 +33,8 @@ export default {
             tableData: [],
             total: 0,
             currentPage: 1,
-            size: 10
+            size: 10,
+            keyword: ''
         }
     },
     props: ['major'],
@@ -50,7 +51,8 @@ export default {
                 page: this.currentPage,
                 size: this.size,
                 plazaId: this.$store.state.plazaId,
-                major: this.major
+                major: this.major,
+                keyword: this.keyword
             }
             queryEquipmentList({ data, postParams }).then(res => {
                 console.log(res)
@@ -73,7 +75,6 @@ export default {
         position: absolute;
         height: 32px;
         right: 26px;
-        bottom: 20px;
     }
     td {
         overflow: hidden;

+ 0 - 1
src/views/equipment/table/wbTable.vue

@@ -81,7 +81,6 @@ export default {
         position: absolute;
         height: 32px;
         right: 26px;
-        bottom: 20px;
     }
     td {
         overflow: hidden;

+ 66 - 24
src/views/legendLibrary/addForm.vue

@@ -3,35 +3,35 @@
         <div class='form1'>
             <span class='span1'>图例编码</span>
             <span class='span2'>图例名称</span>
-            <span class='span3' v-if='ruleForm.type==1 || ruleForm.type==3'>展示预览</span>
+            <span class='span3' v-if='ruleForm.Type==1 || ruleForm.Type==3'>展示预览</span>
         </div>
         <div class='form2'>
             <div class='input-left'>
-                <el-input v-model='ruleForm.code' disabled style='width:200px;height:32px;margin-right:48px;'></el-input>
-                <el-input v-model='ruleForm.name' style='width:200px;height:32px;'></el-input>
+                <el-input v-model='ruleForm.Code' disabled style='width:200px;height:32px;margin-right:48px;'></el-input>
+                <el-input v-model='ruleForm.Name' style='width:200px;height:32px;'></el-input>
                 <div class='title'>单位</div>
                 <div class='type'>图例类型</div>
                 <el-input v-model='ruleForm.unit' style='width:200px;height:32px;'></el-input>
-                <el-select v-model='ruleForm.type' placeholder='请选择' style='width:200px;height:32px;margin-left:46px'>
+                <el-select v-model='ruleForm.Type' placeholder='请选择' style='width:200px;height:32px;margin-left:46px'>
                     <el-option v-for='item in options' :key='item.value' :label='item.label' :value='item.value'></el-option>
                 </el-select>
             </div>
-            <div class='input-right' v-if='ruleForm.type==1 || ruleForm.type==3'>
+            <div class='input-right' v-if='ruleForm.Type==1 || ruleForm.Type==3'>
                 <div
                     class='model'
                     :style='`background:${ruleForm.color};border-width:${ruleForm.borderLine}px;border-style:${ruleForm.borderColor}; border-color:${ruleForm.borderColor};`'
                 ></div>
             </div>
         </div>
-        <div v-if='ruleForm.type==1 || ruleForm.type==4' class='form3'>
+        <div v-if='ruleForm.Type==1 || ruleForm.Type==4' class='form3'>
             <div class='form3-top'>
-                <span class='form3-span1' v-if='ruleForm.type==1'>填充色以及透明度</span>
+                <span class='form3-span1' v-if='ruleForm.Type==1'>填充色以及透明度</span>
                 <span class='form3-span3'>边框颜色</span>
                 <span class='form3-span4'>边框线型</span>
                 <span class='form3-span5'>边框粗细</span>
             </div>
             <div class='form3-bottom'>
-                <el-color-picker v-if='ruleForm.type==1' v-model='ruleForm.color' show-alpha style='margin:0 172px 0 10px'></el-color-picker>
+                <el-color-picker v-if='ruleForm.Type==1' v-model='ruleForm.color' show-alpha style='margin:0 172px 0 10px'></el-color-picker>
                 <el-color-picker v-model='ruleForm.borderColor' show-alpha style='margin:0 90px 0 10px'></el-color-picker>
 
                 <el-select
@@ -53,18 +53,18 @@
                 </el-select>
             </div>
         </div>
-        <div v-if='ruleForm.type==3' class='form5'>
+        <div v-if='ruleForm.Type==3' class='form5'>
             <div class='form5-top'>上传新图标</div>
             <div>
-                <el-upload class='upload-demo' action='https://jsonplaceholder.typicode.com/posts/' :file-list='fileList'>
+                <el-upload class='upload-demo' action='https://jsonplaceholder.typicode.com/posts/' :http-request='getFile' :file-list='fileList'>
                     <el-button size='small' style='color:#1F2329;'>点击上传</el-button>
                 </el-upload>
             </div>
         </div>
-        <div v-if='ruleForm.type!=2' class='form4'>
+        <div v-if='ruleForm.Type!=2' class='form4'>
             <div class='form4-top'>
                 <span class='form4-span1'>对应工程信息化中的位置/设备分类</span>
-                <span class='form4-span2'>工程信息化的专业/系统</span>
+                <span class='form4-span2'>工程信息化的专业</span>
                 <span class='form4-span3'>铺位可视化typeid</span>
             </div>
             <div class='form3-bottom'>
@@ -83,19 +83,20 @@
 </template>
 
 <script>
+import { createLegend, updateLegend, uploadImg } from '@/api/legendLibrary.js'
 export default {
     data() {
         return {
-            ruleForm: {
-                color: 'rgba(19, 206, 102, 0.8)',
-                borderColor: 'rgba(19, 206, 102, 0.8)',
-                borderLine: '',
-                linepx: '',
-                code: '',
-                name: '',
-                type: '2',
-                unit: ''
-            },
+            // ruleForm: {
+            //     color: 'rgba(19, 206, 102, 0.8)',
+            //     borderColor: 'rgba(19, 206, 102, 0.8)',
+            //     borderLine: '',
+            //     linepx: '',
+            //     Code: '',
+            //     Name: '',
+            //     Type: '2',
+            //     unit: ''
+            // },
             options: [
                 {
                     value: '2',
@@ -143,10 +144,24 @@ export default {
                 }
             ],
             fileList: [],
+            imgSrc: '', //图标的key,/serve/Picture/query/${imgSrc}
             value: ''
         }
     },
+    props: ['ruleForm'],
     methods: {
+        getFile(file) {
+            console.log(file)
+            var formData = new FormData()
+            formData.append('file', file.file)
+            let postParams = formData
+            uploadImg({ postParams }).then(res => {
+                if (res.Result == 'success') {
+                    this.imgSrc = res.EntityList[0]
+                    this.$message.success('图标上传成功!')
+                }
+            })
+        },
         changeSelection() {
             console.log(this.ruleForm.linepx)
             let path = this.$refs.select.selectedLabel
@@ -162,8 +177,32 @@ export default {
                 'style',
                 'background:url(' + path + ')  center center no-repeat;color:transparent;'
             )
+        },
+        create() {
+            //新增
+            let postParams = {
+                Name: this.ruleForm.Name,
+                Theme: '111',
+                Type: '111',
+                Id: '77'
+            }
+            createLegend({ postParams }).then(res => {
+                if (res.Result == 'success') {
+                    this.$message.success('添加图例成功!')
+                }
+            })
+        },
+        update() {
+            //修改
+            let postParams = this.ruleForm
+            updateLegend({ postParams }).then(res => {
+                if (res.Result == 'success') {
+                    this.$message.success('图例修改成功!')
+                }
+            })
         }
-    }
+    },
+    mounted() {}
 }
 </script>
 
@@ -260,7 +299,7 @@ export default {
             padding: 12px 0 8px 0;
         }
     }
-    .span1::after,
+
     .span2::after,
     .type::after,
     .form3-span1::after,
@@ -269,5 +308,8 @@ export default {
         color: #f56c6c;
         margin-left: 4px;
     }
+    .upload-demo {
+        display: flex;
+    }
 }
 </style>

+ 19 - 5
src/views/legendLibrary/addLegend.vue

@@ -1,11 +1,11 @@
 <template>
     <div class='add-legend'>
         <el-dialog :title='title' :visible.sync='dialogVisible'>
-            <add-list v-if='title==""'></add-list>
-            <add-form v-else></add-form>
+            <add-list v-if='title==""' ref='searchList' :GraphCategoryId='GraphCategoryId'></add-list>
+            <add-form v-else ref='add' :ruleForm='info'></add-form>
             <span slot='footer' class='dialog-footer'>
                 <el-button @click='dialogVisible = false' size='small'>取 消</el-button>
-                <el-button type='primary' @click='dialogVisible = false' size='small'>确 定</el-button>
+                <el-button type='primary' @click='save' size='small'>确 定</el-button>
             </span>
         </el-dialog>
     </div>
@@ -19,15 +19,29 @@ export default {
         return {
             dialogVisible: false,
             info: {},
-            title: ''
+            title: '',
+            GraphCategoryId: ''
         }
     },
     components: { addForm, addList },
     methods: {
-        open(row, title) {
+        open(row, title, GraphCategoryId) {
             this.dialogVisible = true
             this.title = title
             this.info = row
+            this.GraphCategoryId = GraphCategoryId
+            // if (!title) {
+            //     this.$refs.searchList.query()
+            // }
+        },
+        save() {
+            this.dialogVisible = false
+            if (this.title == '添加图例库') {
+                this.$refs.add.create()
+            }
+            if (this.title == '修改图例库') {
+                this.$refs.add.update()
+            }
         }
     }
 }

+ 82 - 17
src/views/legendLibrary/index.vue

@@ -21,25 +21,53 @@
                 ></Select>
                 <Select width='180' tipPlace='top' caption='位置/设备分类:' :selectdata='dataSelect2' :placeholder='"请选择"'></Select>
                 <Select width='180' tipPlace='top' caption='专业/系统:' :selectdata='dataSelect2' :placeholder='"请选择"' style='margin:0 12px'></Select>
-                <Select width='180' tipPlace='top' caption='铺位可视化:' :selectdata='typeIdSelect' :placeholder='"请选择"'></Select>
-                <Select width='180' tipPlace='top' caption='状态:' v-model='state' :selectdata='stateSelect' :placeholder='"请选择"' style='margin:0 12px'></Select>
+                <Select width='180' tipPlace='top' caption='铺位可视化:' :selectdata='typeIdSelect' :placeholder='"请选择"' @change='getTableList'></Select>
+                <Select
+                    width='180'
+                    tipPlace='top'
+                    caption='状态:'
+                    v-model='state'
+                    :selectdata='stateSelect'
+                    @change='getTableList'
+                    :placeholder='"请选择"'
+                    style='margin:0 12px'
+                ></Select>
                 <a-input-search placeholder style='width: 192px;height:34px' @search='onSearch' />
             </div>
             <el-table :data='tableData' style='width: 100%'>
-                <el-table-column prop='name' label='图例名称'></el-table-column>
-                <el-table-column prop='style' label='图例样式'></el-table-column>
-                <el-table-column prop='unit' label='单位'></el-table-column>
-                <el-table-column prop='position' label='对应广场说明书的位置'></el-table-column>
-                <el-table-column prop='type' label='对应工程信息化中的位置/设备分类' width='240'></el-table-column>
-                <el-table-column prop='system' label='对应工程信息化的系统'></el-table-column>
-                <el-table-column prop='typeId' label='铺位可视化typeid'></el-table-column>
+                <el-table-column prop='Name' label='图例名称'>
+                    <template slot-scope='{row}'>{{row.Name || '--'}}</template>
+                </el-table-column>
+                <el-table-column prop='style' label='图例样式'>
+                    <template slot-scope='{row}'>
+                        <img v-if='row.Url' class='img' :src='`/serve/Picture/query/${row.Url}`' alt />
+                        <span v-else>{{'--'}}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop='Unit' label='单位'>
+                    <template slot-scope='{row}'>{{row.Unit || '--'}}</template>
+                </el-table-column>
+                <el-table-column prop='position' label='对应广场说明书的位置'>
+                    <template slot-scope='{row}'>{{row.Unit || '--'}}</template>
+                </el-table-column>
+                <el-table-column prop='type' label='位置/设备分类' width='240'>
+                    <template slot-scope='{row}'>{{row.InfoLocal || '--'}}</template>
+                </el-table-column>
+                <el-table-column prop='system' label='专业'>
+                    <template slot-scope='{row}'>{{row.InfoSystem || '--'}}</template>
+                </el-table-column>
+                <el-table-column prop='typeId' label='铺位可视化typeid'>
+                    <template slot-scope='{row}'>{{row.InfoSystem || '--'}}</template>
+                </el-table-column>
                 <el-table-column label='操作' width='100' v-if='state==1'>
                     <template slot-scope='scope' v-if='state==1'>
                         <el-button @click='modifyClick(scope.row)' type='text' size='small'>修改</el-button>
                         <el-button @click='deleteClick(scope.row)' type='text' size='small'>做废</el-button>
                     </template>
                 </el-table-column>
-                <el-table-column v-else prop='time' label='作废时间'></el-table-column>
+                <el-table-column v-if='state==0' prop='DeleteTime' label='作废时间' width='180'>
+                    <template v-if='state==0' slot-scope='{row}'>{{row.DeleteTime || '--'}}</template>
+                </el-table-column>
             </el-table>
             <div class='foot'>
                 <el-pagination
@@ -59,11 +87,12 @@
 <script>
 import addLegend from './addLegend'
 import Select from '@/components/Select/Select.vue'
+import { queryLegend, deleteLegend } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend, Select },
     data() {
         return {
-            tableData: [{ name: '车库', style: '--' }, { style: '--' }],
+            tableData: [],
             dataSelect2: [
                 { id: 'test1', name: '选择项' },
                 { id: 'test2', name: '单平米' },
@@ -124,7 +153,7 @@ export default {
         modifyClick(row) {
             this.$refs.addLegend.open(row, '修改图例库')
         },
-        deleteClick() {
+        deleteClick(row) {
             this.$confirm('作废后则不可更改', '确定要作废图例吗?', {
                 confirmButtonText: '作废',
                 cancelButtonText: '取消',
@@ -132,9 +161,19 @@ export default {
                 center: true
             })
                 .then(() => {
-                    this.$message({
-                        type: 'success',
-                        message: '删除成功!'
+                    let postParams = [
+                        {
+                            Id: row.Id
+                        }
+                    ]
+                    deleteLegend({ postParams }).then(res => {
+                        if (res.Result == 'success') {
+                            this.$message({
+                                type: 'success',
+                                message: '作废成功!'
+                            })
+                            this.getTableList()
+                        }
                     })
                 })
                 .catch(() => {
@@ -149,9 +188,26 @@ export default {
             this.size = size
             this.getTableList()
         },
-        getTableList() {}
+        getTableList() {
+            let postParams = {
+                PageNumber: this.currentPage,
+                PageSize: this.size
+            }
+            if (this.state == 0) {
+                postParams.Filters = 'deleted=true'
+            } else {
+                postParams.Filters = 'deleted=false'
+            }
+            queryLegend({ postParams }).then(res => {
+                console.log(res)
+                this.tableData = res.Content
+                this.total = res.Total
+            })
+        }
     },
-    mounted() {}
+    mounted() {
+        this.getTableList()
+    }
 }
 </script>
 <style lang="less" scoped>
@@ -181,6 +237,15 @@ export default {
             display: flex;
             align-items: center;
         }
+        .img {
+            width: 28px;
+            height: 28px;
+        }
+    }
+    .foot {
+        position: absolute;
+        height: 32px;
+        right: 26px;
     }
 }
 </style>

+ 58 - 19
src/views/legendRules/addList.vue

@@ -1,38 +1,77 @@
 <template>
     <div class='add-transfer'>
-        <el-transfer v-model='value' :props='{
-      key: "value",
-      label: "desc"
-    }' :data='data'></el-transfer>
+        <div>
+            <a-input-search v-model='keyword' placeholder style='width: 192px;margin-bottom:12px;height:32px;' @search='queryAll' />
+        </div>
+        <el-transfer v-model='value' :data='data' @change='transferChange'></el-transfer>
     </div>
 </template>
 
 <script>
+import { getTransfer, updateRelation, queryRelation } from '@/api/legendLibrary.js'
 export default {
     data() {
-        const generateData = () => {
-            const data = []
-            for (let i = 1; i <= 15; i++) {
-                data.push({
-                    value: i,
-                    desc: `备选项 ${i}`
+        return {
+            data: [],
+            value: [],
+            keyword: '',
+            multipleSelection: []
+        }
+    },
+    props: ['GraphCategoryId'],
+    methods: {
+        transferChange(value) {
+            this.multipleSelection = value
+        },
+        queryAll() {
+            let getParams = {
+                keywords: this.keywords
+            }
+            this.data = []
+            getTransfer({ getParams }).then(res => {
+                console.log(res)
+                let content = res.Content
+                content.forEach(el => {
+                    this.data.push({
+                        label: el.Name + '',
+                        key: el.Id
+                    })
                 })
+            })
+            this.querySelect()
+        },
+        querySelect() {
+            let postParams = {
+                GraphCategoryId: this.GraphCategoryId
             }
-            return data
-        }
-        return {
-            data: generateData(),
-            value: []
+            queryRelation({ postParams }).then(res => {
+                let content = res.Content
+                content.forEach(el => {
+                    this.value.push({
+                        label: el.Name + '',
+                        key: el.Id
+                    })
+                })
+            })
+        },
+        save() {
+            let GraphElementIds = this.value.forEach
+            let postParams = {
+                GraphCategoryId: this.GraphCategoryId,
+                GraphElementIds: this.value
+            }
+            updateRelation({ postParams }).then(res => {})
         }
+    },
+    mounted() {
+        this.queryAll()
     }
 }
 </script>
 
 <style lang='less' scoped>
 .add-transfer {
-    display: flex;
-    align-self: center;
-    justify-content: center;
-    margin-top: 40px;
+    margin-top: 20px;
+    margin-left: 20px;
 }
 </style>

+ 70 - 88
src/views/legendRules/index.vue

@@ -8,16 +8,25 @@
         <div class='legend-rules-bottom'>
             <div class='legend-rules-left'>
                 <p>楼层功能</p>
-                <el-tree :data='data' :props='defaultProps' default-expand-all @node-click='handleNodeClick'></el-tree>
+                <el-tree :data='treeData' default-expand-all @node-click='handleNodeClick'></el-tree>
             </div>
             <div class='legend-rules-right'>
                 <el-table :data='tableData' style='width: 100%'>
-                    <el-table-column prop='date' label='图例名称'></el-table-column>
-                    <el-table-column prop='name' label='图例样式'></el-table-column>
-                    <el-table-column prop='address' label='地址'></el-table-column>
+                    <el-table-column prop='Name' label='图例名称'>
+                        <template slot-scope='{row}'>{{row.Name || '--'}}</template>
+                    </el-table-column>
+                    <el-table-column prop='Url' label='图例样式'>
+                        <template slot-scope='{row}'>
+                            <img v-if='row.Url' class='img' :src='`/serve/Picture/query/${row.Url}`' alt />
+                            <span v-else>{{'--'}}</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop label='单位'>
+                        <template slot-scope='{row}'>{{row.Unit || '--'}}</template>
+                    </el-table-column>
                     <el-table-column label='操作' width='100'>
                         <template slot-scope='scope'>
-                            <el-button @click='handleClick(scope.row)' type='text' size='small'>删除</el-button>
+                            <el-button @click='deleteClick(scope.row)' type='text' size='small'>删除</el-button>
                         </template>
                     </el-table-column>
                 </el-table>
@@ -28,101 +37,70 @@
 </template>
 <script>
 import addLegend from '../legendLibrary/addLegend'
+import { getLegendTree, queryRelation, deleteRelation } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend },
     data() {
         return {
-            data: [
-                {
-                    label: '楼层分布',
-                    children: [
-                        {
-                            label: '供电系统',
-                            id: 'GD'
-                        },
-                        {
-                            label: '暖通系统',
-                            id: 'NT'
-                        },
-                        {
-                            label: '消防系统',
-                            id: 'XF'
-                        },
-
-                        {
-                            label: '弱电系统',
-                            id: 'RD'
-                        },
-                        {
-                            label: '给排水系统',
-                            id: 'GP'
-                        },
-                        {
-                            label: '电梯系统',
-                            id: 'DT'
-                        },
-                        {
-                            label: '燃气系统',
-                            id: 'RT'
-                        }
-                    ]
-                },
-                {
-                    label: '石材铺装(土建装饰)',
-                    children: []
-                },
-                {
-                    label: '系统原理图',
-                    children: [
-                        {
-                            label: '分支器支路分布图(暖通系统)',
-                            id: 'FZL'
-                        },
-                        {
-                            label: '消防泵房引出管路分布图(消防系统)',
-                            id: 'XFB'
-                        }
-                    ]
-                }
-            ],
-            defaultProps: {
-                children: 'children',
-                label: 'label'
-            },
-            tableData: [
-                {
-                    date: '2016-05-02',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1518 弄'
-                },
-                {
-                    date: '2016-05-04',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1517 弄'
-                },
-                {
-                    date: '2016-05-01',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1519 弄'
-                },
-                {
-                    date: '2016-05-03',
-                    name: '王小虎',
-                    address: '上海市普陀区金沙江路 1516 弄'
-                }
-            ]
+            treeData: [],
+            GraphCategoryId: 'JPSXT',
+            tableData: []
         }
     },
     methods: {
         handleNodeClick(data) {
-            console.log(data)
+            this.GraphCategoryId = data.Id
+            this.getData()
+        },
+        deleteClick(row) {
+            console.log(row)
+            let postParams = [
+                {
+                    GraphCategoryId: this.GraphCategoryId,
+                    GraphElementId: row.Id
+                }
+            ]
+            deleteRelation({ postParams }).then(res => {
+                if (res.Result == 'success') {
+                    this.$message({
+                        type: 'success',
+                        message: '删除成功!'
+                    })
+                    this.getData()
+                }
+            })
         },
-        handleClick() {},
         add() {
-            this.$refs.addLegend.open('', '')
+            this.$refs.addLegend.open('', '', this.GraphCategoryId)
+        },
+        init() {
+            let getParams = {}
+            getLegendTree({ getParams }).then(res => {
+                console.log(res)
+                let content = res.Content
+                content.forEach(el => {
+                    el.label = el.Name
+                    el.children = el.Category || []
+                    el.Category.forEach(ele => {
+                        ele.label = ele.Name
+                    })
+                })
+                this.treeData = content
+                this.getData()
+            })
+        },
+        getData() {
+            let postParams = {
+                GraphCategoryId: this.GraphCategoryId
+            }
+            queryRelation({ postParams }).then(res => {
+                this.tableData = res.Content
+            })
         }
     },
-    mounted() {}
+    mounted() {
+        this.init()
+    }
 }
 </script>
 <style lang="less" scoped>
@@ -155,6 +133,10 @@ export default {
             flex: 1;
             background: #fff;
             color: #1f2429;
+            .img {
+                width: 28px;
+                height: 28px;
+            }
         }
     }
 }

+ 15 - 7
vue.config.js

@@ -16,6 +16,14 @@ module.exports = {
                     "^/wanda": "",
                 },
             },
+            "/serve": {
+                target: "http://192.168.200.83:8085/",
+                changeOrigin: true,
+                secure: false,
+                pathRewrite: {
+                    "^/serve": "",
+                },
+            },
         },
         // 关闭esline
         overlay: {
@@ -24,13 +32,13 @@ module.exports = {
         },
     },
     chainWebpack: (config) => {
-        const svgRule = config.module.rule('svg');
-        svgRule.uses.clear();
+        const svgRule = config.module.rule("svg")
+        svgRule.uses.clear()
         svgRule
-            .use('babel-loader')
-            .loader('babel-loader')
+            .use("babel-loader")
+            .loader("babel-loader")
             .end()
-            .use('vue-svg-loader')
-            .loader('vue-svg-loader');
+            .use("vue-svg-loader")
+            .loader("vue-svg-loader")
     },
-}
+}