diff --git a/ui/src/request/index.ts b/ui/src/request/index.ts index 204fa297c..050b41e5d 100644 --- a/ui/src/request/index.ts +++ b/ui/src/request/index.ts @@ -225,8 +225,9 @@ export const exportExcel: ( params: any, loading?: NProgress | Ref ) => { - return promise(request({ url: url, method: 'get', params, responseType: 'blob' }), loading) - .then((res: any) => { + return promise(request({ url: url, method: 'get', params, responseType: 'blob' }), loading).then( + (res: any) => { + console.log(res) if (res) { const blob = new Blob([res], { type: 'application/vnd.ms-excel' @@ -239,8 +240,8 @@ export const exportExcel: ( window.URL.revokeObjectURL(link.href) } return true - }) - .catch((e) => {}) + } + ) } export const exportExcelPost: ( @@ -265,22 +266,20 @@ export const exportExcelPost: ( responseType: 'blob' }), loading - ) - .then((res: any) => { - if (res) { - const blob = new Blob([res], { - type: 'application/vnd.ms-excel' - }) - const link = document.createElement('a') - link.href = window.URL.createObjectURL(blob) - link.download = fileName - link.click() - // 释放内存 - window.URL.revokeObjectURL(link.href) - } - return true - }) - .catch((e) => {}) + ).then((res: any) => { + if (res) { + const blob = new Blob([res], { + type: 'application/vnd.ms-excel' + }) + const link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = fileName + link.click() + // 释放内存 + window.URL.revokeObjectURL(link.href) + } + return true + }) } export const download: ( diff --git a/ui/src/views/document/index.vue b/ui/src/views/document/index.vue index c3e6052ef..a6df1fb0b 100644 --- a/ui/src/views/document/index.vue +++ b/ui/src/views/document/index.vue @@ -187,9 +187,10 @@ @@ -678,18 +679,24 @@ function deleteDocument(row: any) { 更新名称或状态 */ function updateData(documentId: string, data: any, msg: string) { - documentApi.putDocument(id, documentId, data, loading).then((res) => { - const index = documentData.value.findIndex((v) => v.id === documentId) - documentData.value.splice(index, 1, res.data) - MsgSuccess(msg) - }) + documentApi + .putDocument(id, documentId, data, loading) + .then((res) => { + const index = documentData.value.findIndex((v) => v.id === documentId) + documentData.value.splice(index, 1, res.data) + MsgSuccess(msg) + return true + }) + .catch(() => { + return false + }) } -function changeState(bool: Boolean, row: any) { +function changeState(row: any) { const obj = { - is_active: bool + is_active: !row.is_active } - const str = bool ? '启用成功' : '禁用成功' + const str = !row.is_active ? '启用成功' : '禁用成功' currentMouseId.value && updateData(row.id, obj, str) } diff --git a/ui/src/views/paragraph/index.vue b/ui/src/views/paragraph/index.vue index 2cdc1b1de..31f764868 100644 --- a/ui/src/views/paragraph/index.vue +++ b/ui/src/views/paragraph/index.vue @@ -104,8 +104,9 @@ >
@@ -162,7 +163,6 @@ -