fix
This commit is contained in:
@@ -1,22 +1,16 @@
|
||||
<template>
|
||||
<el-dialog v-model="visible" :title="title" width="600" append-to-body>
|
||||
<div style="text-align: center; margin-bottom: 20px" v-if="currentType!='R10003'">
|
||||
<div style="text-align: center; margin-bottom: 20px" v-if="currentType != 'R10003'">
|
||||
<el-button type="success" :icon="Download" @click="handleDownloadTemplate">下载模板</el-button>
|
||||
</div>
|
||||
|
||||
<el-alert
|
||||
v-if="currentType=='R10003'"
|
||||
type="warning"
|
||||
:closable="false"
|
||||
show-icon
|
||||
style="margin-bottom: 20px;">
|
||||
<template #title>
|
||||
<span> 请从中招平台导出数据后导入</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-alert v-if="currentType == 'R10003'" type="warning" :closable="false" show-icon style="margin-bottom: 20px">
|
||||
<template #title>
|
||||
<span> 请从中招平台导出数据后导入</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
|
||||
|
||||
<el-upload
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
class="upload-demo"
|
||||
:action="uploadUrl"
|
||||
@@ -51,34 +45,34 @@ const visible = ref(false);
|
||||
const headers = computed(() => {
|
||||
return {
|
||||
Authorization: 'Bearer ' + Session.getToken(),
|
||||
TENANT_ID: Session.getTenant()
|
||||
TENANT_ID: Session.getTenant(),
|
||||
};
|
||||
});
|
||||
|
||||
const uploadUrl = ref('')
|
||||
const currentType = ref('')
|
||||
const uploadRef = ref<{ clearFiles?: () => void }>()
|
||||
const uploadUrl = ref('');
|
||||
const currentType = ref('');
|
||||
const uploadRef = ref<{ clearFiles?: () => void }>();
|
||||
const titleMap: Record<string, string> = {
|
||||
R10001: '计划专业导入',
|
||||
R10002: '地区分数导入',
|
||||
R10003: '中招平台数据导入',
|
||||
R10004: '学校维护导入',
|
||||
}
|
||||
R10001: '计划专业导入',
|
||||
R10002: '地区分数导入',
|
||||
R10003: '中招平台数据导入',
|
||||
R10004: '学校维护导入',
|
||||
};
|
||||
// 方法
|
||||
const init = (type: any) => {
|
||||
currentType.value = type
|
||||
uploadUrl.value = '/api/recruit/file/importRecruitInfo?type=' + type
|
||||
title.value = titleMap[type] || '信息导入'
|
||||
visible.value = true
|
||||
currentType.value = type;
|
||||
uploadUrl.value = '/api/recruit/file/importRecruitInfo?type=' + type;
|
||||
title.value = titleMap[type] || '信息导入';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
uploadRef.value?.clearFiles()
|
||||
})
|
||||
}
|
||||
uploadRef.value?.clearFiles();
|
||||
});
|
||||
};
|
||||
|
||||
// Emits
|
||||
const emit = defineEmits<{
|
||||
(e: 'refreshDataList'): void
|
||||
}>()
|
||||
(e: 'refreshDataList'): void;
|
||||
}>();
|
||||
|
||||
const handleUploadSuccess = () => {
|
||||
visible.value = false;
|
||||
@@ -88,7 +82,7 @@ const handleUploadSuccess = () => {
|
||||
type: 'success',
|
||||
});
|
||||
|
||||
emit('refreshDataList')
|
||||
emit('refreshDataList');
|
||||
};
|
||||
|
||||
const handleAvatarError = (err: any) => {
|
||||
@@ -103,12 +97,12 @@ const handleAvatarError = (err: any) => {
|
||||
};
|
||||
|
||||
const handleDownloadTemplate = () => {
|
||||
downBlobFile('/recruit/file/exportRecruitTemplate', { type: currentType.value || 'planMajor' }, title.value+'模板.xlsx')
|
||||
}
|
||||
downBlobFile('/recruit/file/exportRecruitTemplate', { type: currentType.value || 'planMajor' }, title.value + '模板.xlsx');
|
||||
};
|
||||
|
||||
// 暴露方法给父组件
|
||||
defineExpose({
|
||||
init
|
||||
init,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user