Browse Source

no message

libushang 6 months ago
parent
commit
a9697d9b79

+ 19 - 0
src/api/duty/eventing.ts

@@ -125,6 +125,25 @@ export function launchPlan(data) {
     data: data
   });
 }
+
+// 取消应急预案
+export function cancelPlan(data) {
+  return request({
+    url: '/api/event_management/event/cancel_emergency_plan',
+    method: 'post',
+    data: data
+  });
+}
+
+// 取消应急预案
+export function updatePlanResponseLevel(data) {
+  return request({
+    url: '/api/event_management/event/update_emergency_plan_response_level',
+    method: 'post',
+    data: data
+  });
+}
+
 // 获取预案单位任务
 export function unitTask(data) {
   return request({

+ 19 - 1
src/types/components.d.ts

@@ -21,6 +21,7 @@ declare module 'vue' {
     ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
     ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
     ElButton: typeof import('element-plus/es')['ElButton']
+    ElCard: typeof import('element-plus/es')['ElCard']
     ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
     ElCol: typeof import('element-plus/es')['ElCol']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
@@ -37,20 +38,34 @@ declare module 'vue' {
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
+    ElLink: typeof import('element-plus/es')['ElLink']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
+    ElPopover: typeof import('element-plus/es')['ElPopover']
+    ElRadio: typeof import('element-plus/es')['ElRadio']
+    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
+    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
+    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
     ElSlider: typeof import('element-plus/es')['ElSlider']
+    ElStep: typeof import('element-plus/es')['ElStep']
+    ElSteps: typeof import('element-plus/es')['ElSteps']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
+    ElTable: typeof import('element-plus/es')['ElTable']
+    ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
+    ElTabPane: typeof import('element-plus/es')['ElTabPane']
+    ElTabs: typeof import('element-plus/es')['ElTabs']
     ElText: typeof import('element-plus/es')['ElText']
     ElTimeline: typeof import('element-plus/es')['ElTimeline']
     ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
+    ElTooltip: typeof import('element-plus/es')['ElTooltip']
     ElTree: typeof import('element-plus/es')['ElTree']
+    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     FooterSection: typeof import('./../components/FooterSection/index.vue')['default']
@@ -61,6 +76,7 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
+    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']
@@ -94,7 +110,9 @@ declare module 'vue' {
     VideoContainer2: typeof import('./../components/HKVideo/video-container2.vue')['default']
     VideoTagEdit: typeof import('./../components/VideoTagEdit/index.vue')['default']
     YMap: typeof import('./../components/Map/YMap.vue')['default']
-    YMapold: typeof import('./../components/Map/YMapold.vue')['default']
     YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 4 - 3
src/views/emergencyCommandMap/RightSection/RightTop.vue

@@ -67,9 +67,9 @@ const activeTab = ref('任务跟踪');
 
 const setActiveTab = (id) => {
   activeTab.value = id;
-  //if(id === '预案通知' && notifications.value.length === 0) {
-  //  fetchData();
-  //}
+  if(id === '预案通知') {
+    fetchData();
+  }
 };
 
 // 定义 notifications
@@ -104,6 +104,7 @@ const updateTaskList = (tasks) => {
     date: task.sent_time,
     status: task.sent_status === 0 ? '暂未发送' : '已发送',
     content: task.yzy_content,
+    comment: task.comment,
     receiver: task.nick_name // 假设所有的任务都有接收者
   }));
   nextFetchData();

+ 51 - 4
src/views/emergencyCommandMap/RightSection/StartPlan.vue

@@ -12,11 +12,13 @@
         popper-class="custom-select-popper"
         :teleported="false"
         style="width: 1200px; margin-left: 30px"
+        @change="change_response_level"
       >
         <el-option v-for="level in responseLevels" :key="level.value" :label="level.name" :value="level.value"></el-option>
       </el-select>
-      <div class="common-btn-primary2" @click="onStartPlan">启动预案</div>
-      <div class="common-btn-primary2" @click="onTaskDelivery">预案任务下发</div>
+      <div class="common-btn-primary2" @click="onStartPlan" v-show="planId === ''">启动预案</div>
+      <div class="common-btn-primary2" @click="onCancelPlan" v-show="planId != ''">取消响应</div>
+      <div class="common-btn-primary2" @click="onTaskDelivery" v-show="planId === ''">预案任务下发</div>
     </div>
     <div class="title-box">{{ planTitle }}</div>
 
@@ -55,10 +57,14 @@
 import { ref, watch, defineProps, defineEmits, reactive } from 'vue';
 import { ElMessage } from 'element-plus';
 import TaskDelivery from './TaskDelivery.vue';
-import { matchingPlan, launchPlan, getPlanDoc } from '@/api/duty/eventing';
+import { matchingPlan, launchPlan, getPlanDoc, cancelPlan, updatePlanResponseLevel } from '@/api/duty/eventing';
+import { getEventDetail } from '@/api/duty/eventing';
 // 内部状态
+const planId = ref('');
 const planTitle = ref(''); // 预案名称
 const selectedLevel = ref(''); // 默认响应等级为空
+const response_level = ref('');
+
 // 定义组件接收的属性类型
 interface Props {
   show: boolean;
@@ -75,6 +81,11 @@ const responseLevels = [
   { value: '3', name: '较大(III级)' },
   { value: '4', name: '一般(IV级)' }
 ];
+
+const get_response_level_text = (val) => {
+    return responseLevels.find(item => item.value == val).name
+}
+
 const planData = reactive({
     //purpose: '',
     //basis: '',
@@ -119,6 +130,26 @@ const onClose = () => {
   emit('update:show', false);
 };
 
+const change_response_level = async() => {
+  if(planId.value != "") {
+    let confirm_msg = "";
+    if (parseInt(selectedLevel.value) < parseInt(response_level.value)) {
+      confirm_msg = "是否确认升级预案等级为" + get_response_level_text(selectedLevel.value);
+    }
+    else {
+      confirm_msg = "是否确认降级预案等级为" + get_response_level_text(selectedLevel.value);
+    }
+    ElMessageBox.confirm(confirm_msg, '系统提示', {
+      type: 'warning'
+    }).then((res) => {
+      updatePlanResponseLevel({eventId: props.eventId, response_level: selectedLevel.value, plan_id: planData.plan_id})
+      ElMessage.success("变更预案等级成功");
+      setTimeout(()=>{onClose()}, 1000);
+    })
+  }
+  console.log(selectedLevel.value);
+};
+
 // 处理启动预案的函数
 const onStartPlan = async () => {
   // 检查是否选择了响应等级
@@ -138,6 +169,7 @@ const onStartPlan = async () => {
     // 调用后端API启动预案
     const response = await launchPlan(data);
     if (response && response.code === 200) {
+      response_level.value = selectedLevel.value;
       ElMessage.success('预案启动成功!');
     } else if (response && response.code !== 200) {
       ElMessage.error(`预案启动失败,后端返回错误码:${response.code}`);
@@ -153,6 +185,17 @@ const onStartPlan = async () => {
     }
   }
 };
+
+const onCancelPlan = async() => {
+  ElMessageBox.confirm('是否取消响应?', '系统提示', {
+      type: 'warning'
+    }).then((res) => {
+      cancelPlan({eventId: props.eventId})
+      ElMessage.success("取消响应成功");
+      setTimeout(()=>{onClose()}, 1000);
+    })
+}
+
 // 处理标签页点击事件
 const onTabClick = (tab: any, event: Event) => {
   // 实现标签页点击的逻辑
@@ -217,8 +260,12 @@ const getPlanDocInfo = (plan_id) => {
 
 
 // 在组件挂载时尝试获取预案数据
-onMounted(() => {
+onMounted(async() => {
   if (props.eventId) {
+    const response = await getEventDetail({ event_id: props.eventId });
+    const event_data = response.data;
+    planId.value = event_data.plan_id;
+    
     fetchPlanData();
   }
 });

+ 1 - 1
src/views/emergencyCommandMap/RightSection/TaskDelivery.vue

@@ -1,5 +1,5 @@
 <template>
-  <Dialog v-model="dialogVisible" type="xl" :title="props.title" @close="closeDialog">
+  <Dialog :hide-title="false" v-model="dialogVisible" type="xl" :title="props.title" @close="closeDialog">
     <div class="content">
       <el-skeleton :loading="loading" animated>
         <template #template>

+ 4 - 4
src/views/emergencyCommandMap/RightSection/index.vue

@@ -122,10 +122,10 @@ const getEventIdFromUrl = () => {
 const startPlan = async () => {
   const response = await getEventDetail({ event_id: eventId.value });
   const event_data = response.data;
-  if (event_data.emergency_notify_count > 0) {
-    ElMessage.warning('预案已启动');
-    return;
-  }
+  //if (event_data.emergency_notify_count > 0) {
+  //  ElMessage.warning('预案已启动');
+  //  return;
+  //}
 
   if (event_data.del_flag === '0') {
     // 正式事件