buildingDetails.vue 82 KB

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