CloumInfoForm.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <vxe-table
  3. ref="dragTable"
  4. border
  5. :data="info"
  6. max-height="600"
  7. stripe
  8. class="xtable-scrollbar"
  9. :column-config="{ resizable: true }"
  10. >
  11. <vxe-column title="字段列名" field="columnName" fixed="left" width="10%" />
  12. <vxe-colgroup title="基础属性">
  13. <vxe-column title="字段描述" field="columnComment" width="10%">
  14. <template #default="{ row }">
  15. <vxe-input v-model="row.columnComment" placeholder="请输入字段描述" />
  16. </template>
  17. </vxe-column>
  18. <vxe-column title="物理类型" field="dataType" width="10%" />
  19. <vxe-column title="Java类型" width="10%" field="javaType">
  20. <template #default="{ row }">
  21. <vxe-select v-model="row.javaType" placeholder="请选择Java类型">
  22. <vxe-option label="Long" value="Long" />
  23. <vxe-option label="String" value="String" />
  24. <vxe-option label="Integer" value="Integer" />
  25. <vxe-option label="Double" value="Double" />
  26. <vxe-option label="BigDecimal" value="BigDecimal" />
  27. <vxe-option label="LocalDateTime" value="LocalDateTime" />
  28. <vxe-option label="Boolean" value="Boolean" />
  29. </vxe-select>
  30. </template>
  31. </vxe-column>
  32. <vxe-column title="java属性" width="8%" field="javaField">
  33. <template #default="{ row }">
  34. <vxe-input v-model="row.javaField" placeholder="请输入java属性" />
  35. </template>
  36. </vxe-column>
  37. </vxe-colgroup>
  38. <vxe-colgroup title="增删改查">
  39. <vxe-column title="插入" width="40px" field="createOperation">
  40. <template #default="{ row }">
  41. <vxe-checkbox true-label="true" false-label="false" v-model="row.createOperation" />
  42. </template>
  43. </vxe-column>
  44. <vxe-column title="编辑" width="40px" field="updateOperation">
  45. <template #default="{ row }">
  46. <vxe-checkbox true-label="true" false-label="false" v-model="row.updateOperation" />
  47. </template>
  48. </vxe-column>
  49. <vxe-column title="列表" width="40px" field="listOperationResult">
  50. <template #default="{ row }">
  51. <vxe-checkbox true-label="true" false-label="false" v-model="row.listOperationResult" />
  52. </template>
  53. </vxe-column>
  54. <vxe-column title="查询" width="40px" field="listOperation">
  55. <template #default="{ row }">
  56. <vxe-checkbox true-label="true" false-label="false" v-model="row.listOperation" />
  57. </template>
  58. </vxe-column>
  59. <vxe-column title="允许空" width="40px" field="nullable">
  60. <template #default="{ row }">
  61. <vxe-checkbox true-label="true" false-label="false" v-model="row.nullable" />
  62. </template>
  63. </vxe-column>
  64. <vxe-column title="查询方式" width="60px" field="listOperationCondition">
  65. <template #default="{ row }">
  66. <vxe-select v-model="row.listOperationCondition" placeholder="请选择查询方式">
  67. <vxe-option label="=" value="=" />
  68. <vxe-option label="!=" value="!=" />
  69. <vxe-option label=">" value=">" />
  70. <vxe-option label=">=" value=">=" />
  71. <vxe-option label="<" value="<>" />
  72. <vxe-option label="<=" value="<=" />
  73. <vxe-option label="LIKE" value="LIKE" />
  74. <vxe-option label="BETWEEN" value="BETWEEN" />
  75. </vxe-select>
  76. </template>
  77. </vxe-column>
  78. </vxe-colgroup>
  79. <vxe-column title="显示类型" width="10%" field="htmlType">
  80. <template #default="{ row }">
  81. <vxe-select v-model="row.htmlType" placeholder="请选择显示类型">
  82. <vxe-option label="文本框" value="input" />
  83. <vxe-option label="文本域" value="textarea" />
  84. <vxe-option label="下拉框" value="select" />
  85. <vxe-option label="单选框" value="radio" />
  86. <vxe-option label="复选框" value="checkbox" />
  87. <vxe-option label="日期控件" value="datetime" />
  88. <vxe-option label="图片上传" value="imageUpload" />
  89. <vxe-option label="文件上传" value="fileUpload" />
  90. <vxe-option label="富文本控件" value="editor" />
  91. </vxe-select>
  92. </template>
  93. </vxe-column>
  94. <vxe-column title="字典类型" width="10%" field="dictType">
  95. <template #default="{ row }">
  96. <vxe-select v-model="row.dictType" clearable filterable placeholder="请选择字典类型">
  97. <vxe-option
  98. v-for="dict in dictOptions"
  99. :key="dict.id"
  100. :label="dict.name"
  101. :value="dict.type"
  102. />
  103. </vxe-select>
  104. </template>
  105. </vxe-column>
  106. <vxe-column title="示例" field="example">
  107. <template #default="{ row }">
  108. <vxe-input v-model="row.example" placeholder="请输入示例" />
  109. </template>
  110. </vxe-column>
  111. </vxe-table>
  112. </template>
  113. <script setup lang="ts">
  114. import { PropType } from 'vue'
  115. import { DictTypeVO } from '@/api/system/dict/types'
  116. import { CodegenColumnVO } from '@/api/infra/codegen/types'
  117. import { listSimpleDictType } from '@/api/system/dict/dict.type'
  118. const props = defineProps({
  119. info: {
  120. type: Array as unknown as PropType<CodegenColumnVO[]>,
  121. default: () => null
  122. }
  123. })
  124. /** 查询字典下拉列表 */
  125. const dictOptions = ref<DictTypeVO[]>()
  126. const getDictOptions = async () => {
  127. const res = await listSimpleDictType()
  128. dictOptions.value = res
  129. }
  130. onMounted(async () => {
  131. await getDictOptions()
  132. })
  133. defineExpose({
  134. info: props.info
  135. })
  136. </script>