fun.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export default function() {
  2. return {
  3. props: {
  4. tableLoading: {
  5. type: Boolean,
  6. default: false,
  7. },
  8. beforeOpen: Function,
  9. beforeClose: Function,
  10. uploadBefore: Function,
  11. uploadAfter: Function,
  12. rowClassName: Function,
  13. spanMethod: Function,
  14. summaryMethod: Function,
  15. data: {
  16. type: Array,
  17. default: () => []
  18. },
  19. },
  20. methods: {
  21. refreshChange(params) {
  22. this.$emit('refresh-change', params);
  23. },
  24. searchReset() {
  25. this.$emit('search-reset');
  26. },
  27. sizeChange(val) {
  28. this.$emit('size-change', val);
  29. },
  30. dateChange(val) {
  31. this.$emit('date-change', val);
  32. },
  33. currentChange(val) {
  34. this.$emit('current-change', val);
  35. },
  36. currentRowChange(currentRow, oldCurrentRow) {
  37. this.$emit('current-row-change', currentRow, oldCurrentRow);
  38. },
  39. selectionChange(val) {
  40. this.$emit('selection-change', val);
  41. },
  42. sortChange(val) {
  43. this.$emit('sort-change', val);
  44. },
  45. searchChange(val) {
  46. this.$emit('search-change', val);
  47. },
  48. rowDblclick(row, event) {
  49. this.$emit('row-dblclick', row, event);
  50. },
  51. rowClick(row, event, column) {
  52. this.$emit('row-click', row, event, column);
  53. },
  54. rowDel(row, index) {
  55. this.$emit('row-del', row, index);
  56. },
  57. rowSave(row, done, loading) {
  58. this.$emit('row-save', row, done, loading);
  59. },
  60. rowUpdate(row, index, done, loading) {
  61. this.$emit('row-update', row, index, done, loading);
  62. },
  63. rowAdd() {
  64. this.$refs.crud.rowAdd();
  65. },
  66. rowEdit(row, index) {
  67. this.$refs.crud.rowEdit(row, index);
  68. }
  69. }
  70. }
  71. }