|
@@ -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) {
|