|
|
|
|
@ -140,18 +140,20 @@ const result = ref(true)
|
|
|
|
|
const ifShow = ref(false) |
|
|
|
|
const upload = ref<UploadInstance>() |
|
|
|
|
const fileList = ref([]) |
|
|
|
|
const importData = ref([]) |
|
|
|
|
|
|
|
|
|
const handleUpload: UploadProps['httpRequest'] = (file) => { |
|
|
|
|
const formData = new FormData(); // 创建表单数据对象 |
|
|
|
|
formData.append("file", file.file); // 将文件添加到表单数据中 |
|
|
|
|
return axios.post("/lan-api/api/work/check", formData) // 使用 axios 发送 post 请求到后端 |
|
|
|
|
.then((res) => { |
|
|
|
|
// 处理成功的响应 |
|
|
|
|
console.log('checkMsg', res.data); |
|
|
|
|
// 处理成功的响应 |
|
|
|
|
if (res.data.data[0]) { |
|
|
|
|
console.log('checkMsg', res.data.data); |
|
|
|
|
result.value = false |
|
|
|
|
ifShow.value = true |
|
|
|
|
form.value = res.data.data |
|
|
|
|
importData.value = res.data.data |
|
|
|
|
} else { |
|
|
|
|
ifShow.value = true |
|
|
|
|
result.value = true |
|
|
|
|
@ -169,7 +171,7 @@ const handleCheck = () => {
|
|
|
|
|
console.log(query.value) |
|
|
|
|
} |
|
|
|
|
const handleImport = () => { |
|
|
|
|
request.post({ url: '/work/import', body: form.value }).then((data: any) => { |
|
|
|
|
request.post({ url: '/work/import', body: importData.value }).then((data: any) => { |
|
|
|
|
ElMessage.success('下载成功') |
|
|
|
|
resetView() |
|
|
|
|
}).catch((error: any) => { |
|
|
|
|
|