Browse Source

修改导出

master
王梦远 3 days ago
parent
commit
8baf584dd2
  1. 2
      src/apis/audit.ts
  2. 2
      src/apis/log.ts
  3. 12
      src/views/audit/index.vue
  4. 4
      src/views/log/index.vue

2
src/apis/audit.ts

@ -2,6 +2,6 @@ import http from 'libs/http'
export const getAuditList = (params: System.Page = { pageNum: 1, pageSize: 999 }): Promise<System.PageResponse<Audit.AuditItem[]>> => http.post(`/audit-record/page`, params)
export const exportAudit = (params: string): Promise<Blob> => http.post(`/audit-record/export`, params)
export const exportAudit = (params: string): Promise<Blob> => http.get(`/audit-record/export`)
export const delAudit = (ids: string): Promise<null> => http.delete(`/audit-record/${ids}`)

2
src/apis/log.ts

@ -2,7 +2,7 @@ import http from 'libs/http'
export const getLogList = (params: System.Page = { pageNum: 1, pageSize: 999 }): Promise<System.PageResponse<Log.LogItem>> => http.post(`/receive-record/page`, params)
export const exportLog = (params: string): Promise<Blob> => http.post(`/receive-record/export`, params)
export const exportLog = (params: string): Promise<Blob> => http.get(`/receive-record/export`)
export const delLog = (ids: string): Promise<null> => http.delete(`/receive-record/${ids}`)
export const addLog = (params: Log.LogItem): Promise<null> => http.post(`/receive-record`, params)

12
src/views/audit/index.vue

@ -21,12 +21,12 @@ const exportAuditHandle = (data: Log.LogItem[]) => {
const ids = data.map(item => item.id)
exportAudit(ids.join(',')).then((res) => {
FtMessage.success('导出成功')
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = '审计.xlsx'
link.click()
URL.revokeObjectURL(link.href)
// const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
// const link = document.createElement('a')
// link.href = URL.createObjectURL(blob)
// link.download = '.xlsx'
// link.click()
// URL.revokeObjectURL(link.href)
})
})
}

4
src/views/log/index.vue

@ -20,12 +20,12 @@ const exportLogHandle = (data: Log.LogItem[]) => {
const ids = data.map(item => item.id)
exportLog(ids.join(',')).then((res) => {
FtMessage.success('导出成功')
const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
/* const blob = new Blob([res], { type: 'application/vnd.ms-excel' })
const link = document.createElement('a')
link.href = URL.createObjectURL(blob)
link.download = '日志.xlsx'
link.click()
URL.revokeObjectURL(link.href)
URL.revokeObjectURL(link.href) */
})
})
}

Loading…
Cancel
Save