performEvacuationOne.vue 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. <!--应急疏散(针对矿大增加了楼栋与楼层的选择)-->
  2. <template>
  3. <div class="app-container performEvacuation">
  4. <div class="performEvacuation-page scrollbar-box" v-if="pageType == 1">
  5. <div class="top-title-box building-box">
  6. <el-select v-model="buildingId" @change="selectChange" placeholder="请选择">
  7. <el-option
  8. v-for="item in buildingList"
  9. :key="item.value"
  10. :label="item.label"
  11. :value="item.value">
  12. </el-option>
  13. </el-select>
  14. <!--<i class="el-icon-arrow-down"></i>-->
  15. </div>
  16. <div class="for-button-box">
  17. <div class="for-button-min-box" :class="buttonId == item.id ?'button-one':'button-two'"
  18. @click="buttonListClick(item.id,index)"
  19. v-for="(item,index) in floorList" :key="index">{{item.name}}</div>
  20. </div>
  21. <div class="map-big-box">
  22. <div class="map-min-box" :class="buttonId == '5'?'map-min-box-1':(buttonId == '6'?'map-min-box-2':(buttonId == '7'?'map-min-box-3':''))">
  23. <div class="map-min-for-box" :class="item.subjectId == subId?'map-min-for-box-color':''"
  24. v-for="(item,index) in fjList" :key="index" @click="clickDiv(item)">
  25. {{item.room}}
  26. </div>
  27. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif">-->
  28. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif">-->
  29. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif">-->
  30. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif">-->
  31. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif">-->
  32. <!--<img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif">-->
  33. </div>
  34. </div>
  35. <p class="bottom-button-p inquire-button-one" @click="goEvacuation">查看</p>
  36. </div>
  37. <emergency-evacuation-big v-if="pageType == 2" :routerType="true"></emergency-evacuation-big>
  38. </div>
  39. </template>
  40. <script>
  41. import emergencyEvacuationBig from "../../../emergencyEvacuationBigOne.vue"
  42. import { getRedis } from '@/api/executeThePlan'
  43. import { getBuilding } from "@/api/laboratory/building";
  44. import { treeselectByUser } from "@/api/system/dept";
  45. export default {
  46. name: 'performEvacuation',
  47. components: {
  48. emergencyEvacuationBig,
  49. },
  50. data() {
  51. return {
  52. pageType:0,
  53. subId:"",
  54. title:"",
  55. buttonList:[
  56. {name:"环境与气象研究所",}
  57. ],
  58. buttonIndex:0,
  59. routeList:[
  60. {
  61. id:"1",
  62. name:"向左疏散",
  63. },
  64. {
  65. id:"2",
  66. name:"向右疏散",
  67. },
  68. {
  69. id:"0",
  70. name:"两侧疏散",
  71. },
  72. ],
  73. fjList:[],
  74. form:{
  75. lightDirection:"",
  76. },
  77. //楼栋选择数据
  78. buildingList:[],
  79. floorList:[],
  80. buildingId:null,
  81. buttonId:null,
  82. }
  83. },
  84. created() {
  85. if(this.$route.query.subId){
  86. this.subId = this.$route.query.subId;
  87. this.title = this.$route.query.text;
  88. this.pageType = 2;
  89. }else{
  90. this.getRedis();
  91. }
  92. },
  93. mounted(){
  94. this.treeselectByUser();
  95. },
  96. methods:{
  97. getBuilding(id){
  98. getBuilding(id).then(response => {
  99. // this.$set(this,'floorList',response.data);
  100. // 过滤了三楼
  101. let list = [];
  102. for(let i=0;i<response.data.length;i++){
  103. if(response.data[i].id != 7){
  104. list.push(response.data[i]);
  105. }
  106. }
  107. this.$set(this,'floorList',list);
  108. if(response.data[0]){
  109. this.$set(this,'buttonId',response.data[0].id);
  110. this.$set(this,'fjList',response.data[0].list);
  111. }
  112. })
  113. },
  114. //获取院系/楼层
  115. treeselectByUser(){
  116. treeselectByUser().then(response => {
  117. let list = [];
  118. for(let i=0;i<response.data.length;i++){
  119. for(let o=0;o<response.data[i].children.length;o++){
  120. let obj = {
  121. label:response.data[i].label+'-'+response.data[i].children[o].label,
  122. value:response.data[i].children[o].id,
  123. }
  124. list.push(obj);
  125. if(i==0&&o==0){
  126. this.$set(this,'buildingId',response.data[i].children[o].id);
  127. }
  128. }
  129. }
  130. this.$set(this,'buildingList',list);
  131. this.getBuilding(this.buildingId);
  132. });
  133. },
  134. // 楼层点击
  135. buttonListClick(id,index){
  136. this.$set(this,'buttonId',id);
  137. this.$set(this,'fjList',this.floorList[index].list);
  138. this.$set(this,'subId',"");
  139. this.$set(this,'title',"");
  140. },
  141. goPage(type){
  142. if(type == 2){
  143. this.pageType = 2;
  144. }else if(type == 1){
  145. this.treeselectByUser();
  146. this.$set(this,'subId',"");
  147. this.$set(this,'title',"");
  148. this.pageType = 1;
  149. }
  150. },
  151. //获取当前疏散页面
  152. getRedis(){
  153. getRedis().then(data => {
  154. if(data.data){
  155. this.pageType = 2;
  156. }else{
  157. this.pageType = 1;
  158. }
  159. });
  160. },
  161. //页面切换
  162. backPage(){
  163. this.pageType = 1;
  164. },
  165. //点击选中实验室
  166. clickDiv(item){
  167. if(item.subjectId == -1){
  168. this.msgError("该房间未绑定实验室");
  169. return
  170. }
  171. if(item.subjectId == this.subId){
  172. this.subId = "";
  173. this.title = "";
  174. }else{
  175. this.subId = item.subjectId;
  176. this.title = item.subjectName;
  177. }
  178. },
  179. //确认疏散
  180. goEvacuation(){
  181. let self = this;
  182. if(!this.subId){
  183. this.msgError("请选择需要查看的实验室");
  184. return
  185. }
  186. localStorage.setItem('evacuationSubId',this.subId)
  187. localStorage.setItem('evacuationTitel',this.title)
  188. localStorage.setItem('evacuationButtonId',this.buttonId)
  189. localStorage.setItem('evacuationBuildingId',this.buildingId)
  190. let address = "";
  191. for(let i=0;i<self.buildingList.length;i++){
  192. if(self.buildingList[i].value == self.buildingId){
  193. address = self.buildingList[i].label
  194. }
  195. }
  196. for(let i=0;i<self.floorList.length;i++){
  197. if(self.floorList[i].id == self.buttonId){
  198. address = address +'-'+self.floorList[i].name;
  199. }
  200. }
  201. localStorage.setItem('evacuationAddress',address)
  202. this.pageType = 2;
  203. },
  204. //选择疏散方向
  205. selectChange(e){
  206. this.$set(this,'buildingId',e);
  207. this.getBuilding(this.buildingId);
  208. },
  209. }
  210. }
  211. </script>
  212. <style scoped lang="scss">
  213. .performEvacuation{
  214. flex:1;
  215. display: flex;
  216. flex-direction: column;
  217. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  218. border-radius:10px;
  219. .performEvacuation-page{
  220. flex:1;
  221. display: flex;
  222. flex-direction: column;
  223. overflow-y: scroll;
  224. }
  225. .top-title-box{
  226. height:80px;
  227. line-height:80px;
  228. margin:0 46px;
  229. border-bottom:1px solid #E0E0E0;
  230. color:#0045AF;
  231. font-size:18px;
  232. i{
  233. margin-left:18px;
  234. }
  235. }
  236. .for-button-box{
  237. margin:26px 86px 26px;
  238. display: flex;
  239. .for-button-min-box{
  240. margin-right:20px!important;
  241. }
  242. .for-button-null-box{
  243. text-align: right;
  244. font-size:16px;
  245. line-height:40px;
  246. margin-right:20px;
  247. flex:1;
  248. }
  249. .for-button-right-box{
  250. }
  251. .button-one{
  252. font-size:14px;
  253. cursor:pointer;
  254. display: inline-block;
  255. text-align: center;
  256. padding:0 20px;
  257. height: 40px;
  258. line-height:40px;
  259. border-radius: 6px;
  260. border: 1px solid #0045af;
  261. color:#ffffff;
  262. background:#0045af;
  263. margin:0;
  264. }
  265. .button-two{
  266. font-size:14px;
  267. cursor:pointer;
  268. display: inline-block;
  269. text-align: center;
  270. padding:0 20px;
  271. height: 40px;
  272. line-height:40px;
  273. border-radius: 6px;
  274. border: 1px solid #DCDFE6;
  275. color:#606266;
  276. font-size: 14px;
  277. background:#ffffff;
  278. margin:0;
  279. }
  280. }
  281. .map-big-box{
  282. width:1410px;
  283. height:545px;
  284. margin:0 auto;
  285. border:1px solid #E0E0E0;
  286. margin-bottom:20px;
  287. .map-min-box{
  288. /*height:505px;*/
  289. /*width:1133px;*/
  290. /*margin:20px auto;*/
  291. /*background: url("../../../../assets/ZDimages/icon_bj_syspmtcy_jinan.png");*/
  292. /*position: relative;*/
  293. .map-min-for-box{
  294. overflow: hidden;
  295. display: inline-block;
  296. line-height:150px;
  297. text-align: center;
  298. }
  299. .map-min-for-box:hover{
  300. cursor: pointer;
  301. background: rgba(0,189,255,0.3);
  302. }
  303. .map-min-for-box-color{
  304. background: rgba(0,189,255,0.3);
  305. }
  306. .map-min-img{
  307. position: absolute;
  308. width:40px;
  309. height:28px;
  310. }
  311. }
  312. }
  313. .bottom-button-p{
  314. margin: 20px auto 40px;
  315. width:160px;
  316. }
  317. }
  318. </style>
  319. <style lang="scss">
  320. .performEvacuation{
  321. .building-box{
  322. .el-input__inner{
  323. border:none;
  324. color:#0045AF;
  325. font-size:18px;
  326. }
  327. .el-select .el-input .el-select__caret{
  328. font-size:20px;
  329. }
  330. .el-select{
  331. display: flex;
  332. }
  333. }
  334. }
  335. </style>