| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <#if table#>
- import table from "@components/Table.js";
- <#endif#>
- export default{
- components:{
- <#if table#>
- 'YunTable':table
- <#endif#>
- },
- data:{
- <#if table#>
- extend:{
- index_url: '<#pack#>/index',
- <#if form#>
- add_url: '<#pack#>/add',
- edit_url: '<#pack#>/edit',
- <#endif#>
- <#if in_array('del',actions)#>
- del_url: '<#pack#>/del',
- <#endif#>
- multi_url: '<#pack#>/multi',
- <#if in_array('download',actions)#>
- download_url: '<#pack#>/download',
- <#endif#>
- <#if in_array('import',actions)#>
- import_url: '<#pack#>/import',
- <#endif#>
- <#if in_array('recyclebin',actions)#>
- recyclebin_url:'<#pack#>/recyclebin'
- <#endif#>
- },
- columns:[
- <#if reduced#>
- {checkbox: true},
- <#endif#>
- <#if !reduced#>
- {checkbox: true,selectable:function (row,index){
- //可以根据业务需求返回false让某些行不可选中
- return true;
- }},
- <#endif#>
- <#fields#>
- <#if isTree#>
- {treeExpand: true},
- <#endif#>
- {
- field: 'operate',
- title: __('操作'),
- width:130,
- action:{
- <#if in_array('edit',actions)#>
- <#if reduced#>
- edit:true,
- <#endif#>
- <#if !reduced#>
- edit:function(row){
- //可以根据业务需求返回false让按钮不显示
- return true
- },
- <#endif#>
- <#endif#>
- <#if in_array('del',actions)#>
- del:true,
- <#endif#>
- <#if sort#>
- sort:true,
- <#endif#>
- <#if expand#>
- expand:true,
- <#endif#>
- }
- }
- ]
- <#endif#>
- },
- <#if !reduced#>
- //页面加载完成时执行
- onLoad:function(query){
- console.log(query);
- },
- //页面初始显示或在框架内显示时执行
- onShow:function(){
- },
- //页面在框架内隐藏时执行
- onHide:function(){
- },
- //页面在框架内关闭时执行
- onUnload:function(){
- },
- <#endif#>
- methods: {
- <#if !reduced && table#>
- 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);//树形表格展开指定节点
- */
- }
- <#endif#>
- }
- }
|