genInfoForm.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <el-form ref="genInfoForm" :model="info" :rules="rules" label-width="150px">
  3. <el-row>
  4. <el-col :span="12">
  5. <el-form-item prop="tplCategory">
  6. <span slot="label">生成模板</span>
  7. <el-select v-model="info.tplCategory">
  8. <el-option label="单表(增删改查)" value="crud" />
  9. <el-option label="树表(增删改查)" value="tree" disabled/>
  10. </el-select>
  11. </el-form-item>
  12. </el-col>
  13. <el-col :span="12">
  14. <el-form-item prop="packageName">
  15. <span slot="label">
  16. 生成包路径
  17. <el-tooltip content="生成在哪个java包下,例如 com.ruoyi.system" placement="top">
  18. <i class="el-icon-question"></i>
  19. </el-tooltip>
  20. </span>
  21. <el-input v-model="info.packageName" />
  22. </el-form-item>
  23. </el-col>
  24. <el-col :span="12">
  25. <el-form-item prop="moduleName">
  26. <span slot="label">
  27. 生成模块名
  28. <el-tooltip content="可理解为子系统名,例如 system" placement="top">
  29. <i class="el-icon-question"></i>
  30. </el-tooltip>
  31. </span>
  32. <el-input v-model="info.moduleName" />
  33. </el-form-item>
  34. </el-col>
  35. <el-col :span="12">
  36. <el-form-item prop="businessName">
  37. <span slot="label">
  38. 生成业务名
  39. <el-tooltip content="可理解为功能英文名,例如 user" placement="top">
  40. <i class="el-icon-question"></i>
  41. </el-tooltip>
  42. </span>
  43. <el-input v-model="info.businessName" />
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="12">
  47. <el-form-item prop="functionName">
  48. <span slot="label">
  49. 生成功能名
  50. <el-tooltip content="用作类描述,例如 用户" placement="top">
  51. <i class="el-icon-question"></i>
  52. </el-tooltip>
  53. </span>
  54. <el-input v-model="info.functionName" />
  55. </el-form-item>
  56. </el-col>
  57. </el-row>
  58. <el-row v-show="info.tplCategory == 'tree'">
  59. <h4 class="form-header">其他信息</h4>
  60. <el-col :span="12">
  61. <el-form-item>
  62. <span slot="label">
  63. 树编码字段
  64. <el-tooltip content="树显示的编码字段名, 如:dept_id" placement="top">
  65. <i class="el-icon-question"></i>
  66. </el-tooltip>
  67. </span>
  68. <el-select v-model="info.treeCode" placeholder="请选择">
  69. <el-option
  70. v-for="column in info.columns"
  71. :key="column.columnName"
  72. :label="column.columnName + ':' + column.columnComment"
  73. :value="column.columnName"
  74. ></el-option>
  75. </el-select>
  76. </el-form-item>
  77. </el-col>
  78. <el-col :span="12">
  79. <el-form-item>
  80. <span slot="label">
  81. 树父编码字段
  82. <el-tooltip content="树显示的父编码字段名, 如:parent_Id" placement="top">
  83. <i class="el-icon-question"></i>
  84. </el-tooltip>
  85. </span>
  86. <el-select v-model="info.treeParentCode" placeholder="请选择">
  87. <el-option
  88. v-for="column in info.columns"
  89. :key="column.columnName"
  90. :label="column.columnName + ':' + column.columnComment"
  91. :value="column.columnName"
  92. ></el-option>
  93. </el-select>
  94. </el-form-item>
  95. </el-col>
  96. <el-col :span="12">
  97. <el-form-item>
  98. <span slot="label">
  99. 树名称字段
  100. <el-tooltip content="树节点的显示名称字段名, 如:dept_name" placement="top">
  101. <i class="el-icon-question"></i>
  102. </el-tooltip>
  103. </span>
  104. <el-select v-model="info.treeName" placeholder="请选择">
  105. <el-option
  106. v-for="column in info.columns"
  107. :key="column.columnName"
  108. :label="column.columnName + ':' + column.columnComment"
  109. :value="column.columnName"
  110. ></el-option>
  111. </el-select>
  112. </el-form-item>
  113. </el-col>
  114. </el-row>
  115. </el-form>
  116. </template>
  117. <script>
  118. export default {
  119. name: "BasicInfoForm",
  120. props: {
  121. info: {
  122. type: Object,
  123. default: null
  124. }
  125. },
  126. data() {
  127. return {
  128. rules: {
  129. tplCategory: [
  130. { required: true, message: "请选择生成模板", trigger: "blur" }
  131. ],
  132. packageName: [
  133. { required: true, message: "请输入生成包路径", trigger: "blur" }
  134. ],
  135. moduleName: [
  136. { required: true, message: "请输入生成模块名", trigger: "blur" }
  137. ],
  138. businessName: [
  139. { required: true, message: "请输入生成业务名", trigger: "blur" }
  140. ],
  141. functionName: [
  142. { required: true, message: "请输入生成功能名", trigger: "blur" }
  143. ]
  144. }
  145. };
  146. },
  147. created() {}
  148. };
  149. </script>