edfbf302 by lihua

修复数据字典下载

1 parent 1236b879
......@@ -1165,14 +1165,22 @@ const exportData = (type: any = null) => {
params.guid = fieldSheetInfo.value.guid
}
exportDictionary(params).then((res: any) => {
download(res, '数据字典模板.xlsx', 'excel')
if (res && !res.msg) {
download(res, '数据字典模板.xlsx', 'excel')
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
} else {
let params = {
guid: dictGuid.value
}
exportDictionaryFileds(params).then((res: any) => {
download(res, '字典数据.xlsx', 'excel')
if (res && !res.msg) {
download(res, '字典数据.xlsx', 'excel');
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
}
}
......
......@@ -359,7 +359,11 @@ const exportData = (ids: any = null) => {
guid: dictionaryGuid.value
}
exportDictionary(params).then((res: any) => {
download(res, '数据字典模板.xlsx', 'excel')
if (res && !res.msg) {
download(res, '数据字典模板.xlsx', 'excel');
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
} else if (tabsActiveName.value == 'importFile' && isfileImport == '4') {
exportCollectTask({
......@@ -367,7 +371,11 @@ const exportData = (ids: any = null) => {
"0042"
]
}).then((res: any) => {
download(res, '元数据模板.xlsx', 'excel')
if (res && !res.msg) {
download(res, '元数据模板.xlsx', 'excel');
} else {
res?.msg && ElMessage.error(res?.msg);
}
});
}
}
......@@ -413,7 +421,7 @@ const importData = (info) => {
});
paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2`
if (info && Object.keys(info).length) {
paramUrl += `&extendFields=${JSON.stringify(info)}`
paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}`
}
}
dialogInfo.value.footer.btns[1].loading = true;
......@@ -434,7 +442,7 @@ const importData = (info) => {
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
}
}).catch(() => {
// dialogInfo.value.footer.btns.map((item: any) => delete item.disabled)
dialogInfo.value.footer.btns[1].loading = false;
})
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!