group_list.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <el-card shadow="never">
  3. <yun-table :columns="columns" ref="yuntable" @render="onTableRender"
  4. toolbar="refresh,edit,del,multi,download,recyclebin" :auth="auth" :extend="extend">
  5. </yun-table>
  6. </el-card>
  7. </template>
  8. <script>
  9. import table from "@components/Table.js";
  10. export default {
  11. components: {
  12. 'YunTable': table
  13. },
  14. data: {
  15. extend: {
  16. index_url: 'user/group_user/index',
  17. edit_url: 'user/group_user/edit',
  18. del_url: 'user/group_user/del',
  19. multi_url: 'user/group_user/multi',
  20. download_url: 'user/group_user/download',
  21. recyclebin_url: 'user/group_user/recyclebin'
  22. },
  23. auth:{
  24. edit:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','edit'),
  25. del:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','del'),
  26. multi:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','multi'),
  27. download:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','download'),
  28. recyclebin:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','recyclebin'),
  29. },
  30. columns: [
  31. {
  32. checkbox: true, selectable: function (row, index) {
  33. //可以根据业务需求返回false让某些行不可选中
  34. return true;
  35. }
  36. },
  37. { field: "id", title: "ID", operate: false },
  38. { field: "nickname", title: "姓名" },
  39. { field: 'avatar', title: __('头像'), formatter: Yunqi.formatter.image, operate: false },
  40. // { field: "email", title: "电子邮箱" },
  41. { field: "mobile", title: "手机号" },
  42. { field: "id_card", title: "身份证号" },
  43. { field: 'sex', title: __('性别'), width: 100, searchList: { 1: __('男'), 2: __('女') }, operate: false },
  44. // { field: "jointime", title: "加入时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  45. // {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
  46. { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
  47. {
  48. field: 'operate',
  49. title: __('操作'),
  50. width:150,
  51. action:{edit:true, del:true}
  52. }
  53. ]
  54. },
  55. //页面加载完成时执行
  56. onLoad: function (query) {
  57. this.getList(query.pid)
  58. },
  59. //页面初始显示或在框架内显示时执行
  60. onShow: function () {
  61. },
  62. //页面在框架内隐藏时执行
  63. onHide: function () {
  64. },
  65. //页面在框架内关闭时执行
  66. onUnload: function () {
  67. },
  68. methods: {
  69. getList(pid) {
  70. let that = this;
  71. this.extend.index_url = 'user/group_user/group_list?pid=' + pid
  72. Yunqi.ajax.get(this.extend.index_url, {}).then(res => {
  73. this.$refs.yuntable.reload();
  74. })
  75. },
  76. onTableRender: function (list) {
  77. //表格渲染完成后执行
  78. /**
  79. * table常用方法
  80. * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
  81. * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
  82. * this.$refs.yuntable.submit();//返回第一页,重新获取数据
  83. * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
  84. * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
  85. */
  86. }
  87. }
  88. }
  89. </script>
  90. <style>
  91. </style>