diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index f5186f2..10bfe6a 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -43,6 +43,7 @@ const queryParams: any = ref({ endDate: '' }); const total = ref(0); +//导入 const importDialog = ref(false) const importForm: any = ref({}) const importRules: any = ref({ @@ -51,6 +52,8 @@ const importRules: any = ref({ }) const fileList = ref([]) const importFormRef = ref() +// 是否单机 +const standAlone = ref(true) //转化时间格式 function zhuandata(dateString: any) { // 创建Date对象 @@ -158,6 +161,11 @@ function addproject() { localStorageId: '', backupStorageId: '' } + if(standAlone){ + projectForme.value.localStorageId = 1 + projectForme.value.backupStorageId = -1 + } + console.log(projectForme.value) // formitemarr.value.length = 0 shidou.value = true } @@ -223,26 +231,15 @@ function expproject(row: any) { console.log(res) console.log('响应头:', res.headers); if (res) { - // 正确访问响应头 - //const disposition = res.headers['Content-Disposition']; - - const fileName = `${row.id}_data.sql.zip`; // 或从响应头中获取文件名 - - // if (disposition) { - // const filenameMatch = disposition.match(/filename="?([^"]+)"?/); - // if (filenameMatch && filenameMatch[1]) { - // fileName = decodeURIComponent(filenameMatch[1]); - // } - // } - + const fileName = `${row.taskCode}_exportdata.zip`; // 或从响应头中获取文件名 // 处理响应数据 - const blob = new Blob([res.data], { type: 'application/zip' }); + const blob = new Blob([res], { type: 'application/zip' }); // 创建临时链接并触发下载 const url = window.URL.createObjectURL(blob); const link = document.createElement('a'); link.href = url; - link.download = `${row.id}_data.sql.zip`; + link.download = fileName; link.style.display = 'none'; document.body.appendChild(link); link.click(); @@ -487,6 +484,7 @@ function fileChange(uploadFile, uploadFiles) { fileList.value = [uploadFile.raw] console.log(fileList.value, 999) } +const isconnect = ref(false) function importSubmit(formEl: any) { if (!formEl) return formEl.validate((valid: any, fields: any) => { @@ -705,7 +703,7 @@ function importClose() { 删除 -
+
@@ -721,7 +719,6 @@ function importClose() {
-