Browse Source

perf: typo

xingyu 2 years ago
parent
commit
3cfa787ede

+ 31 - 7
yudao-ui-admin-vue3/src/api/infra/apiAccessLog/index.ts

@@ -3,24 +3,48 @@ import request from '@/config/axios'
 export interface ApiAccessLogVO {
   id: number
   traceId: string
-  userId: string
-  userType: string
+  userId: number
+  userType: number
   applicationName: string
   requestMethod: string
   requestParams: string
   requestUrl: string
-  beginTime: string
-  endTIme: string
-  duration: string
+  userIp: string
+  userAgent: string
+  beginTime: Date
+  endTIme: Date
+  duration: number
   resultCode: number
+  resultMsg: string
+  createTime: Date
+}
+
+export interface ApiAccessLogPageReqVO extends PageParam {
+  userId?: number
+  userType?: number
+  applicationName?: string
+  requestUrl?: string
+  beginTime?: Date[]
+  duration?: number
+  resultCode?: number
+}
+
+export interface ApiAccessLogExportReqVO {
+  userId?: number
+  userType?: number
+  applicationName?: string
+  requestUrl?: string
+  beginTime?: Date[]
+  duration?: number
+  resultCode?: number
 }
 
 // 查询列表API 访问日志
-export const getApiAccessLogPageApi = (params) => {
+export const getApiAccessLogPageApi = (params: ApiAccessLogPageReqVO) => {
   return request.get({ url: '/infra/api-access-log/page', params })
 }
 
 // 导出API 访问日志
-export const exportApiAccessLogApi = (params) => {
+export const exportApiAccessLogApi = (params: ApiAccessLogExportReqVO) => {
   return request.download({ url: '/infra/api-access-log/export-excel', params })
 }

+ 35 - 8
yudao-ui-admin-vue3/src/api/infra/apiErrorLog/index.ts

@@ -2,24 +2,51 @@ import request from '@/config/axios'
 
 export interface ApiErrorLogVO {
   id: number
-  userId: string
-  userIp: string
-  userAgent: string
-  userType: string
+  traceId: string
+  userId: number
+  userType: number
   applicationName: string
   requestMethod: string
   requestParams: string
   requestUrl: string
-  exceptionTime: string
+  userIp: string
+  userAgent: string
+  exceptionTime: Date
   exceptionName: string
+  exceptionMessage: string
+  exceptionRootCauseMessage: string
   exceptionStackTrace: string
-  processUserId: string
+  exceptionClassName: string
+  exceptionFileName: string
+  exceptionMethodName: string
+  exceptionLineNumber: number
+  processUserId: number
   processStatus: number
+  processTime: Date
   resultCode: number
+  createTime: Date
+}
+
+export interface ApiErrorLogPageReqVO extends PageParam {
+  userId?: number
+  userType?: number
+  applicationName?: string
+  requestUrl?: string
+  exceptionTime?: Date[]
+  processStatus: number
+}
+
+export interface ApiErrorLogExportReqVO {
+  userId?: number
+  userType?: number
+  applicationName?: string
+  requestUrl?: string
+  exceptionTime?: Date[]
+  processStatus: number
 }
 
 // 查询列表API 访问日志
-export const getApiErrorLogPageApi = (params) => {
+export const getApiErrorLogPageApi = (params: ApiErrorLogPageReqVO) => {
   return request.get({ url: '/infra/api-error-log/page', params })
 }
 
@@ -31,7 +58,7 @@ export const updateApiErrorLogPageApi = (id: number, processStatus: number) => {
 }
 
 // 导出API 访问日志
-export const exportApiErrorLogApi = (params) => {
+export const exportApiErrorLogApi = (params: ApiErrorLogExportReqVO) => {
   return request.download({
     url: '/infra/api-error-log/export-excel',
     params

+ 2 - 2
yudao-ui-admin-vue3/src/api/infra/codegen/types.ts

@@ -12,8 +12,8 @@ export type CodegenTableVO = {
   className: string
   classComment: string
   author: string
-  createTime: string
-  updateTime: string
+  createTime: Date
+  updateTime: Date
   templateType: number
   parentMenuId: number
 }

+ 7 - 5
yudao-ui-admin-vue3/src/api/infra/config/index.ts

@@ -2,26 +2,28 @@ import request from '@/config/axios'
 
 export interface ConfigVO {
   id: number
-  group: string
+  category: string
   name: string
   key: string
   value: string
-  type: string
+  type: number
   visible: boolean
   remark: string
-  createTime: string
+  createTime: Date
 }
 
 export interface ConfigPageReqVO extends PageParam {
   name?: string
+  key?: string
   type?: number
-  createTime?: string[]
+  createTime?: Date[]
 }
 
 export interface ConfigExportReqVO {
   name?: string
+  key?: string
   type?: number
-  createTime?: string[]
+  createTime?: Date[]
 }
 
 // 查询参数列表

+ 1 - 1
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/index.ts

@@ -6,7 +6,7 @@ export interface DataSourceConfigVO {
   url: string
   username: string
   password: string
-  createTime: string
+  createTime: Date
 }
 
 // 查询数据源配置列表

+ 19 - 13
yudao-ui-admin-vue3/src/api/infra/fileConfig/index.ts

@@ -1,16 +1,16 @@
 import request from '@/config/axios'
 
-export interface ConfigType {
+export interface FileClientConfig {
   basePath: string
-  host: string
-  port: string
-  username: string
-  password: string
-  mode: string
-  endpoint: string
-  bucket: string
-  accessKey: string
-  accessSecret: string
+  host?: string
+  port?: number
+  username?: string
+  password?: string
+  mode?: string
+  endpoint?: string
+  bucket?: string
+  accessKey?: string
+  accessSecret?: string
   domain: string
 }
 export interface FileConfigVO {
@@ -19,13 +19,19 @@ export interface FileConfigVO {
   storage: number
   master: boolean
   visible: boolean
-  config: ConfigType
+  config: FileClientConfig
   remark: string
-  createTime: string
+  createTime: Date
+}
+
+export interface FileConfigPageReqVO extends PageParam {
+  name?: string
+  storage?: number
+  createTime?: Date[]
 }
 
 // 查询文件配置列表
-export const getFileConfigPageApi = (params) => {
+export const getFileConfigPageApi = (params: FileConfigPageReqVO) => {
   return request.get({ url: '/infra/file-config/page', params })
 }
 

+ 6 - 3
yudao-ui-admin-vue3/src/api/infra/fileList/index.ts

@@ -2,16 +2,19 @@ import request from '@/config/axios'
 
 export interface FileVO {
   id: number
+  configId: number
   path: string
+  name: string
   url: string
   size: string
   type: string
-  createTime: string
+  createTime: Date
 }
 
 export interface FilePageReqVO extends PageParam {
-  name?: string
-  createTime?: string[]
+  path?: string
+  type?: string
+  createTime?: Date[]
 }
 
 // 查询文件列表

+ 15 - 2
yudao-ui-admin-vue3/src/api/infra/job/index.ts

@@ -10,10 +10,23 @@ export interface JobVO {
   retryCount: number
   retryInterval: number
   monitorTimeout: number
+  createTime: Date
+}
+
+export interface JobPageReqVO extends PageParam {
+  name?: string
+  status?: number
+  handlerName?: string
+}
+
+export interface JobExportReqVO {
+  name?: string
+  status?: number
+  handlerName?: string
 }
 
 // 任务列表
-export const getJobPageApi = (params) => {
+export const getJobPageApi = (params: JobPageReqVO) => {
   return request.get({ url: '/infra/job/page', params })
 }
 
@@ -38,7 +51,7 @@ export const deleteJobApi = (id: number) => {
 }
 
 // 导出定时任务调度
-export const exportJobApi = (params) => {
+export const exportJobApi = (params: JobExportReqVO) => {
   return request.download({ url: '/infra/job/export-excel', params })
 }
 

+ 18 - 2
yudao-ui-admin-vue3/src/api/infra/jobLog/index.ts

@@ -14,8 +14,24 @@ export interface JobLogVO {
   createTime: string
 }
 
+export interface JobLogPageReqVO extends PageParam {
+  jobId?: number
+  handlerName?: string
+  beginTime?: string
+  endTime?: string
+  status?: number
+}
+
+export interface JobLogExportReqVO {
+  jobId?: number
+  handlerName?: string
+  beginTime?: string
+  endTime?: string
+  status?: number
+}
+
 // 任务日志列表
-export const getJobLogPageApi = (params) => {
+export const getJobLogPageApi = (params: JobLogPageReqVO) => {
   return request.get({ url: '/infra/job-log/page', params })
 }
 
@@ -25,7 +41,7 @@ export const getJobLogApi = (id: number) => {
 }
 
 // 导出定时任务日志
-export const exportJobLogApi = (params) => {
+export const exportJobLogApi = (params: JobLogExportReqVO) => {
   return request.download({
     url: '/infra/job-log/export-excel',
     params

+ 8 - 0
yudao-ui-admin-vue3/src/plugins/vxeTable/index.ts

@@ -175,6 +175,14 @@ VXETable.formats.mixin({
   // 格式化图片,将图片链接转换为html标签
   formatImg({ cellValue }) {
     return '<img height="40" src="' + cellValue + '"> '
+  },
+  // 格式化文件大小
+  formatSize({ cellValue }, digits = 0) {
+    const unitArr = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
+    const srcSize = parseFloat(cellValue)
+    const index = Math.floor(Math.log(srcSize) / Math.log(1024))
+    const size = srcSize / Math.pow(1024, index)
+    return XEUtils.toFixed(XEUtils.floor(size, 2), 2) + ' ' + unitArr[digits]
   }
 })
 export const setupVxeTable = (app: App<Element>) => {

+ 20 - 0
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataPicker.tsx

@@ -0,0 +1,20 @@
+import { ElDatePicker } from 'element-plus'
+import { VXETable } from 'vxe-table'
+
+// 日期区间选择渲染
+VXETable.renderer.add('XDataPicker', {
+  // 默认显示模板
+  renderItemContent(renderOpts, params) {
+    const { data, field } = params
+    const { content } = renderOpts
+    return (
+      <ElDatePicker
+        v-model={data[field]}
+        style="width: 100%"
+        type={content ? (content as any) : 'datetime'}
+        value-format="YYYY-MM-DD HH:mm:ss"
+        clearable
+      ></ElDatePicker>
+    )
+  }
+})

+ 0 - 0
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataTimePicker.tsx → yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/dataTimeRangePicker.tsx


+ 2 - 1
yudao-ui-admin-vue3/src/plugins/vxeTable/renderer/index.tsx

@@ -1,4 +1,5 @@
-import './dataTimePicker'
+import './dataPicker'
+import './dataTimeRangePicker'
 import './dict'
 import './html'
 import './link'

+ 12 - 4
yudao-ui-admin-vue3/src/views/infra/fileList/fileList.data.ts

@@ -11,10 +11,12 @@ const crudSchemas = reactive<VxeCrudSchema>({
   columns: [
     {
       title: '文件名',
+      field: 'name'
+    },
+    {
+      title: '文件路径',
       field: 'path',
-      search: {
-        show: true
-      }
+      isSearch: true
     },
     {
       title: 'URL',
@@ -25,9 +27,15 @@ const crudSchemas = reactive<VxeCrudSchema>({
         }
       }
     },
+    {
+      title: '文件大小',
+      field: 'size',
+      formatter: 'formatSize'
+    },
     {
       title: '文件类型',
-      field: 'type'
+      field: 'type',
+      isSearch: true
     },
     {
       title: t('common.createTime'),

+ 3 - 4
yudao-ui-admin-vue3/src/views/infra/job/job.data.ts

@@ -23,16 +23,15 @@ const crudSchemas = reactive<VxeCrudSchema>({
     {
       title: '任务名称',
       field: 'name',
-      search: {
-        show: true
-      }
+      isSearch: true
     },
     {
       title: t('common.status'),
       field: 'status',
       dictType: DICT_TYPE.INFRA_JOB_STATUS,
       dictClass: 'number',
-      isForm: false
+      isForm: false,
+      isSearch: true
     },
     {
       title: '处理器的名字',

+ 2 - 2
yudao-ui-admin-vue3/src/views/infra/job/jobLog.data.ts

@@ -41,7 +41,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
       search: {
         show: true,
         itemRender: {
-          name: 'XDataTimePicker'
+          name: 'XDataPicker'
         }
       }
     },
@@ -53,7 +53,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
       search: {
         show: true,
         itemRender: {
-          name: 'XDataTimePicker'
+          name: 'XDataPicker'
         }
       }
     },