index.vue 12 KB

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