Merge branch 'develop' of https://gitee.com/likeshop_gitee/likeadmin-java into develop
This commit is contained in:
commit
93c862e573
|
|
@ -29,7 +29,6 @@ public class GenTableColumn implements Serializable {
|
|||
private Integer isInsert;
|
||||
private Integer isEdit;
|
||||
private Integer isList;
|
||||
private Integer isDetail;
|
||||
private Integer isQuery;
|
||||
private String queryType;
|
||||
private String htmlType;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ public class GenUtil {
|
|||
}
|
||||
}
|
||||
|
||||
// 非必填字段
|
||||
if (GenUtil.isArraysContains(SqlConstants.COLUMN_NAME_NOT_EDIT, columnName)) {
|
||||
column.setIsRequired(0);
|
||||
}
|
||||
|
||||
// 需插入字段
|
||||
if (!GenUtil.isArraysContains(SqlConstants.COLUMN_NAME_NOT_ADD, columnName)) {
|
||||
column.setIsInsert(GenConstants.REQUIRE);
|
||||
|
|
@ -105,11 +110,6 @@ public class GenUtil {
|
|||
column.setIsList(GenConstants.REQUIRE);
|
||||
}
|
||||
|
||||
// 需详情的字段
|
||||
if (!GenUtil.isArraysContains(new String[]{"is_delete", "delete_time"}, columnName)) {
|
||||
column.setIsDetail(GenConstants.REQUIRE);
|
||||
}
|
||||
|
||||
// 需查询字段
|
||||
if (!GenUtil.isArraysContains(SqlConstants.COLUMN_NAME_NOT_QUERY, columnName) && column.getIsPk() == 0) {
|
||||
column.setIsQuery(GenConstants.REQUIRE);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class VelocityUtil {
|
|||
if (column.getIsList() == 1) {
|
||||
listFields.add(column.getColumnName());
|
||||
}
|
||||
if (column.getIsDetail() == 1) {
|
||||
if (column.getIsEdit() == 1) {
|
||||
detailFields.add(column.getColumnName());
|
||||
}
|
||||
if (column.getIsQuery() == 1) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import java.util.Map;
|
|||
public interface I${EntityName}Service {
|
||||
|
||||
#if($table.genTpl=="curd")
|
||||
/**、
|
||||
/**
|
||||
* ${functionName}列表
|
||||
*
|
||||
#if(!$authorName.equals(""))
|
||||
|
|
@ -22,7 +22,7 @@ public interface I${EntityName}Service {
|
|||
#end
|
||||
* @param pageParam 分页参数
|
||||
* @param params 搜索参数
|
||||
* @return PageResult<${EntityName}Vo}>
|
||||
* @return PageResult<${EntityName}Vo>
|
||||
*/
|
||||
PageResult<${EntityName}ListVo> list(PageParam pageParam, Map<String, String> params);
|
||||
#elseif($table.genTpl=="tree")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ public class ${EntityName}DetailVo implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
#foreach ($column in $columns)
|
||||
#if($column.isDetail==1)
|
||||
#if($column.isEdit==1)
|
||||
#if($dateFields.contains($column.columnName))
|
||||
private String ${column.javaField}; // ${column.columnComment}
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -12,29 +12,29 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType=="select")
|
||||
<el-form-item label="${column.columnComment}" prop="${column.javaField}">
|
||||
<el-select
|
||||
v-model="queryParams.${column.javaField}"
|
||||
class="w-56"
|
||||
clearable
|
||||
>
|
||||
#if($column.dictType=="")
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
#else
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.${column.dictType}"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
#end
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="${column.columnComment}" prop="${column.javaField}">
|
||||
<el-select
|
||||
v-model="queryParams.${column.javaField}"
|
||||
class="w-56"
|
||||
clearable
|
||||
>
|
||||
#if($column.dictType=="")
|
||||
<el-option label="请选择字典生成" value="" />
|
||||
#else
|
||||
<el-option label="全部" value="" />
|
||||
<el-option
|
||||
v-for="(item, index) in dictData.${column.dictType}"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
#end
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
#elseif($column.htmlType=="input")
|
||||
<el-form-item label="${column.columnComment}" prop="${column.javaField}">
|
||||
<el-input class="w-56" v-model="queryParams.${column.javaField}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${column.columnComment}" prop="${column.javaField}">
|
||||
<el-input class="w-56" v-model="queryParams.${column.javaField}" />
|
||||
</el-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
|
|
@ -83,8 +83,8 @@
|
|||
></el-table-column>
|
||||
#else
|
||||
<el-table-column
|
||||
label="菜单名称"
|
||||
prop="menuName"
|
||||
label="${column.columnComment}"
|
||||
prop="${column.javaField}"
|
||||
min-width="150"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
|
|
@ -125,9 +125,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ${moduleName}Delete, ${moduleName}Lists } from '@/api/${moduleName}'
|
||||
import type { ElTable } from 'element-plus'
|
||||
import { MenuEnum } from '@/enums/appEnums'
|
||||
import { ${moduleName}Edit, ${moduleName}Delete, ${moduleName}Lists } from '@/api/${moduleName}'
|
||||
import EditPopup from './edit.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
const tableRef = shallowRef<InstanceType<typeof ElTable>>()
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
</el-card>
|
||||
<el-card class="!border-none mt-4" shadow="never">
|
||||
<div>
|
||||
<el-button v-perms="['dept.jobs/add']" type="primary" @click="handleAdd()">
|
||||
<el-button v-perms="['${moduleName}/add']" type="primary" @click="handleAdd()">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
|
|
@ -62,8 +62,20 @@
|
|||
<dict-value :options="dictData.${column.dictType}" :value="row.${column.javaField}" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif ($column.htmlType=="datetime")
|
||||
#elseif($column.htmlType=="datetime")
|
||||
<el-table-column label="${column.columnComment}" prop="${column.javaField}" min-width="180" />
|
||||
#elseif($column.htmlType=="imageUpload")
|
||||
<el-table-column label="${column.columnComment}" prop="${column.javaField}" min-width="60">
|
||||
<template #default="{ row }">
|
||||
<image-contain width="50px" height="50px" :src="row.${column.javaField}" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
#elseif($column.htmlType=="select" || $column.htmlType=="radio")
|
||||
<el-table-column label="${column.columnComment}" prop="${column.javaField}">
|
||||
<template #default="{ row }">
|
||||
<dict-value :options="dictData.${column.dictType}" :value="row.${column.javaField}" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
#else
|
||||
<el-table-column label="${column.columnComment}" prop="${column.javaField}" min-width="100" />
|
||||
#end
|
||||
|
|
@ -123,8 +135,8 @@
|
|||
fetchFun: ${moduleName}Lists,
|
||||
params: queryParams
|
||||
})
|
||||
#if($dictFields!="")
|
||||
|
||||
#if($dictFields!="")
|
||||
const { dictData } = useDictData<{
|
||||
#foreach ($column in $columns)
|
||||
#if($column.dictType!="")
|
||||
|
|
@ -132,8 +144,8 @@
|
|||
#end
|
||||
#end
|
||||
}>([${dictFields}])
|
||||
#end
|
||||
|
||||
#end
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
|
|
|
|||
Loading…
Reference in New Issue