汪总电商平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
3.1 KiB

"use strict";define(["jquery","bootstrap","backend","table","form"],function(e,t,a,i,n){var l={index:function(){i.api.init({extend:{index_url:"wanlshop/icon/index"+location.search,add_url:"wanlshop/icon/add",edit_url:"wanlshop/icon/edit",del_url:"wanlshop/icon/del",multi_url:"wanlshop/icon/multi",table:"wanlshop_icon"}});var t=e("#table");t.bootstrapTable({url:e.fn.bootstrapTable.defaults.extend.index_url,pk:"id",sortName:"weigh",columns:[[{checkbox:!0},{field:"id",title:__("Id")},{field:"class",title:__("Class")},{field:"class",title:__("Icon"),formatter:l.api.formatter.icon},{field:"name",title:__("Name")},{field:"updatetime",title:__("Updatetime"),operate:"RANGE",addclass:"datetimerange",formatter:i.api.formatter.datetime},{field:"status",title:__("Status"),searchList:{normal:__("Normal"),hidden:__("Hidden")},formatter:i.api.formatter.status},{field:"operate",title:__("Operate"),table:t,events:i.api.events.operate,formatter:i.api.formatter.operate}]]}),i.api.bindevent(t)},recyclebin:function(){i.api.init({extend:{dragsort_url:""}});var t=e("#table");t.bootstrapTable({url:"wanlshop/icon/recyclebin"+location.search,pk:"id",sortName:"id",columns:[[{checkbox:!0},{field:"id",title:__("Id")},{field:"name",title:__("Name"),align:"left"},{field:"deletetime",title:__("Deletetime"),operate:"RANGE",addclass:"datetimerange",formatter:i.api.formatter.datetime},{field:"operate",width:"130px",title:__("Operate"),table:t,events:i.api.events.operate,buttons:[{name:"Restore",text:__("Restore"),classname:"btn btn-xs btn-info btn-ajax btn-restoreit",icon:"fa fa-rotate-left",url:"wanlshop/icon/restore",refresh:!0},{name:"Destroy",text:__("Destroy"),classname:"btn btn-xs btn-danger btn-ajax btn-destroyit",icon:"fa fa-times",url:"wanlshop/icon/destroy",refresh:!0}],formatter:i.api.formatter.operate}]]}),i.api.bindevent(t)},select:function(){i.api.init({extend:{index_url:"wanlshop/icon/select"}});var t=[],n=e("#table");n.on("check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table",function(a,i){"check"==a.type||"uncheck"==a.type?i=[i]:t=[],e.each(i,function(e,i){if(a.type.indexOf("uncheck")>-1){var n=t.indexOf(i.class);n>-1&&t.splice(n,1)}else-1==t.indexOf(i.class)&&t.push(i.class)})}),n.bootstrapTable({url:e.fn.bootstrapTable.defaults.extend.index_url,sortName:"id",showToggle:!1,showExport:!1,columns:[[{field:"state",checkbox:!0},{field:"class",title:__("Class")},{field:"class",title:__("Icon"),formatter:l.api.formatter.icon},{field:"name",title:__("Name")},{field:"operate",title:__("Operate"),events:{"click .btn-chooseone":function(e,t,i,n){var l=a.api.query("multiple");l="true"==l,Fast.api.close({name:i.class,multiple:l})}},formatter:function(){return'<a href="javascript:;" class="btn btn-danger btn-chooseone btn-xs"><i class="fa fa-check"></i> '+__("Choose")+"</a>"}}]]}),e(document).on("click",".btn-choose-multi",function(){var e=a.api.query("multiple");e="true"==e,Fast.api.close({name:t.join(","),multiple:e})}),i.api.bindevent(n)},add:function(){l.api.bindevent()},edit:function(){l.api.bindevent()},api:{formatter:{icon:function(e,t,a){return'<span><i class="wlIcon '+e+'"></i></span>'}},bindevent:function(){n.api.bindevent(e("form[role=form]"))}}};return l});