|
|
@@ -15,14 +15,14 @@
|
|
|
<div class="data">
|
|
|
<div v-for="item in DRILL_VIEW_EXECUTE" :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>
|
|
|
+ <a v-if="item.link" class="link" :href="drillData![item.link]">{{ drillData![item.value] }}</a>
|
|
|
<span v-else class="value"> {{ drillData![item.value] }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
<div class="name">演练参与部门</div>
|
|
|
- <el-button style="margin-top: 20px" type="primary" :icon="Download" @click=""> 创建演练计划 </el-button>
|
|
|
+ <el-button style="margin-top: 20px" type="primary" :icon="Download" @click=""> 下载签到名单 </el-button>
|
|
|
<BasicTable style="margin-top: 20px" :tableConfig="tableConfig" :tableData="drillData.planDetailList!">
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
@@ -40,16 +40,24 @@
|
|
|
import { getAllApproval } from '@/api/approval/approval';
|
|
|
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 { useEmergencyDrillHook } from '../hook';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const id = route.query.id;
|
|
|
const drillData = ref<DrillPlanItemDetail>();
|
|
|
|
|
|
+ const { drillScopeDice, getDrillScopeDict } = useEmergencyDrillHook();
|
|
|
+
|
|
|
async function getData() {
|
|
|
try {
|
|
|
tableConfig.loading = true;
|
|
|
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, '')
|
|
|
@@ -64,6 +72,13 @@
|
|
|
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;
|
|
|
+ }
|
|
|
tableConfig.loading = false;
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
@@ -76,9 +91,16 @@
|
|
|
false,
|
|
|
);
|
|
|
|
|
|
- onMounted(() => {
|
|
|
+ onMounted(async () => {
|
|
|
+ await getDrillScopeDict();
|
|
|
getData();
|
|
|
});
|
|
|
+
|
|
|
+ function unformatAttachment(file?: string) {
|
|
|
+ if (!file) return undefined;
|
|
|
+ const fileData = JSON.parse(file);
|
|
|
+ return fileData;
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|