group_list.html 3.3 KB

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