mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-11-04 10:57:08 +08:00 
			
		
		
		
	fix:导出加载条显示异常,下载参数
This commit is contained in:
		@@ -4,7 +4,7 @@ import type * as System from './type'
 | 
			
		||||
const BASE_URL = '/system/log'
 | 
			
		||||
 | 
			
		||||
/** @desc 查询日志列表 */
 | 
			
		||||
export function listLog(query: System.LogQuery) {
 | 
			
		||||
export function listLog(query: System.PageLogQuery) {
 | 
			
		||||
  return http.get<PageRes<System.LogResp[]>>(`${BASE_URL}`, query)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,10 @@ export interface LogDetailResp extends LogResp {
 | 
			
		||||
  responseHeaders: string
 | 
			
		||||
  responseBody: string
 | 
			
		||||
}
 | 
			
		||||
export interface LogQuery extends PageQuery {
 | 
			
		||||
// 系统日志分页查询条件
 | 
			
		||||
export interface PageLogQuery extends PageQuery,LogQuery{}
 | 
			
		||||
// 系统日志查询条件
 | 
			
		||||
export interface LogQuery{
 | 
			
		||||
  description?: string
 | 
			
		||||
  module?: string
 | 
			
		||||
  ip?: string
 | 
			
		||||
 
 | 
			
		||||
@@ -11,14 +11,13 @@ interface NavigatorWithMsSaveOrOpenBlob extends Navigator {
 | 
			
		||||
  msSaveOrOpenBlob(blob: Blob, fileName: string): void
 | 
			
		||||
}
 | 
			
		||||
export const useDownload = async (
 | 
			
		||||
  api: (param: any) => Promise<any>,
 | 
			
		||||
  tempName: string = '',
 | 
			
		||||
  params: any = {},
 | 
			
		||||
  api: () => Promise<any>,
 | 
			
		||||
  isNotify = true,
 | 
			
		||||
  tempName: string = '',
 | 
			
		||||
  fileType = '.xlsx'
 | 
			
		||||
) => {
 | 
			
		||||
  try {
 | 
			
		||||
    const res = await api(params)
 | 
			
		||||
    const res = await api()
 | 
			
		||||
    if (res.headers['content-disposition']) {
 | 
			
		||||
      tempName = decodeURI(res.headers['content-disposition'].split(';')[1].split('=')[1]);
 | 
			
		||||
    } else {
 | 
			
		||||
 
 | 
			
		||||
@@ -62,6 +62,7 @@ http.interceptors.response.use(
 | 
			
		||||
    const { data } = response
 | 
			
		||||
    const { success, code, msg } = data
 | 
			
		||||
    if(response.request.responseType==='blob'){
 | 
			
		||||
      NProgress.done()
 | 
			
		||||
      return response
 | 
			
		||||
    }
 | 
			
		||||
    // 成功
 | 
			
		||||
 
 | 
			
		||||
@@ -97,7 +97,7 @@ const columns: TableInstance['columns'] = [
 | 
			
		||||
]
 | 
			
		||||
//导出登录日志
 | 
			
		||||
const onExportFile = ()=>{
 | 
			
		||||
  useDownload(exportLog,'',queryForm)
 | 
			
		||||
  useDownload(()=>exportLog(queryForm))
 | 
			
		||||
}
 | 
			
		||||
const queryForm = reactive({
 | 
			
		||||
  module: '登录',
 | 
			
		||||
 
 | 
			
		||||
@@ -111,7 +111,7 @@ const columns: TableInstance['columns'] = [
 | 
			
		||||
]
 | 
			
		||||
//导出操作日志
 | 
			
		||||
const onExportFile = ()=>{
 | 
			
		||||
  useDownload(exportOperateLog,'',queryForm)
 | 
			
		||||
  useDownload(()=>exportOperateLog(queryForm))
 | 
			
		||||
}
 | 
			
		||||
const queryForm = reactive({
 | 
			
		||||
  description: undefined,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user