vue3NativeForm.ftl 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <#include "/common/utils.ftl">
  2. <#-- update-begin---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
  3. <#if po.isShow =='Y' && po.fieldName != 'id' && po.fieldName !='delFlag' && isNotPidField(tableVo, po.fieldDbName)>
  4. <#-- update-end---author:chenrui ---date:20240108 for:[issues/5755]vue代码不加入逻辑删除字段---------- -->
  5. <#assign form_field_dictCode="">
  6. <#if po.dictTable?default("")?trim?length gt 1 && po.dictText?default("")?trim?length gt 1 && po.dictField?default("")?trim?length gt 1>
  7. <#assign form_field_dictCode="${po.dictTable},${po.dictText},${po.dictField}">
  8. <#elseif po.dictField?default("")?trim?length gt 1>
  9. <#assign form_field_dictCode="${po.dictField}">
  10. </#if>
  11. <a-col :span="${form_span}">
  12. <a-form-item label="${po.filedComment}" v-bind="validateInfos.${autoStringSuffixForModel(po)}" id="${formEntityName}-${autoStringSuffixForModel(po)}" name="${autoStringSuffixForModel(po)}">
  13. <#if po.classType =='date'>
  14. <a-date-picker placeholder="请选择${po.filedComment}" <#if po.extendParams?exists && po.extendParams.picker?exists>picker="${po.extendParams.picker}"</#if> v-model:value="formData.${po.fieldName}" value-format="YYYY-MM-DD" style="width: 100%" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  15. <#elseif po.classType =='datetime'>
  16. <a-date-picker placeholder="请选择${po.filedComment}" v-model:value="formData.${po.fieldName}" showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  17. <#elseif po.classType =='time'>
  18. <#assign need_time = true>
  19. <time-picker placeholder="请选择${po.filedComment}" value-format="HH:mm:ss" v-model:value="formData.${po.fieldName}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  20. <#elseif po.classType =='popup'>
  21. <#assign need_popup = true>
  22. <#assign sourceFields = po.dictField?default("")?trim?split(",")/>
  23. <#assign targetFields = po.dictText?default("")?trim?split(",")/>
  24. <j-popup
  25. placeholder="请选择${po.filedComment}"
  26. v-model:value="formData.${po.fieldName}"
  27. code="${po.dictTable}"
  28. :fieldConfig="[
  29. <#list sourceFields as fieldName>
  30. { source: '${fieldName}', target: '${dashedToCamel(targetFields[fieldName_index])}' },
  31. </#list>
  32. ]"
  33. :multi="${po.extendParams.popupMulti?c}"
  34. :setFieldsValue="setFieldsValue"
  35. <#if po.readonly=='Y'>disabled</#if><#rt> allow-clear />
  36. <#elseif po.classType =='popup_dict'>
  37. <#assign need_popup_dict = true>
  38. <#assign sourceFields = po.dictField?default("")?trim?split(",")/>
  39. <#assign targetFields = po.dictText?default("")?trim?split(",")/>
  40. <j-popup-dict
  41. placeholder="请选择${po.filedComment}"
  42. v-model:value="formData.${po.fieldName}"
  43. dictCode="${po.dictTable},${po.dictText},${po.dictField}"
  44. :multi="${po.extendParams.popupMulti?c}" <#if po.readonly=='Y'>disabled</#if> />
  45. <#elseif po.classType =='sel_depart'>
  46. <#assign need_dept = true>
  47. <j-select-dept v-model:value="formData.${po.fieldName}" <#if po.extendParams?exists && po.extendParams.text?exists>labelKey="${po.extendParams.text}"</#if> <#if po.extendParams?exists && po.extendParams.store?exists>rowKey="${po.extendParams.store}"</#if> <#if po.readonly=='Y'>disabled</#if> :multiple="${po.extendParams.multi?default('true')}" checkStrictly <#if po.readonly=='Y'>disabled</#if> allow-clear />
  48. <#elseif po.classType =='switch'>
  49. <#assign need_switch = true>
  50. <j-switch v-model:value="formData.${po.fieldName}" <#if po.dictField != 'is_open'>:options="${po.dictField}"</#if> <#if po.readonly=='Y'>disabled</#if>></j-switch>
  51. <#elseif po.classType =='pca'>
  52. <#assign need_pca = true>
  53. <j-area-linkage v-model:value="formData.${po.fieldName}" placeholder="请输入${po.filedComment}" saveCode="region" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  54. <#elseif po.classType =='markdown'>
  55. <#assign need_markdown = true>
  56. <j-markdown-editor v-model:value="formData.${autoStringSuffixForModel(po)}" id="${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>></j-markdown-editor>
  57. <#elseif po.classType =='password'>
  58. <a-input-password v-model:value="formData.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  59. <#elseif po.classType =='sel_user'>
  60. <#assign need_dept_user = true>
  61. <#-- update-begin---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
  62. <j-select-user v-model:value="formData.${po.fieldName}" <#if po.extendParams?exists && po.extendParams.text?exists>labelKey="${po.extendParams.text}"</#if> <#if po.extendParams?exists && po.extendParams.store?exists>rowKey="${po.extendParams.store}"</#if> <#if po.readonly=='Y'>disabled</#if> allow-clear />
  63. <#-- update-end---author:chenrui ---date:20240102 for:[issue/#5711]修复用户选择组件在生成代码后变成部门用户选择组件---------- -->
  64. <#elseif po.classType =='textarea'>
  65. <a-textarea v-model:value="formData.${autoStringSuffixForModel(po)}" :rows="4" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if>/>
  66. <#elseif po.classType=='radio'>
  67. <#assign need_select_tag = true>
  68. <j-dict-select-tag type='radio' v-model:value="formData.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  69. <#elseif po.classType=='list'>
  70. <#assign need_select_tag = true>
  71. <j-dict-select-tag v-model:value="formData.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  72. <#elseif po.classType=='list_multi'>
  73. <#assign need_multi = true>
  74. <j-select-multiple type="${po.classType}" v-model:value="formData.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> :triggerChange="false"/>
  75. <#elseif po.classType=='checkbox'>
  76. <#assign need_checkbox = true>
  77. <j-checkbox type="${po.classType}" v-model:value="formData.${po.fieldName}" dictCode="${form_field_dictCode}" placeholder="请选择${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  78. <#elseif po.classType=='sel_search'>
  79. <#assign need_search = true>
  80. <j-search-select v-model:value="formData.${po.fieldName}" dict="${form_field_dictCode}" <#if po.readonly=='Y'>disabled</#if> allow-clear />
  81. <#elseif po.classType=='cat_tree'>
  82. <#assign need_category = true>
  83. <j-category-select v-model:value="formData.${po.fieldName}" pcode="${po.dictField?default("")}" placeholder="请选择${po.filedComment}" <#if po.dictText?default("")?trim?length gt 1>back="${dashedToCamel(po.dictText)}"</#if> <#if po.readonly=='Y'>disabled</#if> @change="(value) => handleFormChange('${po.fieldName}', value)" allow-clear />
  84. <#elseif po.fieldDbType=='int' || po.fieldDbType=='double' || po.fieldDbType=='BigDecimal'>
  85. <a-input-number v-model:value="formData.${po.fieldName}" placeholder="请输入${po.filedComment}" style="width: 100%" <#if po.readonly=='Y'>disabled</#if>/>
  86. <#elseif po.classType=='file'>
  87. <#assign need_upload = true>
  88. <j-upload v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if> <#if po.uploadnum??>:maxCount=${po.uploadnum}</#if>></j-upload>
  89. <#elseif po.classType=='image'>
  90. <#assign need_image_upload = true>
  91. <j-image-upload <#if po.uploadnum??>:fileMax=${po.uploadnum}<#else>:fileMax="0"</#if> v-model:value="formData.${po.fieldName}" <#if po.readonly=='Y'>disabled</#if>></j-image-upload>
  92. <#elseif po.classType=='umeditor'>
  93. <#assign need_editor = true>
  94. <j-editor v-model:value="formData.${autoStringSuffixForModel(po)}" <#if po.readonly=='Y'>disabled</#if> :autoFocus="false"/>
  95. <#elseif po.fieldDbType=='Blob'>
  96. <a-input v-model:value="formData.${autoStringSuffixForModel(po)}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear ></a-input>
  97. <#elseif po.classType == 'sel_tree'>
  98. <#assign need_select_tree = true>
  99. <j-tree-select
  100. <#if po.dictText??>
  101. <#if po.dictText?split(',')[2]?? && po.dictText?split(',')[0]??>
  102. dict="${po.dictTable},${po.dictText?split(',')[2]},${po.dictText?split(',')[0]}"
  103. <#elseif po.dictText?split(',')[1]??>
  104. pidField="${po.dictText?split(',')[1]}"
  105. <#elseif po.dictText?split(',')[3]??>
  106. hasChildField="${po.dictText?split(',')[3]}"
  107. </#if>
  108. </#if>
  109. pidValue="${po.dictField}"
  110. <#if po.readonly=='Y'>disabled</#if>
  111. v-model:value="formData.${po.fieldName}"
  112. @change="(value) => handleFormChange('${po.fieldName}', value)" allow-clear >
  113. </j-tree-select>
  114. <#else>
  115. <a-input v-model:value="formData.${po.fieldName}" placeholder="请输入${po.filedComment}" <#if po.readonly=='Y'>disabled</#if> allow-clear ></a-input>
  116. </#if>
  117. </a-form-item>
  118. </a-col>
  119. </#if>