index.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. console.log(value, "====")
  46. if(value.indexOf("1") > -1) role =role+"录入员";
  47. if(value.indexOf("2") > -1) role =role+"-库管";
  48. if(value.indexOf("3") > -1) role =role+"-记账";
  49. return role;
  50. }},
  51. {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
  52. {field: 'createtime', title: __('创建时间'), width:160,formatter: Yunqi.formatter.datetime,operate:false,sortable: true},
  53. {
  54. field: 'operate',
  55. title: __('操作'),
  56. width:180,
  57. fixed:'right',
  58. action:{
  59. edit:true,
  60. del:true
  61. }
  62. }
  63. ]
  64. },
  65. methods: {
  66. // detail:function (row){
  67. // Yunqi.api.open({
  68. // url:'user/index/detail?ids='+row.id,
  69. // width:1000,
  70. // title:__('会员明细'),
  71. // icon:'fa fa-list'
  72. // });
  73. // },
  74. // recharge:function (row){
  75. // Yunqi.api.open({
  76. // url:'user/index/recharge?ids='+row.id,
  77. // title:__('会员充值'),
  78. // icon:'fa fa-plug',
  79. // close:()=>{
  80. // this.$refs.yuntable.reload();
  81. // }
  82. // });
  83. // }
  84. }
  85. }
  86. </script>
  87. <style>
  88. </style>