| | |
| | | #end |
| | | #if($column.htmlType == "input" || $column.htmlType == "textarea") |
| | | <el-form-item label="${comment}" prop="${column.javaField}"> |
| | | <el-input |
| | | v-model="queryParams.${column.javaField}" |
| | | placeholder="请输入${comment}" |
| | | clearable |
| | | @keyup.enter="handleQuery" |
| | | /> |
| | | <el-input v-model="queryParams.${column.javaField}" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | #elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType) |
| | | <el-form-item label="${comment}" prop="${column.javaField}"> |
| | |
| | | #elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | | <el-form-item label="${comment}" style="width: 308px"> |
| | | <el-date-picker |
| | | v-model="daterange${AttrName}" |
| | | v-model="dateRange${AttrName}" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="daterange" |
| | | range-separator="-" |
| | |
| | | <template #header> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['${moduleName}:${businessName}:add']" |
| | | >新增</el-button> |
| | | <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate()" |
| | | v-hasPermi="['${moduleName}:${businessName}:edit']" |
| | | >修改</el-button> |
| | | <el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete()" |
| | | v-hasPermi="['${moduleName}:${businessName}:remove']" |
| | | >删除</el-button> |
| | | <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['${moduleName}:${businessName}:export']" |
| | | >导出</el-button> |
| | | <el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']">导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | |
| | | #set($comment=$column.columnComment) |
| | | #end |
| | | #if($column.pk) |
| | | <el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}"/> |
| | | <el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}" /> |
| | | #elseif($column.list && $column.htmlType == "datetime") |
| | | <el-table-column label="${comment}" align="center" prop="${javaField}" width="180"> |
| | | <template #default="scope"> |
| | |
| | | <el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px"> |
| | | #foreach($column in $columns) |
| | | #set($field=$column.javaField) |
| | | #if($column.insert && !$column.pk) |
| | | #if(($column.insert || $column.edit) && !$column.pk) |
| | | #set($parentheseIndex=$column.columnComment.indexOf("(")) |
| | | #if($parentheseIndex != -1) |
| | | #set($comment=$column.columnComment.substring(0, $parentheseIndex)) |
| | |
| | | <script setup name="${BusinessName}" lang="ts"> |
| | | import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from '@/api/${moduleName}/${businessName}'; |
| | | import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types'; |
| | | import { ComponentInternalInstance } from 'vue'; |
| | | import { ElForm } from 'element-plus'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | #if(${dicts} != '') |
| | |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | | #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
| | | const daterange${AttrName} = ref([]); |
| | | const dateRange${AttrName} = ref<[DateModelType, DateModelType]>(['', '']); |
| | | #end |
| | | #end |
| | | |
| | | const queryFormRef = ref(ElForm); |
| | | const ${businessName}FormRef = ref(ElForm); |
| | | const queryFormRef = ref<ElFormInstance>(); |
| | | const ${businessName}FormRef = ref<ElFormInstance>(); |
| | | |
| | | const dialog = reactive<DialogOption>({ |
| | | visible: false, |
| | |
| | | pageSize: 10, |
| | | #foreach ($column in $columns) |
| | | #if($column.query) |
| | | #if($column.htmlType != "datetime" || $column.queryType != "BETWEEN") |
| | | $column.javaField: undefined#if($foreach.count != $columns.size()),#end |
| | | #end |
| | | #end |
| | | #end |
| | | params: { |
| | | #foreach ($column in $columns) |
| | | #if($column.query) |
| | | #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | | $column.javaField: undefined#if($foreach.count != $columns.size()),#end |
| | | #end |
| | | #end |
| | | #end |
| | | } |
| | | }, |
| | | rules: { |
| | | #foreach ($column in $columns) |
| | |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | | #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
| | | if (null != daterange${AttrName} && '' != daterange${AttrName}) { |
| | | queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0]; |
| | | queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1]; |
| | | } |
| | | proxy?.addDateRange(queryParams.value, dateRange${AttrName}.value, '${AttrName}'); |
| | | #end |
| | | #end |
| | | const res = await list${BusinessName}(queryParams.value); |
| | |
| | | /** 表单重置 */ |
| | | const reset = () => { |
| | | form.value = {...initFormData}; |
| | | ${businessName}FormRef.value.resetFields(); |
| | | ${businessName}FormRef.value?.resetFields(); |
| | | } |
| | | |
| | | /** 搜索按钮操作 */ |
| | |
| | | #foreach ($column in $columns) |
| | | #if($column.htmlType == "datetime" && $column.queryType == "BETWEEN") |
| | | #set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)}) |
| | | daterange${AttrName}.value = []; |
| | | dateRange${AttrName}.value = ['', '']; |
| | | #end |
| | | #end |
| | | queryFormRef.value.resetFields(); |
| | | queryFormRef.value?.resetFields(); |
| | | handleQuery(); |
| | | } |
| | | |
| | |
| | | |
| | | /** 提交按钮 */ |
| | | const submitForm = () => { |
| | | ${businessName}FormRef.value.validate(async (valid: boolean) => { |
| | | ${businessName}FormRef.value?.validate(async (valid: boolean) => { |
| | | if (valid) { |
| | | buttonLoading.value = true; |
| | | #foreach ($column in $columns) |