diff --git a/docs/template/index-tree.vue.vm b/docs/template/index-tree.vue.vm index cc3149f8..e4d28f4a 100644 --- a/docs/template/index-tree.vue.vm +++ b/docs/template/index-tree.vue.vm @@ -6,6 +6,7 @@ import { fetchBatchDelete${BusinessName}, fetchGet${BusinessName}List } from '@/ import { useAppStore } from '@/store/modules/app'; import { useAuth } from '@/hooks/business/auth'; import { useTreeTable, useTreeTableOperate } from '@/hooks/common/tree-table'; +import { useDownload } from '@/hooks/business/download'; import { $t } from '@/locales'; import ButtonIcon from '@/components/custom/button-icon.vue'; import ${BusinessName}OperateDrawer from './modules/${business__name}-operate-drawer.vue'; @@ -45,7 +46,7 @@ const { #end params: {} }, - idField: #foreach($column in $columns)#if($column.isPk == '1')$column.javaField#end#end!, + idField: '#foreach($column in $columns)#if($column.isPk == '1')$column.javaField#end#end', columns: () => [ { type: 'selection', @@ -93,7 +94,7 @@ const { type="primary" icon="material-symbols:drive-file-rename-outline-outline" tooltipContent={$t('common.edit')} - onClick={() => edit(row.#foreach($column in $columns)#if($column.isPk == '1')$column.javaField#end#end!)} + onClick={() => edit(row)} /> ); }; @@ -148,19 +149,23 @@ async function handleDelete(#foreach($column in $columns)#if($column.isPk == '1' onDeleted(); } -async function edit(row: TableDataWithIndex) { +function edit(row: TableDataWithIndex) { handleEdit(row); } -async function addInRow(row: TableDataWithIndex) { +function addInRow(row: TableDataWithIndex) { editingData.value = jsonClone(row); handleAdd(); } + +function handleExport() { + download('/${moduleName}/${businessName}/export', searchParams, `${functionName}_#[[${new Date().getTime()}]]#.xlsx`); +}