index.vue 11 KB

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