Commit 3219611a3296922b7925d241513b31df00a45584

Authored by xingyu
1 parent f8e54dda

fix: vue3 vben codegen dict

yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm
@@ -53,7 +53,14 @@ export const searchFormSchema: FormSchema[] = [ @@ -53,7 +53,14 @@ export const searchFormSchema: FormSchema[] = [
53 component: 'Select', 53 component: 'Select',
54 componentProps: { 54 componentProps: {
55 #if ("" != $dictType)## 设置了 dictType 数据字典的情况 55 #if ("" != $dictType)## 设置了 dictType 数据字典的情况
56 - options: getIntDictOptions(DICT_TYPE.$dictType.toUpperCase()) 56 + #if ($javaType == "Integer" || $javaType == "Long" || $javaType == "Byte" || $javaType == "Short")
  57 + #set ($dictMethod = "getIntDictOptions")
  58 + #elseif ($javaType == "String")
  59 + #set ($dictMethod = "getStrDictOptions")
  60 + #elseif ($javaType == "Boolean")
  61 + #set ($dictMethod = "getBoolDictOptions")
  62 + #end
  63 + options: $dictMethod(DICT_TYPE.$dictType.toUpperCase())
57 #else## 未设置 dictType 数据字典的情况 64 #else## 未设置 dictType 数据字典的情况
58 options: [] 65 options: []
59 #end 66 #end
@@ -99,7 +106,14 @@ export const formSchema: FormSchema[] = [ @@ -99,7 +106,14 @@ export const formSchema: FormSchema[] = [
99 component: 'Select', 106 component: 'Select',
100 componentProps: { 107 componentProps: {
101 #if ("" != $dictType)## 有数据字典 108 #if ("" != $dictType)## 有数据字典
102 - options: getIntDictOptions(DICT_TYPE.COMMON_STATUS) 109 + #if ($javaType == "Integer" || $javaType == "Long" || $javaType == "Byte" || $javaType == "Short")
  110 + #set ($dictMethod = "getIntDictOptions")
  111 + #elseif ($javaType == "String")
  112 + #set ($dictMethod = "getStrDictOptions")
  113 + #elseif ($javaType == "Boolean")
  114 + #set ($dictMethod = "getBoolDictOptions")
  115 + #end
  116 + options: $dictMethod(DICT_TYPE.$dictType.toUpperCase())
103 #else##没数据字典 117 #else##没数据字典
104 options:[] 118 options:[]
105 #end 119 #end