|
|
|
@ -65,339 +65,6 @@ export const columns: BasicColumn[] = [
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
];
|
|
|
|
|
//查询数据
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
|
|
|
<#-- 开始循环 -->
|
|
|
|
|
<#list columns as po>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#if po.isQuery=='Y' && po.fieldName !='delFlag'>
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#assign query_flag=true>
|
|
|
|
|
<#assign query_field_dictCode="">
|
|
|
|
|
<#if po.dictTable?default("")?trim?length gt 1>
|
|
|
|
|
<#assign query_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
|
|
|
|
<#elseif po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
<#assign query_field_dictCode="${po.dictField}">
|
|
|
|
|
</#if>
|
|
|
|
|
<#if po.queryMode=='single'>
|
|
|
|
|
{
|
|
|
|
|
label: "${po.filedComment}",
|
|
|
|
|
field: "${po.fieldName}",
|
|
|
|
|
<#if po.classType=='sel_search'>
|
|
|
|
|
component: 'JSearchSelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dict:"${po.dictTable},${po.dictText},${po.dictField}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='sel_user'>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
component: 'JSelectUser',
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
<#elseif po.classType=='switch'>
|
|
|
|
|
component: 'JSwitch',
|
|
|
|
|
componentProps:{
|
|
|
|
|
query:true,
|
|
|
|
|
<#if po.dictField != 'is_open'>
|
|
|
|
|
options:${po.dictField}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='sel_depart'>
|
|
|
|
|
component: 'JSelectDept',
|
|
|
|
|
<#elseif po.classType=='list_multi'>
|
|
|
|
|
component: 'JSelectMultiple',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictTable?default("")?trim?length gt 1>
|
|
|
|
|
dictCode:"${po.dictTable},${po.dictText},${po.dictField}",
|
|
|
|
|
<#elseif po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
dictCode:"${po.dictField}",
|
|
|
|
|
</#if>
|
|
|
|
|
triggerChange: true
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='cat_tree'>
|
|
|
|
|
component: 'JCategorySelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
pcode:"${po.dictField?default("")}",//back和事件未添加,暂时有问题
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='date'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueFormat: 'YYYY-MM-DD'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='datetime'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
showTime:true,
|
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='pca'>
|
|
|
|
|
component: 'JAreaLinkage',
|
|
|
|
|
<#elseif po.classType=='popup'>
|
|
|
|
|
<#include "/common/form/vue3popup.ftl">
|
|
|
|
|
<#elseif po.classType=='list' || po.classType=='radio' || po.classType=='checkbox'>
|
|
|
|
|
<#-- ---------------------------下拉或是单选 判断数据字典是表字典还是普通字典------------------------------- -->
|
|
|
|
|
component: 'JDictSelectTag',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictTable?default("")?trim?length gt 1>
|
|
|
|
|
dictCode:"${po.dictTable},${po.dictText},${po.dictField}"
|
|
|
|
|
<#elseif po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
dictCode:"${po.dictField}"
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#else>
|
|
|
|
|
component: 'Input',
|
|
|
|
|
</#if>
|
|
|
|
|
//colProps: {span: 6},
|
|
|
|
|
},
|
|
|
|
|
<#else>
|
|
|
|
|
{
|
|
|
|
|
label: "${po.filedComment}",
|
|
|
|
|
field: "${po.fieldName}",
|
|
|
|
|
<#if po.classType=='date'>
|
|
|
|
|
component: 'RangePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueType: 'Date',
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='datetime'>
|
|
|
|
|
component: 'RangePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueType: 'Date',
|
|
|
|
|
showTime:true
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
|
|
|
|
component: 'JRangeNumber',
|
|
|
|
|
<#else>
|
|
|
|
|
component: 'Input', //TODO 范围查询
|
|
|
|
|
</#if>
|
|
|
|
|
//colProps: {span: 6},
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
<#-- 结束循环 -->
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
//表单数据
|
|
|
|
|
export const formSchema: FormSchema[] = [
|
|
|
|
|
<#assign form_cat_tree = false>
|
|
|
|
|
<#assign form_cat_back = "">
|
|
|
|
|
<#assign bpm_flag=false>
|
|
|
|
|
<#assign id_exists = false>
|
|
|
|
|
<#list columns as po><#rt/>
|
|
|
|
|
<#if po.fieldDbName=='bpm_status'>
|
|
|
|
|
<#assign bpm_flag=true>
|
|
|
|
|
</#if>
|
|
|
|
|
<#if po.fieldDbName == 'id'>
|
|
|
|
|
<#assign id_exists = true>
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#assign form_field_dictCode="">
|
|
|
|
|
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
|
|
|
|
<#elseif po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_field_dictCode="${po.dictField}">
|
|
|
|
|
</#if>
|
|
|
|
|
{
|
|
|
|
|
label: '${po.filedComment}',
|
|
|
|
|
field: ${autoStringSuffix(po)},
|
|
|
|
|
<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 -->
|
|
|
|
|
<#if po.defaultVal??>
|
|
|
|
|
<#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int">
|
|
|
|
|
defaultValue: ${po.defaultVal},
|
|
|
|
|
<#else>
|
|
|
|
|
defaultValue: "${po.defaultVal}",
|
|
|
|
|
</#if>
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 -->
|
|
|
|
|
<#if po.classType =='date'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
<#elseif po.classType =='datetime'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueFormat: 'YYYY-MM-DD'
|
|
|
|
|
},
|
|
|
|
|
componentProps: {
|
|
|
|
|
showTime:true,
|
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='time'>
|
|
|
|
|
component: 'TimePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueFormat: 'HH:mm:ss'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='popup'>
|
|
|
|
|
<#include "/common/form/vue3popup.ftl">
|
|
|
|
|
<#elseif po.classType =='sel_depart'>
|
|
|
|
|
component: 'JSelectDept',
|
|
|
|
|
<#elseif po.classType =='switch'>
|
|
|
|
|
component: 'JSwitch',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictField != 'is_open'>
|
|
|
|
|
options:${po.dictField}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='pca'>
|
|
|
|
|
component: 'JAreaLinkage',
|
|
|
|
|
<#elseif po.classType =='markdown'>
|
|
|
|
|
component: 'JMarkdownEditor',//注意string转换问题
|
|
|
|
|
<#elseif po.classType =='password'>
|
|
|
|
|
component: 'InputPassword',
|
|
|
|
|
<#elseif po.classType =='sel_user'>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
component: 'JSelectUser',
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
componentProps:{
|
|
|
|
|
labelKey:'realname',
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='textarea'>
|
|
|
|
|
component: 'InputTextArea',//TODO 注意string转换问题
|
|
|
|
|
<#elseif po.classType=='list'>
|
|
|
|
|
component: 'JDictSelectTag',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='radio'>
|
|
|
|
|
component: 'JDictSelectTag',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}",
|
|
|
|
|
type: "radio"
|
|
|
|
|
},
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
|
|
|
|
<#elseif po.classType=='list_multi'>
|
|
|
|
|
component: 'JSelectMultiple',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='checkbox'>
|
|
|
|
|
component: 'JCheckbox',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583] Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
|
|
|
|
<#elseif po.classType=='sel_search'>
|
|
|
|
|
component: 'JSearchSelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dict:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='cat_tree'>
|
|
|
|
|
<#assign form_cat_tree = true>
|
|
|
|
|
component: 'JCategorySelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
pcode:"${po.dictField?default("")}", //TODO back和事件未添加,暂时有问题
|
|
|
|
|
},
|
|
|
|
|
<#if po.dictText?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_cat_back = "${po.dictText}">
|
|
|
|
|
</#if>
|
|
|
|
|
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
|
|
|
|
component: 'InputNumber',
|
|
|
|
|
<#elseif po.classType=='file'>
|
|
|
|
|
component: 'JUpload',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.uploadnum??>
|
|
|
|
|
maxCount:${po.uploadnum}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='image'>
|
|
|
|
|
component: 'JImageUpload',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.uploadnum??>
|
|
|
|
|
fileMax:${po.uploadnum}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='umeditor'>
|
|
|
|
|
component: 'JEditor',
|
|
|
|
|
<#elseif po.classType == 'sel_tree'>
|
|
|
|
|
component: 'JTreeSelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictText??>
|
|
|
|
|
<#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
|
|
|
|
|
dict:"${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}",
|
|
|
|
|
<#elseif po.dictText?split(',')[1]??>
|
|
|
|
|
pidField:"${po.dictText?split(',')[1]}",
|
|
|
|
|
<#elseif po.dictText?split(',')[3]??>
|
|
|
|
|
hasChildField:"${po.dictText?split(',')[3]}",
|
|
|
|
|
</#if>
|
|
|
|
|
</#if>
|
|
|
|
|
pidValue:"${po.dictField}",
|
|
|
|
|
},
|
|
|
|
|
<#else>
|
|
|
|
|
component: 'Input',
|
|
|
|
|
</#if>
|
|
|
|
|
<#include "/common/utils.ftl">
|
|
|
|
|
<#if po.isShow == 'Y' && poHasCheck(po)>
|
|
|
|
|
dynamicRules: ({model,schema}) => {
|
|
|
|
|
<#if po.fieldName != 'id'>
|
|
|
|
|
<#assign fieldValidType = po.fieldValidType!''>
|
|
|
|
|
return [
|
|
|
|
|
<#-- 非空校验 -->
|
|
|
|
|
<#if po.nullable == 'N' || fieldValidType == '*'>
|
|
|
|
|
{ required: true, message: '请输入${po.filedComment}!'},
|
|
|
|
|
<#elseif fieldValidType!=''>
|
|
|
|
|
{ required: false},
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- 唯一校验 -->
|
|
|
|
|
<#if fieldValidType == 'only'>
|
|
|
|
|
{...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'</#if>, '${po.fieldDbName}',model,schema)[0]},
|
|
|
|
|
<#-- 6到16位数字 -->
|
|
|
|
|
<#elseif fieldValidType == 'n6-16'>
|
|
|
|
|
{ pattern: /^\d{6,16}$|^(?=\d+\.\d+)[\d.]{7,17}$/, message: '请输入6到16位数字!'},
|
|
|
|
|
<#-- 6到16位任意字符 -->
|
|
|
|
|
<#elseif fieldValidType == '*6-16'>
|
|
|
|
|
{ pattern: /^.{6,16}$/, message: '请输入6到16位任意字符!'},
|
|
|
|
|
<#-- 6到18位字母 -->
|
|
|
|
|
<#elseif fieldValidType == 's6-18'>
|
|
|
|
|
{ pattern:/^[a-z|A-Z]{6,18}$/, message: '请输入6到18位字母!'},
|
|
|
|
|
<#-- 网址 -->
|
|
|
|
|
<#elseif fieldValidType == 'url'>
|
|
|
|
|
{ pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!'},
|
|
|
|
|
<#-- 电子邮件 -->
|
|
|
|
|
<#elseif fieldValidType == 'e'>
|
|
|
|
|
{ pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},
|
|
|
|
|
<#-- 手机号码 -->
|
|
|
|
|
<#elseif fieldValidType == 'm'>
|
|
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
|
|
|
|
|
<#-- 邮政编码 -->
|
|
|
|
|
<#elseif fieldValidType == 'p'>
|
|
|
|
|
{ pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'},
|
|
|
|
|
<#-- 字母 -->
|
|
|
|
|
<#elseif fieldValidType == 's'>
|
|
|
|
|
{ pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},
|
|
|
|
|
<#-- 数字 -->
|
|
|
|
|
<#elseif fieldValidType == 'n'>
|
|
|
|
|
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
|
|
|
|
|
<#-- 整数 -->
|
|
|
|
|
<#elseif fieldValidType == 'z'>
|
|
|
|
|
{ pattern: /^-?\d+$/, message: '请输入整数!'},
|
|
|
|
|
<#-- 金额 -->
|
|
|
|
|
<#elseif fieldValidType == 'money'>
|
|
|
|
|
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
|
|
|
|
|
<#-- 正则校验 -->
|
|
|
|
|
<#elseif fieldValidType != '' && fieldValidType != '*'>
|
|
|
|
|
{ pattern: '${fieldValidType}', message: '不符合校验规则!'},
|
|
|
|
|
<#-- 无校验 -->
|
|
|
|
|
<#else>
|
|
|
|
|
<#t>
|
|
|
|
|
</#if>
|
|
|
|
|
];
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
<#if po.readonly=='Y'>
|
|
|
|
|
dynamicDisabled:true,
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
<#if id_exists == false>
|
|
|
|
|
// TODO 主键隐藏字段,目前写死为ID
|
|
|
|
|
{
|
|
|
|
|
label: '',
|
|
|
|
|
field: 'id',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
<#list subTables as sub>
|
|
|
|
|
//子表列表数据
|
|
|
|
@ -462,222 +129,6 @@ export const ${sub.entityName?uncap_first}Columns: BasicColumn[] = [
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
];
|
|
|
|
|
//子表表单数据
|
|
|
|
|
export const ${sub.entityName?uncap_first}FormSchema: FormSchema[] = [
|
|
|
|
|
<#assign form_cat_tree = false>
|
|
|
|
|
<#assign form_cat_back = "">
|
|
|
|
|
<#assign bpm_flag=false>
|
|
|
|
|
<#list sub.originalColumns as po><#rt/>
|
|
|
|
|
<#if po.fieldName == 'id'>
|
|
|
|
|
// TODO 子表隐藏字段,目前写死为ID
|
|
|
|
|
{
|
|
|
|
|
label: '',
|
|
|
|
|
field: 'id',
|
|
|
|
|
component: 'Input',
|
|
|
|
|
show: false
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#if po.isShow =='Y' && po.fieldName !='delFlag'>
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
|
|
|
|
|
<#assign form_field_dictCode="">
|
|
|
|
|
<#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
|
|
|
|
|
<#elseif po.dictField?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_field_dictCode="${po.dictField}">
|
|
|
|
|
</#if>
|
|
|
|
|
{
|
|
|
|
|
label: '${po.filedComment}',
|
|
|
|
|
field: ${autoStringSuffix(po)},
|
|
|
|
|
<#-- update-begin-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 -->
|
|
|
|
|
<#if po.defaultVal??>
|
|
|
|
|
<#if po.fieldDbType=="BigDecimal" || po.fieldDbType=="double" || po.fieldDbType=="int">
|
|
|
|
|
defaultValue: ${po.defaultVal},
|
|
|
|
|
<#else>
|
|
|
|
|
defaultValue: "${po.defaultVal}",
|
|
|
|
|
</#if>
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- update-end-author:taoyan date:2022-6-24 for: VUEN-1190【代码生成】默认值未生成 -->
|
|
|
|
|
<#if po.classType =='date'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueFormat: 'YYYY-MM-DD'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='datetime'>
|
|
|
|
|
component: 'DatePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
showTime:true,
|
|
|
|
|
valueFormat: 'YYYY-MM-DD HH:mm:ss'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='time'>
|
|
|
|
|
component: 'TimePicker',
|
|
|
|
|
componentProps: {
|
|
|
|
|
valueFormat: 'HH:mm:ss'
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='popup'>
|
|
|
|
|
<#include "/common/form/vue3popup.ftl">
|
|
|
|
|
<#elseif po.classType =='sel_depart'>
|
|
|
|
|
component: 'JSelectDept',
|
|
|
|
|
<#elseif po.classType =='switch'>
|
|
|
|
|
component: 'JSwitch',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictField != 'is_open'>
|
|
|
|
|
options:${po.dictField}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='pca'>
|
|
|
|
|
component: 'JAreaLinkage',
|
|
|
|
|
<#elseif po.classType =='markdown'>
|
|
|
|
|
component: 'JMarkdownEditor',//注意string转换问题
|
|
|
|
|
<#elseif po.classType =='password'>
|
|
|
|
|
component: 'InputPassword',
|
|
|
|
|
<#elseif po.classType =='sel_user'>
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
component: 'JSelectUser',
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
|
|
|
|
|
componentProps:{
|
|
|
|
|
labelKey:'realname',
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType =='textarea'>
|
|
|
|
|
component: 'InputTextArea',
|
|
|
|
|
<#elseif po.classType=='list'>
|
|
|
|
|
component: 'JDictSelectTag',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='radio'>
|
|
|
|
|
component: 'JDictSelectTag',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}",
|
|
|
|
|
type: "radio"
|
|
|
|
|
},
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
|
|
|
|
<#elseif po.classType=='list_multi'>
|
|
|
|
|
component: 'JSelectMultiple',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='checkbox'>
|
|
|
|
|
component: 'JCheckbox',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dictCode:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#-- update-end---author:chenrui ---date:20231228 for:[QQYUN-7583]Vue3风格表单页面多选控件渲染成了下拉多选---------- -->
|
|
|
|
|
<#elseif po.classType=='sel_search'>
|
|
|
|
|
component: 'JSearchSelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
dict:"${form_field_dictCode}"
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='cat_tree'>
|
|
|
|
|
<#assign form_cat_tree = true>
|
|
|
|
|
component: 'JCategorySelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
pcode:"${po.dictField?default("")}", //TODO back和事件未添加,暂时有问题
|
|
|
|
|
},
|
|
|
|
|
<#if po.dictText?default("")?trim?length gt 1>
|
|
|
|
|
<#assign form_cat_back = "${po.dictText}">
|
|
|
|
|
</#if>
|
|
|
|
|
<#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
|
|
|
|
|
component: 'InputNumber',
|
|
|
|
|
<#elseif po.classType=='file'>
|
|
|
|
|
component: 'JUpload',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.uploadnum??>
|
|
|
|
|
maxCount:${po.uploadnum}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='image'>
|
|
|
|
|
component: 'JImageUpload',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.uploadnum??>
|
|
|
|
|
fileMax:${po.uploadnum}
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
<#elseif po.classType=='umeditor'>
|
|
|
|
|
component: 'JEditor',
|
|
|
|
|
<#elseif po.classType == 'sel_tree'>
|
|
|
|
|
component: 'JTreeSelect',
|
|
|
|
|
componentProps:{
|
|
|
|
|
<#if po.dictText??>
|
|
|
|
|
<#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
|
|
|
|
|
dict:"${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}",
|
|
|
|
|
<#elseif po.dictText?split(',')[1]??>
|
|
|
|
|
pidField:"${po.dictText?split(',')[1]}",
|
|
|
|
|
<#elseif po.dictText?split(',')[3]??>
|
|
|
|
|
hasChildField:"${po.dictText?split(',')[3]}",
|
|
|
|
|
</#if>
|
|
|
|
|
</#if>
|
|
|
|
|
pidValue:"${po.dictField}",
|
|
|
|
|
},
|
|
|
|
|
<#else>
|
|
|
|
|
component: 'Input',
|
|
|
|
|
</#if>
|
|
|
|
|
<#include "/common/utils.ftl">
|
|
|
|
|
<#if po.isShow == 'Y' && poHasCheck(po)>
|
|
|
|
|
dynamicRules: ({model,schema}) => {
|
|
|
|
|
<#if po.fieldName != 'id'>
|
|
|
|
|
<#assign fieldValidType = po.fieldValidType!''>
|
|
|
|
|
return [
|
|
|
|
|
<#-- 非空校验 -->
|
|
|
|
|
<#if po.nullable == 'N' || fieldValidType == '*'>
|
|
|
|
|
{ required: true, message: '请输入${po.filedComment}!'},
|
|
|
|
|
<#elseif fieldValidType!=''>
|
|
|
|
|
{ required: false},
|
|
|
|
|
</#if>
|
|
|
|
|
<#-- 唯一校验 -->
|
|
|
|
|
<#if fieldValidType == 'only'>
|
|
|
|
|
{...rules.duplicateCheckRule(<#if sub?default("")?trim?length gt 1>'${sub.tableName}'<#else>'${tableName}'</#if>, '${po.fieldDbName}',model,schema)[0]},
|
|
|
|
|
<#-- 6到16位数字 -->
|
|
|
|
|
<#elseif fieldValidType == 'n6-16'>
|
|
|
|
|
{ pattern: /^\d{6,16}$|^(?=\d+\.\d+)[\d.]{7,17}$/, message: '请输入6到16位数字!'},
|
|
|
|
|
<#-- 6到16位任意字符 -->
|
|
|
|
|
<#elseif fieldValidType == '*6-16'>
|
|
|
|
|
{ pattern: /^.{6,16}$/, message: '请输入6到16位任意字符!'},
|
|
|
|
|
<#-- 6到18位字母 -->
|
|
|
|
|
<#elseif fieldValidType == 's6-18'>
|
|
|
|
|
{ pattern: /^[a-z|A-Z]{6,18}$/, message: '请输入6到18位字母!'},
|
|
|
|
|
<#-- 网址 -->
|
|
|
|
|
<#elseif fieldValidType == 'url'>
|
|
|
|
|
{ pattern: /^((ht|f)tps?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/, message: '请输入正确的网址!'},
|
|
|
|
|
<#-- 电子邮件 -->
|
|
|
|
|
<#elseif fieldValidType == 'e'>
|
|
|
|
|
{ pattern: /^([\w]+\.*)([\w]+)@[\w]+\.\w{3}(\.\w{2}|)$/, message: '请输入正确的电子邮件!'},
|
|
|
|
|
<#-- 手机号码 -->
|
|
|
|
|
<#elseif fieldValidType == 'm'>
|
|
|
|
|
{ pattern: /^1[3456789]\d{9}$/, message: '请输入正确的手机号码!'},
|
|
|
|
|
<#-- 邮政编码 -->
|
|
|
|
|
<#elseif fieldValidType == 'p'>
|
|
|
|
|
{ pattern: /^[0-9]\d{5}$/, message: '请输入正确的邮政编码!'},
|
|
|
|
|
<#-- 字母 -->
|
|
|
|
|
<#elseif fieldValidType == 's'>
|
|
|
|
|
{ pattern: /^[A-Z|a-z]+$/, message: '请输入字母!'},
|
|
|
|
|
<#-- 数字 -->
|
|
|
|
|
<#elseif fieldValidType == 'n'>
|
|
|
|
|
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
|
|
|
|
|
<#-- 整数 -->
|
|
|
|
|
<#elseif fieldValidType == 'z'>
|
|
|
|
|
{ pattern: /^-?\d+$/, message: '请输入整数!'},
|
|
|
|
|
<#-- 金额 -->
|
|
|
|
|
<#elseif fieldValidType == 'money'>
|
|
|
|
|
{ pattern: /^(([1-9][0-9]*)|([0]\.\d{0,2}|[1-9][0-9]*\.\d{0,2}))$/, message: '请输入正确的金额!'},
|
|
|
|
|
<#-- 正则校验 -->
|
|
|
|
|
<#elseif fieldValidType != '' && fieldValidType != '*'>
|
|
|
|
|
{ pattern: '${fieldValidType}', message: '不符合校验规则!'},
|
|
|
|
|
<#-- 无校验 -->
|
|
|
|
|
<#else>
|
|
|
|
|
<#t>
|
|
|
|
|
</#if>
|
|
|
|
|
];
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
<#if po.readonly=='Y'>
|
|
|
|
|
dynamicDisabled:true,
|
|
|
|
|
</#if>
|
|
|
|
|
},
|
|
|
|
|
</#if>
|
|
|
|
|
</#list>
|
|
|
|
|
];
|
|
|
|
|
</#list>
|
|
|
|
|
|
|
|
|
|
<#-- update-begin---author:chenrui ---date:20231228 for:[QQYUN-7527]vue3代码生成默认带上高级查询---------- -->
|
|
|
|
|