@yibozhang/pro-table 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("lodash-es"),require("rxjs"),require("@angular/cdk/drag-drop"),require("@angular/common"),require("@angular/common/http"),require("@angular/forms"),require("@angular/router"),require("ng-zorro-antd/button"),require("ng-zorro-antd/checkbox"),require("ng-zorro-antd/date-picker"),require("ng-zorro-antd/form"),require("ng-zorro-antd/grid"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/input"),require("ng-zorro-antd/modal"),require("ng-zorro-antd/popover"),require("ng-zorro-antd/select"),require("ng-zorro-antd/space"),require("ng-zorro-antd/table"),require("ng-zorro-antd/typography"),require("ng-zorro-antd/card"),require("sortablejs"),require("ng-zorro-antd/auto-complete"),require("ng-zorro-antd/input-number"),require("ng-zorro-antd/tooltip"),require("rxjs/operators"),require("uuid")):"function"==typeof define&&define.amd?define("@yibozhang/pro-table",["exports","@angular/core","lodash-es","rxjs","@angular/cdk/drag-drop","@angular/common","@angular/common/http","@angular/forms","@angular/router","ng-zorro-antd/button","ng-zorro-antd/checkbox","ng-zorro-antd/date-picker","ng-zorro-antd/form","ng-zorro-antd/grid","ng-zorro-antd/icon","ng-zorro-antd/input","ng-zorro-antd/modal","ng-zorro-antd/popover","ng-zorro-antd/select","ng-zorro-antd/space","ng-zorro-antd/table","ng-zorro-antd/typography","ng-zorro-antd/card","sortablejs","ng-zorro-antd/auto-complete","ng-zorro-antd/input-number","ng-zorro-antd/tooltip","rxjs/operators","uuid"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).yibozhang=e.yibozhang||{},e.yibozhang["pro-table"]={}),e.ng.core,e.lodashEs,e.rxjs,e.ng.cdk.dragDrop,e.ng.common,e.ng.common.http,e.ng.forms,e.ng.router,e.button,e.checkbox,e.datePicker,e.form,e.grid,e.icon,e.input,e.modal,e.popover,e.select,e.space,e.table,e.typography,e.card,e.Sortable,e.autoComplete,e.inputNumber,e.tooltip,e.rxjs.operators,e.uuid)}(this,(function(e,t,n,r,o,i,a,l,s,u,c,d,p,h,f,m,g,v,b,y,C,w,S,x,z,P,R,I,T){"use strict";function F(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _=k(t),O=k(l),A=F(x);function M(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}function E(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}Object.create;function D(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function j(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(N(arguments[t]));return e}Object.create;"function"==typeof SuppressedError&&SuppressedError;var B=function(){return[]},V=function(e){return""+e},q=function(e){return e},L={input:{name:"",placeHolder:"",disabled:!1,label:"",value:""},select:{name:"",options:[],disabled:!1,label:"",value:"",allowClear:!0,placeHolder:""},selectMultiple:{name:"",options:[],disabled:!1,label:"",value:[],allowClear:!0,placeHolder:"请选择"},inputPlate:{name:"",label:"",value:""},checkbox:{name:"",options:[],disabled:!1,label:"",value:[],noStyle:!1},date:{name:"",disabled:!1,label:"",value:"",allowClear:!0,placeHolder:"请选择",showTime:!1,format:"yyyy-MM-dd",mode:"date"},autoComplete:{name:"",disabled:!1,placeHolder:"请输入",label:"",value:"",dataSource:B,backFill:!1,defaultActiveFirstOption:!1,returnFullData:!1},inputNumber:{name:"",disabled:!1,label:"",value:"",placeHolder:"请输入",min:0,max:100,precision:0,formatterPercent:V,parserPercent:q},custom:{name:"",value:null,label:""}},H={width:"",align:"left",fixedLeft:!1,fixedRight:!1,auxiliaryColumn:!1,ellipsis:!1},G=new t.InjectionToken("PRO_TABLE_COLUMN_REMOTE"),W=new t.InjectionToken("PLATE_PREFIX_LOAD_SERVICE"),U=function(){function e(e){this.columnRemote=e,this.showSearchBtn=!0,this.showClearBtn=!0,this.title=null,this.tableName="",this.multiRow=!1,this.columns=[],this.showSearchBar=!0,this.showActionBar=!0,this.confirmBtnText="查询",this.clearBtnText="清空",this.labelWidth="90px",this.labelAlign="right",this.dataSource=[],this.bordered=!0,this.outerBordered=!0,this.showPagination=!0,this.frontPagination=!1,this.scroll=null,this.summaryData=null,this.sortMode="local",this.showColumnSetting=!1,this.multipleSort=!1,this.showCheckbox=!1,this.rowDisabled=function(){return!1},this.autoTriggerRequest=!0,this.onRowClick=new t.EventEmitter,this.onRowDbClick=new t.EventEmitter,this.onValuesChange=new t.EventEmitter,this.onResetFormBeforeReload=new t.EventEmitter,this._savedSearchParams={},this.templateMap=new Map,this.customTemplates=new Map,this._sortMap={},this._sortPriority=[],this._autoCompleteDebounceMap=new Map,this._preCheckDone=!1,this._columns=[],this._searchParams={},this._searchFiledColumns=[],this._pageInfo={pageIndex:1,pageSize:15,total:100,pageSizeOptions:[10,15,20,50,100,500,1e3]},this._loading=!1,this._selectedTableRow=null,this._selectedRows=[],this._selectedRowIds=new Set,this._checkedAll=!1,this._indeterminate=!1,this._serverColumns=[],this._autoCompleteDataSources={}}return e.prototype.fetchRemoteColumns=function(){var e;return M(this,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:if(!(null===(e=this.columnRemote)||void 0===e?void 0:e.getCol)||!this.tableName)return[2,null];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.columnRemote.getCol(this.tableName,this.multiRow)];case 2:return[2,t.sent()];case 3:return t.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.persistRemoteColumns=function(e){var t;return M(this,void 0,void 0,(function(){var n;return E(this,(function(o){switch(o.label){case 0:if(!(null===(t=this.columnRemote)||void 0===t?void 0:t.setCol)||!this.tableName)return[2,null];o.label=1;case 1:return o.trys.push([1,4,,5]),(n=this.columnRemote.setCol(this.tableName,e,this.multiRow))&&r.isObservable(n)?[4,n.toPromise()]:[3,3];case 2:return[2,o.sent()];case 3:return[2,n];case 4:return o.sent(),[2,null];case 5:return[2]}}))}))},e.prototype.ngOnInit=function(){return M(this,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return this._searchParams={},this.formateInnerColumns(this.columns),[4,this.setSearchParams(this.columns)];case 1:return e.sent(),this._searchParams=this.createSearchParamsProxy(this._searchParams),this.autoTriggerRequest&&this.handleQuery(),this.queryDynamicColumns(),[2]}}))}))},e.prototype.ngAfterContentInit=function(){this.autoRegisterTemplates()},e.prototype.preCheckServerColumns=function(){return M(this,void 0,void 0,(function(){var e,t;return E(this,(function(r){switch(r.label){case 0:return[4,this.fetchRemoteColumns()];case 1:return(e=r.sent())?(t=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{field:e.prop,isShow:!e.hideInTable,header:e.title,sortName:e.sortName||null}})),0!==e.code?[3,5]:n.isEqual(e.data.tabColumn,t)?[3,3]:[4,this.persistRemoteColumns(t)]):[2,!1];case 2:return r.sent()&&this.queryDynamicColumns(),[2,!1];case 3:return console.log("一致"),[2,!0];case 4:return[3,6];case 5:return[2,!1];case 6:return[2]}}))}))},e.prototype.queryDynamicColumns=function(){return M(this,void 0,void 0,(function(){var e,t,n,r;return E(this,(function(o){switch(o.label){case 0:return this.tableName&&this.columnRemote?this._preCheckDone?[3,2]:[4,this.preCheckServerColumns()]:[2];case 1:if(e=o.sent(),this._preCheckDone=!0,!e)return[2];o.label=2;case 2:return[4,this.fetchRemoteColumns()];case 3:return(t=o.sent())?0!==t.code?[3,4]:(n=t.data.tabColumn.map((function(e){return{title:e.header,prop:e.field,sortName:e.sortName,hideInTable:!e.isShow}})),this._serverColumns=n,this.updateTableColumns(n),[3,6]):[2];case 4:return 10!==t.code?[3,6]:(r=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{field:e.prop,isShow:!0,header:e.title,sortName:e.sortName||null}})),[4,this.persistRemoteColumns(r)]);case 5:o.sent()&&this.queryDynamicColumns(),o.label=6;case 6:return[2]}}))}))},e.prototype.formateInnerColumns=function(e){this._columns=e.filter((function(e){return!e.hideInTable})).map((function(e){return Object.assign(Object.assign({},H),e)}))},e.prototype.autoRegisterTemplates=function(){var e=this,t=this._columns.filter((function(e){return e.customRender}));t.length>0&&t.forEach((function(t){var n=t.customRender,r=e.findTemplateByName(n);r&&e.customTemplates.set(n,r)}));var n=this.columns.filter((function(e){return e.customLabelRender}));n.length>0&&n.forEach((function(t){var r=t.customLabelRender,o=e.findLabelTemplateByName(r,n);o&&e.customTemplates.set(r,o)}))},e.prototype.findTemplateByName=function(e){return this.getTemplateFromContent(e)},e.prototype.getTemplateFromContent=function(e){var t=this,n=this._columns.filter((function(e){return e.customRender})).findIndex((function(t){return t.customRender===e}));if(n>=0){var r=this.allTemplates.toArray().filter((function(e){return e!==t.actionBarTpl&&e!==t.imgActionBarTpl}));if(n<r.length)return r[n]}return console.warn("未找到模板 "+e),null},e.prototype.findLabelTemplateByName=function(e,t){var n=this,r=t.findIndex((function(t){return t.customLabelRender===e}));if(r>=0){var o=this.allTemplates.toArray().filter((function(e){return e!==n.actionBarTpl&&e!==n.imgActionBarTpl})),i=this._columns.filter((function(e){return e.customRender})).length+r;if(i<o.length)return o[i]}return console.warn("未找到label模板 "+e),null},e.prototype.setSearchFormDefaultProp=function(e){e.forEach((function(e){e.valueType&&(e.fieldProps?e.fieldProps=Object.assign(Object.assign({},L[e.valueType]),e.fieldProps):e.fieldProps=Object.assign({},L[e.valueType]))}))},e.prototype.setSelectRequest=function(e){var t=this;e.map((function(e){return M(t,void 0,void 0,(function(){var t,r,o;return E(this,(function(i){switch(i.label){case 0:if(!e.fieldProps||!n.hasIn(e.fieldProps,"request"))return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,null===(r=(t=e.fieldProps).request)||void 0===r?void 0:r.call(t)];case 2:return o=i.sent(),e.fieldProps.options=o,[3,4];case 3:return i.sent(),e.fieldProps.options=[],[3,4];case 4:return[2]}}))}))}))},e.prototype.setSearchParams=function(e){return M(this,void 0,void 0,(function(){var t=this;return E(this,(function(r){return this._searchFiledColumns=[],e.filter((function(e){var r=!e.hideInSearch&&e.valueType;return r&&t._searchFiledColumns.push(n.cloneDeep(e)),r})).forEach((function(e){var n,r,o,i=(null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop,a=L[e.valueType].value;if("checkbox"===e.valueType){var l=((null===(r=e.fieldProps)||void 0===r?void 0:r.options)||[]).filter((function(e){return e.checked})).map((function(e){return e.value}));t._searchParams[i]=l.length>0?l:a}else t._searchParams[i]=(null===(o=e.fieldProps)||void 0===o?void 0:o.value)||a;"autoComplete"===e.valueType&&(t._autoCompleteDataSources[i]=[])})),this._searchFiledColumns.sort((function(e,t){var r=n.isNil(null==e?void 0:e.order)?Number.MAX_SAFE_INTEGER:e.order,o=n.isNil(null==t?void 0:t.order)?Number.MAX_SAFE_INTEGER:t.order;return r===o?0:r-o})),this.setSearchFormDefaultProp(this._searchFiledColumns),this.setSelectRequest(this._searchFiledColumns),[2]}))}))},e.prototype.updateTableColumns=function(e){var t=n.cloneDeep(this.columns),r=e,o=t.filter((function(e){return!e.auxiliaryColumn})),i=[],a=j(o);r.forEach((function(e){var t=a.findIndex((function(t){return t.prop===e.prop}));if(-1!==t){var n=a[t],r=Object.assign(Object.assign({},n),e);i.push(r),a.splice(t,1)}else i.push(e)})),a.forEach((function(e){var t=Object.assign(Object.assign({},e),{hideInTable:!0});i.push(t)}));var l=[],s=0;t.forEach((function(e){if(e.auxiliaryColumn)l.push(e);else{var t=i[s];if(t){var n=Object.assign(Object.assign({},e),t);l.push(n)}else l.push(e);s++}})),this.formateInnerColumns(l)},e.prototype.createSearchParamsProxy=function(e){var t=this;return new Proxy(e,{set:function(e,n,r){var o=String(n);if(e[o]===r)return e[o]=r,!0;e[o]=r;try{t.onValuesChange.emit({key:o,value:r,params:t.getSearchParams()})}catch(e){}return!0}})},e.prototype.clearEmptySearchParams=function(){return n.cloneDeep(this._searchParams)},e.prototype.buildServerSortPayload=function(){var e=this,t=this._sortPriority.filter((function(t){return!!e._sortMap[t]}));if(0===t.length)return null;var n=t.map((function(t){var n=e._columns.find((function(e){return e.prop===t}));return{field:(null==n?void 0:n.sortName)||t,order:e._sortMap[t]}}));return this.multipleSort?n:N(n,1)[0]},e.prototype.sortDataSourceInPlace=function(){var e=this;if(Array.isArray(this.dataSource)&&0!==this.dataSource.length){var t=this._sortPriority.filter((function(t){return!!e._sortMap[t]}));if(0!==t.length){var n=j(t);this.dataSource.sort((function(t,r){for(var o=n.length-1;o>=0;o--){var i=n[o],a=e._sortMap[i],l=null==t?void 0:t[i],s=null==r?void 0:r[i],u=e.compareValues(l,s);if(0!==u)return"ascend"===a?u:-u}return 0}))}}},e.prototype.compareValues=function(e,t){if(null==e&&null==t)return 0;if(null==e)return-1;if(null==t)return 1;if(e instanceof Date&&t instanceof Date)return e.getTime()-t.getTime();if("boolean"==typeof e&&"boolean"==typeof t)return e===t?0:e?1:-1;if("number"==typeof e&&"number"==typeof t)return e-t;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t);var n=Number(e),r=Number(t);return isNaN(n)||isNaN(r)?String(e).localeCompare(String(t)):n-r},e.prototype.executeAutoCompleteDataSource=function(e,t){var n,r=this,o=(null===(n=t.fieldProps)||void 0===n?void 0:n.name)||t.prop;if(t.fieldProps.dataSource&&"function"==typeof t.fieldProps.dataSource)try{var i=t.fieldProps.dataSource(e);i instanceof Promise?i.then((function(e){r._autoCompleteDataSources[o]=e||[]})).catch((function(e){console.error("AutoComplete dataSource error:",e),r._autoCompleteDataSources[o]=[]})):this._autoCompleteDataSources[o]=i||[]}catch(e){console.error("AutoComplete dataSource error:",e),this._autoCompleteDataSources[o]=[]}},e.prototype.getSearchParams=function(e){var t=(e||{}).useSaved,r=void 0!==t&&t?this._savedSearchParams:this._searchParams,o=n.cloneDeep(r||{});return Object.assign({params:o,pageInfo:{pageIndex:this._pageInfo.pageIndex,pageSize:this._pageInfo.pageSize}},"server"===this.sortMode?{sort:this.buildServerSortPayload()}:{})},e.prototype.reload=function(e){this.handleQuery(e)},e.prototype.setFieldsValue=function(e){var t=this;Object.keys(e).forEach((function(n){t._searchParams[n]=e[n]}))},e.prototype.setFieldValue=function(e,t){this._searchParams[e]=t},e.prototype.clearSelectedRow=function(){this._selectedTableRow=null},e.prototype.setColumns=function(e,t){return M(this,void 0,void 0,(function(){return E(this,(function(r){switch(r.label){case 0:return this.columns=n.cloneDeep(e),this.formateInnerColumns(this.columns),this._searchParams={},[4,this.setSearchParams(this.columns)];case 1:return r.sent(),this._searchParams=this.createSearchParamsProxy(this._searchParams),this.allTemplates&&this.autoRegisterTemplates(),!0===(null==t?void 0:t.reload)&&this.handleQuery(),[2]}}))}))},e.prototype.getSelectedRowData=function(){return this._selectedTableRow},e.prototype.getCheckedRows=function(){return this.showCheckbox?this.dataSource.filter((function(e){return!0===e.checked})):[]},e.prototype.getTemplate=function(e){if(!e)return null;try{var t=this.customTemplates.get(e);if(t)return t;var n=this.templateMap.get(e);return n||null}catch(e){return null}},e.prototype.getToolTipTextValue=function(e,t){var n=e.customRender&&this.getTemplate(e.customRender)?"":e.ellipsis?e.prop:"";return n?t[n]:""},e.prototype.getTableRowChecked=function(e){return this.showCheckbox?this.isRowChecked(e):!!this._selectedTableRow&&JSON.stringify(this._selectedTableRow)===JSON.stringify(e)},e.prototype.isRowDisabled=function(e){return!!this.showCheckbox&&(!!this.rowDisabled&&this.rowDisabled(e))},e.prototype.isRowChecked=function(e){return!!this.showCheckbox&&!0===e.checked},e.prototype.toggleRowChecked=function(e,t,n){var r=this;if(n&&n.stopPropagation(),!this.isRowDisabled(e)){e.checked=t;var o=this.getRowId(e);void 0!==o&&(t?this._selectedRowIds.add(o):this._selectedRowIds.delete(o));var i=this._selectedRows.findIndex((function(t){return r.isSameRow(t,e)}));t?(-1===i&&this._selectedRows.push(e),this._selectedTableRow=e):(i>-1&&this._selectedRows.splice(i,1),this._selectedTableRow&&this.isSameRow(this._selectedTableRow,e)&&(this._selectedTableRow=null)),this.updateCheckAllStatus()}},e.prototype.updateCheckAllStatus=function(){var e=this;if(!this.showCheckbox||!Array.isArray(this.dataSource))return this._checkedAll=!1,void(this._indeterminate=!1);var t=this.dataSource.filter((function(t){return!e.isRowDisabled(t)})),n=t.filter((function(e){return!0===e.checked})).length,r=t.length;this._checkedAll=r>0&&n>0&&n===r,this._indeterminate=n>0&&n<r},e.prototype.toggleCheckAll=function(e,t){var n=this;t&&t.stopPropagation();var r=this.dataSource.filter((function(e){return!n.isRowDisabled(e)}));r.forEach((function(t){t.checked=e;var r=n.getRowId(t);void 0!==r&&(e?n._selectedRowIds.add(r):n._selectedRowIds.delete(r))})),e?(this._selectedRows=j(r),this._selectedTableRow=r.length>0?r[0]:null):(this._selectedRows=[],this._selectedTableRow=null),this.updateCheckAllStatus()},e.prototype.getSelectedRows=function(){return this.getCheckedRows()},e.prototype.handleRowCheckedChange=function(e,t){var n=this;if(!this.isRowDisabled(e)){var r=this.getRowId(e);void 0!==r&&(t?this._selectedRowIds.add(r):this._selectedRowIds.delete(r));var o=this._selectedRows.findIndex((function(t){return n.isSameRow(t,e)}));t?(-1===o&&this._selectedRows.push(e),this._selectedTableRow=e):(o>-1&&this._selectedRows.splice(o,1),this._selectedTableRow&&this.isSameRow(this._selectedTableRow,e)&&(this._selectedTableRow=null)),this.updateCheckAllStatus()}},e.prototype.refreshCheckAllStatus=function(){this.updateCheckAllStatus()},e.prototype.getRowId=function(e){var t,n;return null!==(n=null!==(t=e.id)&&void 0!==t?t:e.key)&&void 0!==n?n:void 0},e.prototype.isSameRow=function(e,t){var n=this.getRowId(e),r=this.getRowId(t);return void 0!==n&&void 0!==r?n===r:JSON.stringify(e)===JSON.stringify(t)},e.prototype.clearSelectedRows=function(){Array.isArray(this.dataSource)&&this.dataSource.forEach((function(e){e.checked=!1})),this._selectedRowIds.clear(),this._selectedRows=[],this._checkedAll=!1,this._indeterminate=!1,this._selectedTableRow=null},e.prototype.handleFieldCheckBoxChange=function(e,t){var n;this.setFieldsValue(((n={})[t]=e.filter((function(e){return e.checked})).map((function(e){return e.value})),n))},e.prototype.handleSearch=function(){this._savedSearchParams=this.clearEmptySearchParams(),this._pageInfo.pageIndex=1,this.handleQuery()},e.prototype.handleResetForm=function(){var e=this;Object.keys(this._searchParams).forEach((function(t){var n=e._searchFiledColumns.find((function(e){var n;return((null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop)===t}));if("checkbox"===(null==n?void 0:n.valueType)){var r=e.columns.find((function(e){var n;return((null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop)===t})),o=null==r?void 0:r.fieldProps,i=((null==o?void 0:o.options)||[]).filter((function(e){return e.checked})).map((function(e){return e.value})),a=i.length>0?i:L[n.valueType].value;e._searchParams[t]=a;var l=Array.isArray(a)?a:[],s=(null==o?void 0:o.options)||[];n.fieldProps.options=s.map((function(e){return Object.assign(Object.assign({},e),{checked:l.includes(e.value)})}))}else e._searchParams[t]=(null==n?void 0:n.fieldProps)&&(null==n?void 0:n.fieldProps.value)||L[n.valueType].value})),this._savedSearchParams={},this._pageInfo.pageIndex=1,this.onResetFormBeforeReload.emit(),this.handleQuery()},e.prototype.handlePageIndexChange=function(e){this._pageInfo.pageIndex=e,this.handleQuery()},e.prototype.handlePageSizeChange=function(e){this._pageInfo.pageSize=e,this._pageInfo.pageIndex=1,this.handleQuery()},e.prototype.handleQuery=function(e){return M(this,void 0,void 0,(function(){var t,n,r,o,i=this;return E(this,(function(a){switch(a.label){case 0:if(e&&Array.isArray(this.dataSource)&&1===this.dataSource.length&&this._pageInfo.pageIndex>1&&(this._pageInfo.pageIndex=this._pageInfo.pageIndex-1),t=e&&this.showCheckbox?j(this.dataSource):[],this._loading=!0,!this.request)return[3,6];a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,this.request(Object.assign({params:this.clearEmptySearchParams(),pageInfo:{pageIndex:this._pageInfo.pageIndex,pageSize:this._pageInfo.pageSize}},"server"===this.sortMode?{sort:this.buildServerSortPayload()}:{}))];case 2:return n=a.sent(),this.showCheckbox?(this.dataSource=(n.data||[]).map((function(e){var t=i.getRowId(e),n=void 0!==e.checked?e.checked:void 0!==t&&i._selectedRowIds.has(t);return Object.assign(Object.assign({},e),{checked:n})})),e&&t.length>0&&(r=new Set(this.dataSource.map((function(e){return i.getRowId(e)}))),t.forEach((function(e){var t=i.getRowId(e);void 0===t||r.has(t)||(i._selectedRowIds.delete(t),void 0!==e.checked&&(e.checked=!1))})))):this.dataSource=n.data||[],this.summaryData=n.summaryData||null,"local"===this.sortMode&&this.sortDataSourceInPlace(),this._pageInfo.total=n.total||0,this.showCheckbox&&this.updateCheckAllStatus(),[3,5];case 3:return o=a.sent(),console.error("查询失败:",o),this.dataSource=[],this._pageInfo.total=0,this.summaryData=null,[3,5];case 4:return this._loading=!1,this._selectedTableRow=null,[7];case 5:return[3,7];case 6:console.warn("未提供 _request 回调函数"),this._loading=!1,a.label=7;case 7:return[2]}}))}))},e.prototype.onSortChange=function(e,t){var n=this;this.multipleSort||Object.keys(this._sortMap).forEach((function(t){t!==e&&(n._sortMap[t]=null)})),this._sortMap[e]=t,this._sortPriority=this._sortPriority.filter((function(t){return t!==e})),t&&this._sortPriority.push(e),"local"===this.sortMode?this.sortDataSourceInPlace():this.handleQuery()},e.prototype.getSortOrder=function(e){return this._sortMap[e]||null},e.prototype.handleTableRowClick=function(e){this._selectedTableRow=e,this.showCheckbox&&!this.isRowDisabled(e)&&(this._selectedRows=[],this.toggleRowChecked(e,!0)),this.onRowClick.emit(this._selectedTableRow)},e.prototype.handleTableRowDbClick=function(e){this._selectedTableRow=e,this.onRowDbClick.emit(this._selectedTableRow)},e.prototype.handleColumnsSettingConfirm=function(){this.queryDynamicColumns()},e.prototype.handleAutoCompleteInput=function(e,t){var r,o=this,i=(null===(r=t.fieldProps)||void 0===r?void 0:r.name)||t.prop;if(!this._autoCompleteDebounceMap.has(i)){var a=n.debounce((function(e){var t=o._searchFiledColumns.find((function(e){var t;return((null===(t=e.fieldProps)||void 0===t?void 0:t.name)||e.prop)===i}));t&&o.executeAutoCompleteDataSource(e,t)}),300);this._autoCompleteDebounceMap.set(i,a)}var l=this._autoCompleteDebounceMap.get(i);l&&l(e)},e.prototype.getAutoCompleteDataSource=function(e){var t,n=(null===(t=e.fieldProps)||void 0===t?void 0:t.name)||e.prop;return this._autoCompleteDataSources[n]||[]},e.prototype.getFieldProps=function(e){return e.fieldProps},e.prototype.getLabelTemplate=function(e){if(!e)return null;try{var t=this.customTemplates.get(e);if(t)return t;var n=this.templateMap.get(e);return n||null}catch(e){return null}},e.prototype.getFormItemClassName=function(e){return"pro-table-"+(this.getFieldProps(e).name||e.prop)+"-form-item"},e}();U.decorators=[{type:t.Component,args:[{selector:"app-pro-table",template:'<app-page-container\r\n [title]="title"\r\n [showHeader]="showSearchBar"\r\n ngClass="pro-table-container"\r\n>\r\n <ng-template #header>\r\n <app-table-search-bar\r\n *ngIf="showSearchBar"\r\n [labelWidth]="labelWidth"\r\n [labelAlign]="labelAlign"\r\n >\r\n <ng-template #leftContent>\r\n <nz-form-item\r\n *ngFor="let column of _searchFiledColumns"\r\n [ngClass]="getFormItemClassName(column)"\r\n >\r\n <nz-form-label *ngIf="!getFieldProps(column).hideLabel" nzNoColon>\r\n \x3c!-- 检查是否有自定义label模板 --\x3e\r\n <ng-container\r\n *ngIf="\r\n column.customLabelRender &&\r\n getLabelTemplate(column.customLabelRender);\r\n else defaultLabel\r\n "\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]="getLabelTemplate(column.customLabelRender)"\r\n [ngTemplateOutletContext]="{\r\n $implicit: column,\r\n column: column,\r\n fieldProps: getFieldProps(column)\r\n }"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #defaultLabel>\r\n {{ getFieldProps(column).label || column.title }}\r\n </ng-template>\r\n </nz-form-label>\r\n <nz-form-control *ngIf="column.valueType === \'input\'">\r\n <input\r\n nz-input\r\n [name]="getFieldProps(column).name || column.prop"\r\n [placeholder]="getFieldProps(column).placeHolder"\r\n [disabled]="getFieldProps(column).disabled"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n />\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'inputPlate\'">\r\n <app-plate-input\r\n [name]="getFieldProps(column).name || column.prop"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n ></app-plate-input>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'select\'">\r\n <nz-select\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [name]="getFieldProps(column).name || column.prop"\r\n [nzOptions]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'selectMultiple\'">\r\n <nz-select\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [name]="getFieldProps(column).name || column.prop"\r\n [nzOptions]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n nzMode="multiple"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'date\'">\r\n <nz-date-picker\r\n [nzShowTime]="getFieldProps(column).showTime"\r\n [nzFormat]="getFieldProps(column).format"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzMode]="getFieldProps(column).mode"\r\n ></nz-date-picker>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'checkbox\'">\r\n <nz-checkbox-group\r\n [class]="\r\n getFieldProps(column).noStyle\r\n ? \'pro-table-checkboxgroup-nostyle\'\r\n : \'\'\r\n "\r\n [(ngModel)]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n (ngModelChange)="\r\n handleFieldCheckBoxChange(\r\n $event,\r\n getFieldProps(column).name || column.prop\r\n )\r\n "\r\n ></nz-checkbox-group>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'autoComplete\'">\r\n <input\r\n nz-input\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column)?.name || column.prop]\r\n "\r\n (input)="handleAutoCompleteInput($event, column)"\r\n [nzAutocomplete]="auto"\r\n [disabled]="getFieldProps(column)?.disabled"\r\n [placeholder]="getFieldProps(column)?.placeHolder"\r\n />\r\n <nz-autocomplete\r\n [nzBackfill]="getFieldProps(column).backFill"\r\n [nzDefaultActiveFirstOption]="\r\n getFieldProps(column).defaultActiveFirstOption\r\n "\r\n [nzWidth]="getFieldProps(column).width"\r\n #auto\r\n >\r\n <nz-auto-option\r\n *ngFor="let option of getAutoCompleteDataSource(column)"\r\n [nzValue]="\r\n getFieldProps(column).returnFullData ? option : option.value\r\n "\r\n [nzLabel]="option.label"\r\n [nzDisabled]="option.disabled"\r\n >\r\n {{ option.label }}\r\n </nz-auto-option>\r\n </nz-autocomplete>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'custom\'">\r\n <app-dynamic-search-field\r\n [component]="getFieldProps(column).component"\r\n [value]="_searchParams[getFieldProps(column).name || column.prop]"\r\n [props]="getFieldProps(column)"\r\n (valueChange)="\r\n setFieldValue(getFieldProps(column).name || column.prop, $event)\r\n "\r\n ></app-dynamic-search-field>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'inputNumber\'">\r\n <nz-input-number\r\n [style.width]="\'100%\'"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n [nzFormatter]="getFieldProps(column).formatterPercent"\r\n [nzParser]="getFieldProps(column).parserPercent"\r\n ></nz-input-number>\r\n </nz-form-control>\r\n </nz-form-item>\r\n </ng-template>\r\n <ng-template #actionTextBtn>\r\n <nz-space [nzSize]="4">\r\n <nz-space-item *ngIf="showSearchBtn">\r\n <button nz-button nzType="primary" (click)="handleSearch()">\r\n {{ confirmBtnText }}\r\n </button>\r\n </nz-space-item>\r\n <nz-space-item *ngIf="showClearBtn">\r\n <button nz-button (click)="handleResetForm()">\r\n {{ clearBtnText }}\r\n </button>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n <ng-template #actionImgBtn>\r\n <nz-space>\r\n <ng-container *ngTemplateOutlet="imgActionBarTpl"></ng-container>\r\n <nz-space-item class="setting-space-item" *ngIf="showColumnSetting">\r\n <app-colmuns-setting\r\n [columns]="columns"\r\n [selectedColumns]="_serverColumns"\r\n [tableName]="tableName"\r\n (afterConfirm)="handleColumnsSettingConfirm()"\r\n ></app-colmuns-setting>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n </app-table-search-bar>\r\n </ng-template>\r\n\r\n <ng-template #body>\r\n <div class="mb-12">\r\n <ng-container *ngIf="showActionBar">\r\n <ng-container *ngTemplateOutlet="actionBarTpl"></ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf="customTableRender">\r\n <ng-container *ngTemplateOutlet="customTableRender"></ng-container>\r\n </ng-container>\r\n <nz-table\r\n *ngIf="!customTableRender"\r\n #dynamicTable\r\n nzSize="small"\r\n nzShowSizeChanger\r\n [nzBordered]="bordered"\r\n [nzOuterBordered]="outerBordered"\r\n [nzData]="dataSource"\r\n [nzPageIndex]="_pageInfo.pageIndex"\r\n [nzPageSize]="_pageInfo.pageSize"\r\n [nzTotal]="_pageInfo.total"\r\n [nzPageSizeOptions]="_pageInfo.pageSizeOptions"\r\n [nzShowPagination]="showPagination"\r\n [nzShowTotal]="totalTemplate"\r\n [nzLoading]="_loading"\r\n [nzFrontPagination]="frontPagination"\r\n [nzScroll]="scroll"\r\n (nzPageIndexChange)="handlePageIndexChange($event)"\r\n (nzPageSizeChange)="handlePageSizeChange($event)"\r\n >\r\n <thead>\r\n <tr>\r\n \x3c!-- 复选框列(当 showCheckbox=true 时显示) --\x3e\r\n <th\r\n *ngIf="showCheckbox"\r\n [nzWidth]="\'50px\'"\r\n [nzAlign]="\'center\'"\r\n style="text-align: center"\r\n [(nzChecked)]="_checkedAll"\r\n [nzIndeterminate]="_indeterminate"\r\n (nzCheckedChange)="toggleCheckAll($event)"\r\n (click)="$event.stopPropagation()"\r\n ></th>\r\n <th\r\n *ngFor="let column of _columns"\r\n [nzWidth]="column.width"\r\n [nzAlign]="column.align"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n [nzShowSort]="!!column.sorter"\r\n [nzSortOrder]="getSortOrder(column.prop)"\r\n (nzSortOrderChange)="onSortChange(column.prop, $event)"\r\n >\r\n {{ column.title }}\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr\r\n style="cursor: pointer"\r\n *ngFor="let data; let i = index; of: dynamicTable.data"\r\n [ngClass]="{\r\n \'ant-table-custom-row-selected\': !!getTableRowChecked(data),\r\n \'ant-table-custom-row-even\': i % 2 === 0,\r\n \'ant-table-custom-row-odd\': i % 2 !== 0\r\n }"\r\n (click)="handleTableRowClick(data)"\r\n (dblclick)="handleTableRowDbClick(data)"\r\n >\r\n \x3c!-- 复选框列(当 showCheckbox=true 时显示) --\x3e\r\n <td\r\n *ngIf="showCheckbox"\r\n [nzAlign]="\'center\'"\r\n style="text-align: center; width: 50px"\r\n [(nzChecked)]="data.checked"\r\n [nzDisabled]="isRowDisabled(data)"\r\n (nzCheckedChange)="handleRowCheckedChange(data, $event)"\r\n (click)="$event.stopPropagation()"\r\n ></td>\r\n <td\r\n *ngFor="let column of _columns"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n [nzAlign]="column.align"\r\n [ngClass]="{\r\n \'pro-ellipsis\': column.ellipsis,\r\n \'pro-nowrap\': true\r\n }"\r\n [title]="column.ellipsis ? data[column.prop] : null"\r\n >\r\n \x3c!-- 检查是否有自定义模板 --\x3e\r\n <ng-container\r\n *ngIf="\r\n column.customRender && getTemplate(column.customRender);\r\n let template\r\n "\r\n >\r\n <ng-template\r\n [ngTemplateOutlet]="template"\r\n [ngTemplateOutletContext]="{\r\n $implicit: data,\r\n data: data,\r\n column: column,\r\n index: i,\r\n pageInfo: _pageInfo\r\n }"\r\n >\r\n </ng-template>\r\n </ng-container>\r\n\r\n \x3c!-- 默认渲染逻辑 --\x3e\r\n <ng-container\r\n *ngIf="!column.customRender || !getTemplate(column.customRender)"\r\n >\r\n {{ data[column.prop] }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <tr *ngIf="summaryData && _pageInfo.total > 0">\r\n \x3c!-- 汇总行的复选框列(当 showCheckbox=true 时显示,但为空) --\x3e\r\n <td\r\n *ngIf="showCheckbox"\r\n style="font-weight: bold; border-right: 1px solid #e8e8e8"\r\n ></td>\r\n <td\r\n *ngFor="let column; let i = index; of: _columns"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n style="font-weight: bold; border-right: 1px solid #e8e8e8"\r\n [nzAlign]="column.align"\r\n >\r\n <span *ngIf="i === 0">总计</span>\r\n <ng-container *ngIf="i !== 0 && column.summary">\r\n {{\r\n column.summary?.format\r\n ? column.summary?.format(\r\n summaryData[column.summary?.name || column.prop]\r\n )\r\n : summaryData[column.summary?.name || column.prop]\r\n }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <ng-template #totalTemplate let-total\r\n >共 {{ _pageInfo.total }} 条记录</ng-template\r\n >\r\n </nz-table>\r\n </ng-template>\r\n</app-page-container>\r\n',styles:[".pro-ellipsis{overflow:hidden;text-overflow:ellipsis}.pro-nowrap{white-space:nowrap}::ng-deep .setting-space-item{margin-right:0!important}::ng-deep .pro-table-checkboxgroup-nostyle{white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body table{border-collapse:separate;border-spacing:0}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important;white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:first-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:first-child{border-left:none!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-right,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-right{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th{border-top:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:last-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:last-child{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr:last-child>td{border-bottom:1px solid #e8e8e8!important}::ng-deep .table-search-bar-left .ant-form-item{margin-bottom:8px}"]}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[G]}]}]},U.propDecorators={showSearchBtn:[{type:t.Input}],showClearBtn:[{type:t.Input}],title:[{type:t.Input}],tableName:[{type:t.Input}],multiRow:[{type:t.Input}],columns:[{type:t.Input}],showSearchBar:[{type:t.Input}],showActionBar:[{type:t.Input}],confirmBtnText:[{type:t.Input}],clearBtnText:[{type:t.Input}],labelWidth:[{type:t.Input}],labelAlign:[{type:t.Input}],dataSource:[{type:t.Input}],bordered:[{type:t.Input}],outerBordered:[{type:t.Input}],showPagination:[{type:t.Input}],frontPagination:[{type:t.Input}],scroll:[{type:t.Input}],request:[{type:t.Input}],summaryData:[{type:t.Input}],sortMode:[{type:t.Input}],showColumnSetting:[{type:t.Input}],multipleSort:[{type:t.Input}],showCheckbox:[{type:t.Input}],rowDisabled:[{type:t.Input}],autoTriggerRequest:[{type:t.Input}],customTableRender:[{type:t.Input}],onRowClick:[{type:t.Output}],onRowDbClick:[{type:t.Output}],onValuesChange:[{type:t.Output}],onResetFormBeforeReload:[{type:t.Output}],actionBarTpl:[{type:t.ContentChild,args:["actionBar"]}],imgActionBarTpl:[{type:t.ContentChild,args:["ImgActionBar"]}],allTemplates:[{type:t.ContentChildren,args:[t.TemplateRef]}]};var $=function(){function e(){this.title="",this.showHeader=!0}return e.prototype.ngOnInit=function(){},e}();$.decorators=[{type:t.Component,args:[{selector:"app-page-container",template:'<nz-card\r\n [nzBorderless]="true"\r\n [nzBodyStyle]="{ padding: \'10px\', width: \'100%\' }"\r\n>\r\n <div class="page-container-title" *ngIf="title">{{ title }}</div>\r\n <div class="page-container-header" *ngIf="showHeader">\r\n <ng-container *ngTemplateOutlet="headerTpl"></ng-container>\r\n </div>\r\n <div class="page-container-body">\r\n <ng-container *ngTemplateOutlet="bodyTpl"></ng-container>\r\n </div>\r\n</nz-card>\r\n',styles:[".page-container-title{border-left:3px solid #096dd9;color:#1d1d1d;font-size:16px;margin-bottom:16px;padding-left:10px}.page-container-body,.page-container-header{box-sizing:border-box;padding:7px}"]}]}],$.ctorParameters=function(){return[]},$.propDecorators={title:[{type:t.Input}],showHeader:[{type:t.Input}],headerTpl:[{type:t.ContentChild,args:["header"]}],bodyTpl:[{type:t.ContentChild,args:["body"]}]};var Q=function(){};Q.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,S.NzCardModule,l.ReactiveFormsModule],declarations:[$],providers:[],exports:[$]}]}];var J=function(){function e(e,t,n){this.cdr=e,this.elementRef=t,this.platePrefixLoadService=n,this.nzPopoverVisible=!1,this.platePrefix="",this.plateSuffix="",this.platePrefixOptions=[],this.disabled=!1,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){var e=this;this.platePrefixLoadService?this.platePrefixLoadService.loadPrefixOptions().then((function(t){e.platePrefixOptions=t})).catch((function(){e.platePrefixOptions=[]})):this.platePrefixOptions=[]},e.prototype.handlePlatePrefix=function(e){this.platePrefix=e,this.emitValue(),this.nzPopoverVisible=!1,this.removeClickOutsideListener()},e.prototype.writeValue=function(e){e?(this.platePrefix=e.split("")[0],this.plateSuffix=e.split("").filter((function(e,t){return t>0})).join("")):(this.platePrefix="",this.plateSuffix="")},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){var t=this.disabled;this.disabled=e,t!==e&&(this.nzPopoverVisible=!1,this.removeClickOutsideListener(),this.cdr.detectChanges())},e.prototype.handlePrefixClick=function(e){var t=this;if(this.disabled)return e.preventDefault(),e.stopPropagation(),void(this.nzPopoverVisible=!1);this.nzPopoverVisible=!this.nzPopoverVisible,this.nzPopoverVisible?setTimeout((function(){t.attachClickOutsideListener()}),0):this.removeClickOutsideListener(),e.stopPropagation()},e.prototype.attachClickOutsideListener=function(){var e=this;this.clickOutsideHandler||(this.clickOutsideHandler=function(t){var n=e.elementRef.nativeElement,r=t.target,o=document.querySelector(".plate-input-popover"),i=o&&o.contains(r);n.contains(r)||i||(e.nzPopoverVisible=!1,e.removeClickOutsideListener(),e.cdr.detectChanges())},document.addEventListener("click",this.clickOutsideHandler,!0))},e.prototype.removeClickOutsideListener=function(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler,!0),this.clickOutsideHandler=void 0)},e.prototype.ngOnDestroy=function(){this.removeClickOutsideListener()},e.prototype.emitValue=function(){var e=this.platePrefix+this.plateSuffix;this.onChange(e)},e.prototype.onBlur=function(){this.onTouched()},e.prototype.handleAntdPlateSuffixBlur=function(e){if(!this.disabled){var t=e.target.value.toUpperCase();this.plateSuffix=t,this.emitValue()}},e}();J.decorators=[{type:t.Component,args:[{selector:"app-plate-input",template:'<div\r\n class="plate-antd-input-container"\r\n [class.plate-antd-input-disabled]="disabled"\r\n>\r\n <div\r\n class="plate-input-prefix"\r\n [class.plate-input-prefix-disabled]="disabled"\r\n nz-popover\r\n nzPopoverPlacement="bottom"\r\n nzPopoverOverlayClassName="plate-input-popover"\r\n [(nzPopoverVisible)]="nzPopoverVisible"\r\n [nzPopoverTrigger]="\'manual\'"\r\n [nzPopoverContent]="contentTemplate"\r\n (click)="handlePrefixClick($event)"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class="plate-input-icon-down"\r\n [nzRotate]="nzPopoverVisible ? 180 : 0"\r\n nz-icon\r\n nzType="down"\r\n nzTheme="outline"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style="height: 100%">\r\n <div\r\n nz-col\r\n nzSpan="4"\r\n *ngFor="let item of platePrefixOptions"\r\n class="plate-input-popover-item"\r\n (click)="!disabled && handlePlatePrefix(item.value)"\r\n [ngClass]="{\r\n \'plate-input-popover-item-active\': item.value === platePrefix,\r\n \'plate-input-popover-item-default\': item.value !== platePrefix\r\n }"\r\n >\r\n <div class="plate-input-popover-item-label">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class="plate-input-suffix"\r\n type="text"\r\n nz-input\r\n style="width: 75%"\r\n [value]="plateSuffix | uppercase"\r\n [disabled]="disabled"\r\n (blur)="!disabled && handleAntdPlateSuffixBlur($event)"\r\n />\r\n</div>\r\n',providers:[{provide:l.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return J})),multi:!0}],styles:['::ng-deep .plate-input-popover{box-sizing:border-box;padding:5px 0}::ng-deep .plate-input-popover .ant-popover-inner-content{height:264px;padding:0;width:387px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item{box-sizing:border-box;cursor:pointer;height:42px;padding:6px 12px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item .plate-input-popover-item-label{align-items:center;border:1px solid #ccc;display:flex;height:100%;justify-content:center;width:100%}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-default:hover{background-color:#eaeaea}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-active{background-color:#096dd9;color:#fff}::ng-deep .plate-input-prefix:hover:after{background-color:transparent;content:"";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}::ng-deep .plate-antd-input-container{display:flex;flex-wrap:nowrap;width:100%}::ng-deep .plate-antd-input-container .plate-input-prefix{align-items:center;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;display:flex;justify-content:center;min-height:32px;position:relative;text-align:center;width:60px}::ng-deep .plate-antd-input-container .plate-input-prefix .plate-input-icon-down{font-size:10px;position:absolute;right:5px;top:50%;transform:translateY(-50%)}::ng-deep .plate-antd-input-container .plate-input-prefix:hover:not(.plate-input-prefix-disabled){border-color:#40a9ff}::ng-deep .plate-antd-input-container .plate-input-prefix-disabled{background-color:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}::ng-deep .plate-antd-input-container .plate-input-suffix{width:calc(100% - 60px)}']}]}],J.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[W]}]}]};var X=function(){};X.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,h.NzGridModule,m.NzInputModule,v.NzPopoverModule,f.NzIconModule],declarations:[J],providers:[],exports:[J]}]}];var Y=function(){function e(){this.leftColSpan=21,this.rightColSpan=3,this.labelWidth="90px",this.labelAlign="right"}return e.prototype.ngOnInit=function(){this.setCSSVariablesToTarget()},e.prototype.ngAfterViewInit=function(){this.setCSSVariablesToTarget()},e.prototype.setCSSVariablesToTarget=function(){},e}();Y.decorators=[{type:t.Component,args:[{selector:"app-table-search-bar",template:'<div class="table-search-bar">\r\n <div class="table-search-bar-left" style="--label-width: {{ labelWidth }}; --label-align: {{ labelAlign }};">\r\n <ng-container *ngTemplateOutlet="leftContentTpl"></ng-container>\r\n </div>\r\n <div class="table-search-bar-right">\r\n <nz-space nzDirection="vertical" nzAlign="end">\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet="actionTextBtnTpl"></ng-container>\r\n </nz-space-item>\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet="actionImgBtnTpl"></ng-container>\r\n </nz-space-item>\r\n </nz-space>\r\n \x3c!-- <ng-container *ngTemplateOutlet="rightContentTpl"></ng-container> --\x3e\r\n </div>\r\n</div>\r\n',styles:['::ng-deep .table-search-bar{align-items:flex-start;display:flex;flex-wrap:wrap;gap:16px;width:100%}::ng-deep .table-search-bar-left{display:flex;flex:1;flex-wrap:wrap;gap:0 normal;min-width:0}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item{flex-shrink:0;flex-wrap:nowrap;width:250px}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label{flex-shrink:0;text-align:var(--label-align);width:var(--label-width)}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label label:after{content:""}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-picker{width:100%}::ng-deep .table-search-bar-right{align-items:flex-start;display:flex;flex-shrink:0}']}]}],Y.ctorParameters=function(){return[]},Y.propDecorators={leftColSpan:[{type:t.Input}],rightColSpan:[{type:t.Input}],labelWidth:[{type:t.Input}],labelAlign:[{type:t.Input}],leftContentTpl:[{type:t.ContentChild,args:["leftContent"]}],actionTextBtnTpl:[{type:t.ContentChild,args:["actionTextBtn"]}],actionImgBtnTpl:[{type:t.ContentChild,args:["actionImgBtn"]}]};var K=function(){};K.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,h.NzGridModule,l.ReactiveFormsModule,y.NzSpaceModule],declarations:[Y],providers:[],exports:[Y]}]}];var Z=function(){function e(e){this.columnRemote=e,this.columns=[],this.selectedColumns=[],this.afterConfirm=new t.EventEmitter,this.modalVisible=!1,this.options=[],this.sortableInstance=null}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){this.initSortable()},e.prototype.ngOnDestroy=function(){this.sortableInstance&&this.sortableInstance.destroy()},e.prototype.initSortable=function(){var e=this;this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null),this.sortableContainer&&this.sortableContainer.nativeElement&&(this.sortableInstance=new A.default(this.sortableContainer.nativeElement,{animation:150,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",handle:".sort-list-item",onEnd:function(t){e.onSortEnd(t)}}))},e.prototype.onSortEnd=function(e){var t=e.oldIndex,n=e.newIndex;if(t!==n){var r=j(this.selectedColumns),o=r.splice(t,1)[0];r.splice(n,0,o),this.selectedColumns=r}},e.prototype.trackByColumn=function(e,t){return t.prop||e.toString()},e.prototype.syncOptionsWithSelectedColumns=function(){var e=this.selectedColumns.map((function(e){return e.prop}));this.options.forEach((function(t){t.checked=e.includes(t.value)}))},e.prototype.handleModalVisible=function(){var e=this;this.options=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{label:e.title,value:e.prop,checked:!e.hideInTable,sortName:e.sortName||null}})),this.syncOptionsWithSelectedColumns(),this.modalVisible=!0,setTimeout((function(){e.initSortable()}),100)},e.prototype.handleModalClose=function(){this.modalVisible=!1,this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null)},e.prototype.handleSelectRemove=function(e){this.selectedColumns=this.selectedColumns.filter((function(t){return t.prop!==e})),this.syncOptionsWithSelectedColumns()},e.prototype.handleCheckBoxChange=function(e,t){e?(this.selectedColumns.push({title:t.label,prop:t.value,sortName:t.sortName,hideInTable:!1}),this.syncOptionsWithSelectedColumns()):this.handleSelectRemove(t.value)},e.prototype.handleConfirm=function(){var e,t=this;if(!(null===(e=this.columnRemote)||void 0===e?void 0:e.setCol)||!this.tableName)return this.modalVisible=!1,void this.afterConfirm.emit();var n=this.selectedColumns.map((function(e){return{field:e.prop,isShow:!e.hideInTable,header:e.title,sortName:e.sortName||null}})),o=this.columnRemote.setCol(this.tableName,n),i=function(e){t.modalVisible=!1,t.afterConfirm.emit()};o&&r.isObservable(o)?o.subscribe(i,(function(){return i()})):Promise.resolve(o).finally((function(){return i()}))},e}();Z.decorators=[{type:t.Component,args:[{selector:"app-colmuns-setting",template:'<div class="action-pic-btn" (click)="handleModalVisible()" title="列设置">\r\n <i nz-icon nzType="setting" nzTheme="outline"></i>\r\n</div>\r\n\r\n<nz-modal\r\n [(nzVisible)]="modalVisible"\r\n [nzWidth]="820"\r\n [nzTitle]="modalTitle"\r\n (nzOnCancel)="handleModalClose()"\r\n [nzContent]="modalBody"\r\n [nzBodyStyle]="{ padding: \'12px\' }"\r\n (nzOnOk)="handleConfirm()"\r\n [nzWrapClassName]="\'draggable-modal\'"\r\n>\r\n <ng-template #modalTitle>\r\n <div\r\n class="modal-drag-handle"\r\n cdkDrag\r\n [cdkDragRootElement]="\'.draggable-modal .ant-modal\'"\r\n cdkDragHandle\r\n [cdkDragBoundary]="\'.draggable-modal\'"\r\n >\r\n <span>设置显示字段</span>\r\n </div>\r\n </ng-template>\r\n <ng-template #modalBody>\r\n <div class="modal-body">\r\n <div class="check-box-list">\r\n <div class="mb-12">可选字段</div>\r\n <nz-checkbox-wrapper style="width: 100%">\r\n <div nz-row [nzGutter]="[24, 24]">\r\n <div nz-col nzSpan="6" *ngFor="let item of options">\r\n <label\r\n nz-checkbox\r\n nzValue="item.value"\r\n [ngModel]="item.checked"\r\n (ngModelChange)="handleCheckBoxChange($event, item)"\r\n >{{ item.label }}</label\r\n >\r\n </div>\r\n </div>\r\n </nz-checkbox-wrapper>\r\n </div>\r\n <div class="sort-list">\r\n <div nz-typography class="mb-4">当前已经选定的字段</div>\r\n <div\r\n nz-typography\r\n nzType="secondary"\r\n class="mb-4"\r\n [style.fontSize]="\'12px\'"\r\n >\r\n 提示:可拖动排序\r\n </div>\r\n <div #sortableContainer class="sortable-container">\r\n <div\r\n class="sort-list-item mb-12"\r\n *ngFor="let item of selectedColumns; trackBy: trackByColumn"\r\n >\r\n {{ item.title }}\r\n <a\r\n href="javascript:void(0)"\r\n class="fieldd-remove"\r\n title="删除"\r\n (click)="handleSelectRemove(item.prop)"\r\n >×</a\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</nz-modal>\r\n',styles:[".action-pic-btn{align-items:center;cursor:pointer;display:inline-flex;height:32px;justify-content:center;width:32px}.modal-body{display:flex;height:600px;width:100%}.modal-body .check-box-list{height:100%;width:calc(100% - 200px)}.modal-body .sort-list{border-left:1px solid #e3e3e3;box-sizing:border-box;height:100%;overflow-y:auto;padding-left:12px;padding-right:12px;width:200px}.modal-body .sort-list .sortable-container{min-height:100px}.modal-body .sort-list .sort-list-item{-moz-user-select:none;-webkit-user-select:none;align-items:center;cursor:move;display:flex;justify-content:space-between;user-select:none}.modal-body .sort-list .sort-list-item a{font-size:18px}.modal-drag-handle{-moz-user-select:none;-webkit-user-select:none;cursor:move;user-select:none;width:100%}"]}]}],Z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[G]}]}]},Z.propDecorators={columns:[{type:t.Input}],selectedColumns:[{type:t.Input}],tableName:[{type:t.Input}],afterConfirm:[{type:t.Output}],sortableContainer:[{type:t.ViewChild,args:["sortableContainer",{static:!1}]}]};var ee=function(){function e(e){this.cfr=e,this.component=null,this.props=null,this.valueChange=new t.EventEmitter,this.cmpRef=null,this.isCva=!1,this.cvaOnChange=null}return e.prototype.ngOnInit=function(){this.render()},e.prototype.ngOnChanges=function(e){if(e.component&&!e.component.firstChange)return this.destroy(),void this.render();this.cmpRef&&(e.value&&!e.value.firstChange&&(this.isCva?"function"==typeof this.cmpRef.instance.writeValue&&this.cmpRef.instance.writeValue(this.value):"value"in this.cmpRef.instance&&(this.cmpRef.instance.value=this.value)),e.props&&!e.props.firstChange&&this.applyProps())},e.prototype.render=function(){var e=this;if(this.component){var t=this.cfr.resolveComponentFactory(this.component);this.vc.clear(),this.cmpRef=this.vc.createComponent(t),this.isCva="function"==typeof this.cmpRef.instance.registerOnChange&&"function"==typeof this.cmpRef.instance.writeValue,this.isCva?(this.cmpRef.instance.writeValue(this.value),this.cmpRef.instance.registerOnChange((function(t){e.valueChange.emit(t)}))):("value"in this.cmpRef.instance&&(this.cmpRef.instance.value=this.value),"valueChange"in this.cmpRef.instance&&this.cmpRef.instance.valueChange&&"function"==typeof this.cmpRef.instance.valueChange.subscribe&&this.cmpRef.instance.valueChange.subscribe((function(t){e.valueChange.emit(t)}))),this.applyProps()}},e.prototype.applyProps=function(){var e=this,t=(this.props||{}).componentProps||{};Object.keys(t).forEach((function(n){try{e.cmpRef.instance[n]=t[n]}catch(e){}}))},e.prototype.destroy=function(){if(this.cmpRef){try{this.cmpRef.destroy()}catch(e){}this.cmpRef=null}},e.prototype.ngOnDestroy=function(){this.destroy()},e}();ee.decorators=[{type:t.Component,args:[{selector:"app-dynamic-search-field",template:"<ng-template #vc></ng-template>"}]}],ee.ctorParameters=function(){return[{type:t.ComponentFactoryResolver}]},ee.propDecorators={component:[{type:t.Input}],value:[{type:t.Input}],props:[{type:t.Input}],valueChange:[{type:t.Output}],vc:[{type:t.ViewChild,args:["vc",{read:t.ViewContainerRef,static:!0}]}]};var te=function(){};te.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,p.NzFormModule,b.NzSelectModule,y.NzSpaceModule,h.NzGridModule,m.NzInputModule,l.ReactiveFormsModule,v.NzPopoverModule,f.NzIconModule,u.NzButtonModule,Q,K,C.NzTableModule,X,d.NzDatePickerModule,g.NzModalModule,c.NzCheckboxModule,w.NzTypographyModule,o.DragDropModule,c.NzCheckboxModule,z.NzAutocompleteModule,P.NzInputNumberModule,R.NzToolTipModule],declarations:[U,Z,ee],providers:[{provide:G,useValue:null}],exports:[U]}]}];var ne=function(){function e(e){this.http=e,this.defaultApiUrl="/PlateFirstWord/GetPlateFirstWord"}return e.prototype.loadPrefixOptions=function(){return this.http.post(this.defaultApiUrl,{dictCode:"PlateFirstWord"}).toPromise().then((function(e){var t=[];t.push({label:"",value:""});for(var n=0;n<e.length;n++)t.push({label:e[n],value:e[n]});return t})).catch((function(){return[]}))},e}();ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[{type:a.HttpClient}]};var re=function(){function e(e){this.fb=e,this.formStore={},this.formModifyType="create",this.formRegisterStore={},this.labelWidth="120px",this.labelAlign="right",this.labelObservers={},this.errorMessageStore={},this.classPrefix="ant-form-",this.defaultErrorMessages={required:"该字段为必填项",minlength:"输入长度不足",maxlength:"输入长度超限",email:"请输入合法的邮箱地址",pattern:"输入格式不正确"}}return e.prototype.isFormGroupConfig=function(e){return"object"==typeof e&&null!==e&&"type"in e&&"group"===e.type},e.prototype.createNestedFormGroup=function(e,t){var n=this,r={};return Object.entries(e).forEach((function(e){var o,i,a,l,s,u=N(e,2),c=u[0],d=u[1];n.isFormGroupConfig(d)?r[c]=n.createNestedFormGroup(d.fields,null!==(o=d.disabled)&&void 0!==o?o:t):r[c]=[{value:d.value,disabled:null!==(a=null!==(i=d.disabled)&&void 0!==i?i:t)&&void 0!==a&&a},null!==(s=null===(l=d.validators)||void 0===l?void 0:l.call(d))&&void 0!==s?s:[]]})),this.fb.group(r)},e.prototype.createFormGroup=function(e,t,n){var r=this,o={};return this.errorMessageStore[e]={},Object.entries(t).forEach((function(t){var n,i,a,l=N(t,2),s=l[0],u=l[1];if(r.isFormGroupConfig(u)){var c=r.createNestedFormGroup(u.fields,u.disabled);o[s]=c,u.errorMessages&&(r.errorMessageStore[e][s]=u.errorMessages)}else o[s]=[{value:u.value,disabled:null!==(n=u.disabled)&&void 0!==n&&n},null!==(a=null===(i=u.validators)||void 0===i?void 0:i.call(u))&&void 0!==a?a:[]],u.errorMessages&&(r.errorMessageStore[e][s]=u.errorMessages)})),(null==n?void 0:n.labelWidth)&&(this.labelWidth=n.labelWidth),(null==n?void 0:n.labelAlign)&&(this.labelAlign=n.labelAlign),this.formStore[e]=this.fb.group(o),this.formRegisterStore[e]=!0,this.setCSSVariablesToTarget(e),this.formStore[e]},e.prototype.resetFormGroup=function(e,t){var n;null===(n=this.formStore[e])||void 0===n||n.reset(t)},e.prototype.isFormRegistered=function(e){var t;return null!==(t=this.formRegisterStore[e])&&void 0!==t&&t},e.prototype.destory=function(e){var t=this;e.forEach((function(e){t.errorMessageStore[e]&&delete t.errorMessageStore[e],t.formRegisterStore[e]&&delete t.formRegisterStore[e],t.formStore[e]&&delete t.formStore[e]}))},e.prototype.getNestedFormGroup=function(e,t){var n,r;if(!t||""===t.trim())return e;var o=t.split(".").filter((function(e){return""!==e.trim()})),i=e;try{for(var a=D(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(!(i&&i instanceof l.FormGroup))return null;if(!((i=i.get(u))&&i instanceof l.FormGroup))return null}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i instanceof l.FormGroup?i:null},e.prototype.addFieldsConfig=function(e,t,n){var r,o=this,i={success:!0,added:[],failed:[]},a=this.formStore[e];if(!a)return Object.keys(t).forEach((function(t){var r,o='Form "'+e+'" not found';i.failed.push({fieldName:t,error:o}),null===(r=null==n?void 0:n.onFieldAdded)||void 0===r||r.call(n,t,!1,o)})),i.success=!1,i;var l=null==n?void 0:n.targetPath,s=l?this.getNestedFormGroup(a,l):a;if(!s)return Object.keys(t).forEach((function(e){var t,r=l?'Target FormGroup at path "'+l+'" not found':"FormGroup not found";i.failed.push({fieldName:e,error:r}),null===(t=null==n?void 0:n.onFieldAdded)||void 0===t||t.call(n,e,!1,r)})),i.success=!1,i;this.errorMessageStore[e]||(this.errorMessageStore[e]={});var u={},c={};return Object.entries(t).forEach((function(e){var t,r,a,d,p,h=N(e,2),f=h[0],m=h[1];try{if(s.get(f)){var g='Field "'+f+'" already exists'+(l?' in "'+l+'"':"");return i.failed.push({fieldName:f,error:g}),void(null===(t=null==n?void 0:n.onFieldAdded)||void 0===t||t.call(n,f,!1,g))}var v=void 0;if(o.isFormGroupConfig(m)){if(v=o.createNestedFormGroup(m.fields,m.disabled),m.errorMessages)c[l?l+"."+f:f]=m.errorMessages}else{var b={validators:null!==(a=null===(r=m.validators)||void 0===r?void 0:r.call(m))&&void 0!==a?a:[]};if(v=o.fb.control(m.value,b),m.disabled&&v.disable(),m.errorMessages)c[l?l+"."+f:f]=m.errorMessages}u[f]=v,i.added.push(f),null===(d=null==n?void 0:n.onFieldAdded)||void 0===d||d.call(n,f,!0)}catch(g){var y=(null==g?void 0:g.message)||(null==g?void 0:g.toString())||"Unknown error";i.failed.push({fieldName:f,error:y}),null===(p=null==n?void 0:n.onFieldAdded)||void 0===p||p.call(n,f,!1,y)}})),Object.keys(u).length>0&&(Object.entries(u).forEach((function(e){var t=N(e,2),n=t[0],r=t[1];s.addControl(n,r)})),Object.entries(c).forEach((function(t){var n=N(t,2),r=n[0],i=n[1];o.errorMessageStore[e][r]=i})),(null==n?void 0:n.updateValueAndValidity)&&s.updateValueAndValidity({emitEvent:null===(r=null==n?void 0:n.emitEvent)||void 0===r||r})),i.success=0===i.failed.length,i},e.prototype.removeFieldsConfig=function(e,t,n){var r=this,o={success:!0,removed:[],failed:[]},i=this.formStore[e];if(!i)return t.forEach((function(t){var r,i='Form "'+e+'" not found';o.failed.push({fieldName:t,error:i}),null===(r=null==n?void 0:n.onFieldRemoved)||void 0===r||r.call(n,t,!1,i)})),o.success=!1,o;var a=[],l=[];t.forEach((function(e){var t;if(!i.get(e)){var r='Field "'+e+'" not found';return o.failed.push({fieldName:e,error:r}),void(null===(t=null==n?void 0:n.onFieldRemoved)||void 0===t||t.call(n,e,!1,r))}l.push(e),a.push(e)}));try{a.forEach((function(e){var t;i.removeControl(e),o.removed.push(e),null===(t=null==n?void 0:n.onFieldRemoved)||void 0===t||t.call(n,e,!0)})),this.errorMessageStore[e]&&l.forEach((function(t){delete r.errorMessageStore[e][t]}))}catch(e){a.forEach((function(t){var r;if(!o.removed.includes(t)){var i=(null==e?void 0:e.message)||(null==e?void 0:e.toString())||"Failed to remove field";o.failed.push({fieldName:t,error:i}),null===(r=null==n?void 0:n.onFieldRemoved)||void 0===r||r.call(n,t,!1,i)}}))}return o.success=0===o.failed.length,o},e.prototype.patchFormValues=function(e,t,n){var r,o=this.formStore[e];o?o.patchValue(t,{emitEvent:null===(r=null==n?void 0:n.emitEvent)||void 0===r||r}):console.warn('[AntdFormService] patchFormValues: form "'+e+'" not found.')},e.prototype.validateForm=function(e,t){var n,r;if(this.formStore[e].valid){var o=this.formStore[e].getRawValue();return this.excludeInternalFields(o)}return this.markAllControlsAsDirty(this.formStore[e],null===(n=null==t?void 0:t.emitEvent)||void 0===n||n,null!==(r=null==t?void 0:t.onlySelf)&&void 0!==r&&r),!1},e.prototype.markAllControlsAsDirty=function(e,t,n){var r=this;e.invalid&&(e.markAsDirty(),e.updateValueAndValidity({emitEvent:t,onlySelf:n})),e instanceof l.FormGroup&&Object.values(e.controls).forEach((function(e){r.markAllControlsAsDirty(e,t,n)}))},e.prototype.getFieldErrorMessage=function(e,t){var n,r,o,i=this.formStore[e];if(!i)return console.warn('[AntdFormService] getFieldErrorMessage: form "'+e+'" not found.'),"";var a=i.get(t);if(!a)return console.warn('[AntdFormService] getFieldErrorMessage: control "'+t+'" not found in form "'+e+'".'),"";if(!a.errors)return"";var l=null===(o=this.errorMessageStore[e])||void 0===o?void 0:o[t],s=Object.assign(Object.assign({},this.defaultErrorMessages),null!=l?l:{});try{for(var u=D(Object.keys(a.errors)),c=u.next();!c.done;c=u.next()){var d=s[c.value];if(d)return"string"==typeof d?d:""}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return""},e.prototype.watchFormChanges=function(e,t,n){var r=this.formStore[e];if(r)return this.setupValueChangeSubscription(r,t,n);console.warn('[AntdFormService] watchFormChanges: form "'+e+'" not found.')},e.prototype.watchFieldChanges=function(e,t,n,r){var o=this.formStore[e];if(o){var i=o.get(t);if(i)return this.setupValueChangeSubscription(i,n,r);console.warn('[AntdFormService] watchFieldChanges: control "'+t+'" not found in form "'+e+'".')}else console.warn('[AntdFormService] watchFieldChanges: form "'+e+'" not found.')},e.prototype.getFormClassName=function(e){return""+this.classPrefix+e},e.prototype.setCSSVariablesToTarget=function(e){var t=this,n="."+this.getFormClassName(e)+" .ant-form-item-label",r="."+this.getFormClassName(e);if(!this.labelObservers[e]){var o=null,i=new MutationObserver((function(){cancelAnimationFrame(o),o=requestAnimationFrame((function(){setTimeout((function(){!function(){var e=document.querySelectorAll(n);if(!e.length)return!1;var r=0;e.forEach((function(e){var n=e;if(!n.closest(".pro-table-container")){var o=n.getAttribute("custom-width"),i=n.getAttribute("custom-align"),a=o||t.labelWidth,l=i||t.labelAlign;n.style.width===a&&n.style.textAlign===l||(n.style.width=a,n.style.textAlign=l,r++)}}))}()}),0)}))})),a=document.querySelector(r);i.observe(a||document.body,{childList:!0,subtree:!0,attributes:!0}),this.labelObservers[e]=i}},e.prototype.excludeInternalFields=function(e){var t=this;if(null==e)return e;if(Array.isArray(e))return e.map((function(e){return t.excludeInternalFields(e)}));if("object"!=typeof e)return e;var n={};return Object.entries(e).forEach((function(e){var r=N(e,2),o=r[0],i=r[1];o.startsWith("__")||(n[o]=t.excludeInternalFields(i))})),n},e.prototype.setupValueChangeSubscription=function(e,t,n){var r=e.valueChanges;return null!=(null==n?void 0:n.debounce)&&(r=r.pipe(I.debounceTime(n.debounce))),!1!==(null==n?void 0:n.distinctUntilChanged)&&(r=r.pipe(I.distinctUntilChanged())),(null==n?void 0:n.emitInitial)&&t(e.value),r.subscribe(t)},e}();re.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new re(_.ɵɵinject(O.FormBuilder))},token:re,providedIn:"root"}),re.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],re.ctorParameters=function(){return[{type:l.FormBuilder}]};var oe=function(){function e(){this.formStore={}}return e.prototype.cloneValue=function(e){var t,n,r=this;if(null==e)return e;if(Array.isArray(e))return e.map((function(e){return r.cloneValue(e)}));if("object"==typeof e){var o={};try{for(var i=D(Object.keys(e)),a=i.next();!a.done;a=i.next()){var l=a.value;o[l]=this.cloneValue(e[l])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return e},e.prototype.isEqual=function(e,t){var n=this;if(e===t)return!0;if(null===e||null===t)return e===t;if(void 0===e||void 0===t)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((function(e,r){return n.isEqual(e,t[r])}));if("object"==typeof e&&"object"==typeof t){var r=Object.keys(e),o=Object.keys(t);return r.length===o.length&&r.every((function(r){return n.isEqual(e[r],t[r])}))}return!1},e.prototype.createRowSnapshot=function(e,t){var n=this,r={};return t.forEach((function(t){r[t.name]=n.cloneValue(e[t.name])})),r},e.prototype.initializeData=function(e){var t=this;return e.map((function(e){return t.enrichRow(e)}))},e.prototype.enrichRow=function(e){return Object.assign(Object.assign({},e),{uid:e.uid||T.v4(),isEdit:void 0!==e.isEdit&&e.isEdit,disabled:void 0!==e.disabled&&e.disabled})},e.prototype.addRow=function(e,t){var n=Object.assign(Object.assign({},t),{uid:T.v4(),isEdit:!0,isAdd:!0,disabled:!1});return e.push(n),n},e.prototype.validateField=function(e,t,n){var r=n.fields.find((function(e){return e.name===t}));return r&&r.validator?r.validator(e[t],e,t):""},e.prototype.validateRow=function(e,t){var n=this,r={};return t.fields.forEach((function(o){r[o.name]=n.validateField(e,o.name,t)})),r},e.prototype.validateData=function(e,t){var n=this,r={};return e.forEach((function(e){r[e.uid]=n.validateRow(e,t)})),r},e.prototype.registerForm=function(e,t,n){var r=this,o=this.initializeData(t),i={};o.forEach((function(e){i[e.uid]=r.createRowSnapshot(e,n.fields)})),this.formStore[e]={data:o,config:n,validationResults:{},initialSnapshot:i,editingSnapshot:{},allTouched:!1,rowTouched:{}},this.autoUpdateArrayReference(e)},e.prototype.getForm=function(e){return this.formStore[e]},e.prototype.getFormData=function(e){var t=this.formStore[e];if(t)return t.data.map((function(e){return delete e.isEdit,delete e.isAdd,delete e.uid,e}))},e.prototype.addRowToForm=function(e,t){var n=this.formStore[e];if(n){var r=this.addRow(n.data,t);return n.initialSnapshot[r.uid]=this.createRowSnapshot(r,n.config.fields),this.autoUpdateArrayReference(e),r}},e.prototype.validateForm=function(e){var t,n,r,o,i=this.formStore[e];if(!i)return!0;i.allTouched=!0;var a=this.validateData(i.data,i.config);i.validationResults=a;try{for(var l=D(Object.keys(a)),s=l.next();!s.done;s=l.next()){var u=s.value;try{for(var c=(r=void 0,D(Object.keys(a[u]))),d=c.next();!d.done;d=c.next()){var p=d.value;if(a[u][p])return!1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0},e.prototype.enableEdit=function(e,t){var n=this.formStore[e];n&&t.uid&&(n.editingSnapshot[t.uid]=this.createRowSnapshot(t,n.config.fields)),t.isEdit=!0},e.prototype.disableEdit=function(e,t){var n=this,r=this.formStore[e];if(r&&t.uid&&r.editingSnapshot[t.uid]){var o=r.editingSnapshot[t.uid];r.config.fields.forEach((function(e){t[e.name]=n.cloneValue(o[e.name])})),r.initialSnapshot[t.uid]=this.cloneValue(o),delete r.editingSnapshot[t.uid],delete r.rowTouched[t.uid],r.validationResults&&delete r.validationResults[t.uid]}t.isEdit=!1},e.prototype.confirmEdit=function(e,t){var n=this.formStore[e];n&&t.uid&&(n.editingSnapshot[t.uid]&&delete n.editingSnapshot[t.uid],n.initialSnapshot[t.uid]=this.createRowSnapshot(t,n.config.fields),delete n.rowTouched[t.uid]),t.isEdit=!1,t.isAdd=!1},e.prototype.deleteRowFromForm=function(e,t){var n=this.formStore[e];if(!n||!t.uid)return!1;var r=n.data.findIndex((function(e){return e.uid===t.uid}));return-1!==r&&(n.data.splice(r,1),delete n.initialSnapshot[t.uid],delete n.editingSnapshot[t.uid],delete n.rowTouched[t.uid],n.validationResults&&delete n.validationResults[t.uid],this.autoUpdateArrayReference(e),!0)},e.prototype.isFieldTouched=function(e,t,n){var r;if(e.allTouched)return!0;if(e.rowTouched[t.uid])return!0;var o=null===(r=e.initialSnapshot[t.uid])||void 0===r?void 0:r[n],i=t[n];return!this.isEqual(o,i)},e.prototype.validateFieldInRow=function(e,t,n){var r=this.formStore[e];if(!r)return"";var o=r.config.fields.find((function(e){return e.name===n}));if(!o)return"";var i="";return o.validator&&(i=o.validator(t[n],t,n)),r.validationResults||(r.validationResults={}),r.validationResults[t.uid]||(r.validationResults[t.uid]={}),r.validationResults[t.uid][n]=i,this.isFieldTouched(r,t,n)?i?"error":"success":""},e.prototype.getFieldErrorMessage=function(e,t,n){var r,o,i=this.formStore[e];return i&&t.uid&&this.isFieldTouched(i,t,n)&&(null===(o=null===(r=i.validationResults)||void 0===r?void 0:r[t.uid])||void 0===o?void 0:o[n])||""},e.prototype.validateRowAllFields=function(e,t){var n=this,r=this.formStore[e];if(!r||!t.uid)return!0;r.initialSnapshot[t.uid]=this.createRowSnapshot(t,r.config.fields),r.rowTouched[t.uid]=!0;var o=!1;return r.config.fields.forEach((function(r){"error"===n.validateFieldInRow(e,t,r.name)&&(o=!0)})),!o},e.prototype.autoUpdateArrayReference=function(e){var t=this.formStore[e];if(t&&t.config.targetObject&&t.config.arrayPropertyName){var n=t.data?j(t.data):[];t.config.targetObject[t.config.arrayPropertyName]=n}},e.prototype.hasEditingRow=function(e){var t=this.formStore[e];return!!t&&t.data.some((function(e){return e.isEdit}))},e.prototype.destory=function(e){var t=this;e.forEach((function(e){t.formStore[e]&&delete t.formStore[e]}))},e.prototype.resetFormArray=function(e){var t=this.formStore[e];t&&(t.data=[],t.initialSnapshot={},t.editingSnapshot={},t.validationResults={},t.allTouched=!1,t.rowTouched={},this.autoUpdateArrayReference(e))},e}();oe.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new oe},token:oe,providedIn:"root"}),oe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],oe.ctorParameters=function(){return[]},e.AntdFormService=re,e.ArrayFormService=oe,e.DefaultPlatePrefixLoadService=ne,e.PLATE_PREFIX_LOAD_SERVICE=W,e.PRO_TABLE_COLUMN_REMOTE=G,e.PRO_TABLE_DEFAULT_COLUMN=H,e.PRO_TABLE_DEFAULT_PROPS=L,e.PageContainerModule=Q,e.PlateInputModule=X,e.ProTableComponent=U,e.ProTableModule=te,e.TableSearchBarModule=K,e["ɵ0"]=B,e["ɵ1"]=V,e["ɵ2"]=q,e["ɵa"]=$,e["ɵb"]=Y,e["ɵc"]=J,e["ɵd"]=Z,e["ɵe"]=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("lodash-es"),require("rxjs"),require("@angular/cdk/drag-drop"),require("@angular/common"),require("@angular/common/http"),require("@angular/forms"),require("@angular/router"),require("ng-zorro-antd/button"),require("ng-zorro-antd/checkbox"),require("ng-zorro-antd/date-picker"),require("ng-zorro-antd/form"),require("ng-zorro-antd/grid"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/input"),require("ng-zorro-antd/modal"),require("ng-zorro-antd/popover"),require("ng-zorro-antd/select"),require("ng-zorro-antd/space"),require("ng-zorro-antd/table"),require("ng-zorro-antd/typography"),require("ng-zorro-antd/card"),require("sortablejs"),require("ng-zorro-antd/auto-complete"),require("ng-zorro-antd/input-number"),require("ng-zorro-antd/tooltip"),require("rxjs/operators"),require("uuid")):"function"==typeof define&&define.amd?define("@yibozhang/pro-table",["exports","@angular/core","lodash-es","rxjs","@angular/cdk/drag-drop","@angular/common","@angular/common/http","@angular/forms","@angular/router","ng-zorro-antd/button","ng-zorro-antd/checkbox","ng-zorro-antd/date-picker","ng-zorro-antd/form","ng-zorro-antd/grid","ng-zorro-antd/icon","ng-zorro-antd/input","ng-zorro-antd/modal","ng-zorro-antd/popover","ng-zorro-antd/select","ng-zorro-antd/space","ng-zorro-antd/table","ng-zorro-antd/typography","ng-zorro-antd/card","sortablejs","ng-zorro-antd/auto-complete","ng-zorro-antd/input-number","ng-zorro-antd/tooltip","rxjs/operators","uuid"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).yibozhang=e.yibozhang||{},e.yibozhang["pro-table"]={}),e.ng.core,e.lodashEs,e.rxjs,e.ng.cdk.dragDrop,e.ng.common,e.ng.common.http,e.ng.forms,e.ng.router,e.button,e.checkbox,e.datePicker,e.form,e.grid,e.icon,e.input,e.modal,e.popover,e.select,e.space,e.table,e.typography,e.card,e.Sortable,e.autoComplete,e.inputNumber,e.tooltip,e.rxjs.operators,e.uuid)}(this,(function(e,t,n,r,o,i,a,l,s,u,c,d,p,h,f,m,g,v,b,y,C,w,S,x,z,P,R,I,T){"use strict";function F(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function k(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var _=k(t),O=k(l),A=F(x);function M(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function l(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,l)}s((r=r.apply(e,t||[])).next())}))}function E(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}Object.create;function D(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function j(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(N(arguments[t]));return e}Object.create;"function"==typeof SuppressedError&&SuppressedError;var B=function(){return[]},V=function(e){return""+e},q=function(e){return e},L={input:{name:"",placeHolder:"",disabled:!1,label:"",value:""},select:{name:"",options:[],disabled:!1,label:"",value:"",allowClear:!0,placeHolder:""},selectMultiple:{name:"",options:[],disabled:!1,label:"",value:[],allowClear:!0,placeHolder:"请选择"},inputPlate:{name:"",label:"",value:""},checkbox:{name:"",options:[],disabled:!1,label:"",value:[],noStyle:!1},date:{name:"",disabled:!1,label:"",value:"",allowClear:!0,placeHolder:"请选择",showTime:!1,format:"yyyy-MM-dd",mode:"date"},autoComplete:{name:"",disabled:!1,placeHolder:"请输入",label:"",value:"",dataSource:B,backFill:!1,defaultActiveFirstOption:!1,returnFullData:!1},inputNumber:{name:"",disabled:!1,label:"",value:"",placeHolder:"请输入",min:0,max:100,precision:0,formatterPercent:V,parserPercent:q},custom:{name:"",value:null,label:""}},H={width:"",align:"left",fixedLeft:!1,fixedRight:!1,auxiliaryColumn:!1,ellipsis:!1},G=new t.InjectionToken("PRO_TABLE_COLUMN_REMOTE"),W=new t.InjectionToken("PLATE_PREFIX_LOAD_SERVICE"),U=function(){function e(e){this.columnRemote=e,this.showSearchBtn=!0,this.showClearBtn=!0,this.title=null,this.tableName="",this.multiRow=!1,this.columns=[],this.showSearchBar=!0,this.showActionBar=!0,this.confirmBtnText="查询",this.clearBtnText="清空",this.labelWidth="90px",this.labelAlign="right",this.dataSource=[],this.bordered=!0,this.outerBordered=!0,this.showPagination=!0,this.frontPagination=!1,this.scroll=null,this.summaryData=null,this.sortMode="local",this.showColumnSetting=!1,this.multipleSort=!1,this.showCheckbox=!1,this.rowDisabled=function(){return!1},this.autoTriggerRequest=!0,this.onRowClick=new t.EventEmitter,this.onRowDbClick=new t.EventEmitter,this.onValuesChange=new t.EventEmitter,this.onResetFormBeforeReload=new t.EventEmitter,this._savedSearchParams={},this.templateMap=new Map,this.customTemplates=new Map,this._sortMap={},this._sortPriority=[],this._autoCompleteDebounceMap=new Map,this._preCheckDone=!1,this._columns=[],this._searchParams={},this._searchFiledColumns=[],this._pageInfo={pageIndex:1,pageSize:15,total:100,pageSizeOptions:[10,15,20,50,100,500,1e3]},this._loading=!1,this._selectedTableRow=null,this._selectedRows=[],this._selectedRowIds=new Set,this._checkedAll=!1,this._indeterminate=!1,this._serverColumns=[],this._autoCompleteDataSources={}}return e.prototype.fetchRemoteColumns=function(){var e;return M(this,void 0,void 0,(function(){return E(this,(function(t){switch(t.label){case 0:if(!(null===(e=this.columnRemote)||void 0===e?void 0:e.getCol)||!this.tableName)return[2,null];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.columnRemote.getCol(this.tableName,this.multiRow)];case 2:return[2,t.sent()];case 3:return t.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.persistRemoteColumns=function(e){var t;return M(this,void 0,void 0,(function(){var n;return E(this,(function(o){switch(o.label){case 0:if(!(null===(t=this.columnRemote)||void 0===t?void 0:t.setCol)||!this.tableName)return[2,null];o.label=1;case 1:return o.trys.push([1,4,,5]),(n=this.columnRemote.setCol(this.tableName,e,this.multiRow))&&r.isObservable(n)?[4,n.toPromise()]:[3,3];case 2:return[2,o.sent()];case 3:return[2,n];case 4:return o.sent(),[2,null];case 5:return[2]}}))}))},e.prototype.ngOnInit=function(){return M(this,void 0,void 0,(function(){return E(this,(function(e){switch(e.label){case 0:return this._searchParams={},this.formateInnerColumns(this.columns),[4,this.setSearchParams(this.columns)];case 1:return e.sent(),this._searchParams=this.createSearchParamsProxy(this._searchParams),this.autoTriggerRequest&&this.handleQuery(),this.queryDynamicColumns(),[2]}}))}))},e.prototype.ngAfterContentInit=function(){this.autoRegisterTemplates()},e.prototype.preCheckServerColumns=function(){return M(this,void 0,void 0,(function(){var e,t;return E(this,(function(r){switch(r.label){case 0:return[4,this.fetchRemoteColumns()];case 1:return(e=r.sent())?(t=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{field:e.prop,isShow:!e.hideInTable,header:e.title,sortName:e.sortName||null}})),0!==e.code?[3,5]:n.isEqual(e.data.tabColumn,t)?[3,3]:[4,this.persistRemoteColumns(t)]):[2,!1];case 2:return r.sent()&&this.queryDynamicColumns(),[2,!1];case 3:return console.log("一致"),[2,!0];case 4:return[3,6];case 5:return[2,!1];case 6:return[2]}}))}))},e.prototype.queryDynamicColumns=function(){return M(this,void 0,void 0,(function(){var e,t,n,r;return E(this,(function(o){switch(o.label){case 0:return this.tableName&&this.columnRemote?this._preCheckDone?[3,2]:[4,this.preCheckServerColumns()]:[2];case 1:if(e=o.sent(),this._preCheckDone=!0,!e)return[2];o.label=2;case 2:return[4,this.fetchRemoteColumns()];case 3:return(t=o.sent())?0!==t.code?[3,4]:(n=t.data.tabColumn.map((function(e){return{title:e.header,prop:e.field,sortName:e.sortName,hideInTable:!e.isShow}})),this._serverColumns=n,this.updateTableColumns(n),[3,6]):[2];case 4:return 10!==t.code?[3,6]:(r=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{field:e.prop,isShow:!0,header:e.title,sortName:e.sortName||null}})),[4,this.persistRemoteColumns(r)]);case 5:o.sent()&&this.queryDynamicColumns(),o.label=6;case 6:return[2]}}))}))},e.prototype.formateInnerColumns=function(e){this._columns=e.filter((function(e){return!e.hideInTable})).map((function(e){return Object.assign(Object.assign({},H),e)}))},e.prototype.autoRegisterTemplates=function(){var e=this,t=this._columns.filter((function(e){return e.customRender}));t.length>0&&t.forEach((function(t){var n=t.customRender,r=e.findTemplateByName(n);r&&e.customTemplates.set(n,r)}));var n=this.columns.filter((function(e){return e.customLabelRender}));n.length>0&&n.forEach((function(t){var r=t.customLabelRender,o=e.findLabelTemplateByName(r,n);o&&e.customTemplates.set(r,o)}))},e.prototype.findTemplateByName=function(e){return this.getTemplateFromContent(e)},e.prototype.getTemplateFromContent=function(e){var t=this,n=this._columns.filter((function(e){return e.customRender})).findIndex((function(t){return t.customRender===e}));if(n>=0){var r=this.allTemplates.toArray().filter((function(e){return e!==t.actionBarTpl&&e!==t.imgActionBarTpl}));if(n<r.length)return r[n]}return console.warn("未找到模板 "+e),null},e.prototype.findLabelTemplateByName=function(e,t){var n=this,r=t.findIndex((function(t){return t.customLabelRender===e}));if(r>=0){var o=this.allTemplates.toArray().filter((function(e){return e!==n.actionBarTpl&&e!==n.imgActionBarTpl})),i=this._columns.filter((function(e){return e.customRender})).length+r;if(i<o.length)return o[i]}return console.warn("未找到label模板 "+e),null},e.prototype.setSearchFormDefaultProp=function(e){e.forEach((function(e){e.valueType&&(e.fieldProps?e.fieldProps=Object.assign(Object.assign({},L[e.valueType]),e.fieldProps):e.fieldProps=Object.assign({},L[e.valueType]))}))},e.prototype.setSelectRequest=function(e){var t=this;e.map((function(e){return M(t,void 0,void 0,(function(){var t,r,o;return E(this,(function(i){switch(i.label){case 0:if(!e.fieldProps||!n.hasIn(e.fieldProps,"request"))return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,null===(r=(t=e.fieldProps).request)||void 0===r?void 0:r.call(t)];case 2:return o=i.sent(),e.fieldProps.options=o,[3,4];case 3:return i.sent(),e.fieldProps.options=[],[3,4];case 4:return[2]}}))}))}))},e.prototype.setSearchParams=function(e){return M(this,void 0,void 0,(function(){var t=this;return E(this,(function(r){return this._searchFiledColumns=[],e.filter((function(e){var r=!e.hideInSearch&&e.valueType;return r&&t._searchFiledColumns.push(n.cloneDeep(e)),r})).forEach((function(e){var n,r,o,i=(null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop,a=L[e.valueType].value;if("checkbox"===e.valueType){var l=((null===(r=e.fieldProps)||void 0===r?void 0:r.options)||[]).filter((function(e){return e.checked})).map((function(e){return e.value}));t._searchParams[i]=l.length>0?l:a}else t._searchParams[i]=(null===(o=e.fieldProps)||void 0===o?void 0:o.value)||a;"autoComplete"===e.valueType&&(t._autoCompleteDataSources[i]=[])})),this._searchFiledColumns.sort((function(e,t){var r=n.isNil(null==e?void 0:e.order)?Number.MAX_SAFE_INTEGER:e.order,o=n.isNil(null==t?void 0:t.order)?Number.MAX_SAFE_INTEGER:t.order;return r===o?0:r-o})),this.setSearchFormDefaultProp(this._searchFiledColumns),this.setSelectRequest(this._searchFiledColumns),[2]}))}))},e.prototype.updateTableColumns=function(e){var t=n.cloneDeep(this.columns),r=e,o=t.filter((function(e){return!e.auxiliaryColumn})),i=[],a=j(o);r.forEach((function(e){var t=a.findIndex((function(t){return t.prop===e.prop}));if(-1!==t){var n=a[t],r=Object.assign(Object.assign({},n),e);i.push(r),a.splice(t,1)}else i.push(e)})),a.forEach((function(e){var t=Object.assign(Object.assign({},e),{hideInTable:!0});i.push(t)}));var l=[],s=0;t.forEach((function(e){if(e.auxiliaryColumn)l.push(e);else{var t=i[s];if(t){var n=Object.assign(Object.assign({},e),t);l.push(n)}else l.push(e);s++}})),this.formateInnerColumns(l)},e.prototype.createSearchParamsProxy=function(e){var t=this;return new Proxy(e,{set:function(e,n,r){var o=String(n);if(e[o]===r)return e[o]=r,!0;e[o]=r;try{t.onValuesChange.emit({key:o,value:r,params:t.getSearchParams()})}catch(e){}return!0}})},e.prototype.clearEmptySearchParams=function(){return n.cloneDeep(this._searchParams)},e.prototype.buildServerSortPayload=function(){var e=this,t=this._sortPriority.filter((function(t){return!!e._sortMap[t]}));if(0===t.length)return null;var n=t.map((function(t){var n=e._columns.find((function(e){return e.prop===t}));return{field:(null==n?void 0:n.sortName)||t,order:e._sortMap[t]}}));return this.multipleSort?n:N(n,1)[0]},e.prototype.sortDataSourceInPlace=function(){var e=this;if(Array.isArray(this.dataSource)&&0!==this.dataSource.length){var t=this._sortPriority.filter((function(t){return!!e._sortMap[t]}));if(0!==t.length){var n=j(t);this.dataSource.sort((function(t,r){for(var o=n.length-1;o>=0;o--){var i=n[o],a=e._sortMap[i],l=null==t?void 0:t[i],s=null==r?void 0:r[i],u=e.compareValues(l,s);if(0!==u)return"ascend"===a?u:-u}return 0}))}}},e.prototype.compareValues=function(e,t){if(null==e&&null==t)return 0;if(null==e)return-1;if(null==t)return 1;if(e instanceof Date&&t instanceof Date)return e.getTime()-t.getTime();if("boolean"==typeof e&&"boolean"==typeof t)return e===t?0:e?1:-1;if("number"==typeof e&&"number"==typeof t)return e-t;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t);var n=Number(e),r=Number(t);return isNaN(n)||isNaN(r)?String(e).localeCompare(String(t)):n-r},e.prototype.executeAutoCompleteDataSource=function(e,t){var n,r=this,o=(null===(n=t.fieldProps)||void 0===n?void 0:n.name)||t.prop;if(t.fieldProps.dataSource&&"function"==typeof t.fieldProps.dataSource)try{var i=t.fieldProps.dataSource(e);i instanceof Promise?i.then((function(e){r._autoCompleteDataSources[o]=e||[]})).catch((function(e){console.error("AutoComplete dataSource error:",e),r._autoCompleteDataSources[o]=[]})):this._autoCompleteDataSources[o]=i||[]}catch(e){console.error("AutoComplete dataSource error:",e),this._autoCompleteDataSources[o]=[]}},e.prototype.getSearchParams=function(e){var t=(e||{}).useSaved,r=void 0!==t&&t?this._savedSearchParams:this._searchParams,o=n.cloneDeep(r||{});return Object.assign({params:o,pageInfo:{pageIndex:this._pageInfo.pageIndex,pageSize:this._pageInfo.pageSize}},"server"===this.sortMode?{sort:this.buildServerSortPayload()}:{})},e.prototype.reload=function(e){this.handleQuery(e)},e.prototype.setFieldsValue=function(e){var t=this;Object.keys(e).forEach((function(n){t._searchParams[n]=e[n]}))},e.prototype.setFieldValue=function(e,t){this._searchParams[e]=t},e.prototype.clearSelectedRow=function(){this._selectedTableRow=null},e.prototype.setColumns=function(e,t){return M(this,void 0,void 0,(function(){return E(this,(function(r){switch(r.label){case 0:return this.columns=n.cloneDeep(e),this.formateInnerColumns(this.columns),this._searchParams={},[4,this.setSearchParams(this.columns)];case 1:return r.sent(),this._searchParams=this.createSearchParamsProxy(this._searchParams),this.allTemplates&&this.autoRegisterTemplates(),!0===(null==t?void 0:t.reload)&&this.handleQuery(),[2]}}))}))},e.prototype.getSelectedRowData=function(){return this._selectedTableRow},e.prototype.getCheckedRows=function(){return this.showCheckbox?this.dataSource.filter((function(e){return!0===e.checked})):[]},e.prototype.getTemplate=function(e){if(!e)return null;try{var t=this.customTemplates.get(e);if(t)return t;var n=this.templateMap.get(e);return n||null}catch(e){return null}},e.prototype.getToolTipTextValue=function(e,t){var n=e.customRender&&this.getTemplate(e.customRender)?"":e.ellipsis?e.prop:"";return n?t[n]:""},e.prototype.getTableRowChecked=function(e){return this.showCheckbox?this.isRowChecked(e):!!this._selectedTableRow&&JSON.stringify(this._selectedTableRow)===JSON.stringify(e)},e.prototype.isRowDisabled=function(e){return!!this.showCheckbox&&(!!this.rowDisabled&&this.rowDisabled(e))},e.prototype.isRowChecked=function(e){return!!this.showCheckbox&&!0===e.checked},e.prototype.toggleRowChecked=function(e,t,n){var r=this;if(n&&n.stopPropagation(),!this.isRowDisabled(e)){e.checked=t;var o=this.getRowId(e);void 0!==o&&(t?this._selectedRowIds.add(o):this._selectedRowIds.delete(o));var i=this._selectedRows.findIndex((function(t){return r.isSameRow(t,e)}));t?(-1===i&&this._selectedRows.push(e),this._selectedTableRow=e):(i>-1&&this._selectedRows.splice(i,1),this._selectedTableRow&&this.isSameRow(this._selectedTableRow,e)&&(this._selectedTableRow=null)),this.updateCheckAllStatus()}},e.prototype.updateCheckAllStatus=function(){var e=this;if(!this.showCheckbox||!Array.isArray(this.dataSource))return this._checkedAll=!1,void(this._indeterminate=!1);var t=this.dataSource.filter((function(t){return!e.isRowDisabled(t)})),n=t.filter((function(e){return!0===e.checked})).length,r=t.length;this._checkedAll=r>0&&n>0&&n===r,this._indeterminate=n>0&&n<r},e.prototype.toggleCheckAll=function(e,t){var n=this;t&&t.stopPropagation();var r=this.dataSource.filter((function(e){return!n.isRowDisabled(e)}));r.forEach((function(t){t.checked=e;var r=n.getRowId(t);void 0!==r&&(e?n._selectedRowIds.add(r):n._selectedRowIds.delete(r))})),e?(this._selectedRows=j(r),this._selectedTableRow=r.length>0?r[0]:null):(this._selectedRows=[],this._selectedTableRow=null),this.updateCheckAllStatus()},e.prototype.getSelectedRows=function(){return this.getCheckedRows()},e.prototype.handleRowCheckedChange=function(e,t){var n=this;if(!this.isRowDisabled(e)){var r=this.getRowId(e);void 0!==r&&(t?this._selectedRowIds.add(r):this._selectedRowIds.delete(r));var o=this._selectedRows.findIndex((function(t){return n.isSameRow(t,e)}));t?(-1===o&&this._selectedRows.push(e),this._selectedTableRow=e):(o>-1&&this._selectedRows.splice(o,1),this._selectedTableRow&&this.isSameRow(this._selectedTableRow,e)&&(this._selectedTableRow=null)),this.updateCheckAllStatus()}},e.prototype.refreshCheckAllStatus=function(){this.updateCheckAllStatus()},e.prototype.getRowId=function(e){var t,n;return null!==(n=null!==(t=e.id)&&void 0!==t?t:e.key)&&void 0!==n?n:void 0},e.prototype.isSameRow=function(e,t){var n=this.getRowId(e),r=this.getRowId(t);return void 0!==n&&void 0!==r?n===r:JSON.stringify(e)===JSON.stringify(t)},e.prototype.clearSelectedRows=function(){Array.isArray(this.dataSource)&&this.dataSource.forEach((function(e){e.checked=!1})),this._selectedRowIds.clear(),this._selectedRows=[],this._checkedAll=!1,this._indeterminate=!1,this._selectedTableRow=null},e.prototype.handleFieldCheckBoxChange=function(e,t){var n;this.setFieldsValue(((n={})[t]=e.filter((function(e){return e.checked})).map((function(e){return e.value})),n))},e.prototype.handleSearch=function(){this._savedSearchParams=this.clearEmptySearchParams(),this._pageInfo.pageIndex=1,this.handleQuery()},e.prototype.handleResetForm=function(){var e=this;Object.keys(this._searchParams).forEach((function(t){var n=e._searchFiledColumns.find((function(e){var n;return((null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop)===t}));if("checkbox"===(null==n?void 0:n.valueType)){var r=e.columns.find((function(e){var n;return((null===(n=e.fieldProps)||void 0===n?void 0:n.name)||e.prop)===t})),o=null==r?void 0:r.fieldProps,i=((null==o?void 0:o.options)||[]).filter((function(e){return e.checked})).map((function(e){return e.value})),a=i.length>0?i:L[n.valueType].value;e._searchParams[t]=a;var l=Array.isArray(a)?a:[],s=(null==o?void 0:o.options)||[];n.fieldProps.options=s.map((function(e){return Object.assign(Object.assign({},e),{checked:l.includes(e.value)})}))}else e._searchParams[t]=(null==n?void 0:n.fieldProps)&&(null==n?void 0:n.fieldProps.value)||L[n.valueType].value})),this._savedSearchParams={},this._pageInfo.pageIndex=1,this.onResetFormBeforeReload.emit(),this.handleQuery()},e.prototype.handlePageIndexChange=function(e){this._pageInfo.pageIndex=e,this.handleQuery()},e.prototype.handlePageSizeChange=function(e){this._pageInfo.pageSize=e,this._pageInfo.pageIndex=1,this.handleQuery()},e.prototype.handleQuery=function(e){return M(this,void 0,void 0,(function(){var t,n,r,o,i=this;return E(this,(function(a){switch(a.label){case 0:if(e&&Array.isArray(this.dataSource)&&1===this.dataSource.length&&this._pageInfo.pageIndex>1&&(this._pageInfo.pageIndex=this._pageInfo.pageIndex-1),t=e&&this.showCheckbox?j(this.dataSource):[],this._loading=!0,!this.request)return[3,6];a.label=1;case 1:return a.trys.push([1,3,4,5]),[4,this.request(Object.assign({params:this.clearEmptySearchParams(),pageInfo:{pageIndex:this._pageInfo.pageIndex,pageSize:this._pageInfo.pageSize}},"server"===this.sortMode?{sort:this.buildServerSortPayload()}:{}))];case 2:return n=a.sent(),this.showCheckbox?(this.dataSource=(n.data||[]).map((function(e){var t=i.getRowId(e),n=void 0!==e.checked?e.checked:void 0!==t&&i._selectedRowIds.has(t);return Object.assign(Object.assign({},e),{checked:n})})),e&&t.length>0&&(r=new Set(this.dataSource.map((function(e){return i.getRowId(e)}))),t.forEach((function(e){var t=i.getRowId(e);void 0===t||r.has(t)||(i._selectedRowIds.delete(t),void 0!==e.checked&&(e.checked=!1))})))):this.dataSource=n.data||[],this.summaryData=n.summaryData||null,"local"===this.sortMode&&this.sortDataSourceInPlace(),this._pageInfo.total=n.total||0,this.showCheckbox&&this.updateCheckAllStatus(),[3,5];case 3:return o=a.sent(),console.error("查询失败:",o),this.dataSource=[],this._pageInfo.total=0,this.summaryData=null,[3,5];case 4:return this._loading=!1,this._selectedTableRow=null,[7];case 5:return[3,7];case 6:console.warn("未提供 _request 回调函数"),this._loading=!1,a.label=7;case 7:return[2]}}))}))},e.prototype.onSortChange=function(e,t){var n=this;this.multipleSort||Object.keys(this._sortMap).forEach((function(t){t!==e&&(n._sortMap[t]=null)})),this._sortMap[e]=t,this._sortPriority=this._sortPriority.filter((function(t){return t!==e})),t&&this._sortPriority.push(e),"local"===this.sortMode?this.sortDataSourceInPlace():this.handleQuery()},e.prototype.getSortOrder=function(e){return this._sortMap[e]||null},e.prototype.handleTableRowClick=function(e){this._selectedTableRow=e,this.showCheckbox&&!this.isRowDisabled(e)&&(this._selectedRows=[],this.toggleRowChecked(e,!0)),this.onRowClick.emit(this._selectedTableRow)},e.prototype.handleTableRowDbClick=function(e){this._selectedTableRow=e,this.onRowDbClick.emit(this._selectedTableRow)},e.prototype.handleColumnsSettingConfirm=function(){this.queryDynamicColumns()},e.prototype.handleAutoCompleteInput=function(e,t){var r,o=this,i=(null===(r=t.fieldProps)||void 0===r?void 0:r.name)||t.prop;if(!this._autoCompleteDebounceMap.has(i)){var a=n.debounce((function(e){var t=o._searchFiledColumns.find((function(e){var t;return((null===(t=e.fieldProps)||void 0===t?void 0:t.name)||e.prop)===i}));t&&o.executeAutoCompleteDataSource(e,t)}),300);this._autoCompleteDebounceMap.set(i,a)}var l=this._autoCompleteDebounceMap.get(i);l&&l(e)},e.prototype.getAutoCompleteDataSource=function(e){var t,n=(null===(t=e.fieldProps)||void 0===t?void 0:t.name)||e.prop;return this._autoCompleteDataSources[n]||[]},e.prototype.getFieldProps=function(e){return e.fieldProps},e.prototype.getLabelTemplate=function(e){if(!e)return null;try{var t=this.customTemplates.get(e);if(t)return t;var n=this.templateMap.get(e);return n||null}catch(e){return null}},e.prototype.getFormItemClassName=function(e){return"pro-table-"+(this.getFieldProps(e).name||e.prop)+"-form-item"},e}();U.decorators=[{type:t.Component,args:[{selector:"app-pro-table",template:'<app-page-container\r\n [title]="title"\r\n [showHeader]="showSearchBar"\r\n ngClass="pro-table-container"\r\n>\r\n <ng-template #header>\r\n <app-table-search-bar\r\n *ngIf="showSearchBar"\r\n [labelWidth]="labelWidth"\r\n [labelAlign]="labelAlign"\r\n >\r\n <ng-template #leftContent>\r\n <nz-form-item\r\n *ngFor="let column of _searchFiledColumns"\r\n [ngClass]="getFormItemClassName(column)"\r\n >\r\n <nz-form-label *ngIf="!getFieldProps(column).hideLabel" nzNoColon>\r\n \x3c!-- 检查是否有自定义label模板 --\x3e\r\n <ng-container\r\n *ngIf="\r\n column.customLabelRender &&\r\n getLabelTemplate(column.customLabelRender);\r\n else defaultLabel\r\n "\r\n >\r\n <ng-container\r\n [ngTemplateOutlet]="getLabelTemplate(column.customLabelRender)"\r\n [ngTemplateOutletContext]="{\r\n $implicit: column,\r\n column: column,\r\n fieldProps: getFieldProps(column)\r\n }"\r\n >\r\n </ng-container>\r\n </ng-container>\r\n <ng-template #defaultLabel>\r\n {{ getFieldProps(column).label || column.title }}\r\n </ng-template>\r\n </nz-form-label>\r\n <nz-form-control *ngIf="column.valueType === \'input\'">\r\n <input\r\n nz-input\r\n [name]="getFieldProps(column).name || column.prop"\r\n [placeholder]="getFieldProps(column).placeHolder"\r\n [disabled]="getFieldProps(column).disabled"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n />\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'inputPlate\'">\r\n <app-plate-input\r\n [name]="getFieldProps(column).name || column.prop"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n ></app-plate-input>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'select\'">\r\n <nz-select\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [name]="getFieldProps(column).name || column.prop"\r\n [nzOptions]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'selectMultiple\'">\r\n <nz-select\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [name]="getFieldProps(column).name || column.prop"\r\n [nzOptions]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n nzMode="multiple"\r\n >\r\n </nz-select>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'date\'">\r\n <nz-date-picker\r\n [nzShowTime]="getFieldProps(column).showTime"\r\n [nzFormat]="getFieldProps(column).format"\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [nzAllowClear]="getFieldProps(column).allowClear"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzMode]="getFieldProps(column).mode"\r\n ></nz-date-picker>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'checkbox\'">\r\n <nz-checkbox-group\r\n [class]="\r\n getFieldProps(column).noStyle\r\n ? \'pro-table-checkboxgroup-nostyle\'\r\n : \'\'\r\n "\r\n [(ngModel)]="getFieldProps(column).options"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n (ngModelChange)="\r\n handleFieldCheckBoxChange(\r\n $event,\r\n getFieldProps(column).name || column.prop\r\n )\r\n "\r\n ></nz-checkbox-group>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'autoComplete\'">\r\n <input\r\n nz-input\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column)?.name || column.prop]\r\n "\r\n (input)="handleAutoCompleteInput($event, column)"\r\n [nzAutocomplete]="auto"\r\n [disabled]="getFieldProps(column)?.disabled"\r\n [placeholder]="getFieldProps(column)?.placeHolder"\r\n />\r\n <nz-autocomplete\r\n [nzBackfill]="getFieldProps(column).backFill"\r\n [nzDefaultActiveFirstOption]="\r\n getFieldProps(column).defaultActiveFirstOption\r\n "\r\n [nzWidth]="getFieldProps(column).width"\r\n #auto\r\n >\r\n <nz-auto-option\r\n *ngFor="let option of getAutoCompleteDataSource(column)"\r\n [nzValue]="\r\n getFieldProps(column).returnFullData ? option : option.value\r\n "\r\n [nzLabel]="option.label"\r\n [nzDisabled]="option.disabled"\r\n >\r\n {{ option.label }}\r\n </nz-auto-option>\r\n </nz-autocomplete>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'custom\'">\r\n <app-dynamic-search-field\r\n [component]="getFieldProps(column).component"\r\n [value]="_searchParams[getFieldProps(column).name || column.prop]"\r\n [props]="getFieldProps(column)"\r\n (valueChange)="\r\n setFieldValue(getFieldProps(column).name || column.prop, $event)\r\n "\r\n ></app-dynamic-search-field>\r\n </nz-form-control>\r\n <nz-form-control *ngIf="column.valueType === \'inputNumber\'">\r\n <nz-input-number\r\n [style.width]="\'100%\'"\r\n [(ngModel)]="\r\n _searchParams[getFieldProps(column).name || column.prop]\r\n "\r\n [nzPlaceHolder]="getFieldProps(column).placeHolder"\r\n [nzDisabled]="getFieldProps(column).disabled"\r\n [nzFormatter]="getFieldProps(column).formatterPercent"\r\n [nzParser]="getFieldProps(column).parserPercent"\r\n ></nz-input-number>\r\n </nz-form-control>\r\n </nz-form-item>\r\n </ng-template>\r\n <ng-template #actionTextBtn>\r\n <nz-space [nzSize]="4">\r\n <nz-space-item *ngIf="showSearchBtn">\r\n <button nz-button nzType="primary" (click)="handleSearch()">\r\n {{ confirmBtnText }}\r\n </button>\r\n </nz-space-item>\r\n <nz-space-item *ngIf="showClearBtn">\r\n <button nz-button (click)="handleResetForm()">\r\n {{ clearBtnText }}\r\n </button>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n <ng-template #actionImgBtn>\r\n <nz-space>\r\n <ng-container *ngTemplateOutlet="imgActionBarTpl"></ng-container>\r\n <nz-space-item class="setting-space-item" *ngIf="showColumnSetting">\r\n <app-colmuns-setting\r\n [columns]="columns"\r\n [selectedColumns]="_serverColumns"\r\n [tableName]="tableName"\r\n (afterConfirm)="handleColumnsSettingConfirm()"\r\n ></app-colmuns-setting>\r\n </nz-space-item>\r\n </nz-space>\r\n </ng-template>\r\n </app-table-search-bar>\r\n </ng-template>\r\n\r\n <ng-template #body>\r\n <div class="mb-12">\r\n <ng-container *ngIf="showActionBar">\r\n <ng-container *ngTemplateOutlet="actionBarTpl"></ng-container>\r\n </ng-container>\r\n </div>\r\n <ng-container *ngIf="customTableRender">\r\n <ng-container *ngTemplateOutlet="customTableRender"></ng-container>\r\n </ng-container>\r\n <nz-table\r\n *ngIf="!customTableRender"\r\n #dynamicTable\r\n nzSize="small"\r\n nzShowSizeChanger\r\n [nzBordered]="bordered"\r\n [nzOuterBordered]="outerBordered"\r\n [nzData]="dataSource"\r\n [nzPageIndex]="_pageInfo.pageIndex"\r\n [nzPageSize]="_pageInfo.pageSize"\r\n [nzTotal]="_pageInfo.total"\r\n [nzPageSizeOptions]="_pageInfo.pageSizeOptions"\r\n [nzShowPagination]="showPagination"\r\n [nzShowTotal]="totalTemplate"\r\n [nzLoading]="_loading"\r\n [nzFrontPagination]="frontPagination"\r\n [nzScroll]="scroll"\r\n (nzPageIndexChange)="handlePageIndexChange($event)"\r\n (nzPageSizeChange)="handlePageSizeChange($event)"\r\n >\r\n <thead>\r\n <tr>\r\n \x3c!-- 复选框列(当 showCheckbox=true 时显示) --\x3e\r\n <th\r\n *ngIf="showCheckbox"\r\n [nzWidth]="\'50px\'"\r\n [nzAlign]="\'center\'"\r\n style="text-align: center"\r\n [(nzChecked)]="_checkedAll"\r\n [nzIndeterminate]="_indeterminate"\r\n (nzCheckedChange)="toggleCheckAll($event)"\r\n (click)="$event.stopPropagation()"\r\n ></th>\r\n <th\r\n *ngFor="let column of _columns"\r\n [nzWidth]="column.width"\r\n [nzAlign]="column.align"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n [nzShowSort]="!!column.sorter"\r\n [nzSortOrder]="getSortOrder(column.prop)"\r\n (nzSortOrderChange)="onSortChange(column.prop, $event)"\r\n >\r\n {{ column.title }}\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <tr\r\n style="cursor: pointer"\r\n *ngFor="let data; let i = index; of: dynamicTable.data"\r\n [ngClass]="{\r\n \'ant-table-custom-row-selected\': !!getTableRowChecked(data),\r\n \'ant-table-custom-row-even\': i % 2 === 0,\r\n \'ant-table-custom-row-odd\': i % 2 !== 0\r\n }"\r\n (click)="handleTableRowClick(data)"\r\n (dblclick)="handleTableRowDbClick(data)"\r\n >\r\n \x3c!-- 复选框列(当 showCheckbox=true 时显示) --\x3e\r\n <td\r\n *ngIf="showCheckbox"\r\n [nzAlign]="\'center\'"\r\n style="text-align: center; width: 50px"\r\n [(nzChecked)]="data.checked"\r\n [nzDisabled]="isRowDisabled(data)"\r\n (nzCheckedChange)="handleRowCheckedChange(data, $event)"\r\n (click)="$event.stopPropagation()"\r\n ></td>\r\n <td\r\n *ngFor="let column of _columns"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n [nzAlign]="column.align"\r\n [ngClass]="{\r\n \'pro-ellipsis\': column.ellipsis,\r\n \'pro-nowrap\': true\r\n }"\r\n [title]="column.ellipsis ? data[column.prop] : null"\r\n >\r\n \x3c!-- 检查是否有自定义模板 --\x3e\r\n <ng-container\r\n *ngIf="\r\n column.customRender && getTemplate(column.customRender);\r\n let template\r\n "\r\n >\r\n <ng-template\r\n [ngTemplateOutlet]="template"\r\n [ngTemplateOutletContext]="{\r\n $implicit: data,\r\n data: data,\r\n column: column,\r\n index: i,\r\n pageInfo: _pageInfo\r\n }"\r\n >\r\n </ng-template>\r\n </ng-container>\r\n\r\n \x3c!-- 默认渲染逻辑 --\x3e\r\n <ng-container\r\n *ngIf="!column.customRender || !getTemplate(column.customRender)"\r\n >\r\n {{ data[column.prop] }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n <tr *ngIf="summaryData && _pageInfo.total > 0">\r\n \x3c!-- 汇总行的复选框列(当 showCheckbox=true 时显示,但为空) --\x3e\r\n <td\r\n *ngIf="showCheckbox"\r\n style="font-weight: bold; border-right: 1px solid #e8e8e8"\r\n ></td>\r\n <td\r\n *ngFor="let column; let i = index; of: _columns"\r\n [nzLeft]="column.fixedLeft"\r\n [nzRight]="column.fixedRight"\r\n style="font-weight: bold; border-right: 1px solid #e8e8e8"\r\n [nzAlign]="column.align"\r\n >\r\n <span *ngIf="i === 0">总计</span>\r\n <ng-container *ngIf="i !== 0 && column.summary">\r\n {{\r\n column.summary?.format\r\n ? column.summary?.format(\r\n summaryData[column.summary?.name || column.prop]\r\n )\r\n : summaryData[column.summary?.name || column.prop]\r\n }}\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <ng-template #totalTemplate let-total\r\n >共 {{ _pageInfo.total }} 条记录</ng-template\r\n >\r\n </nz-table>\r\n </ng-template>\r\n</app-page-container>\r\n',styles:[".pro-ellipsis{overflow:hidden;text-overflow:ellipsis}.pro-nowrap{white-space:nowrap}::ng-deep .setting-space-item{margin-right:0!important}::ng-deep .pro-table-checkboxgroup-nostyle{white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body table{border-collapse:separate;border-spacing:0}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important;white-space:nowrap}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:first-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:first-child{border-left:none!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-cell-fix-right,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-left,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th.ant-table-cell-fix-right{border-bottom:1px solid #e8e8e8!important;border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-header .ant-table-thead>tr>th{border-top:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr>td:last-child,::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-thead>tr>th:last-child{border-right:1px solid #e8e8e8!important}::ng-deep .ant-table-bordered .ant-table-container .ant-table-content .ant-table-body .ant-table-tbody>tr:last-child>td{border-bottom:1px solid #e8e8e8!important}::ng-deep .table-search-bar-left .ant-form-item{margin-bottom:8px}"]}]}],U.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[G]}]}]},U.propDecorators={showSearchBtn:[{type:t.Input}],showClearBtn:[{type:t.Input}],title:[{type:t.Input}],tableName:[{type:t.Input}],multiRow:[{type:t.Input}],columns:[{type:t.Input}],showSearchBar:[{type:t.Input}],showActionBar:[{type:t.Input}],confirmBtnText:[{type:t.Input}],clearBtnText:[{type:t.Input}],labelWidth:[{type:t.Input}],labelAlign:[{type:t.Input}],dataSource:[{type:t.Input}],bordered:[{type:t.Input}],outerBordered:[{type:t.Input}],showPagination:[{type:t.Input}],frontPagination:[{type:t.Input}],scroll:[{type:t.Input}],request:[{type:t.Input}],summaryData:[{type:t.Input}],sortMode:[{type:t.Input}],showColumnSetting:[{type:t.Input}],multipleSort:[{type:t.Input}],showCheckbox:[{type:t.Input}],rowDisabled:[{type:t.Input}],autoTriggerRequest:[{type:t.Input}],customTableRender:[{type:t.Input}],onRowClick:[{type:t.Output}],onRowDbClick:[{type:t.Output}],onValuesChange:[{type:t.Output}],onResetFormBeforeReload:[{type:t.Output}],actionBarTpl:[{type:t.ContentChild,args:["actionBar"]}],imgActionBarTpl:[{type:t.ContentChild,args:["ImgActionBar"]}],allTemplates:[{type:t.ContentChildren,args:[t.TemplateRef]}]};var $=function(){function e(){this.title="",this.showHeader=!0}return e.prototype.ngOnInit=function(){},e}();$.decorators=[{type:t.Component,args:[{selector:"app-page-container",template:'<nz-card\r\n [nzBorderless]="true"\r\n [nzBodyStyle]="{ padding: \'10px\', width: \'100%\' }"\r\n>\r\n <div class="page-container-title" *ngIf="title">{{ title }}</div>\r\n <div class="page-container-header" *ngIf="showHeader">\r\n <ng-container *ngTemplateOutlet="headerTpl"></ng-container>\r\n </div>\r\n <div class="page-container-body">\r\n <ng-container *ngTemplateOutlet="bodyTpl"></ng-container>\r\n </div>\r\n</nz-card>\r\n',styles:[".page-container-title{border-left:3px solid #096dd9;color:#1d1d1d;font-size:16px;margin-bottom:16px;padding-left:10px}.page-container-body,.page-container-header{box-sizing:border-box;padding:7px}"]}]}],$.ctorParameters=function(){return[]},$.propDecorators={title:[{type:t.Input}],showHeader:[{type:t.Input}],headerTpl:[{type:t.ContentChild,args:["header"]}],bodyTpl:[{type:t.ContentChild,args:["body"]}]};var Q=function(){};Q.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,S.NzCardModule,l.ReactiveFormsModule],declarations:[$],providers:[],exports:[$]}]}];var J=function(){function e(e,t,n){this.cdr=e,this.elementRef=t,this.platePrefixLoadService=n,this.nzPopoverVisible=!1,this.platePrefix="",this.plateSuffix="",this.platePrefixOptions=[],this.disabled=!1,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){var e=this;this.platePrefixLoadService?this.platePrefixLoadService.loadPrefixOptions().then((function(t){e.platePrefixOptions=t})).catch((function(){e.platePrefixOptions=[]})):this.platePrefixOptions=[]},e.prototype.handlePlatePrefix=function(e){this.platePrefix=e,this.emitValue(),this.nzPopoverVisible=!1,this.removeClickOutsideListener()},e.prototype.writeValue=function(e){e?(this.platePrefix=e.split("")[0],this.plateSuffix=e.split("").filter((function(e,t){return t>0})).join("")):(this.platePrefix="",this.plateSuffix="")},e.prototype.registerOnChange=function(e){this.onChange=e},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){var t=this.disabled;this.disabled=e,t!==e&&(this.nzPopoverVisible=!1,this.removeClickOutsideListener(),this.cdr.detectChanges())},e.prototype.handlePrefixClick=function(e){var t=this;if(this.disabled)return e.preventDefault(),e.stopPropagation(),void(this.nzPopoverVisible=!1);this.nzPopoverVisible=!this.nzPopoverVisible,this.nzPopoverVisible?setTimeout((function(){t.attachClickOutsideListener()}),0):this.removeClickOutsideListener(),e.stopPropagation()},e.prototype.attachClickOutsideListener=function(){var e=this;this.clickOutsideHandler||(this.clickOutsideHandler=function(t){var n=e.elementRef.nativeElement,r=t.target,o=document.querySelector(".plate-input-popover"),i=o&&o.contains(r);n.contains(r)||i||(e.nzPopoverVisible=!1,e.removeClickOutsideListener(),e.cdr.detectChanges())},document.addEventListener("click",this.clickOutsideHandler,!0))},e.prototype.removeClickOutsideListener=function(){this.clickOutsideHandler&&(document.removeEventListener("click",this.clickOutsideHandler,!0),this.clickOutsideHandler=void 0)},e.prototype.ngOnDestroy=function(){this.removeClickOutsideListener()},e.prototype.emitValue=function(){var e=this.platePrefix+this.plateSuffix;this.onChange(e)},e.prototype.onBlur=function(){this.onTouched()},e.prototype.handleAntdPlateSuffixBlur=function(e){if(!this.disabled){var t=e.target.value.toUpperCase();this.plateSuffix=t,this.emitValue()}},e}();J.decorators=[{type:t.Component,args:[{selector:"app-plate-input",template:'<div\r\n class="plate-antd-input-container"\r\n [class.plate-antd-input-disabled]="disabled"\r\n>\r\n <div\r\n class="plate-input-prefix"\r\n [class.plate-input-prefix-disabled]="disabled"\r\n nz-popover\r\n nzPopoverPlacement="bottom"\r\n nzPopoverOverlayClassName="plate-input-popover"\r\n [(nzPopoverVisible)]="nzPopoverVisible"\r\n [nzPopoverTrigger]="\'manual\'"\r\n [nzPopoverContent]="contentTemplate"\r\n (click)="handlePrefixClick($event)"\r\n >\r\n {{ platePrefix | uppercase }}\r\n <i\r\n class="plate-input-icon-down"\r\n [nzRotate]="nzPopoverVisible ? 180 : 0"\r\n nz-icon\r\n nzType="down"\r\n nzTheme="outline"\r\n ></i>\r\n </div>\r\n <ng-template #contentTemplate>\r\n <div nz-row style="height: 100%">\r\n <div\r\n nz-col\r\n nzSpan="4"\r\n *ngFor="let item of platePrefixOptions"\r\n class="plate-input-popover-item"\r\n (click)="!disabled && handlePlatePrefix(item.value)"\r\n [ngClass]="{\r\n \'plate-input-popover-item-active\': item.value === platePrefix,\r\n \'plate-input-popover-item-default\': item.value !== platePrefix\r\n }"\r\n >\r\n <div class="plate-input-popover-item-label">\r\n {{ item.label }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <input\r\n class="plate-input-suffix"\r\n type="text"\r\n nz-input\r\n style="width: 75%"\r\n [value]="plateSuffix | uppercase"\r\n [disabled]="disabled"\r\n (blur)="!disabled && handleAntdPlateSuffixBlur($event)"\r\n />\r\n</div>\r\n',providers:[{provide:l.NG_VALUE_ACCESSOR,useExisting:t.forwardRef((function(){return J})),multi:!0}],styles:['::ng-deep .plate-input-popover{box-sizing:border-box;padding:5px 0}::ng-deep .plate-input-popover .ant-popover-inner-content{height:264px;padding:0;width:387px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item{box-sizing:border-box;cursor:pointer;height:42px;padding:6px 12px}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item .plate-input-popover-item-label{align-items:center;border:1px solid #ccc;display:flex;height:100%;justify-content:center;width:100%}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-default:hover{background-color:#eaeaea}::ng-deep .plate-input-popover .ant-popover-inner-content .plate-input-popover-item-active{background-color:#096dd9;color:#fff}::ng-deep .plate-input-prefix:hover:after{background-color:transparent;content:"";height:100%;position:absolute;right:0;top:0;width:1px;z-index:2}::ng-deep .plate-antd-input-container{display:flex;flex-wrap:nowrap;width:100%}::ng-deep .plate-antd-input-container .plate-input-prefix{align-items:center;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;display:flex;justify-content:center;min-height:32px;position:relative;text-align:center;width:60px}::ng-deep .plate-antd-input-container .plate-input-prefix .plate-input-icon-down{font-size:10px;position:absolute;right:5px;top:50%;transform:translateY(-50%)}::ng-deep .plate-antd-input-container .plate-input-prefix:hover:not(.plate-input-prefix-disabled){border-color:#40a9ff}::ng-deep .plate-antd-input-container .plate-input-prefix-disabled{background-color:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}::ng-deep .plate-antd-input-container .plate-input-suffix{width:calc(100% - 60px)}']}]}],J.ctorParameters=function(){return[{type:t.ChangeDetectorRef},{type:t.ElementRef},{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[W]}]}]};var X=function(){};X.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,h.NzGridModule,m.NzInputModule,v.NzPopoverModule,f.NzIconModule],declarations:[J],providers:[],exports:[J]}]}];var Y=function(){function e(){this.leftColSpan=21,this.rightColSpan=3,this.labelWidth="90px",this.labelAlign="right"}return e.prototype.ngOnInit=function(){this.setCSSVariablesToTarget()},e.prototype.ngAfterViewInit=function(){this.setCSSVariablesToTarget()},e.prototype.setCSSVariablesToTarget=function(){},e}();Y.decorators=[{type:t.Component,args:[{selector:"app-table-search-bar",template:'<div class="table-search-bar">\r\n <div class="table-search-bar-left" style="--label-width: {{ labelWidth }}; --label-align: {{ labelAlign }};">\r\n <ng-container *ngTemplateOutlet="leftContentTpl"></ng-container>\r\n </div>\r\n <div class="table-search-bar-right">\r\n <nz-space nzDirection="vertical" nzAlign="end">\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet="actionTextBtnTpl"></ng-container>\r\n </nz-space-item>\r\n <nz-space-item>\r\n <ng-container *ngTemplateOutlet="actionImgBtnTpl"></ng-container>\r\n </nz-space-item>\r\n </nz-space>\r\n \x3c!-- <ng-container *ngTemplateOutlet="rightContentTpl"></ng-container> --\x3e\r\n </div>\r\n</div>\r\n',styles:['::ng-deep .table-search-bar{align-items:flex-start;display:flex;flex-wrap:wrap;gap:16px;width:100%}::ng-deep .table-search-bar-left{display:flex;flex:1;flex-wrap:wrap;gap:0 normal;min-width:0}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item{flex-shrink:0;flex-wrap:nowrap;width:250px}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label{flex-shrink:0;text-align:var(--label-align);width:var(--label-width)}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-form-item-label label:after{content:""}::ng-deep .table-search-bar-left ::ng-deep .ant-form-item .ant-picker{width:100%}::ng-deep .table-search-bar-right{align-items:flex-start;display:flex;flex-shrink:0}']}]}],Y.ctorParameters=function(){return[]},Y.propDecorators={leftColSpan:[{type:t.Input}],rightColSpan:[{type:t.Input}],labelWidth:[{type:t.Input}],labelAlign:[{type:t.Input}],leftContentTpl:[{type:t.ContentChild,args:["leftContent"]}],actionTextBtnTpl:[{type:t.ContentChild,args:["actionTextBtn"]}],actionImgBtnTpl:[{type:t.ContentChild,args:["actionImgBtn"]}]};var K=function(){};K.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,h.NzGridModule,l.ReactiveFormsModule,y.NzSpaceModule],declarations:[Y],providers:[],exports:[Y]}]}];var Z=function(){function e(e){this.columnRemote=e,this.columns=[],this.selectedColumns=[],this.afterConfirm=new t.EventEmitter,this.modalVisible=!1,this.options=[],this.sortableInstance=null}return e.prototype.ngOnInit=function(){},e.prototype.ngAfterViewInit=function(){this.initSortable()},e.prototype.ngOnDestroy=function(){this.sortableInstance&&this.sortableInstance.destroy()},e.prototype.initSortable=function(){var e=this;this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null),this.sortableContainer&&this.sortableContainer.nativeElement&&(this.sortableInstance=new A.default(this.sortableContainer.nativeElement,{animation:150,ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",handle:".sort-list-item",onEnd:function(t){e.onSortEnd(t)}}))},e.prototype.onSortEnd=function(e){var t=e.oldIndex,n=e.newIndex;if(t!==n){var r=j(this.selectedColumns),o=r.splice(t,1)[0];r.splice(n,0,o),this.selectedColumns=r}},e.prototype.trackByColumn=function(e,t){return t.prop||e.toString()},e.prototype.syncOptionsWithSelectedColumns=function(){var e=this.selectedColumns.map((function(e){return e.prop}));this.options.forEach((function(t){t.checked=e.includes(t.value)}))},e.prototype.handleModalVisible=function(){var e=this;this.options=this.columns.filter((function(e){return!e.auxiliaryColumn})).map((function(e){return{label:e.title,value:e.prop,checked:!e.hideInTable,sortName:e.sortName||null}})),this.syncOptionsWithSelectedColumns(),this.modalVisible=!0,setTimeout((function(){e.initSortable()}),100)},e.prototype.handleModalClose=function(){this.modalVisible=!1,this.sortableInstance&&(this.sortableInstance.destroy(),this.sortableInstance=null)},e.prototype.handleSelectRemove=function(e){this.selectedColumns=this.selectedColumns.filter((function(t){return t.prop!==e})),this.syncOptionsWithSelectedColumns()},e.prototype.handleCheckBoxChange=function(e,t){e?(this.selectedColumns.push({title:t.label,prop:t.value,sortName:t.sortName,hideInTable:!1}),this.syncOptionsWithSelectedColumns()):this.handleSelectRemove(t.value)},e.prototype.handleConfirm=function(){var e,t=this;if(!(null===(e=this.columnRemote)||void 0===e?void 0:e.setCol)||!this.tableName)return this.modalVisible=!1,void this.afterConfirm.emit();var n=this.selectedColumns.map((function(e){return{field:e.prop,isShow:!e.hideInTable,header:e.title,sortName:e.sortName||null}})),o=this.columnRemote.setCol(this.tableName,n),i=function(e){t.modalVisible=!1,t.afterConfirm.emit()};o&&r.isObservable(o)?o.subscribe(i,(function(){return i()})):Promise.resolve(o).finally((function(){return i()}))},e}();Z.decorators=[{type:t.Component,args:[{selector:"app-colmuns-setting",template:'<div class="action-pic-btn" (click)="handleModalVisible()" title="列设置">\r\n <i nz-icon nzType="setting" nzTheme="outline"></i>\r\n</div>\r\n\r\n<nz-modal\r\n [(nzVisible)]="modalVisible"\r\n [nzWidth]="820"\r\n [nzTitle]="modalTitle"\r\n (nzOnCancel)="handleModalClose()"\r\n [nzContent]="modalBody"\r\n [nzBodyStyle]="{ padding: \'12px\' }"\r\n (nzOnOk)="handleConfirm()"\r\n [nzWrapClassName]="\'draggable-modal\'"\r\n>\r\n <ng-template #modalTitle>\r\n <div\r\n class="modal-drag-handle"\r\n cdkDrag\r\n [cdkDragRootElement]="\'.draggable-modal .ant-modal\'"\r\n cdkDragHandle\r\n [cdkDragBoundary]="\'.draggable-modal\'"\r\n >\r\n <span>设置显示字段</span>\r\n </div>\r\n </ng-template>\r\n <ng-template #modalBody>\r\n <div class="modal-body">\r\n <div class="check-box-list">\r\n <div class="mb-12">可选字段</div>\r\n <nz-checkbox-wrapper style="width: 100%">\r\n <div nz-row [nzGutter]="[24, 24]">\r\n <div nz-col nzSpan="6" *ngFor="let item of options">\r\n <label\r\n nz-checkbox\r\n nzValue="item.value"\r\n [ngModel]="item.checked"\r\n (ngModelChange)="handleCheckBoxChange($event, item)"\r\n >{{ item.label }}</label\r\n >\r\n </div>\r\n </div>\r\n </nz-checkbox-wrapper>\r\n </div>\r\n <div class="sort-list">\r\n <div nz-typography class="mb-4">当前已经选定的字段</div>\r\n <div\r\n nz-typography\r\n nzType="secondary"\r\n class="mb-4"\r\n [style.fontSize]="\'12px\'"\r\n >\r\n 提示:可拖动排序\r\n </div>\r\n <div #sortableContainer class="sortable-container">\r\n <div\r\n class="sort-list-item mb-12"\r\n *ngFor="let item of selectedColumns; trackBy: trackByColumn"\r\n >\r\n {{ item.title }}\r\n <a\r\n href="javascript:void(0)"\r\n class="fieldd-remove"\r\n title="删除"\r\n (click)="handleSelectRemove(item.prop)"\r\n >×</a\r\n >\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</nz-modal>\r\n',styles:[".action-pic-btn{align-items:center;cursor:pointer;display:inline-flex;height:32px;justify-content:center;width:32px}.modal-body{display:flex;height:600px;width:100%}.modal-body .check-box-list{height:100%;width:calc(100% - 200px)}.modal-body .sort-list{border-left:1px solid #e3e3e3;box-sizing:border-box;height:100%;overflow-y:auto;padding-left:12px;padding-right:12px;width:200px}.modal-body .sort-list .sortable-container{min-height:100px}.modal-body .sort-list .sort-list-item{-moz-user-select:none;-webkit-user-select:none;align-items:center;cursor:move;display:flex;justify-content:space-between;user-select:none}.modal-body .sort-list .sort-list-item a{font-size:18px}.modal-drag-handle{-moz-user-select:none;-webkit-user-select:none;cursor:move;user-select:none;width:100%}"]}]}],Z.ctorParameters=function(){return[{type:void 0,decorators:[{type:t.Optional},{type:t.Inject,args:[G]}]}]},Z.propDecorators={columns:[{type:t.Input}],selectedColumns:[{type:t.Input}],tableName:[{type:t.Input}],afterConfirm:[{type:t.Output}],sortableContainer:[{type:t.ViewChild,args:["sortableContainer",{static:!1}]}]};var ee=function(){function e(e){this.cfr=e,this.component=null,this.props=null,this.valueChange=new t.EventEmitter,this.cmpRef=null,this.isCva=!1,this.cvaOnChange=null}return e.prototype.ngOnInit=function(){this.render()},e.prototype.ngOnChanges=function(e){if(e.component&&!e.component.firstChange)return this.destroy(),void this.render();this.cmpRef&&(e.value&&!e.value.firstChange&&(this.isCva?"function"==typeof this.cmpRef.instance.writeValue&&this.cmpRef.instance.writeValue(this.value):"value"in this.cmpRef.instance&&(this.cmpRef.instance.value=this.value)),e.props&&!e.props.firstChange&&this.applyProps())},e.prototype.render=function(){var e=this;if(this.component){var t=this.cfr.resolveComponentFactory(this.component);this.vc.clear(),this.cmpRef=this.vc.createComponent(t),this.isCva="function"==typeof this.cmpRef.instance.registerOnChange&&"function"==typeof this.cmpRef.instance.writeValue,this.isCva?(this.cmpRef.instance.writeValue(this.value),this.cmpRef.instance.registerOnChange((function(t){e.valueChange.emit(t)}))):("value"in this.cmpRef.instance&&(this.cmpRef.instance.value=this.value),"valueChange"in this.cmpRef.instance&&this.cmpRef.instance.valueChange&&"function"==typeof this.cmpRef.instance.valueChange.subscribe&&this.cmpRef.instance.valueChange.subscribe((function(t){e.valueChange.emit(t)}))),this.applyProps()}},e.prototype.applyProps=function(){var e=this,t=(this.props||{}).componentProps||{};Object.keys(t).forEach((function(n){try{e.cmpRef.instance[n]=t[n]}catch(e){}}))},e.prototype.destroy=function(){if(this.cmpRef){try{this.cmpRef.destroy()}catch(e){}this.cmpRef=null}},e.prototype.ngOnDestroy=function(){this.destroy()},e}();ee.decorators=[{type:t.Component,args:[{selector:"app-dynamic-search-field",template:"<ng-template #vc></ng-template>"}]}],ee.ctorParameters=function(){return[{type:t.ComponentFactoryResolver}]},ee.propDecorators={component:[{type:t.Input}],value:[{type:t.Input}],props:[{type:t.Input}],valueChange:[{type:t.Output}],vc:[{type:t.ViewChild,args:["vc",{read:t.ViewContainerRef,static:!0}]}]};var te=function(){};te.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule,l.FormsModule,a.HttpClientModule,s.RouterModule,p.NzFormModule,b.NzSelectModule,y.NzSpaceModule,h.NzGridModule,m.NzInputModule,l.ReactiveFormsModule,v.NzPopoverModule,f.NzIconModule,u.NzButtonModule,Q,K,C.NzTableModule,X,d.NzDatePickerModule,g.NzModalModule,c.NzCheckboxModule,w.NzTypographyModule,o.DragDropModule,c.NzCheckboxModule,z.NzAutocompleteModule,P.NzInputNumberModule,R.NzToolTipModule],declarations:[U,Z,ee],providers:[{provide:G,useValue:null}],exports:[U]}]}];var ne=function(){function e(e){this.http=e,this.defaultApiUrl="/PlateFirstWord/GetPlateFirstWord"}return e.prototype.loadPrefixOptions=function(){return this.http.post(this.defaultApiUrl,{dictCode:"PlateFirstWord"}).toPromise().then((function(e){var t=[];t.push({label:"",value:""});for(var n=0;n<e.length;n++)t.push({label:e[n],value:e[n]});return t})).catch((function(){return[]}))},e}();ne.decorators=[{type:t.Injectable}],ne.ctorParameters=function(){return[{type:a.HttpClient}]};var re=function(){function e(e){this.fb=e,this.formStore={},this.formModifyType="create",this.formRegisterStore={},this.labelWidth="120px",this.labelAlign="right",this.labelObservers={},this.errorMessageStore={},this.classPrefix="ant-form-",this.defaultErrorMessages={required:"该字段为必填项",minlength:"输入长度不足",maxlength:"输入长度超限",email:"请输入合法的邮箱地址",pattern:"输入格式不正确"}}return e.prototype.isFormGroupConfig=function(e){return"object"==typeof e&&null!==e&&"type"in e&&"group"===e.type},e.prototype.createNestedFormGroup=function(e,t){var n=this,r={};return Object.entries(e).forEach((function(e){var o,i,a,l,s,u=N(e,2),c=u[0],d=u[1];n.isFormGroupConfig(d)?r[c]=n.createNestedFormGroup(d.fields,null!==(o=d.disabled)&&void 0!==o?o:t):r[c]=[{value:d.value,disabled:null!==(a=null!==(i=d.disabled)&&void 0!==i?i:t)&&void 0!==a&&a},null!==(s=null===(l=d.validators)||void 0===l?void 0:l.call(d))&&void 0!==s?s:[]]})),this.fb.group(r)},e.prototype.createFormGroup=function(e,t,n){var r=this,o={};return this.errorMessageStore[e]={},Object.entries(t).forEach((function(t){var n,i,a,l=N(t,2),s=l[0],u=l[1];if(r.isFormGroupConfig(u)){var c=r.createNestedFormGroup(u.fields,u.disabled);o[s]=c,u.errorMessages&&(r.errorMessageStore[e][s]=u.errorMessages)}else o[s]=[{value:u.value,disabled:null!==(n=u.disabled)&&void 0!==n&&n},null!==(a=null===(i=u.validators)||void 0===i?void 0:i.call(u))&&void 0!==a?a:[]],u.errorMessages&&(r.errorMessageStore[e][s]=u.errorMessages)})),(null==n?void 0:n.labelWidth)&&(this.labelWidth=n.labelWidth),(null==n?void 0:n.labelAlign)&&(this.labelAlign=n.labelAlign),this.formStore[e]=this.fb.group(o),this.formRegisterStore[e]=!0,this.setCSSVariablesToTarget(e),this.formStore[e]},e.prototype.resetFormGroup=function(e,t){var n;null===(n=this.formStore[e])||void 0===n||n.reset(t)},e.prototype.isFormRegistered=function(e){var t;return null!==(t=this.formRegisterStore[e])&&void 0!==t&&t},e.prototype.destory=function(e){var t=this;e.forEach((function(e){t.errorMessageStore[e]&&delete t.errorMessageStore[e],t.formRegisterStore[e]&&delete t.formRegisterStore[e],t.formStore[e]&&delete t.formStore[e]}))},e.prototype.getNestedFormGroup=function(e,t){var n,r;if(!t||""===t.trim())return e;var o=t.split(".").filter((function(e){return""!==e.trim()})),i=e;try{for(var a=D(o),s=a.next();!s.done;s=a.next()){var u=s.value;if(!(i&&i instanceof l.FormGroup))return null;if(!((i=i.get(u))&&i instanceof l.FormGroup))return null}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i instanceof l.FormGroup?i:null},e.prototype.addFieldsConfig=function(e,t,n){var r,o=this,i={success:!0,added:[],failed:[]},a=this.formStore[e];if(!a)return Object.keys(t).forEach((function(t){var r,o='Form "'+e+'" not found';i.failed.push({fieldName:t,error:o}),null===(r=null==n?void 0:n.onFieldAdded)||void 0===r||r.call(n,t,!1,o)})),i.success=!1,i;var l=null==n?void 0:n.targetPath,s=l?this.getNestedFormGroup(a,l):a;if(!s)return Object.keys(t).forEach((function(e){var t,r=l?'Target FormGroup at path "'+l+'" not found':"FormGroup not found";i.failed.push({fieldName:e,error:r}),null===(t=null==n?void 0:n.onFieldAdded)||void 0===t||t.call(n,e,!1,r)})),i.success=!1,i;this.errorMessageStore[e]||(this.errorMessageStore[e]={});var u={},c={};return Object.entries(t).forEach((function(e){var t,r,a,d,p,h=N(e,2),f=h[0],m=h[1];try{if(s.get(f)){var g='Field "'+f+'" already exists'+(l?' in "'+l+'"':"");return i.failed.push({fieldName:f,error:g}),void(null===(t=null==n?void 0:n.onFieldAdded)||void 0===t||t.call(n,f,!1,g))}var v=void 0;if(o.isFormGroupConfig(m)){if(v=o.createNestedFormGroup(m.fields,m.disabled),m.errorMessages)c[l?l+"."+f:f]=m.errorMessages}else{var b={validators:null!==(a=null===(r=m.validators)||void 0===r?void 0:r.call(m))&&void 0!==a?a:[]};if(v=o.fb.control(m.value,b),m.disabled&&v.disable(),m.errorMessages)c[l?l+"."+f:f]=m.errorMessages}u[f]=v,i.added.push(f),null===(d=null==n?void 0:n.onFieldAdded)||void 0===d||d.call(n,f,!0)}catch(g){var y=(null==g?void 0:g.message)||(null==g?void 0:g.toString())||"Unknown error";i.failed.push({fieldName:f,error:y}),null===(p=null==n?void 0:n.onFieldAdded)||void 0===p||p.call(n,f,!1,y)}})),Object.keys(u).length>0&&(Object.entries(u).forEach((function(e){var t=N(e,2),n=t[0],r=t[1];s.addControl(n,r)})),Object.entries(c).forEach((function(t){var n=N(t,2),r=n[0],i=n[1];o.errorMessageStore[e][r]=i})),(null==n?void 0:n.updateValueAndValidity)&&s.updateValueAndValidity({emitEvent:null===(r=null==n?void 0:n.emitEvent)||void 0===r||r})),i.success=0===i.failed.length,i},e.prototype.removeFieldsConfig=function(e,t,n){var r=this,o={success:!0,removed:[],failed:[]},i=this.formStore[e];if(!i)return t.forEach((function(t){var r,i='Form "'+e+'" not found';o.failed.push({fieldName:t,error:i}),null===(r=null==n?void 0:n.onFieldRemoved)||void 0===r||r.call(n,t,!1,i)})),o.success=!1,o;var a=[],l=[];t.forEach((function(e){var t;if(!i.get(e)){var r='Field "'+e+'" not found';return o.failed.push({fieldName:e,error:r}),void(null===(t=null==n?void 0:n.onFieldRemoved)||void 0===t||t.call(n,e,!1,r))}l.push(e),a.push(e)}));try{a.forEach((function(e){var t;i.removeControl(e),o.removed.push(e),null===(t=null==n?void 0:n.onFieldRemoved)||void 0===t||t.call(n,e,!0)})),this.errorMessageStore[e]&&l.forEach((function(t){delete r.errorMessageStore[e][t]}))}catch(e){a.forEach((function(t){var r;if(!o.removed.includes(t)){var i=(null==e?void 0:e.message)||(null==e?void 0:e.toString())||"Failed to remove field";o.failed.push({fieldName:t,error:i}),null===(r=null==n?void 0:n.onFieldRemoved)||void 0===r||r.call(n,t,!1,i)}}))}return o.success=0===o.failed.length,o},e.prototype.patchFormValues=function(e,t,n){var r,o=this.formStore[e];o?o.patchValue(t,{emitEvent:null===(r=null==n?void 0:n.emitEvent)||void 0===r||r}):console.warn('[AntdFormService] patchFormValues: form "'+e+'" not found.')},e.prototype.validateForm=function(e,t){var n,r;if(this.formStore[e].valid){var o=this.formStore[e].getRawValue();return this.excludeInternalFields(o)}return this.markAllControlsAsDirty(this.formStore[e],null===(n=null==t?void 0:t.emitEvent)||void 0===n||n,null!==(r=null==t?void 0:t.onlySelf)&&void 0!==r&&r),!1},e.prototype.markAllControlsAsDirty=function(e,t,n){var r=this;e.invalid&&(e.markAsDirty(),e.updateValueAndValidity({emitEvent:t,onlySelf:n})),e instanceof l.FormGroup&&Object.values(e.controls).forEach((function(e){r.markAllControlsAsDirty(e,t,n)}))},e.prototype.getFieldErrorMessage=function(e,t){var n,r,o,i=this.formStore[e];if(!i)return console.warn('[AntdFormService] getFieldErrorMessage: form "'+e+'" not found.'),"";var a=i.get(t);if(!a)return console.warn('[AntdFormService] getFieldErrorMessage: control "'+t+'" not found in form "'+e+'".'),"";if(!a.errors)return"";var l=null===(o=this.errorMessageStore[e])||void 0===o?void 0:o[t],s=Object.assign(Object.assign({},this.defaultErrorMessages),null!=l?l:{});try{for(var u=D(Object.keys(a.errors)),c=u.next();!c.done;c=u.next()){var d=s[c.value];if(d)return"string"==typeof d?d:""}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return""},e.prototype.watchFormChanges=function(e,t,n){var r=this.formStore[e];if(r)return this.setupValueChangeSubscription(r,t,n);console.warn('[AntdFormService] watchFormChanges: form "'+e+'" not found.')},e.prototype.watchFieldChanges=function(e,t,n,r){var o=this.formStore[e];if(o){var i=o.get(t);if(i)return this.setupValueChangeSubscription(i,n,r);console.warn('[AntdFormService] watchFieldChanges: control "'+t+'" not found in form "'+e+'".')}else console.warn('[AntdFormService] watchFieldChanges: form "'+e+'" not found.')},e.prototype.getFormClassName=function(e){return""+this.classPrefix+e},e.prototype.setCSSVariablesToTarget=function(e){var t=this,n="."+this.getFormClassName(e)+" .ant-form-item-label",r="."+this.getFormClassName(e);if(!this.labelObservers[e]){var o=null,i=new MutationObserver((function(){cancelAnimationFrame(o),o=requestAnimationFrame((function(){setTimeout((function(){!function(){var e=document.querySelectorAll(n);if(!e.length)return!1;var r=0;e.forEach((function(e){var n=e;if(!n.closest(".pro-table-container")){var o=n.getAttribute("custom-width"),i=n.getAttribute("custom-align"),a=o||t.labelWidth,l=i||t.labelAlign;n.style.width===a&&n.style.textAlign===l||(n.style.width=a,n.style.textAlign=l,r++)}}))}()}),0)}))})),a=document.querySelector(r);i.observe(a||document.body,{childList:!0,subtree:!0,attributes:!0}),this.labelObservers[e]=i}},e.prototype.excludeInternalFields=function(e){var t=this;if(null==e)return e;if(Array.isArray(e))return e.map((function(e){return t.excludeInternalFields(e)}));if("object"!=typeof e)return e;var n={};return Object.entries(e).forEach((function(e){var r=N(e,2),o=r[0],i=r[1];o.startsWith("__")||(n[o]=t.excludeInternalFields(i))})),n},e.prototype.setupValueChangeSubscription=function(e,t,n){var r=e.valueChanges;return null!=(null==n?void 0:n.debounce)&&(r=r.pipe(I.debounceTime(n.debounce))),!1!==(null==n?void 0:n.distinctUntilChanged)&&(r=r.pipe(I.distinctUntilChanged())),(null==n?void 0:n.emitInitial)&&t(e.value),r.subscribe(t)},e}();re.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new re(_.ɵɵinject(O.FormBuilder))},token:re,providedIn:"root"}),re.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],re.ctorParameters=function(){return[{type:l.FormBuilder}]};var oe=function(){function e(){this.formStore={}}return e.prototype.cloneValue=function(e){var t,n,r=this;if(null==e)return e;if(Array.isArray(e))return e.map((function(e){return r.cloneValue(e)}));if("object"==typeof e){var o={};try{for(var i=D(Object.keys(e)),a=i.next();!a.done;a=i.next()){var l=a.value;o[l]=this.cloneValue(e[l])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return o}return e},e.prototype.isEqual=function(e,t){var n=this;if(e===t)return!0;if(null===e||null===t)return e===t;if(void 0===e||void 0===t)return e===t;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((function(e,r){return n.isEqual(e,t[r])}));if("object"==typeof e&&"object"==typeof t){var r=Object.keys(e),o=Object.keys(t);return r.length===o.length&&r.every((function(r){return n.isEqual(e[r],t[r])}))}return!1},e.prototype.createRowSnapshot=function(e,t){var n=this,r={};return t.forEach((function(t){r[t.name]=n.cloneValue(e[t.name])})),r},e.prototype.initializeData=function(e){var t=this;return e.map((function(e){return t.enrichRow(e)}))},e.prototype.enrichRow=function(e){return Object.assign(Object.assign({},e),{uid:e.uid||T.v4(),isEdit:void 0!==e.isEdit&&e.isEdit,disabled:void 0!==e.disabled&&e.disabled})},e.prototype.addRow=function(e,t){var n=Object.assign(Object.assign({},t),{uid:T.v4(),isEdit:!0,isAdd:!0,disabled:!1});return e.push(n),n},e.prototype.validateField=function(e,t,n){var r=n.fields.find((function(e){return e.name===t}));return r&&r.validator?r.validator(e[t],e,t):""},e.prototype.validateRow=function(e,t){var n=this,r={};return t.fields.forEach((function(o){r[o.name]=n.validateField(e,o.name,t)})),r},e.prototype.validateData=function(e,t){var n=this,r={};return e.forEach((function(e){r[e.uid]=n.validateRow(e,t)})),r},e.prototype.registerForm=function(e,t,n){var r=this,o=this.initializeData(t),i={};o.forEach((function(e){i[e.uid]=r.createRowSnapshot(e,n.fields)})),this.formStore[e]={data:o,config:n,validationResults:{},initialSnapshot:i,editingSnapshot:{},allTouched:!1,rowTouched:{}},this.autoUpdateArrayReference(e)},e.prototype.getForm=function(e){return this.formStore[e]},e.prototype.getFormData=function(e){var t=this.formStore[e];if(t)return t.data.map((function(e){return delete e.isEdit,delete e.isAdd,delete e.uid,delete e.disabled,e}))},e.prototype.addRowToForm=function(e,t){var n=this.formStore[e];if(n){var r=this.addRow(n.data,t);return n.initialSnapshot[r.uid]=this.createRowSnapshot(r,n.config.fields),this.autoUpdateArrayReference(e),r}},e.prototype.validateForm=function(e){var t,n,r,o,i=this.formStore[e];if(!i)return!0;i.allTouched=!0;var a=this.validateData(i.data,i.config);i.validationResults=a;try{for(var l=D(Object.keys(a)),s=l.next();!s.done;s=l.next()){var u=s.value;try{for(var c=(r=void 0,D(Object.keys(a[u]))),d=c.next();!d.done;d=c.next()){var p=d.value;if(a[u][p])return!1}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0},e.prototype.enableEdit=function(e,t){var n=this.formStore[e];n&&t.uid&&(n.editingSnapshot[t.uid]=this.createRowSnapshot(t,n.config.fields)),t.isEdit=!0},e.prototype.disableEdit=function(e,t){var n=this,r=this.formStore[e];if(r&&t.uid&&r.editingSnapshot[t.uid]){var o=r.editingSnapshot[t.uid];r.config.fields.forEach((function(e){t[e.name]=n.cloneValue(o[e.name])})),r.initialSnapshot[t.uid]=this.cloneValue(o),delete r.editingSnapshot[t.uid],delete r.rowTouched[t.uid],r.validationResults&&delete r.validationResults[t.uid]}t.isEdit=!1},e.prototype.confirmEdit=function(e,t){var n=this.formStore[e];n&&t.uid&&(n.editingSnapshot[t.uid]&&delete n.editingSnapshot[t.uid],n.initialSnapshot[t.uid]=this.createRowSnapshot(t,n.config.fields),delete n.rowTouched[t.uid]),t.isEdit=!1,t.isAdd=!1},e.prototype.deleteRowFromForm=function(e,t){var n=this.formStore[e];if(!n||!t.uid)return!1;var r=n.data.findIndex((function(e){return e.uid===t.uid}));return-1!==r&&(n.data.splice(r,1),delete n.initialSnapshot[t.uid],delete n.editingSnapshot[t.uid],delete n.rowTouched[t.uid],n.validationResults&&delete n.validationResults[t.uid],this.autoUpdateArrayReference(e),!0)},e.prototype.isFieldTouched=function(e,t,n){var r;if(e.allTouched)return!0;if(e.rowTouched[t.uid])return!0;var o=null===(r=e.initialSnapshot[t.uid])||void 0===r?void 0:r[n],i=t[n];return!this.isEqual(o,i)},e.prototype.validateFieldInRow=function(e,t,n){var r=this.formStore[e];if(!r)return"";var o=r.config.fields.find((function(e){return e.name===n}));if(!o)return"";var i="";return o.validator&&(i=o.validator(t[n],t,n)),r.validationResults||(r.validationResults={}),r.validationResults[t.uid]||(r.validationResults[t.uid]={}),r.validationResults[t.uid][n]=i,this.isFieldTouched(r,t,n)?i?"error":"success":""},e.prototype.getFieldErrorMessage=function(e,t,n){var r,o,i=this.formStore[e];return i&&t.uid&&this.isFieldTouched(i,t,n)&&(null===(o=null===(r=i.validationResults)||void 0===r?void 0:r[t.uid])||void 0===o?void 0:o[n])||""},e.prototype.validateRowAllFields=function(e,t){var n=this,r=this.formStore[e];if(!r||!t.uid)return!0;r.initialSnapshot[t.uid]=this.createRowSnapshot(t,r.config.fields),r.rowTouched[t.uid]=!0;var o=!1;return r.config.fields.forEach((function(r){"error"===n.validateFieldInRow(e,t,r.name)&&(o=!0)})),!o},e.prototype.autoUpdateArrayReference=function(e){var t=this.formStore[e];if(t&&t.config.targetObject&&t.config.arrayPropertyName){var n=t.data?j(t.data):[];t.config.targetObject[t.config.arrayPropertyName]=n}},e.prototype.hasEditingRow=function(e){var t=this.formStore[e];return!!t&&t.data.some((function(e){return e.isEdit}))},e.prototype.destory=function(e){var t=this;e.forEach((function(e){t.formStore[e]&&delete t.formStore[e]}))},e.prototype.resetFormArray=function(e){var t=this.formStore[e];t&&(t.data=[],t.initialSnapshot={},t.editingSnapshot={},t.validationResults={},t.allTouched=!1,t.rowTouched={},this.autoUpdateArrayReference(e))},e}();oe.ɵprov=_.ɵɵdefineInjectable({factory:function(){return new oe},token:oe,providedIn:"root"}),oe.decorators=[{type:t.Injectable,args:[{providedIn:"root"}]}],oe.ctorParameters=function(){return[]},e.AntdFormService=re,e.ArrayFormService=oe,e.DefaultPlatePrefixLoadService=ne,e.PLATE_PREFIX_LOAD_SERVICE=W,e.PRO_TABLE_COLUMN_REMOTE=G,e.PRO_TABLE_DEFAULT_COLUMN=H,e.PRO_TABLE_DEFAULT_PROPS=L,e.PageContainerModule=Q,e.PlateInputModule=X,e.ProTableComponent=U,e.ProTableModule=te,e.TableSearchBarModule=K,e["ɵ0"]=B,e["ɵ1"]=V,e["ɵ2"]=q,e["ɵa"]=$,e["ɵb"]=Y,e["ɵc"]=J,e["ɵd"]=Z,e["ɵe"]=ee,Object.defineProperty(e,"__esModule",{value:!0})}));
2
2
  //# sourceMappingURL=yibozhang-pro-table.umd.min.js.map