@ -113,86 +113,48 @@
< / div >
< / div >
<!-- < div class = "mapDom" :style ="{opacity:isMapViewer}" style = "position: absolute;left: 105px;top: 250px;width: 250px;height: 180px;" > < / div > -- >
<!-- < div v-if ="active == 25" style="position:absolute;left:367px; top:40px;display: flex; flex-direction: column;" >
< el -button style = "
background - color : rgb ( 1 , 238 , 255 ) ;
color : rgb ( 23 , 72 , 167 ) ;
border : 0 ;
width : 100 px ;
" size=" small " @click=" openPreview ( 'peidian' ) " > 配电系统图 < / e l - b u t t o n >
< el -button style = "
background - color : white ;
color : rgb ( 23 , 72 , 167 ) ;
border : 0 ;
width : 100 px ; margin : 10 px 0 0 0 ;
" size=" small " @click=" openPreview ( 'peidianxiang' ) " > 配电箱系统图 < / e l - b u t t o n >
< el -button style = "
background - color : rgb ( 1 , 238 , 255 ) ;
color : rgb ( 23 , 72 , 167 ) ;
border : 0 ;
width : 100 px ; margin : 10 px 0 0 0 ;
" size=" small " @click=" openPreview ( 'wuding' ) " > 屋顶平面图 < / e l - b u t t o n >
< el -button style = "
background - color : white ;
color : rgb ( 23 , 72 , 167 ) ;
border : 0 ;
width : 100 px ; margin : 10 px 0 0 0 ;
" size=" small " @click=" openPreview ( 'qita' ) " > 其他图纸 < / e l - b u t t o n >
< / div >
< div v -else style = "position:absolute;left:367px; top:40px;display: flex; flex-direction: column;" >
< el -button style = "
background - color : rgb ( 1 , 238 , 255 ) ;
color : rgb ( 23 , 72 , 167 ) ;
border : 0 ;
width : 100 px ;
" size=" small " @click=" openPreview ( active ) " > 平面图纸 < / e l - b u t t o n >
< / div > -- >
< div v -if = " typeList.length ! = 0 & & sbType ! = ' 水 ' & & sbType ! = ' 电子围界 ' " style = " position : absolute ; top : 40px ; display : flex ;
< div v -if = " typeList.length ! = 0 " style = " position : absolute ; top : 40px ; display : flex ;
flex - direction : column ;
flex - wrap : wrap ; "
: style = "{'left': bimModel == 1 ? '367px' : bimModel == 2 ? '217px' : ''}" >
< el -button style = "
< el -button @click ="previewImg" style = "
background - color : # 00 BFB7 ;
color : # fff ;
border : 0 ;
width : 80 px ;
margin : 5 px ; "
width : 136 px ;
height : 30 px ;
border - radius : 0 ;
text - align : left ;
font - size : 14 px ; "
size = "small"
@ click = "previewImg" > 图纸预览 < / e l - b u t t o n >
> 图纸预览 < span style = "margin-left:20px;" > { { isShowType ? '收起' : '展开' } } < / span > < / e l - b u t t o n >
< / div >
< div v -show = " isShowType " style = " position : absolute ; top : 82px ; display : flex ;
flex - direction : column ; "
< div v -show = " isShowType " class = "cadimg-box"
: style = "{'left': bimModel == 1 ? '367px' : bimModel == 2 ? '217px' : ''}" >
< el -button style = "
background - color : rgba ( 255 , 255 , 255 , 0.3 ) ;
color : # 142644 ;
border : 0 ;
width : 80 px ;
margin : 5 px ; "
size = "small"
v - for = "item in typeList"
: key = "item.draweClassId"
@ click = "clickPreview(item)" > { { item . draweClassName } } < / e l - b u t t o n >
< div @click ="clickPreview(index)" v-for ="(item,index) in typeList" :key="item.id" class="cadimg-item" v-if="((page.current-1)*10) <= index && index < ((page.current-1)*10 + 10)" >
< div class = "cadimg-name" > { { item . originalName } } < / div >
< i class = "el-icon-zoom-in" / >
< / div >
<!-- 分页 -- >
< div class = "cadimg-pagination" >
< span @ click = "page.current = index + 1" class = "pagination-dot" v-for ="(item,index) in page.pageCount" :class="(index+1) == page.current ? 'active':''" :key="'pageNo_'+index" > < / span >
< / div >
< / div >
<!-- < el -select v-model ="imgType" @change="clickPreview" v-show="isShowType" style="position:absolute;left:372px;top:82px;" >
< el -option v-for ="item in typeList" :key="item.draweClassId" :value="item.draweClassId" :label="item.draweClassName" > < / el -option >
< / e l - s e l e c t > - - >
<!-- 图片预览 -- >
< el -image style = "width: 0; height: 0;opacity: 0;" ref = "preview" :src ="url" :preview-src-list ="srcList" > < / e l - i m a g e >
< el -image -viewer
< el -image style = "width: 0; height: 0;opacity: 0;" ref = "preview" :initial-index ="initialIndex" :src ="url" :preview-src-list ="srcList" > < / e l - i m a g e >
<!-- < el -image -viewer
v - if = "showViewer"
: on - close = "closeViewer"
: url - list = "srcList" style = "width: 1000px;height:800px;left:50%;top:50%;margin-left:-500px;margin-top:-400px;overflow: hidden;" / >
: url - list = "srcList" style = "width: 1000px;height:800px;left:50%;top:50%;margin-left:-500px;margin-top:-400px;overflow: hidden;" / > -- >
< / div >
< / template >
< script >
import * as bfHelper from '../../util/bfHelper' ;
import ElImageViewer from 'element-ui/packages/image/src/image-viewer '
/ / i m p o r t E l I m a g e V i e w e r f r o m ' e l e m e n t - u i / p a c k a g e s / i m a g e / s r c / i m a g e - v i e w e r '
import { getDrawList } from '@/api/equipment/drawManage'
export default {
components : { ElImageViewer } ,
/ / c o m p o n e n t s : { E l I m a g e V i e w e r } ,
props : {
sbType : {
type : String
@ -245,8 +207,8 @@ export default {
url : '' ,
srcList : [ ] ,
active : '' ,
tower : null ,
layer : null ,
tower : null , / / 楼 号
layer : null , / / 楼 层
ttActive : '' ,
num : 0 ,
cameraPosition : bfHelper . cameraPosition ,
@ -307,7 +269,25 @@ export default {
type : '' ,
/ / i s M a p V i e w e r : 0
typeList : [ ] ,
area : ''
area : '' ,
sbTypeKeys : {
"电" : 1 ,
"水" : 2 ,
"热" : 3 ,
"监控" : 4 ,
"照明" : 5 ,
"消防" : 6 ,
"电梯" : 7 ,
"空调" : 8 ,
"电子门禁" : 9 ,
"电子围界" : 10
} , / / 专 业 字 典
page : {
current : 1 ,
pageCount : [ ]
} , / / 分 页
cadingName : "" , / / 预 览 图 纸 名 称
initialIndex : 0 , / / 初 始 预 览 图 片 索 引
}
} ,
/ / w a t c h : {
@ -322,30 +302,21 @@ export default {
setTimeout ( ( ) => {
this . active = this . active == '' ? 25 : this . active
this . ttActive = this . ttActive == '' ? 20 : this . ttActive
this . type = this . type == '' ? 'build' : this . type
this . area = this . area == '' ? 1 : this . area
console . log ( '进入此方法111111111111111' , this . active )
if ( this . area == 1 ) {
this . getTypeList ( this . active , this . type , this . area )
} else {
this . getTypeList ( this . ttActive , this . type , this . area )
}
this . getTypeList ( this . type )
} , 500 )
} ,
methods : {
/ / 根 据 楼 号 获 取 分 类 列 表
getTypeList ( activeNum , type , area ) {
console . log ( 'activeNum ====>' , activeNum , 'type =====>' , type , 'area ====>' , area , 'active ====>' , this . active , 'ttActive ===>' , this . ttActive , 'build ======>' , this . build )
this . area = area
/ / t h i s . a c t i v e = a c t i v e
getTypeList ( type ) {
console . log ( '专业-区域-楼号-楼层 ====>' , this . sbTypeKeys [ this . sbType ] , this . bimModel , type , 'active ====>' , this . active , 'ttActive ===>' , this . ttActive , this . tower )
let _draweClass = this . sbTypeKeys [ this . sbType ] ;
if ( type == 'build' ) {
this . typeList = [ ] ;
let val = ( activeNum == '' && area == 1 ) ? this . active : ( activeNum == '' && area == 2 ) ? this . ttActive : activeNum
getDrawList ( { current : 1 , size : 200 , type : area , build : val } ) . then ( res => {
console . log ( 'res ======>' , res )
let arr = this . removeDup ( res . data . data . records )
console . log ( 'arr ============>' , arr )
let build = this . bimModel == 1 ? this . active : this . ttActive ;
getDrawList ( { current : 1 , size : 200 , draweClass : _draweClass , region : _draweClass + '-' + this . bimModel , build : _draweClass + '-' + this . bimModel + '-' + build } ) . then ( res => {
let arr = res . data . data . records
if ( arr . length == 0 ) {
this . typeList = [ ]
} else {
@ -353,21 +324,40 @@ export default {
this . typeList . push ( item )
} )
}
console . log ( 'typeList ====>' , this . typeList )
/ / 计 算 页 码
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 if ( type == 'floor' ) {
this . typeList = [ ] ;
let val = ( activeNum == '' && area == 1 ) ? this . active : ( activeNum == '' && area == 2 ) ? this . ttActive : activeNum
getDrawList ( { current : 1 , size : 200 , type : area , floor : val } ) . then ( res => {
console . log ( 'res ======>' , res )
let arr = this . removeDup ( res . data . data . records )
let build = this . bimModel == 1 ? ( this . tower + 1 ) : 3 ;
let layer = this . bimModel == 1 ? this . active : this . ttActive
getDrawList ( { current : 1 , size : 200 , draweClass : _draweClass , region : _draweClass + '-' + this . bimModel , build : _draweClass + '-' + this . bimModel + '-' + build , floor : _draweClass + '-' + this . bimModel + '-' + build + '-' + layer } ) . then ( res => {
let arr = res . data . data . records
arr . map ( item => {
this . typeList . push ( item )
} )
console . log ( 'typeList ====>' , this . typeList )
/ / 计 算 页 码
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 )
} )
}
console . log ( 'active ====>' , this . active )
} ,
/ / 数 组 去 重
@ -384,7 +374,12 @@ export default {
return tempArr
} ,
previewImg ( ) {
this . isShowType = ! this . isShowType
this . isShowType = ! this . isShowType ;
if ( this . isShowType ) {
this . page . current = 1 ;
/ / 展 开 重 新 拉 取 最 新 图 纸 列 表
this . getTypeList ( this . type ) ;
}
} ,
/ / 图 纸
openPreview ( key ) {
@ -418,37 +413,46 @@ export default {
} , 500 )
} ,
/ / 点 击 分 类 按 钮 获 取 图 纸
clickPreview ( item ) {
console . log ( 'item ====>' , item )
if ( this . type == 'build' ) {
getDrawList ( { current : 1 , size : 200 , type : this . area , build : item . build , draweClassId : item . draweClassId } ) . then ( res => {
console . log ( '图纸res ======>' , res )
let str = res . data . data . records . map ( ( item ) => {
return item . url
} ) . join ( ',' )
let arr = str . split ( ',' )
this . srcList = arr ;
this . url = this . srcList [ 0 ]
setTimeout ( ( ) => {
this . $refs . preview . clickHandler ( ) ;
this . isShowType = false
} , 500 )
} )
} else if ( this . type == 'floor' ) {
getDrawList ( { current : 1 , size : 200 , type : this . area , build : item . build , floor : item . floor , draweClassId : item . draweClassId } ) . then ( res => {
console . log ( '图纸res1 ======>' , res )
let str = res . data . data . records . map ( ( item ) => {
return item . url
} ) . join ( ',' )
let arr = str . split ( ',' )
this . srcList = arr ;
this . url = this . srcList [ 0 ]
setTimeout ( ( ) => {
this . $refs . preview . clickHandler ( ) ;
this . isShowType = false
} , 500 )
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' ) ;
/ / 自 定 义 图 纸 名 称 d o m 标 签
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 )
} ,
closeViewer ( ) {
this . showViewer = false ;
@ -456,7 +460,6 @@ export default {
clickBtn ( activeNum , tower , layer , type ) {
console . log ( '进入此方法' )
this . isShowType = false ;
this . getTypeList ( activeNum , type , 1 )
if ( this . sbType == '空调' && activeNum <= 6 ) {
return false ;
}
@ -491,6 +494,7 @@ export default {
this . active = activeNum ;
this . tower = tower ;
this . type = type
this . getTypeList ( type ) ;
if ( this . sbType == '空开' && activeNum != 25 ) {
bfHelper . lookPipeline2 ( null , null , tower ,
@ -968,4 +972,52 @@ export default {
height : 32 px ;
}
}
/ / 图 纸
. cadimg - box {
position : absolute ;
top : 70 px ;
width : 107 px ;
display : flex ;
flex - direction : column ;
background : rgba ( 3 , 22 , 57 , 0.3 ) ;
color : # fff ;
font - size : 14 px ;
padding : 0 15 px 0 14 px ;
line - height : 36 px ;
height : 400 px ;
. cadimg - item {
display : flex ;
align - items : center ;
cursor : pointer ;
& : hover , & . active {
color : # 07 a7ff ;
}
. cadimg - name {
width : 100 px ;
overflow : hidden ;
white - space : nowrap ;
text - overflow : ellipsis ;
}
}
. cadimg - pagination {
position : absolute ;
left : 0 ;
right : 0 ;
bottom : 15 px ;
display : flex ;
justify - content : center ;
. pagination - dot {
cursor : pointer ;
display : inline - block ;
width : 8 px ;
height : 8 px ;
background : rgba ( 255 , 255 , 255 , 0.2 ) ;
border - radius : 4 px ;
margin : 0 5 px ;
& . active {
background : # c3e1ea ;
}
}
}
}
< / style >