moduleView.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <moduleView :propConfig="config" @clickHandle="clickHandle" />
  3. </template>
  4. <script lang="ts">
  5. import { Component, Prop, Vue, Watch } from "vue-property-decorator";
  6. @Component
  7. export default class ModuleViewDemo extends Vue {
  8. config:any={
  9. search:{
  10. attr:{
  11. size:'mini',
  12. rules:{
  13. name:[{
  14. required: true, message: '请输入名称', trigger: 'blur'
  15. }]
  16. }
  17. },
  18. columns:[
  19. [{
  20. span:6,
  21. label:'创建时间',
  22. prop:'created',
  23. // rules:[
  24. // { required: true, message: '请选择时间', trigger: 'change' }
  25. // ],
  26. component:'by-date-picker',
  27. compConfig:{
  28. format:'yyyy-MM-dd',
  29. type:'datetime'
  30. }
  31. }]
  32. ]
  33. },
  34. tool:{
  35. tools:{
  36. add:true,
  37. edit:true,
  38. delete:true,
  39. export:true,
  40. search:true,
  41. refresh:true
  42. },
  43. audit:{
  44. add:'audit:collaborationLog:add',
  45. edit:'audit:collaborationLog:edit',
  46. delete:'audit:collaborationLog:remove',
  47. export:'audit:collaborationLog:export'
  48. }
  49. },
  50. table:{
  51. attr:{
  52. size:'mini',
  53. seq:true,
  54. align:'center',
  55. checkbox:true
  56. },
  57. columns:[{
  58. title:'创建时间',
  59. field:'created',
  60. width:150
  61. },
  62. {
  63. title:'订单号',
  64. field:'order_no',
  65. width:100
  66. },
  67. {
  68. title:'订单类型',
  69. field:'order_type'
  70. },
  71. {
  72. title:'操作',
  73. action:true,
  74. plugins:[{
  75. icon:'el-icon-edit',
  76. name:'编辑',
  77. audit:'',
  78. event:{
  79. click:(item:any) => {
  80. console.log('该行数据:',item)
  81. }
  82. }
  83. },{
  84. name:'查看',
  85. event:{
  86. click:(item:any) => {
  87. console.log('该行数据:',item);
  88. this.fun();
  89. console.log('this:',this)
  90. }
  91. }
  92. }]
  93. }]
  94. },
  95. request:{
  96. url:'/system/audit/collaborationLog'
  97. }
  98. }
  99. fun(){
  100. console.log(this)
  101. }
  102. clickHandle(e:string){
  103. console.log(e+'操作')
  104. }
  105. }
  106. </script>
  107. <style lang="scss" scoped>
  108. </style>