Commit 7b40e5a5e427add46cf94b3b4ed0b258d114bbf0
1 parent
92bcaa04
refactor: api type
Showing
24 changed files
with
49 additions
and
89 deletions
yudao-ui-admin-vue3/src/api/infra/config/index.ts
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/index.ts
yudao-ui-admin-vue3/src/api/infra/dataSourceConfig/types.ts deleted
yudao-ui-admin-vue3/src/api/infra/fileConfig/index.ts
| 1 | import request from '@/config/axios' | 1 | import request from '@/config/axios' |
| 2 | -import type { FileConfigVO } from './types' | 2 | + |
| 3 | +export interface ConfigType { | ||
| 4 | + basePath: string | ||
| 5 | + host: string | ||
| 6 | + port: string | ||
| 7 | + username: string | ||
| 8 | + password: string | ||
| 9 | + mode: string | ||
| 10 | + endpoint: string | ||
| 11 | + bucket: string | ||
| 12 | + accessKey: string | ||
| 13 | + accessSecret: string | ||
| 14 | + domain: string | ||
| 15 | +} | ||
| 16 | +export interface FileConfigVO { | ||
| 17 | + id: number | ||
| 18 | + name: string | ||
| 19 | + storage: string | ||
| 20 | + master: boolean | ||
| 21 | + visible: boolean | ||
| 22 | + config: ConfigType | ||
| 23 | + remark: string | ||
| 24 | + createTime: string | ||
| 25 | +} | ||
| 3 | 26 | ||
| 4 | // 查询文件配置列表 | 27 | // 查询文件配置列表 |
| 5 | export const getFileConfigPageApi = (params) => { | 28 | export const getFileConfigPageApi = (params) => { |
yudao-ui-admin-vue3/src/api/infra/fileConfig/types.ts deleted
| 1 | -export type ConfigType = { | ||
| 2 | - basePath: string | ||
| 3 | - host: string | ||
| 4 | - port: string | ||
| 5 | - username: string | ||
| 6 | - password: string | ||
| 7 | - mode: string | ||
| 8 | - endpoint: string | ||
| 9 | - bucket: string | ||
| 10 | - accessKey: string | ||
| 11 | - accessSecret: string | ||
| 12 | - domain: string | ||
| 13 | -} | ||
| 14 | -export type FileConfigVO = { | ||
| 15 | - id: number | ||
| 16 | - name: string | ||
| 17 | - storage: string | ||
| 18 | - master: boolean | ||
| 19 | - visible: boolean | ||
| 20 | - config: ConfigType | ||
| 21 | - remark: string | ||
| 22 | - createTime: string | ||
| 23 | -} |
yudao-ui-admin-vue3/src/api/infra/fileList/index.ts
yudao-ui-admin-vue3/src/api/infra/job/index.ts
yudao-ui-admin-vue3/src/api/infra/job/types.ts deleted
yudao-ui-admin-vue3/src/api/infra/jobLog/index.ts
yudao-ui-admin-vue3/src/api/infra/jobLog/types.ts deleted
yudao-ui-admin-vue3/src/api/system/dept/index.ts
yudao-ui-admin-vue3/src/api/system/dept/types.ts deleted
yudao-ui-admin-vue3/src/api/system/errorCode/index.ts
yudao-ui-admin-vue3/src/api/system/notice/index.ts
yudao-ui-admin-vue3/src/api/system/oauth2/client.ts
yudao-ui-admin-vue3/src/api/system/operatelog/index.ts
| @@ -22,6 +22,7 @@ export type OperateLogVO = { | @@ -22,6 +22,7 @@ export type OperateLogVO = { | ||
| 22 | resultMsg: string | 22 | resultMsg: string |
| 23 | resultData: string | 23 | resultData: string |
| 24 | } | 24 | } |
| 25 | + | ||
| 25 | export interface OperateLogPageReqVO extends PageParam { | 26 | export interface OperateLogPageReqVO extends PageParam { |
| 26 | module?: string | 27 | module?: string |
| 27 | userNickname?: string | 28 | userNickname?: string |
yudao-ui-admin-vue3/src/api/system/role/index.ts
yudao-ui-admin-vue3/src/api/system/sensitiveWord/index.ts
yudao-ui-admin-vue3/src/api/system/sms/smsChannel/index.ts
yudao-ui-admin-vue3/src/api/system/sms/smsLog/index.ts
yudao-ui-admin-vue3/src/api/system/sms/smsTemplate/index.ts
yudao-ui-admin-vue3/src/api/system/user/index.ts
yudao-ui-admin-vue3/src/views/infra/fileConfig/index.vue
| @@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table' | @@ -86,14 +86,13 @@ import { VxeGridInstance } from 'vxe-table' | ||
| 86 | import { FormExpose } from '@/components/Form' | 86 | import { FormExpose } from '@/components/Form' |
| 87 | // 业务相关的 import | 87 | // 业务相关的 import |
| 88 | import * as FileConfigApi from '@/api/infra/fileConfig' | 88 | import * as FileConfigApi from '@/api/infra/fileConfig' |
| 89 | -import type { FileConfigVO } from '@/api/infra/fileConfig/types' | ||
| 90 | import { rules, allSchemas } from './fileConfig.data' | 89 | import { rules, allSchemas } from './fileConfig.data' |
| 91 | 90 | ||
| 92 | const { t } = useI18n() // 国际化 | 91 | const { t } = useI18n() // 国际化 |
| 93 | const message = useMessage() // 消息弹窗 | 92 | const message = useMessage() // 消息弹窗 |
| 94 | // 列表相关的变量 | 93 | // 列表相关的变量 |
| 95 | const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref | 94 | const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref |
| 96 | -const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigVO>({ | 95 | +const { gridOptions, getList, deleteData } = useVxeGrid<FileConfigApi.FileConfigVO>({ |
| 97 | allSchemas: allSchemas, | 96 | allSchemas: allSchemas, |
| 98 | getListApi: FileConfigApi.getFileConfigPageApi, | 97 | getListApi: FileConfigApi.getFileConfigPageApi, |
| 99 | deleteApi: FileConfigApi.deleteFileConfigApi | 98 | deleteApi: FileConfigApi.deleteFileConfigApi |
| @@ -135,7 +134,7 @@ const handleDetail = async (rowId: number) => { | @@ -135,7 +134,7 @@ const handleDetail = async (rowId: number) => { | ||
| 135 | } | 134 | } |
| 136 | 135 | ||
| 137 | // 主配置操作 | 136 | // 主配置操作 |
| 138 | -const handleMaster = (row: FileConfigVO) => { | 137 | +const handleMaster = (row: FileConfigApi.FileConfigVO) => { |
| 139 | message | 138 | message |
| 140 | .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder')) | 139 | .confirm('是否确认修改配置【 ' + row.name + ' 】为主配置?', t('common.reminder')) |
| 141 | .then(async () => { | 140 | .then(async () => { |
| @@ -158,7 +157,7 @@ const submitForm = async () => { | @@ -158,7 +157,7 @@ const submitForm = async () => { | ||
| 158 | actionLoading.value = true | 157 | actionLoading.value = true |
| 159 | // 提交请求 | 158 | // 提交请求 |
| 160 | try { | 159 | try { |
| 161 | - const data = unref(formRef)?.formModel as FileConfigVO | 160 | + const data = unref(formRef)?.formModel as FileConfigApi.FileConfigVO |
| 162 | if (actionType.value === 'create') { | 161 | if (actionType.value === 'create') { |
| 163 | await FileConfigApi.createFileConfigApi(data) | 162 | await FileConfigApi.createFileConfigApi(data) |
| 164 | message.success(t('common.createSuccess')) | 163 | message.success(t('common.createSuccess')) |
yudao-ui-admin-vue3/src/views/infra/job/JobLog.vue
| @@ -55,7 +55,6 @@ import { useI18n } from '@/hooks/web/useI18n' | @@ -55,7 +55,6 @@ import { useI18n } from '@/hooks/web/useI18n' | ||
| 55 | import { useVxeGrid } from '@/hooks/web/useVxeGrid' | 55 | import { useVxeGrid } from '@/hooks/web/useVxeGrid' |
| 56 | import { VxeGridInstance } from 'vxe-table' | 56 | import { VxeGridInstance } from 'vxe-table' |
| 57 | import * as JobLogApi from '@/api/infra/jobLog' | 57 | import * as JobLogApi from '@/api/infra/jobLog' |
| 58 | -import { JobLogVO } from '@/api/infra/jobLog/types' | ||
| 59 | import { allSchemas } from './jobLog.data' | 58 | import { allSchemas } from './jobLog.data' |
| 60 | 59 | ||
| 61 | const { t } = useI18n() // 国际化 | 60 | const { t } = useI18n() // 国际化 |
| @@ -74,7 +73,7 @@ const dialogTitle = ref('') // 弹出层标题 | @@ -74,7 +73,7 @@ const dialogTitle = ref('') // 弹出层标题 | ||
| 74 | const detailRef = ref() // 详情 Ref | 73 | const detailRef = ref() // 详情 Ref |
| 75 | 74 | ||
| 76 | // 详情操作 | 75 | // 详情操作 |
| 77 | -const handleDetail = async (row: JobLogVO) => { | 76 | +const handleDetail = async (row: JobLogApi.JobLogVO) => { |
| 78 | // 设置数据 | 77 | // 设置数据 |
| 79 | const res = JobLogApi.getJobLogApi(row.id) | 78 | const res = JobLogApi.getJobLogApi(row.id) |
| 80 | detailRef.value = res | 79 | detailRef.value = res |