|
@@ -54,14 +54,14 @@ const [FormModal, formModalApi] = useVbenModal({
|
|
|
|
|
|
|
|
/** 切换树形展开/收缩状态 */
|
|
/** 切换树形展开/收缩状态 */
|
|
|
const isExpanded = ref(true);
|
|
const isExpanded = ref(true);
|
|
|
-function toggleExpand() {
|
|
|
|
|
|
|
+function handleExpand() {
|
|
|
isExpanded.value = !isExpanded.value;
|
|
isExpanded.value = !isExpanded.value;
|
|
|
gridApi.grid.setAllTreeExpand(isExpanded.value);
|
|
gridApi.grid.setAllTreeExpand(isExpanded.value);
|
|
|
}
|
|
}
|
|
|
#end
|
|
#end
|
|
|
|
|
|
|
|
/** 刷新表格 */
|
|
/** 刷新表格 */
|
|
|
-function onRefresh() {
|
|
|
|
|
|
|
+function handleRefresh() {
|
|
|
#if ($table.templateType == 12) ## 内嵌情况
|
|
#if ($table.templateType == 12) ## 内嵌情况
|
|
|
gridApi.reload();
|
|
gridApi.reload();
|
|
|
#else
|
|
#else
|
|
@@ -92,9 +92,9 @@ async function handleDelete(row: ${apiName}.${simpleClassName}) {
|
|
|
text: $t('ui.actionMessage.deleting', [row.id]),
|
|
text: $t('ui.actionMessage.deleting', [row.id]),
|
|
|
});
|
|
});
|
|
|
try {
|
|
try {
|
|
|
- await delete${simpleClassName}(row.id as number);
|
|
|
|
|
|
|
+ await delete${simpleClassName}(row.id!);
|
|
|
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
|
ElMessage.success($t('ui.actionMessage.deleteSuccess', [row.id]));
|
|
|
- onRefresh();
|
|
|
|
|
|
|
+ handleRefresh();
|
|
|
} finally {
|
|
} finally {
|
|
|
loadingInstance.close();
|
|
loadingInstance.close();
|
|
|
}
|
|
}
|
|
@@ -111,7 +111,7 @@ async function handleDeleteBatch() {
|
|
|
await delete${simpleClassName}List(checkedIds.value);
|
|
await delete${simpleClassName}List(checkedIds.value);
|
|
|
checkedIds.value = [];
|
|
checkedIds.value = [];
|
|
|
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
|
|
ElMessage.success($t('ui.actionMessage.deleteSuccess'));
|
|
|
- onRefresh();
|
|
|
|
|
|
|
+ handleRefresh();
|
|
|
} finally {
|
|
} finally {
|
|
|
loadingInstance.close();
|
|
loadingInstance.close();
|
|
|
}
|
|
}
|
|
@@ -207,7 +207,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<Page auto-content-height>
|
|
<Page auto-content-height>
|
|
|
- <FormModal @success="onRefresh" />
|
|
|
|
|
|
|
+ <FormModal @success="handleRefresh" />
|
|
|
#if ($table.templateType == 11) ## erp情况
|
|
#if ($table.templateType == 11) ## erp情况
|
|
|
<div>
|
|
<div>
|
|
|
#end
|
|
#end
|
|
@@ -242,7 +242,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|
|
{
|
|
{
|
|
|
label: isExpanded ? '收缩' : '展开',
|
|
label: isExpanded ? '收缩' : '展开',
|
|
|
type: 'primary',
|
|
type: 'primary',
|
|
|
- onClick: toggleExpand,
|
|
|
|
|
|
|
+ onClick: handleExpand,
|
|
|
},
|
|
},
|
|
|
#end
|
|
#end
|
|
|
{
|
|
{
|