Commit 5bfb8098d6cfffae442f38099dab0569223344d5
1 parent
87fb47ca
fix: vben codegen
Showing
2 changed files
with
11 additions
and
10 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/api/api.ts.vm
| 1 | -import {defHttp} from '@/utils/http/axios' | 1 | +import { defHttp } from '@/utils/http/axios' |
| 2 | #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") | 2 | #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") |
| 3 | 3 | ||
| 4 | // 查询${table.classComment}列表 | 4 | // 查询${table.classComment}列表 |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/index.vue.vm
| 1 | <script lang="ts" setup> | 1 | <script lang="ts" setup> |
| 2 | - import {columns, searchFormSchema} from './' | ||
| 3 | - import {useI18n} from '@/hooks/web/useI18n' | ||
| 4 | - import {useMessage} from '@/hooks/web/useMessage' | ||
| 5 | - import {useModal} from '@/components/Modal' | ||
| 6 | - import {useTable} from '@/components/Table' | ||
| 7 | - import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}' | 2 | +import ${simpleClassName}Modal from './${simpleClassName}Modal.vue' |
| 3 | +import { columns, searchFormSchema } from './${classNameVar}.data' | ||
| 4 | +import { useI18n } from '@/hooks/web/useI18n' | ||
| 5 | +import { useMessage } from '@/hooks/web/useMessage' | ||
| 6 | +import { useModal } from '@/components/Modal' | ||
| 7 | +import { useTable } from '@/components/Table' | ||
| 8 | +import { delete${simpleClassName}, export${simpleClassName}, get${simpleClassName}Page } from '@/api/${table.moduleName}/${classNameVar}' | ||
| 8 | 9 | ||
| 9 | defineOptions({ name: '${table.className}' }) | 10 | defineOptions({ name: '${table.className}' }) |
| 10 | 11 | ||
| @@ -14,7 +15,7 @@ const [registerModal, { openModal }] = useModal() | @@ -14,7 +15,7 @@ const [registerModal, { openModal }] = useModal() | ||
| 14 | 15 | ||
| 15 | const [registerTable, { getForm, reload }] = useTable({ | 16 | const [registerTable, { getForm, reload }] = useTable({ |
| 16 | title: '${table.classComment}列表', | 17 | title: '${table.classComment}列表', |
| 17 | - api: get${ simpleClassName }Page, | 18 | + api: get${simpleClassName}Page, |
| 18 | columns, | 19 | columns, |
| 19 | formConfig: { labelWidth: 120, schemas: searchFormSchema }, | 20 | formConfig: { labelWidth: 120, schemas: searchFormSchema }, |
| 20 | useSearchForm: true, | 21 | useSearchForm: true, |
| @@ -41,14 +42,14 @@ async function handleExport() { | @@ -41,14 +42,14 @@ async function handleExport() { | ||
| 41 | iconType: 'warning', | 42 | iconType: 'warning', |
| 42 | content: t('common.exportMessage'), | 43 | content: t('common.exportMessage'), |
| 43 | async onOk() { | 44 | async onOk() { |
| 44 | - await export${ simpleClassName } (getForm().getFieldsValue()) | 45 | + await export${simpleClassName}(getForm().getFieldsValue()) |
| 45 | createMessage.success(t('common.exportSuccessText')) | 46 | createMessage.success(t('common.exportSuccessText')) |
| 46 | }, | 47 | }, |
| 47 | }) | 48 | }) |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | async function handleDelete(record: Recordable) { | 51 | async function handleDelete(record: Recordable) { |
| 51 | - await delete${ simpleClassName } (record.id) | 52 | + await delete${simpleClassName}(record.id) |
| 52 | createMessage.success(t('common.delSuccessText')) | 53 | createMessage.success(t('common.delSuccessText')) |
| 53 | reload() | 54 | reload() |
| 54 | } | 55 | } |