Skip to content

Commit

Permalink
feat(generator): 代码生成字段配置支持自定义名称、类型
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Aug 29, 2024
1 parent 6574181 commit a8d0cc2
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions src/views/tool/generator/GenConfigDrawer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,28 @@
</a-tooltip>
</a-popconfirm>
</template>
<template #fieldName="{ record }">
<a-input v-model="record.fieldName" />
</template>
<template #fieldType="{ record }">
<span v-if="record.fieldType">{{ record.fieldType }}</span>
<a-tooltip v-else content="请检查 generator.properties 配置">
<icon-exclamation-circle-fill size="large" style="color: #f53f3f" />
</a-tooltip>
<a-select
v-model="record.fieldType"
:default-value="1"
placeholder="请选择字段类型"
allow-search
allow-create
:error="!record.fieldType"
>
<a-option value="String">String</a-option>
<a-option value="Integer">Integer</a-option>
<a-option value="Long">Long</a-option>
<a-option value="Float">Float</a-option>
<a-option value="Double">Double</a-option>
<a-option value="Boolean">Boolean</a-option>
<a-option value="BigDecimal">BigDecimal</a-option>
<a-option value="LocalDate">LocalDate</a-option>
<a-option value="LocalDateTime">LocalDateTime</a-option>
</a-select>
</template>
<template #comment="{ record }">
<a-input v-model="record.comment" />
Expand All @@ -93,6 +110,7 @@
v-if="record.showInForm || record.showInQuery"
v-model="record.formType"
:options="form_type_enum"
:default-value="1"
placeholder="请选择表单类型"
/>
<span v-else>无需设置</span>
Expand All @@ -102,6 +120,7 @@
v-if="record.showInQuery"
v-model="record.queryType"
:options="query_type_enum"
:default-value="1"
placeholder="请选择查询方式"
/>
<span v-else>无需设置</span>
Expand Down Expand Up @@ -138,14 +157,14 @@ const { form_type_enum, query_type_enum } = useDict('form_type_enum', 'query_typ
// Table 字段配置
const columns: TableInstanceColumns[] = [
{ title: '名称', dataIndex: 'fieldName', width: 125, ellipsis: true, tooltip: true },
{ title: '类型', dataIndex: 'fieldType' },
{ title: '名称', slotName: 'fieldName' },
{ title: '类型', slotName: 'fieldType' },
{ title: '描述', slotName: 'comment', width: 170 },
{ title: '列表', slotName: 'showInList', width: 60, align: 'center' },
{ title: '表单', slotName: 'showInForm', width: 60, align: 'center' },
{ title: '必填', slotName: 'isRequired', width: 60, align: 'center' },
{ title: '查询', slotName: 'showInQuery', width: 60, align: 'center' },
{ title: '表单类型', slotName: 'formType', width: 150 },
{ title: '表单类型', slotName: 'formType' },
{ title: '查询方式', slotName: 'queryType' },
{ title: '关联字典', slotName: 'dictCode' }
]
Expand Down

0 comments on commit a8d0cc2

Please sign in to comment.