mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-13 02:57:13 +08:00
feat: 代码生成增加了 TREE_SELECT/CHECK_GROUP/INPUT_NUMBER/INPUT_PASSWORD控件
This commit is contained in:
@@ -55,7 +55,26 @@ public enum FormTypeEnum implements IBaseEnum<Integer> {
|
||||
* 日期时间框
|
||||
*/
|
||||
DATE_TIME(6, "日期时间框"),;
|
||||
|
||||
/**
|
||||
* 树形选择
|
||||
*/
|
||||
TREE_SELECT(7, "树选择"),
|
||||
/**
|
||||
* 复选框
|
||||
*/
|
||||
CHECK_GROUP(8, "复选框"),
|
||||
/**
|
||||
* 数字输入框
|
||||
*/
|
||||
INPUT_NUMBER(9, "数字输入框"),
|
||||
/**
|
||||
* 密码输入框
|
||||
*/
|
||||
INPUT_PASSWORD(10, "密码输入框"),
|
||||
/**
|
||||
* 开关
|
||||
*/
|
||||
SWITCH(11, "开关"),;
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
}
|
||||
|
@@ -1,7 +1,6 @@
|
||||
<template>
|
||||
<div class="table-page">
|
||||
<GiTable
|
||||
ref="tableRef"
|
||||
row-key="id"
|
||||
title="${businessName}管理"
|
||||
:data="dataList"
|
||||
@@ -16,10 +15,38 @@
|
||||
<template #custom-left>
|
||||
<#list fieldConfigs as fieldConfig>
|
||||
<#if fieldConfig.showInQuery>
|
||||
<#if fieldConfig.formType == "SELECT"><#-- 下拉框 -->
|
||||
<a-select
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
:options="${fieldConfig.columnName}_enum"
|
||||
placeholder="请选择${fieldConfig.comment}"
|
||||
allow-clear
|
||||
style="width: 150px"
|
||||
@change="search"
|
||||
/>
|
||||
<#elseif fieldConfig.formType == "RADIO"><#-- 单选框 -->
|
||||
<a-radio-group v-model="queryForm.${fieldConfig.fieldName}" :options="${fieldConfig.columnName}_enum" @change="search"/>
|
||||
<#elseif fieldConfig.formType == "DATE"><#-- 日期框 -->
|
||||
<a-date-picker
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
placeholder="请选择${fieldConfig.comment}"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<#elseif fieldConfig.formType == "DATE_TIME"><#-- 日期时间框 -->
|
||||
<a-date-picker
|
||||
v-model="queryForm.${fieldConfig.fieldName}"
|
||||
placeholder="请选择${fieldConfig.comment}"
|
||||
show-time
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<#else>
|
||||
<a-input v-model="queryForm.${fieldConfig.fieldName}" placeholder="请输入${fieldConfig.comment}" allow-clear @change="search">
|
||||
<template #prefix><icon-search /></template>
|
||||
</a-input>
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
<a-button @click="reset">重置</a-button>
|
||||
</template>
|
||||
@@ -67,6 +94,7 @@ import type { TableInstanceColumns } from '@/components/GiTable/type'
|
||||
import { useDownload, useTable } from '@/hooks'
|
||||
import { isMobile } from '@/utils'
|
||||
import has from '@/utils/has'
|
||||
import { useDict } from '@/hooks/app'
|
||||
|
||||
defineOptions({ name: '${classNamePrefix}' })
|
||||
|
||||
@@ -79,6 +107,14 @@ const queryForm = reactive<${classNamePrefix}Query>({
|
||||
sort: ['createTime,desc']
|
||||
})
|
||||
|
||||
<#list fieldConfigs as fieldConfig>
|
||||
<#if fieldConfig.showInQuery>
|
||||
<#if fieldConfig.formType == "SELECT" || fieldConfig.formType == "RADIO">
|
||||
const { ${fieldConfig.columnName}_enum } = useDict('${fieldConfig.columnName}_enum')
|
||||
</#if>
|
||||
</#if>
|
||||
</#list>
|
||||
|
||||
const {
|
||||
tableData: dataList,
|
||||
loading,
|
||||
@@ -91,7 +127,7 @@ const columns: TableInstanceColumns[] = [
|
||||
<#if fieldConfigs??>
|
||||
<#list fieldConfigs as fieldConfig>
|
||||
<#if fieldConfig.showInList>
|
||||
{ title: '${fieldConfig.comment}', dataIndex: '${fieldConfig.fieldName}', slotName: ${fieldConfig.fieldName} },
|
||||
{ title: '${fieldConfig.comment}', dataIndex: '${fieldConfig.fieldName}', slotName: '${fieldConfig.fieldName}' },
|
||||
</#if>
|
||||
</#list>
|
||||
</#if>
|
||||
|
Reference in New Issue
Block a user