buildingDetails.vue 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098
  1. <template>
  2. <div class="buildingDetails">
  3. <div class="buildingDetails-page">
  4. <div class="max-left-box">
  5. <div class="max-left-box-one" v-if="!mapSrc">
  6. <div class="max-button-big-position-box">
  7. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_syl.png">
  8. <el-upload
  9. class="up-img-button-box"
  10. style="height:40px;width:300px;"
  11. :action="uploadImgUrl"
  12. :show-file-list="false"
  13. accept="image/png"
  14. :on-success="(res, file)=>handleAvatarSuccess(res, file,1)"
  15. :headers="headers"
  16. :before-upload="beforeAvatarUpload">
  17. <p class="up-img-button">+ 上传图片</p>
  18. </el-upload>
  19. <p class="up-img-text">请点击上传图片按钮上传实验室楼层布局参考图</p>
  20. </div>
  21. </div>
  22. <div class="max-left-button-box" v-show="mapSrc">
  23. <p class="null-p"></p>
  24. <el-upload
  25. class="up-img-p"
  26. :action="uploadImgUrl"
  27. :show-file-list="false"
  28. accept="image/png"
  29. :on-success="(res, file)=>handleAvatarSuccess(res, file,2)"
  30. :headers="headers"
  31. :before-upload="beforeAvatarUpload">
  32. <p style="margin:0;">更换图纸</p>
  33. </el-upload>
  34. <div class="opacity-button-box">
  35. <p @click="opacityClick(1)">-</p>
  36. <p>透明度:{{mapOpacityText}}%</p>
  37. <p @click="opacityClick(2)">+</p>
  38. </div>
  39. </div>
  40. <div class="max-left-map-big-box scrollbar-box" ref="maxBigBox" v-show="mapSrc">
  41. <div class="left-map-box" ref="maxBox" :style="'width:'+layerWidth+'px;height:'+layerHeight+'px;'">
  42. <!--循环房间数据-->
  43. <div :class="item.type == 2?'for-map-box-one':(item.type == 1?'for-map-box':(item.type == 3?'for-map-box-two':''))" v-for="(item,index) in mapList" :key="index"
  44. ref="moveBox"
  45. :style="'top:'+item.y+'px;left:'+item.x+'px;width:'+item.w+'px;height:'+item.h+'px;'">
  46. <div class="top-big-box">
  47. <p class="top-left-p"
  48. @mousedown.stop="(MouseEvent)=>zoomDownXY(MouseEvent,index,4)"></p>
  49. <p class="top-center-p"
  50. @mousedown.stop="(MouseEvent)=>zoomDownY(MouseEvent,index,1)"></p>
  51. <p class="top-right-p"
  52. @mousedown.stop="(MouseEvent)=>zoomDownXY(MouseEvent,index,1)"></p>
  53. </div>
  54. <div class="center-big-box">
  55. <p class="center-left-p"
  56. @mousedown.stop="(MouseEvent)=>zoomDownX(MouseEvent,index,4)"></p>
  57. <div class="center-move-box"
  58. :style="'line-height:'+(item.w>item.h?item.h-4:item.w-4)+'px;'"
  59. @contextmenu="(contextmenu)=>boxRightClick(contextmenu,item,index)"
  60. @mousedown.stop="(MouseEvent)=>dragDown(MouseEvent,index)">
  61. {{item.roomNum&&item.type == 1?item.roomNum:(!item.roomNum&&item.type == 1?'配置房间':'')}}
  62. </div>
  63. <p class="center-right-p"
  64. @mousedown.stop="(MouseEvent)=>zoomDownX(MouseEvent,index,2)"></p>
  65. </div>
  66. <div class="bottom-big-box">
  67. <p class="bottom-left-p"
  68. @mousedown.stop="(MouseEvent)=>zoomDownXY(MouseEvent,index,3)"></p>
  69. <p class="bottom-center-p"
  70. @mousedown.stop="(MouseEvent)=>zoomDownY(MouseEvent,index,3)"></p>
  71. <p class="bottom-right-p"
  72. @mousedown.stop="(MouseEvent)=>zoomDownXY(MouseEvent,index,2)"></p>
  73. </div>
  74. <p class="center-move-door-p" v-if="item.type == 1"
  75. :class="minItem.toward=='top'?'center-move-door-p-t':(minItem.toward=='bottom'?'center-move-door-p-b':(minItem.toward=='left'?'center-move-door-p-l':(minItem.toward=='right'?'center-move-door-p-r':'')))"
  76. v-for="(minItem,minIndex) in item.doorList" :key="minIndex"
  77. @contextmenu.stop="(contextmenu)=>boxRightClick(contextmenu,minItem,index,minIndex)"
  78. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"
  79. @mousedown.stop="(MouseEvent)=>doorDragDown(MouseEvent,index,minIndex)"
  80. ></p>
  81. <p class="center-move-door-p" v-if="item.type == 3"
  82. :class="minItem.toward=='top'?'center-move-door-p-t-ss':(minItem.toward=='bottom'?'center-move-door-p-b-ss':(minItem.toward=='left'?'center-move-door-p-l-ss':(minItem.toward=='right'?'center-move-door-p-r-ss':'')))"
  83. v-for="(minItem,minIndex) in item.doorList" :key="minIndex"
  84. @contextmenu.stop="(contextmenu)=>boxRightClick(contextmenu,minItem,index,minIndex)"
  85. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"
  86. @mousedown.stop="(MouseEvent)=>doorDragDown(MouseEvent,index,minIndex)"
  87. ></p>
  88. <p class="center-move-light-p" v-if="minItem.type != 'light'&&!minItem.openType"
  89. v-for="(minItem,minIndex) in item.lightList" :key="minIndex"
  90. :class="minItem.type == 'lab'?'colorDoor':(minItem.type == 'traffic'?'colorTraffic':(minItem.type == 'connect'?'colorConnect':''))"
  91. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"
  92. ><span v-for="(optionsItem,optionsIndex) in dialogOptions" v-if="minItem.state == optionsItem.value">{{optionsItem.label}}</span>{{minItem.name}}</p>
  93. <p class="center-move-light-p" v-if="minItem.type == 'light'&&!minItem.openType"
  94. v-for="(minItem,minIndex) in item.lightList" :key="minIndex"
  95. @contextmenu.stop="(contextmenu)=>boxRightClick(contextmenu,minItem,index,minIndex)"
  96. :class="minItem.state=='1'?'lightTop':(minItem.state=='2'?'lightBottom':(minItem.state=='3'?'lightLeft':(minItem.state=='4'?'lightRight':'lightNone')))"
  97. :style="'top:'+minItem.y+'px;left:'+minItem.x+'px;width:'+minItem.w+'px;height:'+minItem.h+'px;'"
  98. @mousedown.stop="(MouseEvent)=>lightDragDown(MouseEvent,index,minIndex)"
  99. ></p>
  100. </div>
  101. </div>
  102. <img class="left-map-img" :src="mapSrc" :style="'opacity:'+mapOpacity+';width:'+layerWidth+'px;height:'+layerHeight+'px;'">
  103. </div>
  104. </div>
  105. <div class="max-right-box">
  106. <div class="right-title-box">
  107. <el-tooltip class="item" effect="dark" :content="buildName+'楼'+floorName+'层'" placement="top-start">
  108. <p class="right-title-p">{{buildName}}楼{{floorName}}层</p>
  109. </el-tooltip>
  110. <div @click="buttonShadeClick">
  111. <p class="el-icon-question"></p>
  112. <p>使用帮助</p>
  113. </div>
  114. </div>
  115. <div class="right-bottom-max-box scrollbar-box">
  116. <div class="right-for-max-box">
  117. <p class="right-for-title">结构</p>
  118. <div class="right-for-box" v-for="(item,index) in roomList" :key="index">
  119. <img
  120. draggable="true"
  121. @dragstart="(DragEvent)=>externalAddDragStart(DragEvent,item.type)"
  122. @dragend="(DragEvent)=>externalAddDragEnd(DragEvent,'2')"
  123. :src="item.url">
  124. <p>{{item.name}}</p>
  125. </div>
  126. </div>
  127. <div class="right-for-max-box">
  128. <p class="right-for-title">房间</p>
  129. <div class="right-for-box" v-for="(item,index) in accessoriesList" :key="index">
  130. <img
  131. draggable="true"
  132. @dragstart="(DragEvent)=>internalAddDragStart(DragEvent,item.type)"
  133. @dragend="(DragEvent)=>internalAddDragEnd(DragEvent,'2')"
  134. :src="item.url">
  135. <p>{{item.name}}</p>
  136. </div>
  137. </div>
  138. <div class="right-button-box">
  139. <p></p>
  140. <p @click="clickBack">返回</p>
  141. <p @click="setDataButton">保存</p>
  142. <p></p>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <!--右键-->
  148. <div class="map-shade-max-big-box" v-if="mouseType != 0" @click="offMapShade">
  149. <div class="map-shade-big-box" :style="'top:'+mouseY+'px;left:'+mouseX+'px;'">
  150. <p class="shade-button-p" v-if="dialogOpenType == 1 || dialogOpenType == 6" @click="clickShadeButton(1)">编辑</p>
  151. <p class="shade-border-p" v-if="dialogOpenType == 1 || dialogOpenType == 6"></p>
  152. <p class="shade-button-p" @click="clickShadeButton(2)">删除</p>
  153. </div>
  154. </div>
  155. <!--房间/灯设置-->
  156. <el-dialog :title="dialogOpenType==1?'编辑房间':(dialogOpenType==6?'编辑指示灯':'')" :visible.sync="dialogOpen" v-if="dialogOpen" width="600px" append-to-body>
  157. <el-form ref="dialogForm" :model="dialogForm" :rules="rules" label-width="120px">
  158. <div v-if="dialogOpenType == 1">
  159. <el-form-item label="房间类型:" prop="roomType">
  160. <el-select v-model="dialogForm.roomType" placeholder="请选择房间类型" style="width:300px;">
  161. <el-option
  162. v-for="item in roomOptions"
  163. :key="item.dictValue"
  164. :label="item.dictLabel"
  165. :value="item.dictValue">
  166. </el-option>
  167. </el-select>
  168. </el-form-item>
  169. <el-form-item label="房间编号:" prop="roomNum">
  170. <el-input v-model="dialogForm.roomNum" placeholder="请输入房间编号" maxlength="20" style="width:300px;"/>
  171. </el-form-item>
  172. <el-form-item label="房间名称:" prop="roomName" v-if="dialogForm.roomType == '-99'">
  173. <el-input v-model="dialogForm.roomName" placeholder="请输入房间名称" maxlength="20" style="width:300px;"/>
  174. </el-form-item>
  175. <el-form-item label="房间选择:" prop="subId" v-if="dialogForm.roomType != '-99'">
  176. <el-select
  177. style="width:300px;"
  178. v-model="dialogForm.subId"
  179. filterable
  180. remote
  181. reserve-keyword
  182. @focus="selectFocus"
  183. @change="selectClick"
  184. placeholder="请选择房间"
  185. :remote-method="userSelectList"
  186. :loading="loading">
  187. <el-option
  188. v-for="item in subjectOptions"
  189. :key="item.id"
  190. :label="item.name"
  191. :value="item.id">
  192. </el-option>
  193. </el-select>
  194. </el-form-item>
  195. </div>
  196. <div v-if="dialogOpenType == 6">
  197. <el-form-item label="继电器类型:" prop="relayType">
  198. <el-radio-group v-model="dialogForm.relayType" style="margin-top:4px;">
  199. <el-radio :label="2">新版继电器</el-radio>
  200. <el-radio :label="1">老版继电器</el-radio>
  201. </el-radio-group>
  202. </el-form-item>
  203. <el-form-item label="继电器参数:" prop="configName" v-if="dialogForm.relayType == 2">
  204. <el-input v-model="dialogForm.configName" placeholder="请输入继电器参数" maxlength="20" style="width:300px;"/>
  205. </el-form-item>
  206. <el-form-item label="状态参数:" prop="configStatus" style="width:398px;" v-if="dialogForm.relayType == 2">
  207. <el-input v-model="dialogForm.configStatus" placeholder="请输入状态参数" maxlength="20" style="width:300px;"/>
  208. </el-form-item>
  209. <el-form-item label="继电器编号:" prop="relayCode" v-if="dialogForm.relayType == 1">
  210. <el-input v-model="dialogForm.relayCode" placeholder="请输入继电器参数" maxlength="20" style="width:300px;"/>
  211. </el-form-item>
  212. <el-form-item label="继电器路数:" prop="relayBit" style="width:398px;" v-if="dialogForm.relayType == 1" class="dialog-relay-bit-form-item-box">
  213. <el-input-number v-model="dialogForm.relayBit" :min="1" :max="12" placeholder="请输入状态参数" :controls="false" style="width:300px;"></el-input-number>
  214. </el-form-item>
  215. <el-form-item label="指示灯类型:" prop="state">
  216. <el-radio-group v-model="dialogForm.state" style="margin-top:4px;">
  217. <el-radio :label="item.value" v-for="item in dialogOptions">{{item.label}}</el-radio>
  218. </el-radio-group>
  219. </el-form-item>
  220. </div>
  221. </el-form>
  222. <div slot="footer" class="dialog-footer">
  223. <div style="display: flex">
  224. <p style="flex:1;"></p>
  225. <p style="cursor:pointer;border-radius:6px;width:70px;line-height:30px;font-size:12px;text-align:center;margin-right:17px;color:#999999;background:#E0E0E0;" @click="buttonSetButton(1)">取消</p>
  226. <p style="cursor:pointer;border-radius:6px;width:70px;line-height:30px;font-size:12px;text-align:center;color:#fff;background:#0045AF;" @click="buttonSetButton(2)">确定</p>
  227. <p style="flex:1;"></p>
  228. </div>
  229. </div>
  230. </el-dialog>
  231. <!--引导遮罩层-->
  232. <div class="shade-max-big-box" v-if="shadeBoxType != 0">
  233. <div v-if="shadeBoxType == 1" class="shade-max-box-1">
  234. <img class="shade-big-img" src="@/assets/ZDimages/evacuation3_2/img_znwl_jt.png">
  235. <p class="shade-big-1-text-1">更换图纸</p>
  236. <div class="shade-big-1-text-2">
  237. <p>-</p>
  238. <p>透明度:{{mapOpacityText}}%</p>
  239. <p>+</p>
  240. </div>
  241. <p class="shade-big-1-text-3">请先行上传图纸,根据图纸进行楼层布局的临摹,能够让绘制的图形更加精准</p>
  242. <p class="shade-big-1-text-4">上传图纸的可以修改透明度,如图纸会对绘制产生干扰,则能够将透明度降低方便绘制和临摹。</p>
  243. <p class="shade-big-1-text-5" @click="shadeClick(2)">下一步</p>
  244. </div>
  245. <div v-if="shadeBoxType == 2" class="shade-max-box-2">
  246. <img class="shade-big-img" src="@/assets/ZDimages/evacuation3_2/img_znwl_jt.png">
  247. <div class="shade-big-1-text-1">
  248. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_gd.png">
  249. <p>楼道</p>
  250. </div>
  251. <div class="shade-big-1-text-2">
  252. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_yjck.png">
  253. <p>应急出口</p>
  254. </div>
  255. <div class="shade-big-1-text-3">
  256. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_fj.png">
  257. <p>房间</p>
  258. </div>
  259. <p class="shade-big-1-text-4">楼道绘制方法为点击拖拽至绘制区域,鼠标左键选中楼道可以调整楼道的位置和尺寸。楼道支持与其他楼道衔接,衔接办法为选择矩形楼道中线上的点位与另外一个矩形过的中线进行结合即可。</p>
  260. <p class="shade-big-1-text-5">应急出口为固定尺寸,点击拖拽至绘制区域即可。</p>
  261. <p class="shade-big-1-text-6">房间可直接拖拽至绘制区域,鼠标左键选中房间可以调整楼道的位置和尺寸。</p>
  262. <p class="shade-big-1-text-7" @click="shadeClick(3)">下一步</p>
  263. </div>
  264. <div v-if="shadeBoxType == 3" class="shade-max-box-3">
  265. <img class="shade-big-img" src="@/assets/ZDimages/evacuation3_2/img_znwl_jtt.png">
  266. <p class="shade-big-1-text-1">房门为固定尺寸,点击拖拽至绘制区域的房间内即可。</p>
  267. <p class="shade-big-1-text-2">疏散灯需要拖拽至绘制区域的走道中,请您确认疏散灯位置尽可能与实际安装位置一致。</p>
  268. <p class="shade-big-1-text-3" @click="shadeClick(4)">下一步</p>
  269. <div class="shade-big-1-text-4">
  270. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_fj.png">
  271. <p>房间</p>
  272. </div>
  273. <div class="shade-big-1-text-5">
  274. <img src="@/assets/ZDimages/evacuation3_2/img_xgbj_fj.png">
  275. <p>房间</p>
  276. </div>
  277. </div>
  278. <div v-if="shadeBoxType == 4 || shadeBoxType == 5" class="shade-max-box-4">
  279. <div>
  280. <p>{{shadeBoxType == 4?'最后提示:':''}}</p>
  281. <p>左键选中组件可以调整大小和位置,右键选中组件可以删除组件或编辑组件属性,马上开始绘制布局吧。</p>
  282. <p @click="shadeClick(0)">开始绘制</p>
  283. </div>
  284. </div>
  285. </div>
  286. </div>
  287. </template>
  288. <script>
  289. import { Loading } from 'element-ui'
  290. import { getToken } from "@/utils/auth";
  291. import { checkDoorTo,checkLightDirection,checkRoom,calculateTrafficPoint,addDoorPoint,
  292. doorMoveJudge,lightMoveJudge,roomMove,roomAdd,lightAdd,addDoor,fourCornersZoom,
  293. fourEdgeZoom,setJsData,checkInstall} from "@/utils/evacuationLayout";
  294. import { subjectList,lineVertex} from "@/api/evacuation3_2/index";
  295. export default {
  296. name: "builDingDetails",
  297. props:{
  298. propsData:{},
  299. },
  300. data() {
  301. return {
  302. loading:false,
  303. loadingInstance:{},
  304. uploadImgUrl: this.uploadUrl(), // 上传的图片服务器地址
  305. headers: {
  306. Authorization: "Bearer " + getToken(),
  307. },
  308. //背景图透明度
  309. mapOpacity:0.5,
  310. mapOpacityText:50,
  311. //背景图地址
  312. // mapSrc:'https://img0.baidu.com/it/u=3368678403,249914024&fm=253&fmt=auto&app=138&f=JPEG?w=889&h=500',
  313. mapSrc:'',
  314. /*********************布局设置参数*********************/
  315. //边界位置
  316. borderLeft:null,
  317. borderTop:null,
  318. //画布/楼层尺寸
  319. layerWidth:null,
  320. layerHeight:null,
  321. //房间尺寸限制
  322. minHeight:100,
  323. maxHeight:600,
  324. minWidth:100,
  325. maxWidth:800,
  326. //门尺寸数据
  327. doorHeight:34,
  328. doorWidth:34,
  329. //灯尺寸数据
  330. minLightNum:40,
  331. maxLightNum:40,
  332. //交通点检测时触手范围
  333. tentaclesLength:10,
  334. //房间数据
  335. newMapList:[],
  336. mapList: [],
  337. //当前坐标
  338. clientX: "",
  339. clientY: "",
  340. boxIndex: "",
  341. //房间边框/角方向状态 1.上/右上 2.右/右下 3.下/左下 4.左/左上
  342. moveType:null,
  343. //抓取类型 1.房间 2.楼道 3.应急出口 4.房门 6.疏散灯
  344. grab:null,
  345. //子类抓取下标
  346. minIndex:null,
  347. //***********************模拟数据列表*************************//
  348. // 可选房间列表 //1.房间 2.楼道 3.应急出口
  349. roomList:[
  350. {
  351. name:"楼道",
  352. type: '2',
  353. url:require('@/assets/ZDimages/evacuation3_2/img_xgbj_gd.png'),
  354. },
  355. {
  356. name:"应急出口",
  357. type: '3',
  358. url:require('@/assets/ZDimages/evacuation3_2/img_xgbj_yjck.png'),
  359. },
  360. {
  361. name:"房间",
  362. type: '1',
  363. url:require('@/assets/ZDimages/evacuation3_2/img_xgbj_fj.png'),
  364. },
  365. ],
  366. // 房间内配件列表 //4.房间 6.疏散灯
  367. accessoriesList:[
  368. {
  369. name:"房门",
  370. type: '4',
  371. url:require('@/assets/ZDimages/evacuation3_2/img_xgbj_fjm.png'),
  372. },
  373. {
  374. name:"疏散灯",
  375. type: '6',
  376. url:require('@/assets/ZDimages/evacuation3_2/icon_bjt_ssd.png'),
  377. },
  378. ],
  379. //************************弹层开关*******************************//
  380. shadeBoxType:0,
  381. //************************灯设置数据*******************************//
  382. dialogOpen:0,
  383. dialogOpenType:0,
  384. dialogIndex:null,
  385. dialogMinIndex:null,
  386. dialogForm:{},
  387. dialogOptions: [
  388. {
  389. value: '1',
  390. label: '上指示灯'
  391. }, {
  392. value: '2',
  393. label: '下指示灯'
  394. }, {
  395. value: '3',
  396. label: '左指示灯'
  397. }, {
  398. value: '4',
  399. label: '右指示灯'
  400. },
  401. ],
  402. //鼠标右键抓取坐标
  403. mouseX:null,
  404. mouseY:null,
  405. mouseType:0,
  406. //房间类型列表
  407. roomOptions:[],
  408. rules:{
  409. roomType:[
  410. {required: true, message: '请选择房间类型', trigger: 'blur'},
  411. { required: true, message: "请选择房间类型", validator: this.spaceJudgment, trigger: "blur" }
  412. ],
  413. roomNum:[
  414. {required: true, message: '请输入房间编号', trigger: 'blur'},
  415. { required: true, message: "请输入房间编号", validator: this.spaceJudgment, trigger: "blur" }
  416. ],
  417. roomName:[
  418. {required: true, message: '请输入房间名称', trigger: 'blur'},
  419. { required: true, message: "请输入房间名称", validator: this.spaceJudgment, trigger: "blur" }
  420. ],
  421. subId:[
  422. {required: true, message: '请选择房间', trigger: 'blur'},
  423. { required: true, message: "请选择房间", validator: this.spaceJudgment, trigger: "blur" }
  424. ],
  425. name1:[
  426. {required: true, message: '请选择继电器类型', trigger: 'blur'},
  427. { required: true, message: "请选择继电器类型", validator: this.spaceJudgment, trigger: "blur" }
  428. ],
  429. name2:[
  430. {required: true, message: '请输入继电器参数', trigger: 'blur'},
  431. { required: true, message: "请输入继电器参数", validator: this.spaceJudgment, trigger: "blur" }
  432. ],
  433. name3:[
  434. {required: true, message: '请输入状态参数', trigger: 'blur'},
  435. { required: true, message: "请输入状态参数", validator: this.spaceJudgment, trigger: "blur" }
  436. ],
  437. state:[
  438. {required: true, message: '请选择指示灯类型', trigger: 'blur'},
  439. { required: true, message: "请选择指示灯类型", validator: this.spaceJudgment, trigger: "blur" }
  440. ],
  441. },
  442. //拖拽时显示的图片
  443. roomImg_1:null,
  444. roomImg_2:null,
  445. roomImg_3:null,
  446. doorImg:null,
  447. lightImg:null,
  448. //选择实验室 下拉列表
  449. roomSelectList:[],
  450. roomSelectValue:'',
  451. //懒加载实验室列表
  452. subjectOptions:[],
  453. buildName:'',
  454. floorName:'',
  455. }
  456. },
  457. created() {
  458. },
  459. mounted(){
  460. console.log(this.propsData)
  461. this.buildName=this.propsData.buildName
  462. this.floorName=this.propsData.floorName
  463. this.initialization();
  464. this.getDicts("layout_room_type").then(response => {
  465. this.roomOptions = response.data;
  466. this.roomOptions.push({dictLabel:'其他',dictValue:'-99'})
  467. });
  468. // this.$set(this,'mapList',[{"name":"q01","y":401,"x":1,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":29.5}]},{"name":"z01","y":98,"x":801,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":39.5}]},{"name":"l01","y":101,"x":101,"w":100,"h":498,"type":"2","direction":"1","lightList":[{"type":"light","state":"1","w":20,"h":20,"x":40,"y":10},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":90},{"type":"light","state":"1","w":20,"h":20,"x":40,"y":295},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":367},{"type":"light","state":"1","w":20,"h":20,"x":40,"y":400},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":464}]},{"name":"l02","y":301,"x":201,"w":500,"h":100,"type":"2","direction":"1","lightList":[{"type":"light","state":"3","w":20,"h":20,"x":41,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":121,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":348,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":448,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":194,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":277,"y":40}]},{"name":"l03","y":101,"x":701,"w":100,"h":498,"type":"2","direction":"1","lightList":[{"type":"light","state":"1","w":20,"h":20,"x":40,"y":12},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":167},{"type":"light","state":"1","w":20,"h":20,"x":40,"y":321},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":449}]},{"name":"l04","y":101,"x":401,"w":100,"h":200,"type":"2","direction":"1","lightList":[{"type":"light","state":"1","w":20,"h":20,"x":40,"y":46},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":158}]},{"name":"l05","y":401,"x":401,"w":100,"h":198,"type":"2","direction":"1","lightList":[{"type":"light","state":"1","w":20,"h":20,"x":40,"y":23},{"type":"light","state":"2","w":20,"h":20,"x":40,"y":155}]},{"x":301,"y":201,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":20.5}]},{"x":1,"y":501,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":30.5}]},{"x":801,"y":498,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":18.5}]},{"x":301,"y":101,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":35.5,"y":2}]},{"x":201,"y":201,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":23.5}]},{"x":201,"y":101,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":44.5}]},{"x":1,"y":301,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":30.5}]},{"x":1,"y":201,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":40.5}]},{"x":1,"y":101,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":49.5}]},{"x":801,"y":398,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":36.5}]},{"x":801,"y":298,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":34.5}]},{"x":801,"y":198,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":22.5}]},{"x":201,"y":401,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":26.5}]},{"x":301,"y":401,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":43.5}]},{"x":201,"y":501,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"left","w":25,"h":25,"x":2,"y":29.5}]},{"x":301,"y":501,"w":100,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":27.5}]},{"x":501,"y":201,"w":200,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":173,"y":30.5}]},{"x":501,"y":101,"w":200,"h":100,"type":"1","direction":"1","doorList":[{"type":"door","toward":"top","w":25,"h":25,"x":136.5,"y":2}]},{"x":501,"y":401,"w":100,"h":198,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":35.5,"y":171}]},{"x":601,"y":401,"w":100,"h":198,"type":"1","direction":"1","doorList":[{"type":"door","toward":"bottom","w":25,"h":25,"x":33.5,"y":171}]},{"x":101,"y":1,"w":700,"h":100,"type":"2","direction":"1","lightList":[{"type":"light","state":"3","w":20,"h":20,"x":160,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":274,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":495,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":580,"y":40}]},{"x":401,"y":599,"w":400,"h":100,"type":"2","direction":"1","lightList":[{"type":"light","state":"3","w":20,"h":20,"x":87,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":171,"y":40},{"type":"light","state":"3","w":20,"h":20,"x":207,"y":40},{"type":"light","state":"4","w":20,"h":20,"x":272,"y":40}]},{"x":1,"y":1,"w":100,"h":100,"type":"3","direction":"1","doorList":[{"type":"door","toward":"right","w":25,"h":25,"x":73,"y":36.5}]}])
  469. // this.$set(this,'mapSrc','1');
  470. },
  471. methods:{
  472. //提交
  473. setDataButton(){
  474. let self = this;
  475. if(checkRoom(this.mapList)&&
  476. checkDoorTo(this.mapList)&&
  477. checkInstall(this.mapList)){
  478. let newMapList = JSON.parse(JSON.stringify(this.mapList))
  479. let obj = addDoorPoint(newMapList)
  480. console.log('obj',obj);
  481. //提交数据处理
  482. let roomList = [];
  483. let lightList = [];
  484. for(let i=0;i<obj.mapList.length;i++){
  485. if(obj.mapList[i].type == 1){
  486. let minObj = {
  487. roomType:obj.mapList[i].roomType,
  488. roomNum:obj.mapList[i].roomNum,
  489. pointName:obj.mapList[i].key,
  490. }
  491. if(obj.mapList[i].roomType != '-99'){
  492. minObj.subId = obj.mapList[i].subId
  493. minObj.subName = obj.mapList[i].subName
  494. }else{
  495. minObj.roomName = obj.mapList[i].roomName
  496. }
  497. roomList.push(minObj);
  498. }else if(obj.mapList[i].type == 2){
  499. for(let o=0;o<obj.mapList[i].lightList.length;o++){
  500. if( obj.mapList[i].lightList[o].type == 'light'){
  501. let minObj = {
  502. pointName:obj.mapList[i].lightList[o].key,
  503. relayType:obj.mapList[i].lightList[o].relayType,
  504. state:obj.mapList[i].lightList[o].state,
  505. }
  506. if(obj.mapList[i].lightList[o].relayType == 1){
  507. minObj.relayCode = obj.mapList[i].lightList[o].relayCode
  508. minObj.relayBit = obj.mapList[i].lightList[o].relayBit
  509. }else if(obj.mapList[i].lightList[o].relayType == 2){
  510. minObj.configName = obj.mapList[i].lightList[o].configName
  511. minObj.configStatus = obj.mapList[i].lightList[o].configStatus
  512. }
  513. lightList.push(minObj);
  514. }
  515. }
  516. }
  517. }
  518. let newObj = {
  519. imgUrl: this.mapSrc,
  520. canvasWidth: this.layerWidth,
  521. canvasHeight: this.layerHeight,
  522. buildId: this.propsData.buildId,
  523. floorId: this.propsData.floorId,
  524. relationalData:obj.newList,//点数据
  525. buildFloorLayouts:roomList,//房间数据
  526. exitPointRelayList:lightList,//灯数据
  527. layoutData:JSON.stringify(this.mapList),//布局数据
  528. layoutJoinData:JSON.stringify(obj.evacuationList),//布局数据
  529. };
  530. console.log('newObj',newObj);
  531. lineVertex(newObj).then(response => {
  532. this.msgSuccess(response.msg);
  533. this.$parent.clickPage(3)
  534. });
  535. }
  536. },
  537. //返回
  538. clickBack(){
  539. this.$parent.clickPage(1)
  540. },
  541. //初始化
  542. initialization(){
  543. if(this.propsData.layoutData){
  544. this.$set(this,'mapSrc',this.propsData.imgUrl);
  545. this.$set(this,'layerWidth',this.propsData.canvasWidth);
  546. this.$set(this,'layerHeight',this.propsData.canvasHeight);
  547. this.$set(this,'maxWidth',this.propsData.canvasWidth);
  548. this.$set(this,'maxHeight',this.propsData.canvasHeight);
  549. this.$set(this,'mapList',JSON.parse(this.propsData.layoutData));
  550. this.$set(this,'shadeBoxType',5);
  551. }else{
  552. this.$set(this,'shadeBoxType',0);
  553. }
  554. },
  555. //懒加载实验室
  556. userSelectList(e){
  557. subjectList({name:e}).then(response => {
  558. this.subjectOptions = response.data;
  559. });
  560. },
  561. selectFocus(){
  562. console.log("123");
  563. },
  564. selectClick(e){
  565. let self = this;
  566. for(let i=0;i<self.subjectOptions.length;i++){
  567. if(e == self.subjectOptions[i].id){
  568. self.$set(self.dialogForm,'subName',self.subjectOptions[i].name);
  569. }
  570. }
  571. },
  572. /*********************************右键操作事件*********************************/
  573. //右键事件
  574. boxRightClick(event,item,index,minIndex){
  575. event.returnValue = false;
  576. if(item.type == 'light'){
  577. this.$set(this,'mouseX',event.clientX)
  578. this.$set(this,'mouseY',event.clientY )
  579. this.$set(this,'mouseType',6)
  580. this.$set(this,'dialogOpenType',6)
  581. this.$set(this,'dialogIndex',index)
  582. this.$set(this,'dialogMinIndex',minIndex)
  583. let obj = {
  584. relayType:item.relayType?item.relayType:2,
  585. state:item.state?item.state:"",
  586. }
  587. if(obj.relayType == 1){
  588. obj.relayCode = item.relayCode?item.relayCode:"";
  589. obj.relayBit = item.relayBit?item.relayBit:"";
  590. }else if(obj.relayType == 2){
  591. obj.configName = item.configName?item.configName:"";
  592. obj.configStatus = item.configStatus?item.configStatus:"";
  593. }
  594. this.$set(this,'dialogForm',JSON.parse(JSON.stringify(obj)));
  595. //等待写
  596. }else if(item.type == 'door'){
  597. this.$set(this,'mouseX',event.clientX )
  598. this.$set(this,'mouseY',event.clientY)
  599. this.$set(this,'mouseType',4)
  600. this.$set(this,'dialogOpenType',4)
  601. this.$set(this,'dialogIndex',index)
  602. this.$set(this,'dialogMinIndex',minIndex)
  603. this.$set(this,'dialogForm',JSON.parse(JSON.stringify(item)))
  604. }else if(item.type == '1'){
  605. this.$set(this,'mouseX',event.clientX )
  606. this.$set(this,'mouseY',event.clientY)
  607. this.$set(this,'mouseType',1)
  608. this.$set(this,'dialogOpenType',1)
  609. this.$set(this,'dialogIndex',index)
  610. let obj = {
  611. roomType:item.roomType?item.roomType:"",
  612. roomNum:item.roomNum?item.roomNum:"",
  613. roomName:item.roomName?item.roomName:"",
  614. subId:item.subId?item.subId:"",
  615. subName:item.subName?item.subName:"",
  616. }
  617. this.$set(this,'dialogForm',JSON.parse(JSON.stringify(obj)));
  618. }else if(item.type == '2'){
  619. this.$set(this,'mouseX',event.clientX )
  620. this.$set(this,'mouseY',event.clientY)
  621. this.$set(this,'mouseType',2)
  622. this.$set(this,'dialogOpenType',2)
  623. this.$set(this,'dialogIndex',index)
  624. }else if(item.type == '3'){
  625. this.$set(this,'mouseX',event.clientX )
  626. this.$set(this,'mouseY',event.clientY)
  627. this.$set(this,'mouseType',3)
  628. this.$set(this,'dialogOpenType',3)
  629. this.$set(this,'dialogIndex',index)
  630. }
  631. },
  632. //弹窗确定
  633. buttonSetButton(type){
  634. let self = this;
  635. if(type == 1){
  636. this.dialogOpen = false;
  637. }else if(type == 2){
  638. this.$refs["dialogForm"].validate(valid => {
  639. if (valid) {
  640. if(this.dialogOpenType == 1){
  641. for(let i=0;i<self.mapList.length;i++){
  642. if(self.mapList[i].type == '1'){
  643. if(self.mapList[i].subId == self.dialogForm.subId){
  644. this.msgError(self.dialogForm.subName+'已被其他房间绑定')
  645. return
  646. }
  647. }
  648. }
  649. this.$set(this.mapList[this.dialogIndex],'roomType',this.dialogForm.roomType);
  650. this.$set(this.mapList[this.dialogIndex],'roomNum',this.dialogForm.roomNum);
  651. this.$set(this.mapList[this.dialogIndex],'roomName',this.dialogForm.roomName);
  652. this.$set(this.mapList[this.dialogIndex],'subId',this.dialogForm.subId);
  653. this.$set(this.mapList[this.dialogIndex],'subName',this.dialogForm.subName);
  654. this.dialogOpen = false;
  655. }else if(this.dialogOpenType == 6){
  656. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'relayType',this.dialogForm.relayType);
  657. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'state',this.dialogForm.state);
  658. if(this.dialogForm.relayType == 1){
  659. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'relayCode',this.dialogForm.relayCode);
  660. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'relayBit',this.dialogForm.relayBit);
  661. }else if(this.dialogForm.relayType == 2){
  662. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'configName',this.dialogForm.configName);
  663. this.$set(this.mapList[this.dialogIndex].lightList[this.dialogMinIndex],'configStatus',this.dialogForm.configStatus);
  664. }
  665. this.dialogOpen = false;
  666. }
  667. }
  668. })
  669. }
  670. },
  671. //遮罩菜单选中事件
  672. clickShadeButton(type){
  673. if(type == 1){
  674. if(this.dialogForm.roomType != '-99'){
  675. this.$set(this,'subjectOptions',[{id:this.dialogForm.subId,name:this.dialogForm.subName}]);
  676. }
  677. this.$set(this,'dialogOpen',true)
  678. }else if (type == 2){
  679. if(this.dialogOpenType == 1 || this.dialogOpenType == 2 || this.dialogOpenType == 3){
  680. this.mapList.splice(this.dialogIndex,1)
  681. }else if(this.dialogOpenType == 4){
  682. this.mapList[this.dialogIndex].doorList.splice(this.dialogMinIndex,1)
  683. }else if(this.dialogOpenType == 6){
  684. this.mapList[this.dialogIndex].lightList.splice(this.dialogMinIndex,1)
  685. }
  686. this.$forceUpdate();
  687. }
  688. },
  689. //关闭下啦遮罩层
  690. offMapShade(){
  691. this.$set(this,'mouseType',0)
  692. },
  693. /*********************************房间内部移动事件*********************************/
  694. //门按下时绑定事件
  695. doorDragDown(e, index, minIndex){
  696. if (e.button === 0) { //0鼠标左键 1中键 2右键
  697. this.$set(this, 'clientX', e.clientX);
  698. this.$set(this, 'clientY', e.clientY);
  699. this.$set(this, 'boxIndex', index);
  700. this.$set(this, 'minIndex', minIndex);
  701. this.$refs.maxBox.addEventListener('mousemove', this.doorDragMove, false)
  702. this.$refs.maxBox.addEventListener('mouseup', this.doorDragUp, false)
  703. }
  704. },
  705. //门弹起时绑定事件
  706. doorDragUp(e){
  707. if (e.button === 0) { //0鼠标左键 1中键 2右键
  708. this.$refs.maxBox.removeEventListener('mousemove', this.doorDragMove, false)
  709. this.$refs.maxBox.removeEventListener('mouseup', this.doorDragUp, false)
  710. }
  711. },
  712. //门移动事件
  713. doorDragMove(event){
  714. let obj = doorMoveJudge(this.mapList,this.boxIndex,this.minIndex,event,this.$refs.maxBigBox.scrollLeft,this.$refs.maxBigBox.scrollTop);
  715. if(obj){
  716. let newObj = JSON.parse(JSON.stringify(this.mapList[this.boxIndex].doorList));
  717. newObj[this.minIndex] = { type:'door', toward:obj.toward, w:this.doorWidth, h:this.doorHeight, x:obj.x, y:obj.y, }
  718. this.$set(this.mapList[this.boxIndex],'doorList',newObj);
  719. }
  720. //到达边界删除事件
  721. if(event.clientX<=(this.borderLeft)||event.clientX>=(this.borderLeft+this.layerWidth-1)||event.clientY<=(this.borderTop)||event.clientY>=(this.borderTop+this.layerHeight-1)){
  722. this.$refs.maxBox.removeEventListener('mousemove', this.doorDragMove, false)
  723. this.$refs.maxBox.removeEventListener('mouseup', this.doorDragUp, false)
  724. }
  725. },
  726. //灯按下时绑定事件
  727. lightDragDown(e, index,minIndex){
  728. if (e.button === 0) { //0鼠标左键 1中键 2右键
  729. this.$set(this, 'clientX', e.clientX);
  730. this.$set(this, 'clientY', e.clientY);
  731. this.$set(this, 'boxIndex', index);
  732. this.$set(this, 'minIndex', minIndex);
  733. this.$refs.maxBox.addEventListener('mousemove', this.lightDragMove, false)
  734. this.$refs.maxBox.addEventListener('mouseup', this.lightDragUp, false)
  735. }
  736. },
  737. //灯弹起时绑定事件
  738. lightDragUp(e){
  739. if (e.button === 0) { //0鼠标左键 1中键 2右键
  740. this.$refs.maxBox.removeEventListener('mousemove', this.lightDragMove, false)
  741. this.$refs.maxBox.removeEventListener('mouseup', this.lightDragUp, false)
  742. }
  743. },
  744. //灯移动事件
  745. lightDragMove(event){
  746. let obj = lightMoveJudge(this.mapList,this.boxIndex,this.minIndex,event,this.$refs.maxBigBox.scrollLeft,this.$refs.maxBigBox.scrollTop);
  747. if(obj){
  748. this.$set(this.mapList[this.boxIndex].lightList[this.minIndex],'x',obj.x?obj.x:this.mapList[this.boxIndex].lightList[this.minIndex].x);
  749. this.$set(this.mapList[this.boxIndex].lightList[this.minIndex],'y',obj.y?obj.y:this.mapList[this.boxIndex].lightList[this.minIndex].y);
  750. }
  751. //到达边界删除事件
  752. if(event.clientX<=(this.borderLeft)||event.clientX>=(this.borderLeft+this.layerWidth-1)||event.clientY<=(this.borderTop)||event.clientY>=(this.borderTop+this.layerHeight-1)){
  753. this.$refs.maxBox.removeEventListener('mousemove', this.lightDragMove, false)
  754. this.$refs.maxBox.removeEventListener('mouseup', this.lightDragUp, false)
  755. }
  756. },
  757. /*********************************房间移动事件*********************************/
  758. //按下时绑定事件
  759. dragDown(e, index) {
  760. if (e.button === 0) { //0鼠标左键 1中键 2右键
  761. this.$set(this, 'clientX', e.clientX);
  762. this.$set(this, 'clientY', e.clientY);
  763. this.$set(this, 'boxIndex', index);
  764. this.$refs.maxBox.addEventListener('mousemove', this.dragMove, false)
  765. this.$refs.maxBox.addEventListener('mouseup', this.dragUp, false)
  766. }
  767. },
  768. //弹起时删除事件
  769. dragUp(e) {
  770. if (e.button === 0) { //0鼠标左键 1中键 2右键
  771. this.$refs.maxBox.removeEventListener('mousemove', this.dragMove, false)
  772. this.$refs.maxBox.removeEventListener('mouseup', this.dragUp, false)
  773. }
  774. },
  775. //移动事件
  776. dragMove(event) {
  777. if (event.button === 0) { //0鼠标左键 1中键 2右键
  778. let obj = roomMove(this.mapList,this.boxIndex,this.clientX,this.clientY,event)
  779. if(obj.x){
  780. this.$set(this.mapList[this.boxIndex], 'x', obj.x)
  781. }
  782. if (obj.y){
  783. this.$set(this.mapList[this.boxIndex], 'y', obj.y)
  784. }
  785. if(event.clientX<=(this.borderLeft+10)||event.clientX>=(this.borderLeft+this.layerWidth-10)||event.clientY<=(this.borderTop+10)||event.clientY>=(this.borderTop+this.layerHeight-10)){
  786. this.$refs.maxBox.removeEventListener('mousemove', this.dragMove, false)
  787. this.$refs.maxBox.removeEventListener('mouseup', this.dragUp, false)
  788. }
  789. this.$set(this, 'clientX', event.clientX);
  790. this.$set(this, 'clientY', event.clientY);
  791. }
  792. },
  793. /*********************************尺寸调整事件X,Y*********************************/
  794. //四角-按下时绑定事件
  795. zoomDownXY(e, index, type){
  796. if (e.button === 0) { //0鼠标左键 1中键 2右键
  797. this.$set(this, 'clientX', e.clientX);
  798. this.$set(this, 'clientY', e.clientY);
  799. this.$set(this, 'boxIndex', index);
  800. this.$set(this, 'moveType', type);
  801. this.$refs.maxBox.addEventListener('mousemove', this.zoomMoverXY, false)
  802. this.$refs.maxBox.addEventListener('mouseup', this.zoomUpXY, false)
  803. }
  804. },
  805. //四角-弹起时删除事件
  806. zoomUpXY(e){
  807. if (e.button === 0) { //0鼠标左键 1中键 2右键
  808. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverXY, false)
  809. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverXY, false)
  810. }
  811. },
  812. //四角-拖拽事件
  813. zoomMoverXY(event){
  814. // moveType 1.上/右上 2.右/右下 3.下/左下 4.左/左上
  815. if(event.button === 0){
  816. let obj = fourCornersZoom(this.mapList,this.boxIndex,event,this.clientX,this.clientY,this.moveType);
  817. if(obj){
  818. this.$set(this.mapList[this.boxIndex],'x',obj.x?obj.x:this.mapList[this.boxIndex].x);
  819. this.$set(this.mapList[this.boxIndex],'y',obj.y?obj.y:this.mapList[this.boxIndex].y);
  820. this.$set(this.mapList[this.boxIndex],'w',obj.w?obj.w:this.mapList[this.boxIndex].w);
  821. this.$set(this.mapList[this.boxIndex],'h',obj.h?obj.h:this.mapList[this.boxIndex].h);
  822. if(this.mapList[this.boxIndex].type == '1' || this.mapList[this.boxIndex].type == '3'){
  823. this.$set(this.mapList[this.boxIndex],'doorList',obj.doorList?obj.doorList:this.mapList[this.boxIndex].doorList);
  824. }if(this.mapList[this.boxIndex].type == '2'){
  825. this.$set(this.mapList[this.boxIndex],'lightList',obj.lightList?obj.lightList:this.mapList[this.boxIndex].lightList);
  826. }
  827. //到达边界删除事件
  828. if(event.clientX<=(this.borderLeft)||event.clientX>=(this.borderLeft+this.layerWidth-1)||event.clientY<=(this.borderTop)||event.clientY>=(this.borderTop+this.layerHeight-1)){
  829. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverXY, false)
  830. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverXY, false)
  831. }
  832. this.$set(this, 'clientX', event.clientX);
  833. this.$set(this, 'clientY', event.clientY);
  834. }
  835. }
  836. },
  837. /*********************************尺寸调整事件X*********************************/
  838. //左右边框-按下时绑定事件
  839. zoomDownX(e, index, type){
  840. if (e.button === 0) { //0鼠标左键 1中键 2右键
  841. this.$set(this, 'clientX', e.clientX);
  842. this.$set(this, 'clientY', e.clientY);
  843. this.$set(this, 'boxIndex', index);
  844. this.$set(this, 'moveType', type);
  845. this.$refs.maxBox.addEventListener('mousemove', this.zoomMoverX, false)
  846. this.$refs.maxBox.addEventListener('mouseup', this.zoomUpX, false)
  847. }
  848. },
  849. //左右边框-弹起时删除事件
  850. zoomUpX(e){
  851. if (e.button === 0) { //0鼠标左键 1中键 2右键
  852. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverX, false)
  853. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverX, false)
  854. }
  855. },
  856. //左右边框-拖拽事件
  857. zoomMoverX(e){
  858. if (e.button === 0) { //0鼠标左键 1中键 2右键
  859. let obj = fourEdgeZoom(this.mapList,this.boxIndex,e,this.clientX,this.clientY,this.moveType);
  860. if(obj){
  861. this.$set(this.mapList[this.boxIndex],'x',obj.x?obj.x:this.mapList[this.boxIndex].x);
  862. this.$set(this.mapList[this.boxIndex],'w',obj.w?obj.w:this.mapList[this.boxIndex].w);
  863. if(this.mapList[this.boxIndex].type == '1' || this.mapList[this.boxIndex].type == '3'){
  864. this.$set(this.mapList[this.boxIndex],'doorList',obj.doorList?obj.doorList:this.mapList[this.boxIndex].doorList);
  865. }if(this.mapList[this.boxIndex].type == '2'){
  866. this.$set(this.mapList[this.boxIndex],'lightList',obj.lightList?obj.lightList:this.mapList[this.boxIndex].lightList);
  867. }
  868. //到达边界删除事件
  869. if(e.clientX<=(this.borderLeft)||e.clientX>=(this.borderLeft+this.layerWidth-1)||e.clientY<=(this.borderTop)||e.clientY>=(this.borderTop+this.layerHeight-1)){
  870. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverX, false)
  871. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverX, false)
  872. }
  873. this.$set(this, 'clientX', e.clientX);
  874. }
  875. }
  876. },
  877. /*********************************尺寸调整事件Y*********************************/
  878. //上下边框-按下时绑定事件
  879. zoomDownY(e, index, type){
  880. if (e.button === 0) { //0鼠标左键 1中键 2右键
  881. this.$set(this, 'clientX', e.clientX);
  882. this.$set(this, 'clientY', e.clientY);
  883. this.$set(this, 'boxIndex', index);
  884. this.$set(this, 'moveType', type);
  885. this.$refs.maxBox.addEventListener('mousemove', this.zoomMoverY, false)
  886. this.$refs.maxBox.addEventListener('mouseup', this.zoomUpY, false)
  887. }
  888. },
  889. //上下边框-弹起时删除事件
  890. zoomUpY(e){
  891. if (e.button === 0) { //0鼠标左键 1中键 2右键
  892. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverY, false)
  893. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverY, false)
  894. }
  895. },
  896. //上下边框-拖拽事件
  897. zoomMoverY(e){
  898. if (e.button === 0) { //0鼠标左键 1中键 2右键
  899. let obj = fourEdgeZoom(this.mapList,this.boxIndex,e,this.clientX,this.clientY,this.moveType);
  900. if(obj){
  901. this.$set(this.mapList[this.boxIndex],'y',obj.y?obj.y:this.mapList[this.boxIndex].y);
  902. this.$set(this.mapList[this.boxIndex],'h',obj.h?obj.h:this.mapList[this.boxIndex].h);
  903. if(this.mapList[this.boxIndex].type == '1' || this.mapList[this.boxIndex].type == '3'){
  904. this.$set(this.mapList[this.boxIndex],'doorList',obj.doorList?obj.doorList:this.mapList[this.boxIndex].doorList);
  905. }if(this.mapList[this.boxIndex].type == '2'){
  906. this.$set(this.mapList[this.boxIndex],'lightList',obj.lightList?obj.lightList:this.mapList[this.boxIndex].lightList);
  907. }
  908. //到达边界删除事件
  909. if(e.clientX<=(this.borderLeft)||e.clientX>=(this.borderLeft+this.layerWidth-1)||e.clientY<=(this.borderTop)||e.clientY>=(this.borderTop+this.layerHeight-1)){
  910. this.$refs.maxBox.removeEventListener('mousemove', this.zoomMoverY, false)
  911. this.$refs.maxBox.removeEventListener('mouseup', this.zoomMoverY, false)
  912. }
  913. this.$set(this, 'clientY', e.clientY);
  914. }
  915. }
  916. },
  917. /*********************************添加拖拽逻辑*********************************/
  918. externalAddDragStart(e,type){
  919. if(this.mapSrc){
  920. e.dataTransfer.setDragImage(type == 1?this.roomImg_1:(type == 2?this.roomImg_2:(type == 3?this.roomImg_3:'')), 48, 48);
  921. this.$set(this,'grab',type);
  922. }
  923. },
  924. //添加房间
  925. externalAddDragEnd(e){
  926. if(this.mapSrc){
  927. let obj = roomAdd(e,this.mapList,this.grab,this.$refs.maxBigBox.scrollLeft,this.$refs.maxBigBox.scrollTop);
  928. if(obj){
  929. this.mapList.push(obj);
  930. }
  931. }
  932. },
  933. internalAddDragStart(e,type){
  934. e.dataTransfer.setDragImage(type == 4?this.doorImg:(type == 6?this.lightImg:''),
  935. type == 4?17:(type == 6?20:''),
  936. type == 4?17:(type == 6?20:''));
  937. this.$set(this,'grab',type);
  938. },
  939. //添加门/灯
  940. internalAddDragEnd(event){
  941. if(this.grab == 4){
  942. let obj = addDoor(event,this.mapList,this.$refs.maxBigBox.scrollLeft,this.$refs.maxBigBox.scrollTop,this.grab);
  943. if (obj){
  944. //暂时限制只能添加一个
  945. if(this.mapList[obj.index].doorList[0]){
  946. this.msgError('一个房间只能添加一个门')
  947. }else{
  948. this.mapList[obj.index].doorList.push({
  949. type:obj.type,
  950. toward:obj.toward,
  951. w:obj.w,
  952. h:obj.h,
  953. x:obj.x,
  954. y:obj.y,
  955. });
  956. }
  957. }
  958. }else if(this.grab == 6){
  959. let obj = lightAdd(event,this.$refs.maxBigBox.scrollLeft,this.$refs.maxBigBox.scrollTop,this.mapList,this.grab);
  960. if (obj){
  961. this.mapList[obj.index].lightList.push({
  962. type:obj.type,
  963. state:obj.state,
  964. w:obj.w,
  965. h:obj.h,
  966. x:obj.x,
  967. y:obj.y,
  968. });
  969. }
  970. }
  971. },
  972. /*********************************画布坐标矫正相关******************************/
  973. //矫正边界坐标
  974. shadeClick(type){
  975. //初始化抓取图样
  976. this.roomImg_1 = new Image();
  977. this.roomImg_1.src = require('@/assets/ZDimages/evacuation3_2/romm_1.png');
  978. this.roomImg_2 = new Image();
  979. this.roomImg_2.src = require('@/assets/ZDimages/evacuation3_2/romm_2.png');
  980. this.roomImg_3 = new Image();
  981. this.roomImg_3.src = require('@/assets/ZDimages/evacuation3_2/romm_3.png');
  982. this.doorImg = new Image();
  983. this.doorImg.src = require('@/assets/ZDimages/evacuation3_2/icon_sysbjt_m.png');
  984. this.lightImg = new Image();
  985. this.lightImg.src = require('@/assets/ZDimages/evacuation3_2/icon_fxyj_wszys.png');
  986. this.$set(this,'borderLeft', Math.round(this.$refs.maxBigBox.getBoundingClientRect().left));
  987. this.$set(this,'borderTop', Math.round(this.$refs.maxBigBox.getBoundingClientRect().top));
  988. let data = {
  989. borderLeft : this.borderLeft,
  990. borderTop : this.borderTop,
  991. layerWidth : this.layerWidth,
  992. layerHeight : this.layerHeight,
  993. minHeight : this.minHeight,
  994. maxHeight : this.maxHeight,
  995. minWidth : this.minWidth,
  996. maxWidth : this.maxWidth,
  997. doorHeight : this.doorHeight,
  998. doorWidth : this.doorWidth,
  999. minLightNum : this.minLightNum,
  1000. maxLightNum : this.maxLightNum,
  1001. tentaclesLength : this.tentaclesLength,
  1002. }
  1003. setJsData(data);
  1004. this.$set(this, 'shadeBoxType', type);
  1005. },
  1006. //透明度调整
  1007. opacityClick(type){
  1008. if(type == 1){
  1009. if(this.mapOpacityText>10){
  1010. this.$set(this,'mapOpacityText',this.mapOpacityText - 10);
  1011. this.$set(this,'mapOpacity',this.mapOpacityText/100);
  1012. }
  1013. }else if (type == 2){
  1014. if(this.mapOpacityText<100){
  1015. this.$set(this,'mapOpacityText',this.mapOpacityText + 10);
  1016. this.$set(this,'mapOpacity',this.mapOpacityText/100);
  1017. }
  1018. }
  1019. },
  1020. //上传
  1021. handleAvatarSuccess(res, file, type) {
  1022. console.log('上传图片')
  1023. // console.log('res',res);
  1024. // console.log('file',file);
  1025. // console.log('type',type);
  1026. if (type == 1){
  1027. if(res){
  1028. this.loadingInstance.close();
  1029. if(res.data){
  1030. if(res.data.url){
  1031. this.$set(this,'mapSrc',res.data.url)
  1032. this.$set(this, 'shadeBoxType', 1);
  1033. }
  1034. }
  1035. }
  1036. }else if(type == 2){
  1037. }
  1038. },
  1039. beforeAvatarUpload(file) {
  1040. console.log('校验图片')
  1041. if (file.type == 'image/png' || file.type == 'image/jpeg' || file.type == 'image/gif') {
  1042. this.asyncImgChecked(file).then(data => {
  1043. if (data.code == 200) {
  1044. // console.log('data',data);
  1045. this.loadingInstance = Loading.service({ spinner:"", background: 'rgba(255, 255, 255, 0.1)' })
  1046. return true;
  1047. } else if(data.code == 201){
  1048. this.$message.error('图片尺寸不能大于于1500 X 1000')
  1049. return false;
  1050. } else if(data.code == 202){
  1051. this.$message.error('图片尺寸小于当前布局尺寸')
  1052. return false;
  1053. }
  1054. })
  1055. }else{
  1056. this.$message.error('只能上传png/gif/jpg格式');
  1057. return false;
  1058. }
  1059. },
  1060. // 计算图片尺寸
  1061. asyncImgChecked (file) {
  1062. let self = this;
  1063. return new Promise((resolve) => {
  1064. let reader = new FileReader()
  1065. reader.readAsDataURL(file) // 必须用file.raw
  1066. reader.onload = e => { // 让页面中的img标签的src指向读取的路径
  1067. let img = e.target.result;
  1068. const image = new Image()
  1069. image.src=img
  1070. image.onload = _=>{
  1071. let width = image.width
  1072. let height= image.height
  1073. let maxWidth = 0
  1074. let maxHeight = 0
  1075. let upImgType = false
  1076. for(let i=0;i<self.mapList.length;i++){
  1077. if ((self.mapList[i].x + self.mapList[i].w) > maxWidth) {
  1078. maxWidth = self.mapList[i].x + self.mapList[i].w
  1079. }
  1080. if ((self.mapList[i].y + self.mapList[i].h) > maxHeight) {
  1081. maxHeight = self.mapList[i].y + self.mapList[i].h
  1082. }
  1083. }
  1084. if(maxWidth>width||maxHeight>height){
  1085. upImgType = true;
  1086. }
  1087. if(width >1500 || height > 1000){
  1088. //超出限制
  1089. resolve({code:201})
  1090. }else if(upImgType){
  1091. //超出当前布局尺寸
  1092. resolve({code:202})
  1093. }else{
  1094. self.$set(self,'layerWidth',width);
  1095. self.$set(self,'layerHeight',height);
  1096. self.$set(self,'maxWidth',width);
  1097. self.$set(self,'maxHeight',height);
  1098. resolve({code:200})
  1099. }
  1100. }
  1101. }
  1102. })
  1103. },
  1104. buttonShadeClick(){
  1105. this.shadeBoxType = 1;
  1106. },
  1107. }
  1108. }
  1109. </script>
  1110. <style scoped lang="scss">
  1111. .buildingDetails{
  1112. flex:1;
  1113. display: flex!important;
  1114. flex-direction: column;
  1115. overflow: hidden;
  1116. position: relative;
  1117. *{
  1118. margin:0;
  1119. font-weight:500;
  1120. }
  1121. .buildingDetails-page{
  1122. flex:1;
  1123. display: flex;
  1124. overflow: hidden;
  1125. .max-left-box{
  1126. flex:1;
  1127. display: flex;
  1128. flex-direction: column;
  1129. overflow: hidden;
  1130. .max-left-box-one{
  1131. top:0;
  1132. left:0;
  1133. flex:1;
  1134. display: flex;
  1135. flex-direction: column;
  1136. overflow: hidden;
  1137. border:1px solid #e0e0e0;
  1138. margin:22px 0 24px 28px;
  1139. position: relative;
  1140. .max-button-big-position-box{
  1141. position: absolute;
  1142. top:50%;
  1143. left:50%;
  1144. width:332px;
  1145. height:370px;
  1146. margin-left:-166px;
  1147. margin-top:-185px;
  1148. img{
  1149. width:332px;
  1150. height:248px;
  1151. -webkit-user-drag:none
  1152. }
  1153. .up-img-button-box{
  1154. height:40px;
  1155. padding:0;
  1156. margin:34px 16px 19px 16px;
  1157. .up-img-button{
  1158. width:300px;
  1159. line-height:40px;
  1160. color:#0183FA;
  1161. text-align: center;
  1162. border:1px dashed #0183FA;
  1163. border-radius:6px;
  1164. }
  1165. }
  1166. .up-img-text{
  1167. line-height:24px;
  1168. font-size:15px;
  1169. color:#333;
  1170. text-align: center;
  1171. }
  1172. }
  1173. }
  1174. .max-left-button-box{
  1175. display: flex;
  1176. .null-p{
  1177. flex:1;
  1178. }
  1179. .up-img-p{
  1180. width:120px;
  1181. line-height:40px;
  1182. text-align: center;
  1183. font-size:16px;
  1184. color:#333;
  1185. border-radius:6px;
  1186. border: 1px solid #E0E0E0;
  1187. margin:22px 0 0 0;
  1188. }
  1189. .opacity-button-box{
  1190. display: flex;
  1191. border: 1px solid #E0E0E0;
  1192. border-radius:6px;
  1193. width:210px;
  1194. margin:22px 20px 0 26px;
  1195. p{
  1196. font-size:16px;
  1197. text-align: center;
  1198. line-height:40px;
  1199. }
  1200. p:nth-child(1){
  1201. width:40px;
  1202. cursor: pointer;
  1203. }
  1204. p:nth-child(2){
  1205. width:130px;
  1206. border-left:1px solid #e0e0e0;
  1207. border-right:1px solid #e0e0e0;
  1208. }
  1209. p:nth-child(3){
  1210. width:40px;
  1211. cursor: pointer;
  1212. }
  1213. }
  1214. }
  1215. .max-left-map-big-box{
  1216. flex:1;
  1217. margin:22px 0 24px 28px;
  1218. border:1px solid #e0e0e0;
  1219. position: relative;
  1220. .left-map-box{
  1221. z-index:10;
  1222. color:#fff;
  1223. border: 1px solid #dedede;
  1224. position: relative;
  1225. .for-map-box:hover{
  1226. .top-big-box{
  1227. background: #CEF2FD!important;
  1228. }
  1229. .center-left-p{
  1230. background: #CEF2FD!important;
  1231. }
  1232. .center-right-p{
  1233. background: #CEF2FD!important;
  1234. }
  1235. .bottom-big-box{
  1236. background: #CEF2FD!important;
  1237. }
  1238. }
  1239. .for-map-box {
  1240. user-select: none;//解决偶发性拖拽时鼠标变成禁止符号导致拖拽回弹失效
  1241. position: absolute;
  1242. display: flex;
  1243. flex-direction: column;
  1244. background: #CEF2FD;
  1245. .top-big-box{
  1246. display: flex;
  1247. height:2px;
  1248. background: #fff;
  1249. .top-left-p{
  1250. width:2px;
  1251. cursor: se-resize;
  1252. }
  1253. .top-center-p{
  1254. flex:1;
  1255. cursor: n-resize;
  1256. }
  1257. .top-right-p{
  1258. width:2px;
  1259. cursor: ne-resize;
  1260. }
  1261. }
  1262. .center-big-box{
  1263. flex:1;
  1264. display: flex;
  1265. .center-left-p{
  1266. width:2px;
  1267. background: #fff;
  1268. cursor: w-resize;
  1269. }
  1270. .center-move-box{
  1271. flex:1;
  1272. /*cursor: move;*/
  1273. cursor: pointer;
  1274. text-align: center;
  1275. color:#333;
  1276. overflow: hidden;
  1277. }
  1278. .center-right-p{
  1279. width:2px;
  1280. background: #fff;
  1281. cursor: w-resize;
  1282. }
  1283. }
  1284. .bottom-big-box{
  1285. display: flex;
  1286. height:2px;
  1287. background: #fff;
  1288. .bottom-left-p{
  1289. width:2px;
  1290. cursor: ne-resize;
  1291. }
  1292. .bottom-center-p{
  1293. flex:1;
  1294. cursor: n-resize;
  1295. }
  1296. .bottom-right-p{
  1297. width:2px;
  1298. cursor: se-resize;
  1299. }
  1300. }
  1301. .center-move-door-p{
  1302. position: absolute;
  1303. }
  1304. .center-move-light-p{
  1305. position: absolute;
  1306. background: #00ff00;
  1307. font-size:12px;
  1308. font-weight:500;
  1309. }
  1310. .lightNone{
  1311. background: url("../../../../assets/ZDimages/evacuation3_2/icon_fxyj_wszys.png");
  1312. background-size: 100%;
  1313. }
  1314. .lightTop{
  1315. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sjt.png");
  1316. background-size: 100%;
  1317. }
  1318. .lightBottom{
  1319. background: url("../../../../assets/ZDimages/evacuation3_2/icon_xjt.png");
  1320. background-size: 100%;
  1321. }
  1322. .lightLeft{
  1323. background: url("../../../../assets/ZDimages/evacuation3_2/icon_zuo.png");
  1324. background-size: 100%;
  1325. }
  1326. .lightRight{
  1327. background: url("../../../../assets/ZDimages/evacuation3_2/icon_yuo.png");
  1328. background-size: 100%;
  1329. }
  1330. .colorDoor{
  1331. background: red!important;
  1332. }
  1333. .colorTraffic{
  1334. background: #0183fa!important;
  1335. }
  1336. .colorConnect{
  1337. background: #A11DDF!important;
  1338. }
  1339. }
  1340. .for-map-box-one {
  1341. user-select: none;//解决偶发性拖拽时鼠标变成禁止符号导致拖拽回弹失效
  1342. position: absolute;
  1343. display: flex;
  1344. flex-direction: column;
  1345. background: #CEFDD5;
  1346. .top-big-box{
  1347. display: flex;
  1348. height:2px;
  1349. /*background: #0183fa;*/
  1350. .top-left-p{
  1351. width:2px;
  1352. cursor: se-resize;
  1353. }
  1354. .top-center-p{
  1355. flex:1;
  1356. cursor: n-resize;
  1357. }
  1358. .top-right-p{
  1359. width:2px;
  1360. cursor: ne-resize;
  1361. }
  1362. }
  1363. .center-big-box{
  1364. flex:1;
  1365. display: flex;
  1366. .center-left-p{
  1367. width:2px;
  1368. /*background: #0183fa;*/
  1369. cursor: w-resize;
  1370. }
  1371. .center-move-box{
  1372. flex:1;
  1373. /*cursor: move;*/
  1374. cursor: pointer;
  1375. text-align: center;
  1376. color:#333;
  1377. overflow: hidden;
  1378. }
  1379. .center-right-p{
  1380. width:2px;
  1381. /*background: #0183fa;*/
  1382. cursor: w-resize;
  1383. }
  1384. }
  1385. .bottom-big-box{
  1386. display: flex;
  1387. height:2px;
  1388. /*background: #0183fa;*/
  1389. .bottom-left-p{
  1390. width:2px;
  1391. cursor: ne-resize;
  1392. }
  1393. .bottom-center-p{
  1394. flex:1;
  1395. cursor: n-resize;
  1396. }
  1397. .bottom-right-p{
  1398. width:2px;
  1399. cursor: se-resize;
  1400. }
  1401. }
  1402. .center-move-door-p{
  1403. position: absolute;
  1404. background: #0183fa;
  1405. }
  1406. .center-move-light-p{
  1407. position: absolute;
  1408. background: #00ff00;
  1409. font-size:12px;
  1410. font-weight:500;
  1411. }
  1412. .lightNone{
  1413. background: url("../../../../assets/ZDimages/evacuation3_2/icon_fxyj_wszys.png");
  1414. background-size: 100%;
  1415. }
  1416. .lightTop{
  1417. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sjt.png");
  1418. background-size: 100%;
  1419. }
  1420. .lightBottom{
  1421. background: url("../../../../assets/ZDimages/evacuation3_2/icon_xjt.png");
  1422. background-size: 100%;
  1423. }
  1424. .lightLeft{
  1425. background: url("../../../../assets/ZDimages/evacuation3_2/icon_zuo.png");
  1426. background-size: 100%;
  1427. }
  1428. .lightRight{
  1429. background: url("../../../../assets/ZDimages/evacuation3_2/icon_yuo.png");
  1430. background-size: 100%;
  1431. }
  1432. .colorDoor{
  1433. background: red!important;
  1434. }
  1435. .colorTraffic{
  1436. background: #0183fa!important;
  1437. }
  1438. .colorConnect{
  1439. background: #A11DDF!important;
  1440. }
  1441. }
  1442. .for-map-box-two {
  1443. user-select: none;//解决偶发性拖拽时鼠标变成禁止符号导致拖拽回弹失效
  1444. position: absolute;
  1445. display: flex;
  1446. flex-direction: column;
  1447. background:url("../../../../assets/ZDimages/evacuation3_2/icon_yjtd.png") center center no-repeat #39AE36;
  1448. background-size: 60px 60px;
  1449. .top-big-box{
  1450. display: flex;
  1451. height:2px;
  1452. /*background: #0183fa;*/
  1453. background: #fff;
  1454. .top-left-p{
  1455. width:2px;
  1456. cursor: se-resize;
  1457. }
  1458. .top-center-p{
  1459. flex:1;
  1460. cursor: n-resize;
  1461. }
  1462. .top-right-p{
  1463. width:2px;
  1464. cursor: ne-resize;
  1465. }
  1466. }
  1467. .center-big-box{
  1468. flex:1;
  1469. display: flex;
  1470. .center-left-p{
  1471. width:2px;
  1472. /*background: #0183fa;*/
  1473. background: #fff;
  1474. cursor: w-resize;
  1475. }
  1476. .center-move-box{
  1477. flex:1;
  1478. /*cursor: move;*/
  1479. cursor: pointer;
  1480. text-align: center;
  1481. color:#333;
  1482. overflow: hidden;
  1483. }
  1484. .center-right-p{
  1485. width:2px;
  1486. /*background: #0183fa;*/
  1487. background: #fff;
  1488. cursor: w-resize;
  1489. }
  1490. }
  1491. .bottom-big-box{
  1492. display: flex;
  1493. height:2px;
  1494. /*background: #0183fa;*/
  1495. background: #fff;
  1496. .bottom-left-p{
  1497. width:2px;
  1498. cursor: ne-resize;
  1499. }
  1500. .bottom-center-p{
  1501. flex:1;
  1502. cursor: n-resize;
  1503. }
  1504. .bottom-right-p{
  1505. width:2px;
  1506. cursor: se-resize;
  1507. }
  1508. }
  1509. .center-move-door-p{
  1510. position: absolute;
  1511. background: #0183fa;
  1512. }
  1513. .center-move-light-p{
  1514. position: absolute;
  1515. background: #00ff00;
  1516. font-size:12px;
  1517. font-weight:500;
  1518. }
  1519. .lightNone{
  1520. background: url("../../../../assets/ZDimages/evacuation3_2/icon_fxyj_wszys.png");
  1521. background-size: 100%;
  1522. }
  1523. .lightTop{
  1524. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sjt.png");
  1525. background-size: 100%;
  1526. }
  1527. .lightBottom{
  1528. background: url("../../../../assets/ZDimages/evacuation3_2/icon_xjt.png");
  1529. background-size: 100%;
  1530. }
  1531. .lightLeft{
  1532. background: url("../../../../assets/ZDimages/evacuation3_2/icon_zuo.png");
  1533. background-size: 100%;
  1534. }
  1535. .lightRight{
  1536. background: url("../../../../assets/ZDimages/evacuation3_2/icon_yuo.png");
  1537. background-size: 100%;
  1538. }
  1539. .colorDoor{
  1540. background: red!important;
  1541. }
  1542. .colorTraffic{
  1543. background: #0183fa!important;
  1544. }
  1545. .colorConnect{
  1546. background: #A11DDF!important;
  1547. }
  1548. .for-map-box-two-img{
  1549. position: absolute;
  1550. top:50%;
  1551. left:50%;
  1552. margin-left:-30px;
  1553. margin-top:-30px;
  1554. width:60px;
  1555. height:60px;
  1556. }
  1557. }
  1558. .for-map-box-two:hover{
  1559. .top-big-box{
  1560. background: #39AE36!important;
  1561. }
  1562. .center-left-p{
  1563. background: #39AE36!important;
  1564. }
  1565. .center-right-p{
  1566. background: #39AE36!important;
  1567. }
  1568. .bottom-big-box{
  1569. background: #39AE36!important;
  1570. }
  1571. }
  1572. .center-move-door-p-t{
  1573. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sysbjt_m.png")!important;
  1574. background-size: 100%!important;
  1575. transform: rotate(180deg);
  1576. }
  1577. .center-move-door-p-b{
  1578. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sysbjt_m.png")!important;
  1579. background-size: 100%!important;
  1580. }
  1581. .center-move-door-p-l{
  1582. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sysbjt_m.png")!important;
  1583. background-size: 100%!important;
  1584. transform: rotate(90deg);
  1585. }
  1586. .center-move-door-p-r{
  1587. background: url("../../../../assets/ZDimages/evacuation3_2/icon_sysbjt_m.png")!important;
  1588. background-size: 100%!important;
  1589. transform: rotateZ(270deg);
  1590. }
  1591. .center-move-door-p-t-ss{
  1592. background: url("../../../../assets/ZDimages/evacuation3_2/icon_aqtd_m.png")!important;
  1593. background-size: 100%!important;
  1594. transform: rotate(180deg);
  1595. }
  1596. .center-move-door-p-b-ss{
  1597. background: url("../../../../assets/ZDimages/evacuation3_2/icon_aqtd_m.png")!important;
  1598. background-size: 100%!important;
  1599. }
  1600. .center-move-door-p-l-ss{
  1601. background: url("../../../../assets/ZDimages/evacuation3_2/icon_aqtd_m.png")!important;
  1602. background-size: 100%!important;
  1603. transform: rotate(90deg);
  1604. }
  1605. .center-move-door-p-r-ss{
  1606. background: url("../../../../assets/ZDimages/evacuation3_2/icon_aqtd_m.png")!important;
  1607. background-size: 100%!important;
  1608. transform: rotateZ(270deg);
  1609. }
  1610. }
  1611. .left-map-img{
  1612. position: absolute;
  1613. left:0;
  1614. top:0;
  1615. z-index:5;
  1616. -webkit-user-drag: none;
  1617. }
  1618. }
  1619. }
  1620. .max-right-box{
  1621. width:376px;
  1622. display: flex;
  1623. flex-direction: column;
  1624. overflow: hidden;
  1625. .right-title-box{
  1626. margin:0 28px;
  1627. display: flex;
  1628. line-height:70px;
  1629. border-bottom:1px solid #D8D8D8;
  1630. .right-title-p{
  1631. flex:1;
  1632. font-size:16px;
  1633. color:#333;
  1634. overflow:hidden;
  1635. text-overflow:ellipsis;
  1636. white-space:nowrap;
  1637. }
  1638. div{
  1639. cursor: pointer;
  1640. display: flex;
  1641. font-size:16px;
  1642. color:#333;
  1643. p:nth-child(1){
  1644. color:rgb(234,149,24);
  1645. line-height: 70px;
  1646. margin-right:4px;
  1647. }
  1648. p:nth-child(2){
  1649. font-size:16px;
  1650. color:#333;
  1651. }
  1652. }
  1653. }
  1654. .right-bottom-max-box{
  1655. .right-for-max-box{
  1656. margin-left:28px;
  1657. .right-for-title{
  1658. line-height:60px;
  1659. font-size:16px;
  1660. }
  1661. .right-for-box{
  1662. display: inline-block;
  1663. width:150px;
  1664. height:160px;
  1665. margin-right:20px;
  1666. margin-bottom:20px;
  1667. border:1px solid #e0e0e0;
  1668. border-radius:6px;
  1669. overflow: hidden;
  1670. img{
  1671. display: block;
  1672. width:150px;
  1673. height:120px;
  1674. cursor: pointer;
  1675. }
  1676. p{
  1677. line-height:40px;
  1678. border-top:1px solid #e0e0e0;
  1679. text-align: center;
  1680. font-size:14px;
  1681. }
  1682. }
  1683. }
  1684. .right-button-box{
  1685. display: flex;
  1686. p:nth-child(1){
  1687. flex:1;
  1688. }
  1689. p:nth-child(2){
  1690. width:70px;
  1691. line-height: 30px;
  1692. font-size:12px;
  1693. text-align: center;
  1694. background: #E0E0E0;
  1695. color: #999999;
  1696. margin-right:17px;
  1697. border-radius:6px;
  1698. cursor: pointer;
  1699. }
  1700. p:nth-child(3){
  1701. width:70px;
  1702. line-height: 30px;
  1703. font-size:12px;
  1704. text-align: center;
  1705. background: #0045AF;
  1706. color: #fff;
  1707. border-radius:6px;
  1708. cursor: pointer;
  1709. }
  1710. p:nth-child(4){
  1711. flex:1;
  1712. }
  1713. }
  1714. }
  1715. }
  1716. }
  1717. .map-shade-max-big-box{
  1718. z-index:10000;
  1719. position: fixed;
  1720. top: 0;
  1721. left: 0;
  1722. height:100%;
  1723. width:100%;
  1724. .map-shade-big-box{
  1725. width:80px;
  1726. position: absolute;
  1727. border-radius:8px;
  1728. background: #fff;
  1729. font-size:12px;
  1730. font-weight:500;
  1731. box-shadow: 0 4px 10px 0 rgba(0,0,0,0.302);
  1732. overflow: hidden;
  1733. .shade-button-p{
  1734. height:30px;
  1735. line-height:30px;
  1736. text-align: center;
  1737. }
  1738. .shade-button-p:hover{
  1739. color: #fff;
  1740. background: #00a0e9;
  1741. cursor: pointer;
  1742. }
  1743. .shade-border-p{
  1744. height:1px;
  1745. margin:0 10px;
  1746. background:#E0E0E0;
  1747. }
  1748. }
  1749. }
  1750. .shade-max-big-box{
  1751. z-index:10000;
  1752. width:100%;
  1753. height:100%;
  1754. position: fixed;
  1755. top:0;
  1756. left:0;
  1757. background: rgba(0,0,0,0.6);
  1758. .shade-max-box-1{
  1759. width:100%;
  1760. height:100%;
  1761. position: relative;
  1762. .shade-big-img{
  1763. width:126px;
  1764. height:124px;
  1765. position: absolute;
  1766. top:120px;
  1767. left:1010px;
  1768. }
  1769. .shade-big-1-text-1{
  1770. position: absolute;
  1771. top:177px;
  1772. left:1144px;
  1773. background:#fff;
  1774. width:120px;
  1775. line-height:40px;
  1776. text-align: center;
  1777. border:1px solid #e0e0e0;
  1778. border-radius:6px;
  1779. color:#333;
  1780. font-size:16px;
  1781. }
  1782. .shade-big-1-text-2{
  1783. display: flex;
  1784. position: absolute;
  1785. top:177px;
  1786. left:1290px;
  1787. background:#fff;
  1788. width:210px;
  1789. line-height:40px;
  1790. text-align: center;
  1791. border:1px solid #e0e0e0;
  1792. border-radius:6px;
  1793. color:#333;
  1794. font-size:16px;
  1795. p:nth-child(1){
  1796. width:40px;
  1797. }
  1798. p:nth-child(2){
  1799. flex:1;
  1800. border-left:1px solid #e0e0e0;
  1801. border-right:1px solid #e0e0e0;
  1802. }
  1803. p:nth-child(3){
  1804. width:40px;
  1805. }
  1806. }
  1807. .shade-big-1-text-3{
  1808. position: absolute;
  1809. top:230px;
  1810. left:780px;
  1811. color:#fff;
  1812. width:298px;
  1813. }
  1814. .shade-big-1-text-4{
  1815. position: absolute;
  1816. top:300px;
  1817. left:780px;
  1818. color:#fff;
  1819. width:298px;
  1820. }
  1821. .shade-big-1-text-5{
  1822. position: absolute;
  1823. top:395px;
  1824. left:835px;
  1825. background:#fff;
  1826. width:182px;
  1827. line-height:40px;
  1828. text-align: center;
  1829. border:1px solid #e0e0e0;
  1830. border-radius:6px;
  1831. color:#333;
  1832. font-size:16px;
  1833. cursor: pointer;
  1834. }
  1835. }
  1836. .shade-max-box-2{
  1837. width:100%;
  1838. height:100%;
  1839. position: relative;
  1840. .shade-big-img{
  1841. width:126px;
  1842. height:124px;
  1843. position: absolute;
  1844. top:220px;
  1845. right:370px;
  1846. }
  1847. .shade-big-1-text-1{
  1848. background:#fff;
  1849. position: absolute;
  1850. top:286px;
  1851. right:222px;
  1852. width:150px;
  1853. height:160px;
  1854. border:1px solid #e0e0e0;
  1855. border-radius:6px;
  1856. overflow: hidden;
  1857. img{
  1858. display: block;
  1859. width:150px;
  1860. height:120px;
  1861. }
  1862. p{
  1863. line-height:40px;
  1864. border-top:1px solid #e0e0e0;
  1865. text-align: center;
  1866. font-size:14px;
  1867. }
  1868. }
  1869. .shade-big-1-text-1{
  1870. background:#fff;
  1871. position: absolute;
  1872. top:286px;
  1873. right:222px;
  1874. width:150px;
  1875. height:160px;
  1876. border:1px solid #e0e0e0;
  1877. border-radius:6px;
  1878. overflow: hidden;
  1879. img{
  1880. display: block;
  1881. width:150px;
  1882. height:120px;
  1883. }
  1884. p{
  1885. line-height:40px;
  1886. border-top:1px solid #e0e0e0;
  1887. text-align: center;
  1888. font-size:14px;
  1889. }
  1890. }
  1891. .shade-big-1-text-2{
  1892. background:#fff;
  1893. position: absolute;
  1894. top:286px;
  1895. right:52px;
  1896. width:150px;
  1897. height:160px;
  1898. border:1px solid #e0e0e0;
  1899. border-radius:6px;
  1900. overflow: hidden;
  1901. img{
  1902. display: block;
  1903. width:150px;
  1904. height:120px;
  1905. }
  1906. p{
  1907. line-height:40px;
  1908. border-top:1px solid #e0e0e0;
  1909. text-align: center;
  1910. font-size:14px;
  1911. }
  1912. }
  1913. .shade-big-1-text-3{
  1914. background:#fff;
  1915. position: absolute;
  1916. top:470px;
  1917. right:222px;
  1918. width:150px;
  1919. height:160px;
  1920. border:1px solid #e0e0e0;
  1921. border-radius:6px;
  1922. overflow: hidden;
  1923. img{
  1924. display: block;
  1925. width:150px;
  1926. height:120px;
  1927. }
  1928. p{
  1929. line-height:40px;
  1930. border-top:1px solid #e0e0e0;
  1931. text-align: center;
  1932. font-size:14px;
  1933. }
  1934. }
  1935. .shade-big-1-text-4{
  1936. position: absolute;
  1937. top:330px;
  1938. right:440px;
  1939. color:#fff;
  1940. width:298px;
  1941. }
  1942. .shade-big-1-text-5{
  1943. position: absolute;
  1944. top:460px;
  1945. right:440px;
  1946. color:#fff;
  1947. width:298px;
  1948. }
  1949. .shade-big-1-text-6{
  1950. position: absolute;
  1951. top:530px;
  1952. right:440px;
  1953. color:#fff;
  1954. width:298px;
  1955. }
  1956. .shade-big-1-text-7{
  1957. position: absolute;
  1958. top:610px;
  1959. right:500px;
  1960. background:#fff;
  1961. width:182px;
  1962. line-height:40px;
  1963. text-align: center;
  1964. border:1px solid #e0e0e0;
  1965. border-radius:6px;
  1966. color:#333;
  1967. font-size:16px;
  1968. cursor: pointer;
  1969. }
  1970. }
  1971. .shade-max-box-3{
  1972. .shade-big-img{
  1973. width:126px;
  1974. height:124px;
  1975. position: absolute;
  1976. top:670px;
  1977. right:390px;
  1978. }
  1979. .shade-big-1-text-1{
  1980. position: absolute;
  1981. top:460px;
  1982. right:420px;
  1983. color:#fff;
  1984. width:298px;
  1985. }
  1986. .shade-big-1-text-2{
  1987. position: absolute;
  1988. top:540px;
  1989. right:420px;
  1990. color:#fff;
  1991. width:298px;
  1992. }
  1993. .shade-big-1-text-3{
  1994. position: absolute;
  1995. top:630px;
  1996. right:480px;
  1997. background:#fff;
  1998. width:182px;
  1999. line-height:40px;
  2000. text-align: center;
  2001. border:1px solid #e0e0e0;
  2002. border-radius:6px;
  2003. color:#333;
  2004. font-size:16px;
  2005. cursor: pointer;
  2006. }
  2007. .shade-big-1-text-4{
  2008. background:#fff;
  2009. position: absolute;
  2010. top:286px;
  2011. right:222px;
  2012. width:150px;
  2013. height:160px;
  2014. border:1px solid #e0e0e0;
  2015. border-radius:6px;
  2016. overflow: hidden;
  2017. img{
  2018. display: block;
  2019. width:150px;
  2020. height:120px;
  2021. }
  2022. p{
  2023. line-height:40px;
  2024. border-top:1px solid #e0e0e0;
  2025. text-align: center;
  2026. font-size:14px;
  2027. }
  2028. }
  2029. .shade-big-1-text-5{
  2030. background:#fff;
  2031. position: absolute;
  2032. top:286px;
  2033. right:222px;
  2034. width:150px;
  2035. height:160px;
  2036. border:1px solid #e0e0e0;
  2037. border-radius:6px;
  2038. overflow: hidden;
  2039. img{
  2040. display: block;
  2041. width:150px;
  2042. height:120px;
  2043. }
  2044. p{
  2045. line-height:40px;
  2046. border-top:1px solid #e0e0e0;
  2047. text-align: center;
  2048. font-size:14px;
  2049. }
  2050. }
  2051. }
  2052. .shade-max-box-4{
  2053. div{
  2054. position: absolute;
  2055. top:50%;
  2056. left:50%;
  2057. width:460px;
  2058. height:200px;
  2059. margin-top:-100px;
  2060. margin-left:-230px;
  2061. background: #fff;
  2062. padding:18px 30px 0 30px;
  2063. border-radius:6px;
  2064. p:nth-child(1){
  2065. font-size:16px;
  2066. line-height:20px;
  2067. margin-bottom:20px;
  2068. }
  2069. p:nth-child(2){
  2070. font-size:16px;
  2071. line-height:20px;
  2072. }
  2073. p:nth-child(3){
  2074. font-size:16px;
  2075. line-height:20px;
  2076. color:#0183FA;
  2077. margin-left:320px;
  2078. margin-top:50px;
  2079. cursor: pointer;
  2080. }
  2081. }
  2082. }
  2083. }
  2084. }
  2085. </style>
  2086. <style lang="scss">
  2087. .dialog-relay-bit-form-item-box input{
  2088. text-align: left !important;
  2089. }
  2090. </style>