indexOne.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <!--疏散路线(针对矿大增加了楼栋与楼层的选择)-->
  2. <template>
  3. <div class="app-container emergencyEvacuation">
  4. <div class="emergencyEvacuation-page scrollbar-box" v-if="pageType == 1">
  5. <div class="top-title-box building-box">
  6. <el-select v-model="buildingId" 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">
  18. <div :class="buttonId == item.id ?'button-one':'button-two'"
  19. @click="buttonListClick(item.id)"
  20. v-for="(item,index) in floorList" :key="index">{{item.name}}</div>
  21. </div>
  22. <div class="for-button-right-box button-one" @click="pageTypeClick(2)" v-hasPermi="['laboratory:line:add']">新增疏散路线</div>
  23. </div>
  24. <div class="map-big-box">
  25. <div class="map-min-box">
  26. <div class="map-min-for-box" v-for="(item,index) in fjList" :key="index">
  27. {{item.room}}
  28. </div>
  29. <img class="map-min-img" src="@/assets/ZDimages/icon_sjt.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. <img class="map-min-img" src="@/assets/ZDimages/icon_zjt.gif">
  34. <img class="map-min-img" src="@/assets/ZDimages/icon_yjt.gif">
  35. </div>
  36. </div>
  37. <div class="table-box">
  38. <el-table v-loading="loading" border :data="routeList">
  39. <el-table-column label="路径类别" align="left" prop="lightDirection" width="200">
  40. <template slot-scope="scope">
  41. {{scope.row.lightDirection == 1?'向左疏散':(scope.row.lightDirection == 2?'向右疏散':'')}}
  42. </template>
  43. </el-table-column>
  44. <el-table-column label="实验室" align="left" prop="subNames"/>
  45. <el-table-column label="指示灯数量" align="left" prop="labExitLineJoinList.length" width="200"/>
  46. <el-table-column label="操作" align="center" width="160" v-if="tableButtonType">
  47. <template slot-scope="scope">
  48. <div class="button-box">
  49. <p class="table-min-button"
  50. v-hasPermiAnd="['laboratory:line:query','laboratory:line:edit']"
  51. @click="laboratoryLine(scope.row)"
  52. >编辑</p>
  53. <p class="table-min-button"
  54. v-hasPermi="['laboratory:line:remove']"
  55. @click="delButton(scope.row)"
  56. >移除</p>
  57. </div>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <pagination :page-sizes="[20, 30, 40, 50]"
  62. v-show="total>0"
  63. :total="total"
  64. :page.sync="queryParams.pageNum"
  65. :limit.sync="queryParams.pageSize"
  66. @pagination="getList"
  67. />
  68. </div>
  69. </div>
  70. <add-page v-if="pageType == 2"
  71. :propsData="propsData"
  72. :propsList="propsList"></add-page>
  73. </div>
  74. </template>
  75. <script>
  76. import { buildIdList,lablayout,laboratoryLine,laboratoryLineDel,getRedis } from "@/api/laboratory/emergencyEvacuation";
  77. import addPage from './addPageOne.vue'
  78. export default {
  79. components:{
  80. addPage
  81. },
  82. name: "emergencyEvacuation",
  83. data() {
  84. return {
  85. tableButtonType:this.hasPermiDom(['laboratory:line:query','laboratory:line:edit','laboratory:line:remove']),
  86. pageType:1,
  87. fjList:[],
  88. queryParams:{
  89. pageNum:1,
  90. pageSize:20,
  91. },
  92. routeList:[],
  93. loading:false,
  94. total:0,
  95. //组件传参数据
  96. propsData:{},
  97. propsList:{},
  98. //楼栋选择数据
  99. buildingList:[
  100. {value:'1',label:'环境学院-祈福楼1'},
  101. {value:'2',label:'环境学院-祈福楼2'},
  102. {value:'3',label:'环境学院-祈福楼3'},
  103. ],
  104. floorList:[
  105. {name:"环境与气象研究所",id:'1'},
  106. {name:"环境与气象研究所",id:'2'},
  107. {name:"环境与气象研究所",id:'3'},
  108. {name:"环境与气象研究所",id:'4'},
  109. {name:"环境与气象研究所",id:'5'},
  110. {name:"环境与气象研究所",id:'6'},
  111. {name:"环境与气象研究所",id:'7'},
  112. ],
  113. buildingId:"1",
  114. buttonId:'1',
  115. }
  116. },
  117. created() {
  118. },
  119. mounted(){
  120. this.getList();
  121. this.lablayout();
  122. },
  123. methods: {
  124. // 楼层点击
  125. buttonListClick(id){
  126. this.$set(this,'buttonId',id);
  127. },
  128. //删除按钮
  129. delButton(item){
  130. let self = this;
  131. this.$confirm('是否确认删除?', "", {
  132. confirmButtonText: "确定",
  133. cancelButtonText: "取消",
  134. type: "warning"
  135. }).then(function() {
  136. self.delItem(item);
  137. }).then(() => {}).catch(() => {});
  138. },
  139. //删除路线
  140. delItem(item){
  141. laboratoryLineDel(item.id).then(response => {
  142. this.msgSuccess("操作成功");
  143. this.getList();
  144. });
  145. },
  146. //根据学院获取层数据
  147. lablayout(){
  148. let self = this;
  149. let id = 137;
  150. lablayout(id).then(response => {
  151. for(let i=0;i<response.data.length;i++){
  152. if(response.data[i].id == 5){
  153. self.fjList = response.data[i].list;
  154. }
  155. }
  156. });
  157. },
  158. //获取层线路
  159. getList(){
  160. let id = 5;
  161. buildIdList(id).then(response => {
  162. this.routeList = response.rows;
  163. this.total = response.total;
  164. });
  165. },
  166. //获取路线详情
  167. laboratoryLine(item){
  168. laboratoryLine(item.id).then(response => {
  169. console.log("resp",response)
  170. this.$set(this,'propsData',response.data)
  171. this.$set(this,'propsList',{
  172. buildingList:this.buildingList,
  173. floorList:this.floorList,
  174. buildingId:this.buildingId,
  175. buttonId:this.buttonId,
  176. })
  177. this.pageType = 2;
  178. });
  179. },
  180. //切换页面状态
  181. pageTypeClick(type){
  182. if(type == 1){
  183. this.pageType = 1;
  184. this.getList();
  185. }else if(type == 2){
  186. this.$set(this,'propsData',{});
  187. this.$set(this,'propsList',{
  188. buildingList:this.buildingList,
  189. floorList:this.floorList,
  190. buildingId:this.buildingId,
  191. buttonId:this.buttonId,
  192. })
  193. this.pageType = 2;
  194. }
  195. },
  196. }
  197. };
  198. </script>
  199. <style scoped lang="scss">
  200. .emergencyEvacuation{
  201. flex:1;
  202. display: flex;
  203. flex-direction: column;
  204. overflow: hidden !important;
  205. .emergencyEvacuation-page{
  206. flex:1;
  207. display: flex;
  208. flex-direction: column;
  209. overflow-y: scroll;
  210. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  211. border-radius:10px;
  212. .top-title-box{
  213. height:80px;
  214. line-height:80px;
  215. margin:0 46px;
  216. border-bottom:1px solid #E0E0E0;
  217. color:#0045AF;
  218. font-size:18px;
  219. i{
  220. margin-left:18px;
  221. }
  222. }
  223. .for-button-box{
  224. margin:26px 86px 26px;
  225. display: flex;
  226. .for-button-min-box{
  227. flex:1;
  228. div{
  229. margin-right:20px!important;
  230. }
  231. }
  232. .for-button-null-box{
  233. flex:1;
  234. }
  235. .for-button-right-box{
  236. }
  237. .button-one{
  238. font-size:14px;
  239. cursor:pointer;
  240. display: inline-block;
  241. text-align: center;
  242. padding:0 20px;
  243. height: 40px;
  244. line-height:40px;
  245. border-radius: 6px;
  246. border: 1px solid #0045af;
  247. color:#ffffff;
  248. background:#0045af;
  249. margin:0;
  250. }
  251. .button-two{
  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 #DCDFE6;
  261. color:#606266;
  262. font-size: 14px;
  263. background:#ffffff;
  264. margin:0;
  265. }
  266. }
  267. .map-big-box{
  268. width:1410px;
  269. height:545px;
  270. margin:0 auto;
  271. border:1px solid #E0E0E0;
  272. margin-bottom:20px;
  273. .map-min-box{
  274. height:505px;
  275. width:1133px;
  276. margin:20px auto;
  277. background: url("../../../../assets/ZDimages/icon_bj_syspmtcy_jinan.png");
  278. position: relative;
  279. .map-min-for-box{
  280. overflow: hidden;
  281. display: inline-block;
  282. line-height:150px;
  283. text-align: center;
  284. }
  285. .map-min-for-box:nth-child(1){
  286. margin:4px 143px 0 0;
  287. width:162px;
  288. height:162px;
  289. }
  290. .map-min-for-box:nth-child(2){
  291. margin:4px 0 0 0;
  292. width:101px;
  293. height:162px;
  294. }
  295. .map-min-for-box:nth-child(3){
  296. margin:4px 0 0 0;
  297. width:101px;
  298. height:162px;
  299. }
  300. .map-min-for-box:nth-child(4){
  301. margin:4px 0 0 0;
  302. width:100px;
  303. height:162px;
  304. }
  305. .map-min-for-box:nth-child(5){
  306. margin:4px 0 0 0;
  307. width:100px;
  308. height:162px;
  309. }
  310. .map-min-for-box:nth-child(6){
  311. margin:4px 0 0 0;
  312. width:100px;
  313. height:162px;
  314. }
  315. .map-min-for-box:nth-child(7){
  316. margin:4px 0 0 0;
  317. width:100px;
  318. height:162px;
  319. }
  320. .map-min-for-box:nth-child(8){
  321. margin:4px 60px 0 0;
  322. width:100px;
  323. height:162px;
  324. }
  325. .map-min-for-box:nth-child(9){
  326. margin: 90px 0 0 0;
  327. width: 92px;
  328. height: 240px;
  329. line-height:230px;
  330. }
  331. .map-min-for-box:nth-child(10){
  332. margin: 90px 0 0 0;
  333. width: 107px;
  334. height: 240px;
  335. line-height:230px;
  336. }
  337. .map-min-for-box:nth-child(11){
  338. margin: 90px 0 0 0;
  339. width: 107px;
  340. height: 240px;
  341. line-height:230px;
  342. }
  343. .map-min-for-box:nth-child(12){
  344. margin: 90px 0 0 0;
  345. width: 100px;
  346. height: 240px;
  347. line-height:230px;
  348. }
  349. .map-min-for-box:nth-child(13){
  350. margin: 90px 0 0 0;
  351. width: 100px;
  352. height: 240px;
  353. line-height:230px;
  354. }
  355. .map-min-for-box:nth-child(14){
  356. margin: 90px 0 0 0;
  357. width: 100px;
  358. height: 240px;
  359. line-height:230px;
  360. }
  361. .map-min-for-box:nth-child(15){
  362. margin: 90px 0 0 0;
  363. width: 100px;
  364. height: 240px;
  365. line-height:230px;
  366. }
  367. .map-min-for-box:nth-child(16){
  368. margin: 90px 0 0 0;
  369. width: 100px;
  370. height: 240px;
  371. line-height:230px;
  372. }
  373. .map-min-for-box:nth-child(17){
  374. margin: 90px 0 0 0;
  375. width: 100px;
  376. height: 240px;
  377. line-height:230px;
  378. }
  379. .map-min-for-box:nth-child(18){
  380. margin: 90px 60px 0 0;
  381. width: 100px;
  382. height: 240px;
  383. line-height:230px;
  384. }
  385. .map-min-img{
  386. position: absolute;
  387. width:40px;
  388. height:28px;
  389. }
  390. .map-min-img:nth-child(19){
  391. top: 128px;
  392. left: 175px;
  393. }
  394. .map-min-img:nth-child(20){
  395. top: 194px;
  396. left: 231px;
  397. }
  398. .map-min-img:nth-child(21){
  399. top: 194px;
  400. left: 540px;
  401. }
  402. .map-min-img:nth-child(22){
  403. top: 194px;
  404. left: 630px;
  405. }
  406. .map-min-img:nth-child(23){
  407. top: 194px;
  408. left: 940px;
  409. }
  410. .map-min-img:nth-child(24){
  411. top: 194px;
  412. left: 1030px;
  413. }
  414. }
  415. }
  416. .table-box{
  417. min-height:400px;
  418. display: flex;
  419. flex:1;
  420. flex-direction: column;
  421. margin:20px 20px;
  422. .button-box{
  423. display: flex;
  424. p:nth-child(1){
  425. margin-right:20px;
  426. }
  427. }
  428. }
  429. }
  430. }
  431. </style>
  432. <style lang="scss">
  433. .emergencyEvacuation{
  434. .building-box{
  435. .el-input__inner{
  436. border:none;
  437. color:#0045AF;
  438. font-size:18px;
  439. }
  440. .el-select .el-input .el-select__caret{
  441. font-size:20px;
  442. }
  443. }
  444. }
  445. </style>