当前位置: 首页> 财经> 金融 > 北京业之峰装饰公司官网_省建设厅官网_百度下载安装免费下载_百度手机助手免费下载

北京业之峰装饰公司官网_省建设厅官网_百度下载安装免费下载_百度手机助手免费下载

时间:2025/9/8 1:30:02来源:https://blog.csdn.net/weixin_43652106/article/details/145089001 浏览次数:0次
北京业之峰装饰公司官网_省建设厅官网_百度下载安装免费下载_百度手机助手免费下载

selectpage添加默认选项

//如果发送的来源是 Selectpage,则转发到 Selectpage
if ($this->request->request('keyField')) {$result=$this->selectpage();//获取JSON数据$content=json_decode($result->getContent(),true);//解构["list"=>$list,"total"=>$total]=$content;//添加初始默认值array_unshift($list, ['id'=>0,"classify_name"=>'无']);//total +1 return json(['list'=>$list,'total'=>$total+1]);
}

自定义按钮

{field: 'operate', title: __('Operate'), table: table,buttons: [{name: "classify",text: "会场管理",//按钮名称//classname 按钮类型有 btn-dialog、btn-ajax、btn-addtabs、btn-clickclassname: 'btn btn-xs btn-success btn-addtabs',icon: 'fa fa-sitemap',// url: 'hotel/classify?city_id={id}',url:function(row){return 'hotel/classify?city_code='+row['city_code']+'&city_customized=1';},visible:function(row){console.log(row);return (row.status && row.hot) ? true : false;}}],events: Table.api.events.operate, formatter: Table.api.formatter.operate}

设置dailog弹框大小
表格外dialog弹框大小,设置在Table.api.init上面

  $(".btn-add").data("area",["90%","90%"]);// 初始化表格参数配置Table.api.init({

表格内dialog btn弹框大小,设置在表格绑定事件上面

table.on("post-body.bs.table",function(){$(".btn-editone").data("area",["90%","90%"])
});

隐藏表格列中的删除按钮

{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function(value,row,index){
var that = $.extend({}, this);var table = $(that.table).clone(true);if (row.id <4){$(table).data("operate-del", null);}that.table = table;return Table.api.formatter.operate.call(that, value, row, index);}}

通用搜索 查询关联表中字段

public function hotel(){return $this->belongsTo('Hotel','hotel_id','id')->setEagerlyType(0);
}

根据权限 列formatter显示不同api
使用场景举例说明 超级管理员权限拥有审核权限 而普通管理只需知道审核状态,这里主要使用的是Tabel.api.formatter.status和Table.api.formatter.toggle,简单的使用不同的形态,大家都知道,问题是需要根据条件不同动态显示,废话不多说,看源码

{field: 'status', title: '审核', searchList: {"0":'已审核',"1":"未审核"}, formatter: function(value,row,index){if(row.status==1){return Table.api.formatter.toggle.call(this,value,row,index);}else{return Table.api.formatter.status.call(this,value,row,index);}}}

侧边栏 增加数字提醒
使用场景,新订单总量显示在侧边栏menu上提示

//左侧菜单
//修改admin/controller/Index.php  index
list($menulist, $navlist, $fixedmenu, $referermenu) = $this->auth->getSidebar(['dashboard' => 'hot','addon'     => ['new', 'red', 'badge'],'auth/rule' => __('Menu'),'reservation?status=99'=>(new \app\common\model\Reservation)->where("status",99)->count(),'quotation'=>(new \app\common\model\Quotation)->where("status",7)->count(),'apply'=>(new \app\common\model\Apply)->where("status",1)->count(),], $this->view->site['fixedpage']);
关键字:北京业之峰装饰公司官网_省建设厅官网_百度下载安装免费下载_百度手机助手免费下载

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: