index.html 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table
  4. :columns="columns"
  5. search="nickname,mobile"
  6. toolbar="refresh,add,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. add_url: 'user/index/add',
  28. edit_url: 'user/index/edit',
  29. del_url: 'user/index/del',
  30. multi_url: 'user/index/multi',
  31. download_url: 'user/index/download',
  32. recyclebin_url: 'user/index/recyclebin',
  33. },
  34. columns:[
  35. {checkbox: true},
  36. {field: 'id',title: __('ID'),width:80,sortable: true},
  37. {field: 'username',title: __('用户名'),operate:'='},
  38. {field: 'avatar', title: __('头像'), formatter: Yunqi.formatter.image, operate: false},
  39. {field: 'nickname',title: __('昵称'),operate: 'LIKE',formatter: Yunqi.formatter.tag},
  40. {field: 'sex', title: __('性别'),width:100,searchList: {1: __('男'), 2: __('女')},operate:false,formatter:Yunqi.formatter.select},
  41. {field: 'email',title: __('邮箱'),operate:'LIKE'},
  42. {field: 'mobile',title: __('手机'),operate: '='},
  43. {field: 'role', title: __('角色'),sortable: true,operate:'selects', formatter(value, row, index) {
  44. var role = "";
  45. if(value.indexOf("1") > -1) role =role+"录入员";
  46. if(value.indexOf("2") > -1) role =role+"-库管";
  47. if(value.indexOf("3") > -1) role =role+"-记账";
  48. return role;
  49. }},
  50. {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
  51. {field: 'createtime', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},
  52. {
  53. field: 'operate',
  54. title: __('操作'),
  55. width:180,
  56. fixed:'right',
  57. action:{
  58. edit:true,
  59. del:true
  60. }
  61. }
  62. ]
  63. },
  64. methods: {
  65. // detail:function (row){
  66. // Yunqi.api.open({
  67. // url:'user/index/detail?ids='+row.id,
  68. // width:1000,
  69. // title:__('会员明细'),
  70. // icon:'fa fa-list'
  71. // });
  72. // },
  73. // recharge:function (row){
  74. // Yunqi.api.open({
  75. // url:'user/index/recharge?ids='+row.id,
  76. // title:__('会员充值'),
  77. // icon:'fa fa-plug',
  78. // close:()=>{
  79. // this.$refs.yuntable.reload();
  80. // }
  81. // });
  82. // }
  83. }
  84. }
  85. </script>
  86. <style>
  87. </style>