| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <el-card shadow="never">
- <yun-table :columns="columns" ref="yuntable" @render="onTableRender"
- toolbar="refresh,edit,del,multi,download,recyclebin" :auth="auth" :extend="extend">
- </yun-table>
- </el-card>
- </template>
- <script>
- import table from "@components/Table.js";
- export default {
- components: {
- 'YunTable': table
- },
- data: {
- extend: {
- index_url: 'user/group_user/index',
- edit_url: 'user/group_user/edit',
- del_url: 'user/group_user/del',
- multi_url: 'user/group_user/multi',
- download_url: 'user/group_user/download',
- recyclebin_url: 'user/group_user/recyclebin'
- },
- auth:{
- edit:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','edit'),
- del:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','del'),
- multi:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','multi'),
- download:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','download'),
- recyclebin:Yunqi.auth.check('app\\admin\\controller\\user\\GroupUser','recyclebin'),
- },
- columns: [
- {
- checkbox: true, selectable: function (row, index) {
- //可以根据业务需求返回false让某些行不可选中
- return true;
- }
- },
- { field: "id", title: "ID", operate: false },
- { field: "nickname", title: "姓名" },
- { field: 'avatar', title: __('头像'), formatter: Yunqi.formatter.image, operate: false },
- // { field: "email", title: "电子邮箱" },
- { field: "mobile", title: "手机号" },
- { field: "id_card", title: "身份证号" },
- { field: 'sex', title: __('性别'), width: 100, searchList: { 1: __('男'), 2: __('女') }, operate: false },
- // { field: "jointime", title: "加入时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
- // {field: 'status', title: __('状态'),searchList: {'normal': __('正常'),'hidden': __('隐藏')},formatter:Yunqi.formatter.switch,operate:'select'},
- { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime },
- {
- field: 'operate',
- title: __('操作'),
- width:150,
- action:{edit:true, del:true}
- }
-
- ]
- },
- //页面加载完成时执行
- onLoad: function (query) {
- this.getList(query.pid)
-
- },
- //页面初始显示或在框架内显示时执行
- onShow: function () {
- },
- //页面在框架内隐藏时执行
- onHide: function () {
- },
- //页面在框架内关闭时执行
- onUnload: function () {
- },
- methods: {
- getList(pid) {
- let that = this;
- this.extend.index_url = 'user/group_user/group_list?pid=' + pid
- Yunqi.ajax.get(this.extend.index_url, {}).then(res => {
-
- this.$refs.yuntable.reload();
- })
- },
- onTableRender: function (list) {
- //表格渲染完成后执行
- /**
- * table常用方法
- * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
- * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
- * this.$refs.yuntable.submit();//返回第一页,重新获取数据
- * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
- * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
- */
- }
- }
- }
- </script>
- <style>
- </style>
|