From 2c68c12fe29322d3118741e203a6a6fc48a6d768 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Thu, 30 Oct 2025 17:47:41 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 29 ++++++++++------------- 1 file changed, 13 insertions(+), 16 deletions(-) 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() {
- From 996c13b2e3e189db6cef311395d71ab5d39faf23 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Thu, 30 Oct 2025 18:14:08 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 47 ++++++++++++++++------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index 10bfe6a..48dae66 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -15,6 +15,7 @@ import { } from "@/api/testtask"; import { storagesBytype } from "@/api/storage"; import { getDict } from '@/api/dict' +import { getUserInfo } from '@/api/user'; /////// let result2 = ref([]) let result1 = ref([ @@ -53,7 +54,7 @@ const importRules: any = ref({ const fileList = ref([]) const importFormRef = ref() // 是否单机 -const standAlone = ref(true) +const standAlone = ref(false) //转化时间格式 function zhuandata(dateString: any) { // 创建Date对象 @@ -69,7 +70,6 @@ function zhuandata(dateString: any) { const loading = ref(false) //获取表格数据 function getdata() { - loading.value = true if (dataduan.value && dataduan.value.length > 0) { const dataArr = [] @@ -161,9 +161,9 @@ function addproject() { localStorageId: '', backupStorageId: '' } - if(standAlone){ - projectForme.value.localStorageId = 1 - projectForme.value.backupStorageId = -1 + if (standAlone) { + projectForme.value.localStorageId = 1 + projectForme.value.backupStorageId = -1 } console.log(projectForme.value) // formitemarr.value.length = 0 @@ -369,6 +369,13 @@ const moderules = ref({ backupStorageId: [{ required: true, message: "请选择minio存储空间", trigger: "change" }], }); onMounted(() => { + getUserInfo().then((res: any) => { + const roles = res.data.roles + const hasSingleMachineUser = roles.some(name => name === '单机用户'); + if (hasSingleMachineUser) { + standAlone.value = true + } + }) getdata() getDictOne() }); @@ -490,16 +497,27 @@ function importSubmit(formEl: any) { formEl.validate((valid: any, fields: any) => { if (valid) { if (fileList.value.length == 0) { - return ElMessage.warning('请选择导入的文件!') + return ElMessage.warning('请上传导入文件!') + } + if (isconnect) { + return } const formData = new FormData() formData.append('file', fileList.value[0]) formData.append('taskCode', importForm.value.taskCode) formData.append('localStorageId', importForm.value.localStorageId) formData.append('backupStorageId', importForm.value.backupStorageId) + isconnect.value = true importTaskSql(formData).then((res: any) => { - if (res) { + if (res.code == '0') { + isconnect.value = false + importDialog.value = false ElMessage.success('上传成功') + getdata() + } else { + isconnect.value = false + importDialog.value = false + ElMessage.error(res.msg) } }) } @@ -561,7 +579,7 @@ function importClose() {
新增 删除 - 导入 + 导入
- + - + @@ -624,7 +642,7 @@ function importClose() { style="cursor: pointer;"> - @@ -703,7 +721,8 @@ function importClose() { 删除 -
+
@@ -781,13 +800,13 @@ function importClose() { - 导入 + 上传导入文件
- 确定 + 导入
From 753825acad3c60c1fe4b7e254fcb00485dfd824e Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Thu, 30 Oct 2025 18:21:21 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/login/index.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/views/login/index.vue b/web/src/views/login/index.vue index cc2756f..df9b74d 100644 --- a/web/src/views/login/index.vue +++ b/web/src/views/login/index.vue @@ -300,13 +300,14 @@ $light_gray: #eee; position: relative; // justify-content: center; // -webkit-justify-content: center; + text-align: center; .login-container-title{ font-size: 60px; font-weight: 700; color: #fff; margin: 0 auto; margin-top: 2%; - width: 800px; + // width: 800px; letter-spacing: 5px; } .login-container-content { From df829e4abba185437ba72229dd19ec57b1b2dccc Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Fri, 31 Oct 2025 09:05:47 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index 48dae66..4b18753 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -373,9 +373,9 @@ onMounted(() => { const roles = res.data.roles const hasSingleMachineUser = roles.some(name => name === '单机用户'); if (hasSingleMachineUser) { - standAlone.value = true + standAlone.value = true } - }) + }) getdata() getDictOne() }); @@ -474,6 +474,10 @@ function reset() { getdata() } function importproject() { + fileList.value = [] + importForm.value.fileName = '' + importForm.value.localStorageId = '' + importForm.value.backupStorageId = '' getMaxTaskCode().then((res: any) => { if (res.data) { importForm.value.taskCode = res.data @@ -489,7 +493,6 @@ function fileChange(uploadFile, uploadFiles) { importForm.value.fileName = uploadFile.name fileList.value = [] fileList.value = [uploadFile.raw] - console.log(fileList.value, 999) } const isconnect = ref(false) function importSubmit(formEl: any) { @@ -499,7 +502,7 @@ function importSubmit(formEl: any) { if (fileList.value.length == 0) { return ElMessage.warning('请上传导入文件!') } - if (isconnect) { + if (isconnect.value) { return } const formData = new FormData() @@ -642,8 +645,8 @@ function importClose() { style="cursor: pointer;"> - +
From 09a4ab50b30dc2c8892df3bbf783874a5637fd17 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Fri, 31 Oct 2025 09:13:27 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index 4b18753..f218d97 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -800,11 +800,12 @@ function importClose() {
- + - 上传导入文件 + 上传导入文件 +
From 1d5e4c8b8595fa12c01292dc3ea97a845e8d51a3 Mon Sep 17 00:00:00 2001 From: jingna <1264204245@qq.com> Date: Fri, 31 Oct 2025 09:32:32 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index f218d97..a25516f 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -724,7 +724,7 @@ function importClose() { 删除 -
Date: Fri, 31 Oct 2025 09:35:32 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/testdata/testtask/index.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/views/testdata/testtask/index.vue b/web/src/views/testdata/testtask/index.vue index a25516f..4c47e6e 100644 --- a/web/src/views/testdata/testtask/index.vue +++ b/web/src/views/testdata/testtask/index.vue @@ -161,7 +161,7 @@ function addproject() { localStorageId: '', backupStorageId: '' } - if (standAlone) { + if (standAlone.value) { projectForme.value.localStorageId = 1 projectForme.value.backupStorageId = -1 } @@ -582,7 +582,7 @@ function importClose() {
新增 删除 - 导入 + 导入
- + - + @@ -724,7 +724,7 @@ function importClose() { 删除 -