@@ -168,6 +168,7 @@ public class TemplateEngineUtils {
|
|||||||
boolean needDigit = false;
|
boolean needDigit = false;
|
||||||
boolean needDateField = false;
|
boolean needDateField = false;
|
||||||
boolean needSwitchField = false;
|
boolean needSwitchField = false;
|
||||||
|
boolean needParseTime = false;
|
||||||
String firstTreeListField = StringUtils.EMPTY;
|
String firstTreeListField = StringUtils.EMPTY;
|
||||||
for (GenTableColumn column : genTable.getColumns()) {
|
for (GenTableColumn column : genTable.getColumns()) {
|
||||||
boolean writable = column.isInsert() || column.isEdit();
|
boolean writable = column.isInsert() || column.isEdit();
|
||||||
@@ -183,6 +184,7 @@ public class TemplateEngineUtils {
|
|||||||
needDigit = needDigit || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_INPUT_NUMBER);
|
needDigit = needDigit || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_INPUT_NUMBER);
|
||||||
needDateField = needDateField || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_DATETIME);
|
needDateField = needDateField || writable && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_DATETIME);
|
||||||
needSwitchField = needSwitchField || (writable || column.isList()) && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_SWITCH);
|
needSwitchField = needSwitchField || (writable || column.isList()) && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_SWITCH);
|
||||||
|
needParseTime = needParseTime || column.isList() && StringUtils.equals(column.getHtmlType(), GenConstants.HTML_DATETIME);
|
||||||
if (StringUtils.isBlank(firstTreeListField) && column.isList()) {
|
if (StringUtils.isBlank(firstTreeListField) && column.isList()) {
|
||||||
firstTreeListField = column.getJavaField();
|
firstTreeListField = column.getJavaField();
|
||||||
}
|
}
|
||||||
@@ -202,6 +204,7 @@ public class TemplateEngineUtils {
|
|||||||
context.put("needDigit", needDigit);
|
context.put("needDigit", needDigit);
|
||||||
context.put("needDateField", needDateField);
|
context.put("needDateField", needDateField);
|
||||||
context.put("needSwitchField", needSwitchField);
|
context.put("needSwitchField", needSwitchField);
|
||||||
|
context.put("needParseTime", needParseTime);
|
||||||
context.put("firstTreeListField", firstTreeListField);
|
context.put("firstTreeListField", firstTreeListField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
placeholder="请选择${column.columnLabel}"
|
placeholder="请选择${column.columnLabel}"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<#elseif column.htmlType == "datetime" && column.queryType == "BETWEEN">
|
<#elseif column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query>
|
||||||
<el-form-item label="${column.columnLabel}" style="width: 308px">
|
<el-form-item label="${column.columnLabel}" style="width: 308px">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="dateRange${column.capJavaField}"
|
v-model="dateRange${column.capJavaField}"
|
||||||
@@ -233,7 +233,7 @@
|
|||||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
<#list columns as column>
|
<#list columns as column>
|
||||||
<#if (column.insert || column.edit) && !column.pk>`n<#if column.htmlType == "input">
|
<#if (column.insert || column.edit) && !column.pk><#if column.htmlType == "input">
|
||||||
<el-form-item label="${column.columnLabel}" prop="${column.javaField}">
|
<el-form-item label="${column.columnLabel}" prop="${column.javaField}">
|
||||||
<el-input v-model="form.${column.javaField}" placeholder="请输入${column.columnLabel}" />
|
<el-input v-model="form.${column.javaField}" placeholder="请输入${column.columnLabel}" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -380,6 +380,9 @@ import { useTableSelection } from '@/hooks/table/useTableSelection';
|
|||||||
<#if needDict>
|
<#if needDict>
|
||||||
import { useDict } from '@/utils/dict';
|
import { useDict } from '@/utils/dict';
|
||||||
</#if>
|
</#if>
|
||||||
|
<#if needParseTime>
|
||||||
|
import { parseTime } from '@/utils/ruoyi';
|
||||||
|
</#if>
|
||||||
import modal from '@/plugins/modal';
|
import modal from '@/plugins/modal';
|
||||||
<#if enableExport>
|
<#if enableExport>
|
||||||
import { download as requestDownload } from '@/utils/request';
|
import { download as requestDownload } from '@/utils/request';
|
||||||
@@ -400,7 +403,7 @@ const { loading, withLoading } = useLoading(true);
|
|||||||
const { showSearch } = useSearchToggle();
|
const { showSearch } = useSearchToggle();
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
<#list columns as column>
|
<#list columns as column>
|
||||||
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN">
|
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query>
|
||||||
const {
|
const {
|
||||||
dateRange: dateRange${column.capJavaField},
|
dateRange: dateRange${column.capJavaField},
|
||||||
applyDateRange: apply${column.capJavaField}DateRange,
|
applyDateRange: apply${column.capJavaField}DateRange,
|
||||||
@@ -472,7 +475,7 @@ const getList = async () => {
|
|||||||
<#if needAddDateRange>
|
<#if needAddDateRange>
|
||||||
let params = queryParams.value;
|
let params = queryParams.value;
|
||||||
<#list columns as column>
|
<#list columns as column>
|
||||||
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN">
|
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query>
|
||||||
params = apply${column.capJavaField}DateRange(params);
|
params = apply${column.capJavaField}DateRange(params);
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
@@ -505,7 +508,7 @@ const { resetQuery } = useSearchReset({
|
|||||||
initialPageSize: 10,
|
initialPageSize: 10,
|
||||||
resetExtras: () => {
|
resetExtras: () => {
|
||||||
<#list columns as column>
|
<#list columns as column>
|
||||||
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN">
|
<#if column.htmlType == "datetime" && column.queryType == "BETWEEN" && column.query>
|
||||||
reset${column.capJavaField}DateRange();
|
reset${column.capJavaField}DateRange();
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
|
|||||||
Reference in New Issue
Block a user