index.html 3.8 KB

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