fix 修复 代码生成模板导包错误
update 优化 前端代码生成模板
This commit is contained in:
parent
7862d58f01
commit
77fa4e0aa8
@ -16,7 +16,7 @@ import org.dromara.common.core.domain.R;
|
|||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import utils.excel.common.org.dromara.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import ${packageName}.domain.vo.${ClassName}Vo;
|
import ${packageName}.domain.vo.${ClassName}Vo;
|
||||||
import ${packageName}.domain.bo.${ClassName}Bo;
|
import ${packageName}.domain.bo.${ClassName}Bo;
|
||||||
import ${packageName}.service.I${ClassName}Service;
|
import ${packageName}.service.I${ClassName}Service;
|
||||||
|
@ -6,7 +6,7 @@ package ${packageName}.domain;
|
|||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($IsTenant==1)
|
#if($IsTenant==1)
|
||||||
import core.tenant.common.org.dromara.TenantEntity;
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
#else
|
#else
|
||||||
#end
|
#end
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
@ -6,8 +6,8 @@ import ${import};
|
|||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import annotation.excel.common.org.dromara.ExcelDictFormat;
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
import convert.excel.common.org.dromara.ExcelDictConvert;
|
import org.dromara.common.convert.excelExcelDictConvert;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
import request from '@/utils/request';
|
import request from '@/utils/request';
|
||||||
import { AxiosPromise } from 'axios';
|
import { AxiosPromise } from 'axios';
|
||||||
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from './types';
|
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from '@/api/${moduleName}/${businessName}/types';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
* @param query
|
* @param query
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export const list${BusinessName} = (#if(${treeCode})query?: ${BusinessName}Query#else query: ${BusinessName}Query#end): AxiosPromise<${BusinessName}VO[]> => {
|
|
||||||
|
export const list${BusinessName} = (query?: ${BusinessName}Query): AxiosPromise<${BusinessName}VO[]> => {
|
||||||
return request({
|
return request({
|
||||||
url: '/${moduleName}/${businessName}/list',
|
url: '/${moduleName}/${businessName}/list',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
|
@ -13,7 +13,7 @@ export interface ${BusinessName}VO {
|
|||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ${BusinessName}Form extends BaseEntity{
|
export interface ${BusinessName}Form extends BaseEntity {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.insert || $column.edit)
|
#if($column.insert || $column.edit)
|
||||||
/**
|
/**
|
||||||
|
@ -15,12 +15,7 @@
|
|||||||
#end
|
#end
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-input
|
<el-input v-model="queryParams.${column.javaField}" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" />
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
@ -71,26 +66,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
||||||
|
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd()"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="Sort"
|
|
||||||
@click="handleToggleExpandAll"
|
|
||||||
>展开/折叠</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -274,7 +257,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -307,7 +290,6 @@ const ${businessName}Options = ref<${BusinessName}Option[]>([]);
|
|||||||
const buttonLoading = ref(false);
|
const buttonLoading = ref(false);
|
||||||
const showSearch = ref(true);
|
const showSearch = ref(true);
|
||||||
const isExpandAll = ref(true);
|
const isExpandAll = ref(true);
|
||||||
const refreshTable = ref(true);
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
|
|
||||||
const queryFormRef = ref(ElForm);
|
const queryFormRef = ref(ElForm);
|
||||||
@ -472,15 +454,14 @@ const handleUpdate = (row: ${BusinessName}VO) => {
|
|||||||
if (row != null) {
|
if (row != null) {
|
||||||
form.value.${treeParentCode} = row.${treeCode};
|
form.value.${treeParentCode} = row.${treeCode};
|
||||||
}
|
}
|
||||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
const res = await get${BusinessName}(row.${treeCode});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
form.value = response.data;
|
Object.assign(form.value, res.data);
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,12 +15,7 @@
|
|||||||
#end
|
#end
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-input
|
<el-input v-model="queryParams.${column.javaField}" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" />
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
@ -75,42 +70,16 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate()"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete()"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -127,7 +96,7 @@
|
|||||||
#set($comment=$column.columnComment)
|
#set($comment=$column.columnComment)
|
||||||
#end
|
#end
|
||||||
#if($column.pk)
|
#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")
|
#elseif($column.list && $column.htmlType == "datetime")
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user