修复数据字典下载
Showing
2 changed files
with
21 additions
and
5 deletions
| ... | @@ -1165,14 +1165,22 @@ const exportData = (type: any = null) => { | ... | @@ -1165,14 +1165,22 @@ const exportData = (type: any = null) => { |
| 1165 | params.guid = fieldSheetInfo.value.guid | 1165 | params.guid = fieldSheetInfo.value.guid |
| 1166 | } | 1166 | } |
| 1167 | exportDictionary(params).then((res: any) => { | 1167 | exportDictionary(params).then((res: any) => { |
| 1168 | if (res && !res.msg) { | ||
| 1168 | download(res, '数据字典模板.xlsx', 'excel') | 1169 | download(res, '数据字典模板.xlsx', 'excel') |
| 1170 | } else { | ||
| 1171 | res?.msg && ElMessage.error(res?.msg); | ||
| 1172 | } | ||
| 1169 | }); | 1173 | }); |
| 1170 | } else { | 1174 | } else { |
| 1171 | let params = { | 1175 | let params = { |
| 1172 | guid: dictGuid.value | 1176 | guid: dictGuid.value |
| 1173 | } | 1177 | } |
| 1174 | exportDictionaryFileds(params).then((res: any) => { | 1178 | exportDictionaryFileds(params).then((res: any) => { |
| 1175 | download(res, '字典数据.xlsx', 'excel') | 1179 | if (res && !res.msg) { |
| 1180 | download(res, '字典数据.xlsx', 'excel'); | ||
| 1181 | } else { | ||
| 1182 | res?.msg && ElMessage.error(res?.msg); | ||
| 1183 | } | ||
| 1176 | }); | 1184 | }); |
| 1177 | } | 1185 | } |
| 1178 | } | 1186 | } | ... | ... |
| ... | @@ -359,7 +359,11 @@ const exportData = (ids: any = null) => { | ... | @@ -359,7 +359,11 @@ const exportData = (ids: any = null) => { |
| 359 | guid: dictionaryGuid.value | 359 | guid: dictionaryGuid.value |
| 360 | } | 360 | } |
| 361 | exportDictionary(params).then((res: any) => { | 361 | exportDictionary(params).then((res: any) => { |
| 362 | download(res, '数据字典模板.xlsx', 'excel') | 362 | if (res && !res.msg) { |
| 363 | download(res, '数据字典模板.xlsx', 'excel'); | ||
| 364 | } else { | ||
| 365 | res?.msg && ElMessage.error(res?.msg); | ||
| 366 | } | ||
| 363 | }); | 367 | }); |
| 364 | } else if (tabsActiveName.value == 'importFile' && isfileImport == '4') { | 368 | } else if (tabsActiveName.value == 'importFile' && isfileImport == '4') { |
| 365 | exportCollectTask({ | 369 | exportCollectTask({ |
| ... | @@ -367,7 +371,11 @@ const exportData = (ids: any = null) => { | ... | @@ -367,7 +371,11 @@ const exportData = (ids: any = null) => { |
| 367 | "0042" | 371 | "0042" |
| 368 | ] | 372 | ] |
| 369 | }).then((res: any) => { | 373 | }).then((res: any) => { |
| 370 | download(res, '元数据模板.xlsx', 'excel') | 374 | if (res && !res.msg) { |
| 375 | download(res, '元数据模板.xlsx', 'excel'); | ||
| 376 | } else { | ||
| 377 | res?.msg && ElMessage.error(res?.msg); | ||
| 378 | } | ||
| 371 | }); | 379 | }); |
| 372 | } | 380 | } |
| 373 | } | 381 | } |
| ... | @@ -413,7 +421,7 @@ const importData = (info) => { | ... | @@ -413,7 +421,7 @@ const importData = (info) => { |
| 413 | }); | 421 | }); |
| 414 | paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2` | 422 | paramUrl = `${import.meta.env.VITE_APP_ADD_FILE}/import-data/import-common?importType=${importType.value}&staffGuid=${userData.staffGuid}&tenantGuid=${userData.tenantGuid}&dataType=2` |
| 415 | if (info && Object.keys(info).length) { | 423 | if (info && Object.keys(info).length) { |
| 416 | paramUrl += `&extendFields=${JSON.stringify(info)}` | 424 | paramUrl += `&extendFields=${encodeURIComponent(JSON.stringify(info))}` |
| 417 | } | 425 | } |
| 418 | } | 426 | } |
| 419 | dialogInfo.value.footer.btns[1].loading = true; | 427 | dialogInfo.value.footer.btns[1].loading = true; |
| ... | @@ -434,7 +442,7 @@ const importData = (info) => { | ... | @@ -434,7 +442,7 @@ const importData = (info) => { |
| 434 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | 442 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) |
| 435 | } | 443 | } |
| 436 | }).catch(() => { | 444 | }).catch(() => { |
| 437 | // dialogInfo.value.footer.btns.map((item: any) => delete item.disabled) | 445 | dialogInfo.value.footer.btns[1].loading = false; |
| 438 | }) | 446 | }) |
| 439 | } | 447 | } |
| 440 | 448 | ... | ... |
-
Please register or sign in to post a comment