|
@@ -1,40 +1,133 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div v-if="drillData" class="drill-plan-detail">
|
|
<div v-if="drillData" class="drill-plan-detail">
|
|
|
- <div>
|
|
|
|
|
- <div class="name">演练活动</div>
|
|
|
|
|
- <div class="data">
|
|
|
|
|
- <div v-for="item in DRILL_VIEW_CONTENT" :key="item.value" class="item">
|
|
|
|
|
- <span class="label">{{ item.label }}</span>
|
|
|
|
|
- <a v-if="item.link" class="link" :href="item.link">{{ drillData![item.value] }}</a>
|
|
|
|
|
- <span v-else class="value"> {{ drillData![item.value] }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="drill-activity-container">
|
|
|
|
|
+ <div class="drill-container__title">
|
|
|
|
|
+ <div class="drill-container--line"></div>
|
|
|
|
|
+ <span>演练活动</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="drill-container__content">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">演练规模:</span>
|
|
|
|
|
+ <span class="value">{{ getDrillScope(drillData.drillScope) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">演练内容:</span>
|
|
|
|
|
+ <span class="value">{{ drillData.drillContent }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">计划完成时间:</span>
|
|
|
|
|
+ <span class="value">{{ drillData.dueCompleteTime }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">责任部门:</span>
|
|
|
|
|
+ <template v-for="(dept, index) in safatyJsonParse(drillData.responsibleDeptNameList)" :key="index">
|
|
|
|
|
+ <span class="value">
|
|
|
|
|
+ {{ dept }}
|
|
|
|
|
+ <span v-if="index !== safatyJsonParse(drillData.responsibleDeptNameList).length - 1">、</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item" v-if="drillData.coordinateDeptNameList">
|
|
|
|
|
+ <span class="label">配合部门:</span>
|
|
|
|
|
+ <template v-for="(dept, index) in safatyJsonParse(drillData.coordinateDeptNameList)" :key="index">
|
|
|
|
|
+ <span class="value">
|
|
|
|
|
+ {{ dept }}
|
|
|
|
|
+ <span v-if="index !== safatyJsonParse(drillData.coordinateDeptNameList).length - 1">、</span>
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">关联应急预案:</span>
|
|
|
|
|
+ <a v-if="emergencyPlanDetail" class="value font-primary" :href="emergencyPlanDetail.appendix">{{
|
|
|
|
|
+ emergencyPlanDetail.planName
|
|
|
|
|
+ }}</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col>
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">审批流程:</span>
|
|
|
|
|
+ <span class="value">{{ getApprovalName(drillData.approvalTemplateId) }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div>
|
|
|
|
|
- <div class="name">演练实施</div>
|
|
|
|
|
- <div class="data">
|
|
|
|
|
- <div v-for="item in DRILL_VIEW_EXECUTE" :key="item.value" class="item">
|
|
|
|
|
- <span class="label">{{ item.label }}</span>
|
|
|
|
|
- <el-popover v-if="item.popover" placement="bottom" trigger="hover" width="224">
|
|
|
|
|
- <template #reference>
|
|
|
|
|
- <span style="cursor: pointer">查看签到码</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- <QrCode :value="drillData![item.popover]" :width="200" />
|
|
|
|
|
- </el-popover>
|
|
|
|
|
- <a v-else-if="item.link" class="link" :href="drillData![item.link]">{{ drillData![item.value] }}</a>
|
|
|
|
|
- <span v-else class="value"> {{ drillData![item.value] }}</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="drill-activity-container">
|
|
|
|
|
+ <div class="drill-container__title">
|
|
|
|
|
+ <div class="drill-container--line"></div>
|
|
|
|
|
+ <span>演练实施</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="drill-container__content">
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">演练时间:</span>
|
|
|
|
|
+ <span class="value">{{ drillData.drillTime }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">演练地点:</span>
|
|
|
|
|
+ <span class="value">{{ drillData.drillLocation }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">演练负责人:</span>
|
|
|
|
|
+ <span class="value">{{ drillData.personInChargeName }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
|
|
+ <el-row :gutter="20">
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item" v-if="drillData.drillScript">
|
|
|
|
|
+ <span class="label">演练脚本:</span>
|
|
|
|
|
+ <span class="value font-primary link" @click="handlePreviewScript(drillData.drillScript)">{{
|
|
|
|
|
+ JSON.parse(drillData.drillScript).fileName
|
|
|
|
|
+ }}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <div class="drill-container__content--item">
|
|
|
|
|
+ <span class="label">签到码:</span>
|
|
|
|
|
+ <el-popover placement="bottom" trigger="hover" width="224">
|
|
|
|
|
+ <template #reference>
|
|
|
|
|
+ <span style="cursor: pointer">查看签到码</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <QrCode :value="qrCode" :width="200" />
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+ </el-row>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div>
|
|
|
|
|
- <div class="name">演练参与部门</div>
|
|
|
|
|
- <el-button style="margin-top: 20px" type="primary" :icon="Download" @click=""> 下载签到名单 </el-button>
|
|
|
|
|
- <BasicTable style="margin-top: 20px" :tableConfig="tableConfig" :tableData="drillData.planDetailList!">
|
|
|
|
|
- <template #drillScriptStatus="scope">
|
|
|
|
|
- <span>{{ scope.row.drillScriptStatus === 1 ? '未会签' : '已会签' }}</span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </BasicTable>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="drill-container__title">
|
|
|
|
|
+ <div class="drill-container--line"></div>
|
|
|
|
|
+ <span>演练参与部门</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <el-button style="margin-top: 20px" type="primary" :icon="Download" @click=""> 下载签到名单 </el-button>
|
|
|
|
|
+ <BasicTable style="margin-top: 20px" :tableConfig="tableConfig" :tableData="drillData.planDetailList!">
|
|
|
|
|
+ <template #drillScriptStatus="scope">
|
|
|
|
|
+ <span>{{ scope.row.drillScriptStatus === 1 ? '未会签' : '已会签' }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </BasicTable>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -45,53 +138,41 @@
|
|
|
import { Download } from '@element-plus/icons-vue';
|
|
import { Download } from '@element-plus/icons-vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
import { useRoute } from 'vue-router';
|
|
|
import { DrillPlanItemDetail } from '../types';
|
|
import { DrillPlanItemDetail } from '../types';
|
|
|
- import { DRILL_VIEW_CONTENT, DRILL_VIEW_EXECUTE } from '../constants';
|
|
|
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
import useTableConfig from '@/hooks/useTableConfigHook';
|
|
|
import { getAllApproval } from '@/api/approval/approval';
|
|
import { getAllApproval } from '@/api/approval/approval';
|
|
|
import { queryEmergencyDrillPlanDetail, queryEmergencyPlanDetail } from '@/api/emergency-drill/emergency-drill';
|
|
import { queryEmergencyDrillPlanDetail, queryEmergencyPlanDetail } from '@/api/emergency-drill/emergency-drill';
|
|
|
import { DRILL_PLAN_ACTIVITIES_TABLE_OPTIONS, DRILL_PLAN_ACTIVITIES_TABLE_COLUMNS } from '../configs/plan/table';
|
|
import { DRILL_PLAN_ACTIVITIES_TABLE_OPTIONS, DRILL_PLAN_ACTIVITIES_TABLE_COLUMNS } from '../configs/plan/table';
|
|
|
import { useEmergencyDrillHook } from '../hook';
|
|
import { useEmergencyDrillHook } from '../hook';
|
|
|
import QrCode from '@/components/Qrcode/src/Qrcode.vue';
|
|
import QrCode from '@/components/Qrcode/src/Qrcode.vue';
|
|
|
|
|
+ import PreviewOnline from '@/views/disaster/components/PreviewOnline.vue';
|
|
|
|
|
+ import { FILE_TYPE_ICON } from '@/views/disaster/constant';
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
const id = route.query.id;
|
|
const id = route.query.id;
|
|
|
|
|
+ const approvalList = ref();
|
|
|
|
|
+ const emergencyPlanDetail = ref();
|
|
|
const drillData = ref<DrillPlanItemDetail>();
|
|
const drillData = ref<DrillPlanItemDetail>();
|
|
|
|
|
+ const qrCode = ref();
|
|
|
|
|
+ const previewOnlineRef = ref<InstanceType<typeof PreviewOnline>>();
|
|
|
|
|
+
|
|
|
|
|
+ const { getDrillScopeDict, getDrillScope } = useEmergencyDrillHook();
|
|
|
|
|
|
|
|
- const { drillScopeDice, getDrillScopeDict } = useEmergencyDrillHook();
|
|
|
|
|
|
|
+ const getApprovalList = async () => {
|
|
|
|
|
+ approvalList.value = await getAllApproval();
|
|
|
|
|
+ };
|
|
|
|
|
|
|
|
- async function getData() {
|
|
|
|
|
|
|
+ async function getDrillData() {
|
|
|
try {
|
|
try {
|
|
|
tableConfig.loading = true;
|
|
tableConfig.loading = true;
|
|
|
drillData.value = await queryEmergencyDrillPlanDetail(id);
|
|
drillData.value = await queryEmergencyDrillPlanDetail(id);
|
|
|
|
|
|
|
|
- // 解析详情数据
|
|
|
|
|
- drillData.value.drillScope = drillScopeDice.value.find(
|
|
|
|
|
- (x) => x.itemCode === drillData.value!.drillScope,
|
|
|
|
|
- )!.itemValue;
|
|
|
|
|
-
|
|
|
|
|
- drillData.value.responsibleDeptNameList = drillData.value.responsibleDeptNameList!.replace(/^\[|\]$/g, '');
|
|
|
|
|
- drillData.value.coordinateDeptNameList = drillData.value.coordinateDeptNameList
|
|
|
|
|
- ? drillData.value.responsibleDeptNameList!.replace(/^\[|\]$/g, '')
|
|
|
|
|
- : undefined;
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 获取应急预案名
|
|
|
if (drillData.value.emergencyPlanId) {
|
|
if (drillData.value.emergencyPlanId) {
|
|
|
- const emergencyPlan = await queryEmergencyPlanDetail(drillData.value.emergencyPlanId);
|
|
|
|
|
- drillData.value.emergencyPlanFile = emergencyPlan.planName + emergencyPlan.appendix;
|
|
|
|
|
|
|
+ emergencyPlanDetail.value = await queryEmergencyPlanDetail(id);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const allApprovals = await getAllApproval();
|
|
|
|
|
- drillData.value.approvalTemplateName = allApprovals.find(
|
|
|
|
|
- (x) => x.id === drillData.value!.approvalTemplateId,
|
|
|
|
|
- )?.templateName;
|
|
|
|
|
-
|
|
|
|
|
- if (drillData.value.drillScript && drillData.value.drillScript.length > 0) {
|
|
|
|
|
- const scriptFile = unformatAttachment(drillData.value.drillScript);
|
|
|
|
|
- // console.log(scriptFile);
|
|
|
|
|
- drillData.value.drillScriptName = scriptFile.fileName;
|
|
|
|
|
- drillData.value.drillScriptUrl = scriptFile.fileUrl;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- drillData.value.qrCode = 'https://cn.bing.com/?id=' + id + '&type=test';
|
|
|
|
|
|
|
+ // 获取二维码
|
|
|
|
|
+ qrCode.value = 'https://cn.bing.com/?id=' + id + '&type=test';
|
|
|
|
|
|
|
|
tableConfig.loading = false;
|
|
tableConfig.loading = false;
|
|
|
} catch (e) {
|
|
} catch (e) {
|
|
@@ -106,28 +187,30 @@
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
|
|
+ await getApprovalList();
|
|
|
await getDrillScopeDict();
|
|
await getDrillScopeDict();
|
|
|
- getData();
|
|
|
|
|
|
|
+ getDrillData();
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- function unformatAttachment(file?: string) {
|
|
|
|
|
- if (!file) return undefined;
|
|
|
|
|
- const fileData = JSON.parse(file);
|
|
|
|
|
- return fileData;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const getApprovalName = (id: number) => {
|
|
|
|
|
+ return approvalList.value.find((item) => item.id === id)?.templateName;
|
|
|
|
|
+ };
|
|
|
|
|
+ const safatyJsonParse = (str: string) => {
|
|
|
|
|
+ return str.slice(1, -1).split(',');
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handlePreviewScript = (str: string) => {
|
|
|
|
|
+ const file = JSON.parse(str);
|
|
|
|
|
+ const url = file.fileUrl;
|
|
|
|
|
+ const type = file.fileType as keyof typeof FILE_TYPE_ICON;
|
|
|
|
|
+ if (!url) return;
|
|
|
|
|
+ previewOnlineRef.value?.open(url, type);
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
-<style scoped>
|
|
|
|
|
- .name {
|
|
|
|
|
- margin-top: 10px;
|
|
|
|
|
- padding-left: 12px;
|
|
|
|
|
- border-left: 3px #1890ff solid;
|
|
|
|
|
- }
|
|
|
|
|
- .data {
|
|
|
|
|
- display: grid;
|
|
|
|
|
- grid-template-columns: repeat(auto-fill, 33%);
|
|
|
|
|
- }
|
|
|
|
|
- .item {
|
|
|
|
|
- padding: 25px 16px;
|
|
|
|
|
|
|
+<style scoped lang="scss">
|
|
|
|
|
+ @use '../style/common.scss' as *;
|
|
|
|
|
+ .link {
|
|
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|