!705 修复 vben 代码生成错误

Merge pull request !705 from xingyu/fix/vben_codegen
This commit is contained in:
芋道源码 2023-10-30 12:08:54 +00:00 committed by Gitee
commit df8a81f658
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 12 additions and 11 deletions

View File

@ -27,7 +27,7 @@
<mybatis-plus.version>3.5.4</mybatis-plus.version> <mybatis-plus.version>3.5.4</mybatis-plus.version>
<mybatis-plus-generator.version>3.5.4</mybatis-plus-generator.version> <mybatis-plus-generator.version>3.5.4</mybatis-plus-generator.version>
<dynamic-datasource.version>3.6.1</dynamic-datasource.version> <dynamic-datasource.version>3.6.1</dynamic-datasource.version>
<mybatis-plus-join.version>1.4.6</mybatis-plus-join.version> <mybatis-plus-join.version>1.4.7</mybatis-plus-join.version>
<redisson.version>3.18.0</redisson.version> <redisson.version>3.18.0</redisson.version>
<dm8.jdbc.version>8.1.3.62</dm8.jdbc.version> <dm8.jdbc.version>8.1.3.62</dm8.jdbc.version>
<!-- 服务保障相关 --> <!-- 服务保障相关 -->

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()
} }