|
|
@@ -4,11 +4,10 @@
|
|
|
<div style="position: relative;">
|
|
|
<el-upload
|
|
|
ref="dialogUploadRef" :headers="getHeader()" drag
|
|
|
- action="/api/blade-manager/wbsTreeContract/import-node-excel"
|
|
|
- :data="{ nodeId, classify }"
|
|
|
+ action="/api/blade-manager/informationImportRecord/import"
|
|
|
:on-success="handleSuccess" :on-error="handleError" accept=".xls,.xlsx"
|
|
|
:auto-upload="false"
|
|
|
- :limit="1"
|
|
|
+ multiple
|
|
|
:on-exceed="handleExceed"
|
|
|
:before-upload="beforeUpload"
|
|
|
:show-file-list="false"
|
|
|
@@ -59,8 +58,6 @@ const props = defineProps({
|
|
|
type: String,
|
|
|
default: '',
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
})
|
|
|
//事件
|
|
|
const emit = defineEmits(['close', 'save', 'success'])
|
|
|
@@ -73,7 +70,6 @@ watch(
|
|
|
nodeId.value = nid
|
|
|
classify.value = clas
|
|
|
fileList.value = []
|
|
|
-
|
|
|
},
|
|
|
)
|
|
|
|
|
|
@@ -84,8 +80,6 @@ const dataModal = defineModel('modelValue', {
|
|
|
const closeModal = ()=>{
|
|
|
dataModal.value = false
|
|
|
fileList.value = []
|
|
|
-
|
|
|
-
|
|
|
emit('close')
|
|
|
}
|
|
|
|
|
|
@@ -93,7 +87,7 @@ const closeModal = ()=>{
|
|
|
|
|
|
//上传文件
|
|
|
const dialogUploadRef = ref(null)
|
|
|
-const pKeyIdData = ref('')
|
|
|
+// const pKeyIdData = ref('')
|
|
|
// 文件类型验证
|
|
|
const beforeUpload = (file) => {
|
|
|
const extension = file.name.split('.').pop().toLowerCase()
|
|
|
@@ -130,18 +124,18 @@ const handleSuccess = (res) => {
|
|
|
if (res.code === 200) {
|
|
|
window.$message.success(res.msg || '上传成功')
|
|
|
emit('success', res)
|
|
|
- nextTick(()=>{
|
|
|
- fileList.value = []
|
|
|
- })
|
|
|
+ nextTick(()=>{
|
|
|
+ fileList.value = []
|
|
|
+ })
|
|
|
|
|
|
- closeModal()
|
|
|
+ closeModal()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
window.$message.error(res.msg || '上传失败')
|
|
|
- nextTick(()=>{
|
|
|
- fileList.value = []
|
|
|
- })
|
|
|
+ nextTick(()=>{
|
|
|
+ fileList.value = []
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -171,8 +165,16 @@ const parseFileName = (disposition) => {
|
|
|
if (matches && matches[1]) {
|
|
|
return decodeURIComponent(matches[1].replace(/['"]/g, ''))
|
|
|
}
|
|
|
- return 'unknown'
|
|
|
+ confirmLoading.value = false
|
|
|
}
|
|
|
+// const parseFileName = (disposition) => {
|
|
|
+// const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/
|
|
|
+// const matches = filenameRegex.exec(disposition)
|
|
|
+// if (matches && matches[1]) {
|
|
|
+// return decodeURIComponent(matches[1].replace(/['"]/g, ''))
|
|
|
+// }
|
|
|
+// return 'unknown'
|
|
|
+// }
|
|
|
|
|
|
const downloadBlob1 = (data, disposition = '', type = 'application/vnd.ms-excel')=> {
|
|
|
const blob = new Blob([data], { type: type })
|