fix: vue3 代码生成 bugs

This commit is contained in:
xingyu 2022-12-06 23:04:37 +08:00
parent 57bfef8d24
commit ba6a2957fc
3 changed files with 8 additions and 8 deletions

View File

@ -5,7 +5,7 @@ export interface ${simpleClassName}VO {
#if ($column.createOperation || $column.updateOperation) #if ($column.createOperation || $column.updateOperation)
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double") #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
${column.javaField}: number ${column.javaField}: number
#elseif(${column.javaType.toLowerCase()} == "date") #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdatetime")
${column.javaField}: Date ${column.javaField}: Date
#else #else
${column.javaField}: ${column.javaType.toLowerCase()} ${column.javaField}: ${column.javaType.toLowerCase()}
@ -19,7 +19,7 @@ export interface ${simpleClassName}PageReqVO extends PageParam {
#if (${column.listOperation})##查询操作 #if (${column.listOperation})##查询操作
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double") #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
${column.javaField}?: number ${column.javaField}?: number
#elseif(${column.javaType.toLowerCase()} == "date") #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdatetime")
${column.javaField}?: Date[] ${column.javaField}?: Date[]
#else #else
${column.javaField}?: ${column.javaType.toLowerCase()} ${column.javaField}?: ${column.javaType.toLowerCase()}
@ -33,8 +33,8 @@ export interface ${simpleClassName}ExcelReqVO {
#if (${column.listOperation})##查询操作 #if (${column.listOperation})##查询操作
#if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double") #if(${column.javaType.toLowerCase()} == "long" || ${column.javaType.toLowerCase()} == "integer" || ${column.javaType.toLowerCase()} == "double")
${column.javaField}?: number ${column.javaField}?: number
#elseif(${column.javaType.toLowerCase()} == "date") #elseif(${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdatetime")
${column.javaField}?: string[] ${column.javaField}?: Date[]
#else #else
${column.javaField}?: ${column.javaType.toLowerCase()} ${column.javaField}?: ${column.javaType.toLowerCase()}
#end #end

View File

@ -42,7 +42,7 @@ const crudSchemas = reactive<VxeCrudSchema>({
#if (!$column.createOperation && !$column.updateOperation) #if (!$column.createOperation && !$column.updateOperation)
isForm: false, isForm: false,
#elseif(!("" != $column.dictType)) #elseif(!("" != $column.dictType))
#if ($column.htmlType == "datetime")## 时间框 #if (${column.javaType.toLowerCase()} == "date" || ${column.javaType.toLowerCase()} == "localdatetime")
formatter: 'formatDate', formatter: 'formatDate',
form: { form: {
component: 'DatePicker', component: 'DatePicker',

View File

@ -74,7 +74,7 @@
</template> </template>
</XModal> </XModal>
</template> </template>
<script setup lang="ts" name="${table.moduleName}"> <script setup lang="ts" name="${simpleClassName}">
// 全局相关的 import // 全局相关的 import
import { ref, unref } from 'vue' import { ref, unref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
@ -91,7 +91,7 @@ const message = useMessage() // 消息弹窗
// 列表相关的变量 // 列表相关的变量
const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref const xGrid = ref<VxeGridInstance>() // 列表 Grid Ref
const { gridOptions, reloadList, deleteData, exportList } = useVxeGrid<${simpleClassName}Api.${simpleClassName}VO>({ const { gridOptions, getList, deleteData, exportList } = useVxeGrid<${simpleClassName}Api.${simpleClassName}VO>({
allSchemas: allSchemas, allSchemas: allSchemas,
getListApi: ${simpleClassName}Api.get${simpleClassName}PageApi, getListApi: ${simpleClassName}Api.get${simpleClassName}PageApi,
deleteApi: ${simpleClassName}Api.delete${simpleClassName}Api, deleteApi: ${simpleClassName}Api.delete${simpleClassName}Api,
@ -169,7 +169,7 @@ const submitForm = async () => {
} finally { } finally {
actionLoading.value = false actionLoading.value = false
// 刷新列表 // 刷新列表
await reloadList(xGrid) await getList(xGrid)
} }
} }
}) })