瀏覽代碼

no message

libushang 8 月之前
父節點
當前提交
b0770b1e06

+ 11 - 1
src/api/duty/eventing.ts

@@ -126,6 +126,16 @@ export function unitTask(data) {
     data: data
   });
 }
+
+// 获取结构化文档
+export const getPlanDoc = (data) => {
+  return request({
+    url: '/api/emergency_plan/doc/detail',
+    method: 'post',
+    data: data
+  });
+}
+
 // 预案任务下发
 export function sendTask(data) {
   return request({
@@ -141,4 +151,4 @@ export function taskList(data) {
     method: 'post',
     data: data
   });
-}
+}

+ 2 - 2
src/api/emergencyCommandMap/JointDuty.ts

@@ -39,7 +39,7 @@ export function getCheckinList(eventId: string) {
 }
 
 // 更新事发地点 (用于将表单数据发送到服务器以更新某个事件的位置信息)
-export function updateEventLocation(evevtId: string, address: string, longitude: string, latitude: string) {
+export function updateEventLocation(eventId: string, address: string, longitude: string, latitude: string) {
   return request({
     url: '/api/event_management/event/save_address',
     method: 'post',
@@ -74,7 +74,7 @@ export function selectTask(data) {
     url: '/api/taskRegistration/select',
     method: 'post',
     params: {
-      query: addTask.data
+      query: data
     },
     data: data
   });

+ 4 - 0
src/views/emergencyCommandMap/LeftSection/index.vue

@@ -104,6 +104,10 @@ import { ref, onMounted, onUnmounted, computed } from 'vue';
 import Communication from './Communication.vue';
 import CloseCommand from './CloseCommand.vue';
 
+const proxy = getCurrentInstance()?.proxy;
+const { mm_event_type, mm_event_level, mm_event_state, region } = toRefs<any>(
+  proxy?.useDict('mm_event_type', 'mm_event_level', 'mm_event_state', 'region')
+);
 const route = useRoute();
 const router = useRouter();
 

+ 35 - 28
src/views/emergencyCommandMap/RightSection/JointDuty.vue

@@ -13,12 +13,11 @@
         </div>
         <div class="table-content">
           <div v-for="(item, index) in listData" :key="index" class="tr">
-            <div class="td">{{ item.data1 }}</div>
+            <div class="td">{{ item.dept_name }}</div>
             <div class="td">
-              <div>{{ item.data2 }}</div>
-              <div>{{ item.data4 }}</div>
+              <div>{{ item.nick_name }}({{ item.duties }})</div>
             </div>
-            <div class="td text">{{ item.data3 }}</div>
+            <div class="td text">{{ item.phone }}</div>
             <div class="td2">
               <div class="phone-btn"></div>
             </div>
@@ -41,15 +40,15 @@ const route = useRoute();
 const tableHeader = reactive([
   {
     name: '值守单位',
-    key: 'data1'
+    key: 'dept_name'
   },
   {
     name: '值守人员',
-    key: 'data2'
+    key: 'nick_name'
   },
   {
     name: '联系方式',
-    key: 'data3'
+    key: 'phone'
   }
 ]);
 const listData = ref([]);
@@ -62,41 +61,49 @@ const handleShowQrCode = () => {
 
 onMounted(() => {
   eventId.value = route.query.event_id as string;
+  /*
   listData.value = [
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     },
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     },
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     },
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     },
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     },
     {
-      data1: '市应急局',
-      data2: '张平安',
-      data3: '13856642378'
+      dept_name: '市应急局',
+      nick_name: '张平安',
+      phone: '13856642378',
+      duties: '职务'
     }
   ];
-  // getCheckinList(eventId.value).then((res) => {
-  //   listData.value = res.data;
-  // });
+  */
+  getCheckinList(eventId.value).then((res) => {
+     listData.value = res.data;
+  });
   qrCodeUrl.value = import.meta.env.VITE_APP_BASE_API + '/api/event_management/checkin/qrcode?event_id=' + eventId.value;
 });
 </script>

+ 44 - 25
src/views/emergencyCommandMap/RightSection/StartPlan.vue

@@ -12,29 +12,34 @@
       <div class="btn" @click="onTaskDelivery">预案任务下发</div>
     </div>
     <div class="title-box">{{ planTitle }}</div>
+
     <div class="plan-content">
       <!-- 预案内容的标签页 -->
       <div class="tabs">
-        <div v-for="(item, index) in tabs" :key="index" :class="index === activeTab ? 'tab tabActive' : 'tab'" @click="handleClickTab(index)">{{ item.label }}</div>
+        <div v-for="(item, index) in tabs" :key="index" :class="index === activeTab ? 'tab tabActive' : 'tab'" @click="handleClickTab(index)">{{ item.title }}</div>
       </div>
       <div class="tab-content">
         <div class="tabs2">
           <div
-            v-for="(item, index) in tabs[activeTab]?.children"
+            v-for="(item, index) in tabs[activeTab]?.items"
             :key="index"
             :class="index === activeTab2 ? 'tab tab-active2' : 'tab'"
             @click="handleClickTab2(index)"
           >
-            <div class="text">{{ item.label }}</div>
+            <div class="text">{{ item.title }}</div>
           </div>
         </div>
+        <div class="tab-content2" v-html="tabs[activeTab].items[activeTab2].value" v-if="tabs[activeTab] && tabs[activeTab].items && tabs[activeTab].items[activeTab2]"></div>
+        <!--
         <div class="tab-content2">
           {{
-            tabs[activeTab] && tabs[activeTab].children && tabs[activeTab].children[activeTab2] ? tabs[activeTab].children[activeTab2].content : ''
+            tabs[activeTab] && tabs[activeTab].items && tabs[activeTab].items[activeTab2] ? tabs[activeTab].items[activeTab2].value : ''
           }}
         </div>
+        -->
       </div>
     </div>
+
     <TaskDelivery v-model="taskDeliveryState.show" :title="taskDeliveryState.title" :planId="planData.plan_id" :eventId="props.eventId" />
   </div>
 </template>
@@ -43,7 +48,7 @@
 import { ref, watch, defineProps, defineEmits, reactive } from 'vue';
 import { ElMessage } from 'element-plus';
 import TaskDelivery from './TaskDelivery.vue';
-import { matchingPlan, launchPlan } from '@/api/duty/eventing';
+import { matchingPlan, launchPlan, getPlanDoc } from '@/api/duty/eventing';
 // 内部状态
 const planTitle = ref(''); // 预案名称
 const selectedLevel = ref(''); // 默认响应等级为空
@@ -64,29 +69,30 @@ const responseLevels = [
   { value: '4', name: '一般(IV级)' }
 ];
 const planData = reactive({
-    purpose: '',
-    basis: '',
-    scope: '',
-    principles: '',
+    //purpose: '',
+    //basis: '',
+    //scope: '',
+    //principles: '',
     plan_id: ''
 });
 
-let plan_id = '';
+// let plan_id = '';
 const tabs = ref([
   {
-    label: '总则',
-    children: [
-      { label: '编制目的', content: '编制目的内容' },
-      { label: '编制依据', content: '编制依据内容' },
-      { label: '适用范围', content: '适用范围内容' },
-      { label: '工作原则', content: '工作原则内容' }
+    title: '总则',
+    value: '',
+    items: [
+      { title: '编制目的', value: '编制目的内容' },
+      { title: '编制依据', value: '编制依据内容' },
+      { title: '适用范围', value: '适用范围内容' },
+      { title: '工作原则', value: '工作原则内容' }
     ]
   },
-  { label: '组织体系', children: [] },
-  { label: '运行机制', children: [] },
-  { label: '应急保障', children: [] },
-  { label: '附则', children: [] },
-  { label: '附件', children: [] }
+  { title: '组织体系', items: [] },
+  { title: '运行机制', items: [] },
+  { title: '应急保障', items: [] },
+  { title: '附则', items: [] },
+  { title: '附件', items: [] }
 ]);
 const activeTab = ref(0); // 当前激活的标签页
 const activeTab2 = ref(0); // 当前激活的标签页
@@ -179,19 +185,32 @@ const fetchPlanData = async () => {
       } else {
         selectedLevel.value = '';
       }
-      planData.purpose = data.purpose || '这是内容...';
-      planData.basis = data.basis || '这是内容...';
-      planData.scope = data.scope || '这是内容...';
-      planData.principles = data.principles || '这是内容...';
+      //planData.purpose = data.purpose || '这是内容...';
+      //planData.basis = data.basis || '这是内容...';
+      //planData.scope = data.scope || '这是内容...';
+      //planData.principles = data.principles || '这是内容...';
       planData.plan_id = data.plan_id; // 确保 planData 中包含 plan_id
+
+      getPlanDocInfo(planData.plan_id);
+
     } else {
       ElMessage.error('未能从服务器获取有效的预案数据');
     }
   } catch (error) {
+    console.log('error:', error);
     ElMessage.error('获取预案数据失败');
   }
 };
 
+const getPlanDocInfo = (plan_id) => {
+  getPlanDoc({plan_id: plan_id}).then((res)=> {
+    if(res.code === 200) {
+      tabs.value = res.data;
+    }
+  });
+}
+  
+
 // 在组件挂载时尝试获取预案数据
 onMounted(() => {
   if (props.eventId) {

+ 16 - 12
src/views/emergencyCommandMap/index.vue

@@ -23,20 +23,24 @@ const containerRef = ref();
 let scale = ref({ scaleX: 1, scaleY: 1 });
 provide('containerScale', () => scale.value);
 onMounted(() => {
-  autofit.init(
-    {
-      dw: 8960,
-      dh: 2520,
-      el: '#dashboard-container',
-      resize: false,
-      ignore: ['#aMap', '#YztMap']
-    },
-    false
-  );
-  scale.value = getTransformScale(containerRef.value);
+  if ( location.hostname != 'localhost___') {
+    autofit.init(
+      {
+        dw: 8960,
+        dh: 2520,
+        el: '#dashboard-container',
+        resize: false,
+        ignore: ['#aMap', '#YztMap']
+      },
+      false
+    );
+    scale.value = getTransformScale(containerRef.value);
+  }
 });
 onUnmounted(() => {
-  autofit.off();
+  if ( location.hostname === 'localhost___') {
+    autofit.off();
+  }
 });
 </script>
 

+ 16 - 12
src/views/routineCommandMap/index.vue

@@ -23,21 +23,25 @@ const containerRef = ref();
 let scale = ref({ scaleX: 1, scaleY: 1 });
 provide('containerScale', () => scale.value);
 onMounted(() => {
-  const a = autofit.init(
-    {
-      dw: 8960,
-      dh: 2520,
-      el: '#dashboard-container',
-      resize: false,
-      ignore: ['#aMap', '#YztMap', '#positionMap']
-    },
-    false
-  );
-  scale.value = getTransformScale(containerRef.value);
+  if ( location.hostname != 'localhost___') {
+    const a = autofit.init(
+      {
+        dw: 8960,
+        dh: 2520,
+        el: '#dashboard-container',
+        resize: false,
+        ignore: ['#aMap', '#YztMap', '#positionMap']
+      },
+      false
+    );
+    scale.value = getTransformScale(containerRef.value);
+  }
 });
 
 onUnmounted(() => {
-  autofit.off();
+  if ( location.hostname != 'localhost___') {
+    autofit.off();
+  }
 });
 </script>