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: '' endDate: ''
}); });
const total = ref(0); const total = ref(0);
//
const importDialog = ref(false) const importDialog = ref(false)
const importForm: any = ref({}) const importForm: any = ref({})
const importRules: any = ref({ const importRules: any = ref({
@ -51,6 +52,8 @@ const importRules: any = ref({
}) })
const fileList = ref([]) const fileList = ref([])
const importFormRef = ref() const importFormRef = ref()
//
const standAlone = ref(true)
// //
function zhuandata(dateString: any) { function zhuandata(dateString: any) {
// Date // Date
@ -158,6 +161,11 @@ function addproject() {
localStorageId: '', localStorageId: '',
backupStorageId: '' backupStorageId: ''
} }
if(standAlone){
projectForme.value.localStorageId = 1
projectForme.value.backupStorageId = -1
}
console.log(projectForme.value)
// formitemarr.value.length = 0 // formitemarr.value.length = 0
shidou.value = true shidou.value = true
} }
@ -223,26 +231,15 @@ function expproject(row: any) {
console.log(res) console.log(res)
console.log('响应头:', res.headers); console.log('响应头:', res.headers);
if (res) { if (res) {
// 访 const fileName = `${row.taskCode}_exportdata.zip`; //
//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 blob = new Blob([res.data], { type: 'application/zip' }); const blob = new Blob([res], { type: 'application/zip' });
// //
const url = window.URL.createObjectURL(blob); const url = window.URL.createObjectURL(blob);
const link = document.createElement('a'); const link = document.createElement('a');
link.href = url; link.href = url;
link.download = `${row.id}_data.sql.zip`; link.download = fileName;
link.style.display = 'none'; link.style.display = 'none';
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
@ -487,6 +484,7 @@ function fileChange(uploadFile, uploadFiles) {
fileList.value = [uploadFile.raw] fileList.value = [uploadFile.raw]
console.log(fileList.value, 999) console.log(fileList.value, 999)
} }
const isconnect = ref(false)
function importSubmit(formEl: any) { function importSubmit(formEl: any) {
if (!formEl) return if (!formEl) return
formEl.validate((valid: any, fields: any) => { formEl.validate((valid: any, fields: any) => {
@ -705,7 +703,7 @@ function importClose() {
<el-button type="primary" @click="dellable(index)">删除</el-button> <el-button type="primary" @click="dellable(index)">删除</el-button>
</div> </div>
</el-form-item> </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-form-item label="本地存储空间" prop="localStorageId" style="width: 50%;">
<el-select v-model="projectForme.localStorageId" clearable placeholder=" " <el-select v-model="projectForme.localStorageId" clearable placeholder=" "
:disabled="!shidou"> :disabled="!shidou">
@ -721,7 +719,6 @@ function importClose() {
</el-select> </el-select>
</el-form-item> </el-form-item>
</div> </div>
</el-scrollbar> </el-scrollbar>
<el-form-item> <el-form-item>