buildingDetails.vue 84 KB

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