DetailModalFire.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. <template>
  2. <BasicModal @register="register" :title="titleName" width="100%" v-bind="$attrs" @ok="onSubmit" @cancel="onSubmit" :defaultFullscreen="true">
  3. <div class="alarm-modal">
  4. <div class="containers">
  5. <div class="alarm-menu">
  6. <div class="type-btn" v-if="isShowModule">
  7. <div :class="activeIndex == index ? 'btn1' : 'btn'" v-for="(item, index) in typeMenuList" :key="index" @click="btnClick(index)">
  8. {{ item.name }}
  9. </div>
  10. </div>
  11. <div class="card-btn">
  12. <div :class="activeIndex1 == ind ? 'btn1' : 'btn'" v-for="(item, ind) in menuList" :key="ind" @click="cardClick(ind, item)">
  13. <div class="text">{{ item.name }}</div>
  14. <div class="warn">{{ item.warn }}</div>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="alarm-content">
  19. <!-- <div class="toggle-btn">
  20. <div :class="activeIndex2 == ind ? 'btn-item1' : 'btn-item'" v-for="(items, ind) in btnList" :key="ind"
  21. @click="toggleClick(ind)">
  22. {{ items.label }}
  23. </div>
  24. </div> -->
  25. <component :is="componentName[current]" />
  26. </div>
  27. </div>
  28. </div>
  29. </BasicModal>
  30. </template>
  31. <script lang="ts" setup>
  32. import { onMounted, ref, defineEmits, reactive, onUnmounted, watch, markRaw, defineAsyncComponent, defineProps } from 'vue';
  33. import { BasicModal, useModalInner } from '/@/components/Modal';
  34. import { typeMenuList, componentName } from './fire.data';
  35. let props = defineProps({
  36. moduleName: String,
  37. });
  38. let isShowModule = ref(true); //是否显示内外因火灾切换按钮
  39. let titleName = ref('');
  40. let menuList = reactive<any[]>([]); //左侧菜单列表
  41. //内外因火灾激活索引
  42. let activeIndex = ref(0);
  43. //当前激活菜单的索引
  44. let activeIndex1 = ref(0);
  45. //当前加载组件
  46. let current = ref('fireWork');
  47. //实时/历史数据激活索引
  48. let activeIndex2 = ref(0);
  49. // //实时历史数据按钮列表
  50. // let btnList = reactive([{ label: '实时' }]);
  51. const emit = defineEmits(['close', 'register']);
  52. // 注册 modal
  53. const [register, { closeModal }] = useModalInner();
  54. async function onSubmit() {
  55. emit('close');
  56. closeModal();
  57. }
  58. //内外因火灾选项切换
  59. function btnClick(ind) {
  60. activeIndex.value = ind;
  61. switch (ind) {
  62. case 0:
  63. activeIndex1.value = 0;
  64. current.value = 'fireWork';
  65. menuList.forEach((el) => {
  66. el.type = 'on';
  67. });
  68. break;
  69. case 1:
  70. activeIndex1.value = 0;
  71. current.value = 'mainWell';
  72. menuList.forEach((el) => {
  73. el.type = 'out';
  74. });
  75. break;
  76. }
  77. }
  78. //菜单选项切换
  79. function cardClick(ind, item) {
  80. console.log(ind, 'index');
  81. activeIndex1.value = ind;
  82. switch (ind) {
  83. case 0:
  84. current.value = item.type == 'on' ? 'fireWork' : 'mainWell';
  85. break;
  86. case 1:
  87. current.value = item.type == 'on' ? 'closeWall' : 'subStation';
  88. break;
  89. case 2:
  90. current.value = item.type == 'on' ? 'otherMonitor' : 'otherOut';
  91. break;
  92. }
  93. }
  94. watch(
  95. () => props.moduleName,
  96. (val) => {
  97. if (val == 'fire') {
  98. titleName.value = '火灾监测';
  99. isShowModule.value = true;
  100. menuList = [
  101. { name: '综采工作面1', warn: '低风险', type: 'on' },
  102. { name: '密闭工作面1', warn: '低风险', type: 'on' },
  103. { name: '其他工作面1', warn: '低风险', type: 'on' },
  104. ];
  105. } else if (val == 'dust') {
  106. titleName.value = '粉尘监测';
  107. isShowModule.value = false;
  108. menuList = [{ name: '粉尘', warn: '低风险', type: 'on' }];
  109. current.value = 'dustPage';
  110. } else {
  111. titleName.value = '瓦斯监测';
  112. isShowModule.value = false;
  113. menuList = [{ name: '瓦斯', warn: '低风险', type: 'on' }];
  114. current.value = 'gasPage';
  115. }
  116. },
  117. {immediate:true}
  118. );
  119. onMounted(async () => {});
  120. onUnmounted(() => {});
  121. </script>
  122. <style scoped lang="less">
  123. @import '/@/design/vent/color.less';
  124. @import '/@/design/vent/modal.less';
  125. .alarm-modal {
  126. position: relative;
  127. z-index: 999;
  128. max-height: calc(100vh - 150px);
  129. .@{ventSpace}-tabs {
  130. max-height: calc(100vh - 100px);
  131. }
  132. .containers {
  133. width: 100%;
  134. height: calc(100vh - 159px);
  135. display: flex;
  136. justify-content: space-between;
  137. .alarm-menu {
  138. height: 100%;
  139. width: 262px;
  140. .type-btn {
  141. width: 192px;
  142. height: 28px;
  143. line-height: 28px;
  144. border: 1px solid #0058ee;
  145. margin-bottom: 20px;
  146. border-radius: 5px;
  147. box-sizing: border-box;
  148. display: flex;
  149. justify-content: space-between;
  150. .btn {
  151. width: 50%;
  152. height: 100%;
  153. font-size: 14px;
  154. text-align: center;
  155. color: #fff;
  156. cursor: pointer;
  157. }
  158. .btn1 {
  159. width: 50%;
  160. height: 100%;
  161. font-size: 14px;
  162. color: #fff;
  163. text-align: center;
  164. border-radius: 2px;
  165. background: #0058ee;
  166. cursor: pointer;
  167. }
  168. }
  169. .card-btn {
  170. width: 100%;
  171. height: calc(100% - 48px);
  172. overflow-y: auto;
  173. .btn {
  174. position: relative;
  175. width: 212px;
  176. height: 99px;
  177. margin-bottom: 30px;
  178. font-family: 'douyuFont';
  179. background: url('../../../../assets/images/fire/no-choice.png') no-repeat;
  180. background-size: 100% 100%;
  181. cursor: pointer;
  182. .text {
  183. width: 80%;
  184. position: absolute;
  185. left: 50%;
  186. top: 22px;
  187. font-size: 16px;
  188. color: #01fefc;
  189. text-align: center;
  190. transform: translate(-50%, 0);
  191. }
  192. .warn {
  193. width: 100%;
  194. position: absolute;
  195. left: 50%;
  196. top: 68px;
  197. font-size: 16px;
  198. color: #fff;
  199. text-align: center;
  200. transform: translate(-50%, 0);
  201. }
  202. }
  203. .btn1 {
  204. position: relative;
  205. width: 262px;
  206. height: 99px;
  207. margin-bottom: 30px;
  208. font-family: 'douyuFont';
  209. background: url('../../../../assets//images//fire/choice.png') no-repeat;
  210. background-size: 100% 100%;
  211. cursor: pointer;
  212. .text {
  213. width: 80%;
  214. position: absolute;
  215. left: 50%;
  216. top: 22px;
  217. font-size: 16px;
  218. color: #01fefc;
  219. text-align: center;
  220. transform: translate(-62%, 0);
  221. }
  222. .warn {
  223. width: 100%;
  224. position: absolute;
  225. left: 50%;
  226. top: 68px;
  227. font-size: 16px;
  228. color: #fff;
  229. text-align: center;
  230. transform: translate(-60%, 0);
  231. }
  232. }
  233. }
  234. }
  235. .alarm-content {
  236. width: calc(100% - 282px);
  237. height: 100%;
  238. margin-left: 20px;
  239. background: url('../../../../assets//images/fire/border.png') no-repeat;
  240. background-size: 100% 100%;
  241. // .toggle-btn {
  242. // position: absolute;
  243. // right: 10px;
  244. // top: -34px;
  245. // display: flex;
  246. // .btn-item {
  247. // width: 157px;
  248. // height: 36px;
  249. // line-height: 36px;
  250. // text-align: center;
  251. // color: #fff;
  252. // font-size: 14px;
  253. // cursor: pointer;
  254. // background: url('../../../../assets//images//fire/tab-2.png') no-repeat;
  255. // }
  256. // .btn-item1 {
  257. // width: 157px;
  258. // height: 36px;
  259. // line-height: 36px;
  260. // text-align: center;
  261. // color: #fff;
  262. // font-size: 14px;
  263. // cursor: pointer;
  264. // background: url('../../../../assets/images//fire/tab-1.png') no-repeat;
  265. // }
  266. // }
  267. }
  268. }
  269. }
  270. :deep(.@{ventSpace}-tabs-tabpane-active) {
  271. height: 100%;
  272. }
  273. :deep(.@{ventSpace}-tabs-card) {
  274. .@{ventSpace}-tabs-tab {
  275. background: linear-gradient(#2cd1ff55, #1eb0ff55);
  276. border-color: #74e9fe;
  277. border-radius: 0%;
  278. &:hover {
  279. color: #64d5ff;
  280. }
  281. }
  282. .@{ventSpace}-tabs-tab.@{ventSpace}-tabs-tab-active .@{ventSpace}-tabs-tab-btn {
  283. color: aqua;
  284. }
  285. .@{ventSpace}-tabs-nav::before {
  286. border-color: #74e9fe;
  287. }
  288. .@{ventSpace}-picker,
  289. .@{ventSpace}-select-selector {
  290. width: 100% !important;
  291. background: #00000017 !important;
  292. border: 1px solid @vent-form-item-boder !important;
  293. input,
  294. .@{ventSpace}-select-selection-item,
  295. .@{ventSpace}-picker-suffix {
  296. color: #fff !important;
  297. }
  298. .@{ventSpace}-select-selection-placeholder {
  299. color: #b7b7b7 !important;
  300. }
  301. }
  302. .@{ventSpace}-pagination-next,
  303. .action,
  304. .@{ventSpace}-select-arrow,
  305. .@{ventSpace}-picker-separator {
  306. color: #fff !important;
  307. }
  308. .@{ventSpace}-table-cell-row-hover {
  309. background: #264d8833 !important;
  310. }
  311. .@{ventSpace}-table-row-selected {
  312. background: #00c0a311 !important;
  313. td {
  314. background-color: #00000000 !important;
  315. }
  316. }
  317. .@{ventSpace}-table-thead {
  318. // background: linear-gradient(#004a8655 0%, #004a86aa 10%) !important;
  319. background: #3d9dd45d !important;
  320. & > tr > th,
  321. .@{ventSpace}-table-column-title {
  322. // color: #70f9fc !important;
  323. border-color: #84f2ff !important;
  324. border-left: none !important;
  325. border-right: none !important;
  326. padding: 7px;
  327. }
  328. }
  329. .@{ventSpace}-table-tbody {
  330. tr > td {
  331. padding: 12px;
  332. }
  333. }
  334. .@{ventSpace}-table-tbody > tr:hover.@{ventSpace}-table-row > td {
  335. background-color: #26648855 !important;
  336. }
  337. .jeecg-basic-table-row__striped {
  338. // background: #97efff11 !important;
  339. td {
  340. background-color: #97efff11 !important;
  341. }
  342. }
  343. }
  344. </style>