代码生成器 正对时间 增加 时间、日期 两项生成方案

v1.4.1
Parker 4 years ago
parent 226fca1314
commit a9048d40f8

@ -73,8 +73,8 @@ public class TestUserModel extends ApiWrapper {
@ExcelInfo
// 验证器
@ValidationArgs({ValiArgsType.IS_NOT_NULL, })
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date birth;
/** 是否启用 */

@ -69,9 +69,13 @@ public class #(data.model.tableName)Model extends ApiWrapper {
@ValidationArgsLenMax(#(column.fieldLength))
#end
#end
#if(column.javaType == "Date")
###
#if(column.javaType == "Date" && column.showType == "3")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
#else if(column.javaType == "Date" && column.showType == "4")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
#end
private #(column.javaType) #(column.fieldName);

@ -39,7 +39,7 @@
</el-select>
</el-form-item>
</el-col>
###
###
#else if(column.showType == "3")
<el-col :span="12">
<el-form-item label="#(column.fieldComments)" prop="#(column.fieldName)">
@ -51,7 +51,20 @@
></el-date-picker>
</el-form-item>
</el-col>
###
#else if(column.showType == "4")
<el-col :span="12">
<el-form-item label="#(column.fieldComments)" prop="#(column.fieldName)">
<el-date-picker
v-model="form.#(column.fieldName)"
type="date"
placeholder="选择#(column.fieldComments)日期"
style="width: 100%"
></el-date-picker>
</el-form-item>
</el-col>
#end
#end
</el-row>
#end

@ -22,7 +22,7 @@
</el-select>
</el-form-item>
#else if(column.showType == "3")
###
###
<el-form-item>
<el-date-picker
v-model="#(column.fieldName)DatePicker"
@ -34,6 +34,18 @@
align="right">
</el-date-picker>
</el-form-item>
#else if(column.showType == "4")
###
<el-form-item>
<el-date-picker
v-model="#(column.fieldName)DatePicker"
type="daterange"
align="right"
range-separator="至"
start-placeholder="开始#(column.fieldComments)"
end-placeholder="结束#(column.fieldComments)"
></el-date-picker>
</el-form-item>
#else
#if(column.queryType == "EQ" || column.queryType == "LIKE")
<el-form-item>
@ -119,18 +131,30 @@
</el-select>
</el-form-item>
#else if(column.showType == "3")
###
###
<el-form-item>
<el-date-picker
v-model="#(column.fieldName)DatePicker"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
start-placeholder="开始#(column.fieldComments)"
end-placeholder="结束#(column.fieldComments)"
align="right">
</el-date-picker>
</el-form-item>
#else if(column.showType == "4")
###
<el-form-item>
<el-date-picker
v-model="#(column.fieldName)DatePicker"
type="daterange"
align="right"
range-separator="至"
start-placeholder="开始#(column.fieldComments)"
end-placeholder="结束#(column.fieldComments)"
></el-date-picker>
</el-form-item>
#else
#if(column.queryType == "EQ" || column.queryType == "LIKE")
<el-form-item>
@ -299,7 +323,7 @@
###
#if(column.showType == "2")
#(column.fieldName)_EQ: "",
#else if(column.showType == "3")
#else if(column.showType == "3" || column.showType == "4")
###
#(column.fieldName)_BEGIN: "",
#(column.fieldName)_END: "",
@ -317,7 +341,7 @@
###
#if(column.showType == "2")
#(column.fieldName)_EQ: "",
#else if(column.showType == "3")
#else if(column.showType == "3" || column.showType == "4")
###
#(column.fieldName)_BEGIN: "",
#(column.fieldName)_END: "",
@ -334,14 +358,14 @@
### 2
#for(column : briefQueryList)
###
#if(column.showType == "3")
#if(column.showType == "3" || column.showType == "4")
#(column.fieldName)DatePicker: [],
#end
#end
###
#for(column : moreQueryList)
###
#if(column.showType == "3")
#if(column.showType == "3" || column.showType == "4")
#(column.fieldName)DatePicker: [],
#end
#end
@ -433,7 +457,7 @@
### 2
#for(column : briefQueryList)
###
#if(column.showType == "3")
#if(column.showType == "3" || column.showType == "4")
if(isNotNull(this.#(column.fieldName)DatePicker) && this.#(column.fieldName)DatePicker.length === 2){
this.queryForm.#(column.fieldName)_BEGIN =
this.#(column.fieldName)DatePicker.length === 0 ? "" : formateDate(this.#(column.fieldName)DatePicker[0], 'yyyy-MM-dd hh:mm:ss');
@ -447,7 +471,7 @@
###
#for(column : moreQueryList)
###
#if(column.showType == "3")
#if(column.showType == "3" || column.showType == "4")
if(isNotNull(this.#(column.fieldName)DatePicker) && this.#(column.fieldName)DatePicker.length === 2){
this.queryForm.#(column.fieldName)_BEGIN =
this.#(column.fieldName)DatePicker.length === 0 ? "" : formateDate(this.#(column.fieldName)DatePicker[0], 'yyyy-MM-dd hh:mm:ss');

Loading…
Cancel
Save