Browse Source

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

haojianlong 4 years ago
parent
commit
334d1d3d57

+ 2 - 2
public/systemConf.js

@@ -26,7 +26,7 @@ var __systemConf = {
         // 阿里云
         editerUrl: 'http://60.205.177.43:80/wandaEditer/', // 编辑器地址
         wandaBmGuideUrl: 'http://60.205.177.43:80/wandaBmGuide/', //管理书地址
-        // wandaBmGuideUrl: 'http://192.168.200.13:8090/wandaBmGuide/', //管理书地址
+        // wandaBmGuideUrl: 'http://192.168.200.26:8090/wandaBmGuide/', //管理书地址
     },
 }
-window.__systemConf = __systemConf
+window.__systemConf = __systemConf

+ 5 - 5
src/api/legendLibrary.js

@@ -93,12 +93,12 @@ export function graphElementSearch({
     return httputils.postJson(`/serve/topology-wanda/graphElement/search`, postParams)
 }
 // 更新图例关系信息
-export function graphElementUpdate({
-    postParams
-}) {
-    return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
+// export function graphElementUpdate({
+//     postParams
+// }) {
+//     return httputils.postJson(`/serve/topology-wanda/graphRelation/update`, postParams)
 
-}
+// }
 
 // 业下设备分类和位置分类树形结构
 export function queryDeviceAndPOsition({

+ 31 - 8
src/components/Legend/src/legend.vue

@@ -67,7 +67,8 @@
                 <span class='edit-icon corner-con' @click='goToEditer'>
                     <img src='@/assets/imgs/bjs.png' alt />
                     <!-- 角标 -->
-                    <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span>
+                    <!-- <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span> -->
+                    <span v-if='draftNum' class='corner'></span>
                 </span>
             </el-tooltip>
 
@@ -75,7 +76,8 @@
             <span v-else class='edit-icon2 corner-con'>
                 <img src='@/assets/imgs/bjs.png' alt />
                 <!-- 角标 -->
-                <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span>
+                <!-- <span v-if='draftNum' class='corner' :style='{lineHeight : draftNum > 99 ?"10px":"18px"}'>{{draftNum > 99 ? '...' : draftNum}}</span> -->
+                <span v-if='draftNum' class='corner'></span>
             </span>
         </div>
         <div class='select-floor' v-if='isFloor'>
@@ -161,6 +163,21 @@ export default {
         }
     },
     components: { lengendView, legendRemarks, lengendEdit },
+    watch: {
+        // 监听 vuex 中currentFloor的变化,切换楼层后,调用接口查询,显示右下角小红点
+        '$store.state.currentFloor': {
+            handler(newV, oldV) {
+                if (newV.gname !== oldV.gname) {
+                    clearInterval(this.timer)
+                    this.getDraftNum()
+                    this.timer = setInterval(() => {
+                        this.getDraftNum()
+                    }, this.interval)
+                }
+            },
+            deep: true
+        }
+    },
     methods: {
         /**
          * @name getDraftNum
@@ -168,10 +185,11 @@ export default {
          */
         async getDraftNum() {
             let res = null,
-                floorId = this.$cookie.get('floorMapId'),
+                // floorId = this.$cookie.get('floorMapId'),
+                floorId = this.$store.state.currentFloor.gname,
                 data = {
                     Distinct: true,
-                    Filters: `projectId=${this.plazaId};isPub=false;floorId='${floorId}'`,
+                    Filters: `projectId='${this.plazaId}';isPub=false;floorId='${floorId}'`,
                     PageNumber: 1,
                     PageSize: 500,
                     Projection: ['floorId']
@@ -519,11 +537,16 @@ export default {
         position: relative;
         .corner {
             position: absolute;
-            right: -8px;
-            top: 0;
+            // right: -8px;
+            // top: 0;
+            // display: inline-block;
+            // width: 18px;
+            // height: 18px;
+            right: 3px;
+            top: 3px;
             display: inline-block;
-            width: 18px;
-            height: 18px;
+            width: 8px;
+            height: 8px;
             background: @red;
             border-radius: 90px;
             font-size: 12px;

+ 2 - 0
src/components/floorList.vue

@@ -44,6 +44,7 @@
     </div>
 </template>
 <script>
+import store from '../store'
 export default {
     data() {
         return {
@@ -162,6 +163,7 @@ export default {
                 this.$cookie.set('currentFloorId', currentFloor.seq, 3)
                 this.floorId = this.$cookie.get('floorNow') || currentFloor.code
                 this.floorMapIdName = this.$cookie.get('floorMapId') || currentFloor.gname
+                store.commit('SETCURRENTFLOOR', currentFloor)
                 this.$emit('emitFloor', currentFloor)
             }
         },

+ 4 - 3
src/components/floorMap/canvasFun.vue

@@ -15,10 +15,10 @@
             <div class='small-block' @click='showText'>
                 <i>
                     <el-tooltip v-if='isShow' effect='dark' content='隐藏店铺名称' placement='top'>
-                        <img src='../../assets/imgs/er.png' alt />
+                        <img src='../../assets/imgs/yl.png' alt />
                     </el-tooltip>
                     <el-tooltip v-else effect='dark' content='显示店铺名称' placement='top'>
-                        <img src='../../assets/imgs/yl.png' alt />
+                        <img src='../../assets/imgs/er.png' alt />
                     </el-tooltip>
                 </i>
             </div>
@@ -102,7 +102,8 @@ export default {
             this.isShow = !this.isShow
             this.$emit('showText', this.isShow)
         }
-    }
+    },
+    mounted() {}
 }
 </script>
 <style lang="less" scoped>

+ 21 - 3
src/components/floorMap/index.vue

@@ -17,7 +17,7 @@ import { FloorView } from '@/lib/FloorView'
 import { FloorScene } from '@/lib/FloorScene'
 import RoomBox from '@/views/room/index'
 import canvasFun from '@/components/floorMap/canvasFun'
-import { readGroup, queryStatis } from '@/api/public'
+import { readGroup, queryStatis, queryBrand } from '@/api/public'
 import { STopologyParser } from '@/lib/parsers/STopologyParser'
 import { mapGetters, mapActions } from 'vuex'
 import { SImageItem } from '@saga-web/graph/lib'
@@ -61,14 +61,15 @@ export default {
     },
     components: { RoomBox, canvasFun },
     computed: {
-        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap'])
+        ...mapGetters(['plazaId', 'fmapID', 'haveFengMap', 'bunkObj'])
     },
     methods: {
         ...mapActions(['getfmapID']),
         init(floorid) {
-            this.loading = true
+            // this.loading = true
             this.floorid = floorid
             this.mapSize()
+            this.$refs.canvasFun.isShow = false
             setTimeout(() => {
                 if (this.haveFengMap) {
                     this.clearGraphy()
@@ -81,6 +82,16 @@ export default {
                 }
             }, 100)
         },
+        // 铺位
+        query(arr) {
+            let data = {
+                plazaId: '1001145'
+            }
+            // let postParams = arr
+            queryBrand({ data }).then(res => {
+                console.log(res)
+            })
+        },
         parserData(floor) {
             if (floor == 'g80') {
                 // 屋顶
@@ -106,6 +117,11 @@ export default {
                         this.fParser.spaceList.forEach(t => {
                             //   t.selectable = true;
                             this.scene.addItem(t)
+                            if (t.data.Name && this.bunkObj[t.data.Name]) {
+                                t.name = this.bunkObj[t.data.Name].detailtype
+                            } else {
+                                t.name = ''
+                            }
                         })
                         this.fParser.wallList.forEach(t => this.scene.addItem(t))
                         this.fParser.virtualWallList.forEach(t => this.scene.addItem(t))
@@ -223,6 +239,7 @@ export default {
             let scale = this.view.scale
             this.view.scaleByPoint(val / scale, this.canvasWidth / 2, this.canvasHeight / 2)
         },
+        // 小眼睛控制显示铺位名称
         showText(val) {
             // this.topologyParser.zoneLegendList.forEach(t => {
             //     t.showText = val
@@ -302,6 +319,7 @@ export default {
     mounted() {
         this.mapSize()
         this.getEvent()
+        console.log('bunkObjbunkObjbunkObj', this.bunkObj)
     },
     created() {
         this.urlMsg = {

+ 4 - 0
src/components/legendremarks.vue

@@ -121,4 +121,8 @@ export default {
 .quill-editor {
     height: 130px;
 }
+// 修改保存按钮背景色
+/deep/ .ant-btn-primary {
+    background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
+}
 </style>

+ 1 - 1
src/components/menuList.vue

@@ -101,7 +101,7 @@ export default {
             let res = null,
                 data = {
                     Distinct: true,
-                    Filters: `projectId=${this.plazaId};isPub=false`,
+                    Filters: `projectId='${this.plazaId}';isPub=false`,
                     PageNumber: 1,
                     PageSize: 500,
                     Projection: ['floorId']

+ 1 - 0
src/main.js

@@ -44,6 +44,7 @@ router.beforeEach((to, from, next) => __awaiter(void 0, void 0, void 0, function
     if (!store.state.isrequestAuth) {
         yield store.dispatch('getUserInfo', username);
         yield store.dispatch('getFloors');
+        yield store.dispatch('getBrand');
     }
     next();
 }));

+ 1 - 0
src/main.ts

@@ -37,6 +37,7 @@ router.beforeEach(async (to, from, next) => {
     if (!store.state.isrequestAuth) {
         await store.dispatch('getUserInfo', username)
         await store.dispatch('getFloors')
+        await store.dispatch('getBrand')
     }
     next()
 })

+ 26 - 0
src/store/index.js

@@ -1,6 +1,8 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
 import { login, queryFloor, queryfmapID } from '@/api/login.js'
+import { queryBrand } from '@/api/public.js'
+
 Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
@@ -22,6 +24,8 @@ export default new Vuex.Store({
         scpzTable: [], //土建系统图例展示
         legendTable: [], //除土建系统图例展示
         remarksText: '', //备注
+        bunkObj: {}, // 铺位名称
+        currentFloor: {}, //当前选中的楼层信息
     },
     getters: {
         floorsArr: (state) => state.floorsArr,
@@ -34,6 +38,7 @@ export default new Vuex.Store({
         scpzTable: (state) => state.scpzTable,
         legendTable: (state) => state.legendTable,
         remarksText: (state) => state.remarksText,
+        bunkObj: (state) => state.bunkObj,
     },
     mutations: {
         // 设置是否登陆校验
@@ -79,6 +84,12 @@ export default new Vuex.Store({
         SETREMARKSTEXT(state, data) {
             state.remarksText = data
         },
+        SETBUNKOBJ(state, data) {
+            state.bunkObj = data
+        },
+        SETCURRENTFLOOR(state, data) {
+            state.currentFloor = data
+        },
     },
     actions: {
         // 获取项目列表、userId
@@ -109,6 +120,21 @@ export default new Vuex.Store({
                 context.commit('SETMAPID', `${context.state.plazaId}_${res.mapVersion}`)
             })
         },
+        async getBrand(context) {
+            let data = {
+                plazaId: context.state.plazaId,
+            }
+            await queryBrand({ data }).then((res) => {
+                let obj = {}
+                if (res.data.data) {
+                    let Data = res.data.data
+                    Data.forEach((i) => {
+                        obj[i.bunkdesc] = i
+                    })
+                }
+                context.commit('SETBUNKOBJ', obj)
+            })
+        },
     },
     modules: {},
 })

+ 1 - 11
src/views/equipment/index.vue

@@ -54,7 +54,7 @@ import floorMap from '@/components/floorMap/index.vue'
 import eqDialog from './eqDialog'
 import editList from '@/components/edit.vue'
 import { system } from '@/utils/plugins/components.js'
-import { queryPic, queryBrand } from '@/api/public.js'
+import { queryPic } from '@/api/public.js'
 import { mapGetters } from 'vuex'
 
 export default {
@@ -82,15 +82,6 @@ export default {
     },
     components: { floorList, eqDialog, floorMap, editList },
     methods: {
-        query() {
-            let data = {
-                plazaId: '1000423'
-            }
-            // let postParams = []
-            queryBrand({ data }).then(res => {
-                console.log(res)
-            })
-        },
         // 查询tab页
         tabSyatem(item) {
             this.systemId = item.id
@@ -160,7 +151,6 @@ export default {
         this.everySystem = this.system[0].children
         this.init()
         this.$refs.floorMap.init(this.floorInfo.gname)
-        this.query()
     },
     computed: {
         ...mapGetters(['floorsArr', 'plazaId'])

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

@@ -303,6 +303,7 @@ export default {
             this.view.strokecolor = this.ruleForm.Color
             this.view.lineType = this.ruleForm.LineDash
             this.view.lineWidth = this.ruleForm.LineWidth
+            //修改的时候canvas的image可以预览
             if (this.ruleForm.Url && type == 2) {
                 let url = `/serve/topology-wanda/Picture/query/${this.ruleForm.Url}`
                 this.view.url = url
@@ -467,7 +468,7 @@ export default {
                             this.update()
                             this.$emit('updateSuccess')
                             this.view.canvas.clearRect(0, 0, this.width, this.height)
-                        } 
+                        }
                     }
                 })
             }
@@ -545,9 +546,9 @@ export default {
             this.initGraph()
         }
     },
-    watch:{
-        'ruleForm.Id':{
-            handler(){
+    watch: {
+        'ruleForm.Id': {
+            handler() {
                 this.initQueryDeviceAndPOsition()
                 this.visualization()
                 if (this.title == '修改图例库') {

+ 32 - 23
src/views/legendLibrary/addLegend.vue

@@ -15,23 +15,7 @@
                 <el-button type='primary' @click='save' size='small'>确 定</el-button>
             </span>
         </el-dialog>
-        <!-- <Modal :show='dialogVisible' :title='title' mode='middle' @close='dialogVisible=false'>
-            <template #content>
-                <add-form
-                    ref='add'
-                    :InfosList='InfosList'
-                    :InfoTypeIdList='InfoTypeIdList'
-                    :ruleForm='info'
-                    @addSuccess='addSuccess'
-                    @updateSuccess='updateSuccess'
-                    :title='title'
-                />
-            </template>
-            <template #handle>
-                <Button @click='dialogVisible = false,cancal()' type='default'>取 消</Button>
-                <Button @click='save' type='primary'>确 定</Button>
-            </template>
-        </Modal>-->
+
         <TransferSelectModal
             defaultExpandAll
             default-expand-all
@@ -51,7 +35,7 @@
 <script>
 import addForm from './addForm'
 import addList from '../legendRules/addList'
-import { groupByCategory, updateRelation } from '@/api/legendLibrary.js'
+import { groupByCategory, updateRelation, queryRelation } from '@/api/legendLibrary.js'
 
 export default {
     data() {
@@ -75,7 +59,8 @@ export default {
             title: '',
             GraphCategoryId: 'DTXT',
             modalShow4: false,
-            treeData: []
+            treeData: [],
+            tableData: []
         }
     },
     components: { addForm, addList },
@@ -89,6 +74,12 @@ export default {
                     this.treeData = []
                     this.treeData = res.Data.map(i => this.getTree(i))
                 })
+                //获取图例列表
+                let postParams = this.GraphCategoryId
+                let data = {}
+                queryRelation({ data, postParams }).then(res => {
+                    this.tableData = res.data.Content
+                })
                 //treeSelect
                 this.modalShow4 = true
                 this.info = {
@@ -125,8 +116,7 @@ export default {
                 // this.InfosList = [...row.InfoLocal.map(({ id }) => id), ...row.InfoSystem]
                 this.InfosList = row.InfoLocal ? [...row.InfoLocal.map(({ id }) => id)] : []
                 this.InfoTypeIdList = row.InfoTypeId
-                console.log(this.InfosList, this.InfoTypeIdList)
-                console.log(this.info)
+
                 // 图例库规则中的transform
             } else if (title == '' && this.$refs.searchList) {
                 this.$refs.searchList.queryAll()
@@ -189,11 +179,30 @@ export default {
                 this.dialogVisible = false
             }
         },
+
         treeConfirm(ids, dataObj) {
+            let tableList = [],
+                list = [],
+                totalLst = []
+            dataObj.forEach(i => {
+                list.push({
+                    Id: i.id,
+                    name: i.name
+                })
+            })
+            tableList = [...list, ...this.tableData]
+            tableList.forEach((i, index) => {
+                totalLst.push({
+                    GraphElementId: i.Id,
+                    OrderId: index
+                })
+            })
+
             let postParams = {
-                GraphCategoryId: this.GraphCategoryId.join(' '),
-                GraphElementIds: ids
+                GraphCategoryId: this.GraphCategoryId[0],
+                GraphRelations: totalLst
             }
+            console.log(totalLst, 'list')
             updateRelation({ postParams }).then(res => {
                 if (res.Result == 'success') {
                     this.$message.success('添加成功!')

+ 7 - 2
src/views/legendLibrary/index.vue

@@ -110,7 +110,7 @@
                 </el-table-column>
                 <el-table-column prop='style' label='图例样式' width='150'>
                     <template slot-scope='{row}'>
-                        <img class='img' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
+                        <img :class='`${row.Type!="Image"?"img1":"img"}`' :src='`/serve/topology-wanda/Picture/query/${row.Url}`' alt />
                     </template>
                 </el-table-column>
                 <el-table-column prop='Unit' label='单位' width='120'>
@@ -477,6 +477,9 @@ export default {
             })
         },
         getTableList() {
+            if (this.GraphCategoryIds || this.InfoLocals || this.InfoSystems || this.keyword) {
+                this.currentPage = 1
+            }
             let postParams = {
                 Deleted: this.state == 1 ? false : true,
                 GraphCategoryIds: this.GraphCategoryIds.length ? this.GraphCategoryIds : undefined, //说明书位置
@@ -624,11 +627,13 @@ export default {
             display: flex;
             align-items: center;
         }
-
         .img {
             width: 28px;
             height: 28px;
         }
+        .img1 {
+            width: 44px;
+        }
     }
     .foot {
         height: 32px;

+ 22 - 10
src/views/legendRules/index.vue

@@ -77,7 +77,7 @@
 </template>
 <script>
 import addLegend from '../legendLibrary/addLegend'
-import { getLegendTree, queryRelation, deleteRelation, graphElementUpdate } from '@/api/legendLibrary.js'
+import { updateRelation, getLegendTree, queryRelation, deleteRelation } from '@/api/legendLibrary.js'
 export default {
     components: { addLegend },
     data() {
@@ -163,38 +163,50 @@ export default {
                     break
             }
             function up() {
+                let list = []
                 if (index == 0) {
                     _this.$message.error('处于顶端,不可再上移')
                 } else {
                     let upDate = _this.tableData[index - 1]
                     _this.tableData.splice(index - 1, 1)
                     _this.tableData.splice(index, 0, upDate)
-                    let ids = _this.tableData.map(({ Id }) => Id)
-                    _this.upDateGraphy(ids)
+
+                    _this.tableData.forEach((i, index) => {
+                        list.push({
+                            GraphElementId: i.Id,
+                            OrderId: index
+                        })
+                    })
+                    _this.upDateGraphy(list)
                 }
             }
 
             function down() {
+                let list = []
                 if (index == _this.tableData.length - 1) {
                     _this.$message.error('处于底端,不可再下移')
                 } else {
                     let downDate = _this.tableData[index + 1]
                     _this.tableData.splice(index + 1, 1)
                     _this.tableData.splice(index, 0, downDate)
-                    let ids = _this.tableData.map(({ Id }) => Id)
-                    _this.upDateGraphy(ids)
+                    _this.tableData.forEach((i, index) => {
+                        list.push({
+                            GraphElementId: i.Id,
+                            OrderId: index
+                        })
+                    })
+                    _this.upDateGraphy(list)
                 }
             }
         },
         // 更新图例关系信息
-        upDateGraphy(ids) {
-            let posParams = {
+        upDateGraphy(list) {
+            let postParams = {
                 GraphCategoryId: this.GraphCategoryId[0],
-                GraphElementIds: ids,
-                Move: true
+                GraphRelations: list
             }
 
-            graphElementUpdate({ posParams }).then(res => {
+            updateRelation({ postParams }).then(res => {
                 this.getData()
             })
         },