This commit is contained in:
zhoutianchi
2026-02-09 16:04:55 +08:00
parent 88cfb1985a
commit 9ac3a36efa
5 changed files with 26 additions and 9 deletions

View File

@@ -5,6 +5,7 @@
</div>
<el-upload
ref="uploadRef"
class="upload-demo"
:action="uploadUrl"
:headers="headers"
@@ -24,7 +25,7 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { ref, computed, nextTick } from 'vue';
import { ElNotification } from 'element-plus';
import { Download, UploadFilled } from '@element-plus/icons-vue';
import { Session } from '/@/utils/storage';
@@ -44,20 +45,24 @@ const headers = computed(() => {
const uploadUrl = ref('')
const currentType = ref('')
const uploadRef = ref<{ clearFiles?: () => void }>()
const titleMap: Record<string, string> = {
planMajor: '计划专业导入'
}
// 方法
const init = (type: any) => {
currentType.value = type
uploadUrl.value = '/professional/file/importTeacherOtherInfo?type=' + type
uploadUrl.value = '/api/recruit/file/importRecruitInfo?type=' + type
title.value = titleMap[type] || '信息导入'
visible.value = true
nextTick(() => {
uploadRef.value?.clearFiles()
})
}
// Emits
const emit = defineEmits<{
(e: 'refreshData'): void
(e: 'refreshDataList'): void
}>()
const handleUploadSuccess = () => {
@@ -68,7 +73,7 @@ const handleUploadSuccess = () => {
type: 'success',
});
emit('refreshData')
emit('refreshDataList')
};
const handleAvatarError = (err: any) => {

View File

@@ -124,7 +124,7 @@
<!-- 弹窗, 新增 / 修改 -->
<table-form ref="addOrUpdateRef" @refreshDataList="getDataList" />
<import-recruit-info ref="ImportRecruitInfoRef"></import-recruit-info>
<import-recruit-info ref="ImportRecruitInfoRef" @refreshDataList="getDataList"></import-recruit-info>
</div>
</div>
</template>
@@ -283,7 +283,7 @@ const resetQuery = () => {
const exportLoading = ref(false);
const handleImportDialog = () => {
ImportRecruitInfoRef.value?.init("planMajor");
ImportRecruitInfoRef.value?.init("R10001");
};
onMounted(() => {