!133 新增 ele 代码生成示例

Merge pull request !133 from puhui999/dev
This commit is contained in:
xingyu
2025-06-07 07:03:01 +00:00
committed by Gitee
71 changed files with 8024 additions and 149 deletions

View File

@@ -69,6 +69,8 @@ function updateTreeSchema(): void {
treeFormApi.setState({
schema: useGenerationInfoTreeFormSchema(props.columns),
});
// 树表信息回显
treeFormApi.setValues(props.table as any);
}
/** 更新主子表信息表单 schema */
@@ -76,6 +78,8 @@ function updateSubSchema(): void {
subFormApi.setState({
schema: useGenerationInfoSubTableFormSchema(props.columns, tables.value),
});
// 主子表信息回显
subFormApi.setValues(props.table as any);
}
/** 获取合并的表单值 */

View File

@@ -86,17 +86,17 @@ const [FormModal, formModalApi] = useVbenModal({
});
/** 创建示例联系人 */
function onCreate() {
function handleCreate() {
formModalApi.setData({}).open();
}
/** 编辑示例联系人 */
function onEdit(row: Demo01ContactApi.Demo01Contact) {
function handleEdit(row: Demo01ContactApi.Demo01Contact) {
formModalApi.setData(row).open();
}
/** 删除示例联系人 */
async function onDelete(row: Demo01ContactApi.Demo01Contact) {
async function handleDelete(row: Demo01ContactApi.Demo01Contact) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]),
duration: 0,
@@ -115,7 +115,7 @@ async function onDelete(row: Demo01ContactApi.Demo01Contact) {
}
/** 批量删除示例联系人 */
async function onDeleteBatch() {
async function handleDeleteBatch() {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting'),
duration: 0,
@@ -173,7 +173,6 @@ onMounted(() => {
class="w-full"
/>
</Form.Item>
<!-- TODO @puhui999貌似性别的宽度不对并且选择后会变哈 -->
<Form.Item label="性别" name="sex">
<Select
v-model:value="queryParams.sex"
@@ -181,7 +180,6 @@ onMounted(() => {
allow-clear
class="w-full"
>
<!-- TODO @puhui999要不咱还是把 getIntDictOptions 还是搞出来总归方便点~ -->
<Select.Option
v-for="dict in getDictOptions(
DICT_TYPE.SYSTEM_USER_SEX,
@@ -221,7 +219,7 @@ onMounted(() => {
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
@click="handleCreate"
v-access:code="['infra:demo01-contact:create']"
>
{{ $t('ui.actionTitle.create', ['示例联系人']) }}
@@ -242,7 +240,7 @@ onMounted(() => {
danger
class="ml-2"
:disabled="isEmpty(checkedIds)"
@click="onDeleteBatch"
@click="handleDeleteBatch"
v-access:code="['infra:demo01-contact:delete']"
>
批量删除
@@ -282,7 +280,7 @@ onMounted(() => {
<Button
size="small"
type="link"
@click="onEdit(row as any)"
@click="handleEdit(row as any)"
v-access:code="['infra:demo01-contact:update']"
>
{{ $t('ui.actionTitle.edit') }}
@@ -292,7 +290,7 @@ onMounted(() => {
type="link"
danger
class="ml-2"
@click="onDelete(row as any)"
@click="handleDelete(row as any)"
v-access:code="['infra:demo01-contact:delete']"
>
{{ $t('ui.actionTitle.delete') }}