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

View File

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

View File

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