mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-01 02:38:43 +08:00 
			
		
		
		
	refactor: api type
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type ConfigVO = { | export interface ConfigVO { | ||||||
|   id: number |   id: number | ||||||
|   group: string |   group: string | ||||||
|   name: string |   name: string | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type DataSourceConfigVO = { | export interface DataSourceConfigVO { | ||||||
|   id: number |   id: number | ||||||
|   name: string |   name: string | ||||||
|   url: string |   url: string | ||||||
|   | |||||||
| @@ -1,8 +0,0 @@ | |||||||
| export type DataSourceConfigVO = { |  | ||||||
|   id: number |  | ||||||
|   name: string |  | ||||||
|   url: string |  | ||||||
|   username: string |  | ||||||
|   password: string |  | ||||||
|   createTime: string |  | ||||||
| } |  | ||||||
| @@ -1,5 +1,28 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| import type { FileConfigVO } from './types' |  | ||||||
|  | export interface ConfigType { | ||||||
|  |   basePath: string | ||||||
|  |   host: string | ||||||
|  |   port: string | ||||||
|  |   username: string | ||||||
|  |   password: string | ||||||
|  |   mode: string | ||||||
|  |   endpoint: string | ||||||
|  |   bucket: string | ||||||
|  |   accessKey: string | ||||||
|  |   accessSecret: string | ||||||
|  |   domain: string | ||||||
|  | } | ||||||
|  | export interface FileConfigVO { | ||||||
|  |   id: number | ||||||
|  |   name: string | ||||||
|  |   storage: string | ||||||
|  |   master: boolean | ||||||
|  |   visible: boolean | ||||||
|  |   config: ConfigType | ||||||
|  |   remark: string | ||||||
|  |   createTime: string | ||||||
|  | } | ||||||
|  |  | ||||||
| // 查询文件配置列表 | // 查询文件配置列表 | ||||||
| export const getFileConfigPageApi = (params) => { | export const getFileConfigPageApi = (params) => { | ||||||
|   | |||||||
| @@ -1,23 +0,0 @@ | |||||||
| export type ConfigType = { |  | ||||||
|   basePath: string |  | ||||||
|   host: string |  | ||||||
|   port: string |  | ||||||
|   username: string |  | ||||||
|   password: string |  | ||||||
|   mode: string |  | ||||||
|   endpoint: string |  | ||||||
|   bucket: string |  | ||||||
|   accessKey: string |  | ||||||
|   accessSecret: string |  | ||||||
|   domain: string |  | ||||||
| } |  | ||||||
| export type FileConfigVO = { |  | ||||||
|   id: number |  | ||||||
|   name: string |  | ||||||
|   storage: string |  | ||||||
|   master: boolean |  | ||||||
|   visible: boolean |  | ||||||
|   config: ConfigType |  | ||||||
|   remark: string |  | ||||||
|   createTime: string |  | ||||||
| } |  | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type FileVO = { | export interface FileVO { | ||||||
|   id: number |   id: number | ||||||
|   path: string |   path: string | ||||||
|   url: string |   url: string | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type JobVO = { | export interface JobVO { | ||||||
|   id: number |   id: number | ||||||
|   name: string |   name: string | ||||||
|   status: number |   status: number | ||||||
|   | |||||||
| @@ -1,11 +0,0 @@ | |||||||
| export type JobVO = { |  | ||||||
|   id: number |  | ||||||
|   name: string |  | ||||||
|   status: number |  | ||||||
|   handlerName: string |  | ||||||
|   handlerParam: string |  | ||||||
|   cronExpression: string |  | ||||||
|   retryCount: number |  | ||||||
|   retryInterval: number |  | ||||||
|   monitorTimeout: number |  | ||||||
| } |  | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type JobLogVO = { | export interface JobLogVO { | ||||||
|   id: number |   id: number | ||||||
|   jobId: number |   jobId: number | ||||||
|   handlerName: string |   handlerName: string | ||||||
|   | |||||||
| @@ -1,13 +0,0 @@ | |||||||
| export type JobLogVO = { |  | ||||||
|   id: number |  | ||||||
|   jobId: number |  | ||||||
|   handlerName: string |  | ||||||
|   handlerParam: string |  | ||||||
|   cronExpression: string |  | ||||||
|   executeIndex: string |  | ||||||
|   beginTime: Date |  | ||||||
|   endTime: Date |  | ||||||
|   duration: string |  | ||||||
|   status: number |  | ||||||
|   createTime: string |  | ||||||
| } |  | ||||||
| @@ -1,5 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| export type DeptVO = { |  | ||||||
|  | export interface DeptVO { | ||||||
|   id?: number |   id?: number | ||||||
|   name: string |   name: string | ||||||
|   parentId: number |   parentId: number | ||||||
|   | |||||||
| @@ -1,15 +0,0 @@ | |||||||
| export type DeptVO = { |  | ||||||
|   id: number |  | ||||||
|   name: string |  | ||||||
|   parentId: number |  | ||||||
|   status: number |  | ||||||
|   sort: number |  | ||||||
|   leaderUserId: number |  | ||||||
|   phone: string |  | ||||||
|   email: string |  | ||||||
| } |  | ||||||
|  |  | ||||||
| export type DeptListReqVO = { |  | ||||||
|   name: string |  | ||||||
|   status: number |  | ||||||
| } |  | ||||||
| @@ -1,4 +1,5 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export interface ErrorCodeVO { | export interface ErrorCodeVO { | ||||||
|   id: number |   id: number | ||||||
|   type: number |   type: number | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export interface NoticeVO { | export interface NoticeVO { | ||||||
|   id: number |   id: number | ||||||
|   title: string |   title: string | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export interface OAuth2ClientVO { | export interface OAuth2ClientVO { | ||||||
|   id: number |   id: number | ||||||
|   clientId: string |   clientId: string | ||||||
|   | |||||||
| @@ -22,6 +22,7 @@ export type OperateLogVO = { | |||||||
|   resultMsg: string |   resultMsg: string | ||||||
|   resultData: string |   resultData: string | ||||||
| } | } | ||||||
|  |  | ||||||
| export interface OperateLogPageReqVO extends PageParam { | export interface OperateLogPageReqVO extends PageParam { | ||||||
|   module?: string |   module?: string | ||||||
|   userNickname?: string |   userNickname?: string | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type RoleVO = { | export interface RoleVO { | ||||||
|   id: number |   id: number | ||||||
|   name: string |   name: string | ||||||
|   code: string |   code: string | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
|  |  | ||||||
| export type SensitiveWordVO = { | export interface SensitiveWordVO { | ||||||
|   id: number |   id: number | ||||||
|   name: string |   name: string | ||||||
|   status: number |   status: number | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| export type SmsChannelVO = { |  | ||||||
|  | export interface SmsChannelVO { | ||||||
|   id: number |   id: number | ||||||
|   status: number |   status: number | ||||||
|   signature: string |   signature: string | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| export type SmsLogVO = { |  | ||||||
|  | export interface SmsLogVO { | ||||||
|   id: number |   id: number | ||||||
|   idchannelId: number |   idchannelId: number | ||||||
|   templateId: number |   templateId: number | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| export type SmsTemplateVO = { |  | ||||||
|  | export interface SmsTemplateVO { | ||||||
|   id: number |   id: number | ||||||
|   type: number |   type: number | ||||||
|   status: number |   status: number | ||||||
|   | |||||||
| @@ -1,5 +1,6 @@ | |||||||
| import request from '@/config/axios' | import request from '@/config/axios' | ||||||
| export type UserVO = { |  | ||||||
|  | export interface UserVO { | ||||||
|   id: number |   id: number | ||||||
|   username: string |   username: string | ||||||
|   nickname: string |   nickname: string | ||||||
|   | |||||||
| @@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table' | |||||||
| import { FormExpose } from '@/components/Form' | import { FormExpose } from '@/components/Form' | ||||||
| // 业务相关的 import | // 业务相关的 import | ||||||
| import * as FileConfigApi from '@/api/infra/fileConfig' | import * as FileConfigApi from '@/api/infra/fileConfig' | ||||||
| import type { FileConfigVO } from '@/api/infra/fileConfig/types' |  | ||||||
| import { rules, allSchemas } from './fileConfig.data' | import { rules, allSchemas } from './fileConfig.data' | ||||||
|  |  | ||||||
| const { t } = useI18n() // 国际化 | const { t } = useI18n() // 国际化 | ||||||
| const message = useMessage() // 消息弹窗 | const message = useMessage() // 消息弹窗 | ||||||
| // 列表相关的变量 | // 列表相关的变量 | ||||||
| const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | ||||||
| const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigVO>({ | const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigApi.FileConfigVO>({ | ||||||
|   allSchemas: allSchemas, |   allSchemas: allSchemas, | ||||||
|   getListApi: FileConfigApi.getFileConfigPageApi, |   getListApi: FileConfigApi.getFileConfigPageApi, | ||||||
|   deleteApi: FileConfigApi.deleteFileConfigApi |   deleteApi: FileConfigApi.deleteFileConfigApi | ||||||
| @@ -135,7 +134,7 @@ const handleDetail = async (rowId: number) => { | |||||||
| } | } | ||||||
|  |  | ||||||
| // 主配置操作 | // 主配置操作 | ||||||
| const handleMaster = (row: FileConfigVO) => { | const handleMaster = (row: FileConfigApi.FileConfigVO) => { | ||||||
|   message |   message | ||||||
|     .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder')) |     .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder')) | ||||||
|     .then(async () => { |     .then(async () => { | ||||||
| @@ -158,7 +157,7 @@ const submitForm = async () => { | |||||||
|       actionLoading.value = true |       actionLoading.value = true | ||||||
|       // 提交请求 |       // 提交请求 | ||||||
|       try { |       try { | ||||||
|         const data = unref(formRef)?.formModel as FileConfigVO |         const data = unref(formRef)?.formModel as FileConfigApi.FileConfigVO | ||||||
|         if (actionType.value === 'create') { |         if (actionType.value === 'create') { | ||||||
|           await FileConfigApi.createFileConfigApi(data) |           await FileConfigApi.createFileConfigApi(data) | ||||||
|           message.success(t('common.createSuccess')) |           message.success(t('common.createSuccess')) | ||||||
|   | |||||||
| @@ -55,7 +55,6 @@ import { useI18n } from '@/hooks/web/useI18n' | |||||||
| import { useVxeGrid } from '@/hooks/web/useVxeGrid' | import { useVxeGrid } from '@/hooks/web/useVxeGrid' | ||||||
| import { VxeGridInstance } from 'vxe-table' | import { VxeGridInstance } from 'vxe-table' | ||||||
| import * as JobLogApi from '@/api/infra/jobLog' | import * as JobLogApi from '@/api/infra/jobLog' | ||||||
| import { JobLogVO } from '@/api/infra/jobLog/types' |  | ||||||
| import { allSchemas } from './jobLog.data' | import { allSchemas } from './jobLog.data' | ||||||
|  |  | ||||||
| const { t } = useI18n() // 国际化 | const { t } = useI18n() // 国际化 | ||||||
| @@ -74,7 +73,7 @@ const dialogTitle = ref('') // 弹出层标题 | |||||||
| const detailRef = ref() // 详情 Ref | const detailRef = ref() // 详情 Ref | ||||||
|  |  | ||||||
| // 详情操作 | // 详情操作 | ||||||
| const handleDetail = async (row: JobLogVO) => { | const handleDetail = async (row: JobLogApi.JobLogVO) => { | ||||||
|   // 设置数据 |   // 设置数据 | ||||||
|   const res = JobLogApi.getJobLogApi(row.id) |   const res = JobLogApi.getJobLogApi(row.id) | ||||||
|   detailRef.value = res |   detailRef.value = res | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 xingyu4j
					xingyu4j