index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451
  1. <template>
  2. <div class="right-section">
  3. <div class="task-header">
  4. <div class="task-item">
  5. <div class="icon">
  6. <div class="icon1"></div>
  7. </div>
  8. <div class="task-text gradient-text">任务下达</div>
  9. </div>
  10. <div class="task-item">
  11. <div class="icon">
  12. <div class="icon2"></div>
  13. </div>
  14. <div class="task-text gradient-text">粤政伊群聊</div>
  15. </div>
  16. <div class="task-item">
  17. <div class="icon">
  18. <div class="icon3"></div>
  19. </div>
  20. <div class="task-text gradient-text">通讯录</div>
  21. </div>
  22. <div class="task-item" @click="startPlan">
  23. <div class="icon">
  24. <div class="icon4"></div>
  25. </div>
  26. <div class="task-text gradient-text">启动预案</div>
  27. </div>
  28. <div class="task-item">
  29. <div class="icon">
  30. <div class="icon5"></div>
  31. </div>
  32. <div class="task-text gradient-text">知识库</div>
  33. </div>
  34. <div class="back-btn">
  35. <div class="btn-text">返回上级</div>
  36. </div>
  37. </div>
  38. <RightTop :event-id="eventId" />
  39. <JointDuty />
  40. </div>
  41. <StartPlan v-model="startPlanState.show" :title="startPlanState.title" :event-id="eventId" />
  42. <SelectPlan v-model="selectPlanState.show" :title="selectPlanState.title" />
  43. </template>
  44. <script lang="ts" setup>
  45. import { onMounted, ref, reactive, nextTick } from 'vue';
  46. import { useRouter, useRoute } from 'vue-router';
  47. import JointDuty from '@/views/emergencyCommandMap/RightSection/JointDuty.vue';
  48. import RightTop from '@/views/emergencyCommandMap/RightSection/RightTop.vue';
  49. import StartPlan from './StartPlan.vue';
  50. import SelectPlan from './SelectPlan.vue';
  51. let eventId = ref('');
  52. const route = useRoute();
  53. const router = useRouter();
  54. // 启动预案弹窗
  55. const startPlanState = reactive({
  56. show: false,
  57. title: '',
  58. eventId: ''
  59. });
  60. // 控制 selectPlan 弹窗的显示状态
  61. const selectPlanState = reactive({
  62. show: false,
  63. title: '',
  64. plans: [] as { id: number; name: string }[]
  65. });
  66. // 从URL中获取event_id
  67. const getEventIdFromUrl = () => {
  68. const urlParams = new URLSearchParams(route.query);
  69. eventId.value = urlParams.get('event_id') || '';
  70. };
  71. // 启动预案的方法
  72. const startPlan = () => {
  73. console.log('Checking eventId:', eventId.value); // 输出 eventId
  74. if (eventId.value) {
  75. // 如果有eventId,则显示StartPlan弹窗,并传递eventId
  76. startPlanState.title = '启动预案';
  77. startPlanState.eventId = eventId.value;
  78. startPlanState.show = true;
  79. console.log('Showing StartPlan with eventId:', eventId.value, 'and state:', startPlanState.show);
  80. // 使用 nextTick 确保 DOM 更新完成
  81. nextTick().then(() => {
  82. console.log('DOM updated, showing StartPlan:', startPlanState.show);
  83. });
  84. } else {
  85. // 如果没有eventId,则显示SelectPlan弹窗
  86. selectPlanState.title = '预案任务下发';
  87. selectPlanState.show = true;
  88. console.log('Showing SelectPlan with state:', selectPlanState.show);
  89. // 可选操作:加载预案列表
  90. loadPlans();
  91. }
  92. };
  93. const loadPlans = () => {
  94. // 这里应该有一个API调用来获取所有可用的预案
  95. // 仅作示例,下面的数组是假定的预案数据
  96. selectPlanState.plans = [
  97. { id: 1, name: '应急预案A' },
  98. { id: 2, name: '应急预案B' },
  99. { id: 3, name: '应急预案C' }
  100. ];
  101. };
  102. // 初始化数据
  103. const initData = () => {
  104. getEventIdFromUrl();
  105. console.log('Event ID from URL:', eventId.value); // 输出从 URL 获取的 eventId
  106. };
  107. onMounted(() => {
  108. initData();
  109. });
  110. onBeforeRouteUpdate((to, from) => {
  111. getEventIdFromUrl(); // 当路由更新时重新获取 event_id
  112. console.log('Event ID from URL on route update:', eventId.value);
  113. });
  114. watchEffect(() => {
  115. getEventIdFromUrl(); // 每次依赖变化时获取 event_id
  116. console.log('Event ID from URL on dependency change:', eventId.value);
  117. });
  118. </script>
  119. <style lang="scss" scoped>
  120. .right-section {
  121. width: 2668px;
  122. height: 100%;
  123. display: flex;
  124. flex-direction: column;
  125. font-size: 74px;
  126. padding-top: 57px;
  127. .task-header {
  128. display: flex;
  129. justify-content: space-around; /* 使按钮在div内均匀分布 */
  130. align-items: center; /* 使按钮垂直居中 */
  131. width: 100%;
  132. margin-bottom: 62px;
  133. .task-item {
  134. display: flex;
  135. flex-direction: column;
  136. justify-content: center;
  137. align-items: center;
  138. .icon {
  139. position: relative;
  140. width: 170px;
  141. height: 170px;
  142. //padding-left: 60px;
  143. }
  144. .icon1,
  145. .icon2,
  146. .icon3,
  147. .icon4,
  148. .icon5 {
  149. position: absolute;
  150. width: 224px;
  151. height: 238px;
  152. }
  153. .icon1 {
  154. background: url('@/assets/images/emergencyCommandMap/icon1.png') no-repeat 100% 100%;
  155. }
  156. .icon2 {
  157. background: url('@/assets/images/emergencyCommandMap/icon2.png') no-repeat 100% 100%;
  158. }
  159. .icon3 {
  160. background: url('@/assets/images/emergencyCommandMap/icon3.png') no-repeat 100% 100%;
  161. }
  162. .icon4 {
  163. background: url('@/assets/images/emergencyCommandMap/icon4.png') no-repeat 100% 100%;
  164. }
  165. .icon5 {
  166. background: url('@/assets/images/emergencyCommandMap/icon5.png') no-repeat 100% 100%;
  167. }
  168. .task-text gradient-text {
  169. font-size: 60px !important;
  170. }
  171. }
  172. .back-btn {
  173. width: 521px;
  174. height: 194px;
  175. line-height: 175px;
  176. padding-left: 175px;
  177. background: url('@/assets/images/emergencyCommandMap/backBtn.png') no-repeat 100% 100%;
  178. .btn-text {
  179. font-family: 'SourceHanSansCN';
  180. font-size: 48px;
  181. /* 设置字体透明 */
  182. color: transparent;
  183. /* 设置线性渐变,从红色渐变到蓝色 */
  184. background-image: linear-gradient(to right, #fff 40%, #b7ddfd 50%, #82c5fd 100%);
  185. /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
  186. -webkit-background-clip: text;
  187. /* 非Webkit内核浏览器需要使用标准前缀 */
  188. background-clip: text;
  189. /* 把当前元素设置为行内块,以便能够应用背景 */
  190. display: inline-block;
  191. }
  192. }
  193. }
  194. .video-card {
  195. width: 2601px;
  196. height: 879px;
  197. background: url('@/assets/images/emergencyCommandMap/videoBox1.png') no-repeat 100% 100%;
  198. position: relative;
  199. .video-list {
  200. display: flex;
  201. flex-wrap: wrap;
  202. padding-top: 100px;
  203. padding-left: 60px;
  204. .video-box {
  205. width: 600px;
  206. height: 356px;
  207. margin-right: 35.06px;
  208. cursor: pointer;
  209. background: url('@/assets/images/emergencyCommandMap/videoBg.png') no-repeat 100% 100%;
  210. padding: 14.5px 9px;
  211. &:nth-child(1),
  212. &:nth-child(2),
  213. &:nth-child(3),
  214. &:nth-child(4) {
  215. margin-bottom: 3.5px;
  216. }
  217. &:nth-child(4),
  218. &:nth-child(8) {
  219. margin-right: 0;
  220. }
  221. .video-content {
  222. width: 582px;
  223. height: 327px;
  224. background: url('@/assets/images/emergencyCommandMap/videoBox2.png') no-repeat 100% 100%;
  225. display: flex;
  226. justify-content: center;
  227. align-items: center;
  228. position: relative;
  229. }
  230. .video-label {
  231. position: absolute;
  232. bottom: 0;
  233. right: 0;
  234. display: flex;
  235. .label {
  236. width: 410px;
  237. height: 50px;
  238. line-height: 50px;
  239. font-size: 32px;
  240. white-space: nowrap;
  241. overflow: hidden;
  242. text-overflow: ellipsis;
  243. padding-left: 10px;
  244. color: #fff;
  245. background-color: rgba(0, 0, 0, 0.4);
  246. }
  247. &::before {
  248. content: '';
  249. width: 0;
  250. height: 0;
  251. border-bottom: 50px solid rgba(0, 0, 0, 0.4);
  252. border-left: 50px solid transparent;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. .message-card {
  259. width: 2668px;
  260. height: 884px;
  261. background: url('@/assets/images/emergencyCommandMap/messageBox.png') no-repeat 100% 100%;
  262. position: relative;
  263. padding-bottom: 40px;
  264. }
  265. .title {
  266. position: absolute;
  267. top: 6px;
  268. left: 141px;
  269. font-size: 60px;
  270. }
  271. .message-menu {
  272. display: flex;
  273. margin-top: 95px;
  274. margin-left: 50px;
  275. .menu-item {
  276. width: 349px;
  277. height: 118px;
  278. padding-left: 68px;
  279. line-height: 145px;
  280. background: url('@/assets/images/emergencyCommandMap/tab.png');
  281. opacity: 0.7;
  282. font-size: 44px;
  283. color: #fff;
  284. font-family: 'YouSheBiaoTiHei';
  285. cursor: pointer;
  286. margin-left: -40px;
  287. &:first-child {
  288. margin-left: 0;
  289. }
  290. &:hover {
  291. width: 349px;
  292. height: 122px;
  293. background: url('@/assets/images/emergencyCommandMap/tabActive.png');
  294. opacity: 1;
  295. }
  296. }
  297. .menu-active {
  298. width: 349px;
  299. height: 122px;
  300. background: url('@/assets/images/emergencyCommandMap/tabActive.png');
  301. opacity: 1;
  302. }
  303. }
  304. .message-content {
  305. margin-left: 155px;
  306. overflow: auto;
  307. height: 625px;
  308. .message-item {
  309. display: flex;
  310. align-items: center;
  311. margin-top: 11.5px;
  312. .message-success {
  313. width: 115px;
  314. height: 114px;
  315. background: url('@/assets/images/emergencyCommandMap/message_success.png') no-repeat;
  316. }
  317. .message-primary {
  318. width: 115px;
  319. height: 114px;
  320. background: url('@/assets/images/emergencyCommandMap/message_primary.png') no-repeat;
  321. }
  322. .message-warning {
  323. width: 115px;
  324. height: 114px;
  325. background: url('@/assets/images/emergencyCommandMap/message_warning.png') no-repeat;
  326. }
  327. .message-danger {
  328. width: 111px;
  329. height: 112px;
  330. background: url('@/assets/images/emergencyCommandMap/message_danger.png') no-repeat;
  331. }
  332. .message-box {
  333. width: 2136px;
  334. min-height: 114px;
  335. background: url('@/assets/images/emergencyCommandMap/messagBox2.png') no-repeat;
  336. margin-left: -30px;
  337. color: #fff;
  338. font-size: 38px;
  339. font-family: 'PingFang SC', sans-serif;
  340. display: flex;
  341. justify-content: space-between;
  342. align-items: center;
  343. padding: 0 320px 0 78px;
  344. .tag-success {
  345. border-radius: 15px;
  346. background: #104f72;
  347. padding: 10px 15px;
  348. }
  349. .tag-primary {
  350. border-radius: 15px;
  351. background: #0c3d90;
  352. padding: 10px 15px;
  353. }
  354. .tag-warning {
  355. border-radius: 15px;
  356. background: #3a495c;
  357. padding: 10px 15px;
  358. }
  359. .tag-danger {
  360. border-radius: 15px;
  361. background: #3b2d65;
  362. padding: 10px 20px;
  363. }
  364. .message-time {
  365. color: #00e8ff;
  366. font-family: 'BEBAS-1';
  367. font-size: 32px;
  368. }
  369. }
  370. }
  371. }
  372. }
  373. .card {
  374. width: 100%;
  375. background-color: #ffffff;
  376. border-radius: 26px;
  377. padding: 46px 69px;
  378. margin-bottom: 69px;
  379. animation-name: slide;
  380. .header-container {
  381. width: 100%;
  382. display: flex;
  383. //justify-content: space-between;
  384. align-items: center;
  385. padding: 10px;
  386. }
  387. .custom-button {
  388. width: 100px;
  389. height: 80px;
  390. font-size: 14px;
  391. }
  392. .card-header {
  393. width: 100%;
  394. display: flex;
  395. justify-content: space-between;
  396. align-items: center;
  397. }
  398. &:last-child {
  399. margin-bottom: 0;
  400. }
  401. &:nth-child(1) {
  402. animation-duration: 0.5s;
  403. }
  404. &:nth-child(2) {
  405. height: 667.5px;
  406. animation-duration: 1s;
  407. }
  408. &:nth-child(3) {
  409. height: 667.5px;
  410. animation-duration: 1.5s;
  411. }
  412. }
  413. @keyframes slide {
  414. 0% {
  415. transform: translateX(100%);
  416. }
  417. 80% {
  418. transform: translateX(-92px);
  419. }
  420. 100% {
  421. transform: translateX(0);
  422. }
  423. }
  424. .more {
  425. color: #1890ff;
  426. cursor: pointer;
  427. }
  428. </style>