This commit is contained in:
jingna 2025-10-30 17:47:41 +08:00
parent 2a8996130c
commit 2c68c12fe2

View File

@ -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() {
<el-button type="primary" @click="dellable(index)">删除</el-button>
</div>
</el-form-item>
<div style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<div v-if="!standAlone" style="width: 100%;display: flex;justify-content: space-between;align-items: center;">
<el-form-item label="本地存储空间" prop="localStorageId" style="width: 50%;">
<el-select v-model="projectForme.localStorageId" clearable placeholder=" "
:disabled="!shidou">
@ -721,7 +719,6 @@ function importClose() {
</el-select>
</el-form-item>
</div>
</el-scrollbar>
<el-form-item>