diff --git a/src/components/monitoring/clickCp.vue b/src/components/monitoring/clickCp.vue index d438d38..19651d7 100644 --- a/src/components/monitoring/clickCp.vue +++ b/src/components/monitoring/clickCp.vue @@ -310,7 +310,7 @@ export default { }, methods: { // 根据楼号获取分类列表 - getTypeList(active,type,area){ + getTypeList(type){ console.log('专业-区域-楼号-楼层 ====>',this.sbType,this.bimModel,'type ====>',type,'active ====>',this.active,'ttActive ===>',this.ttActive, this.tower) let _draweClass = this.sbTypeKeys[this.sbType]; if(type == 'build'){ @@ -358,6 +358,27 @@ export default { } console.log('typeList ====>',this.typeList, this.page) }) + }else if(type == ''){ + let build = this.bimModel == 1 ? this.active : this.ttActive; + console.log('bimModel ====>',this.bimModel,'draweClass ===>',_draweClass,'build ===>',build) + this.typeList = []; + getDrawList({current:1,size:200,draweClass:_draweClass,region:_draweClass+'-'+this.bimModel}).then(res =>{ + let arr = res.data.data.records + arr.map(item =>{ + this.typeList.push(item) + }) + //计算页码 + let pageCount = Math.ceil(this.typeList.length / 10); + let _pageArr = []; + for(let i = 1; i <= pageCount; i++){ + _pageArr.push(i); + } + this.page = { + current: 1, + pageCount: _pageArr + } + console.log('typeList ====>',this.typeList, this.page) + }) } }, diff --git a/src/components/monitoring/conditioner.vue b/src/components/monitoring/conditioner.vue index b01133a..7aef81c 100644 --- a/src/components/monitoring/conditioner.vue +++ b/src/components/monitoring/conditioner.vue @@ -532,10 +532,13 @@ export default { bfHelper.lookEquipmentCop("空调"); this.getNavigationMap(); bfHelper.setOpacityFun(); - this.$refs.clickcp.area = 1; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.active = 25; - this.$refs.clickcp.getTypeList(25,'build',1) + setTimeout(() =>{ + this.$refs.clickcp.area = 1; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.active = 25; + this.$refs.clickcp.getTypeList('build') + },300) + // setTimeout(() => { this.initial(); // },300) diff --git a/src/components/monitoring/door.vue b/src/components/monitoring/door.vue index 88ca5a3..72f7479 100644 --- a/src/components/monitoring/door.vue +++ b/src/components/monitoring/door.vue @@ -527,10 +527,13 @@ export default { // 查看管线 bfHelper.lookPipeline(null, null, this.condition, "电子门禁"); bfHelper.setOpacityFun(); - this.$refs.clickcp.area = 1; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.active = 25; - this.$refs.clickcp.getTypeList(25,'build',1) + setTimeout(() =>{ + this.$refs.clickcp.area = 1; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.active = 25; + this.$refs.clickcp.getTypeList('build') + },300) + this.getNavigationMap(); // this.initial() } @@ -614,9 +617,12 @@ export default { } else { // 查看管线 bfHelper.TtLookEquipmentCop("电子门禁"); - this.$refs.clickcp.area = 2; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.getTypeList(20,'build',2); + setTimeout(() =>{ + this.$refs.clickcp.area = 2; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.getTypeList('build'); + },300) + bfHelper.setOpacityFun1(); } } diff --git a/src/components/monitoring/electricity.vue b/src/components/monitoring/electricity.vue index 3df8cc6..a2be74b 100644 --- a/src/components/monitoring/electricity.vue +++ b/src/components/monitoring/electricity.vue @@ -621,7 +621,7 @@ export default { this.$refs.clickcp.area = 1; this.$refs.clickcp.type = 'build'; this.$refs.clickcp.active = 25; - this.$refs.clickcp.getTypeList(25,'build',1) + this.$refs.clickcp.getTypeList('build') }) setOpacityFun(false,0.3); this.getNavigationMap(); @@ -705,11 +705,14 @@ export default { ); } } else { + setTimeout(() =>{ + this.$refs.clickcp.active = 20 + this.$refs.clickcp.area = 2; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.getTypeList('build'); + },300) TtLookEquipmentCop("电"); - this.$refs.clickcp.active = 20 - this.$refs.clickcp.area = 2; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.getTypeList(20,'build',2); + setOpacityFun1(); } } diff --git a/src/components/monitoring/firefighting.vue b/src/components/monitoring/firefighting.vue index ddb02df..e9b85eb 100644 --- a/src/components/monitoring/firefighting.vue +++ b/src/components/monitoring/firefighting.vue @@ -341,6 +341,9 @@ export default { this.getFightWarnList(); //bim标注告警列表 this.getFiredWarnList(); //报警信息 this.addWaterLabel(); + // setTimeout(() =>{ + // this.$refs.clickcp.getTypeList('build') + // },300) }, }, //模型是否加载完成监听 @@ -438,10 +441,12 @@ export default { } else { bfHelper.lookEquipmentCop("消防", this.checkList); bfHelper.setOpacityFun(); - this.$refs.clickcp.area = 1; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.active = 25; - this.$refs.clickcp.getTypeList(25,'build',1) + setTimeout(() =>{ + this.$refs.clickcp.area = 1; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.active = 25; + this.$refs.clickcp.getTypeList('build') + },300) this.getNavigationMap(); } } else { @@ -529,10 +534,12 @@ export default { } else { // 查看管线 bfHelper.TtLookEquipmentCop("消防", this.checkList); - this.$refs.clickcp.active = 20 - this.$refs.clickcp.area = 2; - this.$refs.clickcp.type = 'build'; - this.$refs.clickcp.getTypeList(20,'build',2); + setTimeout(() =>{ + this.$refs.clickcp.active = 20 + this.$refs.clickcp.area = 2; + this.$refs.clickcp.type = 'build'; + this.$refs.clickcp.getTypeList('build'); + },300) bfHelper.setOpacityFun1(); } } diff --git a/src/components/monitoring/lift.vue b/src/components/monitoring/lift.vue index f42bfc1..2206767 100644 --- a/src/components/monitoring/lift.vue +++ b/src/components/monitoring/lift.vue @@ -145,7 +145,36 @@ - + +
+ 图纸预览{{isShowType?'收起':'展开'}} +
+
+
+
{{item.originalName}}
+ +
+ +
+ +
+
+ + @@ -162,6 +191,7 @@ import { } from '@/api/garden/monitoring'; import backHome from './backHome'; import { dateFormat } from "@/util/date"; +import {getDrawList} from '@/api/equipment/drawManage' export default { props: { dtState: { @@ -243,6 +273,11 @@ export default { tower: null, layer: null, liftArr: [], + typeList:[], + page:{}, + isShowType:false, + initialIndex: 0,//初始预览图片索引 + srcList: [], } }, watch: { @@ -267,6 +302,7 @@ export default { bfHelper.setOpacityFun(); setTimeout(() => { this.setTowerLift(); + this.getList() }, 300); bfHelper.setCameraStatus({ aspect: 1.889763779527559, @@ -302,6 +338,7 @@ export default { this.setTowerLift(); setTimeout(() => { this.liftCustom1() + this.getList() }, 500); } } @@ -346,6 +383,107 @@ export default { bfHelper.clearComponent(); }, methods: { + // 获取图纸列表 + getList(){ + this.typeList = [] + if(this.bimModel == 1){ + getDrawList({current:1,size:200,draweClass:'7',region:'7-1',build:'7-1-25'}).then(res =>{ + let arr = res.data.data.records + if(arr.length == 0){ + this.typeList = [] + }else{ + arr.map(item =>{ + this.typeList.push(item) + }) + } + //计算页码 + let pageCount = Math.ceil(this.typeList.length / 10); + let _pageArr = []; + for(let i = 1; i <= pageCount; i++){ + _pageArr.push(i); + } + this.page = { + current: 1, + pageCount: _pageArr + } + console.log('typeList ====>',this.typeList, this.page) + }) + }else{ + getDrawList({current:1,size:200,draweClass:'7',region:'7-2',}).then(res =>{ + let arr = res.data.data.records + if(arr.length == 0){ + this.typeList = [] + }else{ + arr.map(item =>{ + this.typeList.push(item) + }) + } + //计算页码 + let pageCount = Math.ceil(this.typeList.length / 10); + let _pageArr = []; + for(let i = 1; i <= pageCount; i++){ + _pageArr.push(i); + } + this.page = { + current: 1, + pageCount: _pageArr + } + console.log('typeList ====>',this.typeList, this.page) + }) + } + + }, + previewImg(){ + this.isShowType = !this.isShowType; + console.log('isShowType ====>',this.isShowType) + if(this.isShowType) { + this.page.current = 1; + //展开重新拉取最新图纸列表 + this.getList(); + } + }, + // 点击分类按钮获取图纸 + clickPreview(index){ + let arr =this.typeList.map((item) => { + return item.url + }) + this.srcList = arr; + this.initialIndex = index; + this.url = this.srcList[index]; + this.cadingName = this.typeList[index].originalName; + setTimeout(() =>{ + this.$refs.preview.clickHandler(); + this.$nextTick(() => { + let wrapEle = document.getElementsByClassName('el-image-viewer__wrapper'); + let prevEle = document.getElementsByClassName('el-image-viewer__prev'); + let nextEle = document.getElementsByClassName('el-image-viewer__next'); + let closeEle = document.getElementsByClassName('el-image-viewer__close'); + //自定义图纸名称dom标签 + let divEle = document.createElement('div'); + divEle.setAttribute('class','el-image-viewer-fixedname'); + divEle.setAttribute('style','position:fixed;left:50%;top:60px;width:220px;color:#fff;text-align:center;background:#606266;border-radius:50px;padding:10px;margin-left:-120px;z-index:2002'); + wrapEle[0].append(divEle); + let divEle2 = document.getElementsByClassName('el-image-viewer-fixedname'); + divEle2[0].innerText = this.cadingName; + if(prevEle != 'undefined'){ + prevEle[0].addEventListener('click',(e) => { + let src = document.getElementsByClassName('el-image-viewer__canvas')[0].children[0].getAttribute('src'); + let idx = this.typeList.findIndex(item => item.url == src); + this.cadingName = this.typeList[idx].originalName; + divEle2[0].innerText = this.cadingName; + }) + } + if(nextEle != 'undefined'){ + nextEle[0].addEventListener('click',(e) => { + let src = document.getElementsByClassName('el-image-viewer__canvas')[0].children[0].getAttribute('src'); + let idx = this.typeList.findIndex(item => item.url == src); + this.cadingName = this.typeList[idx].originalName; + divEle2[0].innerText = this.cadingName; + }) + } + }) + },500) + }, tableContext(row,column, event){ event.preventDefault(); // 阻止默认菜单 const routerUrl = this.$router.resolve({ path: '/equipment/index', query: {code: row.code } }); @@ -1348,6 +1486,54 @@ export default { } +} +// 图纸 +.cadimg-box{ + position:absolute; + top:70px; + width: 107px; + display: flex; + flex-direction: column; + background: rgba(3,22,57,0.3); + color: #fff; + font-size: 14px; + padding: 0 15px 0 14px; + line-height: 36px; + height: 400px; + .cadimg-item{ + display: flex; + align-items: center; + cursor: pointer; + &:hover,&.active{ + color:#07a7ff; + } + .cadimg-name{ + width: 100px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + } + } + .cadimg-pagination{ + position: absolute; + left: 0; + right:0; + bottom: 15px; + display: flex; + justify-content: center; + .pagination-dot{ + cursor: pointer; + display: inline-block; + width: 8px; + height:8px; + background: rgba(255,255,255,0.2); + border-radius:4px; + margin:0 5px; + &.active{ + background:#c3e1ea; + } + } + } }