index.vue 11 KB

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