From 76c5c7c1de79517f4585af16eb48a0f854366f77 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Wed, 29 Mar 2023 09:09:34 +0800 Subject: [PATCH] =?UTF-8?q?REVIEW=20=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/codegen/index.ts | 70 ++++++++++++++- src/api/infra/codegen/types.ts | 61 ------------- src/locales/zh-CN.ts | 3 +- src/views/infra/codegen/EditTable.vue | 2 +- src/views/infra/codegen/codegen.data.ts | 53 ----------- src/views/infra/codegen/index.vue | 112 ++++++++++++------------ 6 files changed, 128 insertions(+), 173 deletions(-) delete mode 100644 src/api/infra/codegen/types.ts delete mode 100644 src/views/infra/codegen/codegen.data.ts diff --git a/src/api/infra/codegen/index.ts b/src/api/infra/codegen/index.ts index 993bd552..64701efe 100644 --- a/src/api/infra/codegen/index.ts +++ b/src/api/infra/codegen/index.ts @@ -1,8 +1,74 @@ import request from '@/config/axios' -import type { CodegenUpdateReqVO, CodegenCreateListReqVO } from './types' + +export type CodegenTableVO = { + id: number + tableId: number + isParentMenuIdValid: boolean + dataSourceConfigId: number + scene: number + tableName: string + tableComment: string + remark: string + moduleName: string + businessName: string + className: string + classComment: string + author: string + createTime: Date + updateTime: Date + templateType: number + parentMenuId: number +} + +export type CodegenColumnVO = { + id: number + tableId: number + columnName: string + dataType: string + columnComment: string + nullable: number + primaryKey: number + autoIncrement: string + ordinalPosition: number + javaType: string + javaField: string + dictType: string + example: string + createOperation: number + updateOperation: number + listOperation: number + listOperationCondition: string + listOperationResult: number + htmlType: string +} + +export type DatabaseTableVO = { + name: string + comment: string +} + +export type CodegenDetailVO = { + table: CodegenTableVO + columns: CodegenColumnVO[] +} + +export type CodegenPreviewVO = { + filePath: string + code: string +} + +export type CodegenUpdateReqVO = { + table: CodegenTableVO | any + columns: CodegenColumnVO[] +} + +export type CodegenCreateListReqVO = { + dataSourceConfigId: number + tableNames: string[] +} // 查询列表代码生成表定义 -export const getCodegenTablePage = (params) => { +export const getCodegenTablePage = (params: PageParam) => { return request.get({ url: '/infra/codegen/table/page', params }) } diff --git a/src/api/infra/codegen/types.ts b/src/api/infra/codegen/types.ts deleted file mode 100644 index e4e78843..00000000 --- a/src/api/infra/codegen/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -export type CodegenTableVO = { - id: number - tableId: number - isParentMenuIdValid: boolean - dataSourceConfigId: number - scene: number - tableName: string - tableComment: string - remark: string - moduleName: string - businessName: string - className: string - classComment: string - author: string - createTime: Date - updateTime: Date - templateType: number - parentMenuId: number -} - -export type CodegenColumnVO = { - id: number - tableId: number - columnName: string - dataType: string - columnComment: string - nullable: number - primaryKey: number - autoIncrement: string - ordinalPosition: number - javaType: string - javaField: string - dictType: string - example: string - createOperation: number - updateOperation: number - listOperation: number - listOperationCondition: string - listOperationResult: number - htmlType: string -} -export type DatabaseTableVO = { - name: string - comment: string -} -export type CodegenDetailVO = { - table: CodegenTableVO - columns: CodegenColumnVO[] -} -export type CodegenPreviewVO = { - filePath: string - code: string -} -export type CodegenUpdateReqVO = { - table: CodegenTableVO | any - columns: CodegenColumnVO[] -} -export type CodegenCreateListReqVO = { - dataSourceConfigId: number - tableNames: string[] -} diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index ea1392c4..6f46f1ab 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -298,8 +298,7 @@ export default { typeUpdate: '字典类型编辑', dataCreate: '字典数据新增', dataUpdate: '字典数据编辑', - fileUpload: '上传文件', - back: '返回' + fileUpload: '上传文件' }, dialog: { dialog: '弹窗', diff --git a/src/views/infra/codegen/EditTable.vue b/src/views/infra/codegen/EditTable.vue index 34ba3bd6..79922ffc 100644 --- a/src/views/infra/codegen/EditTable.vue +++ b/src/views/infra/codegen/EditTable.vue @@ -16,7 +16,7 @@ {{ t('action.save') }} - {{ t('action.back') }} + 返回 diff --git a/src/views/infra/codegen/codegen.data.ts b/src/views/infra/codegen/codegen.data.ts deleted file mode 100644 index f3723a35..00000000 --- a/src/views/infra/codegen/codegen.data.ts +++ /dev/null @@ -1,53 +0,0 @@ -import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' -const { t } = useI18n() // 国际化 - -// 表单校验 -export const rules = reactive({ - title: [required], - type: [required], - status: [required] -}) - -// CrudSchema -const crudSchemas = reactive({ - primaryKey: 'id', - primaryType: 'seq', - action: true, - actionWidth: '400px', - columns: [ - { - title: '表名称', - field: 'tableName', - isSearch: true - }, - { - title: '表描述', - field: 'tableComment', - isSearch: true - }, - { - title: '实体', - field: 'className', - isSearch: true - }, - { - title: t('common.createTime'), - field: 'createTime', - formatter: 'formatDate', - isForm: false, - search: { - show: true, - itemRender: { - name: 'XDataTimePicker' - } - } - }, - { - title: t('common.updateTime'), - field: 'updateTime', - formatter: 'formatDate', - isForm: false - } - ] -}) -export const { allSchemas } = useVxeCrudSchemas(crudSchemas) diff --git a/src/views/infra/codegen/index.vue b/src/views/infra/codegen/index.vue index 591f99d3..b975779a 100644 --- a/src/views/infra/codegen/index.vue +++ b/src/views/infra/codegen/index.vue @@ -1,13 +1,20 @@