【同步】BOOT 和 CLOUD 的功能

This commit is contained in:
YunaiV
2025-07-15 21:54:41 +08:00
parent 031fa11e38
commit 08c31e889d
211 changed files with 9932 additions and 2671 deletions

View File

@@ -8,7 +8,7 @@ import { ImageUpload, FileUpload } from "#/components/upload";
import { message, Tabs, Form, Input, Textarea, Select, RadioGroup, Radio, CheckboxGroup, Checkbox, DatePicker, TreeSelect } from 'ant-design-vue';
import { DICT_TYPE, getDictOptions } from '#/utils';
#if($table.templateType == 2)## 树表需要导入这些
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${table.businessName}';
import { get${simpleClassName}List } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
import { handleTree } from '@vben/utils'
#end
## 特殊:主子表专属逻辑
@@ -22,7 +22,7 @@ import { handleTree } from '@vben/utils'
import { computed, ref } from 'vue';
import { $t } from '#/locales';
import { get${simpleClassName}, create${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
import { get${simpleClassName}, create${simpleClassName}, update${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
const emit = defineEmits(['success']);

View File

@@ -30,7 +30,7 @@ import { handleTree,isEmpty } from '@vben/utils'
import { get${simpleClassName}List, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
#else## 标准表接口
import { isEmpty } from '@vben/utils';
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ListByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}List,#end export${simpleClassName} } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
#end
import { downloadFileFromBlobPart } from '@vben/utils';
@@ -123,24 +123,24 @@ const [FormModal, formModalApi] = useVbenModal({
});
/** 创建${table.classComment} */
function onCreate() {
function handleCreate() {
formModalApi.setData({}).open();
}
/** 编辑${table.classComment} */
function onEdit(row: ${simpleClassName}Api.${simpleClassName}) {
function handleEdit(row: ${simpleClassName}Api.${simpleClassName}) {
formModalApi.setData(row).open();
}
#if (${table.templateType} == 2)## 树表特有:新增下级
/** 新增下级${table.classComment} */
function onAppend(row: ${simpleClassName}Api.${simpleClassName}) {
function handleAppend(row: ${simpleClassName}Api.${simpleClassName}) {
formModalApi.setData({ ${treeParentColumn.javaField}: row.id }).open();
}
#end
/** 删除${table.classComment} */
async function onDelete(row: ${simpleClassName}Api.${simpleClassName}) {
async function handleDelete(row: ${simpleClassName}Api.${simpleClassName}) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]),
duration: 0,
@@ -160,14 +160,14 @@ async function onDelete(row: ${simpleClassName}Api.${simpleClassName}) {
#if ($table.templateType != 2 && $deleteBatchEnable)
/** 批量删除${table.classComment} */
async function onDeleteBatch() {
async function handleDeleteBatch() {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting'),
duration: 0,
key: 'action_process_msg',
});
try {
await delete${simpleClassName}ListByIds(deleteIds.value);
await delete${simpleClassName}List(checkedIds.value);
message.success( $t('ui.actionMessage.deleteSuccess') );
await getList();
} finally {
@@ -175,13 +175,13 @@ async function onDeleteBatch() {
}
}
const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID
function setDeleteIds({
const checkedIds = ref<number[]>([])
function handleRowCheckboxChange({
records,
}: {
records: ${simpleClassName}Api.${simpleClassName}[];
}) {
deleteIds.value = records.map((item) => item.id);
checkedIds.value = records.map((item) => item.id);
}
#end
@@ -315,7 +315,7 @@ onMounted(() => {
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
@click="handleCreate"
v-access:code="['${permissionPrefix}:create']"
>
{{ $t('ui.actionTitle.create', ['${table.classComment}']) }}
@@ -336,8 +336,8 @@ onMounted(() => {
type="primary"
danger
class="ml-2"
:disabled="isEmpty(deleteIds)"
@click="onDeleteBatch"
:disabled="isEmpty(checkedIds)"
@click="handleDeleteBatch"
v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']"
>
批量删除
@@ -368,8 +368,8 @@ onMounted(() => {
show-overflow
:loading="loading"
#if ($table.templateType != 2 && $deleteBatchEnable)
@checkboxAll="setDeleteIds"
@checkboxChange="setDeleteIds"
@checkboxAll="handleRowCheckboxChange"
@checkboxChange="handleRowCheckboxChange"
#end
>
#if ($table.templateType != 2 && $deleteBatchEnable)
@@ -426,7 +426,7 @@ onMounted(() => {
<Button
size="small"
type="link"
@click="onAppend(row as any)"
@click="handleAppend(row as any)"
v-access:code="['${permissionPrefix}:create']"
>
新增下级
@@ -435,7 +435,7 @@ onMounted(() => {
<Button
size="small"
type="link"
@click="onEdit(row as any)"
@click="handleEdit(row as any)"
v-access:code="['${permissionPrefix}:update']"
>
{{ $t('ui.actionTitle.edit') }}
@@ -448,7 +448,7 @@ onMounted(() => {
#if ( $table.templateType == 2 )
:disabled="!isEmpty(row?.children)"
#end
@click="onDelete(row as any)"
@click="handleDelete(row as any)"
v-access:code="['${permissionPrefix}:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@@ -29,7 +29,7 @@
#end
#if ($table.templateType == 11) ## erp
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ListByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}List,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${simpleClassName_strikeCase}';
import { isEmpty } from '@vben/utils';
#else
#if ($subTable.subJoinMany) ## 一对多
@@ -50,7 +50,7 @@ const props = defineProps<{
});
/** 创建${subTable.classComment} */
function onCreate() {
function handleCreate() {
if (!props.${subJoinColumn.javaField}){
message.warning("请先选择一个${table.classComment}!")
return
@@ -59,12 +59,12 @@ function onCreate() {
}
/** 编辑${subTable.classComment} */
function onEdit(row: ${simpleClassName}Api.${subSimpleClassName}) {
function handleEdit(row: ${simpleClassName}Api.${subSimpleClassName}) {
formModalApi.setData(row).open();
}
/** 删除${subTable.classComment} */
async function onDelete(row: ${simpleClassName}Api.${subSimpleClassName}) {
async function handleDelete(row: ${simpleClassName}Api.${subSimpleClassName}) {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting', [row.id]),
duration: 0,
@@ -84,14 +84,14 @@ async function onDelete(row: ${simpleClassName}Api.${subSimpleClassName}) {
#if ($deleteBatchEnable)
/** 批量删除${subTable.classComment} */
async function onDeleteBatch() {
async function handleDeleteBatch() {
const hideLoading = message.loading({
content: $t('ui.actionMessage.deleting'),
duration: 0,
key: 'action_process_msg',
});
try {
await delete${subSimpleClassName}ListByIds(deleteIds.value);
await delete${subSimpleClassName}List(checkedIds.value);
message.success( $t('ui.actionMessage.deleteSuccess') );
await getList();
} finally {
@@ -99,13 +99,13 @@ async function onDeleteBatch() {
}
}
const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID
function setDeleteIds({
const checkedIds = ref<number[]>([])
function handleRowCheckboxChange({
records,
}: {
records: ${simpleClassName}Api.${subSimpleClassName}[];
}) {
deleteIds.value = records.map((item) => item.id);
checkedIds.value = records.map((item) => item.id);
}
#end
#end
@@ -299,7 +299,7 @@ onMounted(() => {
class="ml-2"
:icon="h(Plus)"
type="primary"
@click="onCreate"
@click="handleCreate"
v-access:code="['${permissionPrefix}:create']"
>
{{ $t('ui.actionTitle.create', ['${table.classComment}']) }}
@@ -310,8 +310,8 @@ onMounted(() => {
type="primary"
danger
class="ml-2"
:disabled="isEmpty(deleteIds)"
@click="onDeleteBatch"
:disabled="isEmpty(checkedIds)"
@click="handleDeleteBatch"
v-access:code="['${table.moduleName}:${simpleClassName_strikeCase}:delete']"
>
批量删除
@@ -325,8 +325,8 @@ onMounted(() => {
show-overflow
:loading="loading"
#if ($deleteBatchEnable)
@checkboxAll="setDeleteIds"
@checkboxChange="setDeleteIds"
@checkboxAll="handleRowCheckboxChange"
@checkboxChange="handleRowCheckboxChange"
#end
>
#if ($deleteBatchEnable)
@@ -361,7 +361,7 @@ onMounted(() => {
<Button
size="small"
type="link"
@click="onEdit(row as any)"
@click="handleEdit(row as any)"
v-access:code="['${permissionPrefix}:update']"
>
{{ $t('ui.actionTitle.edit') }}
@@ -371,7 +371,7 @@ onMounted(() => {
type="link"
danger
class="ml-2"
@click="onDelete(row as any)"
@click="handleDelete(row as any)"
v-access:code="['${permissionPrefix}:delete']"
>
{{ $t('ui.actionTitle.delete') }}

View File

@@ -426,9 +426,7 @@ export function use${subSimpleClassName}GridColumns(): VxeTableGridOptions<${sim
#else
#if ($subTable.subJoinMany) ## 一对多
/** 新增/修改列表的字段 */
export function use${subSimpleClassName}GridEditColumns(
onActionClick?: OnActionClickFn<${simpleClassName}Api.${subSimpleClassName}>,
): VxeTableGridOptions<${simpleClassName}Api.${subSimpleClassName}>['columns'] {
export function use${subSimpleClassName}GridEditColumns(): VxeTableGridOptions<${simpleClassName}Api.${subSimpleClassName}>['columns'] {
return [
#foreach($column in $subColumns)
#if ($column.createOperation || $column.updateOperation)

View File

@@ -21,7 +21,7 @@ import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
#if (${table.templateType} == 2)## 树表接口
import { get${simpleClassName}List, delete${simpleClassName}, export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
#else## 标准表接口
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}ListByIds,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
import { get${simpleClassName}Page, delete${simpleClassName},#if ($deleteBatchEnable) delete${simpleClassName}List,#end export${simpleClassName} } from '#/api/${table.moduleName}/${table.businessName}';
#end
import { downloadFileFromBlobPart, isEmpty } from '@vben/utils';
@@ -101,7 +101,7 @@ async function handleDeleteBatch() {
key: 'action_key_msg',
});
try {
await delete${simpleClassName}ListByIds(deleteIds.value);
await delete${simpleClassName}List(checkedIds.value);
message.success({
content: $t('ui.actionMessage.deleteSuccess'),
key: 'action_key_msg',
@@ -112,13 +112,13 @@ async function handleDeleteBatch() {
}
}
const deleteIds = ref<number[]>([]) // 待删除${table.classComment} ID
function setDeleteIds({
const checkedIds = ref<number[]>([])
function handleRowCheckboxChange({
records,
}: {
records: ${simpleClassName}Api.${simpleClassName}[];
}) {
deleteIds.value = records.map((item) => item.id);
checkedIds.value = records.map((item) => item.id);
}
#end
@@ -191,9 +191,9 @@ const [Grid, gridApi] = useVbenVxeGrid({
select${simpleClassName}.value = row;
},
#end
#if($deleteBatchEnable)
checkboxAll: setDeleteIds,
checkboxChange: setDeleteIds,
#if(${table.templateType} != 2 && $deleteBatchEnable)
checkboxAll: handleRowCheckboxChange,
checkboxChange: handleRowCheckboxChange,
#end
}
#end
@@ -254,7 +254,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
type: 'primary',
danger: true,
icon: ACTION_ICON.DELETE,
disabled: isEmpty(deleteIds),
disabled: isEmpty(checkedIds),
auth: ['${table.moduleName}:${simpleClassName_strikeCase}:delete'],
onClick: handleDeleteBatch,
},

View File

@@ -19,7 +19,7 @@ import { $t } from '#/locales';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
#if ($table.templateType == 11) ## erp
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}ListByIds,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
import { delete${subSimpleClassName},#if ($deleteBatchEnable) delete${subSimpleClassName}List,#end get${subSimpleClassName}Page } from '#/api/${table.moduleName}/${table.businessName}';
import { use${subSimpleClassName}GridFormSchema, use${subSimpleClassName}GridColumns } from '../data';
import { isEmpty } from '@vben/utils';
#else
@@ -81,7 +81,7 @@ async function handleDeleteBatch() {
key: 'action_key_msg',
});
try {
await delete${subSimpleClassName}ListByIds(deleteIds.value);
await delete${subSimpleClassName}List(checkedIds.value);
message.success({
content: $t('ui.actionMessage.deleteSuccess', [row.id]),
key: 'action_key_msg',
@@ -92,13 +92,13 @@ async function handleDeleteBatch() {
}
}
const deleteIds = ref<number[]>([]) // 待删除${subTable.classComment} ID
function setDeleteIds({
const checkedIds = ref<number[]>([])
function handleRowCheckboxChange({
records,
}: {
records: ${simpleClassName}Api.${subSimpleClassName}[];
}) {
deleteIds.value = records.map((item) => item.id);
checkedIds.value = records.map((item) => item.id);
}
#end
@@ -151,8 +151,8 @@ const [Grid, gridApi] = useVbenVxeGrid({
} as VxeTableGridOptions<${simpleClassName}Api.${subSimpleClassName}>,
#if (${table.templateType} == 11 && $deleteBatchEnable)
gridEvents:{
checkboxAll: setDeleteIds,
checkboxChange: setDeleteIds,
checkboxAll: handleRowCheckboxChange,
checkboxChange: handleRowCheckboxChange,
}
#end
});
@@ -204,7 +204,7 @@ watch(
type: 'primary',
danger: true,
icon: ACTION_ICON.DELETE,
disabled: isEmpty(deleteIds),
disabled: isEmpty(checkedIds),
auth: ['${table.moduleName}:${simpleClassName_strikeCase}:delete'],
onClick: handleDeleteBatch,
},