49e5aca2436c8f3d214d35c22e19049f8be1cf00.svn-base 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <j-editable-table
  3. ref="editableTable"
  4. :loading="loading"
  5. :columns="columns"
  6. :dataSource="dataSource"
  7. :rowNumber="true"
  8. :rowSelection="true"
  9. :maxHeight="319"
  10. :actionButton="true"
  11. />
  12. </template>
  13. <script>
  14. import JEditableTable from '@/components/jeecg/JEditableTable'
  15. import { FormTypes } from '@/utils/JEditableTableUtil'
  16. const commonPageOptions = [
  17. { title: '文本框', value: 'text' },
  18. { title: '日期(yyyy-MM-dd)', value: 'date' },
  19. { title: '日期(yyyy-MM-dd HH:mm:ss)', value: 'datetime' },
  20. { title: '下拉框', value: 'list' },
  21. { title: '下拉多选框', value: 'list_multi' },
  22. { title: '下拉搜索框', value: 'sel_search' },
  23. { title: '分类字典树', value: 'cat_tree' },
  24. { title: 'Popup弹框', value: 'popup' },
  25. { title: '部门选择', value: 'sel_depart' },
  26. { title: '用户选择', value: 'sel_user' },
  27. { title: '省市区组件', value: 'pca' },
  28. { title: '自定义树控件', value: 'sel_tree' }
  29. ]
  30. export default {
  31. name: 'GraphreportQueryConfig',
  32. components: {
  33. JEditableTable
  34. },
  35. data() {
  36. return {
  37. loading: false,
  38. columns: [
  39. {
  40. title: '字段名',
  41. align: 'center',
  42. key: 'field',
  43. width: '120px',
  44. type: FormTypes.input,
  45. defaultValue: '',
  46. placeholder: '',
  47. validateRules: [{ required: true, message: '${title}不能为空' }]
  48. },
  49. {
  50. title: '字段文本',
  51. align: 'center',
  52. key: 'label',
  53. width: '120px',
  54. type: FormTypes.input,
  55. defaultValue: '',
  56. placeholder: '',
  57. validateRules: [{ required: true, message: '${title}不能为空' }]
  58. },
  59. {
  60. title: '控件类型',
  61. align: 'center',
  62. key: 'viewType',
  63. width: '200px',
  64. defaultValue: '',
  65. type: FormTypes.select,
  66. options: commonPageOptions,
  67. validateRules: [{ required: true, message: '${title}不能为空' }]
  68. },
  69. {
  70. title: '查询类型',
  71. key: 'mode',
  72. width: '110px',
  73. type: FormTypes.select,
  74. options: [
  75. { title: '普通查询', value: 'single' },
  76. { title: '范围查询', value: 'group' }
  77. ],
  78. defaultValue: 'single',
  79. placeholder: '请选择${title}',
  80. validateRules: [{ required: true, message: '请选择${title}' }]
  81. },
  82. {
  83. title: '字典Table',
  84. align: 'center',
  85. key: 'dictTable',
  86. width: '200px',
  87. type: FormTypes.input_pop,
  88. defaultValue: '',
  89. placeholder: ''
  90. },
  91. {
  92. title: '字典Code',
  93. align: 'center',
  94. key: 'dictCode',
  95. width: '200px',
  96. type: FormTypes.input,
  97. defaultValue: '',
  98. placeholder: ''
  99. },
  100. {
  101. title: '字典Text',
  102. align: 'center',
  103. key: 'dictText',
  104. width: '200px',
  105. type: FormTypes.input,
  106. defaultValue: '',
  107. placeholder: ''
  108. },
  109. {
  110. title: '默认值',
  111. align: 'center',
  112. key: 'defValue',
  113. width: '200px',
  114. type: FormTypes.input,
  115. defaultValue: '',
  116. placeholder: ''
  117. },
  118. {
  119. title: '是否启用',
  120. align: 'center',
  121. key: 'config',
  122. width: '100px',
  123. type: FormTypes.checkbox,
  124. defaultValue: '1',
  125. customValue: ['1', '0'],
  126. defaultChecked: false
  127. }
  128. ]
  129. }
  130. },
  131. props: {
  132. dataSource: {
  133. type: Array,
  134. default: () => []
  135. }
  136. },
  137. methods: {
  138. getValuesSync() {
  139. return this.$refs.editableTable.getValuesSync({
  140. validate: true
  141. })
  142. }
  143. }
  144. }
  145. </script>