fix: vben codegen

This commit is contained in:
xingyu 2023-10-30 18:15:22 +08:00
parent 87fb47ca6a
commit 5bfb8098d6
2 changed files with 11 additions and 10 deletions

View File

@ -1,4 +1,4 @@
import {defHttp} from '@/utils/http/axios' import { defHttp } from '@/utils/http/axios'
#set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}") #set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
// 查询${table.classComment}列表 // 查询${table.classComment}列表

View File

@ -1,10 +1,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import {columns, searchFormSchema} from './' import ${simpleClassName}Modal from './${simpleClassName}Modal.vue'
import {useI18n} from '@/hooks/web/useI18n' import { columns, searchFormSchema } from './${classNameVar}.data'
import {useMessage} from '@/hooks/web/useMessage' import { useI18n } from '@/hooks/web/useI18n'
import {useModal} from '@/components/Modal' import { useMessage } from '@/hooks/web/useMessage'
import {useTable} from '@/components/Table' import { useModal } from '@/components/Modal'
import { delete${ simpleClassName }, export${ simpleClassName }, get${ simpleClassName } Page } from '@/api/${table.moduleName}/${classNameVar}' import { useTable } from '@/components/Table'
import { delete${simpleClassName}, export${simpleClassName}, get${simpleClassName}Page } from '@/api/${table.moduleName}/${classNameVar}'
defineOptions({ name: '${table.className}' }) defineOptions({ name: '${table.className}' })
@ -14,7 +15,7 @@ const [registerModal, { openModal }] = useModal()
const [registerTable, { getForm, reload }] = useTable({ const [registerTable, { getForm, reload }] = useTable({
title: '${table.classComment}列表', title: '${table.classComment}列表',
api: get${ simpleClassName }Page, api: get${simpleClassName}Page,
columns, columns,
formConfig: { labelWidth: 120, schemas: searchFormSchema }, formConfig: { labelWidth: 120, schemas: searchFormSchema },
useSearchForm: true, useSearchForm: true,
@ -41,14 +42,14 @@ async function handleExport() {
iconType: 'warning', iconType: 'warning',
content: t('common.exportMessage'), content: t('common.exportMessage'),
async onOk() { async onOk() {
await export${ simpleClassName } (getForm().getFieldsValue()) await export${simpleClassName}(getForm().getFieldsValue())
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
}, },
}) })
} }
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await delete${ simpleClassName } (record.id) await delete${simpleClassName}(record.id)
createMessage.success(t('common.delSuccessText')) createMessage.success(t('common.delSuccessText'))
reload() reload()
} }