| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <el-card shadow="never">
- <yun-table :columns="columns" ref="yuntable" @render="onTableRender"
- toolbar="refresh,add,edit,del,more,import,download" :auth="{
- download:{:$auth->check('app\\admin\\controller\\user\\GroupUser','download')},
- }" :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',
- download_url: 'user/group_user/download',
- },
- 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: "状态", operate: "select", searchList: { normal: "正常", hidden: "隐藏" }},
- { field: "createtime", title: "创建时间", operate: "daterange", formatter: Yunqi.formatter.datetime }
-
- ]
- },
- //页面加载完成时执行
- 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>
|