function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,t){var a="agDropdownCellEditor",i="ag.dropdown.celleditor",o={maxHeight:200},n=27,r=9,l=37,s=38,d=39,c=40,u=13,p=16,f=function(t,i){this.grid=i.grid,this.config=i.config,this.items=i.data.items,this.selected=i.data.selected,this.hook=i.hook,this.arrow=i.arrow||"icon-search",this.name=i.name,this.onSelect=i.select||function(){},this.$input=e(t),this.settings=e.extend({},o,i),this.init(),e.fn[a].instances.push(this)};e.extend(f.prototype,{init:function(){this._construct(),this._events()},_construct:function(){this.$container=e('
'),this.$arrow=e('
'),this.$dropdown=e('
')},i.prototype.getGui=function(){return this.eGui},o.prototype.init=function(e){this.eGui=document.createElement("span"),this.eGui.innerHTML=e.value||""},o.prototype.getGui=function(){return this.eGui},n.prototype.init=function(e){var t=e.api.gridCore.gridOptions;if(!e.node.rowPinned&&null!=e.data){var a=e.data,i="";a.master_id>0&&e.colDef.options.forEach((function(e){if(e.display){var o=''+e.name+"";i+=t.actionCellBeforeRender(o,e,a)||""}})),this.eGui=document.createElement("span"),this.eGui.innerHTML=i}},n.prototype.getGui=function(){return this.eGui},r.prototype.init=function(e){this.grid=e,this.selectedKey=null,this.items=e.colDef.cellEditorParams.values,this.eInput=document.createElement("input"),this.eInput.value=e.value||"",this.eInput.className="ag-cell-edit-input form-control"},r.prototype.getGui=function(e){return this.eInput},r.prototype.afterGuiAttached=function(){var e=this,a=e.grid,i=e.eInput.value;t(e.eInput).agDropdownCellEditor({grid:e,arrow:"fa-caret-down",data:{items:e.items,selected:a.data[a.select_key]},select:function(t){t?(a.data[a.select_key]=t.id,e.eInput.value=t.name,e.selectedKey=t.id):e.eInput.value=i,a.stopEditing()}}),e.eInput.focus(),e.eInput.select()},r.prototype.getValue=function(){return this.eInput.value},r.prototype.destroy=function(){t("body").find(".combo-select").remove()},l.prototype.init=function(e){var t=e.value,a=e.colDef.cellEditorParams.values;this.eGui=document.createElement("div"),this.eGui.innerHTML=a[t]||a[0]},l.prototype.getGui=function(){return this.eGui},s.prototype.init=function(e){var t=e.value;this.eInput=document.createElement("input"),this.eInput.type="checkbox",this.eInput.checked=t,this.eInput.value=t},s.prototype.getGui=function(e){return this.eInput},s.prototype.afterGuiAttached=function(){this.eInput.focus(),this.eInput.select()},s.prototype.getValue=function(){return this.eInput.checked?1:0},s.prototype.destroy=function(){},d.prototype.init=function(e){this.params=e,this.eInput=document.createElement("div"),this.eInput.tabIndex="-1";var a=e.colDef.field+"_"+e.data.id,i=e.query;i.multi=1,i.is_grid=1,i.url=e.url,i.grid_id=e.data.id,i.title=e.title;var o="";t.each(i,(function(e,t){o+=" data-"+e+'="'+t+'"'})),this.query=i,this.eInput.innerHTML='',this.eInput.className="ag-input-wrapper ag-input-dialog-wrapper"},d.prototype.getGui=function(e){return this.eInput},d.prototype.afterGuiAttached=function(){var e=this;t(e.eInput).find("input").gdooSuggest({item:e.params.data,query:e.query}).on("onSelect",(function(t,a){e.params.data[e.query.name]=a[e.query.name],e.eInput.querySelector("input").value=a[e.query.name]})),e.eInput.querySelector("input").select()},d.prototype.getValue=function(){return this.params.data[this.params.query.name]},d.prototype.destroy=function(){t(this.eInput).find("input").off()},d.prototype.isPopup=function(){return!1},c.prototype.init=function(e){this.params=e.colDef.cellEditorParams,this.eInput=document.createElement("div"),this.eInput.innerHTML='',this.eInput.className="ag-input-wrapper ag-input-date-wrapper"},c.prototype.getGui=function(e){return this.eInput},c.prototype.afterGuiAttached=function(){this.eInput.querySelector("input").click()},c.prototype.getValue=function(){return this.eInput.querySelector("input").value},c.prototype.destroy=function(){},e.agGridOptions=function(){var e={defaultColDef:{minWidth:100,enableRowGroup:!0,enablePivot:!0,enableValue:!0,sortable:!0,resizable:!0,filter:!0,comparator:function(e,t){return"htmlCellRenderer"==this.cellRenderer?(e=delHtmlTag(e),t=delHtmlTag(t),e.localeCompare(t)):"string"==typeof e?e.localeCompare(t):e>t?1:e数据加载中...',overlayNoRowsTemplate:'
暂无数据
暂无数据
',generatePinnedBottomData:function(){var t=this,a={},i=!1;e.columnApi.getAllGridColumns().forEach((function(e){e.colDef.calcFooter&&(i=!0,a[e.colId]=t.calculatePinnedBottomData(e))})),i&&t.api.setPinnedBottomRowData([a])},calculatePinnedBottomData:function(t){var a=0;return e.api.forEachNode((function(e){a+=toNumber(e.data[t.colId])})),0==a?"":a},actionCellBeforeRender:function(e,t,a){return e},remoteData:function(a,i){var o=this,n=e.remoteParams;for(var r in a)n[r]=a[r];e.api.showLoadingOverlay(),t.post(e.remoteDataUrl,n,(function(a){if(e.remoteBeforeSuccess.call(e,a),"function"==typeof i&&i(a),a.per_page)if(null===o.pagerDom){var n=o.api.gridCore.eGridDiv,r=n.id+"-pager";t(n).after('
'),o.pagerDom=t("#"+r).Paging({pagesize:a.per_page,count:a.total,current:a.current_page,pageSizeList:[50,100,500,1e3,2e3,5e3,1e4,2e4,5e4],callback:function(e,t,a){o.remoteData2({page:e,limit:t})}})}else o.pagerDom[0].render({pagesize:a.per_page,count:a.total,current:a.current_page});e.api.hideOverlay(),e.api.setRowData(a.data),e.generatePinnedBottomData(),e.remoteAfterSuccess.call(e,a)}),"json")},remoteData2:function(a,i){var o=e.remoteParams;for(var n in a)o[n]=a[n];e.api.showLoadingOverlay(),t.post(e.remoteDataUrl,o,(function(t){e.remoteBeforeSuccess.call(e,t),"function"==typeof i&&i(t),e.api.hideOverlay(),e.api.setRowData(t.data),e.generatePinnedBottomData(),e.remoteAfterSuccess.call(e,t)}),"json")}};return e}}(window,jQuery),function(e){var t=function(e){var t=this;t.args=e,t.trigger=function(e){if("function"==typeof t.args[e]){for(var a=[],i=1;i0&&i.action.rowDoubleClick&&i.action.rowDoubleClick(e.data)},this.div=function(t){var a=document.querySelector("#"+this.table+"-grid");return a.style.height=this.getPanelHeight(t),new agGrid.Grid(a,this.grid),e(a).on("click",'[data-toggle="event"]',(function(){var t=e(this).data();t.master_id>0&&i.action[t.action](t)})),a},this.getPanelHeight=function(t){return"calc(100vh - "+(e(".gdoo-list-grid").position().top+t+"px")+")"},this.init=function(a){var i=this;if(0==i.header.init){var o=a.header;i.header.init=!0,i.header.create_btn=o.create_btn,i.header.trash_btn=o.trash_btn,i.header.name=o.name,i.header.table=t;var n=o.search_form;if(n.simple_search=o.simple_search_form,i.header.search_form=n,i.search.forms=n.forms,i.action.table=t,i.action.name=o.master_name,i.action.bill_url=o.bill_uri,o.access&&(i.header.access=o.access),o.right_buttons&&(i.header.right_buttons=o.right_buttons),o.left_buttons&&(i.header.left_buttons=o.left_buttons),o.buttons&&(i.header.center_buttons=o.buttons),o.bys)if(i.header.bys=o.bys,n.params.by){i.header.bys.active=n.params.by;for(var r=0;r