index.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table
  4. :columns="columns"
  5. search="nickname,mobile"
  6. toolbar="refresh,edit,del,recyclebin,more"
  7. ref="yuntable"
  8. :auth="auth"
  9. :extend="extend">
  10. </yun-table>
  11. </el-card>
  12. </template>
  13. <script>
  14. import table from "@components/Table.js";
  15. export default{
  16. components:{'YunTable':table},
  17. data:{
  18. auth:{
  19. add:Yunqi.auth.check('app\\admin\\controller\\user\\Index','add'),
  20. edit:Yunqi.auth.check('app\\admin\\controller\\user\\Index','edit'),
  21. del:Yunqi.auth.check('app\\admin\\controller\\user\\Index','del'),
  22. multi:Yunqi.auth.check('app\\admin\\controller\\user\\Index','multi'),
  23. recyclebin:Yunqi.auth.check('app\\admin\\controller\\user\\Index','recyclebin'),
  24. },
  25. extend:{
  26. index_url: 'user/index/index',
  27. edit_url: 'user/index/edit',
  28. del_url: 'user/index/del',
  29. multi_url: 'user/index/multi',
  30. download_url: 'user/index/download',
  31. recyclebin_url: 'user/index/recyclebin',
  32. },
  33. columns:[
  34. {checkbox: true},
  35. {field: 'id',title: __('ID'),width:80,sortable: true},
  36. {field: 'username',title: __('用户名'),operate:'='},
  37. {field: 'avatar', title: __('头像'), formatter: Yunqi.formatter.image, operate: false},
  38. {field: 'nickname',title: __('昵称'),operate: 'LIKE',formatter: Yunqi.formatter.tag},
  39. {field: 'sex', title: __('性别'),width:100,searchList: {1: __('男'), 2: __('女')},operate:'select',formatter:Yunqi.formatter.select},
  40. {field: 'email',title: __('邮箱'),operate:'LIKE'},
  41. {field: 'mobile',title: __('手机'),operate: '='},
  42. {field: 'level', title: __('等级'),sortable: true,operate:'selects',searchList:{0:'普通',1:'1级',2:'2级',3:'3级',4:'4级'}},
  43. {field: 'score', title: __('积分'),sortable: true,operate:'between'},
  44. {field: 'balance', title: __('余额'),sortable: true,operate:'between'},
  45. {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
  46. {field: 'createtime', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},
  47. {
  48. field: 'operate',
  49. title: __('操作'),
  50. width:180,
  51. fixed:'right',
  52. action:{
  53. recharge:{
  54. tooltip:true,
  55. icon:'fa fa-plug',
  56. type:'warning',
  57. text:__('会员充值'),
  58. method:'recharge'
  59. },
  60. detail:{
  61. tooltip:true,
  62. icon:'fa fa-list',
  63. type:'info',
  64. text:__('会员明细'),
  65. method:'detail'
  66. },
  67. edit:true,
  68. del:true
  69. }
  70. }
  71. ]
  72. },
  73. methods: {
  74. detail:function (row){
  75. Yunqi.api.open({
  76. url:'user/index/detail?ids='+row.id,
  77. width:1000,
  78. title:__('会员明细'),
  79. icon:'fa fa-list'
  80. });
  81. },
  82. recharge:function (row){
  83. Yunqi.api.open({
  84. url:'user/index/recharge?ids='+row.id,
  85. title:__('会员充值'),
  86. icon:'fa fa-plug',
  87. close:()=>{
  88. this.$refs.yuntable.reload();
  89. }
  90. });
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. </style>