mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-28 01:45:08 +08:00
代码生成:简化现有 crud 模版的各种 pretty 相关的判断,交给 Java 代码后置统一处理。
This commit is contained in:
@ -8,7 +8,6 @@
|
||||
:inline="true"
|
||||
label-width="68px"
|
||||
>
|
||||
#set ($dictMethods = [])## 使用到的 dict 字典方法
|
||||
#foreach($column in $columns)
|
||||
#if ($column.listOperation)
|
||||
#set ($dictType = $column.dictType)
|
||||
@ -36,20 +35,13 @@
|
||||
</el-form-item>
|
||||
#elseif ($column.htmlType == "select" || $column.htmlType == "radio")
|
||||
<el-form-item label="${comment}" prop="${javaField}">
|
||||
#if ($javaField.length() + $comment.length() > 8)
|
||||
<el-select
|
||||
v-model="queryParams.${javaField}"
|
||||
placeholder="请选择${comment}"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
#else
|
||||
<el-select v-model="queryParams.${javaField}" placeholder="请选择${comment}" clearable class="!w-240px">
|
||||
#end
|
||||
#if ("" != $dictType)## 设置了 dictType 数据字典的情况
|
||||
#if (!$dictMethods.contains($dictMethod))## 如果不存在,则添加到 dictMethods 数组中,后续好 import
|
||||
#set($ignore = $dictMethods.add($dictMethod) )
|
||||
#end
|
||||
<el-option
|
||||
v-for="dict in $dictMethod(DICT_TYPE.$dictType.toUpperCase())"
|
||||
:key="dict.value"
|
||||
@ -92,16 +84,12 @@
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
|
||||
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
|
||||
#if ($permissionPrefix.length() <= 12)
|
||||
<el-button type="primary" @click="openForm('create')" v-hasPermi="['${permissionPrefix}:create']">
|
||||
#else
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
@click="openForm('create')"
|
||||
v-hasPermi="['${permissionPrefix}:create']"
|
||||
>
|
||||
#end
|
||||
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||
</el-button>
|
||||
<el-button
|
||||
@ -180,15 +168,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
#if ($dictMethods.size() > 0)
|
||||
import { DICT_TYPE#foreach ($dictMethod in $dictMethods), ${dictMethod}#end } from '@/utils/dict'
|
||||
#end
|
||||
#foreach ($column in $columns)
|
||||
#if ($column.listOperationResult && $column.htmlType == "datetime")
|
||||
import { getIntDictOptions, getStrDictOptions, getBoolDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
#break
|
||||
#end
|
||||
#end
|
||||
import download from '@/utils/download'
|
||||
import * as ${simpleClassName}Api from '@/api/${table.moduleName}/${classNameVar}'
|
||||
import ${simpleClassName}Form from './${simpleClassName}Form.vue'
|
||||
@ -204,19 +185,13 @@ const list = ref([]) // 列表的数据
|
||||
const queryParams = reactive({
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
#set ($listOperationLastIndex = -1)## 求最后一个需要 , 的地方
|
||||
#foreach ($column in $columns)
|
||||
#if ($column.listOperation)
|
||||
#set ($listOperationLastIndex = $foreach.index)
|
||||
#end
|
||||
#end
|
||||
#foreach ($column in $columns)
|
||||
#if ($column.listOperation)
|
||||
#if ($column.listOperationCondition != 'BETWEEN')
|
||||
$column.javaField: null#if($foreach.index < $listOperationLastIndex),#end
|
||||
$column.javaField: null,
|
||||
#end
|
||||
#if ($column.htmlType == "datetime" || $column.listOperationCondition == "BETWEEN")
|
||||
$column.javaField: []#if($foreach.index < $listOperationLastIndex),#end
|
||||
$column.javaField: [],
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
Reference in New Issue
Block a user