index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. export const defaultProps = {
  2. children: 'children',
  3. label: 'label'
  4. }
  5. export const columns = (_this) => [
  6. {
  7. prop: 'aircaftCatalogCode',
  8. label: '飞机编号',
  9. width: '150px'
  10. },
  11. {
  12. prop: 'mechanician',
  13. label: '机械师'
  14. },
  15. {
  16. prop: 'aircaftModelName',
  17. label: '所属机型'
  18. },
  19. {
  20. prop: 'army',
  21. label: '所属部队'
  22. },
  23. {
  24. prop: 'warZone',
  25. label: '所属战区'
  26. },
  27. {
  28. prop: 'station',
  29. label: '驻地'
  30. },
  31. {
  32. prop: 'assemblyTime',
  33. label: '装列时间'
  34. },
  35. {
  36. prop: 'manufacturer',
  37. label: '厂家',
  38. width: '240px'
  39. },
  40. {
  41. prop: 'factoryNumber',
  42. label: '出厂编号',
  43. width: '150px'
  44. },
  45. {
  46. prop: 'status',
  47. label: '状态',
  48. render: (h, params) => {
  49. if (params.row.status == 0) {
  50. return h('span', { class: 'success-state' }, '服役')
  51. } else {
  52. return h('span', { class: 'warning-state' }, '退役')
  53. }
  54. }
  55. },
  56. {
  57. button: true,
  58. label: '操作',
  59. width: '200px',
  60. group: [
  61. {
  62. name: '编辑',
  63. type: 'text',
  64. round: false,
  65. plain: false,
  66. onClick: (row, index, scope) => {
  67. _this.handUpdate(row)
  68. }
  69. },
  70. {
  71. name: '删除',
  72. type: 'text',
  73. round: false,
  74. plain: false,
  75. onClick: (row, index, scope) => {
  76. _this.remove([row])
  77. }
  78. }
  79. ]
  80. }
  81. ]
  82. export const options = {
  83. stripe: true, // 斑马纹
  84. mutiSelect: true, // 多选框
  85. index: false, // 显示序号, 多选则 mutiSelect
  86. loading: false, // 表格动画
  87. initTable: true, // 是否一挂载就加载数据
  88. border: true,
  89. height: 'calc(100vh - 300px)'
  90. }