123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- <template>
- <div class="right-section">
- <div class="task-header">
- <div class="task-item">
- <div class="icon">
- <div class="icon1"></div>
- </div>
- <div class="task-text gradient-text">任务下达</div>
- </div>
- <div class="task-item">
- <div class="icon">
- <div class="icon2"></div>
- </div>
- <div class="task-text gradient-text">粤政伊群聊</div>
- </div>
- <div class="task-item">
- <div class="icon">
- <div class="icon3"></div>
- </div>
- <div class="task-text gradient-text">通讯录</div>
- </div>
- <div class="task-item" @click="startPlan">
- <div class="icon">
- <div class="icon4"></div>
- </div>
- <div class="task-text gradient-text">启动预案</div>
- </div>
- <div class="task-item">
- <div class="icon">
- <div class="icon5"></div>
- </div>
- <div class="task-text gradient-text">知识库</div>
- </div>
- <div class="back-btn">
- <div class="btn-text">返回上级</div>
- </div>
- </div>
- <RightTop :event-id="eventId" />
- <JointDuty />
- </div>
- <StartPlan v-model="startPlanState.show" :title="startPlanState.title" :event-id="startPlanState.eventId" />
- <SelectPlan v-model="selectPlanState.show" :title="selectPlanState.title" :temp-event-id="tempEventId" @update-plan="updatePlan" />
- </template>
- <script lang="ts" setup>
- import { onMounted, ref, reactive, nextTick } from 'vue';
- import { useRouter, useRoute } from 'vue-router';
- import JointDuty from '@/views/emergencyCommandMap/RightSection/JointDuty.vue';
- import RightTop from '@/views/emergencyCommandMap/RightSection/RightTop.vue';
- import StartPlan from './StartPlan.vue';
- import SelectPlan from './SelectPlan.vue';
- let eventId = ref('');
- const route = useRoute();
- const router = useRouter();
- let tempEventId = ref<string | null>(null);
- // 启动预案弹窗
- const startPlanState = reactive({
- show: false,
- title: '',
- eventId: ''
- });
- // 控制 selectPlan 弹窗的显示状态
- const selectPlanState = reactive({
- show: false,
- title: '',
- tempEventId: '',
- plans: [] as { id: number; name: string }[]
- });
- // 更新 getEventIdFromUrl 方法
- const getEventIdFromUrl = () => {
- const urlParams = new URLSearchParams(useRoute().query);
- eventId.value = urlParams.get('event_id') || '';
- tempEventId.value = urlParams.get('tempEventId') || null;
- };
- // 更新 startPlan 方法
- const startPlan = () => {
- if (eventId.value) {
- startPlanState.title = '启动预案';
- startPlanState.eventId = eventId.value;
- startPlanState.show = true;
- console.log('Showing StartPlan with eventId:', eventId.value, 'and state:', startPlanState.show);
- nextTick().then(() => {
- console.log('DOM updated, showing StartPlan:', startPlanState.show);
- });
- } else if (tempEventId.value) {
- selectPlanState.title = '预案任务下发';
- selectPlanState.tempEventId = tempEventId.value;
- selectPlanState.show = true;
- console.log('Showing SelectPlan with state:', selectPlanState.show, 'and tempEventId:', tempEventId.value);
- loadPlans();
- }
- };
- const loadPlans = () => {
- // 这里应该有一个API调用来获取所有可用的预案
- // 仅作示例,下面的数组是假定的预案数据
- selectPlanState.plans = [
- { id: 1, name: '应急预案A' },
- { id: 2, name: '应急预案B' },
- { id: 3, name: '应急预案C' }
- ];
- };
- // 初始化数据
- const initData = () => {
- getEventIdFromUrl();
- console.log('Event ID from URL:', eventId.value); // 输出从 URL 获取的 eventId
- console.log('Temp Event ID from URL:', tempEventId.value); // 新增输出 tempEventId
- };
- // 监听路由变化
- onMounted(() => {
- initData();
- });
- onBeforeRouteUpdate((to, from) => {
- getEventIdFromUrl();
- console.log('Event ID from URL on route update:', eventId.value);
- console.log('Temp Event ID from URL on route update:', tempEventId.value);
- });
- // 每次依赖变化时获取 event_id 和 tempEventId
- watchEffect(() => {
- getEventIdFromUrl();
- console.log('Event ID from URL on dependency change:', eventId.value);
- console.log('Temp Event ID from URL on dependency change:', tempEventId.value);
- });
- const updatePlan = (data: { eventId: string }) => {
- console.log('Received event ID:', data);
- startPlanState.title = '启动预案';
- startPlanState.eventId = data.eventId;
- startPlanState.show = true;
- };
- </script>
- <style lang="scss" scoped>
- .right-section {
- width: 2668px;
- height: 100%;
- display: flex;
- flex-direction: column;
- font-size: 74px;
- padding-top: 57px;
- .task-header {
- display: flex;
- justify-content: space-around; /* 使按钮在div内均匀分布 */
- align-items: center; /* 使按钮垂直居中 */
- width: 100%;
- margin-bottom: 62px;
- .task-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- .icon {
- position: relative;
- width: 170px;
- height: 170px;
- //padding-left: 60px;
- }
- .icon1,
- .icon2,
- .icon3,
- .icon4,
- .icon5 {
- position: absolute;
- width: 224px;
- height: 238px;
- }
- .icon1 {
- background: url('@/assets/images/emergencyCommandMap/icon1.png') no-repeat 100% 100%;
- }
- .icon2 {
- background: url('@/assets/images/emergencyCommandMap/icon2.png') no-repeat 100% 100%;
- }
- .icon3 {
- background: url('@/assets/images/emergencyCommandMap/icon3.png') no-repeat 100% 100%;
- }
- .icon4 {
- background: url('@/assets/images/emergencyCommandMap/icon4.png') no-repeat 100% 100%;
- }
- .icon5 {
- background: url('@/assets/images/emergencyCommandMap/icon5.png') no-repeat 100% 100%;
- }
- .task-text gradient-text {
- font-size: 60px !important;
- }
- }
- .back-btn {
- width: 521px;
- height: 194px;
- line-height: 175px;
- padding-left: 175px;
- background: url('@/assets/images/emergencyCommandMap/backBtn.png') no-repeat 100% 100%;
- .btn-text {
- font-family: 'SourceHanSansCN';
- font-size: 48px;
- /* 设置字体透明 */
- color: transparent;
- /* 设置线性渐变,从红色渐变到蓝色 */
- background-image: linear-gradient(to right, #fff 40%, #b7ddfd 50%, #82c5fd 100%);
- /* 使用 -webkit-background-clip 属性将背景剪裁至文本形状 */
- -webkit-background-clip: text;
- /* 非Webkit内核浏览器需要使用标准前缀 */
- background-clip: text;
- /* 把当前元素设置为行内块,以便能够应用背景 */
- display: inline-block;
- }
- }
- }
- .video-card {
- width: 2601px;
- height: 879px;
- background: url('@/assets/images/emergencyCommandMap/videoBox1.png') no-repeat 100% 100%;
- position: relative;
- .video-list {
- display: flex;
- flex-wrap: wrap;
- padding-top: 100px;
- padding-left: 60px;
- .video-box {
- width: 600px;
- height: 356px;
- margin-right: 35.06px;
- cursor: pointer;
- background: url('@/assets/images/emergencyCommandMap/videoBg.png') no-repeat 100% 100%;
- padding: 14.5px 9px;
- &:nth-child(1),
- &:nth-child(2),
- &:nth-child(3),
- &:nth-child(4) {
- margin-bottom: 3.5px;
- }
- &:nth-child(4),
- &:nth-child(8) {
- margin-right: 0;
- }
- .video-content {
- width: 582px;
- height: 327px;
- background: url('@/assets/images/emergencyCommandMap/videoBox2.png') no-repeat 100% 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- position: relative;
- }
- .video-label {
- position: absolute;
- bottom: 0;
- right: 0;
- display: flex;
- .label {
- width: 410px;
- height: 50px;
- line-height: 50px;
- font-size: 32px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- padding-left: 10px;
- color: #fff;
- background-color: rgba(0, 0, 0, 0.4);
- }
- &::before {
- content: '';
- width: 0;
- height: 0;
- border-bottom: 50px solid rgba(0, 0, 0, 0.4);
- border-left: 50px solid transparent;
- }
- }
- }
- }
- }
- .message-card {
- width: 2668px;
- height: 884px;
- background: url('@/assets/images/emergencyCommandMap/messageBox.png') no-repeat 100% 100%;
- position: relative;
- padding-bottom: 40px;
- }
- .title {
- position: absolute;
- top: 6px;
- left: 141px;
- font-size: 60px;
- }
- .message-menu {
- display: flex;
- margin-top: 95px;
- margin-left: 50px;
- .menu-item {
- width: 349px;
- height: 118px;
- padding-left: 68px;
- line-height: 145px;
- background: url('@/assets/images/emergencyCommandMap/tab.png');
- opacity: 0.7;
- font-size: 44px;
- color: #fff;
- font-family: 'YouSheBiaoTiHei';
- cursor: pointer;
- margin-left: -40px;
- &:first-child {
- margin-left: 0;
- }
- &:hover {
- width: 349px;
- height: 122px;
- background: url('@/assets/images/emergencyCommandMap/tabActive.png');
- opacity: 1;
- }
- }
- .menu-active {
- width: 349px;
- height: 122px;
- background: url('@/assets/images/emergencyCommandMap/tabActive.png');
- opacity: 1;
- }
- }
- .message-content {
- margin-left: 155px;
- overflow: auto;
- height: 625px;
- .message-item {
- display: flex;
- align-items: center;
- margin-top: 11.5px;
- .message-success {
- width: 115px;
- height: 114px;
- background: url('@/assets/images/emergencyCommandMap/message_success.png') no-repeat;
- }
- .message-primary {
- width: 115px;
- height: 114px;
- background: url('@/assets/images/emergencyCommandMap/message_primary.png') no-repeat;
- }
- .message-warning {
- width: 115px;
- height: 114px;
- background: url('@/assets/images/emergencyCommandMap/message_warning.png') no-repeat;
- }
- .message-danger {
- width: 111px;
- height: 112px;
- background: url('@/assets/images/emergencyCommandMap/message_danger.png') no-repeat;
- }
- .message-box {
- width: 2136px;
- min-height: 114px;
- background: url('@/assets/images/emergencyCommandMap/messagBox2.png') no-repeat;
- margin-left: -30px;
- color: #fff;
- font-size: 38px;
- font-family: 'PingFang SC', sans-serif;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 320px 0 78px;
- .tag-success {
- border-radius: 15px;
- background: #104f72;
- padding: 10px 15px;
- }
- .tag-primary {
- border-radius: 15px;
- background: #0c3d90;
- padding: 10px 15px;
- }
- .tag-warning {
- border-radius: 15px;
- background: #3a495c;
- padding: 10px 15px;
- }
- .tag-danger {
- border-radius: 15px;
- background: #3b2d65;
- padding: 10px 20px;
- }
- .message-time {
- color: #00e8ff;
- font-family: 'BEBAS-1';
- font-size: 32px;
- }
- }
- }
- }
- }
- .card {
- width: 100%;
- background-color: #ffffff;
- border-radius: 26px;
- padding: 46px 69px;
- margin-bottom: 69px;
- animation-name: slide;
- .header-container {
- width: 100%;
- display: flex;
- //justify-content: space-between;
- align-items: center;
- padding: 10px;
- }
- .custom-button {
- width: 100px;
- height: 80px;
- font-size: 14px;
- }
- .card-header {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- &:last-child {
- margin-bottom: 0;
- }
- &:nth-child(1) {
- animation-duration: 0.5s;
- }
- &:nth-child(2) {
- height: 667.5px;
- animation-duration: 1s;
- }
- &:nth-child(3) {
- height: 667.5px;
- animation-duration: 1.5s;
- }
- }
- @keyframes slide {
- 0% {
- transform: translateX(100%);
- }
- 80% {
- transform: translateX(-92px);
- }
- 100% {
- transform: translateX(0);
- }
- }
- .more {
- color: #1890ff;
- cursor: pointer;
- }
- </style>
|