index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  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. console.log("resp",response)
  143. this.$set(this,'propsData',response.data)
  144. this.pageType = 2;
  145. });
  146. },
  147. //切换页面状态
  148. pageTypeClick(type){
  149. if(type == 1){
  150. this.pageType = 1;
  151. this.getList();
  152. }else if(type == 2){
  153. this.$set(this,'propsData',{});
  154. this.pageType = 2;
  155. }
  156. },
  157. }
  158. };
  159. </script>
  160. <style scoped lang="scss">
  161. .emergencyEvacuation{
  162. flex:1;
  163. display: flex;
  164. flex-direction: column;
  165. overflow: hidden !important;
  166. .emergencyEvacuation-page{
  167. flex:1;
  168. display: flex;
  169. flex-direction: column;
  170. overflow-y: scroll;
  171. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  172. border-radius:10px;
  173. .top-title-box{
  174. height:80px;
  175. line-height:80px;
  176. margin:0 46px;
  177. border-bottom:1px solid #E0E0E0;
  178. color:#0045AF;
  179. font-size:18px;
  180. i{
  181. margin-left:18px;
  182. }
  183. }
  184. .for-button-box{
  185. margin:36px 86px 26px;
  186. display: flex;
  187. .for-button-min-box{
  188. margin-right:20px!important;
  189. }
  190. .for-button-null-box{
  191. flex:1;
  192. }
  193. .for-button-right-box{
  194. }
  195. .button-one{
  196. font-size:14px;
  197. cursor:pointer;
  198. display: inline-block;
  199. text-align: center;
  200. padding:0 20px;
  201. height: 40px;
  202. line-height:40px;
  203. border-radius: 6px;
  204. border: 1px solid #0045af;
  205. color:#ffffff;
  206. background:#0045af;
  207. margin:0;
  208. }
  209. .button-two{
  210. font-size:14px;
  211. cursor:pointer;
  212. display: inline-block;
  213. text-align: center;
  214. padding:0 20px;
  215. height: 40px;
  216. line-height:40px;
  217. border-radius: 6px;
  218. border: 1px solid #DCDFE6;
  219. color:#606266;
  220. font-size: 14px;
  221. background:#ffffff;
  222. margin:0;
  223. }
  224. }
  225. .map-big-box{
  226. width:1410px;
  227. height:545px;
  228. margin:0 auto;
  229. border:1px solid #E0E0E0;
  230. margin-bottom:20px;
  231. .map-min-box{
  232. height:505px;
  233. width:1133px;
  234. margin:20px auto;
  235. background: url("../../../../assets/ZDimages/icon_bj_syspmtcy_jinan.png");
  236. position: relative;
  237. .map-min-for-box{
  238. overflow: hidden;
  239. display: inline-block;
  240. line-height:150px;
  241. text-align: center;
  242. }
  243. .map-min-for-box:nth-child(1){
  244. margin:4px 143px 0 0;
  245. width:162px;
  246. height:162px;
  247. }
  248. .map-min-for-box:nth-child(2){
  249. margin:4px 0 0 0;
  250. width:101px;
  251. height:162px;
  252. }
  253. .map-min-for-box:nth-child(3){
  254. margin:4px 0 0 0;
  255. width:101px;
  256. height:162px;
  257. }
  258. .map-min-for-box:nth-child(4){
  259. margin:4px 0 0 0;
  260. width:100px;
  261. height:162px;
  262. }
  263. .map-min-for-box:nth-child(5){
  264. margin:4px 0 0 0;
  265. width:100px;
  266. height:162px;
  267. }
  268. .map-min-for-box:nth-child(6){
  269. margin:4px 0 0 0;
  270. width:100px;
  271. height:162px;
  272. }
  273. .map-min-for-box:nth-child(7){
  274. margin:4px 0 0 0;
  275. width:100px;
  276. height:162px;
  277. }
  278. .map-min-for-box:nth-child(8){
  279. margin:4px 60px 0 0;
  280. width:100px;
  281. height:162px;
  282. }
  283. .map-min-for-box:nth-child(9){
  284. margin: 90px 0 0 0;
  285. width: 92px;
  286. height: 240px;
  287. line-height:230px;
  288. }
  289. .map-min-for-box:nth-child(10){
  290. margin: 90px 0 0 0;
  291. width: 107px;
  292. height: 240px;
  293. line-height:230px;
  294. }
  295. .map-min-for-box:nth-child(11){
  296. margin: 90px 0 0 0;
  297. width: 107px;
  298. height: 240px;
  299. line-height:230px;
  300. }
  301. .map-min-for-box:nth-child(12){
  302. margin: 90px 0 0 0;
  303. width: 100px;
  304. height: 240px;
  305. line-height:230px;
  306. }
  307. .map-min-for-box:nth-child(13){
  308. margin: 90px 0 0 0;
  309. width: 100px;
  310. height: 240px;
  311. line-height:230px;
  312. }
  313. .map-min-for-box:nth-child(14){
  314. margin: 90px 0 0 0;
  315. width: 100px;
  316. height: 240px;
  317. line-height:230px;
  318. }
  319. .map-min-for-box:nth-child(15){
  320. margin: 90px 0 0 0;
  321. width: 100px;
  322. height: 240px;
  323. line-height:230px;
  324. }
  325. .map-min-for-box:nth-child(16){
  326. margin: 90px 0 0 0;
  327. width: 100px;
  328. height: 240px;
  329. line-height:230px;
  330. }
  331. .map-min-for-box:nth-child(17){
  332. margin: 90px 0 0 0;
  333. width: 100px;
  334. height: 240px;
  335. line-height:230px;
  336. }
  337. .map-min-for-box:nth-child(18){
  338. margin: 90px 60px 0 0;
  339. width: 100px;
  340. height: 240px;
  341. line-height:230px;
  342. }
  343. .map-min-img{
  344. position: absolute;
  345. width:40px;
  346. height:28px;
  347. }
  348. .map-min-img:nth-child(19){
  349. top: 128px;
  350. left: 175px;
  351. }
  352. .map-min-img:nth-child(20){
  353. top: 194px;
  354. left: 231px;
  355. }
  356. .map-min-img:nth-child(21){
  357. top: 194px;
  358. left: 540px;
  359. }
  360. .map-min-img:nth-child(22){
  361. top: 194px;
  362. left: 630px;
  363. }
  364. .map-min-img:nth-child(23){
  365. top: 194px;
  366. left: 940px;
  367. }
  368. .map-min-img:nth-child(24){
  369. top: 194px;
  370. left: 1030px;
  371. }
  372. }
  373. }
  374. .table-box{
  375. min-height:400px;
  376. display: flex;
  377. flex:1;
  378. flex-direction: column;
  379. margin:20px 20px;
  380. .button-box{
  381. display: flex;
  382. p:nth-child(1){
  383. margin-right:20px;
  384. }
  385. }
  386. }
  387. }
  388. }
  389. </style>