调整前端代码模板.
This commit is contained in:
@@ -13,6 +13,7 @@ import com.orion.lang.utils.ansi.AnsiAppender;
|
||||
import com.orion.lang.utils.ansi.style.AnsiFont;
|
||||
import com.orion.lang.utils.ansi.style.color.AnsiForeground;
|
||||
import com.orion.lang.utils.ext.yml.YmlExt;
|
||||
import com.orion.ops.framework.common.utils.Valid;
|
||||
import com.orion.ops.framework.mybatis.core.domain.BaseDO;
|
||||
import com.orion.ops.framework.mybatis.core.mapper.IMapper;
|
||||
import com.orion.ops.launch.generator.engine.VelocityTemplateEngine;
|
||||
@@ -78,6 +79,8 @@ public class CodeGenerator {
|
||||
String password,
|
||||
Table[] tables,
|
||||
String module) {
|
||||
Valid.notEmpty(tables, "请先配置需要生成的表");
|
||||
|
||||
// 创建引擎
|
||||
VelocityTemplateEngine engine = getEngine(tables);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ export function get${vue.featureEntity}(id: number) {
|
||||
/**
|
||||
* $apiComment.getByIdList
|
||||
*/
|
||||
export function get${vue.featureEntity}List(idList: Array<number>) {
|
||||
export function batchGet${vue.featureEntity}List(idList: Array<number>) {
|
||||
return axios.get<${vue.featureEntity}QueryResponse[]>('/${package.ModuleName}/${typeHyphen}/batch-get', {
|
||||
params: { idList },
|
||||
paramsSerializer: params => {
|
||||
|
||||
@@ -57,10 +57,14 @@
|
||||
import useLoading from '@/hooks/loading';
|
||||
import useVisible from '@/hooks/visible';
|
||||
import formRules from '../types/form.rules';
|
||||
import { create${vue.featureEntity}, update${vue.featureEntity} } from '@/api/${vue.module}/${vue.feature}';
|
||||
import { create${vue.featureEntity}, update${vue.featureEntity}, ${vue.featureEntity}UpdateRequest } from '@/api/${vue.module}/${vue.feature}';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import {} from '../types/enum.types';
|
||||
import {} from '../types/const';
|
||||
#if($vue.enums.isEmpty())
|
||||
import {} from '../types/enum.types';
|
||||
#else
|
||||
import { #foreach($entry in ${vue.enums.entrySet()})${entry.value.className}#if($foreach.hasNext), #end#end } from '../types/enum.types';
|
||||
#end
|
||||
import { toOptions } from '@/utils/enum';
|
||||
|
||||
const { visible, setVisible } = useVisible();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<a-modal v-model:visible="visible"
|
||||
<a-modal :visible="visible"
|
||||
body-class="modal-form"
|
||||
title-align="start"
|
||||
:title="title"
|
||||
@@ -63,8 +63,12 @@
|
||||
import formRules from '../types/form.rules';
|
||||
import { create${vue.featureEntity}, update${vue.featureEntity}, ${vue.featureEntity}UpdateRequest } from '@/api/${vue.module}/${vue.feature}';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import {} from '../types/enum.types';
|
||||
import {} from '../types/const';
|
||||
#if($vue.enums.isEmpty())
|
||||
import {} from '../types/enum.types';
|
||||
#else
|
||||
import { #foreach($entry in ${vue.enums.entrySet()})${entry.value.className}#if($foreach.hasNext), #end#end } from '../types/enum.types';
|
||||
#end
|
||||
import { toOptions } from '@/utils/enum';
|
||||
|
||||
const { visible, setVisible } = useVisible();
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
:loading="loading"
|
||||
:columns="columns"
|
||||
#if($vue.enableRowSelection)
|
||||
:selected-keys="selectedKeys"
|
||||
v-model:selected-keys="selectedKeys"
|
||||
:row-selection="rowSelection"
|
||||
#end
|
||||
:data="tableRenderData"
|
||||
@@ -159,7 +159,7 @@
|
||||
const rowSelection = reactive(defaultRowSelection());
|
||||
#end
|
||||
|
||||
const formModel = ref<${vue.featureEntity}QueryRequest>({
|
||||
const formModel = reactive<${vue.featureEntity}QueryRequest>({
|
||||
#foreach($field in ${table.fields})
|
||||
${field.propertyName}: undefined,
|
||||
#end
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 表格 -->
|
||||
<${vue.feature}-table ref="table"
|
||||
@openAdd="() =>#if($vue.enableDrawerForm) drawer#else modal#end.openAdd()"
|
||||
@openUpdate="(e) => drawer.openUpdate(e)" />
|
||||
@openUpdate="(e) =>#if($vue.enableDrawerForm) drawer#else modal#end.openUpdate(e)" />
|
||||
#if($vue.enableDrawerForm)
|
||||
<!-- 添加修改模态框 -->
|
||||
<${vue.feature}-form-drawer ref="drawer"
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import ${vue.featureEntity}Table from './components/${vue.feature}-table.vue';
|
||||
#if($vue.drawerForm)
|
||||
#if($vue.enableDrawerForm)
|
||||
import ${vue.featureEntity}FormDrawer from './components/${vue.feature}-form-drawer.vue';
|
||||
#else
|
||||
import ${vue.featureEntity}FormModal from './components/${vue.feature}-form-modal.vue';
|
||||
@@ -35,7 +35,7 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
const table = ref();
|
||||
#if($vue.drawerForm)
|
||||
#if($vue.enableDrawerForm)
|
||||
const drawer = ref();
|
||||
#else
|
||||
const modal = ref();
|
||||
|
||||
Reference in New Issue
Block a user