32dbdb08249d63d22d1a3af8d20d29c788bab54c.svn-base 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <j-editable-table
  3. :columns="columns"
  4. :dataSource="dataSource"
  5. :rowNumber="true"
  6. :rowSelection="true"
  7. :maxHeight="400"
  8. :disabled="true"
  9. />
  10. </template>
  11. <script>
  12. import { FormTypes } from '@/utils/JEditableTableUtil'
  13. import JEditableTable from '@/components/jeecg/JEditableTable'
  14. export default {
  15. name: 'ReadOnlyTable',
  16. components: { JEditableTable },
  17. data() {
  18. return {
  19. columns: [
  20. {
  21. title: '输入框',
  22. key: 'input',
  23. type: FormTypes.input,
  24. placeholder: '清输入'
  25. },
  26. {
  27. title: '下拉框',
  28. key: 'select',
  29. type: FormTypes.select,
  30. options: [
  31. { title: 'String', value: 'string' },
  32. { title: 'Integer', value: 'int' },
  33. { title: 'Double', value: 'double' },
  34. { title: 'Boolean', value: 'boolean' }
  35. ],
  36. placeholder: '请选择'
  37. },
  38. {
  39. title: '多选框',
  40. key: 'checkbox',
  41. type: FormTypes.checkbox,
  42. customValue: [true, false]
  43. },
  44. {
  45. title: '日期',
  46. key: 'datetime',
  47. type: FormTypes.datetime
  48. }
  49. ],
  50. dataSource: [
  51. { input: 'hello', select: 'int', checkbox: true, datetime: '2019-6-17 14:50:48' },
  52. { input: 'world', select: 'string', checkbox: false, datetime: '2019-6-16 14:50:48' },
  53. { input: 'one', select: 'double', checkbox: true, datetime: '2019-6-17 15:50:48' },
  54. { input: 'two', select: 'boolean', checkbox: false, datetime: '2019-6-14 14:50:48' },
  55. { input: 'three', select: '', checkbox: false, datetime: '2019-6-13 14:50:48' }
  56. ]
  57. }
  58. },
  59. mounted() {
  60. }
  61. }
  62. </script>
  63. <style scoped>
  64. </style>