@baosight/er4j 0.1.28 → 0.1.29
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.
- package/er4j-dist/{ErAdvanceFilter-BXA8ThMy.js → ErAdvanceFilter-CktxlJpU.js} +2 -2
- package/er4j-dist/{ErAdvanceFilter-BXA8ThMy.js.map → ErAdvanceFilter-CktxlJpU.js.map} +1 -1
- package/er4j-dist/{ErLayoutDesign-dZllKKiy.js → ErLayoutDesign-CWGioPWo.js} +2 -2
- package/er4j-dist/{ErLayoutDesign-dZllKKiy.js.map → ErLayoutDesign-CWGioPWo.js.map} +1 -1
- package/er4j-dist/{ErPopAttachment-CVP-orhW.js → ErPopAttachment-BYk8l6ry.js} +2 -2
- package/er4j-dist/{ErPopAttachment-CVP-orhW.js.map → ErPopAttachment-BYk8l6ry.js.map} +1 -1
- package/er4j-dist/{ErPopForm-CBAFhaJa.js → ErPopForm-BCcNlduH.js} +2 -2
- package/er4j-dist/{ErPopForm-CBAFhaJa.js.map → ErPopForm-BCcNlduH.js.map} +1 -1
- package/er4j-dist/ErPopFree-6n2q-9wE.js +5 -0
- package/er4j-dist/ErPopFree-6n2q-9wE.js.map +1 -0
- package/er4j-dist/ErPopQuery-DfG5qZ-f.js +5 -0
- package/er4j-dist/ErPopQuery-DfG5qZ-f.js.map +1 -0
- package/er4j-dist/ErPopRichEditor-B6f0cEZy.js +5 -0
- package/er4j-dist/ErPopRichEditor-B6f0cEZy.js.map +1 -0
- package/er4j-dist/ErPopTree-D89uf-2A.js +5 -0
- package/er4j-dist/ErPopTree-D89uf-2A.js.map +1 -0
- package/er4j-dist/{ErPopWindow-lc1cu33J.js → ErPopWindow-D8U-_Ak_.js} +2 -2
- package/er4j-dist/{ErPopWindow-lc1cu33J.js.map → ErPopWindow-D8U-_Ak_.js.map} +1 -1
- package/er4j-dist/er4j.es.js +1 -1
- package/er4j-dist/er4j.umd.js +1 -1
- package/er4j-dist/er4j.umd.js.map +1 -1
- package/er4j-dist/{index-C7g5czhs.js → index-V_nUapgz.js} +15 -23
- package/er4j-dist/{index-C7g5czhs.js.map → index-V_nUapgz.js.map} +1 -1
- package/package.json +1 -1
- package/er4j-dist/ErPopFree-ClLSY7JN.js +0 -5
- package/er4j-dist/ErPopFree-ClLSY7JN.js.map +0 -1
- package/er4j-dist/ErPopQuery-BCrJL6FO.js +0 -5
- package/er4j-dist/ErPopQuery-BCrJL6FO.js.map +0 -1
- package/er4j-dist/ErPopRichEditor-8O4rgwvL.js +0 -5
- package/er4j-dist/ErPopRichEditor-8O4rgwvL.js.map +0 -1
- package/er4j-dist/ErPopTree-h3MF45nA.js +0 -5
- package/er4j-dist/ErPopTree-h3MF45nA.js.map +0 -1
package/er4j-dist/er4j.umd.js
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
<span ref="eSortAsc" class="ag-header-icon ag-header-label-icon ag-sort-ascending-icon" aria-hidden="true"></span>
|
|
69
69
|
<span ref="eSortDesc" class="ag-header-icon ag-header-label-icon ag-sort-descending-icon" aria-hidden="true"></span>
|
|
70
70
|
<span ref="eSortNone" class="ag-header-icon ag-header-label-icon ag-sort-none-icon" aria-hidden="true"></span>`:"")+`</div>
|
|
71
|
-
</div>`}static checkGridRow(e,t,n=!0){var i,o,a,s;(i=e==null?void 0:e.gridOptions)!=null&&i.api&&t!==void 0&&t!==null&&(typeof t=="string"&&t.trim().length>0?t=[t]:t.uid&&(t=[G.toString(t.uid)]),t instanceof Array&&t.length>0?t.forEach(c=>{const d=e.gridOptions.api.getRowNode(c);d&&d.setSelected(n===!0)}):typeof t=="number"&&t>=0&&((s=(a=(o=e.gridOptions.api)==null?void 0:o.getModel())==null?void 0:a.getRow(t))==null||s.setSelected(n===!0)))}static checkGridCurrentRow(e){if(e){const t=cr.getGridCurrentRow(e);t&&cr.checkGridRow(e,t)}}static checkAllGridRow(e,t=!0){var n;if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const i=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(i&&i.visible){const o=(a,s)=>{a.setSelected(!0)};t?e.gridOptions.api.forEachNodeAfterFilterAndSort(o):e.gridOptions.api.forEachLeafNode(o)}}}static unCheckAllGridRow(e,t=!0){var n;if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const i=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(i&&i.visible){const o=(a,s)=>{a.setSelected(!1)};t?e.gridOptions.api.forEachNodeAfterFilterAndSort(o):e.gridOptions.api.forEachLeafNode(o)}}}static isGridRowChecked(e,t){var n,i;if((n=e==null?void 0:e.gridOptions)!=null&&n.api&&t){const o=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(o&&o.visible)return(i=e.gridOptions.api.getRowNode(t instanceof qr?t.uid:t))==null?void 0:i.isSelected()}}static setGridFocusedCell(e,t=0,n,i){var o,a,s,c;if((o=e==null?void 0:e.gridOptions)!=null&&o.api){const d=e.gridOptions.api;if(d.clearRangeSelection(),d.getDisplayedRowCount()>0){if(t=t||0,d.ensureIndexVisible(t),n)d.ensureColumnVisible(n),d.setFocusedCell(t,n,i);else if(((s=(a=e.gridOptions.api.columnModel)==null?void 0:a.gridColumns)==null?void 0:s.length)>0){for(let u=0;u<e.gridOptions.api.columnModel.gridColumns.length;u++)if((c=e.gridOptions.api.columnModel.gridColumns[u])!=null&&c.visible){d.ensureColumnVisible(e.gridOptions.api.columnModel.gridColumns[u]),d.setFocusedCell(t,e.gridOptions.api.columnModel.gridColumns[u],i);break}}}}}static validateGridInput(e,t,n,i=!1,o=!0){var c,d,u;n=n||"ChangedRows";let a=!0,s=!1;if((c=e==null?void 0:e.gridOptions)!=null&&c.api){const f=e.gridOptions.api,h=(u=(d=e.gridOptions)==null?void 0:d.context)==null?void 0:u.columnsConfig,p=[];if(i instanceof Array&&i.length>0?i.forEach(m=>{m.trim().length>0&&p.push({ITEM_CODE:m.trim(),FIELD_NAME:m.trim(),CONDITION_TABLE:"",MUST_INPUT_CONDITION:""})}):(s=i===!0,h==null||h.forEach(g=>{g.UNBOUND_TYPE==="0"&&g.ITEM_MUST_FLAG==="1"&&p.push(g)})),p.length>0)if(f.setFilterModel(null),n==="CheckedRows"){const g=f.getSelectedNodes();for(let m=0;m<g.length;m++)if(a=this.validateGridRowInput(f,g[m],p,t,s,o),!a)return a}else if(n==="AllRows"){const g=f.getModel().getRowCount();for(let m=0;m<g;m++){const _=f.getModel().getRow(m);if(_!=null&&_.data&&(a=this.validateGridRowInput(f,_,p,t,s,o),!a))return a}}else{const g=cr.getGridCreatedRows(e),m=cr.getGridModifyRows(e),_=[...g,...m];for(let T=0;T<_.length;T++){const x=f.getModel().getRowNode(_[T].uid);if(x!=null&&x.data&&(a=this.validateGridRowInput(f,x,p,t,s,o),!a))return a}}}return a}static setGridColumnEditable(e,t,...n){var i,o;if((i=e==null?void 0:e.gridOptions)!=null&&i.api){const a=(o=e.gridOptions.api.columnModel)==null?void 0:o.gridColumns;if(n.length===1&&(n=n[0].split(",")),(a==null?void 0:a.length)>0){const s=e.gridOptions.api.getEditingCells();let c="";s.forEach(d=>{var u;c=((u=d.column)==null?void 0:u.getId())||""}),a.forEach(d=>{var u;d.colId!==nt.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(d.colId))&&(d.context=d.context||{},d.context.editable=t,d.colId===c&&t===!1&&e.gridOptions.api.stopEditing(),(d.colDef.cellEditor==="agCheckboxCellEditor"||d.colDef.cellEditType==="switchEditor")&&((u=e==null?void 0:e.gridOptions)==null||u.api.refreshCells({force:!0,columns:[d]})))})}}}static getGridCellRenderText(e,t,n,i){var s,c,d,u;let o="";const a=this.getGridColumnDef(e,t);return a!=null&&a.context&&(a.context.cellEditType==="dateEditor"?o=G.getDateTimeFormatString(n,i||((s=a.context.columnConfig)==null?void 0:s.FORMAT_STRING)):a.context.cellEditType==="numberEditor"?o=G.formatNumberValue(n,i||((c=a.context.columnConfig)==null?void 0:c.FORMAT_STRING)):a.refData&&((d=a.context)==null?void 0:d.cellEditType)==="checkGridLookUpEdit"&&a.context.valueField!==a.context.textField?G.toString(n).trim().split(",").forEach(h=>{const p=a.refData[h]||h;o=o.length===0?p:o+","+p}):((u=a.context)==null?void 0:u.cellEditType)==="gridLookUpEdit"?o=a.refData[n]||n:o=G.toString(n)),o}static validateGridRowInput(e,t,n,i,o=!1,a=!0){var c,d,u;if(e&&((c=t==null?void 0:t.data)!=null&&c.uid))for(let f=0;f<n.length;f++){const h=n[f].ITEM_CODE,p=n[f].FIELD_NAME,g=n[f].CONDITION_TABLE;let m={};G.toString(n[f].EXT_OPTIONS).trim().length>0&&(m=JSON.parse(G.toString(n[f].EXT_OPTIONS)));const _=m.requireCondition||n[f].MUST_INPUT_CONDITION,T=e.getColumnDef(h);if(T&&(!T.visible||!o))if(_.trim().length===0){if(t.rowIndex&&(t==null?void 0:t.data[p])===void 0||(t==null?void 0:t.data[p])===null||G.toString(t==null?void 0:t.data[p]).trim().length===0||((d=T.context)==null?void 0:d.dataType)==="number"&&(t==null?void 0:t.data[p])===0)return a&&(e.ensureNodeVisible(t,"top"),e.ensureColumnVisible(T.colId,"auto"),e.clearRangeSelection(),e.setFocusedCell(t.rowIndex||0,T.colId),e.startEditingCell({rowIndex:t.rowIndex||0,colKey:T.colId}),l.nextTick(()=>{e.getCellEditorInstances({columns:[T],rowNodes:[t]}).forEach(E=>{E.editorType,E.setBorder?E.setBorder("2px solid red"):E.setInvalid&&E.setInvalid()})}),G.messageWarning(G.$t("ERX.InputEmptyMessage"))),!1}else{let x=t==null?void 0:t.data;if(g.trim().length>0&&(i!=null&&i.contains(g.trim()))&&(x=i==null?void 0:i.getCurrentDataObject(g.trim())),x&&x instanceof qr&&G.checkExpressionValid(x,G.getSystemFormatString(_))&&((t==null?void 0:t.data[p])===void 0||(t==null?void 0:t.data[p])===null||G.toString(t==null?void 0:t.data[p]).trim().length===0||((u=T.context)==null?void 0:u.dataType)==="number"&&(t==null?void 0:t.data[p])===0))return a&&(e.ensureNodeVisible(t,"top"),e.ensureColumnVisible(T.colId,"auto"),e.clearRangeSelection(),e.setFocusedCell(t.rowIndex||0,T.colId),e.startEditingCell({rowIndex:t.rowIndex||0,colKey:T.colId}),G.messageWarning(G.$t("ERX.InputEmptyMessage"))),!1}}return!0}static setGridRowData(e,t,n,i=!1){var o;if((o=e==null?void 0:e.gridOptions)!=null&&o.api&&t&&n){n instanceof qr&&(n=n.toJSON());const a=e.gridOptions.api;if(t instanceof qr&&(t=t.uid),typeof t=="string"&&t.trim().length>0){const s=a.getModel().getRowNode(t.trim());s&&s.data&&(Object.keys(n).forEach(c=>{var d,u;if(!["isNew","uid","dirty","dirtyFields","_events","_schemaFields","_preview_row_data","_children_data"].includes(c)&&typeof n[c]!="function"&&((d=s.data.schemaFields)!=null&&d[c])&&(G.toString(s.data[c]).trim().length===0||i===!1)){const f=a.getColumnDef(c);f?f.cellEditor==="agCheckboxCellEditor"?s.setDataValue(c,n[c]===!0||n[c]==="1"):Zr.isPlainObject(f.cellEditor)&&((u=f.cellEditor)==null?void 0:u.name)==="DatetimeEditor"?G.toString(n[c]).trim().length===0?s.setDataValue(c,null):s.setDataValue(c,G.getDateTimeByString(n[c])):s.setDataValue(c,n[c]):s.data[c]=n[c]}}),a.refreshCells({columns:[nt.GridCheckColumnFieldName],rowNodes:[s]}))}}}static setGridCurrentRowData(e,t,n=!1){const i=cr.getGridCurrentRow(e);i&&cr.setGridRowData(e,i,t,n)}static setGridRowState(e,t,n){var i,o,a,s;if((i=e==null?void 0:e.gridOptions)!=null&&i.api&&t){const c=e.gridOptions.api;if(t instanceof qr&&(t=t.uid),typeof t=="string"&&t.trim().length>0){const d=c.getModel().getRowNode(t.trim());if(d&&((o=d.data)!=null&&o.uid)){const u=(s=(a=e.gridOptions)==null?void 0:a.context)==null?void 0:s.bindingSource;u&&u.setRowState(d.data,n)}}}}static getGridBindingTable(e){var t,n;return(n=(t=e.gridOptions)==null?void 0:t.context)==null?void 0:n.bindingSource}static getGridColumn(e,t){var i,o,a,s;let n;if(t=G.toString(t,!0),(i=e==null?void 0:e.gridOptions)!=null&&i.api&&((o=e==null?void 0:e.gridOptions)!=null&&o.columnApi))if(t.length>0){const c=(a=e==null?void 0:e.gridOptions)==null?void 0:a.columnApi.getColumns();for(let d=0;d<c.length;d++)if(c[d].colId===t||c[d].field===t){n=c[d];break}}else{const c=(s=e==null?void 0:e.gridOptions)==null?void 0:s.api.getFocusedCell();c&&(n=c.Column)}return n}static getGridColumnDef(e,t){let n;const i=this.getGridColumn(e,t);return i!=null&&i.colDef&&(n=i.colDef),n}static async deleteGridRows(e,t=!1,n){var i,o,a,s,c,d,u,f,h,p;if((i=e==null?void 0:e.gridOptions)!=null&&i.api){const g=n||this.getGridRows(e,"select");if((g==null?void 0:g.length)>0){let m=!0;if(t&&(m=await G.messageConfirm(G.$t("ERX.RemoveConfirmMessage")||"是否确认删除?")),m){if((o=e==null?void 0:e.gridOptions)!=null&&o.treeData){const _=[];(s=(a=e==null?void 0:e.gridOptions)==null?void 0:a.api)==null||s.forEachNode(T=>{for(let x=0;x<g.length;x++)g[x][nt.TreeHierarchyFieldName].every(E=>new Set(T.data[nt.TreeHierarchyFieldName]).has(E))&&_.push(T.data)}),(u=(d=(c=e==null?void 0:e.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource)==null||u.remove(_)}else(p=(h=(f=e==null?void 0:e.gridOptions)==null?void 0:f.context)==null?void 0:h.bindingSource)==null||p.remove(g);return!0}}}return!1}static getGridSelectRows(e,t=!1,n=!1){return this.getGridRows(e,"select",t,n)}static getGridCurrentRow(e,t=!1,n=!1){let i;const o=this.getGridRows(e,"current",t,n);return o.length>0&&(i=o[0]),i}static getGridCheckedRows(e,t=!1,n=!1){return this.getGridRows(e,"checked",t,n)}static getGridCheckedAfterFilterRows(e,t=!1,n=!1){return this.getGridRows(e,"checkedAfterFilter",t,n)}static getGridDeletedRows(e,t=!1,n=!1){return this.getGridRows(e,"delete",t,n)}static getGridModifyRows(e,t=!1,n=!1){return this.getGridRows(e,"modify",t,n)}static getGridCreatedRows(e,t=!1,n=!1){return this.getGridRows(e,"add",t,n)}static getGridAllRows(e,t=!1,n=!1){return this.getGridRows(e,"all",t,n)}static getGridRows(e,t,n=!1,i=!1){var c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B;let o=[],a,s;if(e!=null&&e.api&&(e!=null&&e.columnApi)?(a=e.api,s=e.columnApi):(a=(c=e==null?void 0:e.gridOptions)==null?void 0:c.api,s=(d=e==null?void 0:e.gridOptions)==null?void 0:d.columnApi),a&&t&&t.toString().length>0){switch(t){case"current":{const O=a.getFocusedCell();if(O){const M=(f=(u=a.getModel())==null?void 0:u.getRow(O.rowIndex))==null?void 0:f.data;M&&(n instanceof Function?o.push(n(M)||M.toJSON()):o.push(n?M.toJSON():M))}break}case"checked":{a.forEachLeafNode(O=>{var M;(M=O.data)!=null&&M.uid&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"addWithChecked":{a.forEachLeafNode(O=>{var M,R;(M=O.data)!=null&&M.uid&&((R=O.data)!=null&&R.isNew)&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"modifyWithChecked":{a.forEachLeafNode(O=>{var M,R;(M=O.data)!=null&&M.uid&&((R=O.data)!=null&&R.isDirty)&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"checkedAfterFilter":{a.forEachNodeAfterFilter(O=>{var M;(M=O.data)!=null&&M.uid&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"select":if(e!=null&&e.gridOptions){const O=this.getGridColumn(e,nt.GridCheckColumnFieldName);return O&&!O.hide&&((h=e==null?void 0:e.gridOptions.context)==null?void 0:h.viewConfig.SHOW_SELECTION)==="1"?this.getGridRows(e,"checked",n,i):this.getGridRows(e,"current",n,i)}break;case"delete":if((g=(p=e==null?void 0:e.gridOptions)==null?void 0:p.context)!=null&&g.bindingSource){const O=(_=(m=e==null?void 0:e.gridOptions)==null?void 0:m.context)==null?void 0:_.bindingSource;o=O==null?void 0:O.getRows("removed",n)}break;case"modify":if((x=(T=e==null?void 0:e.gridOptions)==null?void 0:T.context)!=null&&x.bindingSource){const O=(D=(E=e==null?void 0:e.gridOptions)==null?void 0:E.context)==null?void 0:D.bindingSource;o=O==null?void 0:O.getRows("updated",n)}break;case"add":if((P=(k=e==null?void 0:e.gridOptions)==null?void 0:k.context)!=null&&P.bindingSource){const O=(S=(b=e==null?void 0:e.gridOptions)==null?void 0:b.context)==null?void 0:S.bindingSource;o=O==null?void 0:O.getRows("created",n)}break;case"all":if((I=(w=e==null?void 0:e.gridOptions)==null?void 0:w.context)!=null&&I.bindingSource){const O=(A=(v=e==null?void 0:e.gridOptions)==null?void 0:v.context)==null?void 0:A.bindingSource;o=O==null?void 0:O.getRows("all",n)}break;case"allAfterFilter":a.forEachNodeAfterFilterAndSort(O=>{var M;(M=O.data)!=null&&M.uid&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}if(s&&i&&(o==null?void 0:o.length)>0){const O=((B=s.getAllGridColumns())==null?void 0:B.map(M=>{var R;return(R=M.colDef)==null?void 0:R.field}))||[];o=o.map(M=>(Object.keys(M).forEach(R=>{O.includes(R)||delete M[R]}),M))}}return o}static getGridChangedRowsAsDataMap(e,t,n,i=!1,o){var d,u,f;n=n||new rt,t=t||((f=(u=(d=e==null?void 0:e.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource)==null?void 0:f.tableName)||"Table0";const a=this.getGridRows(e,"delete",o??!0,i);a.length>0&&n.addMapData(t+"_DELETE",a);const s=this.getGridRows(e,"modify",o??!0,i);s.length>0&&n.addMapData(t+"_MODIFY",s);const c=this.getGridRows(e,"add",o??!0,i);return c.length>0&&n.addMapData(t+"_ADD",c),n}static mergeGridDataRow(e,t,n=!1,i=!1){if(e&&t){t instanceof qr&&(t=t.toJSON());const o=Object.keys(e.toJSON()),a=Object.keys(t);(o==null?void 0:o.length)>0&&(a==null?void 0:a.length)>0&&(o.length>a.length?a:o).forEach(c=>{var d;(d=e.schemaFields)!=null&&d[c]&&t[c]!==void 0&&String(e[c]).trim()!==String(t[c]).trim()&&(i||typeof e[c]=="number"||typeof t[c]=="number"||!n||G.toString(t[c],!0).length===0)&&e.set(c,t[c])})}return e}static clearGridData(e){var t,n,i,o,a;if((t=e==null?void 0:e.gridOptions)!=null&&t.api&&((i=(n=e==null?void 0:e.gridOptions)==null?void 0:n.context)!=null&&i.bindingSource)){const s=(a=(o=e==null?void 0:e.gridOptions)==null?void 0:o.context)==null?void 0:a.bindingSource;s==null||s.clear()}return this}static mergeDataToDataTable(e,t,n=!0){var o,a,s,c,d;let i=-1;if(t&&t instanceof Cn){let u=[];e instanceof Array?u=e:((o=e.sys)==null?void 0:o.status)>=0?((a=t.tableName)==null?void 0:a.trim().length)>0&&e.contains(t.tableName.trim())?u=e.getBlock(t.tableName.trim()).data:u=e.getBlock(0).data:e.data instanceof Array?u=e.data:e.getStatus instanceof Function&&e.getStatus()>=0?u=((c=e.getBlock(((s=t.tableName)==null?void 0:s.trim())??"result"))==null?void 0:c.getMappedRows())??e.getBlockByIndex(0).getMappedRows():e.getMappedRows instanceof Function?u=e.getMappedRows():e.getMapData instanceof Function&&(u=e.getMapData(((d=t.tableName)==null?void 0:d.trim())??"result")??e.getMapData()),u?u instanceof Array?(t.merge(u,n),i=t.totalCount()):console.error("ER: Data is not EiInfo、EiBlock、ER.Model or Array"):console.error("ER: Data is undefined")}else console.error("ER: DataTable is undefined");return i}static mergeDataToGrid(e,t,n=!0){var o,a,s,c,d;let i=0;if(e&&((o=t==null?void 0:t.gridOptions)!=null&&o.api)&&((s=(a=t==null?void 0:t.gridOptions)==null?void 0:a.context)!=null&&s.bindingSource)){const u=(d=(c=t==null?void 0:t.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource;u&&e&&(i=this.mergeDataToDataTable(e,u,n))}return i}static mergeEiBlockToGrid(e,t,n=!0){return this.mergeDataToGrid(e.data,t,n)}static setGridData(e,t,n=!1,i){let o=0;if(e){const a=[];let s=[];if(n){if(t.data instanceof Array&&t.getBlockMeta instanceof Function)s=t.data||[],t.getBlockMeta().forEach(c=>{c.name.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c.name,colId:c.name,field:c.name,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{showTooltips:!0,suppressFilterCounts:!1,excelMode:i==null?void 0:i.excelMode}})}),e.setColumnDefs(a);else if(t.getBlockMeta instanceof Function&&t.getMappedRows instanceof Function){s=t.getMappedRows()||[];const c=t.getBlockMeta().getMetas();for(const d in c)d.toUpperCase()!==nt.IdFieldName&&a.push({headerName:d,colId:d,field:d,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{excelMode:"windows"}});e.setColumnDefs(a)}else t instanceof rt?(s=t.getMapData()||[],t.getMeta().forEach(c=>{c.name.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c.name,colId:c.name,width:100,field:c.name,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{showTooltips:!0,suppressFilterCounts:!1,excelMode:i==null?void 0:i.excelMode}})}),e.setColumnDefs(a)):t instanceof Array&&(s=t||[],Object.keys(t[0]).forEach(c=>{c.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c,colId:c,field:c,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{excelMode:"windows"}})}));i!=null&&i.showRowNo&&a.unshift({colId:nt.GridCheckColumnFieldName,pinned:i!=null&&i.IsRtl?"right":"left",headerName:"",width:55,suppressColumnsToolPanel:!0,suppressSizeToFit:!0,suppressMenu:!0,resizable:!0,sortable:!1,suppressMovable:!0,lockPosition:i!=null&&i.IsRtl?"right":"left",cellRenderer:c=>{var d;return c.node.footer||c.node.group?"":((d=c.node)==null?void 0:d.childIndex)+1}}),e.setColumnDefs(a)}e.setRowData(s),o=s.length}return o}static importExcelFile(e,t,n,i){var o,a;((a=(o=e==null?void 0:e.gridOptions)==null?void 0:o.context)==null?void 0:a.bindingSource)instanceof Cn&&G.readExcelFile(s=>{var c,d,u;if(s.length>0){const f={},h={},p=(c=e==null?void 0:e.gridOptions)==null?void 0:c.columnApi.getColumns(),g=(u=(d=e==null?void 0:e.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource,m={},_=(x,E)=>{var D,k,P;if(x==null)return"";if(m[E.field]=m[E.field]||{},m[x])return m[x];if((D=E.refData)!=null&&D[x])return x;{if(G.toString(x).includes("|")){const S=x.split("|");if((k=E.refData)!=null&&k[S[0]])return S[0]}else if(G.toString(x).includes("-")){const S=x.split("-");if((P=E.refData)!=null&&P[S[0]])return S[0]}const b=Object.keys(E.refData).find(S=>E.refData[S]===G.toString(x)||E.refData[S]===`${S}|${G.toString(x)}`||E.refData[S]===`${S}-${G.toString(x)}`);return b?(m[E.field][x]=b,b):""}},T=[];s.forEach(x=>{if(x.__EMPTY!==(G.$t("ERX.Aggregate")||"总计")&&x.__EMPTY!==(G.$t("ERX.GroupAggregate")||"小计")){Object.keys(x).forEach(D=>{var k,P;if(D&&!D.startsWith("__EMPTY")&&!h[D])for(let b=0;b<p.length;b++){const S=p[b].getColDef(),w=(k=S.headerName)==null?void 0:k.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim(),I=D.replace(/<br\s*\/?>/gi,"").replace(/\s+/g,"").trim();if((w===I||S.field===I)&&S.field&&((P=g.options.schema)!=null&&P[S.field])){f[S.field]={dataKey:D,colDef:S},h[D]=S;break}}});const E={};Object.keys(f).forEach(D=>{var k,P;x[f[D].dataKey]&&(E[f[D].colDef.field]=x[f[D].dataKey],f[D].colDef.refData&&((k=f[D].colDef.cellEditor)==null?void 0:k.name)==="DropdownEditor"?E[f[D].colDef.field]=_(E[f[D].colDef.field],f[D].colDef):((P=f[D].colDef.cellEditor)==null?void 0:P.name)==="DatetimeEditor"&&(E[f[D].colDef.field]=G.getDateTimeByString(E[f[D].colDef.field])))}),t&&t instanceof Function?t(E)&&T.push(E):T.push(E)}}),n&&n instanceof Function?n(T):g.import(T)}})}static exportGridToExcel(e,t,n){var c,d;let i=u=>{var h,p,g;this.setGridColumnOptions(e,m=>{var _,T,x,E,D;m.colId===nt.GridCheckColumnFieldName||(m.cellDataType==="number"?m.cellClass=u!=null&&u.numberAsText?"right-cell-string":"right-cell":((_=m.context)==null?void 0:_.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0&&(((T=m.context.columnConfig)==null?void 0:T.FORMAT_STRING)==="yyyy-MM-dd"||((x=m.context.columnConfig)==null?void 0:x.FORMAT_STRING)==="yyyy/MM/dd"?m.cellClass="date-cell":m.cellClass="datetime-cell")),((E=n==null?void 0:n.excelStyleConfig)==null?void 0:E.length)>0&&((D=n==null?void 0:n.excelStyleConfig)==null||D.forEach(k=>{(k.columnNames.length===0||m.colId&&k.columnNames.includes(m.colId.toUpperCase()))&&(m.cellClassRules=m.cellClassRules||{},u!=null&&u.includeCellStyle?!k.condition||k.condition.trim().length===0||k.condition.trim().replaceAll(" ","")==="1=1"?m.cellClassRules[k.id]=P=>{var b;return((b=P.data)==null?void 0:b.uid)&&!0}:m.cellClassRules[k.id]=P=>{var b;return((b=P.data)==null?void 0:b.uid)&&G.checkExpressionValid(P.data,G.getSystemFormatString(k.condition))}:delete m.cellClassRules[k.id])}))});let f;((h=u==null?void 0:u.contentTitle)==null?void 0:h.trim().length)>0&&(f=[{cells:[{data:{value:(p=u==null?void 0:u.contentTitle)==null?void 0:p.trim(),type:"String"},styleId:"title",mergeAcross:(((g=n==null?void 0:n.columnKeys)==null?void 0:g.length)||1)-1}],height:50}]),e==null||e.exportDataAsExcel({fileName:(u==null?void 0:u.fileName)||"grid.xlsx",sheetName:(u==null?void 0:u.sheetName)||"Sheet1",author:nt.UserId,skipPinnedBottom:!0,onlySelected:u==null?void 0:u.selectedRows,skipRowGroups:u==null?void 0:u.skipGroupRows,skipColumnGroupHeaders:u==null?void 0:u.skipBandRows,columnKeys:n==null?void 0:n.columnKeys,processHeaderCallback:m=>{var _,T;return((T=(_=m.column.colDef)==null?void 0:_.headerName)==null?void 0:T.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:m=>!!(u!=null&&u.skipSummaryRows&&m.node.footer===!0&&m.node.group===!0&&m.node.level>=0||u!=null&&u.skipFooterRows&&m.node.footer===!0&&m.node.group===!0&&m.node.level<0),prependContent:(n==null?void 0:n.prependContent)??f,appendContent:n==null?void 0:n.appendContent,processCellCallback:m=>{var x,E,D,k,P,b,S,w,I,v,A,B,O,M,R,H,V,N,W,j,U;const _=G.toString(m.value).includes("->")?" -> ":"",T=G.toString(m.value).replace(_,"").trimStart();return(E=(x=m.column.colDef)==null?void 0:x.context)!=null&&E.hideContent||m.value&&Zr.isPlainObject(m.value)&&m.formatValue instanceof Function?m.formatValue(m.value):m.node.group&&m.node.footer!==!0?(D=m.column.colDef)!=null&&D.rowGroup&&m.node.key?((k=m.column.colDef.refData)==null?void 0:k[m.node.key])||m.node.key:((b=(P=m.column.colDef)==null?void 0:P.context)==null?void 0:b.dataType)==="number"?u!=null&&u.numberAsText?m.formatValue(m.value):m.value:_+(((I=(w=(S=m.node.rowGroupColumn)==null?void 0:S.colDef)==null?void 0:w.refData)==null?void 0:I[T])||m.formatValue(T)||T):((A=(v=m.column.colDef)==null?void 0:v.context)==null?void 0:A.dataType)==="number"?u!=null&&u.numberAsText?m.formatValue(m.value):m.value:((O=(B=m.column.colDef)==null?void 0:B.context)==null?void 0:O.dataType)==="boolean"?m.value?"R":"£":((R=(M=m.column.colDef)==null?void 0:M.context)==null?void 0:R.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0?m.value?((N=(V=(H=m.column.colDef)==null?void 0:H.context)==null?void 0:V.columnConfig)==null?void 0:N.FORMAT_STRING)==="yyyy-MM-dd"||((U=(j=(W=m.column.colDef)==null?void 0:W.context)==null?void 0:j.columnConfig)==null?void 0:U.FORMAT_STRING)==="yyyy/MM/dd"?G.getDateTimeByString(m.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):G.getDateTimeByString(m.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":m.formatValue(m.value)||m.value}})};const o=[],a=[{label:G.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"},{label:G.$t("ERX.ErGrid.ExportOptionsDateAsText")||"日期以文本格式导出",value:"dateAsText"}],s=[{key:"fileName",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsFileName")||"文件名称",required:!0},{key:"sheetName",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsSheetName")||"Sheet名称",required:!0},{key:"contentTitle",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsContentTitle")||"内容标题",required:!1}];n!=null&&n.isCheckedRows&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),n!=null&&n.isBandView&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),t.getRowGroupColumns().length>0&&(a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"}),(n==null?void 0:n.skipGroupRows)!==!1&&o.push("skipGroupRows"),(n==null?void 0:n.skipSummaryRows)!==!1&&o.push("skipSummaryRows")),n!=null&&n.isShowFooter&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),((c=n==null?void 0:n.excelStyleConfig)==null?void 0:c.length)>0&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsIncludeCellStyle")||"包含样式",value:"includeCellStyle"}),n!=null&&n.dateAsText&&o.push("dateAsText"),n!=null&&n.numberAsText&&o.push("numberAsText"),n!=null&&n.skipFooterRows&&o.push("skipFooterRows"),n!=null&&n.includeCellStyle&&o.push("includeCellStyle"),G.openSelectOptionsModal({title:G.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:e.getDisplayedRowCount()>0?a:[],inputOptions:s,default:{checkboxOptions:o,inputOptions:{fileName:n==null?void 0:n.fileName,sheetName:(n==null?void 0:n.sheetName)||"Sheet1",contentTitle:((d=n==null?void 0:n.contentTitle)==null?void 0:d.trim())||""}}},u=>{var f;i({fileName:u.inputs.fileName||(n==null?void 0:n.fileName),sheetName:u.inputs.sheetName||"Sheet1",contentTitle:((f=u.inputs.contentTitle)==null?void 0:f.trim())||"",selectedRows:u.checkboxes.some(h=>h==="selectedRows"),numberAsText:u.checkboxes.some(h=>h==="numberAsText"),dateAsText:u.checkboxes.some(h=>h==="dateAsText"),skipBandRows:u.checkboxes.some(h=>h==="skipBandRows"),skipGroupRows:u.checkboxes.some(h=>h==="skipGroupRows"),skipSummaryRows:u.checkboxes.some(h=>h==="skipSummaryRows"),skipFooterRows:u.checkboxes.some(h=>h==="skipFooterRows"),includeCellStyle:u.checkboxes.some(h=>h==="includeCellStyle")}),i=void 0})}static exportMuiltiGridToExcel(e,t){let n=0;const i=[];e.forEach(o=>{const{gridApi:a,sheetName:s}=o;this.setGridColumnOptions(o.gridApi,d=>{var u,f,h;d.cellDataType==="number"?d.cellClass=t!=null&&t.numberAsText?"right-cell-string":"right-cell":((u=d.context)==null?void 0:u.dataType)==="datetime"&&(t==null?void 0:t.dateAsText)!==!0&&(((f=d.context.columnConfig)==null?void 0:f.FORMAT_STRING)==="yyyy-MM-dd"||((h=d.context.columnConfig)==null?void 0:h.FORMAT_STRING)==="yyyy/MM/dd"?d.cellClass="date-cell":d.cellClass="datetime-cell")});const c=a==null?void 0:a.getSheetDataForExcel({sheetName:s||`Sheet${n+1}`,author:nt.UserId,skipPinnedBottom:!0,onlySelected:t==null?void 0:t.isCheckedRows,skipRowGroups:t==null?void 0:t.skipGroupRows,skipColumnGroupHeaders:t==null?void 0:t.skipBandRows,processHeaderCallback:d=>{var u,f;return((f=(u=d.column.colDef)==null?void 0:u.headerName)==null?void 0:f.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:d=>!!(t!=null&&t.skipSummaryRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level>=0||t!=null&&t.skipFooterRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level<0),processCellCallback:d=>{var h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B,O;const u=G.toString(d.value).includes("->")?" -> ":"",f=G.toString(d.value).replace(u,"").trimStart();return d.value&&Zr.isPlainObject(d.value)&&d.formatValue instanceof Function?d.formatValue(d.value):d.node.group&&d.node.footer!==!0?(h=d.column.colDef)!=null&&h.rowGroup&&d.node.key?((p=d.column.colDef.refData)==null?void 0:p[d.node.key])||d.node.key:((m=(g=d.column.colDef)==null?void 0:g.context)==null?void 0:m.dataType)==="number"?t!=null&&t.numberAsText?d.formatValue(d.value):d.value:u+(((x=(T=(_=d.node.rowGroupColumn)==null?void 0:_.colDef)==null?void 0:T.refData)==null?void 0:x[f])||d.formatValue(f)||f):((D=(E=d.column.colDef)==null?void 0:E.context)==null?void 0:D.dataType)==="number"?t!=null&&t.numberAsText?d.formatValue(d.value):d.value:((P=(k=d.column.colDef)==null?void 0:k.context)==null?void 0:P.dataType)==="boolean"?d.value?"R":"£":((S=(b=d.column.colDef)==null?void 0:b.context)==null?void 0:S.dataType)==="datetime"&&(t==null?void 0:t.dateAsText)!==!0?d.value?((v=(I=(w=d.column.colDef)==null?void 0:w.context)==null?void 0:I.columnConfig)==null?void 0:v.FORMAT_STRING)==="yyyy-MM-dd"||((O=(B=(A=d.column.colDef)==null?void 0:A.context)==null?void 0:B.columnConfig)==null?void 0:O.FORMAT_STRING)==="yyyy/MM/dd"?G.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):G.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":d.formatValue(d.value)||d.value}});i.push(c)}),i.length>0&&e[0].gridApi.exportMultipleSheetsAsExcel({data:i,fileName:(t==null?void 0:t.fileName)||"grid.xlsx"})}static setGridColumnOptions(e,t){if(e&&t instanceof Function){const n=o=>{var a;((a=o==null?void 0:o.children)==null?void 0:a.length)>0&&o.children.forEach(s=>{n(s)}),t(o)},i=e.getColumnDefs();i&&(i==null||i.forEach(o=>{n(o)}),e.setColumnDefs(i))}}}class Bn{static async callService(e,t,n){return new Promise((i,o)=>{var d,u;const a=(n==null?void 0:n.messageError)??!1;let s=new nr.EiInfo;e.trim().length===0&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="No service available",i(s));const c=e.split(/[\/.]/).filter(f=>f.trim().length>0);c.length<2&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="Service name error",i(s)),(d=n==null?void 0:n.loadingOptions)!=null&&d.show&&G.loading(!0,((u=n==null?void 0:n.loadingOptions)==null?void 0:u.delay)||0,n==null?void 0:n.loadingOptions),n!=null&&n.toCamelCase&&Object.keys(t.getBlocks()).forEach(f=>{const h=t.getBlock(f),p=h.getBlockMeta().getMetas(),g=new nr.EiBlockMeta(h.getBlockId());Object.keys(p).forEach(m=>{const _=new nr.EiColumn(G.camelCase(m));_.descName=p[m].name,_.type=p[m].type,g.addMeta(_)}),h.setBlockMeta(g)}),nr.EiCommunicator.send(c[0],c[1],t,{onSuccess:f=>{G.loading(!1),s=f,s.getStatus()<0&&a&&G.messageError(`service:${e}, sys.msg:${s.getMsg()}`,a==="modal"),i(s)},onFail:f=>{G.loading(!1),a&&G.messageError(`service:${e}, sys.msg:${String(f)}`,a==="modal"),console.error(f),s.SysInfo.Flag=-603,s.SysInfo.Msg=f==null?void 0:f.message,i(s)}})})}static async callServiceEx(e,t,n){return new Promise(async(i,o)=>{const a=t.toEiInfo(),s=await this.callService(e,a,n),c=rt.getInstance().mergeFromEiInfo(s);i(c)})}}let Cn=(Xl=class extends id{constructor(t){super();vn(this,qn);vn(this,Pt,[]);vn(this,ki,[]);vn(this,ti,[]);vn(this,Ji,[]);vn(this,$i,{});vn(this,al,{});vn(this,_n);vn(this,vi);vn(this,Ql,!1);vn(this,Ys);vn(this,nn,[]);vn(this,mo,{});vn(this,Ws,{});fe(this,"tableName","");this.tableName="Table0",t=t||{schema:{}},this.init(t)}get options(){return ze(this,_n)}get isCloned(){return ze(this,Ql)}get BingdingInfo(){return ze(this,nn)}get rowCount(){return ze(this,Pt).length}get Current(){return ze(this,vi)}get IsHierarchyTable(){var t,n,i,o;return G.toString((n=(t=ze(this,_n))==null?void 0:t.hierarchy)==null?void 0:n.parentField,!0).length>0&&G.toString((o=(i=ze(this,_n))==null?void 0:i.hierarchy)==null?void 0:o.primaryField,!0).length>0}setInitialValuesForEdit(t,n){var i;t!=null&&t.uid&&n&&n.trim().length>0&&((i=ze(this,al)[t.uid])==null?void 0:i[n])===void 0&&(ze(this,al)[t.uid]=ze(this,al)[t.uid]??{},ze(this,al)[t.uid][n]=t[n])}getInitialValuesForEdit(t,n){var o;let i="";if(typeof t=="string"?i=t:i=(t==null?void 0:t.uid)||"",i&&n&&n.trim().length>0)return(o=ze(this,al)[i])==null?void 0:o[n]}init(t){t&&(gr(this,_n,t),gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,vi,void 0),Ai(this,qn,uf).call(this))}clone(t){const n=new Xl({...ze(this,_n)});return n.tableName=t||this.tableName,n}setBindingInfo(t,n,i,o){var a;t&&n&&n.trim().length>0&&!ze(this,nn).some(s=>{var c;return((c=s.formHelper)==null?void 0:c.FormId)===t.FormId&&s.configId===n})?ze(this,nn).push({formHelper:t,configId:n,dataTable:this,controlType:i}):(a=o==null?void 0:o.gridOptions)!=null&&a.api&&!ze(this,nn).some(s=>s.grid.gridId===o.gridId)&&(o.gridOptions.api.getBindingTable=()=>this,o.gridOptions.getRowId=s=>s.data.uid,o.gridOptions.api.addEventListener("cellFocused",s=>{var c;if(s.api.getBindingTable){const d=s.api.getBindingTable(),u=s.api.getModel().getRow(s.rowIndex),f=((c=s==null?void 0:s.context)==null?void 0:c.focusRowId)||"";u!=null&&u.id&&u.id!==f&&(d.setCurrent(u.data,o.gridId),o.gridOptions.context=o.gridOptions.context||{},o.gridOptions.context.focusRowId=u.id,o.gridOptions.context.focusColId=s.column.colId)}}),o.gridOptions.api.addEventListener("rowDataUpdated",s=>{if(s.api.getBindingTable){const c=s.api.getBindingTable();(c.rowsCount=0)&&(o.gridOptions.context=s.context||{},o.gridOptions.context.focusRowId="",o.gridOptions.context.focusColId="")}}),o.gridOptions.api.addEventListener("cellValueChanged",s=>{s.api.getBindingTable&&s.data&&s.colDef&&s.colDef.field&&(s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0)}),ze(this,nn).push({grid:o,dataTable:this,configId:o.gridId,controlType:i}))}removeBindingInfo(t,n,i){var o,a,s;for(let c=ze(this,nn).length-1;c>=0;c--)ze(this,nn)[c].configId===n&&((a=(o=ze(this,nn)[c])==null?void 0:o.formHelper)==null?void 0:a.FormId)===(t==null?void 0:t.FormId)?ze(this,nn).splice(c,1):(s=i==null?void 0:i.gridOptions)!=null&&s.api&&ze(this,nn)[c].grid.gridId===i.gridId&&(i.gridOptions.getBindingTable&&delete i.gridOptions.getBindingTable,i.gridOptions.getRowId=void 0,ze(this,nn).splice(c,1))}setEvent(t,n){t&&(ze(this,Ws)[t]=n)}getEvent(t){return ze(this,Ws)[t]}setAllowCancelChanges(t){return gr(this,Ys,t),this}addField(...t){if(t&&t.length>0&&(t.forEach(n=>{n.name&&ze(this,_n).schema&&ze(this,_n).schema[n.name]===void 0&&(ze(this,_n).schema[n.name]=n)}),ze(this,Pt).length>0))for(let n=0;n<ze(this,Pt).length;n++)ze(this,Pt)[n].addField(...t);return this}removeField(...t){if(t&&t.length>0&&(t.forEach(n=>{n.name&&ze(this,_n).schema&&ze(this,_n).schema[n.name]===void 0&&delete ze(this,_n).schema[n.name]}),ze(this,Pt).length>0))for(let n=0;n<ze(this,Pt).length;n++)ze(this,Pt)[n].reomveField(...t);return this}setField(t,n){var i,o;if((t==null?void 0:t.trim().length)>0&&((o=(i=ze(this,_n))==null?void 0:i.schema)!=null&&o[t.trim()])&&n){const a=ze(this,_n).schema[t.trim()];ze(this,_n).schema[t.trim()]={...a,...n}}return this}get(t){for(let n=0;n<ze(this,Pt).length;n++)if(ze(this,Pt)[n].uid===t)return ze(this,Pt)[n]}getRows(t,n=!1){const i=[],o=a=>{n instanceof Function?i.push(n(a)||a.toJSON()):i.push(n?a.toJSON():a)};switch(t){case"created":{ze(this,ti).forEach(a=>{o(a)});break}case"updated":{ze(this,Pt).forEach(a=>{a.dirty&&!a.isNew&&o(a)});break}case"removed":{ze(this,Ji).forEach(a=>{o(a)});break}case"unchanged":{ze(this,Pt).forEach(a=>{!a.dirty&&!a.isNew&&o(a)});break}case"original":{ze(this,ki).forEach(a=>{!a.dirty&&!a.isNew&&o(a)});break}case"all":{ze(this,Pt).forEach(a=>{o(a)});break}}return i}at(t){return ze(this,Pt).at(t)}indexOf(t){var n;if(((n=t==null?void 0:t.uid)==null?void 0:n.length)>0){for(let i=0;i<ze(this,Pt).length;i++)if(ze(this,Pt)[i].uid===t.uid)return i}return-1}setCurrent(t,n){var s;const i={},o=((s=ze(this,vi))==null?void 0:s.uid)||"",a=(t==null?void 0:t.uid)||"";i.bindingInfo=ze(this,nn),i.oldCurrent=ze(this,vi),i.current=t,i.source=n,gr(this,vi,t),o!==a&&Ai(this,qn,Eo).call(this,"currentChanged",i)}insert(t,n,i){let o;return n&&(o=new qr(n,ze(this,_n).schema,this),i&&i.trim().length>0&&o[i]!==void 0&&(o[i]=G.guid()),o.isNew=!0,ze(this,Pt).splice(t,0,o),ze(this,ti).push(o),ze(this,mo)[o.uid]=o,Ai(this,qn,Eo).call(this,"dataInserted",{bindingInfo:ze(this,nn),insertAt:t,current:o}),this.setCurrent(o)),o}add(t,n){const i=new qr(t,ze(this,_n).schema,this);return n&&n.trim().length>0&&i[n]!==void 0&&(i[n]=G.guid()),i.isNew=!0,ze(this,Pt).push(i),ze(this,ti).push(i),ze(this,mo)[i.uid]=i,Ai(this,qn,Eo).call(this,"dataAdded",{bindingInfo:ze(this,nn),current:i}),this.setCurrent(i),i}import(t,n=-1,i=!0,o){const a=[];return(t==null?void 0:t.length)>0&&(t.forEach(s=>{if(s!=null){s instanceof qr&&(s=s.toJSON());const c=new qr(s,ze(this,_n).schema,this);o&&o.trim().length>0&&c[o]!==void 0&&(c[o]=G.guid()),c.isNew=i,a.push(c),ze(this,mo)[c.uid]=c}}),n<0?ze(this,Pt).push(...a):ze(this,Pt).splice(n,0,...a),ze(this,ti).push(...a),Ai(this,qn,Eo).call(this,"dataImported",{bindingInfo:ze(this,nn),models:a,insertAt:n,current:a[t.length-1]}),this.setCurrent(a[t.length-1])),a}remove(t){if(!t)return;let n=[];t instanceof Array&&t.length>0?n=t:t&&(n=[t]);let i=!1;const o=[];if(n.length>0){let a=-1,s=-1;if(n.forEach(c=>{var d;if(a=ze(this,Pt).findIndex(u=>u.uid===c.uid),(s<0||a<s)&&(s=a),a!==-1){if(i||(i=ze(this,Pt)[a].uid===((d=ze(this,vi))==null?void 0:d.uid)),ze(this,Pt)[a].isNew){const u=ze(this,ti).indexOf(ze(this,Pt)[a]);u>=0&&ze(this,ti).splice(u,1)}else ze(this,Ji).push(ze(this,Pt)[a]),ze(this,$i)[ze(this,Pt)[a].uid]=ze(this,Ji).length-1;o.push(ze(this,Pt)[a]),ze(this,Pt).splice(a,1),delete ze(this,mo)[c.uid]}}),o.length>0&&Ai(this,qn,Eo).call(this,"dataRemoved",{bindingInfo:ze(this,nn),models:o}),i){let c;ze(this,Pt).length>0&&(ze(this,Pt).length===s?c=ze(this,Pt)[s-1]:c=ze(this,Pt)[s]),this.setCurrent(c)}}}setRowState(t,n){let i=this.indexOf(t);if(i<0&&(ze(this,Pt).push(t),i=ze(this,Pt).length-1),i>=0){ze(this,Pt)[i].dirty=n==="updated",ze(this,Pt)[i].isNew=n==="added",n==="unchanged"&&(ze(this,Pt)[i].dirtyFields={},ze(this,$i)[t.uid]!==void 0&&(delete ze(this,$i)[t.uid],ze(this,Ji).splice(ze(this,$i)[t.uid],1)));const o=ze(this,ti).findIndex(a=>a.uid===t.uid);n==="added"&&o<0?ze(this,ti).push(t):o>=0&&ze(this,ti).splice(o,1),Ai(this,qn,Eo).call(this,"rowStateChanged",{bindingInfo:ze(this,nn),model:ze(this,Pt)[i],state:n})}}clear(){return gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,vi,void 0),gr(this,mo,{}),Ai(this,qn,Eo).call(this,"dataCleared",{bindingInfo:ze(this,nn)}),this}isRemoved(t){return typeof ze(this,$i)[t]=="number"}merge(t,n=!0,i=!1){var s,c,d,u,f;const o=[],a=ze(this,Pt).length>0;if(n&&(gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,mo,{})),t!==void 0&&t.length>0&&((s=this.options)!=null&&s.schema)){const h=this.options.schema,p=Object.keys(t[0]),g=Object.keys(h);console.log("dataFields",p),console.log("schemaFields",g);const m=g.filter(k=>p.includes(k)||p.includes(G.camelCase(k)));g.forEach(k=>{console.log("field",k,G.camelCase(k))});const _=g.filter(k=>!p.includes(k)&&!p.includes(G.camelCase(k)));console.log("existFields",m),console.log("notExistFields",_);const T=new Map,x=G.toString((d=(c=ze(this,_n))==null?void 0:c.hierarchy)==null?void 0:d.primaryField,!0),E=G.toString((f=(u=ze(this,_n))==null?void 0:u.hierarchy)==null?void 0:f.parentField,!0),D=x.length>0&&E.length>0&&h[x]&&h[E];for(let k=0;k<t.length;k++){const P=new qr(void 0,void 0,this);P.setSchema(h,!1),m.forEach(b=>{var S,w,I;switch(console.log("field",b,t[k][b],t[k][G.camelCase(b)]),h[b].type){case"datetime":case"time":P[b]=G.toDateTime(t[k][b]??G.toDateTime(t[k][G.camelCase(b)],"Dayjs"));break;case"boolean":P[b]=G.toBoolean(t[k][b]??G.toBoolean(t[k][G.camelCase(b)]));break;case"number":P[b]=G.toNumber(t[k][b]??G.toNumber(t[k][G.camelCase(b)]));break;case"string":h[b].RGBA?((S=t[k][b])==null?void 0:S.trim().length)>0?P[b]=G.toHexColor(((w=t[k][b])==null?void 0:w.trim())??G.toHexColor((I=t[k][G.camelCase(b)])==null?void 0:I.trim())):P[b]="#ffffff":P[b]=G.toString(t[k][b]??G.toString(t[k][G.camelCase(b)],!0));break;default:P[b]=t[k][b]??t[k][G.camelCase(b)];break}}),_.forEach(b=>{switch(h[b].type){case"datetime":case"time":P[b]=null;break;case"boolean":P[b]=!1;break;case"number":P[b]=0;break;case"string":P[b]="";break;default:P[b]=null;break}}),P.isNew=i,o.push(P),ze(this,Pt).push(P),ze(this,mo)[P.uid]=P,D&&P[x]&&T.set(P[x],P)}if(D){const k=P=>{const b=[];for(;P;)b.unshift(P[x]),P=T.get(P[E]);return b};for(let P=0;P<ze(this,Pt).length;P++)ze(this,Pt)[P][nt.TreeHierarchyFieldName]=k(ze(this,Pt)[P])}Ai(this,qn,uf).call(this),gr(this,vi,ze(this,Pt)[0]),Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:o,current:ze(this,Pt)[0]})}else gr(this,vi,void 0),a&&Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:o,current:void 0});return o}hasChanges(){if(ze(this,Ji).length)return!0;for(let t=0;t<ze(this,Pt).length;t++)if(ze(this,Pt)[t].isNew||ze(this,Pt)[t].dirty)return!0;return!1}acceptChanges(){return gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),ze(this,Pt).forEach(t=>{t.isNew=!1,t.dirty=!1,t.dirtyFields={}}),Ai(this,qn,uf).call(this),Ai(this,qn,Eo).call(this,"acceptChanges",{bindingInfo:ze(this,nn),models:ze(this,Pt),current:void 0}),this}cancelChanges(){return ze(this,Ql)&&(gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,mo,{}),gr(this,Pt,Zr.cloneDeep(ze(this,ki))),ze(this,Pt).forEach(t=>{ze(this,mo)[t.uid]=t}),Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:ze(this,Pt),current:void 0})),this}totalCount(){return ze(this,Pt).length}data(t){return t!==void 0&&t.length>0&&this.merge(t,!0,!1),ze(this,Pt)}originalCopy(){return Zr.cloneDeep(ze(this,ki))}originalModel(t){for(let n=0;n<ze(this,ki).length;n++)if(ze(this,ki)[n].uid===t)return Zr.cloneDeep(ze(this,ki)[n])}static convertDataType(t,n,i,o="all"){var a,s,c;if(o=o||"all",t&&t.length>0&&n&&n.options.schema){const d=n.options.schema,u=Object.keys(t[0]),f=[],h=[],p=[],g={};for(const m of u)((a=d[m])==null?void 0:a.type)==="boolean"&&(o==="all"||o==="boolean")?f.push(m):((s=d[m])==null?void 0:s.type)==="datetime"&&(o==="all"||o==="datetime")?h.push(m):((c=d[m])==null?void 0:c.type)==="number"&&typeof t[0][m]!="number"&&p.push(m);i==="strongly"&&Object.keys(d).forEach(m=>{t[0][m]===void 0&&(d[m].type==="datetime"?g[m]=null:d[m].type==="boolean"?g[m]=d[m].default?d[m].default:!1:d[m].type==="number"?g[m]=G.toNumber(d[m].default):g[m]="")});for(let m=0;m<t.length;m++){t[m]instanceof qr&&(t[m]=t[m].toJSON());for(const _ of f)if(i==="weakly")t[m][_]=t[m][_]?"1":"0";else{const T=G.toString(t[m][_],!0,"toLower");t[m][_]=T.length>0&&T!=="0"&&T!=="false"}for(const _ of h)G.toString(t[m][_],!0).length>0?i==="weakly"?(t[m][_]=G.getDateTimeFormatString(t[m][_],"yyyyMMddHHmmss"),(t[m][_].substring(0,4)==="1901"||t[m][_].substring(0,4)==="0001")&&(t[m][_]=null)):t[m][_]=G.toDateTime(t[m][_]):t[m][_]=null;for(const _ of p)t[m][_]=G.toNumber(t[m][_]);i==="strongly"&&g&&(t[m]={...g,...t[m]})}}return t}static async createDataTable(t,n,i){let o;const a=rt.buildMap({QUERY_TYPE:"tsi00datatable",DATASET_NAME:n,TABLE_NAME:i}),s=await Bn.callServiceEx(nt.queryDevConfigService,a,{partition:t}),c={},d=s.getMapData("TSI00DATATABLE");if((d==null?void 0:d.length)>0){const u={};d.forEach(f=>{if(f.TABLE_NAME===i.trim()){const h={name:f.COL_NAME,caption:f.COL_CAPTION,maxLength:f.MAX_LENGTH};switch(f.DATA_TYPE){case"2":h.type="number",h.defaultValue=G.toNumber(f.DEFAULT_VALUE);break;case"3":h.type="datetime",h.defaultValue=G.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;case"4":h.type="boolean",h.defaultValue=G.toBoolean(f.DEFAULT_VALUE);break;case"5":h.type="time",h.defaultValue=G.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;default:h.type="string",h.defaultValue=G.getSystemFormatString(f.DEFAULT_VALUE).trim();break}u[f.COL_NAME]=h}}),Object.keys(u).length>0&&(c.schema=u,o=new Xl(c))}return o||console.error(`ER: DataTable [${i}] creation failed!`),o}},Pt=new WeakMap,ki=new WeakMap,ti=new WeakMap,Ji=new WeakMap,$i=new WeakMap,al=new WeakMap,_n=new WeakMap,vi=new WeakMap,Ql=new WeakMap,Ys=new WeakMap,nn=new WeakMap,mo=new WeakMap,Ws=new WeakMap,qn=new WeakSet,Eo=function(t,n){var o;(o=ze(this,nn))==null||o.forEach(a=>{var s,c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B,O,M,R,H,V,N,W,j,U,ie,X,Y,Z,ce,ue,he,re,z,K,ke,Q,oe,de,ae,ye,He,ge,We,Te,_e,be,xe,Ie,Se,Ve,Ce;if(a.formHelper&&a.configId||(c=(s=a.grid)==null?void 0:s.gridOptions)!=null&&c.api)if(a.controlType==="Grid"){const se=a.grid||((d=a.formHelper)==null?void 0:d.getGrid(a.configId));if((u=se==null?void 0:se.gridOptions)!=null&&u.api)switch(t){case"dataMerged":{const me=se.gridOptions.api.getFilterModel(),Ne=se.gridOptions.columnApi.getColumnState().filter(Ct=>Ct.sort!==null);se.gridOptions.context=se.gridOptions.context||{},Object.keys(me).length===0&&Ne.length===0&&se.gridOptions.context.calculateRowSpan&&se.gridOptions.context.calculateRowSpan instanceof Function&&se.gridOptions.context.calculateRowSpan(!0),(h=(f=se.gridOptions)==null?void 0:f.api)==null||h.clearRangeSelection(),se.gridOptions.context.focusRowId="",se.gridOptions.context.focusColId="",se.gridOptions.context.dataMerged=!0,(g=(p=se.gridOptions)==null?void 0:p.api)==null||g.setRowData(ze(this,Pt)),ze(this,Pt).length>0&&Object.keys(me).length===0&&Ne.length===0?(gr(this,vi,void 0),this.setCurrent(ze(this,Pt)[0])):(_=(m=se.gridOptions)==null?void 0:m.api)==null||_.setFocusedCell(0,nt.GridCheckColumnFieldName);let Qe=ze(this,Pt).length.toString().length*7+20;((x=(T=se.gridOptions.context)==null?void 0:T.viewConfig)==null?void 0:x.SHOW_SELECTION)==="1"&&(Qe+=20),(E=se.gridOptions.context)!=null&&E.allowDragRow&&(Qe+=21),((k=(D=se.gridOptions.context)==null?void 0:D.options)==null?void 0:k.masterDetail)===!0&&(Qe+=22);const lt=(b=(P=se.gridOptions.columnApi)==null?void 0:P.columnModel)==null?void 0:b.gridColumns,qe=lt==null?void 0:lt.find(Ct=>Ct.colId===nt.GridCheckColumnFieldName);qe&&se.gridOptions.columnApi.setColumnWidth(qe,Qe),(S=a.formHelper)==null||S.setGridOptions(a.configId,"advanceFilterTemplateBillNo","",!0);break}case"dataCleared":{(I=(w=se.gridOptions)==null?void 0:w.api)==null||I.setRowData([]);break}case"dataRemoved":{if(se.gridOptions.api.applyTransaction({remove:n.models}),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(v=me==null?void 0:me.rootNode)==null?void 0:v.aggData,pinndeRowType:"ErGridSummaryFooter"}])}if(((B=(A=se.gridOptions.context)==null?void 0:A.options)==null?void 0:B.showRowNo)!==!1&&(se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),se.gridOptions.context.focusRowId)){const me=(O=se==null?void 0:se.gridOptions)==null?void 0:O.api.getRowNode(se.gridOptions.context.focusRowId);me&&(se.gridOptions.context.focusRowId=me.id,(M=se.gridOptions.context)!=null&&M.focusColId||nt.GridCheckColumnFieldName,se.gridOptions.context.focusColId||(se.gridOptions.context.focusColId=nt.GridCheckColumnFieldName),cr.setGridFocusedCell(se,me.rowIndex,se.gridOptions.context.focusColId))}break}case"dataAdded":{if(se.gridOptions.api.applyTransaction({add:[n.current]}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((H=(R=se.gridOptions.context)==null?void 0:R.viewConfig)==null?void 0:H.AUTO_SELECT_MODE)==="1"||((N=(V=se.gridOptions.context)==null?void 0:V.viewConfig)==null?void 0:N.AUTO_SELECT_MODE)==="3"||((j=(W=se.gridOptions.context)==null?void 0:W.options)==null?void 0:j.autoCheckNewRow)===!0)&&((U=a.formHelper)==null||U.checkGridRow(a.configId,n.current)),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(ie=me==null?void 0:me.rootNode)==null?void 0:ie.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataInserted":{if(n.insertAt>=0?se.gridOptions.api.applyTransaction({add:[n.current],addIndex:n.insertAt}):se.gridOptions.api.applyTransaction({add:[n.current]}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((Y=(X=se.gridOptions.context)==null?void 0:X.viewConfig)==null?void 0:Y.AUTO_SELECT_MODE)==="1"||((ce=(Z=se.gridOptions.context)==null?void 0:Z.viewConfig)==null?void 0:ce.AUTO_SELECT_MODE)==="3"||((he=(ue=se.gridOptions.context)==null?void 0:ue.options)==null?void 0:he.autoCheckNewRow)===!0)&&a.formHelper.checkGridRow(a.configId,n.current),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(re=me==null?void 0:me.rootNode)==null?void 0:re.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataImported":{if(n.insertAt>=0?se.gridOptions.api.applyTransaction({add:n.models,addIndex:n.insertAt}):se.gridOptions.api.applyTransaction({add:n.models}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((K=(z=se.gridOptions.context)==null?void 0:z.viewConfig)==null?void 0:K.AUTO_SELECT_MODE)==="1"||((Q=(ke=se.gridOptions.context)==null?void 0:ke.viewConfig)==null?void 0:Q.AUTO_SELECT_MODE)==="3"||((de=(oe=se.gridOptions.context)==null?void 0:oe.options)==null?void 0:de.autoCheckNewRow)===!0)&&a.formHelper.checkGridRow(a.configId,n.models),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(ae=me==null?void 0:me.rootNode)==null?void 0:ae.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"currentChanged":{if(ze(this,vi)&&n.source!==a.configId&&((He=(ye=se.gridOptions.context)==null?void 0:ye.options)==null?void 0:He.suppressDefaultFocusedCell)!==!0){const me=(We=se==null?void 0:se.gridOptions)==null?void 0:We.api.getRowNode((ge=ze(this,vi))==null?void 0:ge.uid);if((_e=(Te=se.gridOptions)==null?void 0:Te.api)==null||_e.clearFocusedCell(),me){const Ne=((be=se.gridOptions.context)==null?void 0:be.focusColId)||nt.GridCheckColumnFieldName;cr.setGridFocusedCell(se,me.rowIndex,Ne)}}break}case"rowStateChanged":{if(n.model){const me=(xe=se==null?void 0:se.gridOptions)==null?void 0:xe.api.getRowNode(n.model.uid);me&&((Se=(Ie=se.gridOptions)==null?void 0:Ie.api)==null||Se.redrawRows({rowNodes:[me]}))}break}case"acceptChanges":{this.hasChanges()&&((Ce=(Ve=se.gridOptions)==null?void 0:Ve.api)==null||Ce.redrawRows());break}}}else a.controlType==="Layout"&&(t==="currentChanged"||t==="dataMerged"||t==="dataCleared")&&a.formHelper.refreshLayoutBindModel(a.configId)});const i=ze(this,Ws)[t];i&&i instanceof Function&&i(n)},uf=function(){ze(this,Ys)||ze(this,Ys)===void 0&&ze(this,Pt).length<=200?(gr(this,ki,Zr.cloneDeep(ze(this,Pt))),gr(this,Ql,!0)):(gr(this,ki,[]),gr(this,Ql,!1))},Xl),d4=class{constructor(e){fe(this,"dataSetName","");fe(this,"dataTables");fe(this,"relations");this.dataTables={},this.relations={},this.dataSetName=(e==null?void 0:e.trim())||""}get Name(){return this.dataSetName}setName(e){return this.dataSetName=(e==null?void 0:e.trim())||"",this}addDataTable(e,t){return t.tableName=e,this.dataTables[e]=t,this}removeDataTable(e){return this.contains(e)&&delete this.dataTables[e.trim()],this}renameDataTable(e,t){return this.contains(e)&&!this.contains(t)&&e.trim().toUpperCase()!==t.trim().toUpperCase()&&(this.addDataTable(t.trim().toUpperCase(),this.dataTables[e.trim().toUpperCase()]),delete this.dataTables[e.trim().toUpperCase()]),this}copyDataTable(e,t){let n,i;return e instanceof Cn?n=e:typeof e=="string"&&(n=this.dataTables[e]),n&&n.options&&(i=new Cn({...n.options})),t&&t.trim().length>0&&!this.contains(t)&&(this.dataTables[t.trim()]=i),i}cloneDataTable(e,t){const n=this.copyDataTable(e,t);return n.data([]),n}getDataTable(e){return this.dataTables[e]}getTableName(e){let t;return Object.keys(this.dataTables).every(n=>this.dataTables[n]===e?(t=n,!1):!0),t}clear(...e){let t=Object.keys(this.dataTables);return e.length>0&&(t=e),t.forEach(n=>{this.dataTables[n]&&this.dataTables[n]instanceof Cn&&this.dataTables[n].clear()}),this}mergeData(e,t,n=!0,i=!1){return(e==null?void 0:e.trim().length)>0&&this.contains(e.trim())&&t&&this.dataTables[e].merge(t,n,i),this}mergeDataFromEIInfo(e,t="",n=!0){return e.getStatus instanceof Function&&e.getStatus()>=0?(t==null?void 0:t.trim().length)>0?this.contains(t.trim())&&e.getBlock(t.trim())?this.mergeData(t.trim(),e.getBlock(t.trim()).getMappedRows()||[],n):G.warn("ER: EiInfo or DataTable does not contain table: "+t.trim()):Object.keys(this.dataTables).forEach(i=>{i.trim().length>0&&this.contains(i.trim())&&e.getBlock(i.trim())&&this.mergeData(i.trim(),e.getBlock(i.trim()).getMappedRows()||[],n)}):e.status>=0&&((t==null?void 0:t.trim().length)>0?this.contains(t.trim())&&e.contains(t.trim())?this.mergeData(t.trim(),e.getBlock(t.trim()).data||[],n):G.warn("ER: EIInfo or DataTable does not contain table: "+t.trim()):Object.keys(this.dataTables).forEach(i=>{i.trim().length>0&&this.contains(i.trim())&&e.contains(i.trim())&&this.mergeData(i.trim(),e.getBlock(i.trim()).data,n)})),this}getCurrentDataObject(e){let t;return(e==null?void 0:e.trim().length)>0&&this.contains(e.trim())&&(t=this.dataTables[e].Current),t}tablesCount(){return this.dataTables?Object.keys(this.dataTables).length:0}contains(e){return e&&e.trim().length>0?this.dataTables[e.trim()]!==void 0:!1}isEmpty(){return!(this.dataTables&&Object.keys(this.dataTables).length>0)}hasChanges(e){if(this.dataTables){if(e&&e.trim().length>0&&this.dataTables[e.trim()])return this.dataTables[e.trim()].hasChanges();{const n=Object.keys(this.dataTables);for(let i=0;i<n.length;i++)if(this.dataTables[n[i]].hasChanges())return!0}}return!1}hasRelation(e){return this.dataTables&&e&&e.trim().length>0&&this.relations[e.trim()]&&this.relations[e.trim()].length>0}acceptChanges(){return Object.keys(this.dataTables).forEach(t=>{this.dataTables[t]&&this.dataTables[t]instanceof Cn&&this.dataTables[t].acceptChanges()}),this}},d1=class{constructor(e){fe(this,"Content","");fe(this,"Context",{});fe(this,"BordStyle","Sizable");fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick",!0);fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BeforeOkButtonClick");fe(this,"_app");fe(this,"_windowOpened",l.ref(!1));fe(this,"_options",l.reactive({title:"标题"}));fe(this,"_resolveDialogResult");fe(this,"_dialogReturnInfo");fe(this,"_events",{});fe(this,"_component");this.setOptions(e||{})}get WindowOpened(){return this._windowOpened}setOptions(e){this._options={...this._options,...e}}getOptions(e){return e?this._options[e]:this._options}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}show(e,t=!0){return new Promise(async(n,i)=>{var o,a;if(this._app)this._windowOpened.value=!0;else{this._component||this._component||(this._component=await Promise.resolve().then(()=>jR),(o=this._component)!=null&&o.default&&(this._component=this._component.default));const s=l.createApp(this._component,{popRichEditorProps:this,options:this._options,content:e});((a=this._options)==null?void 0:a.extension)==="dropdown"&&s.component("ag-grid-vue",br.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:n,reject:i}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}},u4=class{constructor(e,t,n,i,o){fe(this,"LayoutCaption",{});fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",l.ref(!1));fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick");fe(this,"OkButtonPreventDefault",!1);fe(this,"CancelButtonPreventDefault",!1);fe(this,"OkButtonService","");fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BordStyle");fe(this,"ExtendJsonData");fe(this,"CallServiceDataType","EiInfo");fe(this,"BeforeCallService");fe(this,"app");fe(this,"div");fe(this,"_partition");fe(this,"_savePartition");fe(this,"_formName","");fe(this,"_tableName","");fe(this,"_layoutConfigId","");fe(this,"_layoutGroupIdArray",[]);fe(this,"_layoutGroupInfo",{});fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dataSet");fe(this,"_dataTable");fe(this,"_mainLayoutId","");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_readOnlys");fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=e,this._formName=t,n&&(this._layoutConfigId=n),i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partition(){return this._partition||""}get SavePartiton(){return this._savePartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get FormHelper(){return this._formHelper}get LayoutGroupInfo(){return this._layoutGroupInfo}get DataSet(){return this._dataSet}get DataTable(){return this._dataTable}get TableName(){return this._tableName}get DataModel(){return this._formHelper.getLayoutBindModel(this._mainLayoutId)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(e,t){return new Promise((n,i)=>{this._partition=(e==null?void 0:e.trim())||this._partition,this._serviceName=(t==null?void 0:t.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d,u,f,h,p,g,m,_,T,x,E;if(o.flag===1){if(((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0){if(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((f=(u=(d=this._formHelper)==null?void 0:d.ConfigInfo)==null?void 0:u.TSI00FORMBUTTON)==null?void 0:f.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.every(D=>D.BUTTON_NAME==="btnOk"?(this.OkButtonService=D.SVC_NAME,!1):!0),((g=(p=(h=this._formHelper)==null?void 0:h.ConfigInfo)==null?void 0:p.TSI00GRIDVIEW)==null?void 0:g.length)>0)for(let D=0;D<((T=(_=(m=this._formHelper)==null?void 0:m.ConfigInfo)==null?void 0:_.TSI00GRIDVIEW)==null?void 0:T.length);D++){const k=(E=(x=this._formHelper)==null?void 0:x.ConfigInfo)==null?void 0:E.TSI00GRIDVIEW[D];D==0&&(this._mainLayoutId=k.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(k.FUNCTION_ID),this._layoutGroupInfo[k.FUNCTION_ID]=k}this.CloseDialogWhenOkClick=this.CloseDialogWhenOkClick??this._formHelper.FormOptions.closeDialogWhenOkClick,this._initializeFlag=1}}else{const D="ErPopFreeHelper initialize faild, error msg is ["+o.msg+"]";G.messageError(D)}n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions.value,...e})}getFormOption(e){return this._formOptions.value[e]}setSavePartition(e){this._savePartition=e,this._formHelper.setCustomPartition(e)}ReceiveData(e,t){return e&&e instanceof qr&&(e=e.toJSON()),e&&Object.keys(e).length>0&&(this._receiveData=e,this._readOnlys=t),this._receiveData}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setValue(e,t=!0){return this.InitializeFlag>=0&&this.DataModel&&e&&this.DataModel.setData(e,void 0,t),this}getValue(e){return this.DataModel?this.DataModel.get(e):void 0}show(e,t,n){return new Promise((i,o)=>{const a=s=>{if(this.EditType==="Add"){const c=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={...c,...this._receiveData}}this.WindowOpened.value=!0};t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this.app?a():this.Initialize().then(async s=>{var u;this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>yb),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const c=l.createApp(this._component,{popFreeHelperProp:this,formWidth:this.getFormOption("width")??this.getFormOption("formWidth"),formHeight:this.getFormOption("height")??this.getFormOption("formHeight")});c.component("ag-grid-vue",br.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),a()}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo={...this._dialogReturnInfo,...e}}};const od=Object.freeze(Object.defineProperty({__proto__:null,PopFreeHelper:u4},Symbol.toStringTag,{value:"Module"}));let f4=class{constructor(e,t,n,i){fe(this,"Context",{});fe(this,"BordStyle");fe(this,"AutoRefresh",!1);fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick",!0);fe(this,"OkButtonPreventDefault",!1);fe(this,"CancelButtonPreventDefault",!1);fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BeforeOkButtonClick");fe(this,"_app");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_events",{});fe(this,"_windowOpened",l.ref(!1));fe(this,"_options",l.reactive({title:"标题",width:360,height:630}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"_primaryField");fe(this,"_parentField");fe(this,"_displayField");this._primaryField=e,this._parentField=t,this._displayField=n,this.setOptions(i||{})}get FormId(){return G.guid()}get DialogReturnInfo(){return this._dialogReturnInfo}get WindowOpened(){return this._windowOpened}get TreeOrgialData(){return this._receiveData}get PrimaryField(){return this._primaryField}get ParentField(){return this._parentField}get DisplayField(){return this._displayField}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setOptions(e){this._options={...this._options,...e}}getOptions(e){return e?this._options[e]:this._options}receiveData(e){this._receiveData=e}show(e,t,n){return new Promise(async(i,o)=>{var a;if(t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this._app)this._windowOpened.value=!0;else{this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>rN),(a=this._component)!=null&&a.default&&(this._component=this._component.default)));const s=l.createApp(this._component,{popTreeHelperProp:this});s.component("ag-grid-vue",br.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:i,reject:o}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(e){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=e}};const JD=Object.freeze(Object.defineProperty({__proto__:null,PopTreeHelper:f4},Symbol.toStringTag,{value:"Module"}));let h4=class{constructor(e,t,n,i,o){fe(this,"MasterDetailView",!0);fe(this,"FormConfigQueryService","");fe(this,"FormButtonQueryFilter","");fe(this,"FormCaption","");fe(this,"CustomFilterString","");fe(this,"CustomFilterJson");fe(this,"BordStyle");fe(this,"app");fe(this,"div");fe(this,"DefaultValues",{values:{},readonly:{}});fe(this,"Context");fe(this,"WindowOpened",l.ref(!1));fe(this,"DataModelId","");fe(this,"ShowCheckBoxColumn");fe(this,"SelectMode");fe(this,"ShowQueryButton",!0);fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"QueryButtonCaption","");fe(this,"OkButtonCaption","");fe(this,"CancelButtonCaption","");fe(this,"CloseDialogWhenOkClick");fe(this,"ShowQueryNoDetailInfoMsg",!0);fe(this,"ButtonPreventDefault",{ok:!1,cancel:!1,query:!1,mainViewDoubleClick:!1,mainViewFocusChanged:!1});fe(this,"UnMountWhenCloseDialog",!1);fe(this,"AutoQuery",!1);fe(this,"AutoRefresh",!1);fe(this,"KeyFieldName","");fe(this,"DescFieldName","");fe(this,"ChooseKeyValues","");fe(this,"ReceiveJsonData");fe(this,"LayoutGroupFilterId","LayoutGroupFilter");fe(this,"MainViewConfigId","gridView1");fe(this,"DetailViewConfigId","gridView2");fe(this,"LayoutFilterOptions",{});fe(this,"MainViewOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"DetailViewOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"MainInfoQueryMethod");fe(this,"DetailInfoQueryMethod");fe(this,"_partition");fe(this,"_queryPartition");fe(this,"_formName","");fe(this,"_layoutConfigIds","");fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dialogReturnInfo");fe(this,"_mainTableame","");fe(this,"_detailTableame","");fe(this,"_queryService","");fe(this,"_serviceFilter","");fe(this,"_keyFieldValue",{});fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"queryMainGridInfo",async(e=!0)=>{var o,a,s,c,d,u,f,h;const t=new rt,n=this._formHelper.getAllControlValue(this.LayoutGroupFilterId,this.CustomFilterJson),i=this._formHelper.getAllControlValueAsFilterArray(this.LayoutGroupFilterId,this.CustomFilterJson);if(this.FormButtonQueryFilter.trim().length>0){const p=y.ER.Core.converCustomFilterToQueryFilter(this.FormButtonQueryFilter);p.length>0&&i.push(...p)}if(((o=this.CustomFilterString)==null?void 0:o.trim().length)>0){const p=y.ER.Core.converCustomFilterToQueryFilter(this.CustomFilterString);p.length>0&&i.push(...p)}if(t.addMapData("Table0",[n]),t.addMapData("QUERY_FILTER",i),((s=(a=this.MainViewOptions)==null?void 0:a.pageOptions)==null?void 0:s.pagination)==="server")this._formHelper.setServerPagingQuery(this.MainViewConfigId,t,p=>new Promise(async(g,m)=>{var k,P,b,S,w,I,v,A,B,O;const _=t.copy(),T={flag:-1,msg:"",data:void 0,total:0},E=(P=(k=this._formHelper.getGrid(this.MainViewConfigId).gridOptions.context)==null?void 0:k.pageOptions)==null?void 0:P.pageSize;let D;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)D=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:_,queryPage:p,pageSize:E});else if(((b=this._events)==null?void 0:b.query)instanceof Function)D=await this._events.query({queryHelper:this,queryFilter:_,queryPage:p,pageSize:E});else if(this.FormConfigQueryService.trim().length>0)_.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:E}]),D=await this._formHelper.callServiceEx(this.FormConfigQueryService.trim(),_);else if(this._queryService.trim().length>0){console.log("this._queryService",this._queryService);let M=nt.dynamicQueryService;const R=(w=(S=this._formHelper.ConfigInfo)==null?void 0:S.TSI00DATASOURCE)==null?void 0:w.find(H=>H.FUNC_ID===this._queryService);(R==null?void 0:R.ORIGIN_CODE)==="SVC"&&((I=R==null?void 0:R.SVC_NAME)==null?void 0:I.trim().length)>0?M=(v=R==null?void 0:R.SVC_NAME)==null?void 0:v.trim():(_.addMapData("DATA_SOURCE",[{FUNCTION_ID:(R==null?void 0:R.FUNC_ID)||this._queryService,COMPANY_CODE:nt.CompanyCode}]),M=((A=R==null?void 0:R.SVC_NAME)==null?void 0:A.trim())||nt.dynamicQueryService),_.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:E}]),D=await this._formHelper.callServiceEx(M,_)}else T.flag=-1,T.msg=this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务";if(D instanceof rt)T.flag=D.sysFlag,T.msg=D.sysMsg,T.data=D.getMapData(0),T.total=D.getMapData(0).length,D.contains("PAGEINFO")&&(T.total=D.getMapData("PAGEINFO")[0].TOTAL_RECORD);else if(((B=D.sys)==null?void 0:B.status)>=0)T.flag=0,T.data=D.getBlock(0).data,T.total=D.getBlock(0).length,D.contains("PAGEINFO")&&(T.total=D.getMapData("PAGEINFO").data[0].TOTAL_RECORD||0);else if(D.getStatus instanceof Function&&D.getStatus()>=0){T.flag=D.getStatus(),T.msg=D.getMsg();const M=D.getBlock(this._mainTableame)??D.getBlock("TSI00RESULT")??D.getBlock("result");T.data=M.getMappedRows(),T.total=T.data.length,D.getBlock("PAGEINFO")&&(T.total=D.getBlock("PAGEINFO").getMappedRows()[0].TOTAL_RECORD||0)}else T.flag=-1,T.msg=((O=D.sys)==null?void 0:O.msg)||"";g(T)}));else{const p=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);p&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(_=>{_.trim().length>0&&p[_.trim().toUpperCase()]&&(this._keyFieldValue[_.trim().toUpperCase()]=p[_.trim().toUpperCase()])});let g;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)g=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:t});else if(((c=this._events)==null?void 0:c.query)instanceof Function)g=await this._events.query({queryHelper:this,queryFilter:t});else if(this.FormConfigQueryService.trim().length>0)g=await this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson);else if(this._queryService.trim().length>0){let m="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?m=this._serviceFilter+" and "+this.CustomFilterString:m=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(m=this._serviceFilter),g=await this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:m})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}if(g.sys&&((d=g.sys)==null?void 0:d.status)<0){this._formHelper.messageError(g.sys.msg);return}else if(g.getStatus instanceof Function&&g.getStatus()<0){this._formHelper.messageError(g.getMsg());return}else if(g.sysFlag!==void 0&&g.sysFlag<0){this._formHelper.messageError(g.sysMsg);return}else{let m=[];if(((u=g==null?void 0:g.sys)==null?void 0:u.status)>=0)m=g.contains(this._mainTableame)?(f=g.getBlock(this._mainTableame))==null?void 0:f.data:((h=g.getBlock(0))==null?void 0:h.data)??[];else if(g.getStatus instanceof Function&&g.getStatus()>=0){const T=g.getBlock(this._mainTableame)??g.getBlock("TSI00RESULT")??g.getBlock("result")??g.getBlockByIndex(0);m=(T==null?void 0:T.getMappedRows())??[]}else g.sysFlag>=0&&(m=g.getMapData(this._mainTableame)??g.getMapData("TSI00RESULT")??g.getMapData("result")??g.getMapData(0));this._formHelper.mergeDataToGrid(m,this.MainViewConfigId,!0);const _=m.length;_>0?(e&&this._formHelper.messageInfo(G.$t("ERX.QueryResultWithRecords",[_.toString()])||G.stringFormat("查询完成,共查询到[{0}]条数据",_)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue),this.autoCheckRows()):(this._formHelper.clearGridData(this.DetailViewConfigId),e&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}this.doEvent("afterQuery")}});fe(this,"autoCheckRows",()=>{var e,t;if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const n=this.ChooseKeyValues.trim().split(","),i=this.ErFormHelper.getGrid(this.MainViewConfigId);(t=(e=i==null?void 0:i.gridOptions)==null?void 0:e.api)==null||t.forEachLeafNode(o=>{n.includes(o.data[this.KeyFieldName])&&o.setSelected(!0)})}});this._initializeFlag=0,this._partition=e,this._formName=t,n&&(this._layoutConfigIds=n),i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partiton(){return this._partition?this._partition:""}get QueryPartiton(){return this._queryPartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get ErFormHelper(){return this._formHelper}get DialogReturnInfo(){return this._dialogReturnInfo}async Initialize(e,t){return new Promise((n,i)=>{this._partition=e&&e.trim()||this._partition,this._serviceName=t&&t.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d;if(o.flag===1)if(((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0){this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable");const u=this._formHelper.getSingleViewConfigInfo(this.MainViewConfigId);if(u&&(this._mainTableame=u.TABLE_NAME,this._queryService=u.SVC_NAME,this._serviceFilter=u.FILTER_STRING,this.KeyFieldName.trim().length===0&&(this.KeyFieldName=u.KEY_FIELDS),((d=u.EXT_OPTIONS)==null?void 0:d.trim().length)>0)){const f=JSON.parse(u.EXT_OPTIONS);this.MainViewOptions={...f,...this.MainViewOptions}}this._formHelper.containsConfig(this.DetailViewConfigId)||(this.DetailViewConfigId=""),this.ShowCheckBoxColumn!==void 0&&(u.SHOW_SELECTION=this.ShowCheckBoxColumn?"1":"0",this.ShowCheckBoxColumn===!0&&u.MULTI_SELECT_MODE==="1"&&(u.MULTI_SELECT_MODE="2")),this.CloseDialogWhenOkClick=this.CloseDialogWhenOkClick??this._formHelper.FormOptions.closeDialogWhenOkClick,this._initializeFlag=1}else G.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else G.messageError("ErPopQueryHelper initialize faild, error msg is ["+o.msg+"]");n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions,...e})}getFormOption(e){return this._formOptions.value[e]}setQueryPartition(e){this._queryPartition=e,this._formHelper.setCustomPartition(e)}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}show(e,t,n){return new Promise((i,o)=>{t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async a=>{var d,u,f;if(this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>eN),(d=this._component)!=null&&d.default&&(this._component=this._component.default))),this.doEvent("initial",this),this.FormConfigQueryService.trim().length===0){const h=this._formHelper.getFormButtonConfigInfo("btnQuery");this.FormConfigQueryService=((u=h==null?void 0:h.SVC_NAME)==null?void 0:u.trim())||"",this.FormButtonQueryFilter=((f=h==null?void 0:h.FILTER_STRING)==null?void 0:f.trim())||""}this.MainViewOptions.masterDetail=this.MasterDetailView,this._initializeFlag=1;const s=l.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});s.component("ag-grid-vue",br.AgGridVue),s.component("v-splitter",ni.Splitpanes),s.component("v-splitter-pane",ni.Pane),this.app=s;const c=document.createElement("div");document.body.appendChild(c),this.div=c,s.mount(c),this.WindowOpened.value=!0}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo=e}};const p4=Object.freeze(Object.defineProperty({__proto__:null,PopQueryHelper:h4},Symbol.toStringTag,{value:"Module"}));let $D=class{constructor(e,t,n,i,o){fe(this,"LayoutOptions",{});fe(this,"GridOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"LayoutCaption");fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",l.ref(!1));fe(this,"ShowSaveButton",!0);fe(this,"ShowCloseButton",!0);fe(this,"SaveButtonCaption","");fe(this,"CloseButtonCaption","");fe(this,"CloseDialogWhenSaveClick",!1);fe(this,"PreventDefaultEvent",{});fe(this,"OkButtonService","");fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BordStyle");fe(this,"ExtendJsonData");fe(this,"CallServiceDataType","EiInfo");fe(this,"BeforeCallService");fe(this,"app");fe(this,"div");fe(this,"_partition");fe(this,"_savePartition");fe(this,"_formName","");fe(this,"_mainTableName","");fe(this,"_detailTableName","");fe(this,"_layoutConfigId","LayoutGroupMain");fe(this,"_gridConfigId","gridView1");fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dataSet");fe(this,"_mainDataTable");fe(this,"_detailDataTable");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_readOnlys");fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_resolveDialogResult");fe(this,"_component");this._initializeFlag=0,this._partition=e,this._formName=t,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partition(){return this._partition||""}get SavePartiton(){return this._savePartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get ErFormHelper(){return this._formHelper}get LayoutConfigId(){return this._layoutConfigId}get GridConfigId(){return this._gridConfigId}get DataSet(){return this._dataSet}get MainDataTable(){return this._mainDataTable}get MainTableName(){return this._mainTableName}get DetailDataTable(){return this._detailDataTable}get DetailTableName(){return this._detailTableName}get DataModel(){var e;return l.reactive(((e=this._dataSet)==null?void 0:e.getCurrentDataObject(this._mainTableName))||new qr)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(e,t){return new Promise((n,i)=>{this._partition=(e==null?void 0:e.trim())||this._partition,this._serviceName=(t==null?void 0:t.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d,u,f;if(o.flag===1)this._mainTableName=this._formHelper.setBindingTableName(this._layoutConfigId),this._detailTableName=this._formHelper.setBindingTableName(this._gridConfigId),this._dataSet=this._formHelper.FormDataSet,this._mainDataTable=this._formHelper.getBindingTable(this._layoutConfigId),this._detailDataTable=this._formHelper.getBindingTable(this._gridConfigId),((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((f=(u=(d=this._formHelper)==null?void 0:d.ConfigInfo)==null?void 0:u.TSI00FORMBUTTON)==null?void 0:f.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.every(h=>h.BUTTON_NAME==="btnOk"?(this.OkButtonService=h.SVC_NAME,!1):!0),this._initializeFlag=1);else{const h="ErPopFormHelper initialize faild, error msg is ["+o.msg+"]";G.messageError(h)}n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions.value,...e})}getFormOption(e){return this._formOptions.value[e]}setSavePartition(e){this._savePartition=e,this._formHelper.setCustomPartition(e)}ReceiveData(e,t){this._receiveData=e,this._readOnlys=t}setEvent(e,t,n=!1){this._events[e]=t,this.PreventDefaultEvent[e]=n}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setValue(e,t=!0){return this.InitializeFlag>=0&&this.DataModel&&e&&this.DataModel.setData(e,t),this}getValue(e){return this.DataModel?this.DataModel.get(e):void 0}show(e,t,n){return new Promise((i,o)=>{const a=()=>{var s,c,d;if(this.EditType==="Add"){const u=this._formHelper.getLayoutConfigDefaultValues(this._layoutConfigId);this._receiveData={...u,...this._receiveData}}(s=this.DataModel)==null||s.reset(),(c=this.DataModel)==null||c.setData(this._receiveData),this.DataModel.dirty=!1,this.DataModel.dirtyFields={},(d=this._dataSet)==null||d.acceptChanges(),this.WindowOpened.value=!0};t&&this.setEvent("save",t),n&&this.setEvent("close",n),this.app?a():this.Initialize().then(async s=>{var u;this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>fq),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this._initializeFlag=1,this.doEvent("initial",this);const c=l.createApp(this._component,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});c.component("ag-grid-vue",br.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),a()}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo=e}};Ht.locale("zh-cn");const ex=l.defineComponent({name:"DatetimeEditor",components:{"a-date-picker":Ke.DatePicker,"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},directives:{focus:r=>{r.children&&l.nextTick(()=>{const e=y.ER.Core.jQuery(r.children);e==null||e.select()})}},props:["params"],setup:r=>{var S,w,I,v,A;const e=l.ref(null),t=l.ref(((w=(S=r.params.colDef.context)==null?void 0:S.columnConfig)==null?void 0:w.READ_ONLY)==="1"),n=((v=(I=r.params.colDef.context)==null?void 0:I.columnConfig)==null?void 0:v.MAX_LENGTH)||14,i=l.ref(y.ER.Core.toDateTime(r.params.value)),o=l.ref(r.params.max),a=l.ref(r.params.min),s=l.ref(r.params.showTime),c=l.ref(r.params.picker),d=r.params.dataType||"datetime",u=l.ref(!0),f=l.ref(!1),h=r.params.format||"YYYY-MM-DD HH:mm:ss",p=y.ER.Core.getDateTimeFormatString(r.params.value,h),g=l.ref(h),m=l.ref(Jr()),_=l.ref(Ut());window.$wujie&&((A=window.$wujie.bus)==null||A.$on("changeThemeEmit",B=>{_.value=Ut()}));const T=()=>{f.value=!0},x=()=>{if(d==="string"){const B=y.ER.Core.getDateTimeFormatString(i.value,"yyyyMMddHHmmss");return n>0&&B.length>n?B.substring(0,n):B}return y.ER.Core.toDateTime(i.value)},E=()=>!1,D=()=>!1,k=()=>{u.value=!1},P=()=>{u.value=!1,r.params.stopEditing()},b=B=>{B.key==="Escape"||B.key==="Tab"?u.value=!1:B.key==="Enter"&&(u.value=!u.value)};return l.onMounted(()=>{l.nextTick(()=>{if(!t){const B=y.ER.Core.jQuery(e.value);B==null||B.focus()}})}),{h:l.h,ER:y.ER,props:r,readOnly:t,readOnlyValue:p,value:i,dateInputRef:e,max:o,min:a,showTime:s,format:g,picker:c,open:u,antdLocale:m,antdTheme:_,invalid:f,setInvalid:T,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,onOk:k,onChange:P,onKeyDown:b,getValue:x,isCancelBeforeStart:E,isCancelAfterEnd:D}}}),Gr=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t};function tx(r,e,t,n,i,o){const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-tooltip"),c=l.resolveComponent("a-time-picker"),d=l.resolveComponent("a-date-picker"),u=l.resolveComponent("a-config-provider"),f=l.resolveDirective("focus");return l.openBlock(),l.createBlock(u,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[r.readOnly?l.withDirectives((l.openBlock(),l.createBlock(a,{key:0,value:r.readOnlyValue,"allow-clear":!1,readOnly:!0},null,8,["value"])),[[f]]):r.props.params.type==="time"?(l.openBlock(),l.createBlock(c,{key:1,value:r.value,"onUpdate:value":e[0]||(e[0]=h=>r.value=h),ref:"dateInputRef",style:{width:"100%"},open:r.open,format:r.format,max:r.max,min:r.min,autofocus:!0,status:r.invalid?"error":void 0,onKeydown:r.onKeyDown,onChange:r.onChange,onOk:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prevIcon",fn:l.withCtx(()=>[l.createVNode(s,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","open","format","max","min","status","onKeydown","onChange","onOk"])):(l.openBlock(),l.createBlock(d,{key:2,value:r.value,"onUpdate:value":e[1]||(e[1]=h=>r.value=h),ref:"dateInputRef",style:{width:"100%"},picker:r.picker,open:r.open,format:r.format,max:r.max,min:r.min,"show-time":r.showTime,autofocus:!0,status:r.invalid?"error":void 0,onKeydown:r.onKeyDown,onChange:r.onChange,onOk:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prevIcon",fn:l.withCtx(()=>[l.createVNode(s,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","picker","open","format","max","min","show-time","status","onKeydown","onChange","onOk"]))]),_:1},8,["theme","locale"])}const u1=Gr(ex,[["render",tx]]),rx=l.defineComponent({name:"DropdownEditor",components:{"a-button":Ke.Button,"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},props:["params"],directives:{focus:r=>{r.children&&l.nextTick(()=>{const e=y.ER.Core.jQuery(r.children);e==null||e.select()})}},setup:r=>{var M,R,H,V,N,W,j,U,ie,X;const e=l.ref(null),t=l.ref(r.params.multiple?"multiple":"single"),n=l.ref(((R=(M=r.params.colDef.context)==null?void 0:M.columnConfig)==null?void 0:R.READ_ONLY)==="1"),i=l.ref(r.params.value),o=l.ref(""),a=l.ref(""),s=l.ref(null),c=l.ref(""),d=[],u="DropdownEditor",f=(H=r.params.colDef.context)==null?void 0:H.iconUrlMap;let h=r.params.dataSource||[],p=r.params.displayColumns||[],g=r.params.valueField||"CODE",m=r.params.textField||"CODE_DESC_1_CONTENT",_=((j=(W=(N=(V=r.params.context)==null?void 0:V.columnConfig)==null?void 0:N[r.params.colDef.colId])==null?void 0:W.extendOptions)==null?void 0:j.showDropdownFilter)??((ie=(U=r.params.context)==null?void 0:U.options)==null?void 0:ie.showDropdownFilter)??5;_=typeof _=="number"&&_>=1?_:5;const T=l.ref(Ut()),x=l.ref(Jr());window.$wujie&&((X=window.$wujie.bus)==null||X.$on("changeThemeEmit",Y=>{T.value=Ut()}));const E=()=>i.value,D=()=>n.value!==!0,k=Y=>{c.value={...c.value,border:Y}},P=()=>!1,b=()=>!1,S=Y=>{var Z,ce;if(Y.event.key==="ArrowUp"||Y.event.key==="ArrowDown"){const ue=Y.api.getFocusedCell();(ue==null?void 0:ue.rowIndex)>=0&&(i.value=(ce=(Z=Y.api.getModel())==null?void 0:Z.getRow(ue.rowIndex))==null?void 0:ce.data[g])}},w=Y=>{e.value.gridOptions.api.setQuickFilter(Y.target.value)},I=Y=>{var Z,ce,ue;if((Z=r.params)!=null&&Z.allowNew&&((ce=r.params)==null?void 0:ce.multiple)!==!0)i.value=o.value,o.value="",r.params.stopEditing();else if(((ue=r.params)==null?void 0:ue.multiple)===!0){const he=e.value.gridOptions.api.getSelectedNodes();let re="";he.forEach(z=>{re=re.trim().length===0?y.ER.Core.toString(z.data[g]):re+","+y.ER.Core.toString(z.data[g])}),i.value=re,r.params.stopEditing()}},v=Y=>{r.params.stopEditing()},A=(Y,Z)=>{const ce=document.createElement("div");ce.style.display="flex";let ue;Y.startsWith("IconFont:")?(Y=Y.replace("IconFont:",""),ue=y.ER.Core.createErSvgElement(Y)):Y.startsWith("ImgUrl:")&&(Y=Y.replace("ImgUrl:",""),ue=y.ER.Core.createRemoteImgElement(Y)),ue&&(ue.style.paddingTop="1px",ce.appendChild(ue));const he=document.createElement("span");return he.innerHTML=Z,he.style.paddingLeft="3px",ce.appendChild(he),ce},B=Y=>{var ce,ue,he;const Z=[];return Y.api.getDisplayedRowCount()>0&&(Z.push("copy","copyWithHeaders"),((ue=(ce=Y.columnApi)==null?void 0:ce.getRowGroupColumns())==null?void 0:ue.length)>0&&Z.push("separator","expandAll","contractAll")),(he=Y.api)!=null&&he.isColumnFilterPresent()&&(Z.push("separator"),Z.push({name:y.ER.Core.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var re;(re=Y.api)==null||re.setFilterModel(null)}})),Z},O=Y=>{var Z,ce;if(Y.event){const ue=((Z=Y.api)==null?void 0:Z.getCellRanges())||[];if(ue.length===1&&ue[0].columns.length===1&&ue[0].columns[0].colId===y.ER.SysInfo.GridCheckColumnFieldName){const he=(ce=Y.api)==null?void 0:ce.getModel();if(he){const re=[];for(let z=ue[0].startRow.rowIndex;z<=ue[0].endRow.rowIndex;z++){const K=he.getRow(z);K&&re.push(K)}Y.api.setNodesSelected({nodes:re,newValue:Y.node.isSelected()})}}}};return l.onBeforeMount(()=>{var Y,Z,ce,ue,he,re,z,K,ke,Q,oe;if(n.value===!1){const de=r.params.formHelper,ae=(ce=(Z=(Y=r.params.context)==null?void 0:Y.options)==null?void 0:Z.dropdownFilter)==null?void 0:ce[r.params.colDef.colId];if(p.length>0)ae instanceof Function&&(h=ae({data:r.params.data,dataSource:h,value:r.params.value})),p.forEach((ye,He)=>{const ge={colId:ye.field,field:ye.field,tooltipField:ye.field,headerName:ye.headerName||ye.title,minWidth:150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};ye.field===g&&(ge.width=100,ge.minWidth=100,ge.maxWidth=200),d.push(ge)});else if((he=(ue=de.DropDownBindSource)==null?void 0:ue[r.params.configId])!=null&&he[r.params.colDef.colId]){const ye=de.DropDownBindSource[r.params.configId][r.params.colDef.colId],He=(re=r.params.colDef.context)==null?void 0:re.columnConfig;g=ye.dataValueField||"CODE",m=ye.dataTextField||"CODE_DESC_1_CONTENT",h=ye.dataSource;const ge=((z=He==null?void 0:He.FATHER_FIELD)==null?void 0:z.trim())||"",We=((K=He==null?void 0:He.FORM_FILTER)==null?void 0:K.trim())||"",Te=((ke=He==null?void 0:He.LAYOUT_ID)==null?void 0:ke.trim())||r.params.configId,_e=((Q=He==null?void 0:He.extendOptions)==null?void 0:Q.dropdownOptions)||{};if(ge.length>0&&We.length>0)if(Te===r.params.configId&&r.params.data)h=de.filterDropDownCascaderDataSource(ye.dataSource,We,r.params.data[ge]||"");else{const be=de.getGrid(Te);if(be){const xe=de.getGridCurrentRow(be,!0);xe&&(h=de.filterDropDownCascaderDataSource(ye.dataSource,We,xe[ge]||""))}else{const xe=de.getLayoutBindModel(Te);xe&&(h=de.filterDropDownCascaderDataSource(ye.dataSource,We,xe[ge]||""))}}ae instanceof Function&&(h=ae({data:r.params.data,dataSource:h,value:r.params.value})),((oe=ye.columns)==null?void 0:oe.length)>0&&ye.columns.forEach((be,xe)=>{var Ve;const Ie={colId:be.field,field:be.field,tooltipField:be.field,headerName:be.title,minWidth:50,width:be.width||150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};f&&xe===0&&(Ie.cellRenderer=Ce=>{var Ne,Qe,lt,qe;const se=y.ER.Core.toString(Ce.value).replace(/</g,"<"),me=((Qe=(Ne=Ce==null?void 0:Ce.data)==null?void 0:Ne[g])==null?void 0:Qe.trim())||"";if(me.length>0)return(lt=f[me])!=null&<.trim().startsWith("IconFont:")||(qe=f[me])!=null&&qe.startsWith("ImgUrl:")?A(f[me],se):se});const Se=((Ve=_e==null?void 0:_e.wrapText)==null?void 0:Ve[Ie.field])??(_e==null?void 0:_e.wrapText);Ie.autoHeight=Ie.autoHeight||Se,Ie.wrapText=Ie.wrapText||Se,d.push(Ie)})}(h==null?void 0:h.length)>10&&(s.value={statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]})}else a.value=r.params.colDef.refData[r.params.value]||r.params.value}),l.onMounted(()=>{var Y,Z,ce,ue,he,re,z,K,ke;if(!n.value){if(d.length===0){const ae={colId:"CODE",field:"CODE",tooltipField:"CODE",headerName:y.ER.Core.$t("ERX.CodeColumn")||"代码",minWidth:100,width:100,maxWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};f&&(ae.cellRenderer=ye=>{var ge,We,Te;const He=y.ER.Core.toString(ye.value).replace(/</g,"<");if(((ge=ye.value)==null?void 0:ge.length)>0)return(We=f[ye.value])!=null&&We.trim().startsWith("IconFont:")||(Te=f[ye.value])!=null&&Te.startsWith("ImgUrl:")?A(f[ye.value],He):He}),d.push(ae),d.push({colId:"CODE_DESC_1_CONTENT",field:"CODE_DESC_1_CONTENT",tooltipField:"CODE_DESC_1_CONTENT",headerName:y.ER.Core.$t("ERX.DescriptionColumn")||"描述",width:200,minWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_})}let Q=0;d.forEach(ae=>{var ye,He;ae.width=((He=(ye=r.params.colDef.context)==null?void 0:ye.popColumnsWidth)==null?void 0:He[ae.colId])||ae.width,Q+=ae.width||150}),r.params.multiple&&(d.unshift({colId:y.ER.SysInfo.GridCheckColumnFieldName,pinned:ii()?"right":"left",headerCheckboxSelection:ae=>!0,headerCheckboxSelectionFilteredOnly:((Y=r.params)==null?void 0:Y.headerCheckboxSelectionFilteredOnly)??!0,checkboxSelection:ae=>!ae.node.group&&!ae.node.footer,headerName:"",width:30,maxWidth:30,minWidth:30,suppressMenu:!0,resizable:!1,sortable:!1,lockPosition:ii()?"right":"left"}),Q+=30);let oe=15;(h==null?void 0:h.length)<15&&(oe=(h==null?void 0:h.length)+2),oe<5&&(oe=5),(ce=(Z=r.params.colDef)==null?void 0:Z.context)!=null&&ce.popWidth&&(Q=(he=(ue=r.params.colDef)==null?void 0:ue.context)==null?void 0:he.popWidth);const de=((z=(re=r.params.colDef)==null?void 0:re.context)==null?void 0:z.popHeight)||oe*25+15;if(c.value={resize:"both",overflow:"auto",height:de+"px",width:Q+"px"},e.value.gridOptions.api.selectionService.rowSelection=r.params.multiple?"multiple":"single",e.value.gridOptions.enableRangeSelection=!0,e.value.gridOptions.enableRangeHandle=!0,e.value.gridOptions.debounceVerticalScrollbar=!0,e.value.gridOptions.enableBrowserTooltips=!0,e.value.gridOptions.headerHeight=d.length===1&&h.length<_?0:void 0,e.value.gridOptions.api.setColumnDefs(d),e.value.gridOptions.api.setRowData(h),e.value.gridOptions.api.addEventListener("columnResized",ae=>{var ye;r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popColumnsWidth=r.params.colDef.context.popColumnsWidth||{},(ye=ae.columns)==null||ye.forEach(He=>{r.params.colDef.context.popColumnsWidth[He.colId]=He.actualWidth})}),!r.params.multiple&&((ke=(K=r.params.colDef.context)==null?void 0:K.columnConfig)==null?void 0:ke.ADD_EMPTY_ITEM)==="1"){const ae={};ae[g]="",e.value.gridOptions.api.setPinnedTopRowData([ae])}r.params.multiple||e.value.gridOptions.api.addEventListener("cellClicked",ae=>{i.value=ae.data[g],r.params.stopEditing()}),e.value.gridOptions.api.addEventListener("firstDataRendered",ae=>{if(y.ER.Core.toString(i.value,!0).trim().length>0){const ye=y.ER.Core.toString(i.value,!0).split(",");let He=!1;ae.api.forEachNodeAfterFilterAndSort(ge=>{ye.includes(ge.data[g])&&(ge.setSelected(!0),ae.api.setFocusedCell(ge.rowIndex,m),He||ae.api.ensureIndexVisible(ge.rowIndex,"top"),He=!0)})}}),l.nextTick(()=>{y.ER.Core.jQuery(e.value).focus(),new ResizeObserver(y.ER.Core.debounce(ye=>{var We,Te,_e,be,xe,Ie,Se,Ve;const He=((Te=(We=ye[0])==null?void 0:We.contentRect)==null?void 0:Te.width)||0,ge=((be=(_e=ye[0])==null?void 0:_e.contentRect)==null?void 0:be.height)||0;He>0&&(r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popWidth=He),ge>0&&(r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popHeight=ge),(((xe=r.params.colDef.context)==null?void 0:xe.popColumnsWidth)===void 0||Object.keys(r.params.colDef.context.popColumnsWidth).length>0)&&((Ve=(Se=(Ie=e==null?void 0:e.value)==null?void 0:Ie.gridOptions)==null?void 0:Se.api)==null||Ve.sizeColumnsToFit())},200)).observe(document.querySelector("#dropdownEditorDiv"))})}}),{h:l.h,isRTL:ii,ER:y.ER,editorType:u,dropDownStyle:c,props:r,readOnly:n,value:i,newValue:o,displayText:a,statusBar:s,dropDownColumns:d,dropDownData:h,agGridVueDropdownRef:e,rowSelection:t,antdTheme:T,antdLocale:x,getAgLocaleText:ca,CheckCircleOutlined:$e.CheckCircleOutlined,CloseCircleOutlined:$e.CloseCircleOutlined,getContextMenuItems:B,setBorder:k,confirmClick:I,cancelClick:v,onCellKeyDown:S,getValue:E,isPopup:D,isCancelBeforeStart:P,isCancelAfterEnd:b,onFilterTextBoxChanged:w,onRowSelected:O}}}),nx={key:0},ix={style:{flex:1,width:"100%"}},ox={key:0,class:"gridDropDownEditorFooter"};function ax(r,e,t,n,i,o){var f,h,p;const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-config-provider"),c=l.resolveComponent("ag-grid-vue"),d=l.resolveComponent("a-button"),u=l.resolveDirective("focus");return r.readOnly?(l.openBlock(),l.createElementBlock("div",nx,[l.createVNode(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(a,{value:r.displayText,"allow-clear":!1,readOnly:!0},null,8,["value"]),[[u]])]),_:1},8,["theme","locale"])])):(l.openBlock(),l.createElementBlock("div",{key:1,id:"dropdownEditorDiv",style:l.normalizeStyle([{display:"flex","flex-direction":"column",height:"100%"},r.dropDownStyle])},[l.createElementVNode("div",ix,[l.createVNode(c,{class:"ag-theme-balham",style:{height:"100%",width:"100%"},ref:"agGridVueDropdownRef",enableRtl:r.isRTL(),localeText:r.getAgLocaleText(),statusBar:r.statusBar,"row-selection":r.rowSelection,enableRangeSelection:r.props.params.multiple,rowMultiSelectWithClick:r.props.params.multiple,enableRangeHandle:r.props.params.multiple,suppressRowClickSelection:(f=r.props.params)==null?void 0:f.multiple,stopEditingWhenCellsLoseFocus:!0,enableBrowserTooltips:!0,getContextMenuItems:r.getContextMenuItems,onRowSelected:r.onRowSelected,onCellKeyDown:r.onCellKeyDown},null,8,["enableRtl","localeText","statusBar","row-selection","enableRangeSelection","rowMultiSelectWithClick","enableRangeHandle","suppressRowClickSelection","getContextMenuItems","onRowSelected","onCellKeyDown"])]),(h=r.props.params)!=null&&h.multiple||(p=r.props.params)!=null&&p.allowNew?(l.openBlock(),l.createElementBlock("div",ox,[l.createVNode(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var g,m;return[(g=r.props.params)!=null&&g.allowNew&&((m=r.props.params)==null?void 0:m.multiple)!==!0?(l.openBlock(),l.createBlock(a,{key:0,onPressEnter:r.confirmClick,placeholder:"请输入其他值",value:r.newValue,"onUpdate:value":e[0]||(e[0]=_=>r.newValue=_),"allow-clear":!0},null,8,["onPressEnter","value"])):l.createCommentVNode("",!0),l.createVNode(d,{type:"primary",class:"xr-er-button",icon:r.h(r.CheckCircleOutlined),onClick:r.confirmClick},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.ER.Core.$t("ERX.Confirm")||"确定"),1)]),_:1},8,["icon","onClick"]),l.createVNode(d,{type:"primary",class:"xr-er-button",icon:r.h(r.CloseCircleOutlined),onClick:r.cancelClick},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.ER.Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["icon","onClick"])]}),_:1},8,["theme","locale"])])):l.createCommentVNode("",!0)],4))}const Qo=Gr(rx,[["render",ax]]),lx=l.defineComponent({name:"ButtonEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-input-group":Ke.InputGroup,"a-input":Ke.Input,"a-button":Ke.Button,"a-tooltip":Ke.Tooltip},setup:r=>{var p,g,m;const e=l.ref(null),t=l.ref(((g=(p=r.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:g.READ_ONLY)==="1"),n=l.ref(r.params.value),i=l.ref(!1),o=l.ref(Jr()),a=l.ref(Ut());window.$wujie&&((m=window.$wujie.bus)==null||m.$on("changeThemeEmit",_=>{a.value=Ut()}));const s=()=>n.value,c=()=>{i.value=!0},d=()=>!1,u=()=>!1,f=_=>{if(i.value=!1,y.ER.Core.toString(n,!0).length===0&&r.params.formHelper&&r.params.configId){_.params=r.params,_.isClear=!0;const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");if(T&&T instanceof Function&&T(_)===!1)return;r.params.stopEditing()}else if(r.params.maxLength>0){const T=_.target.value||"";let x="",E=0;for(let D=0;D<T.length;D++){const k=T.codePointAt(D);if(k>=128512&&k<=128591?E+=4:k>=19968&&k<=40959||k>=65280&&k<=65519?E+=2:E+=1,E>r.params.maxLength){n.value=x;break}x+=T[D]}}},h=async _=>{if(r.params.formHelper&&r.params.configId){_.params=r.params,r.params.event&&r.params.event instanceof Function&&await r.params.event(_);const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");if(T&&T instanceof Function&&T(_)===!1)return;r.params.stopEditing()}};return l.onMounted(()=>{l.nextTick(()=>{y.ER.Core.jQuery(e.value).focus()})}),{h:l.h,ER:y.ER,props:r,value:n,inputRef:e,readOnly:t,antdLocale:o,antdTheme:a,EllipsisOutlined:$e.EllipsisOutlined,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,onChange:f,setInvalid:c,getValue:s,addButtonClick:h,isCancelBeforeStart:d,isCancelAfterEnd:u}}});function sx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-button"),d=l.resolveComponent("a-input-group"),u=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(u,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(d,{style:{display:"flex","align-items":"center",width:"100%"},compact:""},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=f=>r.value=f),ref:"inputRef","allow-clear":!0,readOnly:r.readOnly,style:{flex:1},onChange:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","readOnly","onChange"]),l.createVNode(c,{style:{height:"22px !important",width:"23px","box-shadow":"none !important"},onClick:r.addButtonClick},{icon:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.EllipsisOutlined))))]),_:1},8,["onClick"])]),_:1})]),_:1},8,["theme","locale"])}const cx=Gr(lx,[["render",sx]]),dx=l.defineComponent({name:"ColorEditor",props:["params"],components:{"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},setup:r=>{var d;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{t.value=Ut()}));const n=l.ref(null),i=l.ref("#ffffff"),o=()=>i.value||"#ffffff",a=()=>!1,s=()=>!1,c=u=>{i.value="#ffffff"};return l.onBeforeMount(()=>{var u;if(((u=r.params.value)==null?void 0:u.trim().length)>0)i.value=y.ER.Core.toHexColor(r.params.value);else return"#ffffff"}),l.onMounted(()=>{}),{h:l.h,value:i,props:r,inputRef:n,antdLocale:e,antdTheme:t,clearButtonClick:c,getValue:o,isCancelBeforeStart:a,isCancelAfterEnd:s}}});function ux(r,e,t,n,i,o){const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(a,{ref:"inputRef",value:r.value,"onUpdate:value":e[1]||(e[1]=c=>r.value=c),style:{paddingTop:"0px",paddingBottom:"0px"},class:"er-color-picker","allow-clear":!0},{addonBefore:l.withCtx(()=>[l.createVNode(a,{type:"color",value:r.value,"onUpdate:value":e[0]||(e[0]=c=>r.value=c)},null,8,["value"])]),_:1},8,["value"])]),_:1},8,["theme","locale"])}const fx=Gr(dx,[["render",ux]]),hx=l.defineComponent({name:"NumberEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-tooltip":Ke.Tooltip,"a-input":Ke.Input,"a-input-number":Ke.InputNumber},setup:r=>{var p,g,m;const e=l.ref(null),t=l.ref(((g=(p=r.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:g.READ_ONLY)==="1"),n=l.ref(r.params.zeroDisplayEmpty!==!1&&r.params.value===0?"":r.params.value),i=l.ref(!1),o=r.params.eventKey||"",a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((m=window.$wujie.bus)==null||m.$on("changeThemeEmit",_=>{s.value=Ut()}));const c=()=>n.value===""||n.value===void 0||isNaN(n.value)?null:y.ER.Core.toNumber(n.value),d=()=>{i.value=!0},u=()=>!1,f=()=>{const _=parseFloat(n.value);return r.params.min!==void 0&&_<r.params.min||r.params.max!==void 0&&_>r.params.max?(y.ER.Core.messageWarning((y.ER.Core.$t("ERX.InputValueOutOfRange")||"输入数值超出允许范围")+"["+r.params.min+","+r.params.max+"]"),!0):(i.value=!1,!1)},h=_=>{let T=_.target.value;if(T=T.replace(/(?!^-)[^\d.]/g,""),r.params.precision>=0&&T.includes(".")){const x=T.split(".");x[0]=x[0]||"0",r.params.precision===0?T=x[0]:(x[1]=x[1].slice(0,r.params.precision),T=`${x[0]}.${x[1]}`)}n.value=T};return l.onMounted(()=>{l.nextTick(()=>{const _=y.ER.Core.jQuery(e.value);_==null||_.focus(),o.length===1?n.value=o:_==null||_.select()})}),{h:l.h,ER:y.ER,props:r,readOnly:t,value:n,inputRef:e,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,onChange:h,setInvalid:d,getValue:c,isCancelBeforeStart:u,isCancelAfterEnd:f}}});function px(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-input-number"),d=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(d,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[r.props.params.showNumberControl!==!0?(l.openBlock(),l.createBlock(s,{key:0,value:r.value,"onUpdate:value":e[0]||(e[0]=u=>r.value=u),ref:"inputRef","allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,autofocus:!0,readOnly:r.readOnly,onChange:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange"])):l.createCommentVNode("",!0),r.props.params.showNumberControl===!0?(l.openBlock(),l.createBlock(c,{key:1,value:r.value,"onUpdate:value":e[1]||(e[1]=u=>r.value=u),ref:"inputRef",style:{width:"100%"},"allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,autofocus:!0,readonly:r.readOnly,controls:!0,step:r.props.params.step===!0?1:typeof r.props.params.step=="number"?r.props.params.step:1,formatter:r.props.params.formatter,parser:r.props.params.parser},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readonly","step","formatter","parser"])):l.createCommentVNode("",!0)]),_:1},8,["theme","locale"])}const f1=Gr(hx,[["render",px]]),gx=l.defineComponent({name:"TextEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-input":Ke.Input,"a-tooltip":Ke.Tooltip},setup:r=>{var T,x,E;const e=l.ref(null),t=l.ref(((x=(T=r.params.colDef.context)==null?void 0:T.columnConfig)==null?void 0:x.READ_ONLY)==="1"),n=l.ref(r.params.value||""),i=l.ref(!1),o=l.ref(""),a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",D=>{s.value=Ut()}));const c=r.params.eventKey||"",d=r.params.maxLength??-1,u=r.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{i.value=!0},p=()=>!1,g=()=>!1,m=D=>{i.value=!1;const k=D.target.value||"";if(d>0&&k.length>0){let P="",b=0;for(let S=0;S<k.length;S++){const w=k.codePointAt(S);if(w>=128512&&w<=128591?b+=4:w>=19968&&w<=40959||w>=65280&&w<=65519?b+=2:b+=1,b>d){n.value=P;break}P+=k[S]}}if((u==null?void 0:u.length)>0&&y.ER.Core.isValidRegex(u)&&!new RegExp(u).test(k)){i.value=!0,n.value=Array.from(n.value).filter(P=>new RegExp(u).test(P)).join(""),o.value=y.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}},_=D=>{i.value=!1};return l.onMounted(()=>{l.nextTick(()=>{var k;const D=y.ER.Core.jQuery(e.value);D==null||D.focus(),c.length===1?(n.value=c,(k=e.value)==null||k.setSelectionRange(1,1)):D==null||D.select()})}),{h:l.h,ER:y.ER,props:r,value:n,readOnly:t,inputRef:e,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,errorMessage:o,onChange:m,onKeydown:_,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:g}}});function mx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=d=>r.value=d),ref:"inputRef","allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,readOnly:r.readOnly,onChange:r.onChange,onKeydown:l.withKeys(r.onKeydown,["enter"])},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.errorMessage},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange","onKeydown"])]),_:1},8,["theme","locale"])}const h1=Gr(gx,[["render",mx]]),Ex=l.defineComponent({name:"LargeTextEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-textarea":Ke.Textarea,"a-tooltip":Ke.Tooltip},setup:r=>{var E,D,k;const e=l.ref(null),t=l.ref(((D=(E=r.params.colDef.context)==null?void 0:E.columnConfig)==null?void 0:D.READ_ONLY)==="1"),n=l.ref(r.params.value||""),i=l.ref(!1),o=l.ref(""),a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((k=window.$wujie.bus)==null||k.$on("changeThemeEmit",P=>{s.value=Ut()}));let c=!1;const d=r.params.maxLength??-1,u=r.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{i.value=!0},p=()=>!1,g=()=>!1,m=P=>{P.key==="Enter"&&(c||P.shiftKey)&&P.stopPropagation()},_=()=>{c=!0},T=()=>{c=!1},x=P=>{i.value=!1;const b=P.target.value||"";if(d>0&&b.length>0){let S="",w=0;for(let I=0;I<b.length;I++){const v=b.codePointAt(I);if(v>=128512&&v<=128591?w+=4:v>=19968&&v<=40959||v>=65280&&v<=65519?w+=2:w+=1,w>d){n.value=S;break}S+=b[I]}}if((u==null?void 0:u.length)>0&&y.ER.Core.isValidRegex(u)&&!new RegExp(u).test(b)){i.value=!0,n.value=Array.from(n.value).filter(S=>new RegExp(u).test(S)).join(""),o.value=y.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}};return l.onMounted(()=>{l.nextTick(()=>{const P=y.ER.Core.jQuery(e.value);P==null||P.focus(),P==null||P.select()})}),{h:l.h,ER:y.ER,props:r,value:n,inputRef:e,readOnly:t,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,errorMessage:o,onChange:x,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:g,onCompositionstart:_,onCompositionend:T,onKeyDown:m}}});function Cx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-textarea"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=d=>r.value=d),ref:"inputRef",class:"grid-cell-editor-textarea","allow-clear":r.readOnly!==!0,maxlength:r.props.params.maxLength,status:r.invalid?"error":void 0,readOnly:r.readOnly===!0,rows:r.props.params.rows,cols:r.props.params.cols,"show-count":r.props.params.showCount,onKeydown:r.onKeyDown,onCompositionstart:r.onCompositionstart,onCompositionend:r.onCompositionend},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.errorMessage},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","maxlength","status","readOnly","rows","cols","show-count","onKeydown","onCompositionstart","onCompositionend"])]),_:1},8,["theme","locale"])}const ad=Gr(Ex,[["render",Cx]]),_x=l.defineComponent({name:"ColorCell",props:["params"],setup:r=>{const e=l.ref("");return l.onMounted(()=>{var t;((t=r.params.value)==null?void 0:t.trim().length)>0&&(e.value=r.params.value==="255,255,255,1"?"":r.params.value)}),{ER:y.ER,value:e}}}),yx={style:{overflow:"hidden",textOverflow:"ellipsis"}};function Tx(r,e,t,n,i,o){return l.openBlock(),l.createElementBlock("div",yx,[l.createElementVNode("span",{style:l.normalizeStyle({paddingRight:"5px",borderLeft:r.value.length>0?"10px solid "+r.ER.Core.toHexColor(r.value):""})},null,4),l.createTextVNode(l.toDisplayString(r.value),1)])}const Ox=Gr(_x,[["render",Tx]]),Sx=l.defineComponent({name:"ButtonGroup",components:{"a-button":Ke.Button,"a-tooltip":Ke.Tooltip,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{var a,s,c,d;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((a=window.$wujie.bus)==null||a.$on("changeThemeEmit",u=>{t.value=Ut()}));const n=r.params.columnConfig||{},i=[];(c=(s=r.params)==null?void 0:s.data)!=null&&c.uid&&r.params.buttons.forEach(u=>{var h,p;u.options=u.options||{},u.options.style={height:"16px !important",...u.options.style};const f=((h=u.options)==null?void 0:h.condition)||"";if((f==null?void 0:f.trim().length)>0){const g=((p=r.params.data)==null?void 0:p.toJSON())||{};y.ER.Core.checkExpressionValid(g,f)&&i.push(u)}else i.push(u)}),window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{t.value=Ut()}));const o=u=>{var f,h,p,g,m,_;if(r.params.formHelper&&r.params.configId){((f=u.name)==null?void 0:f.toLowerCase())==="addrow"||((h=u.name)==null?void 0:h.toLowerCase())==="newrow"?r.params.formHelper.addRowToGrid(r.params.configId):(((p=u.name)==null?void 0:p.toLowerCase())==="deleterow"||((g=u.name)==null?void 0:g.toLowerCase())==="removerow"||((m=u.name)==null?void 0:m.toLowerCase())==="delete"||((_=u.name)==null?void 0:_.toLowerCase())==="remove")&&r.params.formHelper.deleteGridRows(r.params.configId,!0,[r.params.data]);const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");T&&T instanceof Function&&T({...r.params,button:u})}};return l.onMounted(()=>{}),{buttonClick:o,props:r,antdLocale:e,antdTheme:t,columnConfig:n,renderButton:i}}}),wx={key:0,class:"er-grid-button-group",style:{display:"flex","align-items":"center"}};function vx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-button"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var d,u,f;return[!((d=r.props.params.node)!=null&&d.group)&&!((u=r.props.params.node)!=null&&u.rowPinned)?(l.openBlock(),l.createElementBlock("div",wx,[r.props.params.displayValue?(l.openBlock(),l.createBlock(a,{key:0,title:(f=r.props.params)==null?void 0:f.getValue()},{default:l.withCtx(()=>{var h;return[l.createElementVNode("div",null,l.toDisplayString((h=r.props.params)==null?void 0:h.getValue()),1)]}),_:1},8,["title"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.renderButton,(h,p)=>{var g;return l.openBlock(),l.createBlock(a,{key:h.name+"tooltip",title:(g=h.options)!=null&&g.showTooltip?h.caption:void 0},{default:l.withCtx(()=>{var m,_,T,x,E,D,k,P,b,S,w,I,v;return[l.createVNode(s,{type:((m=h.options)==null?void 0:m.type)||"link",icon:((_=h.options)==null?void 0:_.icon)||void 0,class:l.normalizeClass(((T=h.options)==null?void 0:T.class)||""),style:l.normalizeStyle((x=h.options)==null?void 0:x.style),ghost:((E=h.options)==null?void 0:E.ghost)===!0,loading:((D=h.options)==null?void 0:D.loading)===!0,shape:((k=h.options)==null?void 0:k.shape)||"default",block:((P=h.options)==null?void 0:P.block)===!0,danger:((b=h.options)==null?void 0:b.danger)===!0||((S=h.name)==null?void 0:S.toLowerCase())==="deleterow"||((w=h.name)==null?void 0:w.toLowerCase())==="removerow"||((I=h.name)==null?void 0:I.toLowerCase())==="delete"||((v=h.name)==null?void 0:v.toLowerCase())==="remove",onClick:A=>r.buttonClick({...h,data:r.props.params.data,index:p})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.caption),1)]),_:2},1032,["type","icon","class","style","ghost","loading","shape","block","danger","onClick"])]}),_:2},1032,["title"])}),128))])):l.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const Dx=Gr(Sx,[["render",vx]]),xx=l.defineComponent({name:"ProgressBar",props:["params"],setup:r=>{const e=l.ref(r.params.value),t=l.ref(r.params.maxValue),n=l.ref(r.params.progressBarColor),i=()=>!r.params.value||r.params.value<=0||r.params.maxValue<=0?0:r.params.value/r.params.maxValue>=1?"100%":y.ER.Core.toString(y.ER.Core.toNumber(r.params.value)/y.ER.Core.toNumber(r.params.maxValue)*100)+"%",o=()=>r.params.value?r.params.value<=0||r.params.maxValue<=0?e:y.ER.Core.toString(y.ER.Core.round(r.params.value/r.params.maxValue*100,2))+"%":"";return l.onMounted(()=>{}),{value:e,maxValue:t,progressBarColor:n,percent:i,labelText:o,props:r,ER:y.ER}}}),Ax={style:{width:"100%",height:"15px",position:"absolute",color:"",right:0,top:0,zIndex:1}};function Ix(r,e,t,n,i,o){return r.value?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({width:"100%",height:"18px",backgroundColor:"transparent",borderColor:r.progressBarColor,position:"relative",borderStyle:"solid",borderWidth:"thin"})},[l.createElementVNode("div",Ax,l.toDisplayString(r.labelText()),1),l.createElementVNode("div",{style:l.normalizeStyle({width:r.percent(),height:"100%",backgroundColor:r.progressBarColor,position:"absolute",left:0,right:0,top:0,bottom:0,transition:"width 10s ease-in-out",zIndex:0})},null,4)],4)):l.createCommentVNode("",!0)}const bx=Gr(xx,[["render",Ix]]),Fx=l.defineComponent({name:"DefaultRender",components:{"a-tag":Ke.Tag,"a-badge":Ke.Badge,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{const e=r.params.click,t=l.ref({});r.params.color&&(t.value.color=r.params.color),r.params.backgroundColor&&(t.value.backgroundColor=r.params.backgroundColor),r.params.boderColor&&(t.value.boxShadow=`0 0 0 1px ${r.params.boderColor} inset`);const n=i=>{i.preventDefault(),e&&e instanceof Function&&e(r.params)};return l.onMounted(()=>{}),{props:r,ER:y.ER,navigateToLink:n,badgeNumberStyle:t}}}),Mx={key:0,class:"er-grid-cell-image",style:{display:"inline-block"}},kx={key:0,class:"icon",fill:"currentColor"},Rx=["xlink:href"],Nx=["src"],Px=["href"];function Lx(r,e,t,n,i,o){var c,d,u,f;const a=l.resolveComponent("a-tag"),s=l.resolveComponent("a-badge");return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle({display:"block",textAlign:r.props.params.justifyContent==="flex-end"?"right":r.props.params.justifyContent==="center"?"center":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})},[r.props.params.svgIcon||r.props.params.imgIcon||r.props.params.fontIcon?(l.openBlock(),l.createElementBlock("div",Mx,[r.props.params.svgIcon?(l.openBlock(),l.createElementBlock("svg",kx,[l.createElementVNode("use",{"xlink:href":r.props.params.svgIcon},null,8,Rx)])):r.props.params.fontIcon?(l.openBlock(),l.createElementBlock("i",{key:1,class:l.normalizeClass(`iconfont icon-${r.props.params.fontIcon} er-iconfont`),style:l.normalizeStyle({height:"16px",width:"16px",fontSize:"14px",color:r.props.params.fontColor})},null,6)):(l.openBlock(),l.createElementBlock("img",{key:2,class:"er-remote-img",src:r.props.params.imgIcon},null,8,Nx))])):l.createCommentVNode("",!0),((c=r.props.params.tagText)==null?void 0:c.trim().length)>0&&r.props.params.tagAfterText!==!0?(l.openBlock(),l.createBlock(a,{key:1,style:{display:"inline-block",height:"18px"},color:r.props.params.tagColor||"#87d068",bordered:r.props.params.tagBordered},{default:l.withCtx(()=>{var h;return[l.createTextVNode(l.toDisplayString((h=r.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["color","bordered"])):l.createCommentVNode("",!0),((d=r.props.params.badgeText)==null?void 0:d.trim().length)>0?(l.openBlock(),l.createBlock(s,{key:2,class:"er-badge",count:(u=r.props.params.badgeText)==null?void 0:u.trim(),"number-style":r.badgeNumberStyle,style:{display:"inline-block"}},null,8,["count","number-style"])):l.createCommentVNode("",!0),r.props.params.callFormLink?(l.openBlock(),l.createElementBlock("a",{key:3,onClick:e[0]||(e[0]=l.withModifiers((...h)=>r.navigateToLink&&r.navigateToLink(...h),["prevent"])),style:l.normalizeStyle([{display:"inline-block","text-decoration":"underline"},r.props.params.style])},l.toDisplayString(r.props.params.displayText),5)):r.ER.Core.isUrl(r.props.params.displayText)?(l.openBlock(),l.createElementBlock("a",{key:4,href:r.props.params.displayText,target:"_blank",style:{display:"inline-block"}},l.toDisplayString(r.props.params.displayText),9,Px)):(l.openBlock(),l.createElementBlock("span",{key:5,style:l.normalizeStyle([r.props.params.textStyle,{display:"inline-block"}])},l.toDisplayString(r.props.params.displayText),5)),((f=r.props.params.tagText)==null?void 0:f.trim().length)>0&&r.props.params.tagAfterText===!0?(l.openBlock(),l.createBlock(a,{key:6,style:l.normalizeStyle([{display:"inline-block",height:"18px","margin-left":"5px","padding-left":"1px","padding-right":"1px"},r.props.params.tagStyle]),color:r.props.params.tagColor||"#87d068",bordered:r.props.params.tagBordered},{default:l.withCtx(()=>{var h;return[l.createTextVNode(l.toDisplayString((h=r.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["style","color","bordered"])):l.createCommentVNode("",!0)],4)}const g4=Gr(Fx,[["render",Lx]]),Bx=l.defineComponent({name:"ImagePreview",components:{"a-image":Ke.Image},props:["params"],setup:r=>{const e=new y.ER.UploadHelper,t=l.ref("");return l.onMounted(async()=>{var n;if(r.params.data){if(r.params.data.imageBlobData)t.value=r.params.data.imageBlobData;else if(r.params.src&&r.params.src.split("/").length>1){const i=await e.downloadFile({key:r.params.src});i.flag&&((n=i.result)!=null&&n.data)&&(t.value=URL.createObjectURL(new Blob([i.result.data])),r.params.data.imageBlobData=t.value)}}}),l.onUnmounted(()=>{}),{props:r,imageUrl:t}}});function Vx(r,e,t,n,i,o){const a=l.resolveComponent("a-image");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{src:r.imageUrl||"https://www.antdv.com/#error",alt:"Blob Image",width:r.params.width||100,height:r.params.height||100,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="},null,8,["src","width","height"])])}const p1=Gr(Bx,[["render",Vx]]),Hx=l.defineComponent({name:"SwitchRender",components:{"a-switch":Ke.Switch,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{var u,f,h;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((u=window.$wujie.bus)==null||u.$on("changeThemeEmit",p=>{t.value=Ut()}));const n=r.params.colDef.cellDataType||"boolean",i=r.params.switchOptions||{},o=l.ref(r.params.value??!1);(n==="string"||n==="text")&&(i!=null&&i.onValue)&&(i!=null&&i.offValue)&&(o.value=r.params.value===(i==null?void 0:i.onValue));const a=l.ref(i==null?void 0:i.onText),s=l.ref(i==null?void 0:i.offText),c=((f=r.params.colDef.context)==null?void 0:f.editable)??!1;window.$wujie&&((h=window.$wujie.bus)==null||h.$on("changeThemeEmit",p=>{t.value=Ut()}));const d=p=>{(n==="string"||n==="text")&&(i!=null&&i.onValue)&&(i!=null&&i.offValue)?r.params.setValue(p?i==null?void 0:i.onValue:i==null?void 0:i.offValue):r.params.setValue(o.value)};return l.onMounted(()=>{}),{props:r,antdLocale:e,antdTheme:t,checkedValue:o,editable:c,handleChange:d,checkedChildren:a,unCheckedChildren:s}}}),Ux={key:0,style:{display:"flex"}};function Gx(r,e,t,n,i,o){const a=l.resolveComponent("a-switch"),s=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var c,d;return[!((c=r.props.params.node)!=null&&c.group)&&!((d=r.props.params.node)!=null&&d.rowPinned)?(l.openBlock(),l.createElementBlock("div",Ux,[l.createVNode(a,{checked:r.checkedValue,"onUpdate:checked":e[0]||(e[0]=u=>r.checkedValue=u),disabled:!r.editable,"checked-children":r.checkedChildren,"un-checked-children":r.unCheckedChildren,onChange:r.handleChange},null,8,["checked","disabled","checked-children","un-checked-children","onChange"])])):l.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const m4=Gr(Hx,[["render",Gx]]),zx=l.defineComponent({name:"HeaderGroup",props:["params"],onMounted(){}}),Yx={class:"ag-header-group-cell-label"},Wx=["innerHTML"];function Qx(r,e,t,n,i,o){return l.openBlock(),l.createElementBlock("div",Yx,[l.createElementVNode("div",{class:"er-header-group-text",innerHTML:r.params.displayName},null,8,Wx)])}const Xx=Gr(zx,[["render",Qx],["__scopeId","data-v-440bb297"]]),qx=l.defineComponent({name:"AggregationPanel",props:["params"],setup(r){var i,o;const e=((o=(i=r.params.options)==null?void 0:i.aggregation)==null?void 0:o.format)||"#,##0.######",t=l.reactive({}),n=()=>{var g;const a=(g=r.params.api)!=null&&g.rangeService?r.params.api.rangeService.getCellRanges():void 0;let s=new Pr(0),c=0,d=0,u=2,f=null,h=null;const p={};a&&a.length>0&&a.forEach(m=>{let _=r.params.api.rangeService.getRangeStartRow(m);const T=r.params.api.rangeService.getRangeEndRow(m);for(;!(!_||r.params.api.rangeService.rowPositionUtils.before(T,_)||!m.columns);)m.columns.forEach(E=>{var b,S;if(_===null)return;const D=r.params.api.rangeService.cellPositionUtils.createId({rowPinned:_.rowPinned,column:E,rowIndex:_.rowIndex});if(p[D])return;p[D]=!0;const k=r.params.api.rowRenderer.getRowNode(_);if(!k)return;let P=r.params.api.valueService.getValue(E,k);(S=(b=E.colDef)==null?void 0:b.context)!=null&&S.hideContent&&(P="******"),!y.ER.Core.isNullOrEmpty(P)&&(c++,!(typeof P=="object"&&"value"in P&&(P=P.value,P===""))&&(typeof P=="string"&&(P=Number(P)),typeof P=="number"&&!isNaN(P)&&(new Pr(P).decimalPlaces()>u&&(u=new Pr(P).decimalPlaces()),s=s.add(P),(h===null||P>h)&&(h=P),(f===null||P<f)&&(f=P),d++)))}),_=r.params.api.rangeService.cellNavigationService.getRowBelow(_)}),d>1?(t.average={value:y.ER.Core.formatNumberValue(s.dividedBy(d).toDecimalPlaces(u).toNumber(),e),show:!0},t.sum={value:y.ER.Core.formatNumberValue(s.toNumber(),e),show:!0},t.min={value:y.ER.Core.formatNumberValue(f,e),show:!0},t.max={value:y.ER.Core.formatNumberValue(h,e),show:!0}):(delete t.average,delete t.sum,delete t.min,delete t.max),c>1?t.count={value:c,show:!0}:delete t.count};return{ER:y.ER,aggData:t,setAggData:n}}}),jx={class:"ag-status-panel ag-status-panel-aggregations"},Kx={key:0,class:"ag-status-name-value"},Zx={class:"ag-status-name-value-value"},Jx={key:1,class:"ag-status-name-value"},$x={class:"ag-status-name-value-value"},eA={key:2,class:"ag-status-name-value"},tA={class:"ag-status-name-value-value"},rA={key:3,class:"ag-status-name-value"},nA={class:"ag-status-name-value-value"},iA={key:4,class:"ag-status-name-value"},oA={class:"ag-status-name-value-value"};function aA(r,e,t,n,i,o){var a,s,c,d,u,f,h,p,g,m;return l.openBlock(),l.createElementBlock("div",jx,[(a=r.aggData.average)!=null&&a.show?(l.openBlock(),l.createElementBlock("div",Kx,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Average")||"平均值")+":",1),l.createElementVNode("span",Zx,l.toDisplayString((s=r.aggData.average)==null?void 0:s.value),1)])):l.createCommentVNode("",!0),(c=r.aggData.count)!=null&&c.show?(l.openBlock(),l.createElementBlock("div",Jx,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Count")||"计数")+":",1),l.createElementVNode("span",$x,l.toDisplayString((d=r.aggData.count)==null?void 0:d.value),1)])):l.createCommentVNode("",!0),(u=r.aggData.max)!=null&&u.show?(l.openBlock(),l.createElementBlock("div",eA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Max")||"最大值")+":",1),l.createElementVNode("span",tA,l.toDisplayString((f=r.aggData.max)==null?void 0:f.value),1)])):l.createCommentVNode("",!0),(h=r.aggData.min)!=null&&h.show?(l.openBlock(),l.createElementBlock("div",rA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Min")||"最小值")+":",1),l.createElementVNode("span",nA,l.toDisplayString((p=r.aggData.min)==null?void 0:p.value),1)])):l.createCommentVNode("",!0),(g=r.aggData.sum)!=null&&g.show?(l.openBlock(),l.createElementBlock("div",iA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Sum")||"总和")+":",1),l.createElementVNode("span",oA,l.toDisplayString((m=r.aggData.sum)==null?void 0:m.value),1)])):l.createCommentVNode("",!0)])}const E4=Gr(qx,[["render",aA],["__scopeId","data-v-04a55dad"]]);let g1=class{constructor(e){fe(this,"UnMountWhenCloseDialog",!0);fe(this,"_app");fe(this,"_options",{});fe(this,"_popWindowOpened",l.ref(!1));fe(this,"_component");this._options=e||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(e){this._options={...this._options,...e}}async showPopAttachment(e){var t;if(this._app)this._options.refreshKey=G.guid(),this._popWindowOpened.value=!0;else{this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>mq),(t=this._component)!=null&&t.default&&(this._component=this._component.default)));const n=l.createApp(this._component,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=n;const i=document.createElement("div");document.body.appendChild(i),n.mount(i),this._popWindowOpened.value=!0}}},Tc=class{static callMenuForm(e,t){}static callDialogForm(e,t,n,i){}static exportGridAsExcel(e,t,n){}static getImportExcelData(e){return Promise.resolve([])}},lA=class{constructor(e,t,n,i,o){fe(this,"SysDefinedParas");fe(this,"_app");fe(this,"_currentFormRegitInfo",{});fe(this,"_currentConfigCompanyCode");fe(this,"_serverPartition","");fe(this,"_customPartition","");fe(this,"_moduleName","");fe(this,"_formId","");fe(this,"_formName","");fe(this,"_formCaption","");fe(this,"_formWidth",-1);fe(this,"_formHeight",-1);fe(this,"_maxmizeBox",!0);fe(this,"_minimizeBox",!0);fe(this,"_resizable",!0);fe(this,"_initializeFlag",0);fe(this,"_layoutIds");fe(this,"_dataSetName","");fe(this,"_tableNames","");fe(this,"_serviceName","si00_form_get");fe(this,"_initialConfiParas",{});fe(this,"_formInfo",{});fe(this,"_configInfo",{});fe(this,"_systemInfo",{});fe(this,"_customDefaultValues",{});fe(this,"_dropDownRefreshKey",l.reactive({}));fe(this,"_dropDownBindSource",{});fe(this,"_dropDownCascader",{});fe(this,"_gridOptions",{});fe(this,"_gridReactiveOptions",l.reactive({}));fe(this,"_gridToolbarOptions",l.reactive({}));fe(this,"_hiddenFields",{});fe(this,"_requiredFields",{});fe(this,"_requiredFieldsByCondition",{});fe(this,"_formDataSet",new d4);fe(this,"_formBindingRelation",{});fe(this,"_formAuthButtons",{});fe(this,"_groupCompanyCode","");fe(this,"_groupCompanyName","");fe(this,"_formConfigLicens","");fe(this,"_formConfigLicensErrorMsg","WMyNCZMrw9FY9qti+0p7zA==");fe(this,"_privateEncryptKey","QTS8kH81A2Do4qfezJ9cCEM4lZifC7Ym");fe(this,"_developPermission","0");fe(this,"_tempSingleConfigInfo",{});fe(this,"_gridInstanceInfo",{});fe(this,"_itemAuthInfo",{});fe(this,"_gridColumnsConfigInfo",{});fe(this,"_gridStyleInfo",{});fe(this,"_allowMergeColumnFields",{});fe(this,"_widgetInstanceInfo",{});fe(this,"_layoutConditionStyleInfo",{});fe(this,"_layoutConfigRelationInfo",{});fe(this,"_sysParaInfo",{});fe(this,"_gridCustomEvent",{});fe(this,"_formOptions",{});fe(this,"_layoutOpitons",l.reactive({}));fe(this,"_layoutItemOpitons",l.reactive({}));fe(this,"_layoutBindModelUid",l.reactive({}));fe(this,"_layoutBindModel",{});fe(this,"_controlConditionProps",{});fe(this,"_erxGlobalConfig",{});fe(this,"excuteGridColumnExpressions",(e,t)=>{const n={...e},i=Object.keys(n).sort((a,s)=>a.length>s.length?-1:a.length<s.length?1:0);let o=t;i.forEach(a=>{Ht.isDayjs(n[a])?n[a]=n[a].toDate():(n[a]===null||n[a]===void 0)&&(n[a]="");const s=new RegExp(`\\b${a}\\b`,"gi"),c=new RegExp(`[${a}]`.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");c.test(o)?o=o.replaceAll(c,`data.${a}`):s.test(o)&&(o=o.replaceAll(s,`data.${a}`))});try{return new Function("data",o)(n)}catch{console.error("ER: Script has a syntax error: "+o+"; data: "+JSON.stringify(n))}});this._formId=G.guid(),this._serverPartition=e||this._serverPartition,this._serviceName=n||this._serviceName,this._formName=t||this._formName,this._layoutIds=i,this._initialConfiParas=o,this._currentConfigCompanyCode={},this.SysDefinedParas={GroupCompanyCode:"BS",GroupCompanyName:"宝信软件",DefaultRmbCode:"CNY"}}get App(){return this._app}get Locale(){return Xs()}get IsRtl(){return ii()}get ModuleName(){return this._moduleName}get FormId(){return this._formId}get FormName(){return this._formName}get FormCaption(){return this._formCaption}get FormWidth(){return this._formWidth}get FormHeight(){return this._formHeight}get MaxmizeBox(){return this._maxmizeBox}get MinimizeBox(){return this._minimizeBox}get Resizable(){return this._resizable}get InitializeFlag(){return this._initializeFlag}get FormInfo(){return this._formInfo}get ConfigInfo(){return this._configInfo}get SystemInfo(){return this._systemInfo}get DropDownRefreshKey(){return this._dropDownRefreshKey}get DropDownBindSource(){return this._dropDownBindSource}get DropDownCascader(){return this._dropDownCascader}get FormOptions(){return this._formOptions}get GridOptions(){return this._gridOptions}get GridToolbarOptions(){return this._gridToolbarOptions}get RequiredFields(){return this._requiredFields}get RequiredFieldsByCondition(){return this._requiredFieldsByCondition}get AllowMergeColumnFields(){return this._allowMergeColumnFields}get FormDataSet(){return this._formDataSet}get FormBindingRelation(){return this._formBindingRelation}get FormAuthButtons(){return this._formAuthButtons}get DefaultConfigCompanyCode(){return"BS"}get DefaultConfigCompanyName(){return"宝信软件"}get ServerPartition(){return this._serverPartition}get CustomPartition(){return this._customPartition}get InitialConfiParas(){return this._initialConfiParas}get InitialService(){return this._serviceName}get CurrentConfigCompanyCode(){return this._currentConfigCompanyCode}get GroupCompanyCode(){return this._groupCompanyCode}get GroupCompanyName(){return this._groupCompanyName}get WidgetInstanceInfo(){return this._widgetInstanceInfo}get DevelopPermission(){return this._developPermission}get LayoutBindModelUid(){return this._layoutBindModelUid}get ErxGlobalConfig(){return this._erxGlobalConfig}get ItemAuthInfo(){return this._itemAuthInfo}get MenuFormInstance(){return this._currentFormRegitInfo}async Initialize(e,t,n,i,o){var s,c,d,u;this._erxGlobalConfig=await G.getErxGlobalConfig(),(c=(s=this._erxGlobalConfig)==null?void 0:s.License)!=null&&c[nt.CompanyCode]&&(this._formConfigLicens=(u=(d=this._erxGlobalConfig)==null?void 0:d.License)==null?void 0:u[nt.CompanyCode]);const a=G.decryptData(this._formConfigLicens,nt.GridCheckColumnFieldName,G.decryptData(this._privateEncryptKey,nt.GridCheckColumnFieldName,nt.GridCheckColumnFieldName));return this._erxGlobalConfig&&(!this._formConfigLicens||a!==nt.CompanyName)&&this.messageWarning(G.decryptData(this._formConfigLicensErrorMsg,nt.GridCheckColumnFieldName,nt.GridCheckColumnFieldName)),new Promise((f,h)=>{var m;this._serverPartition=(e==null?void 0:e.trim())||this._serverPartition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formName=(t==null?void 0:t.trim())||this._formName,this._initialConfiParas=o||this._initialConfiParas||{},this._layoutIds=n||this._layoutIds;let p="";this._layoutIds&&(typeof this._layoutIds=="string"?p=this._layoutIds:this._layoutIds instanceof Array&&(p=this._layoutIds.join(","))),this._dataSetName=G.toString(o==null?void 0:o.dataSetName).trim()||((m=this._dataSetName)==null?void 0:m.trim())||"#";const g=rt.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:nt.Culture,FUNCTION_IDS:p,DATASET_NAME:this._dataSetName,TABLE_NAMES:this._tableNames}],"Table0");this._initialConfiParas&&Object.keys(this._initialConfiParas).length>0&&g.addMapData("InitializeFormParas",Object.keys(this._initialConfiParas).map(_=>({PARA_NAME:_,PARA_VALUE:this._initialConfiParas?this._initialConfiParas[_]:""}))),Bn.callServiceEx(this._serviceName,g,{partition:this._serverPartition}).then(_=>{var T,x;_.sysFlag>=0?(_.dataMap.forEach((E,D)=>{this._configInfo[D]=E}),((x=(T=this._configInfo)==null?void 0:T.TSI00FORM)==null?void 0:x.length)>0?(this.InitializeWithData(),f({flag:this._initializeFlag,msg:"success"})):(this._initializeFlag=-1,f({flag:this._initializeFlag,msg:`The configuration information for the form [${this._formName}] was not found`}))):(this._initializeFlag=-1,f({flag:this._initializeFlag,msg:_.sysMsg}))},_=>{f({..._,flag:-1,msg:_.msg||"unknown error"})})})}InitializeWithData(){var e,t,n,i,o;this._initializeFlag=1,this._formInfo=this._configInfo.TSI00FORM[0]||{},this._moduleName=this._formInfo.MODULE_NAME,this.ModuleName.length<2?this._moduleName="GC":this._moduleName=this.ModuleName.substring(0,2),this._formName=this._formInfo.FORM_NAME,this._formWidth=G.toNumber(this._formInfo.FORM_WIDTH)||800,this._formHeight=G.toNumber(this._formInfo.FORM_HEIGHT)||650,this._formCaption=this._formInfo.FORM_FUNC_DESC,this._minimizeBox=this._formInfo.MINIMIZE==="1",this._maxmizeBox=this._formInfo.MAXIMIZE==="1",this._resizable=this._formInfo.FORM_STYLE!=="3",this._formConfigLicens=this._formInfo.LICENSE,this._groupCompanyCode=((e=this._formInfo.GROUP_COMPANY_CODE)==null?void 0:e.trim())||this._groupCompanyCode,this._groupCompanyName=((t=this._formInfo.GROUP_COMPANY_NAME)==null?void 0:t.trim())||this._groupCompanyName,this._configInfo[nt.SystemParamsBlockName]&&(this._systemInfo=this._configInfo[nt.SystemParamsBlockName][0],this._developPermission=this.getFormSysInfo("DEV_LICENSE")),((n=this._formInfo.EXT_OPTIONS)==null?void 0:n.trim().length)>0&&(this._formOptions=JSON.parse(this._formInfo.EXT_OPTIONS)),((o=(i=this._configInfo)==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0?(this.createDataSet(),this._configInfo.TSI00GRIDVIEW.forEach(a=>{this.setDropDownBindSourceAndRequiredFields(a)})):console.error("ER: No view configuration information found")}setMenuFormInstance(e){var t,n,i,o,a,s,c,d,u,f,h;if((t=e==null?void 0:e.attrs)!=null&&t.__eiInfo){const p=(n=e==null?void 0:e.attrs)==null?void 0:n.__eiInfo;this._currentFormRegitInfo.formEname=(i=p==null?void 0:p.extAttr)==null?void 0:i.efFormEname,this._currentFormRegitInfo.formCname=(o=p==null?void 0:p.extAttr)==null?void 0:o.efFormCname,this._currentFormRegitInfo.formLoadPath=(a=p==null?void 0:p.extAttr)==null?void 0:a.efFormLoadPath,this._currentFormRegitInfo.formInfo=p==null?void 0:p.extAttr,this._currentFormRegitInfo.formQueryParams=G.getQueryParams((s=p==null?void 0:p.extAttr)==null?void 0:s.efFormLoadPath),this._currentFormRegitInfo.formButtons={},(d=(c=e==null?void 0:e.attrs)==null?void 0:c.__buttonsEi)!=null&&d.blocks&&Object.keys((f=(u=e==null?void 0:e.attrs)==null?void 0:u.__buttonsEi)==null?void 0:f.blocks).forEach(g=>{var m,_;this._currentFormRegitInfo.formButtons[g]=(_=(m=e==null?void 0:e.attrs)==null?void 0:m.__buttonsEi)==null?void 0:_.getBlock(g).getMappedRows(),this._formAuthButtons[g]=this._currentFormRegitInfo.formButtons[g]})}else e!=null&&e.buttonInfo&&(this._currentFormRegitInfo.appName=e==null?void 0:e.appName,this._currentFormRegitInfo.formEname=e==null?void 0:e.formName,this._currentFormRegitInfo.formCname=e==null?void 0:e.formCaption,this._currentFormRegitInfo.formLoadPath=e==null?void 0:e.formPath,this._currentFormRegitInfo.formInfo=e==null?void 0:e.formInfo,this._currentFormRegitInfo.formQueryParams=G.getQueryParams(e==null?void 0:e.formLoadPath),this._currentFormRegitInfo.formButtons={},((h=e==null?void 0:e.buttonInfo)==null?void 0:h.length)>0&&(this._currentFormRegitInfo.formButtons=e==null?void 0:e.buttonInfo.filter(p=>{var g;return((g=p.regionId)==null?void 0:g.trim().length)>0}).reduce((p,g)=>{const m=g.regionId;p[m]||(p[m]=[]);const _={...g,button_ename:g.name,button_cname:g.desc,...G.jsonParseSafe(g.extProperty)};return p[m].push(_),p},{}),Object.keys(this._currentFormRegitInfo.formButtons).forEach(p=>{this._currentFormRegitInfo.formButtons[p].sort((g,m)=>G.toNumber(g.nodeSortId)-G.toNumber(m.nodeSortId)),this._formAuthButtons[p]=this._currentFormRegitInfo.formButtons[p]})))}async loadConfig(e,t){return new Promise((n,i)=>{var a,s;t={...this._initialConfiParas,...t};const o=e.trim().length>0?e.split(",").filter(c=>c.trim().length>0):[];if(o.length>0){const c=t.reload==="1"?o.join(","):o.filter(u=>!this.containsConfig(u.trim())).join(","),d=(c==null?void 0:c.length)>0?c.split(","):[];if(d.length>0){const u=rt.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:nt.Culture,FUNCTION_IDS:c,DATASET_NAME:"#",TABLE_NAMES:"",EXIST_TABLES:((s=Object.keys((a=this._formDataSet)==null?void 0:a.dataTables))==null?void 0:s.join(","))||"",INI_FLAG:this._initializeFlag}],"Table0");t&&Object.keys(t).length>0&&u.addMapData("InitializeFormParas",Object.keys(t).map(f=>({PARA_NAME:f,PARA_VALUE:t?t[f]:""}))),Bn.callServiceEx(this._serviceName,u,{partition:this._serverPartition}).then(f=>{f.sysFlag>=0&&(f.dataMap.forEach((p,g)=>{[nt.SystemParamsBlockName,"TESCOMPANYINFO","TSI00FORM","TSI00DATASOURCE","TSI00DATATABLE","TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].includes(g)||(this._configInfo[g]=p)}),["TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].forEach(p=>{if(f.contains(p)&&this._configInfo[p]&&f.getMapData(p).length>0){if((t==null?void 0:t.reload)==="1"&&this._configInfo[p].length>0)for(let g=this._configInfo[p].length-1;g>=0;g--)d.includes(this._configInfo[p][g].FUNCTION_ID)&&this._configInfo[p].splice(g,1);this._configInfo[p].push(...f.getMapData(p))}}),d.forEach(p=>{var _;(t==null?void 0:t.reload)==="1"&&(this._tempSingleConfigInfo[p]=void 0);const g=this.getSingleViewConfigInfo(p),m=G.toString(g.TABLE_NAME).trim();if(g&&m.length>0&&!this._formDataSet.contains(m)){this._configInfo.TSI00DATATABLE.some(x=>x.TABLE_NAME===m)||f.getMapData("TSI00DATATABLE").length>0&&this._configInfo.TSI00DATATABLE.push(...f.getMapData("TSI00DATATABLE"));const T={};g.FUNCTION_TYPE==="T"&&((_=g.CURRENT_NODE_DESC)==null?void 0:_.trim().length)>0&&g.FATHER_NODE_DESC.trim().length>0&&(T.hierarchy={primaryField:g.CURRENT_NODE_DESC.trim(),parentField:g.CURRENT_NODE_DESC}),this.createDataTable(m,T)}this.setDropDownBindSourceAndRequiredFields(g)})),n({flag:f.sysFlag>=0?1:-1,msg:f.sysMsg})},f=>{n({...f,flag:-1,msg:"unknown error"})})}else n({flag:1,msg:"Configuration ["+e.trim()+"] already exists"})}else n({flag:-1,msg:"No config id"})})}$t(e,t){var i,o;let n;if((e==null?void 0:e.trim().length)>0){for(let a=0;a<((o=(i=this.ConfigInfo.TSI00FORMRESOURCE)==null?void 0:i.data)==null?void 0:o.length);a++)if(this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_CODE===e){n=this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_VALUE_RES||this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_VALUE;break}n=n??G.$t(e,t)}return n??""}setFormCapiton(e){return this._formCaption=e,this}setFormOptions(e){return this._formOptions={...this._formOptions,...e},this}setDropDownBindSourceAndRequiredFields(e){const t={},n={},i=[],o=[],a=["F3","F6","F7","FD","FA","FB","FP","FC","FH","FL","FJ","FK","G1","G2","G4","GD","GP"];if(this._configInfo.TSI00GRIDCOLUMN&&this._configInfo.TSI00GRIDCOLUMN.length>0){let s=[],c=nt.CompanyCode;e.MATCH_FLAG==="1"&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===e.FUNCTION_ID&&d.COMPANY_CODE===c&&(a.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length===0&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===e.FUNCTION_ID&&d.COMPANY_CODE===this.DefaultConfigCompanyCode&&(a.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length>0&&s.forEach(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;if(a.includes(u))if(d.ORIGIN_CODE!=="0"&&d.SVC_NAME.trim().length>0){if(t[d.ITEM_CODE]=this.setDropDownBindOptions(e.FUNCTION_TYPE,d),d.FATHER_FIELD.trim().length>0&&d.FORM_FILTER.trim().length>0&&d.FORM_FILTER.trim()!=="0"){d.LAYOUT_ID.trim().length===0&&(d.LAYOUT_ID=e.FUNCTION_ID),this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()]||(this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()]=[]);const f={};f.COLUMN_EDIT=d.COLUMN_EDIT,f.FUNCTION_ID=d.FUNCTION_ID,f.ITEM_CODE=d.ITEM_CODE,f.FORM_FILTER=d.FORM_FILTER,f.FUNCTION_TYPE=e.FUNCTION_TYPE,this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()].push(f)}n[d.ITEM_CODE]=G.guid()}else console.warn(`ER: The dropdown data source for [${e.FUNCTION_ID}.${d.ITEM_CODE}] is not configured!`);d.ITEM_MUST_FLAG==="1"&&(d.MUST_INPUT_CONDITION.trim().length>0?o.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME,MUST_INPUT_CONDITION:d.MUST_INPUT_CONDITION,CONDITION_TABLE:d.CONDITION_TABLE}):i.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME}))})}this._dropDownRefreshKey[e.FUNCTION_ID]=n,this._dropDownBindSource[e.FUNCTION_ID]=t,this._requiredFields[e.FUNCTION_ID]=i,this._requiredFieldsByCondition[e.FUNCTION_ID]=o}setCustomPartition(e){return this._customPartition=e,this._customPartition}setLayoutCaption(e,t){this.setLayoutOptions(e,"layoutCaption",t)}getLayoutCaption(e){return G.toString(this.getLayoutOptions(e,"layoutCaption"))}getLayoutBindModel(e){if(this._layoutBindModel[e]===void 0){const t=new qr;t.uid="",this._layoutBindModel[e]=l.reactive(t)}return this._layoutBindModel[e]}refreshLayoutBindModel(e){const t=this.getBindingTable(e);let n=t==null?void 0:t.Current;n||(n=new qr,n.uid=""),this._layoutBindModel[e]=l.reactive(n),this._layoutBindModelUid[e]=n.uid}setLayoutBindForm(e,t){this.setLayoutOptions(e,"bindForm",t)}getLayoutBindForm(e){return this.getLayoutOptions(e,"bindForm")}setLayoutOptions(e,t,n){return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(e=e.trim(),t=t.trim(),this._layoutOpitons[e]=this._layoutOpitons[e]||{},this._layoutOpitons[e][t]=n),this}getLayoutOptions(e,t){let n;return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(e=e.trim(),this._layoutOpitons[e]&&(n=this._layoutOpitons[e][t==null?void 0:t.trim()])),(n==null?void 0:n.value)!==void 0?n==null?void 0:n.value:n}setLayoutItemOption(e,t,n){return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&n&&(this._layoutItemOpitons[e]=this._layoutItemOpitons[e]||{},this._layoutItemOpitons[e][t]=this._layoutItemOpitons[e][t]||{},Object.keys(n).forEach(i=>{l.isRef(this._layoutItemOpitons[e][t][i])?this._layoutItemOpitons[e][t][i].value=n[i]:this._layoutItemOpitons[e][t][i]=l.ref(n[i])})),this}getLayoutItemOption(e,t,n){let i;return this._layoutItemOpitons[e]&&this._layoutItemOpitons[e][t]&&(i=this._layoutItemOpitons[e][t][n]),(i==null?void 0:i.value)!==void 0?i==null?void 0:i.value:i}setLayoutItemValidateRules(e,t,n,i=!1){if((e==null?void 0:e.trim().length)>0&&typeof t=="string"&&(t==null?void 0:t.trim().length)>0){const o=this.getLayoutBindForm(e);if(o!=null&&o.rulesRef)if(o.rulesRef[t]=o.rulesRef[t]||[],i&&o.rulesRef[t])if((n==null?void 0:n.length)>0){const a=[];n.forEach((s,c)=>{n[c].itemCode=t;let d=!1;for(let u=0;u<o.rulesRef[t].length;u++)if(o.rulesRef[t][u].customType===s.customType){o.rulesRef[t][u]=s,d=!0;break}d||a.push(s)}),a.length>0&&o.rulesRef[t].push(...a)}else o.rulesRef[t]=[];else o.rulesRef[t].push(...n)}return this}setLayoutItemValidator(e,t,n,i=!1){const o=[];return o.push({message:"",trigger:"change",itemCode:t,validator:(a,s)=>n instanceof Function?n(s)===!0?(a.message="",Promise.resolve()):(a.message=n(s)||"",Promise.reject(new Error("Invalid value"))):(a.message="",Promise.resolve())}),this.setLayoutItemValidateRules(e,t,o,i),this}setLayoutItemCaptionForeColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{o.trim().length>0&&this.setLayoutItemOption(e,o,{LabelForeColor:n})}),this}setLayoutItemCaptionBackColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{o.trim().length>0&&this.setLayoutItemOption(e,o,{LabelBackColor:n})}),this}setLayoutItemContentForeColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","erTreeSelect","erMultiTreeSelect","antInput","antInputNumber","antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(a)&&this.setControlCss(e,o,[{property:"color",value:n}]),this.setLayoutItemOption(e,o,{TextForeColor:n})}}),this}setLayoutItemContentBackColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","antInput","antInputNumber"].includes(a)&&this.setControlCss(e,o,[{property:"background",value:n}]),this.setLayoutItemOption(e,o,{TextBackColor:n})}}),this}setLayoutConditionStyleConfigInfo(e,t,n){return this._layoutConditionStyleInfo[e]=this._layoutConditionStyleInfo[e]||{},this._layoutConditionStyleInfo[e][t]=n,this}setLayoutConditionStyle(e,t){if((e==null?void 0:e.trim().length)>0){const n=this.getLayoutBindModel(e);if(n&&this._layoutConditionStyleInfo[e==null?void 0:e.trim()]){const i=a=>{var c,d,u,f,h,p,g,m;const s=this._layoutConditionStyleInfo[e==null?void 0:e.trim()][a];s&&(G.checkExpressionValid(n,G.getSystemFormatString(s.condition))?(((c=s.labelForeColor)==null?void 0:c.trim().length)>0&&this.setLayoutItemCaptionForeColor(e,a,s.labelForeColor),((d=s.labelBackgroundColor)==null?void 0:d.trim().length)>0&&this.setLayoutItemCaptionBackColor(e,a,s.labelBackgroundColor),((u=s.textForeColor)==null?void 0:u.trim().length)>0&&this.setLayoutItemContentForeColor(e,a,s.textForeColor),((f=s.textBackgroundColor)==null?void 0:f.trim().length)>0&&this.setLayoutItemContentBackColor(e,a,s.textBackgroundColor)):(((h=s.labelForeColor)==null?void 0:h.trim().length)>0&&this.setLayoutItemCaptionForeColor(e,a,""),((p=s.labelBackgroundColor)==null?void 0:p.trim().length)>0&&this.setLayoutItemCaptionBackColor(e,a,""),((g=s.textForeColor)==null?void 0:g.trim().length)>0&&this.setLayoutItemContentForeColor(e,a,""),((m=s.textBackgroundColor)==null?void 0:m.trim().length)>0&&this.setLayoutItemContentBackColor(e,a,"")))};let o;t instanceof Array?o=t:t&&(t==null?void 0:t.trim().length)>0?o=t.split(","):o=Object.keys(this._layoutConditionStyleInfo[e]),(o==null?void 0:o.length)>0&&o.forEach(a=>{i(a)})}}return this}bindGridCustomEvent(e,t,n){return this._gridCustomEvent[e]=this._gridCustomEvent[e]||{},this._gridCustomEvent[e][t]=n,this}getGridCustomEvent(e,t){let n;return this._gridCustomEvent[e]&&this._gridCustomEvent[e][t]&&(n=this._gridCustomEvent[e][t]),n}getCompanyName(e){var n,i,o;let t="";return(e==null?void 0:e.trim().length)>0&&((n=this._configInfo.TESCOMPANYINFO)==null?void 0:n.length)>0&&(t=((o=(i=this._configInfo.TESCOMPANYINFO.find(a=>a.COMPANYCODE===e))==null?void 0:i.COMPANYNAME)==null?void 0:o.trim())||""),t}cloneTableForLayoutOrGrid(e,t,n){var i,o,a,s,c,d;if(this.InitializeFlag>0&&e.trim().length>0&&t.trim().length>0&&n.trim().length>0&&!((i=this._formDataSet)!=null&&i.contains(t.trim())))if(n=n.trim(),e=e.trim(),t=t.trim(),(o=this._formDataSet)!=null&&o.contains(e)||(e=this.getBindingTableName(e)),e.length>0&&((a=this._formDataSet)!=null&&a.contains(e))){const u=(s=this._formDataSet)==null?void 0:s.getDataTable(e),f=(c=this._formDataSet)==null?void 0:c.cloneDataTable(u,t);(d=this._formDataSet)==null||d.addDataTable(t,f),this._configInfo.TSI00GRIDVIEW.every(p=>p.FUNCTION_ID===n?(p.TABLE_NAME=t,!1):!0),this._formBindingRelation[n]=t;const h=this.getGrid(n);h&&(u==null||u.removeBindingInfo(this,n),h.gridOptions.context.bindingSource=f,h.gridOptions.context.bindTableName=t,f==null||f.setBindingInfo(this,n,"Grid"))}else this.messageError(`ER: The origin table [${e}] does not exist!`);return this}containsConfig(e){const t=this.getConfigInfo(e);return!!(t&&t.TSI00GRIDCOLUMN&&t.TSI00GRIDCOLUMN.length>0)}isEmptyConfig(e){return!this.containsConfig(e)}getConfigInfo(e,t=!1){let n={},i=nt.CompanyCode;if(this._tempSingleConfigInfo[e])n=this._tempSingleConfigInfo[e];else{let o=[];if(this._configInfo.TSI00GRIDVIEW&&(o=this._configInfo.TSI00GRIDVIEW.filter(a=>a.FUNCTION_ID===e),o.length>0)){n.TSI00GRIDVIEW=o;const a=n.TSI00GRIDVIEW.FUNCTION_TYPE,s=n.TSI00GRIDVIEW.MATCH_FLAG;this._configInfo.TSI00GRIDCOLUMN&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&(c.IS_VISIBLE==="1"||t===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.IS_VISIBLE==="1"||t===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMN=o),this._configInfo.TSI00GRIDCOLUMNAUTH&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&(c.USER_ID===nt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.USER_ID===nt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNAUTH=o,o.length>0&&(this._itemAuthInfo[e]={},o.forEach(c=>{this._itemAuthInfo[e][c.ITEM_CODE]=this._itemAuthInfo[e][c.ITEM_CODE]||{},this._itemAuthInfo[e][c.ITEM_CODE][c.USER_ID]=c.AUTH_CODE}))),this._configInfo.TSI00GRIDCOLUMNURL&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNURL=o),this._configInfo.TSI00GRIDSTYLE&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDSTYLE=o),this._configInfo.TSI00GRIDBAND&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i),this._currentConfigCompanyCode["TSI00GRIDBAND"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDBAND"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDBAND=o),this._configInfo.TSI00GRIDVIEWCUS&&a!=="F"&&(o=this._configInfo.TSI00GRIDVIEWCUS.filter(c=>c.FUNCTION_ID===e),n.TSI00GRIDVIEWCUS=o),this._tempSingleConfigInfo[e]=n}}return n}getSingleViewConfigInfo(e){let t={};if(this._configInfo.TSI00GRIDVIEW&&this._configInfo.TSI00GRIDVIEW.length>0){for(let n=0;n<this._configInfo.TSI00GRIDVIEW.length;n++)if(this._configInfo.TSI00GRIDVIEW[n].FUNCTION_ID===e)return this._configInfo.TSI00GRIDVIEW[n]}return t}getSingleItemConfigInfo(e,t,n){var o,a;let i={};if(this._gridColumnsConfigInfo[e]===void 0&&(this._gridColumnsConfigInfo[e]={}),this._gridColumnsConfigInfo[e][t])i=this._gridColumnsConfigInfo[e][t];else{(!n||n.trim().length===0)&&(n=nt.CompanyCode),n||(n=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]);const s=this.getConfigInfo(e);(s==null?void 0:s.TSI00GRIDCOLUMN.length)>0&&(s.TSI00GRIDCOLUMN.every((c,d)=>c.COMPANY_CODE===n&&c.FUNCTION_ID===e&&c.ITEM_CODE===t||c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.FUNCTION_ID===e&&c.ITEM_CODE===t?(i=c,!1):!0),Object.keys(i).length>0&&((o=s.TSI00GRIDVIEW)==null?void 0:o.length)>0&&(i.FUNCTION_TYPE=s.TSI00GRIDVIEW[0].FUNCTION_TYPE,((a=i.EXT_OPTIONS)==null?void 0:a.trim().length)>0&&(i.extendOptions=JSON.parse(i.EXT_OPTIONS))),this._gridColumnsConfigInfo[e][t]=i)}return i}getAllItemCodeArray(e){const t=[];e=this.getConfigIdbyLayoutName(e);const n=this.getConfigInfo(e);if(n.TSI00GRIDCOLUMN){const i=n.TSI00GRIDCOLUMN;i.length>0&&i.forEach(o=>{t.push(o.ITEM_CODE)})}return t}getAllConfigIdArray(){const e=[];if(this._configInfo.TSI00GRIDVIEW){const t=this._configInfo.TSI00GRIDVIEW;t.length>0&&t.forEach(n=>{e.push(n.ITEM_CODE)})}return e}getItemDropDownDataSource(e,t){var o;let n=[];const i=this.getSingleItemConfigInfo(e,t);return((o=i==null?void 0:i.SVC_NAME)==null?void 0:o.trim().length)>0&&(this._configInfo[i.FUNCTION_ID+i.ITEM_CODE+nt.CompanyCode]?n=this._configInfo[i.FUNCTION_ID+i.ITEM_CODE+nt.CompanyCode]:this._configInfo[i.FUNCTION_ID+i.ITEM_CODE]?n=this._configInfo[i.FUNCTION_ID+i.ITEM_CODE]:this._configInfo[i.FUNCTION_ID+i.SVC_NAME]?n=this._configInfo[i.FUNCTION_ID+i.SVC_NAME]:this._configInfo["SI->"+i.SVC_NAME]?n=this._configInfo["SI->"+i.SVC_NAME]:this._configInfo["EP->"+i.SVC_NAME]?n=this._configInfo["EP->"+i.SVC_NAME]:this._configInfo["PM->"+i.SVC_NAME]?n=this._configInfo["PM->"+i.SVC_NAME]:this._configInfo[this._formName+i.SVC_NAME]?n=this._configInfo[this._formName+i.SVC_NAME]:this._configInfo[i.SVC_NAME]?n=this._configInfo[i.SVC_NAME]:this.messageError(`Can not find the data source config for [${e}.${t}]!`)),n}setDropDownBindOptions(e,t,n){var k,P,b,S,w;((k=t.EXT_OPTIONS)==null?void 0:k.trim().length)>0&&(t.extendOptions=JSON.parse(t.EXT_OPTIONS));const i=G.toString(t.DISPLAY_COLS).toUpperCase();let o=G.toString(t.DISPLAY_CAPTIONS).trim();const a=((b=(P=t.extendOptions)==null?void 0:P.dropdownOptions)==null?void 0:b.displayWidths)||[];let s=!1;const c=G.toString(t.VALUE_MEMBER).toUpperCase(),d=G.toString(t.DISPLAY_MEMBER).toUpperCase(),u=G.toNumber(t.VALUE_POSITION),f=G.toNumber(t.DISPLAY_POSITION),h=[],p=G.$t("ERX.CodeColumn")||"代码",g=G.$t("ERX.DescriptionColumn")||"描述";o.startsWith("$t(")&&o.endsWith(")")&&(o=o.substring(3,o.length-1),s=!0);let m="CODE";c.trim().length>0&&(m=c.trim());let _="CODE_DESC_1_CONTENT";d.trim().length>0&&(_=d.trim()),h.push(m,_);const T={dataValueField:"",dataTextField:"",dataSource:[],filterFields:h,columns:[{field:m,title:p,width:150},{field:_,title:g,width:150}],codeClass:t.SVC_NAME,layoutType:e,columnConfig:t};let x=[];n&&n instanceof Function&&(n=n());const E=n||this.getItemDropDownDataSource(t.FUNCTION_ID,t.ITEM_CODE)||[];if(i.length>0&&o.length>0){const I=i.split(","),v=o.split(",");if(I.length!==v.length)this.messageError("[DisplayColumns] array length need same to [DisplayCaptions] array length!");else{const A=[];for(let B=0;B<I.length;B++){const O={field:I[B],title:v[B].trim(),width:150};G.toNumber(a[B])>0&&(O.width=G.toNumber(a[B])),O.title.startsWith("$t(")&&O.title.endsWith(")")?O.title=G.$t(O.title.substring(3,O.title.length-1)):s&&(O.title=G.$t(O.title)),A.push(O),h.push(O.field)}c.trim().length>0&&d.trim().length>0?(m=c.trim(),_=d.trim()):(u>=0&&u<I.length?m=I[u]:m=I[0],f>=0&&u<I.length?_=I[f]:I.length>1?_=I[1]:_=I[0]),T.columns=A,T.dataValueField=m,T.dataTextField=_}}else if(E.length>0){const I=Object.keys(E[0]);(E[0][m]===void 0||E[0][_]===void 0)&&(E[0][m]===void 0&&(m=I[0]),E[0][_]===void 0&&(I.length>1?_=I[1]:_=I[0])),T.columns=t.VALUE_VISIBLE==="1"?[{field:m,title:p,width:G.toNumber(a[0])||150},{field:_,title:g,width:G.toNumber(a[1])||150}]:[{field:_,title:g,width:G.toNumber(a[0])||150}],t.VALUE_VISIBLE==="1"&&h.push(m)}else c.trim().length>0&&d.trim().length>0&&(m=c.trim(),_=d.trim(),T.columns=t.VALUE_VISIBLE==="1"?[{field:m,title:p,width:G.toNumber(a[0])||150},{field:_,title:g,width:G.toNumber(a[1])||150}]:[{field:_,title:g,width:G.toNumber(a[0])||150}],t.VALUE_VISIBLE==="1"&&h.push(m));t.ADD_EMPTY_ITEM==="1"&&(T.optionLabel="—-—"),t.FORMAT_TYPE==="Custom"&&((S=t.FORMAT_STRING)==null?void 0:S.trim().length)>0?T.displayFormat=(w=t.FORMAT_STRING)==null?void 0:w.trim():t.DISPLAY_POSITION===t.VALUE_POSITION&&G.toNumber(t.VALUE_POSITION)>=0||t.DISPLAY_MEMBER===t.VALUE_MEMBER&&t.VALUE_MEMBER.trim().length>0?T.displayFormat="{0}":t.VALUE_VISIBLE==="1"?T.displayFormat="{0}|{1}":T.displayFormat="{1}",E&&E instanceof Array&&(x=E.map(I=>({...I,value:I[m],label:I[_]}))),h.push(_),T.autoWidth=!0,T.dataSource=x,T.dataValueField=m,T.dataTextField=_;let D=0;return T.columns.forEach(I=>{D+=I.width}),T.dropDownWidth=D,T}filterDropDownCascaderDataSource(e,t,n){const i=[];if(Array.isArray(n)&&n.length>0?i.push(...n):G.toString(n).length>0&&i.push(G.toString(n)),e&&e.length>0&&t.length>0&&i.length>0)if(t.toLowerCase().startsWith("script:")&&t.length>7){t=G.getSystemFormatString(t.substring(7)).replaceAll("{0}",`${i.join(",")}`);const o=[];return e.forEach(a=>{G.checkExpressionValid(a,t)&&o.push(a)}),o}else{const o=t.indexOf(" like ")>=0?"like":t.indexOf("<>")>=0?"<>":"=",a=t.split(o);if(a.length===2){const s=a[0].trim().toUpperCase(),c=a[1].trim().toUpperCase(),d=[];return e.forEach(u=>{const f=G.toString(u[s]).trim();if(f.length>0){for(let h=0;h<i.length;h++)if(o==="like"){if(c.startsWith("'%")&&c.endsWith("%'")&&f.indexOf(i[h])>=0){d.push(u);break}else if(c.startsWith("'%")&&f.endsWith(i[h])){d.push(u);break}else if(f.startsWith(i[h])){d.push(u);break}}else if(o==="<>"){if(f!==i[h]){d.push(u);break}}else if(f===i[h]){d.push(u);break}}}),d}}return e}setDropDownCascaderDataSource(e,t,n){this._dropDownCascader[e+t]&&this._dropDownCascader[e+t].length>0&&this._dropDownCascader[e+t].forEach(o=>{if(o.FUNCTION_TYPE==="F"){const a=this._dropDownBindSource[o.FUNCTION_ID][o.ITEM_CODE].dataSource,s=o.FORM_FILTER.trim(),c=this.filterDropDownCascaderDataSource(a,s,n);o.dataSource=c,this.reloadDropDownDataSource(o.FUNCTION_ID,o.ITEM_CODE,o.dataSource)}})}getDropDownCascaderDataTable(e,t,n,i){let o;return e.trim().length>0&&t.trim().length>0&&n.trim().length>0&&i.trim().length>0&&this._dropDownCascader[n.trim()+i.trim()]&&this._dropDownCascader[n.trim()+i.trim()].length>0&&this._dropDownCascader[n.trim()+i.trim()].every(a=>a.FUNCTION_ID===e.trim()&&a.ITEM_CODE===t.trim()?(o=a.dataSource,!1):!0),o}getGridStyleConfig(e){return this._gridStyleInfo[e]}setDropDownAutoFillFieldForLayout(e,t,n){var a,s;n&&n instanceof Array&&(n=n.join(","));const i=this.getSingleItemConfigInfo(e,t),o=((a=i==null?void 0:i.extendOptions)==null?void 0:a.autoFillColumns)||((s=i.AUTOFILL_COLS)==null?void 0:s.trim())||"";if(o.trim().length>0){const c=o.split(";").filter(u=>u.trim().length>0),d=this.getDropDownSelectedData(e,t,n);c.forEach(u=>{if(u.trim().length>0){const f=u.split("="),h=f[0].trim().toUpperCase();let p=f[0].trim().toUpperCase();if(f.length>1&&(p=f[1].trim().toUpperCase()),d&&d instanceof Array){let g="";d.forEach(m=>{const _=G.toString(m[h]).trim();_.length>0&&(g=g.length===0?_:g+","+_)}),this.setControlValue(e,p,g)}else this.setControlValue(e,p,d[h])}})}}setDropDownAutoFillFieldsForGrid(e,t,n){var o,a,s,c,d,u,f,h,p,g,m,_;const i=this.getGrid(e);if(i&&((o=n==null?void 0:n.data)!=null&&o.uid)){const T=(a=i.gridOptions.context)==null?void 0:a.configId,x=(c=(s=i.gridOptions.context)==null?void 0:s.viewConfig)==null?void 0:c.AUTO_SELECT_MODE,E=this.getGridColumn(e,t);if((u=(d=E==null?void 0:E.colDef)==null?void 0:d.context)!=null&&u.columnConfig){const D=(h=(f=E==null?void 0:E.colDef)==null?void 0:f.context)==null?void 0:h.columnConfig,k=((p=D==null?void 0:D.extendOptions)==null?void 0:p.autoFillColumns)||((g=D.AUTOFILL_COLS)==null?void 0:g.trim())||"";let P=[],b={};if(k.trim().length>0&&D.COLUMN_EDIT!=="3"&&(P=k.split(";"),n.data[t]&&(b=this.getDropDownSelectedData(T,t,n.data[t])),P.forEach(S=>{if(S.trim().length>0){const w=S.trim().split("="),I=w[0].toUpperCase().trim();let v=w[0].toUpperCase().trim();if(w.length>1&&(v=w[1].toUpperCase().trim()),b&&b instanceof Array){let A="";b.forEach(B=>{const O=G.toString(B[I]).trim();O.length>0&&(A=A.length===0?O:A+","+O)}),n.data.set(v,A)}else n.data.set(v,b[I]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[v,nt.GridCheckColumnFieldName]})}})),n.isSelected()&&D.MULTI_ROW_EDIT==="1"&&x!=="1"&&x!=="3"){const S=this.getGridOptions(T,"multiRowEdit");S!==!1&&S!=="0"&&(((_=(m=i.gridOptions.context)==null?void 0:m.options)==null?void 0:_.multiRowEditType)==="all"?i.gridOptions.api.foreachLeafNode(w=>{var I;w!=null&&w.selected&&((I=w.data)!=null&&I.uid)&&w.data.uid!==n.data.uid&&P.forEach(v=>{if(v.trim().length>0){const A=v.trim().split("="),B=A[0].toUpperCase().trim();let O=A[0].toUpperCase().trim();if(A.length>1&&(O=A[1].toUpperCase().trim()),b&&b instanceof Array){let M="";b.forEach(R=>{const H=G.toString(R[B]).trim();H.length>0&&(M=M.length===0?H:M+","+H)}),w.setDataValue(O,M)}else w.setDataValue(O,b[B]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[O,nt.GridCheckColumnFieldName]})}})}):i.gridOptions.api.forEachNodeAfterFilter(w=>{var I;w!=null&&w.selected&&((I=w.data)!=null&&I.uid)&&w.data.uid!==n.data.uid&&P.forEach(v=>{if(v.trim().length>0){const A=v.trim().split("="),B=A[0].toUpperCase().trim();let O=A[0].toUpperCase().trim();if(A.length>1&&(O=A[1].toUpperCase().trim()),b&&b instanceof Array){let M="";b.forEach(R=>{const H=G.toString(R[B]).trim();H.length>0&&(M=M.length===0?H:M+","+H)}),w.setDataValue(O,M)}else w.setDataValue(O,b[B]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[O,nt.GridCheckColumnFieldName]})}})}))}}}}addDropDownCode(e,t,n,i="push"){var o,a;if((e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(n==null?void 0:n.length)>0&&this._dropDownBindSource[e.trim()]&&this._dropDownBindSource[e.trim()][t.trim()]){const s=this._dropDownBindSource[e.trim()][t.trim()];if(s.dataSource!==void 0&&s.dataSource instanceof Array){i==="unshift"?s.dataSource.unshift(...n):s.dataSource.push(...n);const c=this.getSingleItemConfigInfo(e,t);if(c.FUNCTION_TYPE==="F")this._dropDownRefreshKey[e][t]=G.guid(),this.setControlEmptyValue(e,t);else if(c.FUNCTION_TYPE==="G"||c.FUNCTION_TYPE==="P"){const d=this.getGridColumn(e,t);if(d!=null&&d.colDef){this.setGridColumnDropdown(e,d.colDef,s.dataSource,(o=d.colDef.context)==null?void 0:o.valueField,(a=d.colDef.context)==null?void 0:a.textField,s.displayFormat);const u=this.getGridApi(e);u==null||u.refreshCells({columns:[d.colId]})}}}}}async reloadDropDownDataSource(e,t,n){var i,o,a;if((e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0){const s=this.getSingleItemConfigInfo(e,t);if(s){let c=[];if(n&&n instanceof Function&&(n=n()),(n==null?void 0:n.data)instanceof Array)c=n.data;else if((n==null?void 0:n.getMappedRows)instanceof Function)c=n.getMappedRows();else if(n instanceof Array)c=n;else if(s.ORIGIN_CODE==="2"&&s.SVC_NAME.trim().length>0){const u=rt.buildMap([{FUNCTION_ID:s.SVC_NAME,COMPANY_CODE:nt.CompanyCode}],"DATA_SOURCE"),f=await this.callServiceEx(nt.dynamicQueryService,u);f.sysFlag>=0&&(c=f.getMapData(0))}const d=this.setDropDownBindOptions(s.FUNCTION_TYPE,s,c);if(this._dropDownBindSource[e.trim()]=this._dropDownBindSource[e.trim()]||{},this._dropDownBindSource[e.trim()][t.trim()]=d,s.FUNCTION_TYPE==="F"){const u=this.getControlValue(e,t);u&&!((i=d==null?void 0:d.dataSource)!=null&&i.some(f=>f[d.dataValueField]===u))&&this.setControlEmptyValue(e,t)}else if(s.FUNCTION_TYPE==="G"||s.FUNCTION_TYPE==="P"){const u=this.getGridColumn(e,t);if(u!=null&&u.colDef){this.setGridColumnDropdown(e,u.colDef,c,(o=u.colDef.context)==null?void 0:o.valueField,(a=u.colDef.context)==null?void 0:a.textField,d.displayFormat);const f=this.getGridApi(e);f==null||f.refreshCells({columns:[u.colId]})}}this._dropDownRefreshKey[e][t]=G.guid()}}}createDataSet(){var n,i,o;const e=[];let t="";this._configInfo.TSI00GRIDVIEW.forEach(a=>{var s,c,d;if(((s=a.TABLE_NAME)==null?void 0:s.trim().length)>0&&((c=a.DATASET_NAME)==null?void 0:c.trim().length)>0){const u={};a.FUNCTION_TYPE==="T"&&((d=a.CURRENT_NODE_DESC)==null?void 0:d.trim().length)>0&&a.FATHER_NODE_DESC.trim().length>0&&(u.hierarchy={primaryField:a.CURRENT_NODE_DESC.trim(),parentField:a.FATHER_NODE_DESC}),this.createDataTable(a.TABLE_NAME.trim(),u)&&e.push({tableName:a.TABLE_NAME.trim()}),t=a.DATASET_NAME.trim()}}),((i=(n=this._configInfo)==null?void 0:n.TSI00DATARELATION)==null?void 0:i.length)>0&&this._configInfo.TSI00DATARELATION.forEach(a=>{e.findIndex(s=>s.tableName===a.RESERVE1)>=0&&e.findIndex(s=>s.tableName===a.RESERVE7)>=0&&(this._formDataSet.relations[a.RELATION_NAME]=this._formDataSet.relations[a.RELATION_NAME]||[],this._formDataSet.relations[a.RELATION_NAME].push({ParentTable:a.RESERVE1,ChildTable:a.RESERVE7,ParentColumn:a.RESERVE2,ChildColumn:a.RESERVE8}))}),(o=this._formDataSet)==null||o.setName(t)}createDataTable(e,t){var o,a,s,c,d,u;let n;const i={...t};if(e.trim().length>0&&!this._formDataSet.dataTables[e.trim()]){const f={};((o=this._configInfo.TSI00DATATABLE)==null?void 0:o.length)>0&&this._configInfo.TSI00DATATABLE.forEach(h=>{if(h.TABLE_NAME===e.trim()){const p={name:h.COL_NAME,caption:h.COL_CAPTION,maxLength:h.MAX_LENGTH,camelCaseName:G.camelCase(h.COL_NAME)};switch(h.DATA_TYPE.toLowerCase()){case"2":case"decimal":case"numeric":case"int":case"integer":case"bigint":case"smallint":case"number":p.type="number",p.defaultValue=G.toNumber(h.DEFAULT_VALUE);break;case"3":case"date":case"datetime":p.type="datetime",p.defaultValue=G.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;case"4":case"bool":case"boolean":p.type="boolean",p.defaultValue=G.toBoolean(h.DEFAULT_VALUE);break;case"5":case"time":p.type="time",p.defaultValue=G.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;default:p.type="string",p.defaultValue=G.getSystemFormatString(h.DEFAULT_VALUE).trim();break}f[h.COL_NAME]=p}}),Object.keys(f).length>0&&(i.schema=f,n=new Cn(i),this._formDataSet.addDataTable(e.trim(),n))}else n=(a=this._formDataSet)==null?void 0:a.dataTables[e.trim()],i.schema=(s=n==null?void 0:n.options)==null?void 0:s.schema,i.hierarchy=i.hierarchy||((c=n==null?void 0:n.options)==null?void 0:c.hierarchy);return(d=t==null?void 0:t.hierarchy)!=null&&d.primaryField&&((u=t==null?void 0:t.hierarchy)!=null&&u.parentField)&&(i.schema[t.hierarchy.primaryField]===void 0&&console.error(`ER: Hierarchy DataTable's PrimaryField [${t.hierarchy.primaryField}] not exists!`),i.schema[t.hierarchy.parentField]===void 0&&console.error(`ER: Hierarchy DataTable's ParentField [${t.hierarchy.parentField}] not exists!`)),n||console.error(`ER: DataTable [${e}] creation failed!`),n}getTableName(e){var t;return(t=this._formDataSet)==null?void 0:t.getTableName(e)}getBindingTableName(e){var n;let t="";return(e==null?void 0:e.trim().length)>0&&((n=this._formBindingRelation)!=null&&n[e.trim()])&&(t=this._formBindingRelation[e.trim()]),t}setBindingTableName(e){var n;let t="";if((e==null?void 0:e.trim().length)>0){e=e.trim();const i=this.getSingleViewConfigInfo(e);i&&i.TABLE_NAME&&i.TABLE_NAME.trim().length>0&&((n=this._formDataSet)!=null&&n.contains(i.TABLE_NAME.trim()))&&(t=i.TABLE_NAME.trim(),this._formBindingRelation[e]=t)}return t}getBindingTable(e){var i;let t;const n=this.getBindingTableName(e);return n&&n.trim().length>0&&(t=(i=this._formDataSet)==null?void 0:i.dataTables[n]),t}getBindingTableAsDataMap(e){let t;const n=this.getBindingTable(e);return n&&n instanceof Cn&&(t=n.data(),t&&(t=Cn.convertDataType(t,n,"weakly"))),rt.buildMap(t||{},"Table0")}hasDataChange(...e){let t=!1;return e.length===0?e=Object.keys(this._formBindingRelation):e.length===1&&(e=e[0].split(",")),e.forEach(n=>{const i=this.getBindingTable(n);if(i&&i instanceof Cn)if(!t)t=i.hasChanges();else return t}),t}cancelGridChange(e){var n,i;const t=this.getGrid(e);if(t){const o=(i=(n=t.gridOptions)==null?void 0:n.context)==null?void 0:i.bindingSource;o&&o instanceof Cn&&o.cancelChanges()}return this}mergeData(e,t=!0,...n){var i,o,a;if(this.isNullOrEmpty(n)?n=Object.keys(this._formBindingRelation):n.length===1&&n[0]&&typeof n[0]=="string"&&(n=n[0].split(",")),n.length>0){if(n.length===1&&n[0].trim().length>0){const s=this.getBindingTableName(n[0]);(s==null?void 0:s.trim().length)>0&&(e instanceof rt?e.contains(s.trim())?(i=this._formDataSet)==null||i.mergeData(s.trim(),e.getMapData(s.trim()),t):Object.keys(e).length>0&&((o=this._formDataSet)==null||o.mergeData(s.trim(),e.getMapData(),t)):e instanceof Array&&e&&e.length>0&&((a=this._formDataSet)==null||a.mergeData(s.trim(),e,t)),this.autoBestFit(n[0]))}else if(e instanceof rt){const s={};n.forEach(c=>{var u;const d=this.getBindingTableName(c);(d==null?void 0:d.trim().length)>0&&e.contains(d.trim())&&(s[d]||((u=this._formDataSet)==null||u.mergeData(d.trim(),e.getMapData(d.trim()),t),s[d]=!0),this.autoBestFit(c))})}}return this}checkFormChanged(...e){return new Promise(t=>{this.hasDataChange(...e)?this.messageConfirm(G.$t("ERX.ContinueToOperate")||"继续将丢失未保存的更改,是否继续?").then(n=>{t(n)}).catch(()=>{t(!1)}):t(!0)})}addRowToGrid(e,t=!0,n="default",i=!1){var s,c,d,u,f,h;let o;const a=this.getGrid(e);if((s=a==null?void 0:a.gridOptions.context)!=null&&s.bindingSource){a.gridOptions.context.options=a.gridOptions.context.options||{},a.gridOptions.context.options.autoCheckNewRow=i;let p={};n==="default"&&(n=this.getGridOptions(e,"insertAtTop")||"default"),n==="default"&&(n=((u=(d=(c=a==null?void 0:a.gridOptions)==null?void 0:c.context)==null?void 0:d.options)==null?void 0:u.insertAtTop)||"default");const g=this.getGridOptions(e,"autoGuidField");(t===!0||(t==null?void 0:t.setDefaultValue)===!0)&&(p=this.getGridConfigDefaultValues(e)||{}),this._customDefaultValues[e]&&(p={...p,...this._customDefaultValues[e]}),t!=null&&t.data&&(p={...p,...t.data});const m=(f=a.gridOptions.context)==null?void 0:f.bindingSource;if(n===!0||n==="top")o=m.insert(0,p,g);else if(n==="afterCurrent"||n==="beforeCurrent"){const _=this.getGridCurrentRow(e);if(_){let T=m.indexOf(_);T>=0&&T<m.rowCount&&n==="afterCurrent"?T=T+1:T>0&&n==="beforeCurrent"&&(T=T),o=m.insert(T,p,g)}else o=m.add(p,g)}else typeof n=="number"&&n>=0?o=m.insert(n,p,g):o=m.add(p,g);(h=a==null?void 0:a.gridOptions)!=null&&h.treeData&&(o[nt.TreeHierarchyFieldName]=[G.guid()])}return o}addCopyRowToGrid(e,t="default",n=!1){var a,s,c;const i=this.getGrid(e);let o;if(i){t==="default"&&(t=this.getGridOptions(e,"insertAtTop")||"default"),t==="default"&&(t=((c=(s=(a=i==null?void 0:i.gridOptions)==null?void 0:a.context)==null?void 0:s.options)==null?void 0:c.insertAtTop)||"default"),(i==null?void 0:i.gridOptions.api).stopEditing();const u=this.getGridSelectRows(i);if(u.length===0){const f=this.getGridCurrentRow(i);f&&u.push(f)}if(u.length===0)o=[this.addRowToGrid(e,!0,t,n)];else{if(this._customDefaultValues[e])for(let h=0;h<u.length;h++)u[h]={...u[h],...this._customDefaultValues[e]};const f=this.getGridBindingTable(e);if(f){let h=-1;t==="top"||t===!0?h=0:t==="afterCurrent"||t==="default"?(h=f.indexOf(u[u.length-1]),h<f.rowCount&&(h=h+1)):t==="beforeCurrent"?(h=f.indexOf(u[0]),h>0&&(h=h-1)):typeof t=="number"&&t>=0&&(h=t),o=f.import(u,h,!0,this.getGridOptions(e,"autoGuidField"))}}}return o}importRowsToGrid(e,t,n=!1,i=!0){var s,c;let o;const a=this.getGrid(e);if((s=a==null?void 0:a.gridOptions.context)!=null&&s.bindingSource){a.gridOptions.context.options=a.gridOptions.context.options||{},a.gridOptions.context.options.autoCheckNewRow=n;const d=(c=a.gridOptions.context)==null?void 0:c.bindingSource;d&&(o=d.import(t,void 0,i))}return o}getGridAggregates(e){var n;let t;if(e){const i=this.getGrid(e);if(i){const o=i.gridOptions.api.getModel();t=(n=o==null?void 0:o.rootNode)==null?void 0:n.aggData}}return t}getModelFromGridOrLayout(e,t,n=!1,i){const o=this.getBindingTable(e);return this.getModelFromDataTable(o,t,n,i)}getModelFromDataTable(e,t,n=!1,i){let o;return typeof e=="string"&&e.trim().length>0&&(e=this.getBindingTable(e)),e&&e instanceof Cn&&(t&&t.trim().length>0?o=e.get(t.trim()):(o=e.at(0),o=l.reactive(o))),o&&(n instanceof Function?o=n(o)||o.toJSON():o=n?o.toJSON():o,i&&Object.keys(i).forEach(a=>{o[a]=i[a]})),o}getGridDataCount(e){let t=0;const n=this.getGridConfigId(e);if(n){const i=this.getBindingTable(n);i&&i instanceof Cn&&(t=i.totalCount())}return t}getModelFromDataTableById(e,t,n=!1){var o;let i;return typeof e=="string"&&e.trim().length>0&&this._formBindingRelation[e.trim()].trim().length>0&&(e=(o=this._formDataSet)==null?void 0:o.dataTables[this._formBindingRelation[e.trim()]]),e&&e instanceof Cn&&t&&t.trim().length>0&&(i=e.get(t.trim()),i&&(n instanceof Function?i=n(i)||i.toJSON():i=n?i.toJSON():i)),i}addModelToLayout(e,t,n){let i;if((e==null?void 0:e.trim().length)>0){const o=this.getBindingTable(e.trim());if(o){o instanceof Cn&&(i=o.add({}));const a=this.getRelationConfigIdsByTableName(o.tableName);t&&this.setModelDefalutValue(i,a),i=this.getLayoutBindModel(e)}else console.error("ER: Attempting to add model to a non-existent dataTable, configId: "+e)}return i}getModelFields(e){var t;return(t=e==null?void 0:e.options)==null?void 0:t.schema}getControlName(e,t,n){let i="antInput";switch(e){case"F1":case"G3":case"T3":i="antInputGroup";break;case"FB":i="antRadioGroup";break;case"FJ":i="erRadioGroup";break;case"F6":case"F7":case"FA":case"FC":case"FP":case"G1":case"G2":case"GP":case"T1":case"T2":case"TP":i="erSelect";break;case"FD":i="erMultiSelect";break;case"F3":case"G4":case"GD":case"T4":case"TD":i="antMultiSelect";break;case"FL":i="erTreeSelect";break;case"FH":i="erMultiTreeSelect";break;case"F2":case"F9":case"FG":i="antInputNumber";break;case"F4":i="antCheckbox";break;case"FK":i="erCheckboxGroup";break;case"FW":i="antSwitch";break;case"FM":i="scriptEditor";break;case"F5":G.toNumber(n==null?void 0:n.MAX_LENGTH)===2?i="antTimePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===4?t.toLowerCase()==="hh:mm"?i="antTimePicker":i="antYearPicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===6?t.toLowerCase()==="hh:mm:ss"?i="antTimePicker":i="antMonthPicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===8?i="antDatePicker":i="antDateTimePicker";break;case"FR":G.toNumber(n==null?void 0:n.MAX_LENGTH)===4||t.toLowerCase()==="yyyy"?i="antYearRangePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===6||t.toLowerCase()==="yyyy-mm"||t.toLowerCase()==="yyyy/mm"||t.toLowerCase()==="yyyymm"?i="antMonthRangePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===8||t.toLowerCase()==="yyyy-mm-dd"||t.toLowerCase()==="yyyy/mm/dd"||t.toLowerCase()==="yyyymmdd"?i="antDateRangePicker":i="antDateTimeRangePicker";break;case"F8":case"G8":case"T8":i="antTextarea";break;case"FE":case"G5":case"T5":i="erMemoEditor";break;case"FN":i="antButton";break;case"FZ":case"GZ":case"TZ":i="antInputColor";break;case"FS":i="label";break;case"FT":i="antDivider";break;default:i="antInput";break}return i}resetValidator(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++){if(t[n].trim().length===0)continue;const i=this.getLayoutBindForm(t[n]);i==null||i.clearValidate()}}getLayoutLabelSpan(e,t){return G.jQuery("#"+this._formId+e+t+"_span")}getLayoutJqueryElement(e,t){let n;return n=G.jQuery("#"+this._formId+e+t),n===void 0&&(n=G.jQuery("#"+e)),n}autoBestFit(e){var n,i,o,a,s;const t=this.getGrid(e);if(t&&this.isGridOnScreen(t)){const c=(i=(n=t.gridOptions.columnApi)==null?void 0:n.columnModel)==null?void 0:i.gridColumns;(c==null?void 0:c.length)>0&&((s=(a=(o=t==null?void 0:t.gridOptions)==null?void 0:o.context)==null?void 0:a.viewConfig)==null?void 0:s.BESTFIT)==="1"&&c.forEach(d=>{d.visible&&!d.colDef.suppressSizeToFit&&t.gridOptions.columnApi.autoSizeColumn(d)})}return this}getGrid(e){var n,i;let t;return e&&typeof e=="string"&&this._gridInstanceInfo[e]!==void 0&&(e=this._gridInstanceInfo[e]),(n=e==null?void 0:e.gridOptions)!=null&&n.api&&((i=e==null?void 0:e.gridOptions)!=null&&i.columnApi)&&(t=e),t}getDetailGrid(e,t){const n=this.getGrid(e);if(n&&t){const i=(typeof t=="string"?t:t==null?void 0:t.uid)||"";if(i.trim().length===0)return;const o=n.gridOptions.api.getDetailGridInfo(`detail_${i}`);if(o)return{gridOptions:{...n.gridOptions.detailGridOptions,...o}}}}getGridApi(e){var t,n;return(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.api}isGridOnScreen(e){const t=this.getGrid(e);return t?G.isGridOnScreen(t):!1}getGridColumnApi(e){var t,n;return(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.columnApi}getGridConfig(e){var t,n,i;return(i=(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.context)==null?void 0:i.viewConfig}getGridColumn(e,t){const n=this.getGrid(e);return cr.getGridColumn(n,t)}getGridColumnDef(e,t){const n=this.getGrid(e);return cr.getGridColumnDef(n,t)}showGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){const o=[];i.forEach(a=>{o.push({colId:a,hide:!1})}),n.gridOptions.columnApi.applyColumnState({state:o})}}return this}hideGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){const o=[];i.forEach(a=>{o.push({colId:a,hide:!0})}),n.gridOptions.columnApi.applyColumnState({state:o})}}return this}showGridCheckColumn(e){return this.showOrHideGridCheckColumn(e,"show")}hideGridCheckColumn(e){return this.showOrHideGridCheckColumn(e,"hide")}showOrHideGridCheckColumn(e,t="default"){var i,o,a,s;const n=this.getGrid(e);if((i=n==null?void 0:n.gridOptions)!=null&&i.api){const c=n.gridOptions.api,d=c.getColumnDef(nt.GridCheckColumnFieldName);d&&(t==="hide"?(d.checkboxSelection=void 0,d.headerCheckboxSelection=void 0):(t==="show"||((o=n.gridOptions.context)==null?void 0:o.viewConfig.SHOW_SELECTION)==="1")&&(d.checkboxSelection=u=>!u.node.footer,this.getGridOptions((s=(a=n.gridOptions)==null?void 0:a.context)==null?void 0:s.configId,"RowSelection",!0)==="multiple"?d.headerCheckboxSelection=!0:d.headerCheckboxSelection=void 0),c==null||c.redrawRows(),c==null||c.refreshHeader())}return this}setGridSelectMode(e,t,n="none"){var o,a;const i=this.getGrid(e);return i&&(this.setGridOptions((a=(o=i.gridOptions)==null?void 0:o.context)==null?void 0:a.configId,"RowSelection",t,!0),this.setGridColumnOptions(i,s=>{var c,d,u,f,h;s.colId===nt.GridCheckColumnFieldName&&(n==="show"||n==="hide"||t==="multiple")&&(n==="hide"?(s.checkboxSelection=void 0,s.headerCheckboxSelection=void 0):t==="multiple"?(s.checkboxSelection=p=>!p.node.footer,s.headerCheckboxSelection=n==="show"||((c=i.gridOptions.context)==null?void 0:c.viewConfig.SHOW_SELECTION)==="1",s.headerCheckboxSelectionFilteredOnly=((u=(d=i.gridOptions.context)==null?void 0:d.options)==null?void 0:u.headerCheckboxSelectionFilteredOnly)??!0,s.headerCheckboxSelectionFilteredOnly!==!0?s.headerCheckboxSelectionCurrentPageOnly=(h=(f=i.gridOptions.context)==null?void 0:f.options)==null?void 0:h.headerCheckboxSelectionCurrentPageOnly:delete s.headerCheckboxSelectionCurrentPageOnly):t==="single"&&(s.headerCheckboxSelection=void 0))})),this}setGridRowDrag(e,t="default"){var i,o,a,s;const n=this.getGrid(e);if((i=n==null?void 0:n.gridOptions)!=null&&i.api){const d=n.gridOptions.api.getColumnDef(nt.GridCheckColumnFieldName);d&&(t===!1?(d.rowDrag=void 0,(o=n==null?void 0:n.gridOptions)==null||o.columnApi.setColumnWidth(d.colId,55)):(t===!0||(a=n.gridOptions.context)!=null&&a.allowDragRow)&&(n.gridOptions.context.allowDragRow=!0,(s=n==null?void 0:n.gridOptions)==null||s.columnApi.setColumnWidth(d.colId,75),d.rowDrag=u=>{var f;return((f=u.context)==null?void 0:f.allowDragRow)&&!u.node.group&&!u.node.footer}),n.gridOptions.rowDragManaged=t),n.gridOptions.api.redrawRows()}return this}addGridColumn(e,t,n){const i=this.getGrid(e);if(i){let o;if(t instanceof Array?o=t:o=[t],o.length>0){const a=i.gridOptions.context.bindingSource,s=i.gridOptions.api.getColumnDefs()||[],c=[];o.forEach(u=>{var f,h,p,g;if(((f=u.field)==null?void 0:f.trim().length)>0){u.field=u.field.trim();const m={name:u.field,capiton:u.headerName,defaultValue:u.defaultValue,type:u.dataType||u.type||"string",maxLength:u.maxLength||-1};a.addField(m),u.colId=u.colId||u.field,i.gridOptions.api.getColumnDef(u.colId)||(u.headerComponentParams={template:`${this.getGridHeaderTemplate({color:u.headerTextColor,backColor:u.headerBackColor,fontSize:u.fontSize,title:u.headerName||u.title||u.caption})}`},u.headerClass=()=>{var T,x,E,D,k;let _="er-grid-header-align-center";return((T=u.headerAlignment)==null?void 0:T.toLowerCase())==="near"||((x=u.headerAlignment)==null?void 0:x.toLowerCase())==="left"?_="er-grid-header-align-left":(((E=u.headerAlignment)==null?void 0:E.toLowerCase())==="far"||((D=u.headerAlignment)==null?void 0:D.toLowerCase())==="right")&&(_="er-grid-header-align-right"),u.required&&((k=u.requiredCondition)==null?void 0:k.trim().length)>0?_=_+" er-grid-header-maroon-star":u.required&&(_=_+" er-grid-header-red-star"),_},u.editable=u.editable===void 0?!0:u.editable,u.autoHeaderHeight=u.autoHeaderHeight===void 0?!0:u.autoHeaderHeight,u.enableRowGroup=u.enableRowGroup===void 0?!0:u.enableRowGroup,typeof u.editable!="function"&&(u.context=u.context||{},u.context.editable=u.editable,u.headerTooltip=u.headerName||u.title||u.caption,u.editable=_=>{var T,x;return((T=_.context)==null?void 0:T.editable)&&((x=_.colDef.context)==null?void 0:x.editable)&&!_.node.rowPinned}),u.filter=u.filter===void 0?"agSetColumnFilter":u.filter,u.filterParams={excelMode:(g=(p=(h=i.gridOptions)==null?void 0:h.context)==null?void 0:p.options)==null?void 0:g.excelMode,showTooltips:!0},c.push(u))}});let d=-1;n&&n.trim().length>0&&(d=s.findIndex(u=>u.colId===n)),d!==-1?s.splice(d,0,...c):s.push(...c),i.gridOptions.api.setColumnDefs(s)}}return this}removeGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){let o=n.gridOptions.api.getColumnDefs()||[];o=o.filter(a=>!i.includes(a.colId)),n.gridOptions.api.setColumnDefs(o)}}return this}getGridColumnFields(e,t="string"){var o,a,s;const n=this.getGrid(e);let i=t==="Array"?[]:void 0;if((a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId){const c=this.getConfigInfo(n.gridOptions.context.configId);((s=c==null?void 0:c.TSI00GRIDCOLUMN)==null?void 0:s.length)>0&&c.TSI00GRIDCOLUMN.forEach(d=>{d.FIELD_NAME.trim().length>0&&d.UNBOUND_TYPE==="0"&&(t==="Array"?i.push(d.FIELD_NAME.trim()):i=i?i+","+d.FIELD_NAME.trim():d.FIELD_NAME.trim())})}return i}setGridEnable(e,t){var i,o,a;const n=this.getGrid(e);return(i=n==null?void 0:n.gridOptions)!=null&&i.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.enable=t,(a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId&&(this.setGridOptions(n.gridOptions.context.configId,"enable",t,!0),document.querySelectorAll(".ag-full-width-row").forEach(c=>{c.style!==void 0&&(t?c.style.pointerEvents="all":c.style.pointerEvents="none")}))),this}setGridEditable(e,t){var i,o,a;const n=this.getGrid(e);return(i=n==null?void 0:n.gridOptions)!=null&&i.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.editable=t,(a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId&&this.setGridOptions(n.gridOptions.context.configId,"editable",t,!0)),this}setGridIndicator(e,t,n){if(e&&t&&Object.keys(t).length>0){const i=this.getGrid(e);setTimeout(()=>{var o,a,s,c,d,u,f;if((o=i==null?void 0:i.gridOptions)!=null&&o.api&&((s=(a=i==null?void 0:i.gridOptions)==null?void 0:a.context)!=null&&s.bindingSource)){const h=(c=i==null?void 0:i.gridOptions)==null?void 0:c.api,g=((u=(d=i==null?void 0:i.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource).data().find(m=>{for(const _ in t)if(m[_]!==t[_])return!1;return!0});if(g!=null&&g.uid){h.clearFocusedCell();const m=(f=i==null?void 0:i.gridOptions)==null?void 0:f.api.getRowNode(g==null?void 0:g.uid);m&&this.setGridFocusedCell(e,m.rowIndex,nt.GridCheckColumnFieldName,n)}}},250)}return this}setDragAndDropBetweenGrids(e,t,n,i){const o=this.getGrid(e),a=this.getGrid(t);if(!o)return G.error("fromGrid is not found",e),this;if(!a)return G.error("toGrid is not found",t),this;const s=o.gridOptions.api,c=a.gridOptions.api,d=c.getRowDropZoneParams({onDragStop:u=>{var f,h,p,g;if((i==null?void 0:i.preventDefault)!==!0&&((f=o.gridOptions.context)!=null&&f.configId)&&u.nodes.length>0){const m=u.nodes.map(_=>_.data);if(this.deleteGridRows(o.gridOptions.context.configId,!1,m),u.removedRows=m,(h=u.context)!=null&&h.configId){const _=(p=u.context)==null?void 0:p.bindingSource;u.nodes.forEach(T=>{_.isRemoved(T.data.uid)?this.setGridRowState(a,T.data,"unchanged"):this.setGridRowState(a,T.data,"added")})}}u.formGridContext=o.gridOptions.context,(g=i==null?void 0:i.onDragStop)==null||g.call(i,u)}});if(n){s.addRowDropZone(d);const u=s.getRowDropZoneParams({onDragStop:f=>{var h,p,g,m;if((i==null?void 0:i.preventDefault)!==!0&&((h=a.gridOptions.context)!=null&&h.configId)&&f.nodes.length>0){const _=f.nodes.map(T=>T.data);if(this.deleteGridRows(a.gridOptions.context.configId,!1,_),f.removedRows=_,(p=f.context)!=null&&p.configId){const T=(g=f.context)==null?void 0:g.bindingSource;f.nodes.forEach(x=>{T.isRemoved(x.data.uid)?this.setGridRowState(o,x.data,"unchanged"):this.setGridRowState(o,x.data,"added")})}}f.formGridContext=a.gridOptions.context,(m=i==null?void 0:i.onDragStop)==null||m.call(i,f)}});c.addRowDropZone(u)}return this}refreshGridFooterData(e){var n,i,o;const t=this.getGrid(e);if((n=t==null?void 0:t.gridOptions)!=null&&n.api){const a=(i=t==null?void 0:t.gridOptions)==null?void 0:i.api;if(a.getPinnedBottomRowCount()>0){a.refreshClientSideRowModel("aggregate");const s=a.getModel();a.setPinnedBottomRowData([{...(o=s==null?void 0:s.rootNode)==null?void 0:o.aggData,pinndeRowType:"ErGridSummaryFooter"}])}}return this}setLayoutConfigRelationInfo(e,t){return this._layoutConfigRelationInfo[t]=e,this}getConfigIdbyLayoutName(e){return this._layoutConfigRelationInfo[e]&&this._layoutConfigRelationInfo[e].trim().length>0?this._layoutConfigRelationInfo[e].trim():e}getGridConfigId(e){let t="";return e&&(typeof e=="string"&&this._gridInstanceInfo[e]!==void 0?t=e:e.gridOptions&&e.gridOptions.api&&(t=e.gridOptions.gridId)),t}setWidgetInstanceInfo(e,t,n){return this.isNullOrEmpty(e)||(this._widgetInstanceInfo[e.trim()]===void 0&&(this._widgetInstanceInfo[e.trim()]={}),!this.isNullOrEmpty(t)&&n&&(this._widgetInstanceInfo[e.trim()][t.trim()]=n)),this}setControlVisible(e,t,n,i="none"){return!this.isNullOrEmpty(e)&&(n==null?void 0:n.trim().length)>0&&(e=this.getConfigIdbyLayoutName(e),n.split(",").forEach(a=>{a.trim().length>0&&(i==="empty"?this.setControlEmptyValue(e,a):i==="default"&&this.setControlDefalutValue(e,a),this.setLayoutItemOption(e,a.trim(),{visible:t}))})),this}setGridColumnTitle(e,t){if((t==null?void 0:t.length)>0){const n=this.getGrid(e);n&&(t.forEach(i=>{var a;const o=n.gridOptions.columnApi.getColumn(i.colId);if(o!=null&&o.colDef){const s=((a=o.colDef.context)==null?void 0:a.titleInfo)||{};o.colDef.headerComponentParams={template:`${this.getGridHeaderTemplate({...s,...i})}`}}}),n.gridOptions.api.refreshHeader())}return this}setGridColumnOptions(e,t){if(e&&t instanceof Function){const n=this.getGrid(e);if(n){const i=a=>{var s;((s=a==null?void 0:a.children)==null?void 0:s.length)>0&&a.children.forEach(c=>{i(c)}),t(a)},o=n.gridOptions.api.getColumnDefs();o.forEach(a=>{i(a)}),n.gridOptions.api.setColumnDefs(o)}}return this}setGridOptions(e,t,n,i=!1){return e=(e==null?void 0:e.trim())||"",t=(t==null?void 0:t.trim())||"",e.length>0&&t.length>0&&(i?(this._gridReactiveOptions[e]=this._gridReactiveOptions[e]||{},this._gridReactiveOptions[e][t]=n):(this._gridOptions[e]=this._gridOptions[e]||{},this._gridOptions[e][t]=n)),this}getGridOptions(e,t,n=!1){if(e=(e==null?void 0:e.trim())||"",t=(t==null?void 0:t.trim())||"",e.length>0&&t.length>0){if(n&&this._gridReactiveOptions[e])return this._gridReactiveOptions[e][t];if(!n&&this._gridOptions[e])return this._gridOptions[e][t]}}getLayoutExtentedOptions(e){var o,a;let t={};const n=this.getFormSysInfo("LayoutDefaultOptions");n.trim().length>0&&(t={...JSON.parse(n)});const i=this.getConfigInfo(e);if(((o=i==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0){const s=i.TSI00GRIDVIEW[0];if(((a=s.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);t={...t,...c}}}return t}getGridExtentedOptions(e){var o,a;let t={};const n=this.getFormSysInfo("GridDefaultOptions");n.trim().length>0&&(t={...JSON.parse(n)});const i=this.getConfigInfo(e);if(((o=i==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0){const s=i.TSI00GRIDVIEW[0];if(((a=s.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);t={...t,...c}}}return t}getDetailGridRenderOptions(e,t,n,i){const o=this.getGridConfigOptions(e,t,n,i),a={context:o==null?void 0:o.context,defaultColDef:o==null?void 0:o.defaultColDef,groupDisplayType:o==null?void 0:o.groupDisplayType,columnDefs:o==null?void 0:o.columnDefs,groupIncludeTotalFooter:o==null?void 0:o.groupIncludeTotalFooter,groupIncludeFooter:o==null?void 0:o.groupIncludeFooter,suppressRowClickSelection:o==null?void 0:o.suppressRowClickSelection,rowSelection:o==null?void 0:o.rowSelection,groupRowRendererParams:o==null?void 0:o.groupRowRendererParams,localeText:ca(),enableRangeSelection:!0,stopEditingWhenCellsLoseFocus:!0,suppressRowTransform:!0,enableRtl:ii(),statusBar:{statusPanels:[{statusPanel:l.markRaw(E4),statusPanelParams:{configId:e,options:t},key:"AggregationPanel",align:"center"},{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]},onCellValueChanged:s=>{var c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof qr){if(((c=s.data.schemaFields[s.colDef.field])==null?void 0:c.type)==="datetime"||((d=s.data.schemaFields[s.colDef.field])==null?void 0:d.type)==="time")s.data[s.colDef.field]=G.getDateTimeByString(s.newValue);else if(((u=s.data.schemaFields[s.colDef.field])==null?void 0:u.type)==="boolean")s.data[s.colDef.field]=s.newValue===!0||s.newValue==="1"||s.newValue==="True"||s.newValue==="true";else if(((f=s.data.schemaFields[s.colDef.field])==null?void 0:f.type)==="number")s.data[s.colDef.field]=G.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const B=s.colDef.context.displayFormat||"",O=G.toString(s.newValue,!0);if(O.length>0){if(B.trim().startsWith("{0}|")&&O.includes("|")){const M=O.split("|")[0];(p=s.colDef.refData)!=null&&p[M]?s.data[s.colDef.field]=M:s.data[s.colDef.field]=""}else if(B.trim().startsWith("{0}-")&&O.includes("-")){const M=O.split("-")[0];(g=s.colDef.refData)!=null&&g[M]?s.data[s.colDef.field]=M:s.data[s.colDef.field]=""}else if(B.trim().endsWith("{0}|")&&O.includes("|")){const M=O.split("|"),R=M[M.length-1];(m=s.colDef.refData)!=null&&m[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(B.trim().endsWith("{0}-")&&O.includes("-")){const M=O.split("-"),R=M[M.length-1];(_=s.colDef.refData)!=null&&_[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(B.length>0){const M=Object.keys(s.colDef.refData);let R="";for(let H=0;H<M.length;H++)if(((T=s.colDef.refData)==null?void 0:T[M[H]])===O){R=M[H];break}s.data[s.colDef.field]=R}}}}s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0,this.setDropDownAutoFillFieldsForGrid({gridOptions:{...s}},s.colDef.colId,s.node),this.DropDownCascader[e+s.colDef.colId]&&this.DropDownCascader[e+s.colDef.colId].forEach(B=>{var O,M,R;if(B.FUNCTION_TYPE&&B.FUNCTION_ID&&B.ITEM_CODE){let H="";const V=s.data[s.colDef.field],N=this.getSingleItemConfigInfo(B.FUNCTION_ID,B.ITEM_CODE),W=this.getItemDropDownDataSource(B.FUNCTION_ID,B.ITEM_CODE);if(s.data[s.colDef.field]){const j=this.filterDropDownCascaderDataSource(W,B.FORM_FILTER,s.data[s.colDef.field]);if((j==null?void 0:j.length)>0){const U=(O=this.DropDownBindSource[B.FUNCTION_ID])==null?void 0:O[B.ITEM_CODE];U.dataValueField&&(V&&j.some(ie=>ie[U.dataValueField]===V)?H=V:(((M=N==null?void 0:N.DEFAULT_VALUE)==null?void 0:M.trim().toLowerCase())==="$first_row$"||((R=N==null?void 0:N.DEFAULT_VALUE)==null?void 0:R.trim().toLowerCase())==="{first_row}")&&(H=j[0][U.dataValueField]))}}B.FUNCTION_TYPE==="F"?this.setControlValue(B.FUNCTION_ID,B.ITEM_CODE,H):B.FUNCTION_ID===e&&(s.data[B.ITEM_CODE]=H)}});let A=(E=(x=s.context)==null?void 0:x.viewConfig)==null?void 0:E.AUTO_SELECT_MODE;if(A==="2"||A==="3")this.checkGridRow(e,s.data.uid);else if(((P=(k=(D=s.colDef)==null?void 0:D.context)==null?void 0:k.columnConfig)==null?void 0:P.MULTI_ROW_EDIT)==="1"&&((b=s.node)!=null&&b.selected)){const B=this.getGridOptions(e,"multiRowEdit");if(B!==!1&&B!=="0"){let O=!1;(t==null?void 0:t.multiRowEditType)==="all"?s.api.forEachLeafNode(M=>{var R;M!=null&&M.selected&&((R=M.data)!=null&&R.uid)&&M.data.uid!==s.data.uid&&(M.setDataValue(s.colDef.field,s.data[s.colDef.field]),O=!0)}):s.api.forEachNodeAfterFilter(M=>{var R;M!=null&&M.selected&&((R=M.data)!=null&&R.uid)&&M.data.uid!==s.data.uid&&(M.setDataValue(s.colDef.field,s.data[s.colDef.field]),O=!0)}),O&&s.api.refreshCells({columns:[nt.GridCheckColumnFieldName]})}}if(((S=s.context)==null?void 0:S.viewConfig.SHOW_FOOTER)==="1"&&((w=s.context.viewType)==null?void 0:w.toLowerCase())!=="cardview"&&((I=s.context.viewType)==null?void 0:I.toLowerCase())!=="card"){const B=s.api.getModel();s.api.setPinnedBottomRowData([{...(v=B==null?void 0:B.rootNode)==null?void 0:v.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[nt.GridCheckColumnFieldName,s.colDef.colId]})}},getRowId:s=>s.data.uid,getRowStyle:s=>this.getRowStyle(s,{showDefaultFooter:!0}),getMainMenuItems:s=>this.getGridMenuItems(s),getContextMenuItems:s=>{const c=this.getGridContextMenuItems(s)||[];return c.length>0&&c.push("separator"),c.push({name:this.$t("ERX.Export")||"导出",action:()=>{var p,g,m,_,T,x;const d=window.getCurrentFormInfo&&window.getCurrentFormInfo(),u=(d==null?void 0:d.formName)||this.FormName,f=(d==null?void 0:d.formCaption)||this.FormCaption,h=s.columnApi.getAllDisplayedColumns().filter(E=>{var D,k,P;return((P=(k=(D=E.colDef)==null?void 0:D.context)==null?void 0:k.columnConfig)==null?void 0:P.ALLOW_PRINT)!=="0"}).map(E=>{var D;return(D=E.colDef)==null?void 0:D.colId});cr.exportGridToExcel(s.api,s.columnApi,{fileName:`${u}-${f}-${G.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,isBandView:((g=(p=o.context)==null?void 0:p.viewType)==null?void 0:g.toLowerCase())==="bandview"||((_=(m=o.context)==null?void 0:m.viewType)==null?void 0:_.toLowerCase())==="band",isShowFooter:((x=(T=o.context)==null?void 0:T.viewConfig)==null?void 0:x.SHOW_FOOTER)==="1",isCheckedRows:!0,columnKeys:h})}}),c},onGridReady:s=>s.api.setPopupParent(document.querySelector("body")),onRowSelected:s=>this.processRowSelectedEvent(s),onRangeSelectionChanged:s=>{if(s!=null&&s.api){const c=s.api.getStatusPanel("AggregationPanel");c&&c.setAggData()}}};return a.context.isDetailGrid=!0,a}getGridEditable(e){var n,i;const t=this.getGrid(e);return((i=(n=t==null?void 0:t.gridOptions)==null?void 0:n.context)==null?void 0:i.editable)===!0}getControl(e,t,n){let i;if(this._widgetInstanceInfo[e.trim()]&&this._widgetInstanceInfo[e.trim()][t.trim()]&&(i=this._widgetInstanceInfo[e.trim()][t.trim()]),i==null)if(n&&n.trim().length>0)i=G.jQuery("#"+this._formId+e+t);else{const o=this.getSingleItemConfigInfo(e,t);if(o.FUNCTION_TYPE&&o.COLUMN_EDIT){const a=o.FUNCTION_TYPE+o.COLUMN_EDIT;n=this.getControlName(a,o.FORMAT_STRING),i=G.jQuery("#"+this._formId+e+t)}}return i}isControlEmptyValue(e,t,n){let i=!0;const o=this.getControlValue(e,t),a=Object.keys(o);for(let s=0;s<a.length;s++)if(o[a[s]]!==null&&String(o[a[s]]).trim().length>0){i=!1;break}return i}setControlConditionProps(e,t,n="ReadOnly",i,o){if(n=(n==null?void 0:n.trim())||"ReadOnly",(e==null?void 0:e.trim().length)>0){const a=e.trim()+"_"+n+"_"+(t==null?void 0:t.trim());let s=[];if(this._controlConditionProps[a])s=this._controlConditionProps[a];else if(this._configInfo.TSI00GRIDCONDITION&&this._configInfo.TSI00GRIDCONDITION.length>0){const c=this.getSingleViewConfigInfo(e==null?void 0:e.trim());if(c)for(let d=0;d<this._configInfo.TSI00GRIDCONDITION.length;d++){const u=this._configInfo.TSI00GRIDCONDITION[d];if(G.toString(u.FUNCTION_ID,!0)!==e||(t==null?void 0:t.trim().length)>0&&G.toString(u.OPERATE_NAME,!0)!==(t==null?void 0:t.trim())||c.MATCH_FLAG==="1"&&G.toString(u.COMPANY_CODE,!0)!==nt.CompanyCode||G.toString(u.FIELD_NAME_ARRAY,!0).length===0)continue;const f=G.toString(u.FIELD_NAME_ARRAY,!0).split(",");u.FIELD_NAME_ARRAY=f,s.push(u)}}if(s.length>0){this._controlConditionProps[a]=s;const c=this.getAllControlValue(e);s.forEach(d=>{const u=d.FIELD_NAME_ARRAY;let f=i??d.PROP_VALUE??"default";u.forEach(h=>{if(h&&!(o!=null&&o.includes(h))){const p=G.toString(d.REGULAR_EXPRESS,!0),g=p.length===0||p.replaceAll(" ","")==="1=1"||G.checkExpressionValid(c,G.getSystemFormatString(p));f=f==!0||f==="1"||G.toString(f).toLowerCase()==="true",n==="ReadOnly"&&this.setControlReadOnly(e,g?f:"default",h)}})})}}return this}getControlValue(e,t){let n,i;if(e.trim().length>0&&t.trim().length>0){const o=t.split(",").filter(s=>s.trim().length>0);o.length>1&&(i={});const a=this.getLayoutBindModel(e);if(a)for(let s=0;s<o.length;s++){const c=o[s].trim();n=null;const d=this.getLayoutItemOption(e,c,"controlType"),u=this.getLayoutItemOption(e,c,"field");if((u==null?void 0:u.trim().length)>0?n=a[u.trim()]:this._hiddenFields[e.trim()]?n=this._hiddenFields[e.trim()][c]||"":n=a[c],["antInput","antInputGroup","antTextarea","erSelect","erTreeSelect","erMemoEditor"].includes(d))n=n||"";else if(d==="antInputNumber"&&n==null)n=0;else if(["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(d))n=n||[];else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(d)){const f=this.getLayoutItemOption(e,c,"rangePickerStartKey"),h=this.getLayoutItemOption(e,c,"rangePickerEndKey");n=[a[f]||null,a[h]||null]}o.length>1?i[c]=n:i=n}}return i}getControlText(e,t){let n,i;if(e.trim().length>0&&t.trim().length>0){const o=t.split(",");o.length>1&&(i={});const a=this.getLayoutBindModel(e);if(a)for(let s=0;s<o.length;s++){const c=o[s].trim();if(n=null,c.length===0)continue;const d=this.getLayoutItemOption(e,c,"field"),u=this.getLayoutItemOption(e,c,"controlType");let f=this.getLayoutItemOption(e,c,"format");if(f instanceof Array&&f.length>0?f=f[0]:f&&typeof f=="string"?f=f.trim():f="YYYY-MM-DD HH:mm:ss",(d==null?void 0:d.trim().length)>0?n=a[d.trim()]:this._hiddenFields[e.trim()]?n=this._hiddenFields[e.trim()][c]||"":n=a[c],n==null)i="";else{if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect"].includes(u))n=this.getDropDownSelectedText(e,c,n);else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u))n=G.toDateTime(n,"Dayjs").format(f);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const h=this.getLayoutItemOption(e,c,"rangePickerStartKey"),p=this.getLayoutItemOption(e,c,"rangePickerEndKey"),g=a[h]||null,m=a[p]||null;n=G.toDateTime(g,"Dayjs").format(f)+"&"+G.toDateTime(m,"Dayjs").format(f)}else u==="antInputNumber"&&(n=G.formatNumberValue(n,f));o.length>1?i[c]=n:i=n}}}return i}setControlValue(e,t,n){if(G.isNullOrEmpty(e)||G.isNullOrEmpty(t))return this;const i=this.getLayoutBindModel(e==null?void 0:e.trim()),o=this.getLayoutBindForm(e==null?void 0:e.trim()),a=this.getLayoutItemOption(e,t,"controlType"),s=this.getLayoutItemOption(e,t,"field")||(t==null?void 0:t.trim());if(i&&s){if(G.toString(n).trim()===G.toString(i[s]).trim())return this;let c=!0;if(n===void 0&&(n=null,c=!1),["antMultiSelect","erMultiSelect"].includes(a))n?n instanceof Array?i==null||i.set(s,n,e):typeof n=="string"?i==null||i.set(s,n.split(","),e):i==null||i.set(s,[],e):i==null||i.set(s,[],e);else if(n!==null&&(a!=null&&a.startsWith("antCheckbox")||a!=null&&a.startsWith("antSwitch")))i==null||i.set(s,G.toString(n)==="1"||G.toString(n).toLowerCase()==="true",e);else if(n!==null&&["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(a))i==null||i.set(s,G.toDateTime(n,"Dayjs"),e);else if(n instanceof Array&&n.length===2&&["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(a)){const d=this.getLayoutItemOption(e,t,"rangePickerStartKey"),u=this.getLayoutItemOption(e,t,"rangePickerEndKey");n[0]!==void 0&&(i==null||i.set(d,G.toDateTime(n[0],"Dayjs"),e)),n[1]!==void 0&&(i==null||i.set(u,G.toDateTime(n[1],"Dayjs"),e))}else i==null||i.set(s,n,e);c&&setTimeout(()=>{o==null||o.validate(s)})}if(this._layoutConditionStyleInfo[e]){const c=this._layoutConditionStyleInfo[e];Object.keys(c).forEach(d=>{var u,f;(d===t||((f=(u=c[d])==null?void 0:u.condition)==null?void 0:f.indexOf(t))>-1)&&this.setLayoutConditionStyle(e,d)})}return this}setControlValueEx(e,t,...n){const i=Object.keys(t);return(i==null?void 0:i.length)>0&&(n.length===1&&(n=n[0].split(",")),n.length>0?n.forEach(o=>{(t==null?void 0:t[o])!==void 0&&this.setControlValue(e,o,t[o])}):i.forEach(o=>{(t==null?void 0:t[o])!==void 0&&this.setControlValue(e,o,t[o])})),this}setControlCss(e,t,n){if((e==null?void 0:e.trim().length)>0&&(n==null?void 0:n.length)>0){let i;t instanceof Array?i=t:i=t.split(","),i&&i.length>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");let s=document.getElementsByName(this.FormId+e+o);if((s==null?void 0:s.length)>0){let c;switch(a){case"erSelect":case"erMultiSelect":case"antMultiSelect":case"erTreeSelect":case"erMultiTreeSelect":c=s[0].getElementsByClassName("ant-select-selector");break;case"antInput":case"antInputNumber":c=document.getElementById(this.FormId+e+o);break;case"antDateTimePicker":case"antDatePicker":case"antMonthPicker":case"antYearPicker":c=s[0].getElementsByClassName("ant-picker-input");break}n.forEach(d=>{(c==null?void 0:c.length)>0?d.value!==void 0&&G.jQuery(c).css(d.property,d.value):d.value!==void 0&&G.jQuery(s).css(d.property,d.value)})}else s=document.getElementById(this.FormId+e+o),s&&n.forEach(c=>{c.value!==void 0&&G.jQuery(s).css(c.property,c.value)})}})}return this}setModelDefalutValue(e,t,n,i){let o;t instanceof Array?o=t:o=t.split(",");const a=(s,c)=>{var f,h,p;const d=this.getSingleItemConfigInfo(s,c);let u=null;if(d.DEFAULT_VALUE&&d.DEFAULT_VALUE.trim().length>0?u=d.DEFAULT_VALUE:this._customDefaultValues[s]&&this._customDefaultValues[s][c]!==void 0?u=this._customDefaultValues[s][c]:i&&(u=i),u&&u.trim().length>0&&e.schemaFields[c].type){if(e.schemaFields[c].type==="datetime")e.set(c,G.getDateTimeByString(u),s);else if(e.schemaFields[c].type==="boolean")e.set(c,u==="1"||u.toLowerCase()==="true",s);else if(e.schemaFields[c].type==="number")e.set(c,u,s);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(u)){const g=(h=(f=this._dropDownBindSource)==null?void 0:f[s])==null?void 0:h[c];((p=g==null?void 0:g.dataSource)==null?void 0:p.length)>0&&(g!=null&&g.dataValueField)?u==="$FIRST_ROW$"?u=g.dataSource[0][g.dataValueField]:u==="$LAST_ROW$"?u=g.dataSource[g.dataSource.length-1][g.dataValueField]:u==="$ALL_VALUES$"&&(u="",g.dataSource.forEach(m=>{u=u.length===0?m[g.dataValueField]:u+","+m[g.dataValueField]})):u="",e.set(c,u,s)}else e.set(c,this.getDefaultStringValue(u),s);this.setControlValue(s,c,e[c])}};return n&&n.trim().length>0?o.forEach(s=>{s=this.getConfigIdbyLayoutName(s),e&&n&&e.schemaFields&&e.schemaFields[n]&&a(s,n)}):o.forEach(s=>{s=this.getConfigIdbyLayoutName(s);const c=this.getConfigInfo(s);c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{n=d.ITEM_CODE,e&&n&&e.schemaFields&&e.schemaFields[n]&&a(s,n)})}),this}setModelValue(e,t,...n){return qr.setModelValue(e,t,...n),this}setModelEmptyValue(e,...t){return t.length===1&&(t=t[0].split(",")),t.length>0?t.forEach(n=>{e&&e[n]!==void 0&&e.set(n,null)}):e.schemaFields&&Object.keys(e.schemaFields).forEach(n=>{e.set(n,null)}),this}setControlReadOnlyEx(e,t){return t&&Object.keys(t).forEach(n=>{this.setControlReadOnly(e,t[n],n)}),this}setControlReadOnly(e,t,...n){if(G.isNullOrEmpty(e))return this;n.length===1&&(n=n[0].split(",")),e=this.getConfigIdbyLayoutName(e);for(const i of n){const o=this.getSingleItemConfigInfo(e,i);let a=!0,s=!1;o.FUNCTION_TYPE&&o.COLUMN_EDIT&&(t!=="default"&&!t&&o.READ_ONLY==="1"&&(o.COLUMN_EDIT!=="1"||o.ALLOW_EDIT!=="1")||(t==="default"?(s=o.READ_ONLY==="1"||o.FUNCTION_TYPE!=="F"&&o.ALLOW_EDIT!=="1",a=o.ALLOW_EDIT==="1"):(s=t,a=!s),this.setLayoutItemOption(e,i,{readOnly:s}),o.COLUMN_EDIT==="1"&&this.setLayoutItemOption(e,i,{buttonEnable:a})))}return this}setAllControlReadOnly(e,t){let n;return e instanceof Array?n=e:n=e.split(","),n&&n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{this.setControlReadOnly(i.trim(),t,a.ITEM_CODE)})}}),this}setControlEnable(e,t,...n){if(G.isNullOrEmpty(e))return this;n.length===1&&(n=n[0].split(",")),e=this.getConfigIdbyLayoutName(e);for(const i of n){const o=this.getSingleItemConfigInfo(e,i);let a=!0;o.FUNCTION_TYPE&&o.COLUMN_EDIT&&(t==="default"?a=o.ALLOW_EDIT==="1":a=t,this.setLayoutItemOption(e,i,{allowEdit:a}),o.COLUMN_EDIT==="1"&&this.setLayoutItemOption(e,i,{buttonEnable:a}))}return this}setAllControlEnable(e,t){let n;return e instanceof Array?n=e:n=e.split(","),n&&n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{this.setControlEnable(i.trim(),t,a.ITEM_CODE)})}}),this}setControlEmptyValue(e,...t){if(t.length===1&&(t=t[0].split(",")),!t||t.length===0){const n=this.getConfigInfo(e);n.TSI00GRIDVIEW&&n.TSI00GRIDVIEW.length>0&&n.TSI00GRIDVIEW[0].FUNCTION_TYPE==="F"&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(i=>{this.setControlValue(e,i.ITEM_CODE,void 0)})}else t.forEach(n=>{this.setControlValue(e,n,void 0)});return this}setAllControlDefalutValue(e,t=!1){let n;return e instanceof Array?n=e:n=e.split(","),n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{var s;((s=a.DEFAULT_VALUE)==null?void 0:s.trim().length)>0?this.setControlDefalutValue(i.trim(),a.ITEM_CODE,t):t||this.setControlEmptyValue(i,a.ITEM_CODE)})}}),this}setControlDefalutValue(e,t,n=!1){var i,o,a,s;if(G.isNullOrEmpty(e)||G.isNullOrEmpty(t))return this;if(e=this.getConfigIdbyLayoutName(e),(e==null?void 0:e.trim().length)>0){const c=this.getLayoutBindModel(e),d=this.getSingleItemConfigInfo(e,t),u=((i=this.getLayoutItemOption(e.trim(),t,"field"))==null?void 0:i.value)||t.trim(),f=c==null?void 0:c.get(u==null?void 0:u.trim());if(f!=null&&n)return this;const h=G.toString(d.DEFAULT_VALUE,!0);if(c&&h.length>0){let p=this.getDefaultStringValue(h),g=null;const m=this.getLayoutItemOption(e.trim(),t,"controlType");if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect","antRadioGroup","erRadioGroup","erCheckboxGroup"].includes(m)&&["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(h)){const _=(a=(o=this._dropDownBindSource)==null?void 0:o[e])==null?void 0:a[t];((s=_==null?void 0:_.dataSource)==null?void 0:s.length)>0&&(_!=null&&_.dataValueField)?h==="$FIRST_ROW$"?p=_.dataSource[0][_.dataValueField]:h==="$LAST_ROW$"?p=_.dataSource[_.dataSource.length-1][_.dataValueField]:["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(m)&&h==="$ALL_VALUES$"&&(p="",_.dataSource.forEach(T=>{p=p.length===0?T[_.dataValueField]:p+","+T[_.dataValueField]})):p=""}if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(m))g=G.getDateTimeByString(p);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(m)){const _=p.split(/[|&]/);g=[G.getDateTimeByString(_[0]),G.getDateTimeByString(_[1])]}else m==="antInputNumber"?g=G.toNumber(p):["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(m)?g=p.split(","):m==="antCheckbox"||m==="antSwitch"?g=p==="1"||p.toLowerCase()==="true":g=p;this.setControlValue(e,t,g)}}return this}getFormButtonConfigInfo(e){let t={},n=[];return this._configInfo.TSI00FORMBUTTON&&this._configInfo.TSI00FORMBUTTON.length>0&&(n=this._configInfo.TSI00FORMBUTTON,n.length>0&&n.every((i,o)=>i.BUTTON_NAME===e?(t=i,!1):!0)),t}getSystemGlobalOptions(){let e={};const t=this.getFormSysInfo("SystemGlobalOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getLayoutGlobalOptions(){let e={};const t=this.getFormSysInfo("LayoutDefaultOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getGridGlobalOptions(){let e={};const t=this.getFormSysInfo("GridDefaultOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getFormExtentedOptions(){var n,i;let e={};const t=this.getFormSysInfo("FormDefaultOptions");if(t.trim().length>0&&(e={...JSON.parse(t)}),((n=this._configInfo.TSI00FORM)==null?void 0:n.length)>0){const o=this._configInfo.TSI00FORM[0];if(((i=o.EXT_OPTIONS)==null?void 0:i.trim().length)>0){const a=JSON.parse(o.EXT_OPTIONS);e={...e,...a}}}return e}resetLayout(e){let t;return e instanceof Array?t=e:t=e.split(","),t.length>0&&t.forEach(n=>{if(n.trim().length>0){const i=this.getConfigInfo(n.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(o=>{o.DEFAULT_VALUE&&o.DEFAULT_VALUE.trim().length>0?this.setControlDefalutValue(n.trim(),o.ITEM_CODE):this.setControlValue(n.trim(),o.ITEM_CODE,void 0)}),l.nextTick(()=>{this.resetValidator(n.trim())})}}),this}getAllControlValue(e,t,n=!1){const i={};return(e instanceof Array?e:e.split(",")).forEach(a=>{if((a==null?void 0:a.trim().length)>0){const s=this.getLayoutBindModel(a.trim());if(s){const c=this.getConfigInfo(a.trim());c.TSI00GRIDVIEW&&c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{var p,g,m,_;const u=this.getLayoutItemOption(a,d.ITEM_CODE,"controlType"),f=this.getLayoutItemOption(a,d.ITEM_CODE,"field")||d.ITEM_CODE,h=G.toNumber(d.MAX_LENGTH);if(f&&(d.IS_VISIBLE==="1"||n===!1)){let T=s[f];if(u==="antCheckbox"||u==="antSwitch")T=T===!0?"1":"0",i[f]=T;else if(u==="antInputNumber")T=T||0,i[f]=T;else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u)&&T){const x=G.toString(d.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss",E=G.getDateTimeFormatString(T,x);E.substring(0,4)==="0001"||E.substring(0,4)==="1900"||E.substring(0,4)==="1901"?T="":(T=E,h>0&&h<T.length&&(T=T.substring(0,h))),i[f]=T}else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const x=this.getLayoutItemOption(a,d.ITEM_CODE,"rangePickerStartKey"),E=this.getLayoutItemOption(a,d.ITEM_CODE,"rangePickerEndKey"),D=G.toString(d.DATE_TIME_FORMAT,!0);let k="yyyyMMddHHmmss",P="yyyyMMddHHmmss";if(D.length>0){const w=D.split(/[|&]/);((p=w[0])==null?void 0:p.trim().length)>=6&&((g=w[0])==null?void 0:g.trim().toLowerCase())!=="yyyymmdd"&&(k="yyyyMMdd"+w[0].substring(0,6)),((m=w[1])==null?void 0:m.trim().length)>=6&&((_=w[1])==null?void 0:_.trim().toLowerCase())!=="yyyymmdd"&&(P="yyyyMMdd"+w[1].substring(0,6))}let b=G.getDateTimeFormatString(s[x],k),S=G.getDateTimeFormatString(s[E],P);(b.substring(0,4)==="0001"||b.substring(0,4)==="1900"||b.substring(0,4)==="1901")&&(b=""),(S.substring(0,4)==="0001"||S.substring(0,4)==="1900"||S.substring(0,4)==="1901")&&(S=""),h>0&&(b.length>h&&(b=b.substring(0,h)),S.length>h&&(S=S.substring(0,h))),i[x]=b,i[E]=S}else["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(u)&&T&&T instanceof Array?(T=T.join(","),i[f]=T):(T=T||"",i[f]=T)}})}}}),t&&Object.keys(t).length>0&&Object.keys(t).forEach(a=>{i[a]=t[a]}),i}getAllControlValueAsFilterArray(e,t){const n=[];return(e instanceof Array?e:e.split(",")).forEach(o=>{const a=this.getConfigInfo(o);a.TSI00GRIDVIEW&&a.TSI00GRIDCOLUMN&&a.TSI00GRIDCOLUMN.forEach(s=>{var c,d,u,f;if(s.OPERATOR.trim().length>0&&s.OPERATOR.trim()!=="None"&&s.PARA_GROUP.trim().length>0&&s.PARA_GROUP.trim()!=="None"){const h=this.getLayoutItemOption(o,s.ITEM_CODE,"controlType"),p={};t&&Object.keys(t).length>0?Object.keys(t).forEach(T=>{p[T]=t[T]}):p.QUERY_TYPE="",p.ITEM_CODE=G.toString(s.ITEM_CODE,!0,"toLower"),p.ORIGIN_CODE=s.ORIGIN_CODE,p.TABLE_NAME=s.TABLE_NAME,p.FIELD_NAME=G.toString(s.PARA_NAME,!0,"toLower"),p.OPERATOR=s.OPERATOR,p.PARA_GROUP=s.PARA_GROUP,p.SQL_CONTENT=s.SQL_CONTENT,p.OP_VALUE=null,p.DATA_TYPE="String";const g=G.toString(p.PARA_GROUP,!0),m=G.toString(p.OPERATOR,!0);let _=this.getControlValue(o,s.ITEM_CODE)||"";if(m.length>0)switch(h){case"antRadioGroup":case"erRadioGroup":case"erSelect":case"erTreeSelect":{p.OP_VALUE=_,p.ORIGIN_CODE==="4"&&s.SVC_NAME.trim().length>0&&p.OP_VALUE.trim().length>0&&p.OPERATOR==="SQL"&&(p.ORIGIN_CODE="SIU",p.SQL_CONTENT=this.getFormCodeSetFilter(s.SVC_NAME,p.OP_VALUE)),(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antInputNumber":{p.DATA_TYPE="Decimal",p.OP_VALUE=_,p.OP_VALUE===null&&(p.OP_VALUE=0),(g==="2"||G.toNumber(p.OP_VALUE)!==0)&&(p.OP_VALUE=G.toString(p.OP_VALUE),n.push(p));break}case"antCheckbox":case"antSwitch":{p.OPERATOR="=",p.OP_VALUE=_===!0?"1":_===!1?"0":"",(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antMultiSelect":case"erMultiSelect":case"erCheckboxGroup":case"erMultiTreeSelect":{p.OPERATOR="IN",_&&_ instanceof Array&&_.length>0?_=_.join(","):_&&typeof _=="string"&&_.length>0?_=_:_="",p.OP_VALUE=_,(g==="2"||_.length>0)&&n.push(p);break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{if(_){const T=G.toString(s.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss";p.OP_VALUE=G.getDateTimeFormatString(_,T),p.OP_VALUE.length>=4&&(p.OP_VALUE.substring(0,4)==="0001"||p.OP_VALUE.substring(0,4)==="1900")&&(p.OP_VALUE=""),(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p)}break}case"antDateTimeRangePicker":case"antDateRangePicker":case"antMonthRangePicker":case"antYearRangePicker":{if(_ instanceof Array&&_.length===2){const T=G.toString(s.DATE_TIME_FORMAT,!0);let x="yyyyMMddHHmmss",E="yyyyMMddHHmmss";if(T.length>0){const b=T.split(/[|&]/);((c=b[0])==null?void 0:c.trim().length)>=6&&((d=b[0])==null?void 0:d.trim().toLowerCase())!=="yyyymmdd"&&(x="yyyyMMdd"+b[0].substring(0,6)),((u=b[1])==null?void 0:u.trim().length)>=6&&((f=b[1])==null?void 0:f.trim().toLowerCase())!=="yyyymmdd"&&(E="yyyyMMdd"+b[1].substring(0,6))}let D=G.getDateTimeFormatString(_[0],x),k=G.getDateTimeFormatString(_[1],E);(D.substring(0,4)==="0001"||D.substring(0,4)==="1900"||D.substring(0,4)==="1901")&&(D=""),(k.substring(0,4)==="0001"||k.substring(0,4)==="1900"||k.substring(0,4)==="1901")&&(k="");const P=p.ITEM_CODE;(g==="2"||D.length>0)&&n.push({...p,ITEM_CODE:`${P}_beg`,OPERATOR:">=",OP_VALUE:D}),(g==="2"||k.length>0)&&n.push({...p,ITEM_CODE:`${P}_end`,OPERATOR:"<=",OP_VALUE:k})}break}default:{G.toString(_,!0).length>0&&m==="IN"&&(_=_.split(/\n|\t|,|,/).map(T=>T.trim()).filter(T=>T.length>0).join(",")),p.OP_VALUE=_,(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}}}})}),n}expandLayoutGroup(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++)if(t[n].trim().length>0){const i=document.getElementById(this.FormId+t[n].trim()+"_content");i&&G.jQuery(i).show()}return this}collapseLayoutGroup(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++)if(t[n].trim().length>0){const i=document.getElementById(this.FormId+t[n].trim()+"_content");i&&G.jQuery(i).hide()}return this}async queryByButton(e,t,n,i){var a;const o=this.getFormButtonConfigInfo(e);((a=o==null?void 0:o.SVC_NAME)==null?void 0:a.trim().length)>0?this.queryByService(o==null?void 0:o.SVC_NAME,t,n,i):G.error("未配置按钮["+e+"]的服务信息!")}async queryByService(e,t,n,i){var o;if(e.trim().length>0){let a=new rt;if(t instanceof rt)a=t;else if(((o=t.filterConfigId)==null?void 0:o.trim().length)>0){const c=this.getAllControlValue(t.filterConfigId,t.extendJson),d=this.getAllControlValueAsFilterArray(t.filterConfigId,t.extendJson);if(t.customFilter){const u=G.converCustomFilterToQueryFilter(t.customFilter);u.length>0&&d.push(...u)}a.addMapData("Table0",[c]),a.addMapData("QUERY_FILTER",d)}const s=await Bn.callServiceEx(e,a,i);n&&n instanceof Function?n(s):G.warn("未配置回调函数!")}else G.error("调用服务名为空")}async queryByDataSource(e,t,n,i,o){var a,s,c,d,u,f,h,p;if(e.trim().length>0){let g="",m=e,_="";const T=this.getGridConfig(e);((a=T==null?void 0:T.SVC_NAME)==null?void 0:a.trim().length)>0&&(m=(s=T==null?void 0:T.SVC_NAME)==null?void 0:s.trim(),g=T.FILTER_STRING.trim(),_=e);let x=new rt;if(n instanceof rt)x=n;else if(((c=n.filterConfigId)==null?void 0:c.trim().length)>0){const k=this.getAllControlValue(n.filterConfigId,n.extendJson),P=this.getAllControlValueAsFilterArray(n.filterConfigId,n.extendJson);if(n.customFilter){const b=G.converCustomFilterToQueryFilter(n.customFilter);b.length>0&&P.push(...b)}g.trim().length>0&&P.push(...G.converCustomFilterToQueryFilter(g.trim())),x.addMapData("Table0",[k]),x.addMapData("QUERY_FILTER",P)}const E=(u=(d=this._configInfo)==null?void 0:d.TSI00DATASOURCE)==null?void 0:u.find(k=>k.FUNC_ID===m);(E==null?void 0:E.ORIGIN_CODE)==="SVC"&&((f=E==null?void 0:E.SVC_NAME)==null?void 0:f.trim().length)>0?t=(h=E==null?void 0:E.SVC_NAME)==null?void 0:h.trim():(x.addMapData("DATA_SOURCE",[{FUNCTION_ID:(E==null?void 0:E.FUNC_ID)||m,COMPANY_CODE:nt.CompanyCode}]),t=t.trim()||((p=E==null?void 0:E.SVC_NAME)==null?void 0:p.trim())||nt.dynamicQueryService);const D=await Bn.callServiceEx(t,x,o);(_==null?void 0:_.trim().length)>0&&this.mergeDataToGrid(D,_,!0),i&&i instanceof Function?i(D):G.warn("未配置回调函数!")}else G.error("未传入配置ID信息")}getFormCodeSetFilter(e,t){let n="";if(this._configInfo[this._formName+e]){for(const i of this._configInfo[this._formName+e])if(i.CODE===t){n=i.SQL_CONTENT;break}}return n}getQuerySqlFormat(e,t){return G.getSystemFormatString(e,t)}getFormSysInfo(e){return this._configInfo[nt.SystemParamsBlockName]&&this._configInfo[nt.SystemParamsBlockName].length>0&&e.trim().length>0?G.toString(this._configInfo[nt.SystemParamsBlockName][0][e.trim().toUpperCase()])||G.toString(this._configInfo[nt.SystemParamsBlockName][0][e.trim()]):""}getSysParaValue(e,t,n){return new Promise((i,o)=>{if(this._sysParaInfo&&this._sysParaInfo[e]!==void 0&&this._sysParaInfo[e][t]!==void 0)i(this._sysParaInfo[e][t].toString());else if(t&&t.trim().length>0){let a="";const s=rt.buildMap([{QUERY_TYPE:"system_para",COMPANY_CODE:e,CTRL_CODE:t,EFFECT_ELEMENT_VALUE:n||""}]);Bn.callServiceEx(nt.queryDevConfigService,s,{partition:this._serverPartition}).then(c=>{c.sysFlag>=0&&c.contains("TSIFIAA51")&&c.getMapData("TSIFIAA51").length>0?a=G.toString(c.getMapData("TSIFIAA51")[0].CTRL_NUM):c.sysFlag>=0&&c.contains(nt.SystemParamsBlockName)&&c.getMapData(nt.SystemParamsBlockName).length>0&&(a=G.toString(c.getMapData(nt.SystemParamsBlockName)[0][t.toUpperCase()])),this._sysParaInfo[e]===void 0&&(this._sysParaInfo[e]={}),this._sysParaInfo[e][t]=a,i(a)},()=>{this._sysParaInfo[e]===void 0&&(this._sysParaInfo[e]={}),this._sysParaInfo[e][t]="",i("")})}})}getDefaultStringValue(e){return e.trim().length>14&&e.trim().substring(0,13)==="$FormSysInfo."&&e.trim().substring(e.trim().length-1,e.trim().length)==="$"?e=this.getFormSysInfo(e.trim().substring(13,e.trim().length-1)):e=G.getSystemFormatString(e),e}setCustomDefaultValue(e,t){(e==null?void 0:e.trim().length)>0&&t&&(this._customDefaultValues[e.trim()]=t)}getLayoutConfigDefaultValues(e){const t={};let n;return e instanceof Array?n=e:n=e.split(","),n.length>0&&n.forEach(i=>{const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{var s,c,d;if(a.DEFAULT_VALUE&&a.DEFAULT_VALUE.trim().length>0){const u=a.FUNCTION_TYPE+a.COLUMN_EDIT,f=a.DEFAULT_VALUE,h=this.getControlName(u,a.FORMAT_STRING);if(h&&h.trim().length>0&&f.trim().length>0)switch(h){case"antInputNumber":{t[a.ITEM_CODE]=parseFloat(f);break}case"erCheckboxGroup":case"antMultiSelect":case"erMultiSelect":{const p=this.getDefaultStringValue(f).split(",");t[a.ITEM_CODE]=p;break}case"antCheckbox":case"antSwitch":{t[a.ITEM_CODE]=G.toString(f)==="1"||G.toString(f)==="true";break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{t[a.ITEM_CODE]=G.getDateTimeByString(f);break}default:{if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(f)){const p=(c=(s=this._dropDownBindSource)==null?void 0:s[i])==null?void 0:c[a.ITEM_CODE];((d=p==null?void 0:p.dataSource)==null?void 0:d.length)>0&&(p!=null&&p.dataValueField)?f==="$FIRST_ROW$"?t[a.ITEM_CODE]=p.dataSource[0][p.dataValueField]:f==="$LAST_ROW$"?t[a.ITEM_CODE]=p.dataSource[p.dataSource.length-1][p.dataValueField]:f==="$ALL_VALUES$"&&(t[a.ITEM_CODE]="",p.dataSource.forEach(g=>{t[a.ITEM_CODE]=t[a.ITEM_CODE].length===0?g[p.dataValueField]:t[a.ITEM_CODE]+","+g[p.dataValueField]})):t[a.ITEM_CODE]=""}else t[a.ITEM_CODE]=this.getDefaultStringValue(f);break}}}})}),t}getGridConfigDefaultValues(e){const t={},n=this.getConfigInfo(e.trim()),i=this.getBindingTable(e.trim());return i&&n.TSI00GRIDVIEW&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(o=>{var a,s,c;if(i.options.schema&&o.DEFAULT_VALUE&&o.DEFAULT_VALUE.trim().length>0){const d=i.options.schema[o.FIELD_NAME].type;if(d==="datetime")t[o.FIELD_NAME]=G.getDateTimeByString(o.DEFAULT_VALUE);else if(d==="boolean")t[o.FIELD_NAME]=o.DEFAULT_VALUE==="1"||o.DEFAULT_VALUE.toLowerCase()==="true";else if(d==="number")t[o.FIELD_NAME]=G.toNumber(o.DEFAULT_VALUE);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(o.DEFAULT_VALUE)){const u=(s=(a=this._dropDownBindSource)==null?void 0:a[e])==null?void 0:s[o.ITEM_CODE];((c=u==null?void 0:u.dataSource)==null?void 0:c.length)>0&&(u!=null&&u.dataValueField)?o.DEFAULT_VALUE==="$FIRST_ROW$"?t[o.FIELD_NAME]=u.dataSource[0][u.dataValueField]:o.DEFAULT_VALUE==="$LAST_ROW$"?t[o.FIELD_NAME]=u.dataSource[u.dataSource.length-1][u.dataValueField]:o.DEFAULT_VALUE==="$ALL_VALUES$"&&(t[o.FIELD_NAME]="",u.dataSource.forEach(f=>{t[o.FIELD_NAME]=t[o.FIELD_NAME].length===0?f[u.dataValueField]:t[o.FIELD_NAME]+","+f[u.dataValueField]})):t[o.FIELD_NAME]=""}else t[o.FIELD_NAME]=this.getDefaultStringValue(o.DEFAULT_VALUE)}}),t}async loadGrid(e,t,n,i,o){var a,s,c,d,u,f,h,p,g,m,_,T,x,E,D,k,P;if(!this.containsConfig(e)&&(n==null?void 0:n.forceLoadConfig)!==!1&&await this.loadConfig(e),this.containsConfig(e)){if(this._gridInstanceInfo[e]&&(n==null?void 0:n.reload)!==!0)return console.error(`Grid instance ${e} already exists!`),!1;this.getSingleViewConfigInfo(e),this._gridColumnsConfigInfo[e]={},this._allowMergeColumnFields[e]=[],this._gridStyleInfo[e]=this._gridStyleInfo[e]||[],this._gridOptions[e]=this._gridOptions[e]||{};const b=this.getConfigInfo(e);if((a=t==null?void 0:t.gridOptions)!=null&&a.api&&b.TSI00GRIDVIEW&&b.TSI00GRIDVIEW.length>0){const S=b.TSI00GRIDVIEW[0];((s=n==null?void 0:n.cloneTableName)==null?void 0:s.trim().length)>0&&this.cloneTableForLayoutOrGrid(((c=n==null?void 0:n.originTableName)==null?void 0:c.trim())||S.TABLE_NAME.trim(),n.cloneTableName.trim(),e),t.gridOptions.context={configId:e,configCaption:S.FUNCNAME_RES||S.FUNCNAME,options:n},n=n||{},S.SHOW_GROUP==="2"?n.groupDisplayType="singleColumn":S.SHOW_GROUP==="3"?n.groupDisplayType="multipleColumns":n.groupDisplayType="groupRows",(d=this._formOptions)!=null&&d.gridOptions&&(n={...this._formOptions.gridOptions,...n}),((u=S.CUS_EXT_OPTIONS)==null?void 0:u.trim().length)>0&&(n={...JSON.parse(S.CUS_EXT_OPTIONS),...n}),((f=S.EXT_OPTIONS)==null?void 0:f.trim().length)>0&&(n={...JSON.parse(S.EXT_OPTIONS),...n});const w=this.getFormSysInfo("GridDefaultOptions");w.trim().length>0&&(n={...JSON.parse(w),...n}),["disableErMenu","rowDragManaged","groupIncludeFooter","groupIncludeTotalFooter","suppressRowTransform","suppressRowClickSelection","rowMultiSelectWithClick","singleClickEdit"].forEach(B=>{const O=t.gridOptions[B]??n[B];O!==void 0&&(n[B]=O)}),this.setGridToolbarVisible(e,{refresh:S.SHOW_REFRESH==="1",addrow:S.SHOW_ADD==="1",copyrow:S.SHOW_ADDCOPY==="1",delete:S.SHOW_DELETE==="1",cancel:S.SHOW_ADD==="1"||S.SHOW_ADDCOPY==="1"||S.SHOW_DELETE==="1",excel:S.SHOW_EXPORT==="1",import:S.ALLOW_IMPORT==="1"}),((h=S==null?void 0:S.KEY_FIELDS)==null?void 0:h.trim().length)>0&&(this.getGridOptions(e,"primaryKeys")===void 0||((p=this.getGridOptions(e,"primaryKeys"))==null?void 0:p.length)===0)&&this.setGridOptions(e,"primaryKeys",(g=S==null?void 0:S.KEY_FIELDS)==null?void 0:g.trim().split(",").filter(B=>B.trim().length>0)),n.groupDisplayType=n.groupDisplayType||t.gridOptions.groupDisplayType||this.getFormSysInfo("GRIDGROUPDISPLAYTYPE")||"groupRows",n.rowHeight=n.rowHeight||t.gridOptions.rowHeight;const v=this.getGridConfigOptions(e,n,i,o);v.context={...t.gridOptions.context,...v.context},v&&Object.keys(v).forEach(B=>{t.gridOptions[B]=v[B]!==void 0?v[B]:t.gridOptions[B]}),t.gridOptions.defaultColDef=t.gridOptions.defaultColDef||{},t.gridOptions.rowSelection=b.TSI00GRIDVIEW[0].MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single",t.gridOptions.api.selectionService.rowSelection=t.gridOptions.rowSelection,t.gridOptions.api.selectionService.groupSelectsChildren=!0,t.gridOptions.api.setColumnDefs(v.columnDefs),t.gridOptions.api.setRowData([]);const A=(o==null?void 0:o.pagination)===!0||(o==null?void 0:o.pagination)==="client";if(S.ALLOW_CELLMERGE==="1"&&!A&&((m=t.gridOptions.context.mergeColumns)==null?void 0:m.length)>0&&!n.masterDetail&&(t.gridOptions.context.calculateRowSpan=(B=!0)=>{var H,V,N,W,j,U;let O=[];const M=t.gridOptions.columnApi.getRowGroupColumns(),R={};if(M.length===0){B?O=t.gridOptions.context.bindingSource.data():t.gridOptions.api.forEachNodeAfterFilterAndSort(X=>{var Y;(Y=X.data)!=null&&Y.uid&&O.push(X.data)});const ie=((N=(V=(H=t.gridOptions.context)==null?void 0:H.viewConfig)==null?void 0:V.MERGE_COLUMN)==null?void 0:N.trim().length)>0?(U=(j=(W=t.gridOptions.context)==null?void 0:W.viewConfig)==null?void 0:j.MERGE_COLUMN)==null?void 0:U.trim().split(","):[];t.gridOptions.context.mergeColumns.forEach(X=>{R[X]={};const Y={};let Z=0;const ce=[...ie,X];for(let ue=0;ue<O.length;ue++){let he=!0;for(let re=0;re<ce.length;re++){const z=ce[re];if(O[ue][z]!==Y[z]){he=!1;break}}if(!he){if(Object.keys(Y).length>0)for(let re=Z;re<ue;re++){const z=O[re].uid;R[X][z]=re===Z?ue-Z:0}ce.forEach(re=>{Y[re]=O[ue][re]}),Z=ue}if(ue===O.length-1)for(let re=Z;re<=ue;re++){const z=O[re].uid;R[X][z]=re===Z?ue-Z+1:0}}})}return t.gridOptions.context.rowSpanMap=R,O[0]}),(S==null?void 0:S.SHOW_FOOTER)==="1"&&((_=t.gridOptions.context.viewType)==null?void 0:_.toLowerCase())!=="cardview"&&((T=t.gridOptions.context.viewType)==null?void 0:T.toLowerCase())!=="card"&&t.gridOptions.api.setPinnedBottomRowData([{pinndeRowType:"ErGridSummaryFooter"}]),l.nextTick(()=>{var B;t.gridOptions.defaultColDef.floatingFilter===void 0&&t.gridOptions.api.setDefaultColDef({floatingFilter:(S==null?void 0:S.SHOW_FILTER_ROW)==="1"}),((B=n==null?void 0:n.initialData)==null?void 0:B.length)>0&&this.mergeDataToGrid(n.initialData,t)}),t.gridOptions.processCellForClipboard=B=>{var O,M,R,H,V,N,W,j;return(R=(M=(O=B.column)==null?void 0:O.colDef)==null?void 0:M.context)!=null&&R.hideContent?"******":(H=B.node)!=null&&H.footer&&((V=B.node)!=null&&V.group)&&((N=B.context)!=null&&N.focusColId)&&B.node.aggData&&B.node.aggData[B.context.focusColId]?Zr.isPlainObject(B.node.aggData[B.context.focusColId])?`☑️ ${G.formatNumberValue(B.node.aggData[B.context.focusColId].aggValueOfChecked,"")}
|
|
71
|
+
</div>`}static checkGridRow(e,t,n=!0){var i,o,a,s;(i=e==null?void 0:e.gridOptions)!=null&&i.api&&t!==void 0&&t!==null&&(typeof t=="string"&&t.trim().length>0?t=[t]:t.uid&&(t=[G.toString(t.uid)]),t instanceof Array&&t.length>0?t.forEach(c=>{const d=e.gridOptions.api.getRowNode(c);d&&d.setSelected(n===!0)}):typeof t=="number"&&t>=0&&((s=(a=(o=e.gridOptions.api)==null?void 0:o.getModel())==null?void 0:a.getRow(t))==null||s.setSelected(n===!0)))}static checkGridCurrentRow(e){if(e){const t=cr.getGridCurrentRow(e);t&&cr.checkGridRow(e,t)}}static checkAllGridRow(e,t=!0){var n;if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const i=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(i&&i.visible){const o=(a,s)=>{a.setSelected(!0)};t?e.gridOptions.api.forEachNodeAfterFilterAndSort(o):e.gridOptions.api.forEachLeafNode(o)}}}static unCheckAllGridRow(e,t=!0){var n;if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const i=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(i&&i.visible){const o=(a,s)=>{a.setSelected(!1)};t?e.gridOptions.api.forEachNodeAfterFilterAndSort(o):e.gridOptions.api.forEachLeafNode(o)}}}static isGridRowChecked(e,t){var n,i;if((n=e==null?void 0:e.gridOptions)!=null&&n.api&&t){const o=cr.getGridColumn(e,nt.GridCheckColumnFieldName);if(o&&o.visible)return(i=e.gridOptions.api.getRowNode(t instanceof qr?t.uid:t))==null?void 0:i.isSelected()}}static setGridFocusedCell(e,t=0,n,i){var o,a,s,c;if((o=e==null?void 0:e.gridOptions)!=null&&o.api){const d=e.gridOptions.api;if(d.clearRangeSelection(),d.getDisplayedRowCount()>0){if(t=t||0,d.ensureIndexVisible(t),n)d.ensureColumnVisible(n),d.setFocusedCell(t,n,i);else if(((s=(a=e.gridOptions.api.columnModel)==null?void 0:a.gridColumns)==null?void 0:s.length)>0){for(let u=0;u<e.gridOptions.api.columnModel.gridColumns.length;u++)if((c=e.gridOptions.api.columnModel.gridColumns[u])!=null&&c.visible){d.ensureColumnVisible(e.gridOptions.api.columnModel.gridColumns[u]),d.setFocusedCell(t,e.gridOptions.api.columnModel.gridColumns[u],i);break}}}}}static validateGridInput(e,t,n,i=!1,o=!0){var c,d,u;n=n||"ChangedRows";let a=!0,s=!1;if((c=e==null?void 0:e.gridOptions)!=null&&c.api){const f=e.gridOptions.api,h=(u=(d=e.gridOptions)==null?void 0:d.context)==null?void 0:u.columnsConfig,p=[];if(i instanceof Array&&i.length>0?i.forEach(m=>{m.trim().length>0&&p.push({ITEM_CODE:m.trim(),FIELD_NAME:m.trim(),CONDITION_TABLE:"",MUST_INPUT_CONDITION:""})}):(s=i===!0,h==null||h.forEach(g=>{g.UNBOUND_TYPE==="0"&&g.ITEM_MUST_FLAG==="1"&&p.push(g)})),p.length>0)if(f.setFilterModel(null),n==="CheckedRows"){const g=f.getSelectedNodes();for(let m=0;m<g.length;m++)if(a=this.validateGridRowInput(f,g[m],p,t,s,o),!a)return a}else if(n==="AllRows"){const g=f.getModel().getRowCount();for(let m=0;m<g;m++){const _=f.getModel().getRow(m);if(_!=null&&_.data&&(a=this.validateGridRowInput(f,_,p,t,s,o),!a))return a}}else{const g=cr.getGridCreatedRows(e),m=cr.getGridModifyRows(e),_=[...g,...m];for(let T=0;T<_.length;T++){const x=f.getModel().getRowNode(_[T].uid);if(x!=null&&x.data&&(a=this.validateGridRowInput(f,x,p,t,s,o),!a))return a}}}return a}static setGridColumnEditable(e,t,...n){var i,o;if((i=e==null?void 0:e.gridOptions)!=null&&i.api){const a=(o=e.gridOptions.api.columnModel)==null?void 0:o.gridColumns;if(n.length===1&&(n=n[0].split(",")),(a==null?void 0:a.length)>0){const s=e.gridOptions.api.getEditingCells();let c="";s.forEach(d=>{var u;c=((u=d.column)==null?void 0:u.getId())||""}),a.forEach(d=>{var u;d.colId!==nt.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(d.colId))&&(d.context=d.context||{},d.context.editable=t,d.colId===c&&t===!1&&e.gridOptions.api.stopEditing(),(d.colDef.cellEditor==="agCheckboxCellEditor"||d.colDef.cellEditType==="switchEditor")&&((u=e==null?void 0:e.gridOptions)==null||u.api.refreshCells({force:!0,columns:[d]})))})}}}static getGridCellRenderText(e,t,n,i){var s,c,d,u;let o="";const a=this.getGridColumnDef(e,t);return a!=null&&a.context&&(a.context.cellEditType==="dateEditor"?o=G.getDateTimeFormatString(n,i||((s=a.context.columnConfig)==null?void 0:s.FORMAT_STRING)):a.context.cellEditType==="numberEditor"?o=G.formatNumberValue(n,i||((c=a.context.columnConfig)==null?void 0:c.FORMAT_STRING)):a.refData&&((d=a.context)==null?void 0:d.cellEditType)==="checkGridLookUpEdit"&&a.context.valueField!==a.context.textField?G.toString(n).trim().split(",").forEach(h=>{const p=a.refData[h]||h;o=o.length===0?p:o+","+p}):((u=a.context)==null?void 0:u.cellEditType)==="gridLookUpEdit"?o=a.refData[n]||n:o=G.toString(n)),o}static validateGridRowInput(e,t,n,i,o=!1,a=!0){var c,d,u;if(e&&((c=t==null?void 0:t.data)!=null&&c.uid))for(let f=0;f<n.length;f++){const h=n[f].ITEM_CODE,p=n[f].FIELD_NAME,g=n[f].CONDITION_TABLE;let m={};G.toString(n[f].EXT_OPTIONS).trim().length>0&&(m=JSON.parse(G.toString(n[f].EXT_OPTIONS)));const _=m.requireCondition||n[f].MUST_INPUT_CONDITION,T=e.getColumnDef(h);if(T&&(!T.visible||!o))if(_.trim().length===0){if(t.rowIndex&&(t==null?void 0:t.data[p])===void 0||(t==null?void 0:t.data[p])===null||G.toString(t==null?void 0:t.data[p]).trim().length===0||((d=T.context)==null?void 0:d.dataType)==="number"&&(t==null?void 0:t.data[p])===0)return a&&(e.ensureNodeVisible(t,"top"),e.ensureColumnVisible(T.colId,"auto"),e.clearRangeSelection(),e.setFocusedCell(t.rowIndex||0,T.colId),e.startEditingCell({rowIndex:t.rowIndex||0,colKey:T.colId}),l.nextTick(()=>{e.getCellEditorInstances({columns:[T],rowNodes:[t]}).forEach(E=>{E.editorType,E.setBorder?E.setBorder("2px solid red"):E.setInvalid&&E.setInvalid()})}),G.messageWarning(G.$t("ERX.InputEmptyMessage"))),!1}else{let x=t==null?void 0:t.data;if(g.trim().length>0&&(i!=null&&i.contains(g.trim()))&&(x=i==null?void 0:i.getCurrentDataObject(g.trim())),x&&x instanceof qr&&G.checkExpressionValid(x,G.getSystemFormatString(_))&&((t==null?void 0:t.data[p])===void 0||(t==null?void 0:t.data[p])===null||G.toString(t==null?void 0:t.data[p]).trim().length===0||((u=T.context)==null?void 0:u.dataType)==="number"&&(t==null?void 0:t.data[p])===0))return a&&(e.ensureNodeVisible(t,"top"),e.ensureColumnVisible(T.colId,"auto"),e.clearRangeSelection(),e.setFocusedCell(t.rowIndex||0,T.colId),e.startEditingCell({rowIndex:t.rowIndex||0,colKey:T.colId}),G.messageWarning(G.$t("ERX.InputEmptyMessage"))),!1}}return!0}static setGridRowData(e,t,n,i=!1){var o;if((o=e==null?void 0:e.gridOptions)!=null&&o.api&&t&&n){n instanceof qr&&(n=n.toJSON());const a=e.gridOptions.api;if(t instanceof qr&&(t=t.uid),typeof t=="string"&&t.trim().length>0){const s=a.getModel().getRowNode(t.trim());s&&s.data&&(Object.keys(n).forEach(c=>{var d,u;if(!["isNew","uid","dirty","dirtyFields","_events","_schemaFields","_preview_row_data","_children_data"].includes(c)&&typeof n[c]!="function"&&((d=s.data.schemaFields)!=null&&d[c])&&(G.toString(s.data[c]).trim().length===0||i===!1)){const f=a.getColumnDef(c);f?f.cellEditor==="agCheckboxCellEditor"?s.setDataValue(c,n[c]===!0||n[c]==="1"):Zr.isPlainObject(f.cellEditor)&&((u=f.cellEditor)==null?void 0:u.name)==="DatetimeEditor"?G.toString(n[c]).trim().length===0?s.setDataValue(c,null):s.setDataValue(c,G.getDateTimeByString(n[c])):s.setDataValue(c,n[c]):s.data[c]=n[c]}}),a.refreshCells({columns:[nt.GridCheckColumnFieldName],rowNodes:[s]}))}}}static setGridCurrentRowData(e,t,n=!1){const i=cr.getGridCurrentRow(e);i&&cr.setGridRowData(e,i,t,n)}static setGridRowState(e,t,n){var i,o,a,s;if((i=e==null?void 0:e.gridOptions)!=null&&i.api&&t){const c=e.gridOptions.api;if(t instanceof qr&&(t=t.uid),typeof t=="string"&&t.trim().length>0){const d=c.getModel().getRowNode(t.trim());if(d&&((o=d.data)!=null&&o.uid)){const u=(s=(a=e.gridOptions)==null?void 0:a.context)==null?void 0:s.bindingSource;u&&u.setRowState(d.data,n)}}}}static getGridBindingTable(e){var t,n;return(n=(t=e.gridOptions)==null?void 0:t.context)==null?void 0:n.bindingSource}static getGridColumn(e,t){var i,o,a,s;let n;if(t=G.toString(t,!0),(i=e==null?void 0:e.gridOptions)!=null&&i.api&&((o=e==null?void 0:e.gridOptions)!=null&&o.columnApi))if(t.length>0){const c=(a=e==null?void 0:e.gridOptions)==null?void 0:a.columnApi.getColumns();for(let d=0;d<c.length;d++)if(c[d].colId===t||c[d].field===t){n=c[d];break}}else{const c=(s=e==null?void 0:e.gridOptions)==null?void 0:s.api.getFocusedCell();c&&(n=c.Column)}return n}static getGridColumnDef(e,t){let n;const i=this.getGridColumn(e,t);return i!=null&&i.colDef&&(n=i.colDef),n}static async deleteGridRows(e,t=!1,n){var i,o,a,s,c,d,u,f,h,p;if((i=e==null?void 0:e.gridOptions)!=null&&i.api){const g=n||this.getGridRows(e,"select");if((g==null?void 0:g.length)>0){let m=!0;if(t&&(m=await G.messageConfirm(G.$t("ERX.RemoveConfirmMessage")||"是否确认删除?")),m){if((o=e==null?void 0:e.gridOptions)!=null&&o.treeData){const _=[];(s=(a=e==null?void 0:e.gridOptions)==null?void 0:a.api)==null||s.forEachNode(T=>{for(let x=0;x<g.length;x++)g[x][nt.TreeHierarchyFieldName].every(E=>new Set(T.data[nt.TreeHierarchyFieldName]).has(E))&&_.push(T.data)}),(u=(d=(c=e==null?void 0:e.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource)==null||u.remove(_)}else(p=(h=(f=e==null?void 0:e.gridOptions)==null?void 0:f.context)==null?void 0:h.bindingSource)==null||p.remove(g);return!0}}}return!1}static getGridSelectRows(e,t=!1,n=!1){return this.getGridRows(e,"select",t,n)}static getGridCurrentRow(e,t=!1,n=!1){let i;const o=this.getGridRows(e,"current",t,n);return o.length>0&&(i=o[0]),i}static getGridCheckedRows(e,t=!1,n=!1){return this.getGridRows(e,"checked",t,n)}static getGridCheckedAfterFilterRows(e,t=!1,n=!1){return this.getGridRows(e,"checkedAfterFilter",t,n)}static getGridDeletedRows(e,t=!1,n=!1){return this.getGridRows(e,"delete",t,n)}static getGridModifyRows(e,t=!1,n=!1){return this.getGridRows(e,"modify",t,n)}static getGridCreatedRows(e,t=!1,n=!1){return this.getGridRows(e,"add",t,n)}static getGridAllRows(e,t=!1,n=!1){return this.getGridRows(e,"all",t,n)}static getGridRows(e,t,n=!1,i=!1){var c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B;let o=[],a,s;if(e!=null&&e.api&&(e!=null&&e.columnApi)?(a=e.api,s=e.columnApi):(a=(c=e==null?void 0:e.gridOptions)==null?void 0:c.api,s=(d=e==null?void 0:e.gridOptions)==null?void 0:d.columnApi),a&&t&&t.toString().length>0){switch(t){case"current":{const O=a.getFocusedCell();if(O){const M=(f=(u=a.getModel())==null?void 0:u.getRow(O.rowIndex))==null?void 0:f.data;M&&(n instanceof Function?o.push(n(M)||M.toJSON()):o.push(n?M.toJSON():M))}break}case"checked":{a.forEachLeafNode(O=>{var M;(M=O.data)!=null&&M.uid&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"addWithChecked":{a.forEachLeafNode(O=>{var M,R;(M=O.data)!=null&&M.uid&&((R=O.data)!=null&&R.isNew)&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"modifyWithChecked":{a.forEachLeafNode(O=>{var M,R;(M=O.data)!=null&&M.uid&&((R=O.data)!=null&&R.isDirty)&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"checkedAfterFilter":{a.forEachNodeAfterFilter(O=>{var M;(M=O.data)!=null&&M.uid&&O.isSelected()&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}case"select":if(e!=null&&e.gridOptions){const O=this.getGridColumn(e,nt.GridCheckColumnFieldName);return O&&!O.hide&&((h=e==null?void 0:e.gridOptions.context)==null?void 0:h.viewConfig.SHOW_SELECTION)==="1"?this.getGridRows(e,"checked",n,i):this.getGridRows(e,"current",n,i)}break;case"delete":if((g=(p=e==null?void 0:e.gridOptions)==null?void 0:p.context)!=null&&g.bindingSource){const O=(_=(m=e==null?void 0:e.gridOptions)==null?void 0:m.context)==null?void 0:_.bindingSource;o=O==null?void 0:O.getRows("removed",n)}break;case"modify":if((x=(T=e==null?void 0:e.gridOptions)==null?void 0:T.context)!=null&&x.bindingSource){const O=(D=(E=e==null?void 0:e.gridOptions)==null?void 0:E.context)==null?void 0:D.bindingSource;o=O==null?void 0:O.getRows("updated",n)}break;case"add":if((P=(k=e==null?void 0:e.gridOptions)==null?void 0:k.context)!=null&&P.bindingSource){const O=(S=(b=e==null?void 0:e.gridOptions)==null?void 0:b.context)==null?void 0:S.bindingSource;o=O==null?void 0:O.getRows("created",n)}break;case"all":if((I=(w=e==null?void 0:e.gridOptions)==null?void 0:w.context)!=null&&I.bindingSource){const O=(A=(v=e==null?void 0:e.gridOptions)==null?void 0:v.context)==null?void 0:A.bindingSource;o=O==null?void 0:O.getRows("all",n)}break;case"allAfterFilter":a.forEachNodeAfterFilterAndSort(O=>{var M;(M=O.data)!=null&&M.uid&&(n instanceof Function?o.push(n(O.data)||O.data.toJSON()):o.push(n?O.data.toJSON():O.data))});break}if(s&&i&&(o==null?void 0:o.length)>0){const O=((B=s.getAllGridColumns())==null?void 0:B.map(M=>{var R;return(R=M.colDef)==null?void 0:R.field}))||[];o=o.map(M=>(Object.keys(M).forEach(R=>{O.includes(R)||delete M[R]}),M))}}return o}static getGridChangedRowsAsDataMap(e,t,n,i=!1,o){var d,u,f;n=n||new rt,t=t||((f=(u=(d=e==null?void 0:e.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource)==null?void 0:f.tableName)||"Table0";const a=this.getGridRows(e,"delete",o??!0,i);a.length>0&&n.addMapData(t+"_DELETE",a);const s=this.getGridRows(e,"modify",o??!0,i);s.length>0&&n.addMapData(t+"_MODIFY",s);const c=this.getGridRows(e,"add",o??!0,i);return c.length>0&&n.addMapData(t+"_ADD",c),n}static mergeGridDataRow(e,t,n=!1,i=!1){if(e&&t){t instanceof qr&&(t=t.toJSON());const o=Object.keys(e.toJSON()),a=Object.keys(t);(o==null?void 0:o.length)>0&&(a==null?void 0:a.length)>0&&(o.length>a.length?a:o).forEach(c=>{var d;(d=e.schemaFields)!=null&&d[c]&&t[c]!==void 0&&String(e[c]).trim()!==String(t[c]).trim()&&(i||typeof e[c]=="number"||typeof t[c]=="number"||!n||G.toString(t[c],!0).length===0)&&e.set(c,t[c])})}return e}static clearGridData(e){var t,n,i,o,a;if((t=e==null?void 0:e.gridOptions)!=null&&t.api&&((i=(n=e==null?void 0:e.gridOptions)==null?void 0:n.context)!=null&&i.bindingSource)){const s=(a=(o=e==null?void 0:e.gridOptions)==null?void 0:o.context)==null?void 0:a.bindingSource;s==null||s.clear()}return this}static mergeDataToDataTable(e,t,n=!0){var o,a,s,c,d;let i=-1;if(t&&t instanceof Cn){let u=[];e instanceof Array?u=e:((o=e.sys)==null?void 0:o.status)>=0?((a=t.tableName)==null?void 0:a.trim().length)>0&&e.contains(t.tableName.trim())?u=e.getBlock(t.tableName.trim()).data:u=e.getBlock(0).data:e.data instanceof Array?u=e.data:e.getStatus instanceof Function&&e.getStatus()>=0?u=((c=e.getBlock(((s=t.tableName)==null?void 0:s.trim())??"result"))==null?void 0:c.getMappedRows())??e.getBlockByIndex(0).getMappedRows():e.getMappedRows instanceof Function?u=e.getMappedRows():e.getMapData instanceof Function&&(u=e.getMapData(((d=t.tableName)==null?void 0:d.trim())??"result")??e.getMapData()),u?u instanceof Array?(t.merge(u,n),i=t.totalCount()):console.error("ER: Data is not EiInfo、EiBlock、ER.Model or Array"):console.error("ER: Data is undefined")}else console.error("ER: DataTable is undefined");return i}static mergeDataToGrid(e,t,n=!0){var o,a,s,c,d;let i=0;if(e&&((o=t==null?void 0:t.gridOptions)!=null&&o.api)&&((s=(a=t==null?void 0:t.gridOptions)==null?void 0:a.context)!=null&&s.bindingSource)){const u=(d=(c=t==null?void 0:t.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource;u&&e&&(i=this.mergeDataToDataTable(e,u,n))}return i}static mergeEiBlockToGrid(e,t,n=!0){return this.mergeDataToGrid(e.data,t,n)}static setGridData(e,t,n=!1,i){let o=0;if(e){const a=[];let s=[];if(n){if(t.data instanceof Array&&t.getBlockMeta instanceof Function)s=t.data||[],t.getBlockMeta().forEach(c=>{c.name.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c.name,colId:c.name,field:c.name,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{showTooltips:!0,suppressFilterCounts:!1,excelMode:i==null?void 0:i.excelMode}})}),e.setColumnDefs(a);else if(t.getBlockMeta instanceof Function&&t.getMappedRows instanceof Function){s=t.getMappedRows()||[];const c=t.getBlockMeta().getMetas();for(const d in c)d.toUpperCase()!==nt.IdFieldName&&a.push({headerName:d,colId:d,field:d,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{excelMode:"windows"}});e.setColumnDefs(a)}else t instanceof rt?(s=t.getMapData()||[],t.getMeta().forEach(c=>{c.name.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c.name,colId:c.name,width:100,field:c.name,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{showTooltips:!0,suppressFilterCounts:!1,excelMode:i==null?void 0:i.excelMode}})}),e.setColumnDefs(a)):t instanceof Array&&(s=t||[],Object.keys(t[0]).forEach(c=>{c.toUpperCase()!==nt.IdFieldName&&a.push({headerName:c,colId:c,field:c,resizable:!0,sortable:!0,editable:!0,filter:"agSetColumnFilter",filterParams:{excelMode:"windows"}})}));i!=null&&i.showRowNo&&a.unshift({colId:nt.GridCheckColumnFieldName,pinned:i!=null&&i.IsRtl?"right":"left",headerName:"",width:55,suppressColumnsToolPanel:!0,suppressSizeToFit:!0,suppressMenu:!0,resizable:!0,sortable:!1,suppressMovable:!0,lockPosition:i!=null&&i.IsRtl?"right":"left",cellRenderer:c=>{var d;return c.node.footer||c.node.group?"":((d=c.node)==null?void 0:d.childIndex)+1}}),e.setColumnDefs(a)}e.setRowData(s),o=s.length}return o}static importExcelFile(e,t,n,i){var o,a;((a=(o=e==null?void 0:e.gridOptions)==null?void 0:o.context)==null?void 0:a.bindingSource)instanceof Cn&&G.readExcelFile(s=>{var c,d,u;if(s.length>0){const f={},h={},p=(c=e==null?void 0:e.gridOptions)==null?void 0:c.columnApi.getColumns(),g=(u=(d=e==null?void 0:e.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource,m={},_=(x,E)=>{var D,k,P;if(x==null)return"";if(m[E.field]=m[E.field]||{},m[x])return m[x];if((D=E.refData)!=null&&D[x])return x;{if(G.toString(x).includes("|")){const S=x.split("|");if((k=E.refData)!=null&&k[S[0]])return S[0]}else if(G.toString(x).includes("-")){const S=x.split("-");if((P=E.refData)!=null&&P[S[0]])return S[0]}const b=Object.keys(E.refData).find(S=>E.refData[S]===G.toString(x)||E.refData[S]===`${S}|${G.toString(x)}`||E.refData[S]===`${S}-${G.toString(x)}`);return b?(m[E.field][x]=b,b):""}},T=[];s.forEach(x=>{if(x.__EMPTY!==(G.$t("ERX.Aggregate")||"总计")&&x.__EMPTY!==(G.$t("ERX.GroupAggregate")||"小计")){Object.keys(x).forEach(D=>{var k,P;if(D&&!D.startsWith("__EMPTY")&&!h[D])for(let b=0;b<p.length;b++){const S=p[b].getColDef(),w=(k=S.headerName)==null?void 0:k.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim(),I=D.replace(/<br\s*\/?>/gi,"").replace(/\s+/g,"").trim();if((w===I||S.field===I)&&S.field&&((P=g.options.schema)!=null&&P[S.field])){f[S.field]={dataKey:D,colDef:S},h[D]=S;break}}});const E={};Object.keys(f).forEach(D=>{var k,P;x[f[D].dataKey]&&(E[f[D].colDef.field]=x[f[D].dataKey],f[D].colDef.refData&&((k=f[D].colDef.cellEditor)==null?void 0:k.name)==="DropdownEditor"?E[f[D].colDef.field]=_(E[f[D].colDef.field],f[D].colDef):((P=f[D].colDef.cellEditor)==null?void 0:P.name)==="DatetimeEditor"&&(E[f[D].colDef.field]=G.getDateTimeByString(E[f[D].colDef.field])))}),t&&t instanceof Function?t(E)&&T.push(E):T.push(E)}}),n&&n instanceof Function?n(T):g.import(T)}})}static exportGridToExcel(e,t,n){var c,d;let i=u=>{var h,p,g;this.setGridColumnOptions(e,m=>{var _,T,x,E,D;m.colId===nt.GridCheckColumnFieldName||(m.cellDataType==="number"?m.cellClass=u!=null&&u.numberAsText?"right-cell-string":"right-cell":((_=m.context)==null?void 0:_.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0&&(((T=m.context.columnConfig)==null?void 0:T.FORMAT_STRING)==="yyyy-MM-dd"||((x=m.context.columnConfig)==null?void 0:x.FORMAT_STRING)==="yyyy/MM/dd"?m.cellClass="date-cell":m.cellClass="datetime-cell")),((E=n==null?void 0:n.excelStyleConfig)==null?void 0:E.length)>0&&((D=n==null?void 0:n.excelStyleConfig)==null||D.forEach(k=>{(k.columnNames.length===0||m.colId&&k.columnNames.includes(m.colId.toUpperCase()))&&(m.cellClassRules=m.cellClassRules||{},u!=null&&u.includeCellStyle?!k.condition||k.condition.trim().length===0||k.condition.trim().replaceAll(" ","")==="1=1"?m.cellClassRules[k.id]=P=>{var b;return((b=P.data)==null?void 0:b.uid)&&!0}:m.cellClassRules[k.id]=P=>{var b;return((b=P.data)==null?void 0:b.uid)&&G.checkExpressionValid(P.data,G.getSystemFormatString(k.condition))}:delete m.cellClassRules[k.id])}))});let f;((h=u==null?void 0:u.contentTitle)==null?void 0:h.trim().length)>0&&(f=[{cells:[{data:{value:(p=u==null?void 0:u.contentTitle)==null?void 0:p.trim(),type:"String"},styleId:"title",mergeAcross:(((g=n==null?void 0:n.columnKeys)==null?void 0:g.length)||1)-1}],height:50}]),e==null||e.exportDataAsExcel({fileName:(u==null?void 0:u.fileName)||"grid.xlsx",sheetName:(u==null?void 0:u.sheetName)||"Sheet1",author:nt.UserId,skipPinnedBottom:!0,onlySelected:u==null?void 0:u.selectedRows,skipRowGroups:u==null?void 0:u.skipGroupRows,skipColumnGroupHeaders:u==null?void 0:u.skipBandRows,columnKeys:n==null?void 0:n.columnKeys,processHeaderCallback:m=>{var _,T;return((T=(_=m.column.colDef)==null?void 0:_.headerName)==null?void 0:T.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:m=>!!(u!=null&&u.skipSummaryRows&&m.node.footer===!0&&m.node.group===!0&&m.node.level>=0||u!=null&&u.skipFooterRows&&m.node.footer===!0&&m.node.group===!0&&m.node.level<0),prependContent:(n==null?void 0:n.prependContent)??f,appendContent:n==null?void 0:n.appendContent,processCellCallback:m=>{var x,E,D,k,P,b,S,w,I,v,A,B,O,M,R,H,V,N,W,j,U;const _=G.toString(m.value).includes("->")?" -> ":"",T=G.toString(m.value).replace(_,"").trimStart();return(E=(x=m.column.colDef)==null?void 0:x.context)!=null&&E.hideContent||m.value&&Zr.isPlainObject(m.value)&&m.formatValue instanceof Function?m.formatValue(m.value):m.node.group&&m.node.footer!==!0?(D=m.column.colDef)!=null&&D.rowGroup&&m.node.key?((k=m.column.colDef.refData)==null?void 0:k[m.node.key])||m.node.key:((b=(P=m.column.colDef)==null?void 0:P.context)==null?void 0:b.dataType)==="number"?u!=null&&u.numberAsText?m.formatValue(m.value):m.value:_+(((I=(w=(S=m.node.rowGroupColumn)==null?void 0:S.colDef)==null?void 0:w.refData)==null?void 0:I[T])||m.formatValue(T)||T):((A=(v=m.column.colDef)==null?void 0:v.context)==null?void 0:A.dataType)==="number"?u!=null&&u.numberAsText?m.formatValue(m.value):m.value:((O=(B=m.column.colDef)==null?void 0:B.context)==null?void 0:O.dataType)==="boolean"?m.value?"R":"£":((R=(M=m.column.colDef)==null?void 0:M.context)==null?void 0:R.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0?m.value?((N=(V=(H=m.column.colDef)==null?void 0:H.context)==null?void 0:V.columnConfig)==null?void 0:N.FORMAT_STRING)==="yyyy-MM-dd"||((U=(j=(W=m.column.colDef)==null?void 0:W.context)==null?void 0:j.columnConfig)==null?void 0:U.FORMAT_STRING)==="yyyy/MM/dd"?G.getDateTimeByString(m.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):G.getDateTimeByString(m.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":m.formatValue(m.value)||m.value}})};const o=[],a=[{label:G.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"},{label:G.$t("ERX.ErGrid.ExportOptionsDateAsText")||"日期以文本格式导出",value:"dateAsText"}],s=[{key:"fileName",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsFileName")||"文件名称",required:!0},{key:"sheetName",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsSheetName")||"Sheet名称",required:!0},{key:"contentTitle",type:"input",title:G.$t("ERX.ErGrid.ExportOptionsContentTitle")||"内容标题",required:!1}];n!=null&&n.isCheckedRows&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),n!=null&&n.isBandView&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),t.getRowGroupColumns().length>0&&(a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"}),(n==null?void 0:n.skipGroupRows)!==!1&&o.push("skipGroupRows"),(n==null?void 0:n.skipSummaryRows)!==!1&&o.push("skipSummaryRows")),n!=null&&n.isShowFooter&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),((c=n==null?void 0:n.excelStyleConfig)==null?void 0:c.length)>0&&a.push({label:G.$t("ERX.ErGrid.ExportOptionsIncludeCellStyle")||"包含样式",value:"includeCellStyle"}),n!=null&&n.dateAsText&&o.push("dateAsText"),n!=null&&n.numberAsText&&o.push("numberAsText"),n!=null&&n.skipFooterRows&&o.push("skipFooterRows"),n!=null&&n.includeCellStyle&&o.push("includeCellStyle"),G.openSelectOptionsModal({title:G.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:e.getDisplayedRowCount()>0?a:[],inputOptions:s,default:{checkboxOptions:o,inputOptions:{fileName:n==null?void 0:n.fileName,sheetName:(n==null?void 0:n.sheetName)||"Sheet1",contentTitle:((d=n==null?void 0:n.contentTitle)==null?void 0:d.trim())||""}}},u=>{var f;i({fileName:u.inputs.fileName||(n==null?void 0:n.fileName),sheetName:u.inputs.sheetName||"Sheet1",contentTitle:((f=u.inputs.contentTitle)==null?void 0:f.trim())||"",selectedRows:u.checkboxes.some(h=>h==="selectedRows"),numberAsText:u.checkboxes.some(h=>h==="numberAsText"),dateAsText:u.checkboxes.some(h=>h==="dateAsText"),skipBandRows:u.checkboxes.some(h=>h==="skipBandRows"),skipGroupRows:u.checkboxes.some(h=>h==="skipGroupRows"),skipSummaryRows:u.checkboxes.some(h=>h==="skipSummaryRows"),skipFooterRows:u.checkboxes.some(h=>h==="skipFooterRows"),includeCellStyle:u.checkboxes.some(h=>h==="includeCellStyle")}),i=void 0})}static exportMuiltiGridToExcel(e,t){let n=0;const i=[];e.forEach(o=>{const{gridApi:a,sheetName:s}=o;this.setGridColumnOptions(o.gridApi,d=>{var u,f,h;d.cellDataType==="number"?d.cellClass=t!=null&&t.numberAsText?"right-cell-string":"right-cell":((u=d.context)==null?void 0:u.dataType)==="datetime"&&(t==null?void 0:t.dateAsText)!==!0&&(((f=d.context.columnConfig)==null?void 0:f.FORMAT_STRING)==="yyyy-MM-dd"||((h=d.context.columnConfig)==null?void 0:h.FORMAT_STRING)==="yyyy/MM/dd"?d.cellClass="date-cell":d.cellClass="datetime-cell")});const c=a==null?void 0:a.getSheetDataForExcel({sheetName:s||`Sheet${n+1}`,author:nt.UserId,skipPinnedBottom:!0,onlySelected:t==null?void 0:t.isCheckedRows,skipRowGroups:t==null?void 0:t.skipGroupRows,skipColumnGroupHeaders:t==null?void 0:t.skipBandRows,processHeaderCallback:d=>{var u,f;return((f=(u=d.column.colDef)==null?void 0:u.headerName)==null?void 0:f.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:d=>!!(t!=null&&t.skipSummaryRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level>=0||t!=null&&t.skipFooterRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level<0),processCellCallback:d=>{var h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B,O;const u=G.toString(d.value).includes("->")?" -> ":"",f=G.toString(d.value).replace(u,"").trimStart();return d.value&&Zr.isPlainObject(d.value)&&d.formatValue instanceof Function?d.formatValue(d.value):d.node.group&&d.node.footer!==!0?(h=d.column.colDef)!=null&&h.rowGroup&&d.node.key?((p=d.column.colDef.refData)==null?void 0:p[d.node.key])||d.node.key:((m=(g=d.column.colDef)==null?void 0:g.context)==null?void 0:m.dataType)==="number"?t!=null&&t.numberAsText?d.formatValue(d.value):d.value:u+(((x=(T=(_=d.node.rowGroupColumn)==null?void 0:_.colDef)==null?void 0:T.refData)==null?void 0:x[f])||d.formatValue(f)||f):((D=(E=d.column.colDef)==null?void 0:E.context)==null?void 0:D.dataType)==="number"?t!=null&&t.numberAsText?d.formatValue(d.value):d.value:((P=(k=d.column.colDef)==null?void 0:k.context)==null?void 0:P.dataType)==="boolean"?d.value?"R":"£":((S=(b=d.column.colDef)==null?void 0:b.context)==null?void 0:S.dataType)==="datetime"&&(t==null?void 0:t.dateAsText)!==!0?d.value?((v=(I=(w=d.column.colDef)==null?void 0:w.context)==null?void 0:I.columnConfig)==null?void 0:v.FORMAT_STRING)==="yyyy-MM-dd"||((O=(B=(A=d.column.colDef)==null?void 0:A.context)==null?void 0:B.columnConfig)==null?void 0:O.FORMAT_STRING)==="yyyy/MM/dd"?G.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):G.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":d.formatValue(d.value)||d.value}});i.push(c)}),i.length>0&&e[0].gridApi.exportMultipleSheetsAsExcel({data:i,fileName:(t==null?void 0:t.fileName)||"grid.xlsx"})}static setGridColumnOptions(e,t){if(e&&t instanceof Function){const n=o=>{var a;((a=o==null?void 0:o.children)==null?void 0:a.length)>0&&o.children.forEach(s=>{n(s)}),t(o)},i=e.getColumnDefs();i&&(i==null||i.forEach(o=>{n(o)}),e.setColumnDefs(i))}}}class Bn{static async callService(e,t,n){return new Promise((i,o)=>{var d,u;const a=(n==null?void 0:n.messageError)??!1;let s=new nr.EiInfo;e.trim().length===0&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="No service available",i(s));const c=e.split(/[\/.]/).filter(f=>f.trim().length>0);c.length<2&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="Service name error",i(s)),(d=n==null?void 0:n.loadingOptions)!=null&&d.show&&G.loading(!0,((u=n==null?void 0:n.loadingOptions)==null?void 0:u.delay)||0,n==null?void 0:n.loadingOptions),n!=null&&n.toCamelCase&&Object.keys(t.getBlocks()).forEach(f=>{const h=t.getBlock(f),p=h.getBlockMeta().getMetas(),g=new nr.EiBlockMeta(h.getBlockId());Object.keys(p).forEach(m=>{const _=new nr.EiColumn(G.camelCase(m));_.descName=p[m].name,_.type=p[m].type,g.addMeta(_)}),h.setBlockMeta(g)}),nr.EiCommunicator.send(c[0],c[1],t,{onSuccess:f=>{G.loading(!1),s=f,s.getStatus()<0&&a&&G.messageError(`service:${e}, sys.msg:${s.getMsg()}`,a==="modal"),i(s)},onFail:f=>{G.loading(!1),a&&G.messageError(`service:${e}, sys.msg:${String(f)}`,a==="modal"),console.error(f),s.SysInfo.Flag=-603,s.SysInfo.Msg=f==null?void 0:f.message,i(s)}})})}static async callServiceEx(e,t,n){return new Promise(async(i,o)=>{const a=t.toEiInfo(),s=await this.callService(e,a,n),c=rt.getInstance().mergeFromEiInfo(s);i(c)})}}let Cn=(Xl=class extends id{constructor(t){super();vn(this,qn);vn(this,Pt,[]);vn(this,ki,[]);vn(this,ti,[]);vn(this,Ji,[]);vn(this,$i,{});vn(this,al,{});vn(this,_n);vn(this,vi);vn(this,Ql,!1);vn(this,Ys);vn(this,nn,[]);vn(this,mo,{});vn(this,Ws,{});fe(this,"tableName","");this.tableName="Table0",t=t||{schema:{}},this.init(t)}get options(){return ze(this,_n)}get isCloned(){return ze(this,Ql)}get BingdingInfo(){return ze(this,nn)}get rowCount(){return ze(this,Pt).length}get Current(){return ze(this,vi)}get IsHierarchyTable(){var t,n,i,o;return G.toString((n=(t=ze(this,_n))==null?void 0:t.hierarchy)==null?void 0:n.parentField,!0).length>0&&G.toString((o=(i=ze(this,_n))==null?void 0:i.hierarchy)==null?void 0:o.primaryField,!0).length>0}setInitialValuesForEdit(t,n){var i;t!=null&&t.uid&&n&&n.trim().length>0&&((i=ze(this,al)[t.uid])==null?void 0:i[n])===void 0&&(ze(this,al)[t.uid]=ze(this,al)[t.uid]??{},ze(this,al)[t.uid][n]=t[n])}getInitialValuesForEdit(t,n){var o;let i="";if(typeof t=="string"?i=t:i=(t==null?void 0:t.uid)||"",i&&n&&n.trim().length>0)return(o=ze(this,al)[i])==null?void 0:o[n]}init(t){t&&(gr(this,_n,t),gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,vi,void 0),Ai(this,qn,uf).call(this))}clone(t){const n=new Xl({...ze(this,_n)});return n.tableName=t||this.tableName,n}setBindingInfo(t,n,i,o){var a;t&&n&&n.trim().length>0&&!ze(this,nn).some(s=>{var c;return((c=s.formHelper)==null?void 0:c.FormId)===t.FormId&&s.configId===n})?ze(this,nn).push({formHelper:t,configId:n,dataTable:this,controlType:i}):(a=o==null?void 0:o.gridOptions)!=null&&a.api&&!ze(this,nn).some(s=>s.grid.gridId===o.gridId)&&(o.gridOptions.api.getBindingTable=()=>this,o.gridOptions.getRowId=s=>s.data.uid,o.gridOptions.api.addEventListener("cellFocused",s=>{var c;if(s.api.getBindingTable){const d=s.api.getBindingTable(),u=s.api.getModel().getRow(s.rowIndex),f=((c=s==null?void 0:s.context)==null?void 0:c.focusRowId)||"";u!=null&&u.id&&u.id!==f&&(d.setCurrent(u.data,o.gridId),o.gridOptions.context=o.gridOptions.context||{},o.gridOptions.context.focusRowId=u.id,o.gridOptions.context.focusColId=s.column.colId)}}),o.gridOptions.api.addEventListener("rowDataUpdated",s=>{if(s.api.getBindingTable){const c=s.api.getBindingTable();(c.rowsCount=0)&&(o.gridOptions.context=s.context||{},o.gridOptions.context.focusRowId="",o.gridOptions.context.focusColId="")}}),o.gridOptions.api.addEventListener("cellValueChanged",s=>{s.api.getBindingTable&&s.data&&s.colDef&&s.colDef.field&&(s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0)}),ze(this,nn).push({grid:o,dataTable:this,configId:o.gridId,controlType:i}))}removeBindingInfo(t,n,i){var o,a,s;for(let c=ze(this,nn).length-1;c>=0;c--)ze(this,nn)[c].configId===n&&((a=(o=ze(this,nn)[c])==null?void 0:o.formHelper)==null?void 0:a.FormId)===(t==null?void 0:t.FormId)?ze(this,nn).splice(c,1):(s=i==null?void 0:i.gridOptions)!=null&&s.api&&ze(this,nn)[c].grid.gridId===i.gridId&&(i.gridOptions.getBindingTable&&delete i.gridOptions.getBindingTable,i.gridOptions.getRowId=void 0,ze(this,nn).splice(c,1))}setEvent(t,n){t&&(ze(this,Ws)[t]=n)}getEvent(t){return ze(this,Ws)[t]}setAllowCancelChanges(t){return gr(this,Ys,t),this}addField(...t){if(t&&t.length>0&&(t.forEach(n=>{n.name&&ze(this,_n).schema&&ze(this,_n).schema[n.name]===void 0&&(ze(this,_n).schema[n.name]=n)}),ze(this,Pt).length>0))for(let n=0;n<ze(this,Pt).length;n++)ze(this,Pt)[n].addField(...t);return this}removeField(...t){if(t&&t.length>0&&(t.forEach(n=>{n.name&&ze(this,_n).schema&&ze(this,_n).schema[n.name]===void 0&&delete ze(this,_n).schema[n.name]}),ze(this,Pt).length>0))for(let n=0;n<ze(this,Pt).length;n++)ze(this,Pt)[n].reomveField(...t);return this}setField(t,n){var i,o;if((t==null?void 0:t.trim().length)>0&&((o=(i=ze(this,_n))==null?void 0:i.schema)!=null&&o[t.trim()])&&n){const a=ze(this,_n).schema[t.trim()];ze(this,_n).schema[t.trim()]={...a,...n}}return this}get(t){for(let n=0;n<ze(this,Pt).length;n++)if(ze(this,Pt)[n].uid===t)return ze(this,Pt)[n]}getRows(t,n=!1){const i=[],o=a=>{n instanceof Function?i.push(n(a)||a.toJSON()):i.push(n?a.toJSON():a)};switch(t){case"created":{ze(this,ti).forEach(a=>{o(a)});break}case"updated":{ze(this,Pt).forEach(a=>{a.dirty&&!a.isNew&&o(a)});break}case"removed":{ze(this,Ji).forEach(a=>{o(a)});break}case"unchanged":{ze(this,Pt).forEach(a=>{!a.dirty&&!a.isNew&&o(a)});break}case"original":{ze(this,ki).forEach(a=>{!a.dirty&&!a.isNew&&o(a)});break}case"all":{ze(this,Pt).forEach(a=>{o(a)});break}}return i}at(t){return ze(this,Pt).at(t)}indexOf(t){var n;if(((n=t==null?void 0:t.uid)==null?void 0:n.length)>0){for(let i=0;i<ze(this,Pt).length;i++)if(ze(this,Pt)[i].uid===t.uid)return i}return-1}setCurrent(t,n){var s;const i={},o=((s=ze(this,vi))==null?void 0:s.uid)||"",a=(t==null?void 0:t.uid)||"";i.bindingInfo=ze(this,nn),i.oldCurrent=ze(this,vi),i.current=t,i.source=n,gr(this,vi,t),o!==a&&Ai(this,qn,Eo).call(this,"currentChanged",i)}insert(t,n,i){let o;return n&&(o=new qr(n,ze(this,_n).schema,this),i&&i.trim().length>0&&o[i]!==void 0&&(o[i]=G.guid()),o.isNew=!0,ze(this,Pt).splice(t,0,o),ze(this,ti).push(o),ze(this,mo)[o.uid]=o,Ai(this,qn,Eo).call(this,"dataInserted",{bindingInfo:ze(this,nn),insertAt:t,current:o}),this.setCurrent(o)),o}add(t,n){const i=new qr(t,ze(this,_n).schema,this);return n&&n.trim().length>0&&i[n]!==void 0&&(i[n]=G.guid()),i.isNew=!0,ze(this,Pt).push(i),ze(this,ti).push(i),ze(this,mo)[i.uid]=i,Ai(this,qn,Eo).call(this,"dataAdded",{bindingInfo:ze(this,nn),current:i}),this.setCurrent(i),i}import(t,n=-1,i=!0,o){const a=[];return(t==null?void 0:t.length)>0&&(t.forEach(s=>{if(s!=null){s instanceof qr&&(s=s.toJSON());const c=new qr(s,ze(this,_n).schema,this);o&&o.trim().length>0&&c[o]!==void 0&&(c[o]=G.guid()),c.isNew=i,a.push(c),ze(this,mo)[c.uid]=c}}),n<0?ze(this,Pt).push(...a):ze(this,Pt).splice(n,0,...a),ze(this,ti).push(...a),Ai(this,qn,Eo).call(this,"dataImported",{bindingInfo:ze(this,nn),models:a,insertAt:n,current:a[t.length-1]}),this.setCurrent(a[t.length-1])),a}remove(t){if(!t)return;let n=[];t instanceof Array&&t.length>0?n=t:t&&(n=[t]);let i=!1;const o=[];if(n.length>0){let a=-1,s=-1;if(n.forEach(c=>{var d;if(a=ze(this,Pt).findIndex(u=>u.uid===c.uid),(s<0||a<s)&&(s=a),a!==-1){if(i||(i=ze(this,Pt)[a].uid===((d=ze(this,vi))==null?void 0:d.uid)),ze(this,Pt)[a].isNew){const u=ze(this,ti).indexOf(ze(this,Pt)[a]);u>=0&&ze(this,ti).splice(u,1)}else ze(this,Ji).push(ze(this,Pt)[a]),ze(this,$i)[ze(this,Pt)[a].uid]=ze(this,Ji).length-1;o.push(ze(this,Pt)[a]),ze(this,Pt).splice(a,1),delete ze(this,mo)[c.uid]}}),o.length>0&&Ai(this,qn,Eo).call(this,"dataRemoved",{bindingInfo:ze(this,nn),models:o}),i){let c;ze(this,Pt).length>0&&(ze(this,Pt).length===s?c=ze(this,Pt)[s-1]:c=ze(this,Pt)[s]),this.setCurrent(c)}}}setRowState(t,n){let i=this.indexOf(t);if(i<0&&(ze(this,Pt).push(t),i=ze(this,Pt).length-1),i>=0){ze(this,Pt)[i].dirty=n==="updated",ze(this,Pt)[i].isNew=n==="added",n==="unchanged"&&(ze(this,Pt)[i].dirtyFields={},ze(this,$i)[t.uid]!==void 0&&(delete ze(this,$i)[t.uid],ze(this,Ji).splice(ze(this,$i)[t.uid],1)));const o=ze(this,ti).findIndex(a=>a.uid===t.uid);n==="added"&&o<0?ze(this,ti).push(t):o>=0&&ze(this,ti).splice(o,1),Ai(this,qn,Eo).call(this,"rowStateChanged",{bindingInfo:ze(this,nn),model:ze(this,Pt)[i],state:n})}}clear(){return gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,vi,void 0),gr(this,mo,{}),Ai(this,qn,Eo).call(this,"dataCleared",{bindingInfo:ze(this,nn)}),this}isRemoved(t){return typeof ze(this,$i)[t]=="number"}merge(t,n=!0,i=!1){var s,c,d,u,f;const o=[],a=ze(this,Pt).length>0;if(n&&(gr(this,Pt,[]),gr(this,ki,[]),gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,mo,{})),t!==void 0&&t.length>0&&((s=this.options)!=null&&s.schema)){const h=this.options.schema,p=Object.keys(t[0]),g=Object.keys(h),m=g.filter(k=>p.includes(k)||p.includes(G.camelCase(k))),_=g.filter(k=>!p.includes(k)&&!p.includes(G.camelCase(k))),T=new Map,x=G.toString((d=(c=ze(this,_n))==null?void 0:c.hierarchy)==null?void 0:d.primaryField,!0),E=G.toString((f=(u=ze(this,_n))==null?void 0:u.hierarchy)==null?void 0:f.parentField,!0),D=x.length>0&&E.length>0&&h[x]&&h[E];for(let k=0;k<t.length;k++){const P=new qr(void 0,void 0,this);P.setSchema(h,!1),m.forEach(b=>{var S,w,I;switch(h[b].type){case"datetime":case"time":P[b]=G.toDateTime(t[k][b]??G.toDateTime(t[k][G.camelCase(b)],"Dayjs"));break;case"boolean":P[b]=G.toBoolean(t[k][b]??G.toBoolean(t[k][G.camelCase(b)]));break;case"number":P[b]=G.toNumber(t[k][b]??G.toNumber(t[k][G.camelCase(b)]));break;case"string":h[b].RGBA?((S=t[k][b])==null?void 0:S.trim().length)>0?P[b]=G.toHexColor(((w=t[k][b])==null?void 0:w.trim())??G.toHexColor((I=t[k][G.camelCase(b)])==null?void 0:I.trim())):P[b]="#ffffff":P[b]=G.toString(t[k][b]??G.toString(t[k][G.camelCase(b)],!0));break;default:P[b]=t[k][b]??t[k][G.camelCase(b)];break}}),_.forEach(b=>{switch(h[b].type){case"datetime":case"time":P[b]=null;break;case"boolean":P[b]=!1;break;case"number":P[b]=0;break;case"string":P[b]="";break;default:P[b]=null;break}}),P.isNew=i,o.push(P),ze(this,Pt).push(P),ze(this,mo)[P.uid]=P,D&&P[x]&&T.set(P[x],P)}if(D){const k=P=>{const b=[];for(;P;)b.unshift(P[x]),P=T.get(P[E]);return b};for(let P=0;P<ze(this,Pt).length;P++)ze(this,Pt)[P][nt.TreeHierarchyFieldName]=k(ze(this,Pt)[P])}Ai(this,qn,uf).call(this),gr(this,vi,ze(this,Pt)[0]),Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:o,current:ze(this,Pt)[0]})}else gr(this,vi,void 0),a&&Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:o,current:void 0});return o}hasChanges(){if(ze(this,Ji).length)return!0;for(let t=0;t<ze(this,Pt).length;t++)if(ze(this,Pt)[t].isNew||ze(this,Pt)[t].dirty)return!0;return!1}acceptChanges(){return gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),ze(this,Pt).forEach(t=>{t.isNew=!1,t.dirty=!1,t.dirtyFields={}}),Ai(this,qn,uf).call(this),Ai(this,qn,Eo).call(this,"acceptChanges",{bindingInfo:ze(this,nn),models:ze(this,Pt),current:void 0}),this}cancelChanges(){return ze(this,Ql)&&(gr(this,ti,[]),gr(this,Ji,[]),gr(this,$i,{}),gr(this,mo,{}),gr(this,Pt,Zr.cloneDeep(ze(this,ki))),ze(this,Pt).forEach(t=>{ze(this,mo)[t.uid]=t}),Ai(this,qn,Eo).call(this,"dataMerged",{bindingInfo:ze(this,nn),models:ze(this,Pt),current:void 0})),this}totalCount(){return ze(this,Pt).length}data(t){return t!==void 0&&t.length>0&&this.merge(t,!0,!1),ze(this,Pt)}originalCopy(){return Zr.cloneDeep(ze(this,ki))}originalModel(t){for(let n=0;n<ze(this,ki).length;n++)if(ze(this,ki)[n].uid===t)return Zr.cloneDeep(ze(this,ki)[n])}static convertDataType(t,n,i,o="all"){var a,s,c;if(o=o||"all",t&&t.length>0&&n&&n.options.schema){const d=n.options.schema,u=Object.keys(t[0]),f=[],h=[],p=[],g={};for(const m of u)((a=d[m])==null?void 0:a.type)==="boolean"&&(o==="all"||o==="boolean")?f.push(m):((s=d[m])==null?void 0:s.type)==="datetime"&&(o==="all"||o==="datetime")?h.push(m):((c=d[m])==null?void 0:c.type)==="number"&&typeof t[0][m]!="number"&&p.push(m);i==="strongly"&&Object.keys(d).forEach(m=>{t[0][m]===void 0&&(d[m].type==="datetime"?g[m]=null:d[m].type==="boolean"?g[m]=d[m].default?d[m].default:!1:d[m].type==="number"?g[m]=G.toNumber(d[m].default):g[m]="")});for(let m=0;m<t.length;m++){t[m]instanceof qr&&(t[m]=t[m].toJSON());for(const _ of f)if(i==="weakly")t[m][_]=t[m][_]?"1":"0";else{const T=G.toString(t[m][_],!0,"toLower");t[m][_]=T.length>0&&T!=="0"&&T!=="false"}for(const _ of h)G.toString(t[m][_],!0).length>0?i==="weakly"?(t[m][_]=G.getDateTimeFormatString(t[m][_],"yyyyMMddHHmmss"),(t[m][_].substring(0,4)==="1901"||t[m][_].substring(0,4)==="0001")&&(t[m][_]=null)):t[m][_]=G.toDateTime(t[m][_]):t[m][_]=null;for(const _ of p)t[m][_]=G.toNumber(t[m][_]);i==="strongly"&&g&&(t[m]={...g,...t[m]})}}return t}static async createDataTable(t,n,i){let o;const a=rt.buildMap({QUERY_TYPE:"tsi00datatable",DATASET_NAME:n,TABLE_NAME:i}),s=await Bn.callServiceEx(nt.queryDevConfigService,a,{partition:t}),c={},d=s.getMapData("TSI00DATATABLE");if((d==null?void 0:d.length)>0){const u={};d.forEach(f=>{if(f.TABLE_NAME===i.trim()){const h={name:f.COL_NAME,caption:f.COL_CAPTION,maxLength:f.MAX_LENGTH};switch(f.DATA_TYPE){case"2":h.type="number",h.defaultValue=G.toNumber(f.DEFAULT_VALUE);break;case"3":h.type="datetime",h.defaultValue=G.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;case"4":h.type="boolean",h.defaultValue=G.toBoolean(f.DEFAULT_VALUE);break;case"5":h.type="time",h.defaultValue=G.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;default:h.type="string",h.defaultValue=G.getSystemFormatString(f.DEFAULT_VALUE).trim();break}u[f.COL_NAME]=h}}),Object.keys(u).length>0&&(c.schema=u,o=new Xl(c))}return o||console.error(`ER: DataTable [${i}] creation failed!`),o}},Pt=new WeakMap,ki=new WeakMap,ti=new WeakMap,Ji=new WeakMap,$i=new WeakMap,al=new WeakMap,_n=new WeakMap,vi=new WeakMap,Ql=new WeakMap,Ys=new WeakMap,nn=new WeakMap,mo=new WeakMap,Ws=new WeakMap,qn=new WeakSet,Eo=function(t,n){var o;(o=ze(this,nn))==null||o.forEach(a=>{var s,c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B,O,M,R,H,V,N,W,j,U,ie,X,Y,Z,ce,ue,he,re,z,K,ke,Q,oe,de,ae,ye,He,ge,We,Te,_e,be,xe,Ie,Se,Ve,Ce;if(a.formHelper&&a.configId||(c=(s=a.grid)==null?void 0:s.gridOptions)!=null&&c.api)if(a.controlType==="Grid"){const se=a.grid||((d=a.formHelper)==null?void 0:d.getGrid(a.configId));if((u=se==null?void 0:se.gridOptions)!=null&&u.api)switch(t){case"dataMerged":{const me=se.gridOptions.api.getFilterModel(),Ne=se.gridOptions.columnApi.getColumnState().filter(Ct=>Ct.sort!==null);se.gridOptions.context=se.gridOptions.context||{},Object.keys(me).length===0&&Ne.length===0&&se.gridOptions.context.calculateRowSpan&&se.gridOptions.context.calculateRowSpan instanceof Function&&se.gridOptions.context.calculateRowSpan(!0),(h=(f=se.gridOptions)==null?void 0:f.api)==null||h.clearRangeSelection(),se.gridOptions.context.focusRowId="",se.gridOptions.context.focusColId="",se.gridOptions.context.dataMerged=!0,(g=(p=se.gridOptions)==null?void 0:p.api)==null||g.setRowData(ze(this,Pt)),ze(this,Pt).length>0&&Object.keys(me).length===0&&Ne.length===0?(gr(this,vi,void 0),this.setCurrent(ze(this,Pt)[0])):(_=(m=se.gridOptions)==null?void 0:m.api)==null||_.setFocusedCell(0,nt.GridCheckColumnFieldName);let Qe=ze(this,Pt).length.toString().length*7+20;((x=(T=se.gridOptions.context)==null?void 0:T.viewConfig)==null?void 0:x.SHOW_SELECTION)==="1"&&(Qe+=20),(E=se.gridOptions.context)!=null&&E.allowDragRow&&(Qe+=21),((k=(D=se.gridOptions.context)==null?void 0:D.options)==null?void 0:k.masterDetail)===!0&&(Qe+=22);const lt=(b=(P=se.gridOptions.columnApi)==null?void 0:P.columnModel)==null?void 0:b.gridColumns,qe=lt==null?void 0:lt.find(Ct=>Ct.colId===nt.GridCheckColumnFieldName);qe&&se.gridOptions.columnApi.setColumnWidth(qe,Qe),(S=a.formHelper)==null||S.setGridOptions(a.configId,"advanceFilterTemplateBillNo","",!0);break}case"dataCleared":{(I=(w=se.gridOptions)==null?void 0:w.api)==null||I.setRowData([]);break}case"dataRemoved":{if(se.gridOptions.api.applyTransaction({remove:n.models}),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(v=me==null?void 0:me.rootNode)==null?void 0:v.aggData,pinndeRowType:"ErGridSummaryFooter"}])}if(((B=(A=se.gridOptions.context)==null?void 0:A.options)==null?void 0:B.showRowNo)!==!1&&(se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),se.gridOptions.context.focusRowId)){const me=(O=se==null?void 0:se.gridOptions)==null?void 0:O.api.getRowNode(se.gridOptions.context.focusRowId);me&&(se.gridOptions.context.focusRowId=me.id,(M=se.gridOptions.context)!=null&&M.focusColId||nt.GridCheckColumnFieldName,se.gridOptions.context.focusColId||(se.gridOptions.context.focusColId=nt.GridCheckColumnFieldName),cr.setGridFocusedCell(se,me.rowIndex,se.gridOptions.context.focusColId))}break}case"dataAdded":{if(se.gridOptions.api.applyTransaction({add:[n.current]}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((H=(R=se.gridOptions.context)==null?void 0:R.viewConfig)==null?void 0:H.AUTO_SELECT_MODE)==="1"||((N=(V=se.gridOptions.context)==null?void 0:V.viewConfig)==null?void 0:N.AUTO_SELECT_MODE)==="3"||((j=(W=se.gridOptions.context)==null?void 0:W.options)==null?void 0:j.autoCheckNewRow)===!0)&&((U=a.formHelper)==null||U.checkGridRow(a.configId,n.current)),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(ie=me==null?void 0:me.rootNode)==null?void 0:ie.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataInserted":{if(n.insertAt>=0?se.gridOptions.api.applyTransaction({add:[n.current],addIndex:n.insertAt}):se.gridOptions.api.applyTransaction({add:[n.current]}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((Y=(X=se.gridOptions.context)==null?void 0:X.viewConfig)==null?void 0:Y.AUTO_SELECT_MODE)==="1"||((ce=(Z=se.gridOptions.context)==null?void 0:Z.viewConfig)==null?void 0:ce.AUTO_SELECT_MODE)==="3"||((he=(ue=se.gridOptions.context)==null?void 0:ue.options)==null?void 0:he.autoCheckNewRow)===!0)&&a.formHelper.checkGridRow(a.configId,n.current),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(re=me==null?void 0:me.rootNode)==null?void 0:re.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataImported":{if(n.insertAt>=0?se.gridOptions.api.applyTransaction({add:n.models,addIndex:n.insertAt}):se.gridOptions.api.applyTransaction({add:n.models}),se.gridOptions.api.refreshCells({columns:[nt.GridCheckColumnFieldName]}),(((K=(z=se.gridOptions.context)==null?void 0:z.viewConfig)==null?void 0:K.AUTO_SELECT_MODE)==="1"||((Q=(ke=se.gridOptions.context)==null?void 0:ke.viewConfig)==null?void 0:Q.AUTO_SELECT_MODE)==="3"||((de=(oe=se.gridOptions.context)==null?void 0:oe.options)==null?void 0:de.autoCheckNewRow)===!0)&&a.formHelper.checkGridRow(a.configId,n.models),se.gridOptions.api.getPinnedBottomRowCount()>0){se.gridOptions.api.refreshClientSideRowModel("aggregate");const me=se.gridOptions.api.getModel();se.gridOptions.api.setPinnedBottomRowData([{...(ae=me==null?void 0:me.rootNode)==null?void 0:ae.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"currentChanged":{if(ze(this,vi)&&n.source!==a.configId&&((He=(ye=se.gridOptions.context)==null?void 0:ye.options)==null?void 0:He.suppressDefaultFocusedCell)!==!0){const me=(We=se==null?void 0:se.gridOptions)==null?void 0:We.api.getRowNode((ge=ze(this,vi))==null?void 0:ge.uid);if((_e=(Te=se.gridOptions)==null?void 0:Te.api)==null||_e.clearFocusedCell(),me){const Ne=((be=se.gridOptions.context)==null?void 0:be.focusColId)||nt.GridCheckColumnFieldName;cr.setGridFocusedCell(se,me.rowIndex,Ne)}}break}case"rowStateChanged":{if(n.model){const me=(xe=se==null?void 0:se.gridOptions)==null?void 0:xe.api.getRowNode(n.model.uid);me&&((Se=(Ie=se.gridOptions)==null?void 0:Ie.api)==null||Se.redrawRows({rowNodes:[me]}))}break}case"acceptChanges":{this.hasChanges()&&((Ce=(Ve=se.gridOptions)==null?void 0:Ve.api)==null||Ce.redrawRows());break}}}else a.controlType==="Layout"&&(t==="currentChanged"||t==="dataMerged"||t==="dataCleared")&&a.formHelper.refreshLayoutBindModel(a.configId)});const i=ze(this,Ws)[t];i&&i instanceof Function&&i(n)},uf=function(){ze(this,Ys)||ze(this,Ys)===void 0&&ze(this,Pt).length<=200?(gr(this,ki,Zr.cloneDeep(ze(this,Pt))),gr(this,Ql,!0)):(gr(this,ki,[]),gr(this,Ql,!1))},Xl),d4=class{constructor(e){fe(this,"dataSetName","");fe(this,"dataTables");fe(this,"relations");this.dataTables={},this.relations={},this.dataSetName=(e==null?void 0:e.trim())||""}get Name(){return this.dataSetName}setName(e){return this.dataSetName=(e==null?void 0:e.trim())||"",this}addDataTable(e,t){return t.tableName=e,this.dataTables[e]=t,this}removeDataTable(e){return this.contains(e)&&delete this.dataTables[e.trim()],this}renameDataTable(e,t){return this.contains(e)&&!this.contains(t)&&e.trim().toUpperCase()!==t.trim().toUpperCase()&&(this.addDataTable(t.trim().toUpperCase(),this.dataTables[e.trim().toUpperCase()]),delete this.dataTables[e.trim().toUpperCase()]),this}copyDataTable(e,t){let n,i;return e instanceof Cn?n=e:typeof e=="string"&&(n=this.dataTables[e]),n&&n.options&&(i=new Cn({...n.options})),t&&t.trim().length>0&&!this.contains(t)&&(this.dataTables[t.trim()]=i),i}cloneDataTable(e,t){const n=this.copyDataTable(e,t);return n.data([]),n}getDataTable(e){return this.dataTables[e]}getTableName(e){let t;return Object.keys(this.dataTables).every(n=>this.dataTables[n]===e?(t=n,!1):!0),t}clear(...e){let t=Object.keys(this.dataTables);return e.length>0&&(t=e),t.forEach(n=>{this.dataTables[n]&&this.dataTables[n]instanceof Cn&&this.dataTables[n].clear()}),this}mergeData(e,t,n=!0,i=!1){return(e==null?void 0:e.trim().length)>0&&this.contains(e.trim())&&t&&this.dataTables[e].merge(t,n,i),this}mergeDataFromEIInfo(e,t="",n=!0){return e.getStatus instanceof Function&&e.getStatus()>=0?(t==null?void 0:t.trim().length)>0?this.contains(t.trim())&&e.getBlock(t.trim())?this.mergeData(t.trim(),e.getBlock(t.trim()).getMappedRows()||[],n):G.warn("ER: EiInfo or DataTable does not contain table: "+t.trim()):Object.keys(this.dataTables).forEach(i=>{i.trim().length>0&&this.contains(i.trim())&&e.getBlock(i.trim())&&this.mergeData(i.trim(),e.getBlock(i.trim()).getMappedRows()||[],n)}):e.status>=0&&((t==null?void 0:t.trim().length)>0?this.contains(t.trim())&&e.contains(t.trim())?this.mergeData(t.trim(),e.getBlock(t.trim()).data||[],n):G.warn("ER: EIInfo or DataTable does not contain table: "+t.trim()):Object.keys(this.dataTables).forEach(i=>{i.trim().length>0&&this.contains(i.trim())&&e.contains(i.trim())&&this.mergeData(i.trim(),e.getBlock(i.trim()).data,n)})),this}getCurrentDataObject(e){let t;return(e==null?void 0:e.trim().length)>0&&this.contains(e.trim())&&(t=this.dataTables[e].Current),t}tablesCount(){return this.dataTables?Object.keys(this.dataTables).length:0}contains(e){return e&&e.trim().length>0?this.dataTables[e.trim()]!==void 0:!1}isEmpty(){return!(this.dataTables&&Object.keys(this.dataTables).length>0)}hasChanges(e){if(this.dataTables){if(e&&e.trim().length>0&&this.dataTables[e.trim()])return this.dataTables[e.trim()].hasChanges();{const n=Object.keys(this.dataTables);for(let i=0;i<n.length;i++)if(this.dataTables[n[i]].hasChanges())return!0}}return!1}hasRelation(e){return this.dataTables&&e&&e.trim().length>0&&this.relations[e.trim()]&&this.relations[e.trim()].length>0}acceptChanges(){return Object.keys(this.dataTables).forEach(t=>{this.dataTables[t]&&this.dataTables[t]instanceof Cn&&this.dataTables[t].acceptChanges()}),this}},d1=class{constructor(e){fe(this,"Content","");fe(this,"Context",{});fe(this,"BordStyle","Sizable");fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick",!0);fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BeforeOkButtonClick");fe(this,"_app");fe(this,"_windowOpened",l.ref(!1));fe(this,"_options",l.reactive({title:"标题"}));fe(this,"_resolveDialogResult");fe(this,"_dialogReturnInfo");fe(this,"_events",{});fe(this,"_component");this.setOptions(e||{})}get WindowOpened(){return this._windowOpened}setOptions(e){this._options={...this._options,...e}}getOptions(e){return e?this._options[e]:this._options}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}show(e,t=!0){return new Promise(async(n,i)=>{var o,a;if(this._app)this._windowOpened.value=!0;else{this._component||this._component||(this._component=await Promise.resolve().then(()=>jR),(o=this._component)!=null&&o.default&&(this._component=this._component.default));const s=l.createApp(this._component,{popRichEditorProps:this,options:this._options,content:e});((a=this._options)==null?void 0:a.extension)==="dropdown"&&s.component("ag-grid-vue",br.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:n,reject:i}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}},u4=class{constructor(e,t,n,i,o){fe(this,"LayoutCaption",{});fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",l.ref(!1));fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick");fe(this,"OkButtonPreventDefault",!1);fe(this,"CancelButtonPreventDefault",!1);fe(this,"OkButtonService","");fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BordStyle");fe(this,"ExtendJsonData");fe(this,"CallServiceDataType","EiInfo");fe(this,"BeforeCallService");fe(this,"app");fe(this,"div");fe(this,"_partition");fe(this,"_savePartition");fe(this,"_formName","");fe(this,"_tableName","");fe(this,"_layoutConfigId","");fe(this,"_layoutGroupIdArray",[]);fe(this,"_layoutGroupInfo",{});fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dataSet");fe(this,"_dataTable");fe(this,"_mainLayoutId","");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_readOnlys");fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=e,this._formName=t,n&&(this._layoutConfigId=n),i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partition(){return this._partition||""}get SavePartiton(){return this._savePartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get FormHelper(){return this._formHelper}get LayoutGroupInfo(){return this._layoutGroupInfo}get DataSet(){return this._dataSet}get DataTable(){return this._dataTable}get TableName(){return this._tableName}get DataModel(){return this._formHelper.getLayoutBindModel(this._mainLayoutId)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(e,t){return new Promise((n,i)=>{this._partition=(e==null?void 0:e.trim())||this._partition,this._serviceName=(t==null?void 0:t.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d,u,f,h,p,g,m,_,T,x,E;if(o.flag===1){if(((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0){if(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((f=(u=(d=this._formHelper)==null?void 0:d.ConfigInfo)==null?void 0:u.TSI00FORMBUTTON)==null?void 0:f.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.every(D=>D.BUTTON_NAME==="btnOk"?(this.OkButtonService=D.SVC_NAME,!1):!0),((g=(p=(h=this._formHelper)==null?void 0:h.ConfigInfo)==null?void 0:p.TSI00GRIDVIEW)==null?void 0:g.length)>0)for(let D=0;D<((T=(_=(m=this._formHelper)==null?void 0:m.ConfigInfo)==null?void 0:_.TSI00GRIDVIEW)==null?void 0:T.length);D++){const k=(E=(x=this._formHelper)==null?void 0:x.ConfigInfo)==null?void 0:E.TSI00GRIDVIEW[D];D==0&&(this._mainLayoutId=k.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(k.FUNCTION_ID),this._layoutGroupInfo[k.FUNCTION_ID]=k}this.CloseDialogWhenOkClick=this.CloseDialogWhenOkClick??this._formHelper.FormOptions.closeDialogWhenOkClick,this._initializeFlag=1}}else{const D="ErPopFreeHelper initialize faild, error msg is ["+o.msg+"]";G.messageError(D)}n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions.value,...e})}getFormOption(e){return this._formOptions.value[e]}setSavePartition(e){this._savePartition=e,this._formHelper.setCustomPartition(e)}ReceiveData(e,t){return e&&e instanceof qr&&(e=e.toJSON()),e&&Object.keys(e).length>0&&(this._receiveData=e,this._readOnlys=t),this._receiveData}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setValue(e,t=!0){return this.InitializeFlag>=0&&this.DataModel&&e&&this.DataModel.setData(e,void 0,t),this}getValue(e){return this.DataModel?this.DataModel.get(e):void 0}show(e,t,n){return new Promise((i,o)=>{const a=s=>{if(this.EditType==="Add"){const c=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={...c,...this._receiveData}}this.WindowOpened.value=!0};t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this.app?a():this.Initialize().then(async s=>{var u;this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>yb),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const c=l.createApp(this._component,{popFreeHelperProp:this,formWidth:this.getFormOption("width")??this.getFormOption("formWidth"),formHeight:this.getFormOption("height")??this.getFormOption("formHeight")});c.component("ag-grid-vue",br.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),a()}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo={...this._dialogReturnInfo,...e}}};const od=Object.freeze(Object.defineProperty({__proto__:null,PopFreeHelper:u4},Symbol.toStringTag,{value:"Module"}));let f4=class{constructor(e,t,n,i){fe(this,"Context",{});fe(this,"BordStyle");fe(this,"AutoRefresh",!1);fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"OkButtonCaption","确定");fe(this,"CancelButtonCaption","取消");fe(this,"CloseDialogWhenOkClick",!0);fe(this,"OkButtonPreventDefault",!1);fe(this,"CancelButtonPreventDefault",!1);fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BeforeOkButtonClick");fe(this,"_app");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_events",{});fe(this,"_windowOpened",l.ref(!1));fe(this,"_options",l.reactive({title:"标题",width:360,height:630}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"_primaryField");fe(this,"_parentField");fe(this,"_displayField");this._primaryField=e,this._parentField=t,this._displayField=n,this.setOptions(i||{})}get FormId(){return G.guid()}get DialogReturnInfo(){return this._dialogReturnInfo}get WindowOpened(){return this._windowOpened}get TreeOrgialData(){return this._receiveData}get PrimaryField(){return this._primaryField}get ParentField(){return this._parentField}get DisplayField(){return this._displayField}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setOptions(e){this._options={...this._options,...e}}getOptions(e){return e?this._options[e]:this._options}receiveData(e){this._receiveData=e}show(e,t,n){return new Promise(async(i,o)=>{var a;if(t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this._app)this._windowOpened.value=!0;else{this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>rN),(a=this._component)!=null&&a.default&&(this._component=this._component.default)));const s=l.createApp(this._component,{popTreeHelperProp:this});s.component("ag-grid-vue",br.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:i,reject:o}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(e){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=e}};const JD=Object.freeze(Object.defineProperty({__proto__:null,PopTreeHelper:f4},Symbol.toStringTag,{value:"Module"}));let h4=class{constructor(e,t,n,i,o){fe(this,"MasterDetailView",!0);fe(this,"FormConfigQueryService","");fe(this,"FormButtonQueryFilter","");fe(this,"FormCaption","");fe(this,"CustomFilterString","");fe(this,"CustomFilterJson");fe(this,"BordStyle");fe(this,"app");fe(this,"div");fe(this,"DefaultValues",{values:{},readonly:{}});fe(this,"Context");fe(this,"WindowOpened",l.ref(!1));fe(this,"DataModelId","");fe(this,"ShowCheckBoxColumn");fe(this,"SelectMode");fe(this,"ShowQueryButton",!0);fe(this,"ShowOkButton",!0);fe(this,"ShowCancelButton",!0);fe(this,"QueryButtonCaption","");fe(this,"OkButtonCaption","");fe(this,"CancelButtonCaption","");fe(this,"CloseDialogWhenOkClick");fe(this,"ShowQueryNoDetailInfoMsg",!0);fe(this,"ButtonPreventDefault",{ok:!1,cancel:!1,query:!1,mainViewDoubleClick:!1,mainViewFocusChanged:!1});fe(this,"UnMountWhenCloseDialog",!1);fe(this,"AutoQuery",!1);fe(this,"AutoRefresh",!1);fe(this,"KeyFieldName","");fe(this,"DescFieldName","");fe(this,"ChooseKeyValues","");fe(this,"ReceiveJsonData");fe(this,"LayoutGroupFilterId","LayoutGroupFilter");fe(this,"MainViewConfigId","gridView1");fe(this,"DetailViewConfigId","gridView2");fe(this,"LayoutFilterOptions",{});fe(this,"MainViewOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"DetailViewOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"MainInfoQueryMethod");fe(this,"DetailInfoQueryMethod");fe(this,"_partition");fe(this,"_queryPartition");fe(this,"_formName","");fe(this,"_layoutConfigIds","");fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dialogReturnInfo");fe(this,"_mainTableame","");fe(this,"_detailTableame","");fe(this,"_queryService","");fe(this,"_serviceFilter","");fe(this,"_keyFieldValue",{});fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"queryMainGridInfo",async(e=!0)=>{var o,a,s,c,d,u,f,h;const t=new rt,n=this._formHelper.getAllControlValue(this.LayoutGroupFilterId,this.CustomFilterJson),i=this._formHelper.getAllControlValueAsFilterArray(this.LayoutGroupFilterId,this.CustomFilterJson);if(this.FormButtonQueryFilter.trim().length>0){const p=y.ER.Core.converCustomFilterToQueryFilter(this.FormButtonQueryFilter);p.length>0&&i.push(...p)}if(((o=this.CustomFilterString)==null?void 0:o.trim().length)>0){const p=y.ER.Core.converCustomFilterToQueryFilter(this.CustomFilterString);p.length>0&&i.push(...p)}if(t.addMapData("Table0",[n]),t.addMapData("QUERY_FILTER",i),((s=(a=this.MainViewOptions)==null?void 0:a.pageOptions)==null?void 0:s.pagination)==="server")this._formHelper.setServerPagingQuery(this.MainViewConfigId,t,p=>new Promise(async(g,m)=>{var k,P,b,S,w,I,v,A,B,O;const _=t.copy(),T={flag:-1,msg:"",data:void 0,total:0},E=(P=(k=this._formHelper.getGrid(this.MainViewConfigId).gridOptions.context)==null?void 0:k.pageOptions)==null?void 0:P.pageSize;let D;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)D=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:_,queryPage:p,pageSize:E});else if(((b=this._events)==null?void 0:b.query)instanceof Function)D=await this._events.query({queryHelper:this,queryFilter:_,queryPage:p,pageSize:E});else if(this.FormConfigQueryService.trim().length>0)_.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:E}]),D=await this._formHelper.callServiceEx(this.FormConfigQueryService.trim(),_);else if(this._queryService.trim().length>0){console.log("this._queryService",this._queryService);let M=nt.dynamicQueryService;const R=(w=(S=this._formHelper.ConfigInfo)==null?void 0:S.TSI00DATASOURCE)==null?void 0:w.find(H=>H.FUNC_ID===this._queryService);(R==null?void 0:R.ORIGIN_CODE)==="SVC"&&((I=R==null?void 0:R.SVC_NAME)==null?void 0:I.trim().length)>0?M=(v=R==null?void 0:R.SVC_NAME)==null?void 0:v.trim():(_.addMapData("DATA_SOURCE",[{FUNCTION_ID:(R==null?void 0:R.FUNC_ID)||this._queryService,COMPANY_CODE:nt.CompanyCode}]),M=((A=R==null?void 0:R.SVC_NAME)==null?void 0:A.trim())||nt.dynamicQueryService),_.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:E}]),D=await this._formHelper.callServiceEx(M,_)}else T.flag=-1,T.msg=this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务";if(D instanceof rt)T.flag=D.sysFlag,T.msg=D.sysMsg,T.data=D.getMapData(0),T.total=D.getMapData(0).length,D.contains("PAGEINFO")&&(T.total=D.getMapData("PAGEINFO")[0].TOTAL_RECORD);else if(((B=D.sys)==null?void 0:B.status)>=0)T.flag=0,T.data=D.getBlock(0).data,T.total=D.getBlock(0).length,D.contains("PAGEINFO")&&(T.total=D.getMapData("PAGEINFO").data[0].TOTAL_RECORD||0);else if(D.getStatus instanceof Function&&D.getStatus()>=0){T.flag=D.getStatus(),T.msg=D.getMsg();const M=D.getBlock(this._mainTableame)??D.getBlock("TSI00RESULT")??D.getBlock("result");T.data=M.getMappedRows(),T.total=T.data.length,D.getBlock("PAGEINFO")&&(T.total=D.getBlock("PAGEINFO").getMappedRows()[0].TOTAL_RECORD||0)}else T.flag=-1,T.msg=((O=D.sys)==null?void 0:O.msg)||"";g(T)}));else{const p=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);p&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(_=>{_.trim().length>0&&p[_.trim().toUpperCase()]&&(this._keyFieldValue[_.trim().toUpperCase()]=p[_.trim().toUpperCase()])});let g;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)g=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:t});else if(((c=this._events)==null?void 0:c.query)instanceof Function)g=await this._events.query({queryHelper:this,queryFilter:t});else if(this.FormConfigQueryService.trim().length>0)g=await this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson);else if(this._queryService.trim().length>0){let m="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?m=this._serviceFilter+" and "+this.CustomFilterString:m=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(m=this._serviceFilter),g=await this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:m})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}if(g.sys&&((d=g.sys)==null?void 0:d.status)<0){this._formHelper.messageError(g.sys.msg);return}else if(g.getStatus instanceof Function&&g.getStatus()<0){this._formHelper.messageError(g.getMsg());return}else if(g.sysFlag!==void 0&&g.sysFlag<0){this._formHelper.messageError(g.sysMsg);return}else{let m=[];if(((u=g==null?void 0:g.sys)==null?void 0:u.status)>=0)m=g.contains(this._mainTableame)?(f=g.getBlock(this._mainTableame))==null?void 0:f.data:((h=g.getBlock(0))==null?void 0:h.data)??[];else if(g.getStatus instanceof Function&&g.getStatus()>=0){const T=g.getBlock(this._mainTableame)??g.getBlock("TSI00RESULT")??g.getBlock("result")??g.getBlockByIndex(0);m=(T==null?void 0:T.getMappedRows())??[]}else g.sysFlag>=0&&(m=g.getMapData(this._mainTableame)??g.getMapData("TSI00RESULT")??g.getMapData("result")??g.getMapData(0));this._formHelper.mergeDataToGrid(m,this.MainViewConfigId,!0);const _=m.length;_>0?(e&&this._formHelper.messageInfo(G.$t("ERX.QueryResultWithRecords",[_.toString()])||G.stringFormat("查询完成,共查询到[{0}]条数据",_)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue),this.autoCheckRows()):(this._formHelper.clearGridData(this.DetailViewConfigId),e&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}this.doEvent("afterQuery")}});fe(this,"autoCheckRows",()=>{var e,t;if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const n=this.ChooseKeyValues.trim().split(","),i=this.ErFormHelper.getGrid(this.MainViewConfigId);(t=(e=i==null?void 0:i.gridOptions)==null?void 0:e.api)==null||t.forEachLeafNode(o=>{n.includes(o.data[this.KeyFieldName])&&o.setSelected(!0)})}});this._initializeFlag=0,this._partition=e,this._formName=t,n&&(this._layoutConfigIds=n),i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partiton(){return this._partition?this._partition:""}get QueryPartiton(){return this._queryPartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get ErFormHelper(){return this._formHelper}get DialogReturnInfo(){return this._dialogReturnInfo}async Initialize(e,t){return new Promise((n,i)=>{this._partition=e&&e.trim()||this._partition,this._serviceName=t&&t.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d;if(o.flag===1)if(((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0){this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable");const u=this._formHelper.getSingleViewConfigInfo(this.MainViewConfigId);if(u&&(this._mainTableame=u.TABLE_NAME,this._queryService=u.SVC_NAME,this._serviceFilter=u.FILTER_STRING,this.KeyFieldName.trim().length===0&&(this.KeyFieldName=u.KEY_FIELDS),((d=u.EXT_OPTIONS)==null?void 0:d.trim().length)>0)){const f=JSON.parse(u.EXT_OPTIONS);this.MainViewOptions={...f,...this.MainViewOptions}}this._formHelper.containsConfig(this.DetailViewConfigId)||(this.DetailViewConfigId=""),this.ShowCheckBoxColumn!==void 0&&(u.SHOW_SELECTION=this.ShowCheckBoxColumn?"1":"0",this.ShowCheckBoxColumn===!0&&u.MULTI_SELECT_MODE==="1"&&(u.MULTI_SELECT_MODE="2")),this.CloseDialogWhenOkClick=this.CloseDialogWhenOkClick??this._formHelper.FormOptions.closeDialogWhenOkClick,this._initializeFlag=1}else G.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else G.messageError("ErPopQueryHelper initialize faild, error msg is ["+o.msg+"]");n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions,...e})}getFormOption(e){return this._formOptions.value[e]}setQueryPartition(e){this._queryPartition=e,this._formHelper.setCustomPartition(e)}setEvent(e,t){this._events[e]=t}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}show(e,t,n){return new Promise((i,o)=>{t&&this.setEvent("ok",t),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async a=>{var d,u,f;if(this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>eN),(d=this._component)!=null&&d.default&&(this._component=this._component.default))),this.doEvent("initial",this),this.FormConfigQueryService.trim().length===0){const h=this._formHelper.getFormButtonConfigInfo("btnQuery");this.FormConfigQueryService=((u=h==null?void 0:h.SVC_NAME)==null?void 0:u.trim())||"",this.FormButtonQueryFilter=((f=h==null?void 0:h.FILTER_STRING)==null?void 0:f.trim())||""}this.MainViewOptions.masterDetail=this.MasterDetailView,this._initializeFlag=1;const s=l.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});s.component("ag-grid-vue",br.AgGridVue),s.component("v-splitter",ni.Splitpanes),s.component("v-splitter-pane",ni.Pane),this.app=s;const c=document.createElement("div");document.body.appendChild(c),this.div=c,s.mount(c),this.WindowOpened.value=!0}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo=e}};const p4=Object.freeze(Object.defineProperty({__proto__:null,PopQueryHelper:h4},Symbol.toStringTag,{value:"Module"}));let $D=class{constructor(e,t,n,i,o){fe(this,"LayoutOptions",{});fe(this,"GridOptions",l.reactive({groupDisplayType:"groupRows"}));fe(this,"LayoutCaption");fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",l.ref(!1));fe(this,"ShowSaveButton",!0);fe(this,"ShowCloseButton",!0);fe(this,"SaveButtonCaption","");fe(this,"CloseButtonCaption","");fe(this,"CloseDialogWhenSaveClick",!1);fe(this,"PreventDefaultEvent",{});fe(this,"OkButtonService","");fe(this,"UnMountWhenCloseDialog",!1);fe(this,"BordStyle");fe(this,"ExtendJsonData");fe(this,"CallServiceDataType","EiInfo");fe(this,"BeforeCallService");fe(this,"app");fe(this,"div");fe(this,"_partition");fe(this,"_savePartition");fe(this,"_formName","");fe(this,"_mainTableName","");fe(this,"_detailTableName","");fe(this,"_layoutConfigId","LayoutGroupMain");fe(this,"_gridConfigId","gridView1");fe(this,"_sysConfiParas");fe(this,"_serviceName","si00_form_get");fe(this,"_initializeFlag",0);fe(this,"_formHelper");fe(this,"_dataSet");fe(this,"_mainDataTable");fe(this,"_detailDataTable");fe(this,"_dialogReturnInfo");fe(this,"_receiveData");fe(this,"_readOnlys");fe(this,"_events",{});fe(this,"_formOptions",l.ref({}));fe(this,"_resolveDialogResult");fe(this,"_component");this._initializeFlag=0,this._partition=e,this._formName=t,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,i&&i.trim().length>0&&(this._serviceName=i),this._sysConfiParas=o,this._formHelper=new y.ER.FormHelper(this._partition,this._formName,this._serviceName)}get Partition(){return this._partition||""}get SavePartiton(){return this._savePartition||this._partition||""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag}get ErFormHelper(){return this._formHelper}get LayoutConfigId(){return this._layoutConfigId}get GridConfigId(){return this._gridConfigId}get DataSet(){return this._dataSet}get MainDataTable(){return this._mainDataTable}get MainTableName(){return this._mainTableName}get DetailDataTable(){return this._detailDataTable}get DetailTableName(){return this._detailTableName}get DataModel(){var e;return l.reactive(((e=this._dataSet)==null?void 0:e.getCurrentDataObject(this._mainTableName))||new qr)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(e,t){return new Promise((n,i)=>{this._partition=(e==null?void 0:e.trim())||this._partition,this._serviceName=(t==null?void 0:t.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(o=>{var a,s,c,d,u,f;if(o.flag===1)this._mainTableName=this._formHelper.setBindingTableName(this._layoutConfigId),this._detailTableName=this._formHelper.setBindingTableName(this._gridConfigId),this._dataSet=this._formHelper.FormDataSet,this._mainDataTable=this._formHelper.getBindingTable(this._layoutConfigId),this._detailDataTable=this._formHelper.getBindingTable(this._gridConfigId),((c=(s=(a=this._formHelper)==null?void 0:a.ConfigInfo)==null?void 0:s.TSI00FORM)==null?void 0:c.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((f=(u=(d=this._formHelper)==null?void 0:d.ConfigInfo)==null?void 0:u.TSI00FORMBUTTON)==null?void 0:f.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.every(h=>h.BUTTON_NAME==="btnOk"?(this.OkButtonService=h.SVC_NAME,!1):!0),this._initializeFlag=1);else{const h="ErPopFormHelper initialize faild, error msg is ["+o.msg+"]";G.messageError(h)}n(this._initializeFlag)})})}setFormOptions(e){e&&(this._formOptions.value={...this._formOptions.value,...e})}getFormOption(e){return this._formOptions.value[e]}setSavePartition(e){this._savePartition=e,this._formHelper.setCustomPartition(e)}ReceiveData(e,t){this._receiveData=e,this._readOnlys=t}setEvent(e,t,n=!1){this._events[e]=t,this.PreventDefaultEvent[e]=n}getEvent(e){return this._events[e]}doEvent(e,t){const n=this._events[e];if(n)return n(t)}setValue(e,t=!0){return this.InitializeFlag>=0&&this.DataModel&&e&&this.DataModel.setData(e,t),this}getValue(e){return this.DataModel?this.DataModel.get(e):void 0}show(e,t,n){return new Promise((i,o)=>{const a=()=>{var s,c,d;if(this.EditType==="Add"){const u=this._formHelper.getLayoutConfigDefaultValues(this._layoutConfigId);this._receiveData={...u,...this._receiveData}}(s=this.DataModel)==null||s.reset(),(c=this.DataModel)==null||c.setData(this._receiveData),this.DataModel.dirty=!1,this.DataModel.dirtyFields={},(d=this._dataSet)==null||d.acceptChanges(),this.WindowOpened.value=!0};t&&this.setEvent("save",t),n&&this.setEvent("close",n),this.app?a():this.Initialize().then(async s=>{var u;this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>fq),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this._initializeFlag=1,this.doEvent("initial",this);const c=l.createApp(this._component,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});c.component("ag-grid-vue",br.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),a()}),this._resolveDialogResult={resolve:i,reject:o}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(e){this._dialogReturnInfo=e}};Ht.locale("zh-cn");const ex=l.defineComponent({name:"DatetimeEditor",components:{"a-date-picker":Ke.DatePicker,"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},directives:{focus:r=>{r.children&&l.nextTick(()=>{const e=y.ER.Core.jQuery(r.children);e==null||e.select()})}},props:["params"],setup:r=>{var S,w,I,v,A;const e=l.ref(null),t=l.ref(((w=(S=r.params.colDef.context)==null?void 0:S.columnConfig)==null?void 0:w.READ_ONLY)==="1"),n=((v=(I=r.params.colDef.context)==null?void 0:I.columnConfig)==null?void 0:v.MAX_LENGTH)||14,i=l.ref(y.ER.Core.toDateTime(r.params.value)),o=l.ref(r.params.max),a=l.ref(r.params.min),s=l.ref(r.params.showTime),c=l.ref(r.params.picker),d=r.params.dataType||"datetime",u=l.ref(!0),f=l.ref(!1),h=r.params.format||"YYYY-MM-DD HH:mm:ss",p=y.ER.Core.getDateTimeFormatString(r.params.value,h),g=l.ref(h),m=l.ref(Jr()),_=l.ref(Ut());window.$wujie&&((A=window.$wujie.bus)==null||A.$on("changeThemeEmit",B=>{_.value=Ut()}));const T=()=>{f.value=!0},x=()=>{if(d==="string"){const B=y.ER.Core.getDateTimeFormatString(i.value,"yyyyMMddHHmmss");return n>0&&B.length>n?B.substring(0,n):B}return y.ER.Core.toDateTime(i.value)},E=()=>!1,D=()=>!1,k=()=>{u.value=!1},P=()=>{u.value=!1,r.params.stopEditing()},b=B=>{B.key==="Escape"||B.key==="Tab"?u.value=!1:B.key==="Enter"&&(u.value=!u.value)};return l.onMounted(()=>{l.nextTick(()=>{if(!t){const B=y.ER.Core.jQuery(e.value);B==null||B.focus()}})}),{h:l.h,ER:y.ER,props:r,readOnly:t,readOnlyValue:p,value:i,dateInputRef:e,max:o,min:a,showTime:s,format:g,picker:c,open:u,antdLocale:m,antdTheme:_,invalid:f,setInvalid:T,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,onOk:k,onChange:P,onKeyDown:b,getValue:x,isCancelBeforeStart:E,isCancelAfterEnd:D}}}),Gr=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t};function tx(r,e,t,n,i,o){const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-tooltip"),c=l.resolveComponent("a-time-picker"),d=l.resolveComponent("a-date-picker"),u=l.resolveComponent("a-config-provider"),f=l.resolveDirective("focus");return l.openBlock(),l.createBlock(u,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[r.readOnly?l.withDirectives((l.openBlock(),l.createBlock(a,{key:0,value:r.readOnlyValue,"allow-clear":!1,readOnly:!0},null,8,["value"])),[[f]]):r.props.params.type==="time"?(l.openBlock(),l.createBlock(c,{key:1,value:r.value,"onUpdate:value":e[0]||(e[0]=h=>r.value=h),ref:"dateInputRef",style:{width:"100%"},open:r.open,format:r.format,max:r.max,min:r.min,autofocus:!0,status:r.invalid?"error":void 0,onKeydown:r.onKeyDown,onChange:r.onChange,onOk:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prevIcon",fn:l.withCtx(()=>[l.createVNode(s,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","open","format","max","min","status","onKeydown","onChange","onOk"])):(l.openBlock(),l.createBlock(d,{key:2,value:r.value,"onUpdate:value":e[1]||(e[1]=h=>r.value=h),ref:"dateInputRef",style:{width:"100%"},picker:r.picker,open:r.open,format:r.format,max:r.max,min:r.min,"show-time":r.showTime,autofocus:!0,status:r.invalid?"error":void 0,onKeydown:r.onKeyDown,onChange:r.onChange,onOk:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prevIcon",fn:l.withCtx(()=>[l.createVNode(s,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","picker","open","format","max","min","show-time","status","onKeydown","onChange","onOk"]))]),_:1},8,["theme","locale"])}const u1=Gr(ex,[["render",tx]]),rx=l.defineComponent({name:"DropdownEditor",components:{"a-button":Ke.Button,"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},props:["params"],directives:{focus:r=>{r.children&&l.nextTick(()=>{const e=y.ER.Core.jQuery(r.children);e==null||e.select()})}},setup:r=>{var M,R,H,V,N,W,j,U,ie,X;const e=l.ref(null),t=l.ref(r.params.multiple?"multiple":"single"),n=l.ref(((R=(M=r.params.colDef.context)==null?void 0:M.columnConfig)==null?void 0:R.READ_ONLY)==="1"),i=l.ref(r.params.value),o=l.ref(""),a=l.ref(""),s=l.ref(null),c=l.ref(""),d=[],u="DropdownEditor",f=(H=r.params.colDef.context)==null?void 0:H.iconUrlMap;let h=r.params.dataSource||[],p=r.params.displayColumns||[],g=r.params.valueField||"CODE",m=r.params.textField||"CODE_DESC_1_CONTENT",_=((j=(W=(N=(V=r.params.context)==null?void 0:V.columnConfig)==null?void 0:N[r.params.colDef.colId])==null?void 0:W.extendOptions)==null?void 0:j.showDropdownFilter)??((ie=(U=r.params.context)==null?void 0:U.options)==null?void 0:ie.showDropdownFilter)??5;_=typeof _=="number"&&_>=1?_:5;const T=l.ref(Ut()),x=l.ref(Jr());window.$wujie&&((X=window.$wujie.bus)==null||X.$on("changeThemeEmit",Y=>{T.value=Ut()}));const E=()=>i.value,D=()=>n.value!==!0,k=Y=>{c.value={...c.value,border:Y}},P=()=>!1,b=()=>!1,S=Y=>{var Z,ce;if(Y.event.key==="ArrowUp"||Y.event.key==="ArrowDown"){const ue=Y.api.getFocusedCell();(ue==null?void 0:ue.rowIndex)>=0&&(i.value=(ce=(Z=Y.api.getModel())==null?void 0:Z.getRow(ue.rowIndex))==null?void 0:ce.data[g])}},w=Y=>{e.value.gridOptions.api.setQuickFilter(Y.target.value)},I=Y=>{var Z,ce,ue;if((Z=r.params)!=null&&Z.allowNew&&((ce=r.params)==null?void 0:ce.multiple)!==!0)i.value=o.value,o.value="",r.params.stopEditing();else if(((ue=r.params)==null?void 0:ue.multiple)===!0){const he=e.value.gridOptions.api.getSelectedNodes();let re="";he.forEach(z=>{re=re.trim().length===0?y.ER.Core.toString(z.data[g]):re+","+y.ER.Core.toString(z.data[g])}),i.value=re,r.params.stopEditing()}},v=Y=>{r.params.stopEditing()},A=(Y,Z)=>{const ce=document.createElement("div");ce.style.display="flex";let ue;Y.startsWith("IconFont:")?(Y=Y.replace("IconFont:",""),ue=y.ER.Core.createErSvgElement(Y)):Y.startsWith("ImgUrl:")&&(Y=Y.replace("ImgUrl:",""),ue=y.ER.Core.createRemoteImgElement(Y)),ue&&(ue.style.paddingTop="1px",ce.appendChild(ue));const he=document.createElement("span");return he.innerHTML=Z,he.style.paddingLeft="3px",ce.appendChild(he),ce},B=Y=>{var ce,ue,he;const Z=[];return Y.api.getDisplayedRowCount()>0&&(Z.push("copy","copyWithHeaders"),((ue=(ce=Y.columnApi)==null?void 0:ce.getRowGroupColumns())==null?void 0:ue.length)>0&&Z.push("separator","expandAll","contractAll")),(he=Y.api)!=null&&he.isColumnFilterPresent()&&(Z.push("separator"),Z.push({name:y.ER.Core.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var re;(re=Y.api)==null||re.setFilterModel(null)}})),Z},O=Y=>{var Z,ce;if(Y.event){const ue=((Z=Y.api)==null?void 0:Z.getCellRanges())||[];if(ue.length===1&&ue[0].columns.length===1&&ue[0].columns[0].colId===y.ER.SysInfo.GridCheckColumnFieldName){const he=(ce=Y.api)==null?void 0:ce.getModel();if(he){const re=[];for(let z=ue[0].startRow.rowIndex;z<=ue[0].endRow.rowIndex;z++){const K=he.getRow(z);K&&re.push(K)}Y.api.setNodesSelected({nodes:re,newValue:Y.node.isSelected()})}}}};return l.onBeforeMount(()=>{var Y,Z,ce,ue,he,re,z,K,ke,Q,oe;if(n.value===!1){const de=r.params.formHelper,ae=(ce=(Z=(Y=r.params.context)==null?void 0:Y.options)==null?void 0:Z.dropdownFilter)==null?void 0:ce[r.params.colDef.colId];if(p.length>0)ae instanceof Function&&(h=ae({data:r.params.data,dataSource:h,value:r.params.value})),p.forEach((ye,He)=>{const ge={colId:ye.field,field:ye.field,tooltipField:ye.field,headerName:ye.headerName||ye.title,minWidth:150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};ye.field===g&&(ge.width=100,ge.minWidth=100,ge.maxWidth=200),d.push(ge)});else if((he=(ue=de.DropDownBindSource)==null?void 0:ue[r.params.configId])!=null&&he[r.params.colDef.colId]){const ye=de.DropDownBindSource[r.params.configId][r.params.colDef.colId],He=(re=r.params.colDef.context)==null?void 0:re.columnConfig;g=ye.dataValueField||"CODE",m=ye.dataTextField||"CODE_DESC_1_CONTENT",h=ye.dataSource;const ge=((z=He==null?void 0:He.FATHER_FIELD)==null?void 0:z.trim())||"",We=((K=He==null?void 0:He.FORM_FILTER)==null?void 0:K.trim())||"",Te=((ke=He==null?void 0:He.LAYOUT_ID)==null?void 0:ke.trim())||r.params.configId,_e=((Q=He==null?void 0:He.extendOptions)==null?void 0:Q.dropdownOptions)||{};if(ge.length>0&&We.length>0)if(Te===r.params.configId&&r.params.data)h=de.filterDropDownCascaderDataSource(ye.dataSource,We,r.params.data[ge]||"");else{const be=de.getGrid(Te);if(be){const xe=de.getGridCurrentRow(be,!0);xe&&(h=de.filterDropDownCascaderDataSource(ye.dataSource,We,xe[ge]||""))}else{const xe=de.getLayoutBindModel(Te);xe&&(h=de.filterDropDownCascaderDataSource(ye.dataSource,We,xe[ge]||""))}}ae instanceof Function&&(h=ae({data:r.params.data,dataSource:h,value:r.params.value})),((oe=ye.columns)==null?void 0:oe.length)>0&&ye.columns.forEach((be,xe)=>{var Ve;const Ie={colId:be.field,field:be.field,tooltipField:be.field,headerName:be.title,minWidth:50,width:be.width||150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};f&&xe===0&&(Ie.cellRenderer=Ce=>{var Ne,Qe,lt,qe;const se=y.ER.Core.toString(Ce.value).replace(/</g,"<"),me=((Qe=(Ne=Ce==null?void 0:Ce.data)==null?void 0:Ne[g])==null?void 0:Qe.trim())||"";if(me.length>0)return(lt=f[me])!=null&<.trim().startsWith("IconFont:")||(qe=f[me])!=null&&qe.startsWith("ImgUrl:")?A(f[me],se):se});const Se=((Ve=_e==null?void 0:_e.wrapText)==null?void 0:Ve[Ie.field])??(_e==null?void 0:_e.wrapText);Ie.autoHeight=Ie.autoHeight||Se,Ie.wrapText=Ie.wrapText||Se,d.push(Ie)})}(h==null?void 0:h.length)>10&&(s.value={statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]})}else a.value=r.params.colDef.refData[r.params.value]||r.params.value}),l.onMounted(()=>{var Y,Z,ce,ue,he,re,z,K,ke;if(!n.value){if(d.length===0){const ae={colId:"CODE",field:"CODE",tooltipField:"CODE",headerName:y.ER.Core.$t("ERX.CodeColumn")||"代码",minWidth:100,width:100,maxWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_};f&&(ae.cellRenderer=ye=>{var ge,We,Te;const He=y.ER.Core.toString(ye.value).replace(/</g,"<");if(((ge=ye.value)==null?void 0:ge.length)>0)return(We=f[ye.value])!=null&&We.trim().startsWith("IconFont:")||(Te=f[ye.value])!=null&&Te.startsWith("ImgUrl:")?A(f[ye.value],He):He}),d.push(ae),d.push({colId:"CODE_DESC_1_CONTENT",field:"CODE_DESC_1_CONTENT",tooltipField:"CODE_DESC_1_CONTENT",headerName:y.ER.Core.$t("ERX.DescriptionColumn")||"描述",width:200,minWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=_})}let Q=0;d.forEach(ae=>{var ye,He;ae.width=((He=(ye=r.params.colDef.context)==null?void 0:ye.popColumnsWidth)==null?void 0:He[ae.colId])||ae.width,Q+=ae.width||150}),r.params.multiple&&(d.unshift({colId:y.ER.SysInfo.GridCheckColumnFieldName,pinned:ii()?"right":"left",headerCheckboxSelection:ae=>!0,headerCheckboxSelectionFilteredOnly:((Y=r.params)==null?void 0:Y.headerCheckboxSelectionFilteredOnly)??!0,checkboxSelection:ae=>!ae.node.group&&!ae.node.footer,headerName:"",width:30,maxWidth:30,minWidth:30,suppressMenu:!0,resizable:!1,sortable:!1,lockPosition:ii()?"right":"left"}),Q+=30);let oe=15;(h==null?void 0:h.length)<15&&(oe=(h==null?void 0:h.length)+2),oe<5&&(oe=5),(ce=(Z=r.params.colDef)==null?void 0:Z.context)!=null&&ce.popWidth&&(Q=(he=(ue=r.params.colDef)==null?void 0:ue.context)==null?void 0:he.popWidth);const de=((z=(re=r.params.colDef)==null?void 0:re.context)==null?void 0:z.popHeight)||oe*25+15;if(c.value={resize:"both",overflow:"auto",height:de+"px",width:Q+"px"},e.value.gridOptions.api.selectionService.rowSelection=r.params.multiple?"multiple":"single",e.value.gridOptions.enableRangeSelection=!0,e.value.gridOptions.enableRangeHandle=!0,e.value.gridOptions.debounceVerticalScrollbar=!0,e.value.gridOptions.enableBrowserTooltips=!0,e.value.gridOptions.headerHeight=d.length===1&&h.length<_?0:void 0,e.value.gridOptions.api.setColumnDefs(d),e.value.gridOptions.api.setRowData(h),e.value.gridOptions.api.addEventListener("columnResized",ae=>{var ye;r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popColumnsWidth=r.params.colDef.context.popColumnsWidth||{},(ye=ae.columns)==null||ye.forEach(He=>{r.params.colDef.context.popColumnsWidth[He.colId]=He.actualWidth})}),!r.params.multiple&&((ke=(K=r.params.colDef.context)==null?void 0:K.columnConfig)==null?void 0:ke.ADD_EMPTY_ITEM)==="1"){const ae={};ae[g]="",e.value.gridOptions.api.setPinnedTopRowData([ae])}r.params.multiple||e.value.gridOptions.api.addEventListener("cellClicked",ae=>{i.value=ae.data[g],r.params.stopEditing()}),e.value.gridOptions.api.addEventListener("firstDataRendered",ae=>{if(y.ER.Core.toString(i.value,!0).trim().length>0){const ye=y.ER.Core.toString(i.value,!0).split(",");let He=!1;ae.api.forEachNodeAfterFilterAndSort(ge=>{ye.includes(ge.data[g])&&(ge.setSelected(!0),ae.api.setFocusedCell(ge.rowIndex,m),He||ae.api.ensureIndexVisible(ge.rowIndex,"top"),He=!0)})}}),l.nextTick(()=>{y.ER.Core.jQuery(e.value).focus(),new ResizeObserver(y.ER.Core.debounce(ye=>{var We,Te,_e,be,xe,Ie,Se,Ve;const He=((Te=(We=ye[0])==null?void 0:We.contentRect)==null?void 0:Te.width)||0,ge=((be=(_e=ye[0])==null?void 0:_e.contentRect)==null?void 0:be.height)||0;He>0&&(r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popWidth=He),ge>0&&(r.params.colDef.context=r.params.colDef.context||{},r.params.colDef.context.popHeight=ge),(((xe=r.params.colDef.context)==null?void 0:xe.popColumnsWidth)===void 0||Object.keys(r.params.colDef.context.popColumnsWidth).length>0)&&((Ve=(Se=(Ie=e==null?void 0:e.value)==null?void 0:Ie.gridOptions)==null?void 0:Se.api)==null||Ve.sizeColumnsToFit())},200)).observe(document.querySelector("#dropdownEditorDiv"))})}}),{h:l.h,isRTL:ii,ER:y.ER,editorType:u,dropDownStyle:c,props:r,readOnly:n,value:i,newValue:o,displayText:a,statusBar:s,dropDownColumns:d,dropDownData:h,agGridVueDropdownRef:e,rowSelection:t,antdTheme:T,antdLocale:x,getAgLocaleText:ca,CheckCircleOutlined:$e.CheckCircleOutlined,CloseCircleOutlined:$e.CloseCircleOutlined,getContextMenuItems:B,setBorder:k,confirmClick:I,cancelClick:v,onCellKeyDown:S,getValue:E,isPopup:D,isCancelBeforeStart:P,isCancelAfterEnd:b,onFilterTextBoxChanged:w,onRowSelected:O}}}),nx={key:0},ix={style:{flex:1,width:"100%"}},ox={key:0,class:"gridDropDownEditorFooter"};function ax(r,e,t,n,i,o){var f,h,p;const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-config-provider"),c=l.resolveComponent("ag-grid-vue"),d=l.resolveComponent("a-button"),u=l.resolveDirective("focus");return r.readOnly?(l.openBlock(),l.createElementBlock("div",nx,[l.createVNode(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(a,{value:r.displayText,"allow-clear":!1,readOnly:!0},null,8,["value"]),[[u]])]),_:1},8,["theme","locale"])])):(l.openBlock(),l.createElementBlock("div",{key:1,id:"dropdownEditorDiv",style:l.normalizeStyle([{display:"flex","flex-direction":"column",height:"100%"},r.dropDownStyle])},[l.createElementVNode("div",ix,[l.createVNode(c,{class:"ag-theme-balham",style:{height:"100%",width:"100%"},ref:"agGridVueDropdownRef",enableRtl:r.isRTL(),localeText:r.getAgLocaleText(),statusBar:r.statusBar,"row-selection":r.rowSelection,enableRangeSelection:r.props.params.multiple,rowMultiSelectWithClick:r.props.params.multiple,enableRangeHandle:r.props.params.multiple,suppressRowClickSelection:(f=r.props.params)==null?void 0:f.multiple,stopEditingWhenCellsLoseFocus:!0,enableBrowserTooltips:!0,getContextMenuItems:r.getContextMenuItems,onRowSelected:r.onRowSelected,onCellKeyDown:r.onCellKeyDown},null,8,["enableRtl","localeText","statusBar","row-selection","enableRangeSelection","rowMultiSelectWithClick","enableRangeHandle","suppressRowClickSelection","getContextMenuItems","onRowSelected","onCellKeyDown"])]),(h=r.props.params)!=null&&h.multiple||(p=r.props.params)!=null&&p.allowNew?(l.openBlock(),l.createElementBlock("div",ox,[l.createVNode(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var g,m;return[(g=r.props.params)!=null&&g.allowNew&&((m=r.props.params)==null?void 0:m.multiple)!==!0?(l.openBlock(),l.createBlock(a,{key:0,onPressEnter:r.confirmClick,placeholder:"请输入其他值",value:r.newValue,"onUpdate:value":e[0]||(e[0]=_=>r.newValue=_),"allow-clear":!0},null,8,["onPressEnter","value"])):l.createCommentVNode("",!0),l.createVNode(d,{type:"primary",class:"xr-er-button",icon:r.h(r.CheckCircleOutlined),onClick:r.confirmClick},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.ER.Core.$t("ERX.Confirm")||"确定"),1)]),_:1},8,["icon","onClick"]),l.createVNode(d,{type:"primary",class:"xr-er-button",icon:r.h(r.CloseCircleOutlined),onClick:r.cancelClick},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.ER.Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["icon","onClick"])]}),_:1},8,["theme","locale"])])):l.createCommentVNode("",!0)],4))}const Qo=Gr(rx,[["render",ax]]),lx=l.defineComponent({name:"ButtonEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-input-group":Ke.InputGroup,"a-input":Ke.Input,"a-button":Ke.Button,"a-tooltip":Ke.Tooltip},setup:r=>{var p,g,m;const e=l.ref(null),t=l.ref(((g=(p=r.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:g.READ_ONLY)==="1"),n=l.ref(r.params.value),i=l.ref(!1),o=l.ref(Jr()),a=l.ref(Ut());window.$wujie&&((m=window.$wujie.bus)==null||m.$on("changeThemeEmit",_=>{a.value=Ut()}));const s=()=>n.value,c=()=>{i.value=!0},d=()=>!1,u=()=>!1,f=_=>{if(i.value=!1,y.ER.Core.toString(n,!0).length===0&&r.params.formHelper&&r.params.configId){_.params=r.params,_.isClear=!0;const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");if(T&&T instanceof Function&&T(_)===!1)return;r.params.stopEditing()}else if(r.params.maxLength>0){const T=_.target.value||"";let x="",E=0;for(let D=0;D<T.length;D++){const k=T.codePointAt(D);if(k>=128512&&k<=128591?E+=4:k>=19968&&k<=40959||k>=65280&&k<=65519?E+=2:E+=1,E>r.params.maxLength){n.value=x;break}x+=T[D]}}},h=async _=>{if(r.params.formHelper&&r.params.configId){_.params=r.params,r.params.event&&r.params.event instanceof Function&&await r.params.event(_);const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");if(T&&T instanceof Function&&T(_)===!1)return;r.params.stopEditing()}};return l.onMounted(()=>{l.nextTick(()=>{y.ER.Core.jQuery(e.value).focus()})}),{h:l.h,ER:y.ER,props:r,value:n,inputRef:e,readOnly:t,antdLocale:o,antdTheme:a,EllipsisOutlined:$e.EllipsisOutlined,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,onChange:f,setInvalid:c,getValue:s,addButtonClick:h,isCancelBeforeStart:d,isCancelAfterEnd:u}}});function sx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-button"),d=l.resolveComponent("a-input-group"),u=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(u,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(d,{style:{display:"flex","align-items":"center",width:"100%"},compact:""},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=f=>r.value=f),ref:"inputRef","allow-clear":!0,readOnly:r.readOnly,style:{flex:1},onChange:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","readOnly","onChange"]),l.createVNode(c,{style:{height:"22px !important",width:"23px","box-shadow":"none !important"},onClick:r.addButtonClick},{icon:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.EllipsisOutlined))))]),_:1},8,["onClick"])]),_:1})]),_:1},8,["theme","locale"])}const cx=Gr(lx,[["render",sx]]),dx=l.defineComponent({name:"ColorEditor",props:["params"],components:{"a-input":Ke.Input,"a-config-provider":Ke.ConfigProvider},setup:r=>{var d;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{t.value=Ut()}));const n=l.ref(null),i=l.ref("#ffffff"),o=()=>i.value||"#ffffff",a=()=>!1,s=()=>!1,c=u=>{i.value="#ffffff"};return l.onBeforeMount(()=>{var u;if(((u=r.params.value)==null?void 0:u.trim().length)>0)i.value=y.ER.Core.toHexColor(r.params.value);else return"#ffffff"}),l.onMounted(()=>{}),{h:l.h,value:i,props:r,inputRef:n,antdLocale:e,antdTheme:t,clearButtonClick:c,getValue:o,isCancelBeforeStart:a,isCancelAfterEnd:s}}});function ux(r,e,t,n,i,o){const a=l.resolveComponent("a-input"),s=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(a,{ref:"inputRef",value:r.value,"onUpdate:value":e[1]||(e[1]=c=>r.value=c),style:{paddingTop:"0px",paddingBottom:"0px"},class:"er-color-picker","allow-clear":!0},{addonBefore:l.withCtx(()=>[l.createVNode(a,{type:"color",value:r.value,"onUpdate:value":e[0]||(e[0]=c=>r.value=c)},null,8,["value"])]),_:1},8,["value"])]),_:1},8,["theme","locale"])}const fx=Gr(dx,[["render",ux]]),hx=l.defineComponent({name:"NumberEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-tooltip":Ke.Tooltip,"a-input":Ke.Input,"a-input-number":Ke.InputNumber},setup:r=>{var p,g,m;const e=l.ref(null),t=l.ref(((g=(p=r.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:g.READ_ONLY)==="1"),n=l.ref(r.params.zeroDisplayEmpty!==!1&&r.params.value===0?"":r.params.value),i=l.ref(!1),o=r.params.eventKey||"",a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((m=window.$wujie.bus)==null||m.$on("changeThemeEmit",_=>{s.value=Ut()}));const c=()=>n.value===""||n.value===void 0||isNaN(n.value)?null:y.ER.Core.toNumber(n.value),d=()=>{i.value=!0},u=()=>!1,f=()=>{const _=parseFloat(n.value);return r.params.min!==void 0&&_<r.params.min||r.params.max!==void 0&&_>r.params.max?(y.ER.Core.messageWarning((y.ER.Core.$t("ERX.InputValueOutOfRange")||"输入数值超出允许范围")+"["+r.params.min+","+r.params.max+"]"),!0):(i.value=!1,!1)},h=_=>{let T=_.target.value;if(T=T.replace(/(?!^-)[^\d.]/g,""),r.params.precision>=0&&T.includes(".")){const x=T.split(".");x[0]=x[0]||"0",r.params.precision===0?T=x[0]:(x[1]=x[1].slice(0,r.params.precision),T=`${x[0]}.${x[1]}`)}n.value=T};return l.onMounted(()=>{l.nextTick(()=>{const _=y.ER.Core.jQuery(e.value);_==null||_.focus(),o.length===1?n.value=o:_==null||_.select()})}),{h:l.h,ER:y.ER,props:r,readOnly:t,value:n,inputRef:e,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,onChange:h,setInvalid:d,getValue:c,isCancelBeforeStart:u,isCancelAfterEnd:f}}});function px(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-input-number"),d=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(d,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[r.props.params.showNumberControl!==!0?(l.openBlock(),l.createBlock(s,{key:0,value:r.value,"onUpdate:value":e[0]||(e[0]=u=>r.value=u),ref:"inputRef","allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,autofocus:!0,readOnly:r.readOnly,onChange:r.onChange},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange"])):l.createCommentVNode("",!0),r.props.params.showNumberControl===!0?(l.openBlock(),l.createBlock(c,{key:1,value:r.value,"onUpdate:value":e[1]||(e[1]=u=>r.value=u),ref:"inputRef",style:{width:"100%"},"allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,autofocus:!0,readonly:r.readOnly,controls:!0,step:r.props.params.step===!0?1:typeof r.props.params.step=="number"?r.props.params.step:1,formatter:r.props.params.formatter,parser:r.props.params.parser},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.ER.Core.$t("ERX.InputEmptyMessage")},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readonly","step","formatter","parser"])):l.createCommentVNode("",!0)]),_:1},8,["theme","locale"])}const f1=Gr(hx,[["render",px]]),gx=l.defineComponent({name:"TextEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-input":Ke.Input,"a-tooltip":Ke.Tooltip},setup:r=>{var T,x,E;const e=l.ref(null),t=l.ref(((x=(T=r.params.colDef.context)==null?void 0:T.columnConfig)==null?void 0:x.READ_ONLY)==="1"),n=l.ref(r.params.value||""),i=l.ref(!1),o=l.ref(""),a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",D=>{s.value=Ut()}));const c=r.params.eventKey||"",d=r.params.maxLength??-1,u=r.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{i.value=!0},p=()=>!1,g=()=>!1,m=D=>{i.value=!1;const k=D.target.value||"";if(d>0&&k.length>0){let P="",b=0;for(let S=0;S<k.length;S++){const w=k.codePointAt(S);if(w>=128512&&w<=128591?b+=4:w>=19968&&w<=40959||w>=65280&&w<=65519?b+=2:b+=1,b>d){n.value=P;break}P+=k[S]}}if((u==null?void 0:u.length)>0&&y.ER.Core.isValidRegex(u)&&!new RegExp(u).test(k)){i.value=!0,n.value=Array.from(n.value).filter(P=>new RegExp(u).test(P)).join(""),o.value=y.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}},_=D=>{i.value=!1};return l.onMounted(()=>{l.nextTick(()=>{var k;const D=y.ER.Core.jQuery(e.value);D==null||D.focus(),c.length===1?(n.value=c,(k=e.value)==null||k.setSelectionRange(1,1)):D==null||D.select()})}),{h:l.h,ER:y.ER,props:r,value:n,readOnly:t,inputRef:e,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,errorMessage:o,onChange:m,onKeydown:_,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:g}}});function mx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-input"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=d=>r.value=d),ref:"inputRef","allow-clear":r.readOnly!==!0,status:r.invalid?"error":void 0,readOnly:r.readOnly,onChange:r.onChange,onKeydown:l.withKeys(r.onKeydown,["enter"])},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.errorMessage},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange","onKeydown"])]),_:1},8,["theme","locale"])}const h1=Gr(gx,[["render",mx]]),Ex=l.defineComponent({name:"LargeTextEditor",props:["params"],components:{"a-config-provider":Ke.ConfigProvider,"a-textarea":Ke.Textarea,"a-tooltip":Ke.Tooltip},setup:r=>{var E,D,k;const e=l.ref(null),t=l.ref(((D=(E=r.params.colDef.context)==null?void 0:E.columnConfig)==null?void 0:D.READ_ONLY)==="1"),n=l.ref(r.params.value||""),i=l.ref(!1),o=l.ref(""),a=l.ref(Jr()),s=l.ref(Ut());window.$wujie&&((k=window.$wujie.bus)==null||k.$on("changeThemeEmit",P=>{s.value=Ut()}));let c=!1;const d=r.params.maxLength??-1,u=r.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{i.value=!0},p=()=>!1,g=()=>!1,m=P=>{P.key==="Enter"&&(c||P.shiftKey)&&P.stopPropagation()},_=()=>{c=!0},T=()=>{c=!1},x=P=>{i.value=!1;const b=P.target.value||"";if(d>0&&b.length>0){let S="",w=0;for(let I=0;I<b.length;I++){const v=b.codePointAt(I);if(v>=128512&&v<=128591?w+=4:v>=19968&&v<=40959||v>=65280&&v<=65519?w+=2:w+=1,w>d){n.value=S;break}S+=b[I]}}if((u==null?void 0:u.length)>0&&y.ER.Core.isValidRegex(u)&&!new RegExp(u).test(b)){i.value=!0,n.value=Array.from(n.value).filter(S=>new RegExp(u).test(S)).join(""),o.value=y.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}};return l.onMounted(()=>{l.nextTick(()=>{const P=y.ER.Core.jQuery(e.value);P==null||P.focus(),P==null||P.select()})}),{h:l.h,ER:y.ER,props:r,value:n,inputRef:e,readOnly:t,antdLocale:a,antdTheme:s,ExclamationCircleOutlined:$e.ExclamationCircleOutlined,invalid:i,errorMessage:o,onChange:x,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:g,onCompositionstart:_,onCompositionend:T,onKeyDown:m}}});function Cx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-textarea"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[l.createVNode(s,{value:r.value,"onUpdate:value":e[0]||(e[0]=d=>r.value=d),ref:"inputRef",class:"grid-cell-editor-textarea","allow-clear":r.readOnly!==!0,maxlength:r.props.params.maxLength,status:r.invalid?"error":void 0,readOnly:r.readOnly===!0,rows:r.props.params.rows,cols:r.props.params.cols,"show-count":r.props.params.showCount,onKeydown:r.onKeyDown,onCompositionstart:r.onCompositionstart,onCompositionend:r.onCompositionend},l.createSlots({_:2},[r.invalid?{name:"prefix",fn:l.withCtx(()=>[l.createVNode(a,{title:r.errorMessage},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(r.h(r.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","maxlength","status","readOnly","rows","cols","show-count","onKeydown","onCompositionstart","onCompositionend"])]),_:1},8,["theme","locale"])}const ad=Gr(Ex,[["render",Cx]]),_x=l.defineComponent({name:"ColorCell",props:["params"],setup:r=>{const e=l.ref("");return l.onMounted(()=>{var t;((t=r.params.value)==null?void 0:t.trim().length)>0&&(e.value=r.params.value==="255,255,255,1"?"":r.params.value)}),{ER:y.ER,value:e}}}),yx={style:{overflow:"hidden",textOverflow:"ellipsis"}};function Tx(r,e,t,n,i,o){return l.openBlock(),l.createElementBlock("div",yx,[l.createElementVNode("span",{style:l.normalizeStyle({paddingRight:"5px",borderLeft:r.value.length>0?"10px solid "+r.ER.Core.toHexColor(r.value):""})},null,4),l.createTextVNode(l.toDisplayString(r.value),1)])}const Ox=Gr(_x,[["render",Tx]]),Sx=l.defineComponent({name:"ButtonGroup",components:{"a-button":Ke.Button,"a-tooltip":Ke.Tooltip,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{var a,s,c,d;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((a=window.$wujie.bus)==null||a.$on("changeThemeEmit",u=>{t.value=Ut()}));const n=r.params.columnConfig||{},i=[];(c=(s=r.params)==null?void 0:s.data)!=null&&c.uid&&r.params.buttons.forEach(u=>{var h,p;u.options=u.options||{},u.options.style={height:"16px !important",...u.options.style};const f=((h=u.options)==null?void 0:h.condition)||"";if((f==null?void 0:f.trim().length)>0){const g=((p=r.params.data)==null?void 0:p.toJSON())||{};y.ER.Core.checkExpressionValid(g,f)&&i.push(u)}else i.push(u)}),window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{t.value=Ut()}));const o=u=>{var f,h,p,g,m,_;if(r.params.formHelper&&r.params.configId){((f=u.name)==null?void 0:f.toLowerCase())==="addrow"||((h=u.name)==null?void 0:h.toLowerCase())==="newrow"?r.params.formHelper.addRowToGrid(r.params.configId):(((p=u.name)==null?void 0:p.toLowerCase())==="deleterow"||((g=u.name)==null?void 0:g.toLowerCase())==="removerow"||((m=u.name)==null?void 0:m.toLowerCase())==="delete"||((_=u.name)==null?void 0:_.toLowerCase())==="remove")&&r.params.formHelper.deleteGridRows(r.params.configId,!0,[r.params.data]);const T=r.params.formHelper.getGridCustomEvent(r.params.configId,"cellButtonClick");T&&T instanceof Function&&T({...r.params,button:u})}};return l.onMounted(()=>{}),{buttonClick:o,props:r,antdLocale:e,antdTheme:t,columnConfig:n,renderButton:i}}}),wx={key:0,class:"er-grid-button-group",style:{display:"flex","align-items":"center"}};function vx(r,e,t,n,i,o){const a=l.resolveComponent("a-tooltip"),s=l.resolveComponent("a-button"),c=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(c,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var d,u,f;return[!((d=r.props.params.node)!=null&&d.group)&&!((u=r.props.params.node)!=null&&u.rowPinned)?(l.openBlock(),l.createElementBlock("div",wx,[r.props.params.displayValue?(l.openBlock(),l.createBlock(a,{key:0,title:(f=r.props.params)==null?void 0:f.getValue()},{default:l.withCtx(()=>{var h;return[l.createElementVNode("div",null,l.toDisplayString((h=r.props.params)==null?void 0:h.getValue()),1)]}),_:1},8,["title"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.renderButton,(h,p)=>{var g;return l.openBlock(),l.createBlock(a,{key:h.name+"tooltip",title:(g=h.options)!=null&&g.showTooltip?h.caption:void 0},{default:l.withCtx(()=>{var m,_,T,x,E,D,k,P,b,S,w,I,v;return[l.createVNode(s,{type:((m=h.options)==null?void 0:m.type)||"link",icon:((_=h.options)==null?void 0:_.icon)||void 0,class:l.normalizeClass(((T=h.options)==null?void 0:T.class)||""),style:l.normalizeStyle((x=h.options)==null?void 0:x.style),ghost:((E=h.options)==null?void 0:E.ghost)===!0,loading:((D=h.options)==null?void 0:D.loading)===!0,shape:((k=h.options)==null?void 0:k.shape)||"default",block:((P=h.options)==null?void 0:P.block)===!0,danger:((b=h.options)==null?void 0:b.danger)===!0||((S=h.name)==null?void 0:S.toLowerCase())==="deleterow"||((w=h.name)==null?void 0:w.toLowerCase())==="removerow"||((I=h.name)==null?void 0:I.toLowerCase())==="delete"||((v=h.name)==null?void 0:v.toLowerCase())==="remove",onClick:A=>r.buttonClick({...h,data:r.props.params.data,index:p})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.caption),1)]),_:2},1032,["type","icon","class","style","ghost","loading","shape","block","danger","onClick"])]}),_:2},1032,["title"])}),128))])):l.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const Dx=Gr(Sx,[["render",vx]]),xx=l.defineComponent({name:"ProgressBar",props:["params"],setup:r=>{const e=l.ref(r.params.value),t=l.ref(r.params.maxValue),n=l.ref(r.params.progressBarColor),i=()=>!r.params.value||r.params.value<=0||r.params.maxValue<=0?0:r.params.value/r.params.maxValue>=1?"100%":y.ER.Core.toString(y.ER.Core.toNumber(r.params.value)/y.ER.Core.toNumber(r.params.maxValue)*100)+"%",o=()=>r.params.value?r.params.value<=0||r.params.maxValue<=0?e:y.ER.Core.toString(y.ER.Core.round(r.params.value/r.params.maxValue*100,2))+"%":"";return l.onMounted(()=>{}),{value:e,maxValue:t,progressBarColor:n,percent:i,labelText:o,props:r,ER:y.ER}}}),Ax={style:{width:"100%",height:"15px",position:"absolute",color:"",right:0,top:0,zIndex:1}};function Ix(r,e,t,n,i,o){return r.value?(l.openBlock(),l.createElementBlock("div",{key:0,style:l.normalizeStyle({width:"100%",height:"18px",backgroundColor:"transparent",borderColor:r.progressBarColor,position:"relative",borderStyle:"solid",borderWidth:"thin"})},[l.createElementVNode("div",Ax,l.toDisplayString(r.labelText()),1),l.createElementVNode("div",{style:l.normalizeStyle({width:r.percent(),height:"100%",backgroundColor:r.progressBarColor,position:"absolute",left:0,right:0,top:0,bottom:0,transition:"width 10s ease-in-out",zIndex:0})},null,4)],4)):l.createCommentVNode("",!0)}const bx=Gr(xx,[["render",Ix]]),Fx=l.defineComponent({name:"DefaultRender",components:{"a-tag":Ke.Tag,"a-badge":Ke.Badge,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{const e=r.params.click,t=l.ref({});r.params.color&&(t.value.color=r.params.color),r.params.backgroundColor&&(t.value.backgroundColor=r.params.backgroundColor),r.params.boderColor&&(t.value.boxShadow=`0 0 0 1px ${r.params.boderColor} inset`);const n=i=>{i.preventDefault(),e&&e instanceof Function&&e(r.params)};return l.onMounted(()=>{}),{props:r,ER:y.ER,navigateToLink:n,badgeNumberStyle:t}}}),Mx={key:0,class:"er-grid-cell-image",style:{display:"inline-block"}},kx={key:0,class:"icon",fill:"currentColor"},Rx=["xlink:href"],Nx=["src"],Px=["href"];function Lx(r,e,t,n,i,o){var c,d,u,f;const a=l.resolveComponent("a-tag"),s=l.resolveComponent("a-badge");return l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle({display:"block",textAlign:r.props.params.justifyContent==="flex-end"?"right":r.props.params.justifyContent==="center"?"center":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})},[r.props.params.svgIcon||r.props.params.imgIcon||r.props.params.fontIcon?(l.openBlock(),l.createElementBlock("div",Mx,[r.props.params.svgIcon?(l.openBlock(),l.createElementBlock("svg",kx,[l.createElementVNode("use",{"xlink:href":r.props.params.svgIcon},null,8,Rx)])):r.props.params.fontIcon?(l.openBlock(),l.createElementBlock("i",{key:1,class:l.normalizeClass(`iconfont icon-${r.props.params.fontIcon} er-iconfont`),style:l.normalizeStyle({height:"16px",width:"16px",fontSize:"14px",color:r.props.params.fontColor})},null,6)):(l.openBlock(),l.createElementBlock("img",{key:2,class:"er-remote-img",src:r.props.params.imgIcon},null,8,Nx))])):l.createCommentVNode("",!0),((c=r.props.params.tagText)==null?void 0:c.trim().length)>0&&r.props.params.tagAfterText!==!0?(l.openBlock(),l.createBlock(a,{key:1,style:{display:"inline-block",height:"18px"},color:r.props.params.tagColor||"#87d068",bordered:r.props.params.tagBordered},{default:l.withCtx(()=>{var h;return[l.createTextVNode(l.toDisplayString((h=r.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["color","bordered"])):l.createCommentVNode("",!0),((d=r.props.params.badgeText)==null?void 0:d.trim().length)>0?(l.openBlock(),l.createBlock(s,{key:2,class:"er-badge",count:(u=r.props.params.badgeText)==null?void 0:u.trim(),"number-style":r.badgeNumberStyle,style:{display:"inline-block"}},null,8,["count","number-style"])):l.createCommentVNode("",!0),r.props.params.callFormLink?(l.openBlock(),l.createElementBlock("a",{key:3,onClick:e[0]||(e[0]=l.withModifiers((...h)=>r.navigateToLink&&r.navigateToLink(...h),["prevent"])),style:l.normalizeStyle([{display:"inline-block","text-decoration":"underline"},r.props.params.style])},l.toDisplayString(r.props.params.displayText),5)):r.ER.Core.isUrl(r.props.params.displayText)?(l.openBlock(),l.createElementBlock("a",{key:4,href:r.props.params.displayText,target:"_blank",style:{display:"inline-block"}},l.toDisplayString(r.props.params.displayText),9,Px)):(l.openBlock(),l.createElementBlock("span",{key:5,style:l.normalizeStyle([r.props.params.textStyle,{display:"inline-block"}])},l.toDisplayString(r.props.params.displayText),5)),((f=r.props.params.tagText)==null?void 0:f.trim().length)>0&&r.props.params.tagAfterText===!0?(l.openBlock(),l.createBlock(a,{key:6,style:l.normalizeStyle([{display:"inline-block",height:"18px","margin-left":"5px","padding-left":"1px","padding-right":"1px"},r.props.params.tagStyle]),color:r.props.params.tagColor||"#87d068",bordered:r.props.params.tagBordered},{default:l.withCtx(()=>{var h;return[l.createTextVNode(l.toDisplayString((h=r.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["style","color","bordered"])):l.createCommentVNode("",!0)],4)}const g4=Gr(Fx,[["render",Lx]]),Bx=l.defineComponent({name:"ImagePreview",components:{"a-image":Ke.Image},props:["params"],setup:r=>{const e=new y.ER.UploadHelper,t=l.ref("");return l.onMounted(async()=>{var n;if(r.params.data){if(r.params.data.imageBlobData)t.value=r.params.data.imageBlobData;else if(r.params.src&&r.params.src.split("/").length>1){const i=await e.downloadFile({key:r.params.src});i.flag&&((n=i.result)!=null&&n.data)&&(t.value=URL.createObjectURL(new Blob([i.result.data])),r.params.data.imageBlobData=t.value)}}}),l.onUnmounted(()=>{}),{props:r,imageUrl:t}}});function Vx(r,e,t,n,i,o){const a=l.resolveComponent("a-image");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{src:r.imageUrl||"https://www.antdv.com/#error",alt:"Blob Image",width:r.params.width||100,height:r.params.height||100,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="},null,8,["src","width","height"])])}const p1=Gr(Bx,[["render",Vx]]),Hx=l.defineComponent({name:"SwitchRender",components:{"a-switch":Ke.Switch,"a-config-provider":Ke.ConfigProvider},props:["params"],setup:r=>{var u,f,h;const e=l.ref(Jr()),t=l.ref(Ut());window.$wujie&&((u=window.$wujie.bus)==null||u.$on("changeThemeEmit",p=>{t.value=Ut()}));const n=r.params.colDef.cellDataType||"boolean",i=r.params.switchOptions||{},o=l.ref(r.params.value??!1);(n==="string"||n==="text")&&(i!=null&&i.onValue)&&(i!=null&&i.offValue)&&(o.value=r.params.value===(i==null?void 0:i.onValue));const a=l.ref(i==null?void 0:i.onText),s=l.ref(i==null?void 0:i.offText),c=((f=r.params.colDef.context)==null?void 0:f.editable)??!1;window.$wujie&&((h=window.$wujie.bus)==null||h.$on("changeThemeEmit",p=>{t.value=Ut()}));const d=p=>{(n==="string"||n==="text")&&(i!=null&&i.onValue)&&(i!=null&&i.offValue)?r.params.setValue(p?i==null?void 0:i.onValue:i==null?void 0:i.offValue):r.params.setValue(o.value)};return l.onMounted(()=>{}),{props:r,antdLocale:e,antdTheme:t,checkedValue:o,editable:c,handleChange:d,checkedChildren:a,unCheckedChildren:s}}}),Ux={key:0,style:{display:"flex"}};function Gx(r,e,t,n,i,o){const a=l.resolveComponent("a-switch"),s=l.resolveComponent("a-config-provider");return l.openBlock(),l.createBlock(s,{theme:r.antdTheme,locale:r.antdLocale,componentSize:"small"},{default:l.withCtx(()=>{var c,d;return[!((c=r.props.params.node)!=null&&c.group)&&!((d=r.props.params.node)!=null&&d.rowPinned)?(l.openBlock(),l.createElementBlock("div",Ux,[l.createVNode(a,{checked:r.checkedValue,"onUpdate:checked":e[0]||(e[0]=u=>r.checkedValue=u),disabled:!r.editable,"checked-children":r.checkedChildren,"un-checked-children":r.unCheckedChildren,onChange:r.handleChange},null,8,["checked","disabled","checked-children","un-checked-children","onChange"])])):l.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const m4=Gr(Hx,[["render",Gx]]),zx=l.defineComponent({name:"HeaderGroup",props:["params"],onMounted(){}}),Yx={class:"ag-header-group-cell-label"},Wx=["innerHTML"];function Qx(r,e,t,n,i,o){return l.openBlock(),l.createElementBlock("div",Yx,[l.createElementVNode("div",{class:"er-header-group-text",innerHTML:r.params.displayName},null,8,Wx)])}const Xx=Gr(zx,[["render",Qx],["__scopeId","data-v-440bb297"]]),qx=l.defineComponent({name:"AggregationPanel",props:["params"],setup(r){var i,o;const e=((o=(i=r.params.options)==null?void 0:i.aggregation)==null?void 0:o.format)||"#,##0.######",t=l.reactive({}),n=()=>{var g;const a=(g=r.params.api)!=null&&g.rangeService?r.params.api.rangeService.getCellRanges():void 0;let s=new Pr(0),c=0,d=0,u=2,f=null,h=null;const p={};a&&a.length>0&&a.forEach(m=>{let _=r.params.api.rangeService.getRangeStartRow(m);const T=r.params.api.rangeService.getRangeEndRow(m);for(;!(!_||r.params.api.rangeService.rowPositionUtils.before(T,_)||!m.columns);)m.columns.forEach(E=>{var b,S;if(_===null)return;const D=r.params.api.rangeService.cellPositionUtils.createId({rowPinned:_.rowPinned,column:E,rowIndex:_.rowIndex});if(p[D])return;p[D]=!0;const k=r.params.api.rowRenderer.getRowNode(_);if(!k)return;let P=r.params.api.valueService.getValue(E,k);(S=(b=E.colDef)==null?void 0:b.context)!=null&&S.hideContent&&(P="******"),!y.ER.Core.isNullOrEmpty(P)&&(c++,!(typeof P=="object"&&"value"in P&&(P=P.value,P===""))&&(typeof P=="string"&&(P=Number(P)),typeof P=="number"&&!isNaN(P)&&(new Pr(P).decimalPlaces()>u&&(u=new Pr(P).decimalPlaces()),s=s.add(P),(h===null||P>h)&&(h=P),(f===null||P<f)&&(f=P),d++)))}),_=r.params.api.rangeService.cellNavigationService.getRowBelow(_)}),d>1?(t.average={value:y.ER.Core.formatNumberValue(s.dividedBy(d).toDecimalPlaces(u).toNumber(),e),show:!0},t.sum={value:y.ER.Core.formatNumberValue(s.toNumber(),e),show:!0},t.min={value:y.ER.Core.formatNumberValue(f,e),show:!0},t.max={value:y.ER.Core.formatNumberValue(h,e),show:!0}):(delete t.average,delete t.sum,delete t.min,delete t.max),c>1?t.count={value:c,show:!0}:delete t.count};return{ER:y.ER,aggData:t,setAggData:n}}}),jx={class:"ag-status-panel ag-status-panel-aggregations"},Kx={key:0,class:"ag-status-name-value"},Zx={class:"ag-status-name-value-value"},Jx={key:1,class:"ag-status-name-value"},$x={class:"ag-status-name-value-value"},eA={key:2,class:"ag-status-name-value"},tA={class:"ag-status-name-value-value"},rA={key:3,class:"ag-status-name-value"},nA={class:"ag-status-name-value-value"},iA={key:4,class:"ag-status-name-value"},oA={class:"ag-status-name-value-value"};function aA(r,e,t,n,i,o){var a,s,c,d,u,f,h,p,g,m;return l.openBlock(),l.createElementBlock("div",jx,[(a=r.aggData.average)!=null&&a.show?(l.openBlock(),l.createElementBlock("div",Kx,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Average")||"平均值")+":",1),l.createElementVNode("span",Zx,l.toDisplayString((s=r.aggData.average)==null?void 0:s.value),1)])):l.createCommentVNode("",!0),(c=r.aggData.count)!=null&&c.show?(l.openBlock(),l.createElementBlock("div",Jx,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Count")||"计数")+":",1),l.createElementVNode("span",$x,l.toDisplayString((d=r.aggData.count)==null?void 0:d.value),1)])):l.createCommentVNode("",!0),(u=r.aggData.max)!=null&&u.show?(l.openBlock(),l.createElementBlock("div",eA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Max")||"最大值")+":",1),l.createElementVNode("span",tA,l.toDisplayString((f=r.aggData.max)==null?void 0:f.value),1)])):l.createCommentVNode("",!0),(h=r.aggData.min)!=null&&h.show?(l.openBlock(),l.createElementBlock("div",rA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Min")||"最小值")+":",1),l.createElementVNode("span",nA,l.toDisplayString((p=r.aggData.min)==null?void 0:p.value),1)])):l.createCommentVNode("",!0),(g=r.aggData.sum)!=null&&g.show?(l.openBlock(),l.createElementBlock("div",iA,[l.createElementVNode("span",null,l.toDisplayString(r.ER.Core.$t("ERX.Sum")||"总和")+":",1),l.createElementVNode("span",oA,l.toDisplayString((m=r.aggData.sum)==null?void 0:m.value),1)])):l.createCommentVNode("",!0)])}const E4=Gr(qx,[["render",aA],["__scopeId","data-v-04a55dad"]]);let g1=class{constructor(e){fe(this,"UnMountWhenCloseDialog",!0);fe(this,"_app");fe(this,"_options",{});fe(this,"_popWindowOpened",l.ref(!1));fe(this,"_component");this._options=e||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(e){this._options={...this._options,...e}}async showPopAttachment(e){var t;if(this._app)this._options.refreshKey=G.guid(),this._popWindowOpened.value=!0;else{this._component||(this._component=e,this._component||(this._component=await Promise.resolve().then(()=>mq),(t=this._component)!=null&&t.default&&(this._component=this._component.default)));const n=l.createApp(this._component,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=n;const i=document.createElement("div");document.body.appendChild(i),n.mount(i),this._popWindowOpened.value=!0}}},Tc=class{static callMenuForm(e,t){}static callDialogForm(e,t,n,i){}static exportGridAsExcel(e,t,n){}static getImportExcelData(e){return Promise.resolve([])}},lA=class{constructor(e,t,n,i,o){fe(this,"SysDefinedParas");fe(this,"_app");fe(this,"_currentFormRegitInfo",{});fe(this,"_currentConfigCompanyCode");fe(this,"_serverPartition","");fe(this,"_customPartition","");fe(this,"_moduleName","");fe(this,"_formId","");fe(this,"_formName","");fe(this,"_formCaption","");fe(this,"_formWidth",-1);fe(this,"_formHeight",-1);fe(this,"_maxmizeBox",!0);fe(this,"_minimizeBox",!0);fe(this,"_resizable",!0);fe(this,"_initializeFlag",0);fe(this,"_layoutIds");fe(this,"_dataSetName","");fe(this,"_tableNames","");fe(this,"_serviceName","si00_form_get");fe(this,"_initialConfiParas",{});fe(this,"_formInfo",{});fe(this,"_configInfo",{});fe(this,"_systemInfo",{});fe(this,"_customDefaultValues",{});fe(this,"_dropDownRefreshKey",l.reactive({}));fe(this,"_dropDownBindSource",{});fe(this,"_dropDownCascader",{});fe(this,"_gridOptions",{});fe(this,"_gridReactiveOptions",l.reactive({}));fe(this,"_gridToolbarOptions",l.reactive({}));fe(this,"_hiddenFields",{});fe(this,"_requiredFields",{});fe(this,"_requiredFieldsByCondition",{});fe(this,"_formDataSet",new d4);fe(this,"_formBindingRelation",{});fe(this,"_formAuthButtons",{});fe(this,"_groupCompanyCode","");fe(this,"_groupCompanyName","");fe(this,"_formConfigLicens","");fe(this,"_formConfigLicensErrorMsg","WMyNCZMrw9FY9qti+0p7zA==");fe(this,"_privateEncryptKey","QTS8kH81A2Do4qfezJ9cCEM4lZifC7Ym");fe(this,"_developPermission","0");fe(this,"_tempSingleConfigInfo",{});fe(this,"_gridInstanceInfo",{});fe(this,"_itemAuthInfo",{});fe(this,"_gridColumnsConfigInfo",{});fe(this,"_gridStyleInfo",{});fe(this,"_allowMergeColumnFields",{});fe(this,"_widgetInstanceInfo",{});fe(this,"_layoutConditionStyleInfo",{});fe(this,"_layoutConfigRelationInfo",{});fe(this,"_sysParaInfo",{});fe(this,"_gridCustomEvent",{});fe(this,"_formOptions",{});fe(this,"_layoutOpitons",l.reactive({}));fe(this,"_layoutItemOpitons",l.reactive({}));fe(this,"_layoutBindModelUid",l.reactive({}));fe(this,"_layoutBindModel",{});fe(this,"_controlConditionProps",{});fe(this,"_erxGlobalConfig",{});fe(this,"excuteGridColumnExpressions",(e,t)=>{const n={...e},i=Object.keys(n).sort((a,s)=>a.length>s.length?-1:a.length<s.length?1:0);let o=t;i.forEach(a=>{Ht.isDayjs(n[a])?n[a]=n[a].toDate():(n[a]===null||n[a]===void 0)&&(n[a]="");const s=new RegExp(`\\b${a}\\b`,"gi"),c=new RegExp(`[${a}]`.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");c.test(o)?o=o.replaceAll(c,`data.${a}`):s.test(o)&&(o=o.replaceAll(s,`data.${a}`))});try{return new Function("data",o)(n)}catch{console.error("ER: Script has a syntax error: "+o+"; data: "+JSON.stringify(n))}});this._formId=G.guid(),this._serverPartition=e||this._serverPartition,this._serviceName=n||this._serviceName,this._formName=t||this._formName,this._layoutIds=i,this._initialConfiParas=o,this._currentConfigCompanyCode={},this.SysDefinedParas={GroupCompanyCode:"BS",GroupCompanyName:"宝信软件",DefaultRmbCode:"CNY"}}get App(){return this._app}get Locale(){return Xs()}get IsRtl(){return ii()}get ModuleName(){return this._moduleName}get FormId(){return this._formId}get FormName(){return this._formName}get FormCaption(){return this._formCaption}get FormWidth(){return this._formWidth}get FormHeight(){return this._formHeight}get MaxmizeBox(){return this._maxmizeBox}get MinimizeBox(){return this._minimizeBox}get Resizable(){return this._resizable}get InitializeFlag(){return this._initializeFlag}get FormInfo(){return this._formInfo}get ConfigInfo(){return this._configInfo}get SystemInfo(){return this._systemInfo}get DropDownRefreshKey(){return this._dropDownRefreshKey}get DropDownBindSource(){return this._dropDownBindSource}get DropDownCascader(){return this._dropDownCascader}get FormOptions(){return this._formOptions}get GridOptions(){return this._gridOptions}get GridToolbarOptions(){return this._gridToolbarOptions}get RequiredFields(){return this._requiredFields}get RequiredFieldsByCondition(){return this._requiredFieldsByCondition}get AllowMergeColumnFields(){return this._allowMergeColumnFields}get FormDataSet(){return this._formDataSet}get FormBindingRelation(){return this._formBindingRelation}get FormAuthButtons(){return this._formAuthButtons}get DefaultConfigCompanyCode(){return"BS"}get DefaultConfigCompanyName(){return"宝信软件"}get ServerPartition(){return this._serverPartition}get CustomPartition(){return this._customPartition}get InitialConfiParas(){return this._initialConfiParas}get InitialService(){return this._serviceName}get CurrentConfigCompanyCode(){return this._currentConfigCompanyCode}get GroupCompanyCode(){return this._groupCompanyCode}get GroupCompanyName(){return this._groupCompanyName}get WidgetInstanceInfo(){return this._widgetInstanceInfo}get DevelopPermission(){return this._developPermission}get LayoutBindModelUid(){return this._layoutBindModelUid}get ErxGlobalConfig(){return this._erxGlobalConfig}get ItemAuthInfo(){return this._itemAuthInfo}get MenuFormInstance(){return this._currentFormRegitInfo}async Initialize(e,t,n,i,o){var s,c,d,u;this._erxGlobalConfig=await G.getErxGlobalConfig(),(c=(s=this._erxGlobalConfig)==null?void 0:s.License)!=null&&c[nt.CompanyCode]&&(this._formConfigLicens=(u=(d=this._erxGlobalConfig)==null?void 0:d.License)==null?void 0:u[nt.CompanyCode]);const a=G.decryptData(this._formConfigLicens,nt.GridCheckColumnFieldName,G.decryptData(this._privateEncryptKey,nt.GridCheckColumnFieldName,nt.GridCheckColumnFieldName));return this._erxGlobalConfig&&(!this._formConfigLicens||a!==nt.CompanyName)&&this.messageWarning(G.decryptData(this._formConfigLicensErrorMsg,nt.GridCheckColumnFieldName,nt.GridCheckColumnFieldName)),new Promise((f,h)=>{var m;this._serverPartition=(e==null?void 0:e.trim())||this._serverPartition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formName=(t==null?void 0:t.trim())||this._formName,this._initialConfiParas=o||this._initialConfiParas||{},this._layoutIds=n||this._layoutIds;let p="";this._layoutIds&&(typeof this._layoutIds=="string"?p=this._layoutIds:this._layoutIds instanceof Array&&(p=this._layoutIds.join(","))),this._dataSetName=G.toString(o==null?void 0:o.dataSetName).trim()||((m=this._dataSetName)==null?void 0:m.trim())||"#";const g=rt.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:nt.Culture,FUNCTION_IDS:p,DATASET_NAME:this._dataSetName,TABLE_NAMES:this._tableNames}],"Table0");this._initialConfiParas&&Object.keys(this._initialConfiParas).length>0&&g.addMapData("InitializeFormParas",Object.keys(this._initialConfiParas).map(_=>({PARA_NAME:_,PARA_VALUE:this._initialConfiParas?this._initialConfiParas[_]:""}))),Bn.callServiceEx(this._serviceName,g,{partition:this._serverPartition}).then(_=>{var T,x;_.sysFlag>=0?(_.dataMap.forEach((E,D)=>{this._configInfo[D]=E}),((x=(T=this._configInfo)==null?void 0:T.TSI00FORM)==null?void 0:x.length)>0?(this.InitializeWithData(),f({flag:this._initializeFlag,msg:"success"})):(this._initializeFlag=-1,f({flag:this._initializeFlag,msg:`The configuration information for the form [${this._formName}] was not found`}))):(this._initializeFlag=-1,f({flag:this._initializeFlag,msg:_.sysMsg}))},_=>{f({..._,flag:-1,msg:_.msg||"unknown error"})})})}InitializeWithData(){var e,t,n,i,o;this._initializeFlag=1,this._formInfo=this._configInfo.TSI00FORM[0]||{},this._moduleName=this._formInfo.MODULE_NAME,this.ModuleName.length<2?this._moduleName="GC":this._moduleName=this.ModuleName.substring(0,2),this._formName=this._formInfo.FORM_NAME,this._formWidth=G.toNumber(this._formInfo.FORM_WIDTH)||800,this._formHeight=G.toNumber(this._formInfo.FORM_HEIGHT)||650,this._formCaption=this._formInfo.FORM_FUNC_DESC,this._minimizeBox=this._formInfo.MINIMIZE==="1",this._maxmizeBox=this._formInfo.MAXIMIZE==="1",this._resizable=this._formInfo.FORM_STYLE!=="3",this._formConfigLicens=this._formInfo.LICENSE,this._groupCompanyCode=((e=this._formInfo.GROUP_COMPANY_CODE)==null?void 0:e.trim())||this._groupCompanyCode,this._groupCompanyName=((t=this._formInfo.GROUP_COMPANY_NAME)==null?void 0:t.trim())||this._groupCompanyName,this._configInfo[nt.SystemParamsBlockName]&&(this._systemInfo=this._configInfo[nt.SystemParamsBlockName][0],this._developPermission=this.getFormSysInfo("DEV_LICENSE")),((n=this._formInfo.EXT_OPTIONS)==null?void 0:n.trim().length)>0&&(this._formOptions=JSON.parse(this._formInfo.EXT_OPTIONS)),((o=(i=this._configInfo)==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0?(this.createDataSet(),this._configInfo.TSI00GRIDVIEW.forEach(a=>{this.setDropDownBindSourceAndRequiredFields(a)})):console.error("ER: No view configuration information found")}setMenuFormInstance(e){var t,n,i,o,a,s,c,d,u,f,h;if((t=e==null?void 0:e.attrs)!=null&&t.__eiInfo){const p=(n=e==null?void 0:e.attrs)==null?void 0:n.__eiInfo;this._currentFormRegitInfo.formEname=(i=p==null?void 0:p.extAttr)==null?void 0:i.efFormEname,this._currentFormRegitInfo.formCname=(o=p==null?void 0:p.extAttr)==null?void 0:o.efFormCname,this._currentFormRegitInfo.formLoadPath=(a=p==null?void 0:p.extAttr)==null?void 0:a.efFormLoadPath,this._currentFormRegitInfo.formInfo=p==null?void 0:p.extAttr,this._currentFormRegitInfo.formQueryParams=G.getQueryParams((s=p==null?void 0:p.extAttr)==null?void 0:s.efFormLoadPath),this._currentFormRegitInfo.formButtons={},(d=(c=e==null?void 0:e.attrs)==null?void 0:c.__buttonsEi)!=null&&d.blocks&&Object.keys((f=(u=e==null?void 0:e.attrs)==null?void 0:u.__buttonsEi)==null?void 0:f.blocks).forEach(g=>{var m,_;this._currentFormRegitInfo.formButtons[g]=(_=(m=e==null?void 0:e.attrs)==null?void 0:m.__buttonsEi)==null?void 0:_.getBlock(g).getMappedRows(),this._formAuthButtons[g]=this._currentFormRegitInfo.formButtons[g]})}else e!=null&&e.buttonInfo&&(this._currentFormRegitInfo.appName=e==null?void 0:e.appName,this._currentFormRegitInfo.formEname=e==null?void 0:e.formName,this._currentFormRegitInfo.formCname=e==null?void 0:e.formCaption,this._currentFormRegitInfo.formLoadPath=e==null?void 0:e.formPath,this._currentFormRegitInfo.formInfo=e==null?void 0:e.formInfo,this._currentFormRegitInfo.formQueryParams=G.getQueryParams(e==null?void 0:e.formLoadPath),this._currentFormRegitInfo.formButtons={},((h=e==null?void 0:e.buttonInfo)==null?void 0:h.length)>0&&(this._currentFormRegitInfo.formButtons=e==null?void 0:e.buttonInfo.filter(p=>{var g;return((g=p.regionId)==null?void 0:g.trim().length)>0}).reduce((p,g)=>{const m=g.regionId;p[m]||(p[m]=[]);const _={...g,button_ename:g.name,button_cname:g.desc,...G.jsonParseSafe(g.extProperty)};return p[m].push(_),p},{}),Object.keys(this._currentFormRegitInfo.formButtons).forEach(p=>{this._currentFormRegitInfo.formButtons[p].sort((g,m)=>G.toNumber(g.nodeSortId)-G.toNumber(m.nodeSortId)),this._formAuthButtons[p]=this._currentFormRegitInfo.formButtons[p]})))}async loadConfig(e,t){return new Promise((n,i)=>{var a,s;t={...this._initialConfiParas,...t};const o=e.trim().length>0?e.split(",").filter(c=>c.trim().length>0):[];if(o.length>0){const c=t.reload==="1"?o.join(","):o.filter(u=>!this.containsConfig(u.trim())).join(","),d=(c==null?void 0:c.length)>0?c.split(","):[];if(d.length>0){const u=rt.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:nt.Culture,FUNCTION_IDS:c,DATASET_NAME:"#",TABLE_NAMES:"",EXIST_TABLES:((s=Object.keys((a=this._formDataSet)==null?void 0:a.dataTables))==null?void 0:s.join(","))||"",INI_FLAG:this._initializeFlag}],"Table0");t&&Object.keys(t).length>0&&u.addMapData("InitializeFormParas",Object.keys(t).map(f=>({PARA_NAME:f,PARA_VALUE:t?t[f]:""}))),Bn.callServiceEx(this._serviceName,u,{partition:this._serverPartition}).then(f=>{f.sysFlag>=0&&(f.dataMap.forEach((p,g)=>{[nt.SystemParamsBlockName,"TESCOMPANYINFO","TSI00FORM","TSI00DATASOURCE","TSI00DATATABLE","TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].includes(g)||(this._configInfo[g]=p)}),["TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].forEach(p=>{if(f.contains(p)&&this._configInfo[p]&&f.getMapData(p).length>0){if((t==null?void 0:t.reload)==="1"&&this._configInfo[p].length>0)for(let g=this._configInfo[p].length-1;g>=0;g--)d.includes(this._configInfo[p][g].FUNCTION_ID)&&this._configInfo[p].splice(g,1);this._configInfo[p].push(...f.getMapData(p))}}),d.forEach(p=>{var _;(t==null?void 0:t.reload)==="1"&&(this._tempSingleConfigInfo[p]=void 0);const g=this.getSingleViewConfigInfo(p),m=G.toString(g.TABLE_NAME).trim();if(g&&m.length>0&&!this._formDataSet.contains(m)){this._configInfo.TSI00DATATABLE.some(x=>x.TABLE_NAME===m)||f.getMapData("TSI00DATATABLE").length>0&&this._configInfo.TSI00DATATABLE.push(...f.getMapData("TSI00DATATABLE"));const T={};g.FUNCTION_TYPE==="T"&&((_=g.CURRENT_NODE_DESC)==null?void 0:_.trim().length)>0&&g.FATHER_NODE_DESC.trim().length>0&&(T.hierarchy={primaryField:g.CURRENT_NODE_DESC.trim(),parentField:g.CURRENT_NODE_DESC}),this.createDataTable(m,T)}this.setDropDownBindSourceAndRequiredFields(g)})),n({flag:f.sysFlag>=0?1:-1,msg:f.sysMsg})},f=>{n({...f,flag:-1,msg:"unknown error"})})}else n({flag:1,msg:"Configuration ["+e.trim()+"] already exists"})}else n({flag:-1,msg:"No config id"})})}$t(e,t){var i,o;let n;if((e==null?void 0:e.trim().length)>0){for(let a=0;a<((o=(i=this.ConfigInfo.TSI00FORMRESOURCE)==null?void 0:i.data)==null?void 0:o.length);a++)if(this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_CODE===e){n=this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_VALUE_RES||this.ConfigInfo.TSI00FORMRESOURCE.data[a].ITEM_VALUE;break}n=n??G.$t(e,t)}return n??""}setFormCapiton(e){return this._formCaption=e,this}setFormOptions(e){return this._formOptions={...this._formOptions,...e},this}setDropDownBindSourceAndRequiredFields(e){const t={},n={},i=[],o=[],a=["F3","F6","F7","FD","FA","FB","FP","FC","FH","FL","FJ","FK","G1","G2","G4","GD","GP"];if(this._configInfo.TSI00GRIDCOLUMN&&this._configInfo.TSI00GRIDCOLUMN.length>0){let s=[],c=nt.CompanyCode;e.MATCH_FLAG==="1"&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===e.FUNCTION_ID&&d.COMPANY_CODE===c&&(a.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length===0&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===e.FUNCTION_ID&&d.COMPANY_CODE===this.DefaultConfigCompanyCode&&(a.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length>0&&s.forEach(d=>{const u=(e.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;if(a.includes(u))if(d.ORIGIN_CODE!=="0"&&d.SVC_NAME.trim().length>0){if(t[d.ITEM_CODE]=this.setDropDownBindOptions(e.FUNCTION_TYPE,d),d.FATHER_FIELD.trim().length>0&&d.FORM_FILTER.trim().length>0&&d.FORM_FILTER.trim()!=="0"){d.LAYOUT_ID.trim().length===0&&(d.LAYOUT_ID=e.FUNCTION_ID),this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()]||(this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()]=[]);const f={};f.COLUMN_EDIT=d.COLUMN_EDIT,f.FUNCTION_ID=d.FUNCTION_ID,f.ITEM_CODE=d.ITEM_CODE,f.FORM_FILTER=d.FORM_FILTER,f.FUNCTION_TYPE=e.FUNCTION_TYPE,this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()].push(f)}n[d.ITEM_CODE]=G.guid()}else console.warn(`ER: The dropdown data source for [${e.FUNCTION_ID}.${d.ITEM_CODE}] is not configured!`);d.ITEM_MUST_FLAG==="1"&&(d.MUST_INPUT_CONDITION.trim().length>0?o.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME,MUST_INPUT_CONDITION:d.MUST_INPUT_CONDITION,CONDITION_TABLE:d.CONDITION_TABLE}):i.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME}))})}this._dropDownRefreshKey[e.FUNCTION_ID]=n,this._dropDownBindSource[e.FUNCTION_ID]=t,this._requiredFields[e.FUNCTION_ID]=i,this._requiredFieldsByCondition[e.FUNCTION_ID]=o}setCustomPartition(e){return this._customPartition=e,this._customPartition}setLayoutCaption(e,t){this.setLayoutOptions(e,"layoutCaption",t)}getLayoutCaption(e){return G.toString(this.getLayoutOptions(e,"layoutCaption"))}getLayoutBindModel(e){if(this._layoutBindModel[e]===void 0){const t=new qr;t.uid="",this._layoutBindModel[e]=l.reactive(t)}return this._layoutBindModel[e]}refreshLayoutBindModel(e){const t=this.getBindingTable(e);let n=t==null?void 0:t.Current;n||(n=new qr,n.uid=""),this._layoutBindModel[e]=l.reactive(n),this._layoutBindModelUid[e]=n.uid}setLayoutBindForm(e,t){this.setLayoutOptions(e,"bindForm",t)}getLayoutBindForm(e){return this.getLayoutOptions(e,"bindForm")}setLayoutOptions(e,t,n){return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(e=e.trim(),t=t.trim(),this._layoutOpitons[e]=this._layoutOpitons[e]||{},this._layoutOpitons[e][t]=n),this}getLayoutOptions(e,t){let n;return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(e=e.trim(),this._layoutOpitons[e]&&(n=this._layoutOpitons[e][t==null?void 0:t.trim()])),(n==null?void 0:n.value)!==void 0?n==null?void 0:n.value:n}setLayoutItemOption(e,t,n){return(e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&n&&(this._layoutItemOpitons[e]=this._layoutItemOpitons[e]||{},this._layoutItemOpitons[e][t]=this._layoutItemOpitons[e][t]||{},Object.keys(n).forEach(i=>{l.isRef(this._layoutItemOpitons[e][t][i])?this._layoutItemOpitons[e][t][i].value=n[i]:this._layoutItemOpitons[e][t][i]=l.ref(n[i])})),this}getLayoutItemOption(e,t,n){let i;return this._layoutItemOpitons[e]&&this._layoutItemOpitons[e][t]&&(i=this._layoutItemOpitons[e][t][n]),(i==null?void 0:i.value)!==void 0?i==null?void 0:i.value:i}setLayoutItemValidateRules(e,t,n,i=!1){if((e==null?void 0:e.trim().length)>0&&typeof t=="string"&&(t==null?void 0:t.trim().length)>0){const o=this.getLayoutBindForm(e);if(o!=null&&o.rulesRef)if(o.rulesRef[t]=o.rulesRef[t]||[],i&&o.rulesRef[t])if((n==null?void 0:n.length)>0){const a=[];n.forEach((s,c)=>{n[c].itemCode=t;let d=!1;for(let u=0;u<o.rulesRef[t].length;u++)if(o.rulesRef[t][u].customType===s.customType){o.rulesRef[t][u]=s,d=!0;break}d||a.push(s)}),a.length>0&&o.rulesRef[t].push(...a)}else o.rulesRef[t]=[];else o.rulesRef[t].push(...n)}return this}setLayoutItemValidator(e,t,n,i=!1){const o=[];return o.push({message:"",trigger:"change",itemCode:t,validator:(a,s)=>n instanceof Function?n(s)===!0?(a.message="",Promise.resolve()):(a.message=n(s)||"",Promise.reject(new Error("Invalid value"))):(a.message="",Promise.resolve())}),this.setLayoutItemValidateRules(e,t,o,i),this}setLayoutItemCaptionForeColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{o.trim().length>0&&this.setLayoutItemOption(e,o,{LabelForeColor:n})}),this}setLayoutItemCaptionBackColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{o.trim().length>0&&this.setLayoutItemOption(e,o,{LabelBackColor:n})}),this}setLayoutItemContentForeColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","erTreeSelect","erMultiTreeSelect","antInput","antInputNumber","antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(a)&&this.setControlCss(e,o,[{property:"color",value:n}]),this.setLayoutItemOption(e,o,{TextForeColor:n})}}),this}setLayoutItemContentBackColor(e,t,n){let i;return t instanceof Array?i=t:i=t.split(","),(i==null?void 0:i.length)>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","antInput","antInputNumber"].includes(a)&&this.setControlCss(e,o,[{property:"background",value:n}]),this.setLayoutItemOption(e,o,{TextBackColor:n})}}),this}setLayoutConditionStyleConfigInfo(e,t,n){return this._layoutConditionStyleInfo[e]=this._layoutConditionStyleInfo[e]||{},this._layoutConditionStyleInfo[e][t]=n,this}setLayoutConditionStyle(e,t){if((e==null?void 0:e.trim().length)>0){const n=this.getLayoutBindModel(e);if(n&&this._layoutConditionStyleInfo[e==null?void 0:e.trim()]){const i=a=>{var c,d,u,f,h,p,g,m;const s=this._layoutConditionStyleInfo[e==null?void 0:e.trim()][a];s&&(G.checkExpressionValid(n,G.getSystemFormatString(s.condition))?(((c=s.labelForeColor)==null?void 0:c.trim().length)>0&&this.setLayoutItemCaptionForeColor(e,a,s.labelForeColor),((d=s.labelBackgroundColor)==null?void 0:d.trim().length)>0&&this.setLayoutItemCaptionBackColor(e,a,s.labelBackgroundColor),((u=s.textForeColor)==null?void 0:u.trim().length)>0&&this.setLayoutItemContentForeColor(e,a,s.textForeColor),((f=s.textBackgroundColor)==null?void 0:f.trim().length)>0&&this.setLayoutItemContentBackColor(e,a,s.textBackgroundColor)):(((h=s.labelForeColor)==null?void 0:h.trim().length)>0&&this.setLayoutItemCaptionForeColor(e,a,""),((p=s.labelBackgroundColor)==null?void 0:p.trim().length)>0&&this.setLayoutItemCaptionBackColor(e,a,""),((g=s.textForeColor)==null?void 0:g.trim().length)>0&&this.setLayoutItemContentForeColor(e,a,""),((m=s.textBackgroundColor)==null?void 0:m.trim().length)>0&&this.setLayoutItemContentBackColor(e,a,"")))};let o;t instanceof Array?o=t:t&&(t==null?void 0:t.trim().length)>0?o=t.split(","):o=Object.keys(this._layoutConditionStyleInfo[e]),(o==null?void 0:o.length)>0&&o.forEach(a=>{i(a)})}}return this}bindGridCustomEvent(e,t,n){return this._gridCustomEvent[e]=this._gridCustomEvent[e]||{},this._gridCustomEvent[e][t]=n,this}getGridCustomEvent(e,t){let n;return this._gridCustomEvent[e]&&this._gridCustomEvent[e][t]&&(n=this._gridCustomEvent[e][t]),n}getCompanyName(e){var n,i,o;let t="";return(e==null?void 0:e.trim().length)>0&&((n=this._configInfo.TESCOMPANYINFO)==null?void 0:n.length)>0&&(t=((o=(i=this._configInfo.TESCOMPANYINFO.find(a=>a.COMPANYCODE===e))==null?void 0:i.COMPANYNAME)==null?void 0:o.trim())||""),t}cloneTableForLayoutOrGrid(e,t,n){var i,o,a,s,c,d;if(this.InitializeFlag>0&&e.trim().length>0&&t.trim().length>0&&n.trim().length>0&&!((i=this._formDataSet)!=null&&i.contains(t.trim())))if(n=n.trim(),e=e.trim(),t=t.trim(),(o=this._formDataSet)!=null&&o.contains(e)||(e=this.getBindingTableName(e)),e.length>0&&((a=this._formDataSet)!=null&&a.contains(e))){const u=(s=this._formDataSet)==null?void 0:s.getDataTable(e),f=(c=this._formDataSet)==null?void 0:c.cloneDataTable(u,t);(d=this._formDataSet)==null||d.addDataTable(t,f),this._configInfo.TSI00GRIDVIEW.every(p=>p.FUNCTION_ID===n?(p.TABLE_NAME=t,!1):!0),this._formBindingRelation[n]=t;const h=this.getGrid(n);h&&(u==null||u.removeBindingInfo(this,n),h.gridOptions.context.bindingSource=f,h.gridOptions.context.bindTableName=t,f==null||f.setBindingInfo(this,n,"Grid"))}else this.messageError(`ER: The origin table [${e}] does not exist!`);return this}containsConfig(e){const t=this.getConfigInfo(e);return!!(t&&t.TSI00GRIDCOLUMN&&t.TSI00GRIDCOLUMN.length>0)}isEmptyConfig(e){return!this.containsConfig(e)}getConfigInfo(e,t=!1){let n={},i=nt.CompanyCode;if(this._tempSingleConfigInfo[e])n=this._tempSingleConfigInfo[e];else{let o=[];if(this._configInfo.TSI00GRIDVIEW&&(o=this._configInfo.TSI00GRIDVIEW.filter(a=>a.FUNCTION_ID===e),o.length>0)){n.TSI00GRIDVIEW=o;const a=n.TSI00GRIDVIEW.FUNCTION_TYPE,s=n.TSI00GRIDVIEW.MATCH_FLAG;this._configInfo.TSI00GRIDCOLUMN&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&(c.IS_VISIBLE==="1"||t===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.IS_VISIBLE==="1"||t===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMN=o),this._configInfo.TSI00GRIDCOLUMNAUTH&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&(c.USER_ID===nt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.USER_ID===nt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNAUTH=o,o.length>0&&(this._itemAuthInfo[e]={},o.forEach(c=>{this._itemAuthInfo[e][c.ITEM_CODE]=this._itemAuthInfo[e][c.ITEM_CODE]||{},this._itemAuthInfo[e][c.ITEM_CODE][c.USER_ID]=c.AUTH_CODE}))),this._configInfo.TSI00GRIDCOLUMNURL&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNURL=o),this._configInfo.TSI00GRIDSTYLE&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDSTYLE=o),this._configInfo.TSI00GRIDBAND&&a!=="F"&&(o=[],s==="1"&&(o=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===i),this._currentConfigCompanyCode["TSI00GRIDBAND"+e]=i),o.length===0&&(o=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===e&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDBAND"+e]=this.DefaultConfigCompanyCode),n.TSI00GRIDBAND=o),this._configInfo.TSI00GRIDVIEWCUS&&a!=="F"&&(o=this._configInfo.TSI00GRIDVIEWCUS.filter(c=>c.FUNCTION_ID===e),n.TSI00GRIDVIEWCUS=o),this._tempSingleConfigInfo[e]=n}}return n}getSingleViewConfigInfo(e){let t={};if(this._configInfo.TSI00GRIDVIEW&&this._configInfo.TSI00GRIDVIEW.length>0){for(let n=0;n<this._configInfo.TSI00GRIDVIEW.length;n++)if(this._configInfo.TSI00GRIDVIEW[n].FUNCTION_ID===e)return this._configInfo.TSI00GRIDVIEW[n]}return t}getSingleItemConfigInfo(e,t,n){var o,a;let i={};if(this._gridColumnsConfigInfo[e]===void 0&&(this._gridColumnsConfigInfo[e]={}),this._gridColumnsConfigInfo[e][t])i=this._gridColumnsConfigInfo[e][t];else{(!n||n.trim().length===0)&&(n=nt.CompanyCode),n||(n=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+e]);const s=this.getConfigInfo(e);(s==null?void 0:s.TSI00GRIDCOLUMN.length)>0&&(s.TSI00GRIDCOLUMN.every((c,d)=>c.COMPANY_CODE===n&&c.FUNCTION_ID===e&&c.ITEM_CODE===t||c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.FUNCTION_ID===e&&c.ITEM_CODE===t?(i=c,!1):!0),Object.keys(i).length>0&&((o=s.TSI00GRIDVIEW)==null?void 0:o.length)>0&&(i.FUNCTION_TYPE=s.TSI00GRIDVIEW[0].FUNCTION_TYPE,((a=i.EXT_OPTIONS)==null?void 0:a.trim().length)>0&&(i.extendOptions=JSON.parse(i.EXT_OPTIONS))),this._gridColumnsConfigInfo[e][t]=i)}return i}getAllItemCodeArray(e){const t=[];e=this.getConfigIdbyLayoutName(e);const n=this.getConfigInfo(e);if(n.TSI00GRIDCOLUMN){const i=n.TSI00GRIDCOLUMN;i.length>0&&i.forEach(o=>{t.push(o.ITEM_CODE)})}return t}getAllConfigIdArray(){const e=[];if(this._configInfo.TSI00GRIDVIEW){const t=this._configInfo.TSI00GRIDVIEW;t.length>0&&t.forEach(n=>{e.push(n.ITEM_CODE)})}return e}getItemDropDownDataSource(e,t){var o;let n=[];const i=this.getSingleItemConfigInfo(e,t);return((o=i==null?void 0:i.SVC_NAME)==null?void 0:o.trim().length)>0&&(this._configInfo[i.FUNCTION_ID+i.ITEM_CODE+nt.CompanyCode]?n=this._configInfo[i.FUNCTION_ID+i.ITEM_CODE+nt.CompanyCode]:this._configInfo[i.FUNCTION_ID+i.ITEM_CODE]?n=this._configInfo[i.FUNCTION_ID+i.ITEM_CODE]:this._configInfo[i.FUNCTION_ID+i.SVC_NAME]?n=this._configInfo[i.FUNCTION_ID+i.SVC_NAME]:this._configInfo["SI->"+i.SVC_NAME]?n=this._configInfo["SI->"+i.SVC_NAME]:this._configInfo["EP->"+i.SVC_NAME]?n=this._configInfo["EP->"+i.SVC_NAME]:this._configInfo["PM->"+i.SVC_NAME]?n=this._configInfo["PM->"+i.SVC_NAME]:this._configInfo[this._formName+i.SVC_NAME]?n=this._configInfo[this._formName+i.SVC_NAME]:this._configInfo[i.SVC_NAME]?n=this._configInfo[i.SVC_NAME]:this.messageError(`Can not find the data source config for [${e}.${t}]!`)),n}setDropDownBindOptions(e,t,n){var k,P,b,S,w;((k=t.EXT_OPTIONS)==null?void 0:k.trim().length)>0&&(t.extendOptions=JSON.parse(t.EXT_OPTIONS));const i=G.toString(t.DISPLAY_COLS).toUpperCase();let o=G.toString(t.DISPLAY_CAPTIONS).trim();const a=((b=(P=t.extendOptions)==null?void 0:P.dropdownOptions)==null?void 0:b.displayWidths)||[];let s=!1;const c=G.toString(t.VALUE_MEMBER).toUpperCase(),d=G.toString(t.DISPLAY_MEMBER).toUpperCase(),u=G.toNumber(t.VALUE_POSITION),f=G.toNumber(t.DISPLAY_POSITION),h=[],p=G.$t("ERX.CodeColumn")||"代码",g=G.$t("ERX.DescriptionColumn")||"描述";o.startsWith("$t(")&&o.endsWith(")")&&(o=o.substring(3,o.length-1),s=!0);let m="CODE";c.trim().length>0&&(m=c.trim());let _="CODE_DESC_1_CONTENT";d.trim().length>0&&(_=d.trim()),h.push(m,_);const T={dataValueField:"",dataTextField:"",dataSource:[],filterFields:h,columns:[{field:m,title:p,width:150},{field:_,title:g,width:150}],codeClass:t.SVC_NAME,layoutType:e,columnConfig:t};let x=[];n&&n instanceof Function&&(n=n());const E=n||this.getItemDropDownDataSource(t.FUNCTION_ID,t.ITEM_CODE)||[];if(i.length>0&&o.length>0){const I=i.split(","),v=o.split(",");if(I.length!==v.length)this.messageError("[DisplayColumns] array length need same to [DisplayCaptions] array length!");else{const A=[];for(let B=0;B<I.length;B++){const O={field:I[B],title:v[B].trim(),width:150};G.toNumber(a[B])>0&&(O.width=G.toNumber(a[B])),O.title.startsWith("$t(")&&O.title.endsWith(")")?O.title=G.$t(O.title.substring(3,O.title.length-1)):s&&(O.title=G.$t(O.title)),A.push(O),h.push(O.field)}c.trim().length>0&&d.trim().length>0?(m=c.trim(),_=d.trim()):(u>=0&&u<I.length?m=I[u]:m=I[0],f>=0&&u<I.length?_=I[f]:I.length>1?_=I[1]:_=I[0]),T.columns=A,T.dataValueField=m,T.dataTextField=_}}else if(E.length>0){const I=Object.keys(E[0]);(E[0][m]===void 0||E[0][_]===void 0)&&(E[0][m]===void 0&&(m=I[0]),E[0][_]===void 0&&(I.length>1?_=I[1]:_=I[0])),T.columns=t.VALUE_VISIBLE==="1"?[{field:m,title:p,width:G.toNumber(a[0])||150},{field:_,title:g,width:G.toNumber(a[1])||150}]:[{field:_,title:g,width:G.toNumber(a[0])||150}],t.VALUE_VISIBLE==="1"&&h.push(m)}else c.trim().length>0&&d.trim().length>0&&(m=c.trim(),_=d.trim(),T.columns=t.VALUE_VISIBLE==="1"?[{field:m,title:p,width:G.toNumber(a[0])||150},{field:_,title:g,width:G.toNumber(a[1])||150}]:[{field:_,title:g,width:G.toNumber(a[0])||150}],t.VALUE_VISIBLE==="1"&&h.push(m));t.ADD_EMPTY_ITEM==="1"&&(T.optionLabel="—-—"),t.FORMAT_TYPE==="Custom"&&((S=t.FORMAT_STRING)==null?void 0:S.trim().length)>0?T.displayFormat=(w=t.FORMAT_STRING)==null?void 0:w.trim():t.DISPLAY_POSITION===t.VALUE_POSITION&&G.toNumber(t.VALUE_POSITION)>=0||t.DISPLAY_MEMBER===t.VALUE_MEMBER&&t.VALUE_MEMBER.trim().length>0?T.displayFormat="{0}":t.VALUE_VISIBLE==="1"?T.displayFormat="{0}|{1}":T.displayFormat="{1}",E&&E instanceof Array&&(x=E.map(I=>({...I,value:I[m],label:I[_]}))),h.push(_),T.autoWidth=!0,T.dataSource=x,T.dataValueField=m,T.dataTextField=_;let D=0;return T.columns.forEach(I=>{D+=I.width}),T.dropDownWidth=D,T}filterDropDownCascaderDataSource(e,t,n){const i=[];if(Array.isArray(n)&&n.length>0?i.push(...n):G.toString(n).length>0&&i.push(G.toString(n)),e&&e.length>0&&t.length>0&&i.length>0)if(t.toLowerCase().startsWith("script:")&&t.length>7){t=G.getSystemFormatString(t.substring(7)).replaceAll("{0}",`${i.join(",")}`);const o=[];return e.forEach(a=>{G.checkExpressionValid(a,t)&&o.push(a)}),o}else{const o=t.indexOf(" like ")>=0?"like":t.indexOf("<>")>=0?"<>":"=",a=t.split(o);if(a.length===2){const s=a[0].trim().toUpperCase(),c=a[1].trim().toUpperCase(),d=[];return e.forEach(u=>{const f=G.toString(u[s]).trim();if(f.length>0){for(let h=0;h<i.length;h++)if(o==="like"){if(c.startsWith("'%")&&c.endsWith("%'")&&f.indexOf(i[h])>=0){d.push(u);break}else if(c.startsWith("'%")&&f.endsWith(i[h])){d.push(u);break}else if(f.startsWith(i[h])){d.push(u);break}}else if(o==="<>"){if(f!==i[h]){d.push(u);break}}else if(f===i[h]){d.push(u);break}}}),d}}return e}setDropDownCascaderDataSource(e,t,n){this._dropDownCascader[e+t]&&this._dropDownCascader[e+t].length>0&&this._dropDownCascader[e+t].forEach(o=>{if(o.FUNCTION_TYPE==="F"){const a=this._dropDownBindSource[o.FUNCTION_ID][o.ITEM_CODE].dataSource,s=o.FORM_FILTER.trim(),c=this.filterDropDownCascaderDataSource(a,s,n);o.dataSource=c,this.reloadDropDownDataSource(o.FUNCTION_ID,o.ITEM_CODE,o.dataSource)}})}getDropDownCascaderDataTable(e,t,n,i){let o;return e.trim().length>0&&t.trim().length>0&&n.trim().length>0&&i.trim().length>0&&this._dropDownCascader[n.trim()+i.trim()]&&this._dropDownCascader[n.trim()+i.trim()].length>0&&this._dropDownCascader[n.trim()+i.trim()].every(a=>a.FUNCTION_ID===e.trim()&&a.ITEM_CODE===t.trim()?(o=a.dataSource,!1):!0),o}getGridStyleConfig(e){return this._gridStyleInfo[e]}setDropDownAutoFillFieldForLayout(e,t,n){var a,s;n&&n instanceof Array&&(n=n.join(","));const i=this.getSingleItemConfigInfo(e,t),o=((a=i==null?void 0:i.extendOptions)==null?void 0:a.autoFillColumns)||((s=i.AUTOFILL_COLS)==null?void 0:s.trim())||"";if(o.trim().length>0){const c=o.split(";").filter(u=>u.trim().length>0),d=this.getDropDownSelectedData(e,t,n);c.forEach(u=>{if(u.trim().length>0){const f=u.split("="),h=f[0].trim().toUpperCase();let p=f[0].trim().toUpperCase();if(f.length>1&&(p=f[1].trim().toUpperCase()),d&&d instanceof Array){let g="";d.forEach(m=>{const _=G.toString(m[h]).trim();_.length>0&&(g=g.length===0?_:g+","+_)}),this.setControlValue(e,p,g)}else this.setControlValue(e,p,d[h])}})}}setDropDownAutoFillFieldsForGrid(e,t,n){var o,a,s,c,d,u,f,h,p,g,m,_;const i=this.getGrid(e);if(i&&((o=n==null?void 0:n.data)!=null&&o.uid)){const T=(a=i.gridOptions.context)==null?void 0:a.configId,x=(c=(s=i.gridOptions.context)==null?void 0:s.viewConfig)==null?void 0:c.AUTO_SELECT_MODE,E=this.getGridColumn(e,t);if((u=(d=E==null?void 0:E.colDef)==null?void 0:d.context)!=null&&u.columnConfig){const D=(h=(f=E==null?void 0:E.colDef)==null?void 0:f.context)==null?void 0:h.columnConfig,k=((p=D==null?void 0:D.extendOptions)==null?void 0:p.autoFillColumns)||((g=D.AUTOFILL_COLS)==null?void 0:g.trim())||"";let P=[],b={};if(k.trim().length>0&&D.COLUMN_EDIT!=="3"&&(P=k.split(";"),n.data[t]&&(b=this.getDropDownSelectedData(T,t,n.data[t])),P.forEach(S=>{if(S.trim().length>0){const w=S.trim().split("="),I=w[0].toUpperCase().trim();let v=w[0].toUpperCase().trim();if(w.length>1&&(v=w[1].toUpperCase().trim()),b&&b instanceof Array){let A="";b.forEach(B=>{const O=G.toString(B[I]).trim();O.length>0&&(A=A.length===0?O:A+","+O)}),n.data.set(v,A)}else n.data.set(v,b[I]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[v,nt.GridCheckColumnFieldName]})}})),n.isSelected()&&D.MULTI_ROW_EDIT==="1"&&x!=="1"&&x!=="3"){const S=this.getGridOptions(T,"multiRowEdit");S!==!1&&S!=="0"&&(((_=(m=i.gridOptions.context)==null?void 0:m.options)==null?void 0:_.multiRowEditType)==="all"?i.gridOptions.api.foreachLeafNode(w=>{var I;w!=null&&w.selected&&((I=w.data)!=null&&I.uid)&&w.data.uid!==n.data.uid&&P.forEach(v=>{if(v.trim().length>0){const A=v.trim().split("="),B=A[0].toUpperCase().trim();let O=A[0].toUpperCase().trim();if(A.length>1&&(O=A[1].toUpperCase().trim()),b&&b instanceof Array){let M="";b.forEach(R=>{const H=G.toString(R[B]).trim();H.length>0&&(M=M.length===0?H:M+","+H)}),w.setDataValue(O,M)}else w.setDataValue(O,b[B]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[O,nt.GridCheckColumnFieldName]})}})}):i.gridOptions.api.forEachNodeAfterFilter(w=>{var I;w!=null&&w.selected&&((I=w.data)!=null&&I.uid)&&w.data.uid!==n.data.uid&&P.forEach(v=>{if(v.trim().length>0){const A=v.trim().split("="),B=A[0].toUpperCase().trim();let O=A[0].toUpperCase().trim();if(A.length>1&&(O=A[1].toUpperCase().trim()),b&&b instanceof Array){let M="";b.forEach(R=>{const H=G.toString(R[B]).trim();H.length>0&&(M=M.length===0?H:M+","+H)}),w.setDataValue(O,M)}else w.setDataValue(O,b[B]);i.gridOptions.api.refreshCells({rowNodes:[n],columns:[O,nt.GridCheckColumnFieldName]})}})}))}}}}addDropDownCode(e,t,n,i="push"){var o,a;if((e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0&&(n==null?void 0:n.length)>0&&this._dropDownBindSource[e.trim()]&&this._dropDownBindSource[e.trim()][t.trim()]){const s=this._dropDownBindSource[e.trim()][t.trim()];if(s.dataSource!==void 0&&s.dataSource instanceof Array){i==="unshift"?s.dataSource.unshift(...n):s.dataSource.push(...n);const c=this.getSingleItemConfigInfo(e,t);if(c.FUNCTION_TYPE==="F")this._dropDownRefreshKey[e][t]=G.guid(),this.setControlEmptyValue(e,t);else if(c.FUNCTION_TYPE==="G"||c.FUNCTION_TYPE==="P"){const d=this.getGridColumn(e,t);if(d!=null&&d.colDef){this.setGridColumnDropdown(e,d.colDef,s.dataSource,(o=d.colDef.context)==null?void 0:o.valueField,(a=d.colDef.context)==null?void 0:a.textField,s.displayFormat);const u=this.getGridApi(e);u==null||u.refreshCells({columns:[d.colId]})}}}}}async reloadDropDownDataSource(e,t,n){var i,o,a;if((e==null?void 0:e.trim().length)>0&&(t==null?void 0:t.trim().length)>0){const s=this.getSingleItemConfigInfo(e,t);if(s){let c=[];if(n&&n instanceof Function&&(n=n()),(n==null?void 0:n.data)instanceof Array)c=n.data;else if((n==null?void 0:n.getMappedRows)instanceof Function)c=n.getMappedRows();else if(n instanceof Array)c=n;else if(s.ORIGIN_CODE==="2"&&s.SVC_NAME.trim().length>0){const u=rt.buildMap([{FUNCTION_ID:s.SVC_NAME,COMPANY_CODE:nt.CompanyCode}],"DATA_SOURCE"),f=await this.callServiceEx(nt.dynamicQueryService,u);f.sysFlag>=0&&(c=f.getMapData(0))}const d=this.setDropDownBindOptions(s.FUNCTION_TYPE,s,c);if(this._dropDownBindSource[e.trim()]=this._dropDownBindSource[e.trim()]||{},this._dropDownBindSource[e.trim()][t.trim()]=d,s.FUNCTION_TYPE==="F"){const u=this.getControlValue(e,t);u&&!((i=d==null?void 0:d.dataSource)!=null&&i.some(f=>f[d.dataValueField]===u))&&this.setControlEmptyValue(e,t)}else if(s.FUNCTION_TYPE==="G"||s.FUNCTION_TYPE==="P"){const u=this.getGridColumn(e,t);if(u!=null&&u.colDef){this.setGridColumnDropdown(e,u.colDef,c,(o=u.colDef.context)==null?void 0:o.valueField,(a=u.colDef.context)==null?void 0:a.textField,d.displayFormat);const f=this.getGridApi(e);f==null||f.refreshCells({columns:[u.colId]})}}this._dropDownRefreshKey[e][t]=G.guid()}}}createDataSet(){var n,i,o;const e=[];let t="";this._configInfo.TSI00GRIDVIEW.forEach(a=>{var s,c,d;if(((s=a.TABLE_NAME)==null?void 0:s.trim().length)>0&&((c=a.DATASET_NAME)==null?void 0:c.trim().length)>0){const u={};a.FUNCTION_TYPE==="T"&&((d=a.CURRENT_NODE_DESC)==null?void 0:d.trim().length)>0&&a.FATHER_NODE_DESC.trim().length>0&&(u.hierarchy={primaryField:a.CURRENT_NODE_DESC.trim(),parentField:a.FATHER_NODE_DESC}),this.createDataTable(a.TABLE_NAME.trim(),u)&&e.push({tableName:a.TABLE_NAME.trim()}),t=a.DATASET_NAME.trim()}}),((i=(n=this._configInfo)==null?void 0:n.TSI00DATARELATION)==null?void 0:i.length)>0&&this._configInfo.TSI00DATARELATION.forEach(a=>{e.findIndex(s=>s.tableName===a.RESERVE1)>=0&&e.findIndex(s=>s.tableName===a.RESERVE7)>=0&&(this._formDataSet.relations[a.RELATION_NAME]=this._formDataSet.relations[a.RELATION_NAME]||[],this._formDataSet.relations[a.RELATION_NAME].push({ParentTable:a.RESERVE1,ChildTable:a.RESERVE7,ParentColumn:a.RESERVE2,ChildColumn:a.RESERVE8}))}),(o=this._formDataSet)==null||o.setName(t)}createDataTable(e,t){var o,a,s,c,d,u;let n;const i={...t};if(e.trim().length>0&&!this._formDataSet.dataTables[e.trim()]){const f={};((o=this._configInfo.TSI00DATATABLE)==null?void 0:o.length)>0&&this._configInfo.TSI00DATATABLE.forEach(h=>{if(h.TABLE_NAME===e.trim()){const p={name:h.COL_NAME,caption:h.COL_CAPTION,maxLength:h.MAX_LENGTH,camelCaseName:G.camelCase(h.COL_NAME)};switch(h.DATA_TYPE.toLowerCase()){case"2":case"decimal":case"numeric":case"int":case"integer":case"bigint":case"smallint":case"number":p.type="number",p.defaultValue=G.toNumber(h.DEFAULT_VALUE);break;case"3":case"date":case"datetime":p.type="datetime",p.defaultValue=G.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;case"4":case"bool":case"boolean":p.type="boolean",p.defaultValue=G.toBoolean(h.DEFAULT_VALUE);break;case"5":case"time":p.type="time",p.defaultValue=G.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;default:p.type="string",p.defaultValue=G.getSystemFormatString(h.DEFAULT_VALUE).trim();break}f[h.COL_NAME]=p}}),Object.keys(f).length>0&&(i.schema=f,n=new Cn(i),this._formDataSet.addDataTable(e.trim(),n))}else n=(a=this._formDataSet)==null?void 0:a.dataTables[e.trim()],i.schema=(s=n==null?void 0:n.options)==null?void 0:s.schema,i.hierarchy=i.hierarchy||((c=n==null?void 0:n.options)==null?void 0:c.hierarchy);return(d=t==null?void 0:t.hierarchy)!=null&&d.primaryField&&((u=t==null?void 0:t.hierarchy)!=null&&u.parentField)&&(i.schema[t.hierarchy.primaryField]===void 0&&console.error(`ER: Hierarchy DataTable's PrimaryField [${t.hierarchy.primaryField}] not exists!`),i.schema[t.hierarchy.parentField]===void 0&&console.error(`ER: Hierarchy DataTable's ParentField [${t.hierarchy.parentField}] not exists!`)),n||console.error(`ER: DataTable [${e}] creation failed!`),n}getTableName(e){var t;return(t=this._formDataSet)==null?void 0:t.getTableName(e)}getBindingTableName(e){var n;let t="";return(e==null?void 0:e.trim().length)>0&&((n=this._formBindingRelation)!=null&&n[e.trim()])&&(t=this._formBindingRelation[e.trim()]),t}setBindingTableName(e){var n;let t="";if((e==null?void 0:e.trim().length)>0){e=e.trim();const i=this.getSingleViewConfigInfo(e);i&&i.TABLE_NAME&&i.TABLE_NAME.trim().length>0&&((n=this._formDataSet)!=null&&n.contains(i.TABLE_NAME.trim()))&&(t=i.TABLE_NAME.trim(),this._formBindingRelation[e]=t)}return t}getBindingTable(e){var i;let t;const n=this.getBindingTableName(e);return n&&n.trim().length>0&&(t=(i=this._formDataSet)==null?void 0:i.dataTables[n]),t}getBindingTableAsDataMap(e){let t;const n=this.getBindingTable(e);return n&&n instanceof Cn&&(t=n.data(),t&&(t=Cn.convertDataType(t,n,"weakly"))),rt.buildMap(t||{},"Table0")}hasDataChange(...e){let t=!1;return e.length===0?e=Object.keys(this._formBindingRelation):e.length===1&&(e=e[0].split(",")),e.forEach(n=>{const i=this.getBindingTable(n);if(i&&i instanceof Cn)if(!t)t=i.hasChanges();else return t}),t}cancelGridChange(e){var n,i;const t=this.getGrid(e);if(t){const o=(i=(n=t.gridOptions)==null?void 0:n.context)==null?void 0:i.bindingSource;o&&o instanceof Cn&&o.cancelChanges()}return this}mergeData(e,t=!0,...n){var i,o,a;if(this.isNullOrEmpty(n)?n=Object.keys(this._formBindingRelation):n.length===1&&n[0]&&typeof n[0]=="string"&&(n=n[0].split(",")),n.length>0){if(n.length===1&&n[0].trim().length>0){const s=this.getBindingTableName(n[0]);(s==null?void 0:s.trim().length)>0&&(e instanceof rt?e.contains(s.trim())?(i=this._formDataSet)==null||i.mergeData(s.trim(),e.getMapData(s.trim()),t):Object.keys(e).length>0&&((o=this._formDataSet)==null||o.mergeData(s.trim(),e.getMapData(),t)):e instanceof Array&&e&&e.length>0&&((a=this._formDataSet)==null||a.mergeData(s.trim(),e,t)),this.autoBestFit(n[0]))}else if(e instanceof rt){const s={};n.forEach(c=>{var u;const d=this.getBindingTableName(c);(d==null?void 0:d.trim().length)>0&&e.contains(d.trim())&&(s[d]||((u=this._formDataSet)==null||u.mergeData(d.trim(),e.getMapData(d.trim()),t),s[d]=!0),this.autoBestFit(c))})}}return this}checkFormChanged(...e){return new Promise(t=>{this.hasDataChange(...e)?this.messageConfirm(G.$t("ERX.ContinueToOperate")||"继续将丢失未保存的更改,是否继续?").then(n=>{t(n)}).catch(()=>{t(!1)}):t(!0)})}addRowToGrid(e,t=!0,n="default",i=!1){var s,c,d,u,f,h;let o;const a=this.getGrid(e);if((s=a==null?void 0:a.gridOptions.context)!=null&&s.bindingSource){a.gridOptions.context.options=a.gridOptions.context.options||{},a.gridOptions.context.options.autoCheckNewRow=i;let p={};n==="default"&&(n=this.getGridOptions(e,"insertAtTop")||"default"),n==="default"&&(n=((u=(d=(c=a==null?void 0:a.gridOptions)==null?void 0:c.context)==null?void 0:d.options)==null?void 0:u.insertAtTop)||"default");const g=this.getGridOptions(e,"autoGuidField");(t===!0||(t==null?void 0:t.setDefaultValue)===!0)&&(p=this.getGridConfigDefaultValues(e)||{}),this._customDefaultValues[e]&&(p={...p,...this._customDefaultValues[e]}),t!=null&&t.data&&(p={...p,...t.data});const m=(f=a.gridOptions.context)==null?void 0:f.bindingSource;if(n===!0||n==="top")o=m.insert(0,p,g);else if(n==="afterCurrent"||n==="beforeCurrent"){const _=this.getGridCurrentRow(e);if(_){let T=m.indexOf(_);T>=0&&T<m.rowCount&&n==="afterCurrent"?T=T+1:T>0&&n==="beforeCurrent"&&(T=T),o=m.insert(T,p,g)}else o=m.add(p,g)}else typeof n=="number"&&n>=0?o=m.insert(n,p,g):o=m.add(p,g);(h=a==null?void 0:a.gridOptions)!=null&&h.treeData&&(o[nt.TreeHierarchyFieldName]=[G.guid()])}return o}addCopyRowToGrid(e,t="default",n=!1){var a,s,c;const i=this.getGrid(e);let o;if(i){t==="default"&&(t=this.getGridOptions(e,"insertAtTop")||"default"),t==="default"&&(t=((c=(s=(a=i==null?void 0:i.gridOptions)==null?void 0:a.context)==null?void 0:s.options)==null?void 0:c.insertAtTop)||"default"),(i==null?void 0:i.gridOptions.api).stopEditing();const u=this.getGridSelectRows(i);if(u.length===0){const f=this.getGridCurrentRow(i);f&&u.push(f)}if(u.length===0)o=[this.addRowToGrid(e,!0,t,n)];else{if(this._customDefaultValues[e])for(let h=0;h<u.length;h++)u[h]={...u[h],...this._customDefaultValues[e]};const f=this.getGridBindingTable(e);if(f){let h=-1;t==="top"||t===!0?h=0:t==="afterCurrent"||t==="default"?(h=f.indexOf(u[u.length-1]),h<f.rowCount&&(h=h+1)):t==="beforeCurrent"?(h=f.indexOf(u[0]),h>0&&(h=h-1)):typeof t=="number"&&t>=0&&(h=t),o=f.import(u,h,!0,this.getGridOptions(e,"autoGuidField"))}}}return o}importRowsToGrid(e,t,n=!1,i=!0){var s,c;let o;const a=this.getGrid(e);if((s=a==null?void 0:a.gridOptions.context)!=null&&s.bindingSource){a.gridOptions.context.options=a.gridOptions.context.options||{},a.gridOptions.context.options.autoCheckNewRow=n;const d=(c=a.gridOptions.context)==null?void 0:c.bindingSource;d&&(o=d.import(t,void 0,i))}return o}getGridAggregates(e){var n;let t;if(e){const i=this.getGrid(e);if(i){const o=i.gridOptions.api.getModel();t=(n=o==null?void 0:o.rootNode)==null?void 0:n.aggData}}return t}getModelFromGridOrLayout(e,t,n=!1,i){const o=this.getBindingTable(e);return this.getModelFromDataTable(o,t,n,i)}getModelFromDataTable(e,t,n=!1,i){let o;return typeof e=="string"&&e.trim().length>0&&(e=this.getBindingTable(e)),e&&e instanceof Cn&&(t&&t.trim().length>0?o=e.get(t.trim()):(o=e.at(0),o=l.reactive(o))),o&&(n instanceof Function?o=n(o)||o.toJSON():o=n?o.toJSON():o,i&&Object.keys(i).forEach(a=>{o[a]=i[a]})),o}getGridDataCount(e){let t=0;const n=this.getGridConfigId(e);if(n){const i=this.getBindingTable(n);i&&i instanceof Cn&&(t=i.totalCount())}return t}getModelFromDataTableById(e,t,n=!1){var o;let i;return typeof e=="string"&&e.trim().length>0&&this._formBindingRelation[e.trim()].trim().length>0&&(e=(o=this._formDataSet)==null?void 0:o.dataTables[this._formBindingRelation[e.trim()]]),e&&e instanceof Cn&&t&&t.trim().length>0&&(i=e.get(t.trim()),i&&(n instanceof Function?i=n(i)||i.toJSON():i=n?i.toJSON():i)),i}addModelToLayout(e,t,n){let i;if((e==null?void 0:e.trim().length)>0){const o=this.getBindingTable(e.trim());if(o){o instanceof Cn&&(i=o.add({}));const a=this.getRelationConfigIdsByTableName(o.tableName);t&&this.setModelDefalutValue(i,a),i=this.getLayoutBindModel(e)}else console.error("ER: Attempting to add model to a non-existent dataTable, configId: "+e)}return i}getModelFields(e){var t;return(t=e==null?void 0:e.options)==null?void 0:t.schema}getControlName(e,t,n){let i="antInput";switch(e){case"F1":case"G3":case"T3":i="antInputGroup";break;case"FB":i="antRadioGroup";break;case"FJ":i="erRadioGroup";break;case"F6":case"F7":case"FA":case"FC":case"FP":case"G1":case"G2":case"GP":case"T1":case"T2":case"TP":i="erSelect";break;case"FD":i="erMultiSelect";break;case"F3":case"G4":case"GD":case"T4":case"TD":i="antMultiSelect";break;case"FL":i="erTreeSelect";break;case"FH":i="erMultiTreeSelect";break;case"F2":case"F9":case"FG":i="antInputNumber";break;case"F4":i="antCheckbox";break;case"FK":i="erCheckboxGroup";break;case"FW":i="antSwitch";break;case"FM":i="scriptEditor";break;case"F5":G.toNumber(n==null?void 0:n.MAX_LENGTH)===2?i="antTimePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===4?t.toLowerCase()==="hh:mm"?i="antTimePicker":i="antYearPicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===6?t.toLowerCase()==="hh:mm:ss"?i="antTimePicker":i="antMonthPicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===8?i="antDatePicker":i="antDateTimePicker";break;case"FR":G.toNumber(n==null?void 0:n.MAX_LENGTH)===4||t.toLowerCase()==="yyyy"?i="antYearRangePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===6||t.toLowerCase()==="yyyy-mm"||t.toLowerCase()==="yyyy/mm"||t.toLowerCase()==="yyyymm"?i="antMonthRangePicker":G.toNumber(n==null?void 0:n.MAX_LENGTH)===8||t.toLowerCase()==="yyyy-mm-dd"||t.toLowerCase()==="yyyy/mm/dd"||t.toLowerCase()==="yyyymmdd"?i="antDateRangePicker":i="antDateTimeRangePicker";break;case"F8":case"G8":case"T8":i="antTextarea";break;case"FE":case"G5":case"T5":i="erMemoEditor";break;case"FN":i="antButton";break;case"FZ":case"GZ":case"TZ":i="antInputColor";break;case"FS":i="label";break;case"FT":i="antDivider";break;default:i="antInput";break}return i}resetValidator(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++){if(t[n].trim().length===0)continue;const i=this.getLayoutBindForm(t[n]);i==null||i.clearValidate()}}getLayoutLabelSpan(e,t){return G.jQuery("#"+this._formId+e+t+"_span")}getLayoutJqueryElement(e,t){let n;return n=G.jQuery("#"+this._formId+e+t),n===void 0&&(n=G.jQuery("#"+e)),n}autoBestFit(e){var n,i,o,a,s;const t=this.getGrid(e);if(t&&this.isGridOnScreen(t)){const c=(i=(n=t.gridOptions.columnApi)==null?void 0:n.columnModel)==null?void 0:i.gridColumns;(c==null?void 0:c.length)>0&&((s=(a=(o=t==null?void 0:t.gridOptions)==null?void 0:o.context)==null?void 0:a.viewConfig)==null?void 0:s.BESTFIT)==="1"&&c.forEach(d=>{d.visible&&!d.colDef.suppressSizeToFit&&t.gridOptions.columnApi.autoSizeColumn(d)})}return this}getGrid(e){var n,i;let t;return e&&typeof e=="string"&&this._gridInstanceInfo[e]!==void 0&&(e=this._gridInstanceInfo[e]),(n=e==null?void 0:e.gridOptions)!=null&&n.api&&((i=e==null?void 0:e.gridOptions)!=null&&i.columnApi)&&(t=e),t}getDetailGrid(e,t){const n=this.getGrid(e);if(n&&t){const i=(typeof t=="string"?t:t==null?void 0:t.uid)||"";if(i.trim().length===0)return;const o=n.gridOptions.api.getDetailGridInfo(`detail_${i}`);if(o)return{gridOptions:{...n.gridOptions.detailGridOptions,...o}}}}getGridApi(e){var t,n;return(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.api}isGridOnScreen(e){const t=this.getGrid(e);return t?G.isGridOnScreen(t):!1}getGridColumnApi(e){var t,n;return(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.columnApi}getGridConfig(e){var t,n,i;return(i=(n=(t=this.getGrid(e))==null?void 0:t.gridOptions)==null?void 0:n.context)==null?void 0:i.viewConfig}getGridColumn(e,t){const n=this.getGrid(e);return cr.getGridColumn(n,t)}getGridColumnDef(e,t){const n=this.getGrid(e);return cr.getGridColumnDef(n,t)}showGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){const o=[];i.forEach(a=>{o.push({colId:a,hide:!1})}),n.gridOptions.columnApi.applyColumnState({state:o})}}return this}hideGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){const o=[];i.forEach(a=>{o.push({colId:a,hide:!0})}),n.gridOptions.columnApi.applyColumnState({state:o})}}return this}showGridCheckColumn(e){return this.showOrHideGridCheckColumn(e,"show")}hideGridCheckColumn(e){return this.showOrHideGridCheckColumn(e,"hide")}showOrHideGridCheckColumn(e,t="default"){var i,o,a,s;const n=this.getGrid(e);if((i=n==null?void 0:n.gridOptions)!=null&&i.api){const c=n.gridOptions.api,d=c.getColumnDef(nt.GridCheckColumnFieldName);d&&(t==="hide"?(d.checkboxSelection=void 0,d.headerCheckboxSelection=void 0):(t==="show"||((o=n.gridOptions.context)==null?void 0:o.viewConfig.SHOW_SELECTION)==="1")&&(d.checkboxSelection=u=>!u.node.footer,this.getGridOptions((s=(a=n.gridOptions)==null?void 0:a.context)==null?void 0:s.configId,"RowSelection",!0)==="multiple"?d.headerCheckboxSelection=!0:d.headerCheckboxSelection=void 0),c==null||c.redrawRows(),c==null||c.refreshHeader())}return this}setGridSelectMode(e,t,n="none"){var o,a;const i=this.getGrid(e);return i&&(this.setGridOptions((a=(o=i.gridOptions)==null?void 0:o.context)==null?void 0:a.configId,"RowSelection",t,!0),this.setGridColumnOptions(i,s=>{var c,d,u,f,h;s.colId===nt.GridCheckColumnFieldName&&(n==="show"||n==="hide"||t==="multiple")&&(n==="hide"?(s.checkboxSelection=void 0,s.headerCheckboxSelection=void 0):t==="multiple"?(s.checkboxSelection=p=>!p.node.footer,s.headerCheckboxSelection=n==="show"||((c=i.gridOptions.context)==null?void 0:c.viewConfig.SHOW_SELECTION)==="1",s.headerCheckboxSelectionFilteredOnly=((u=(d=i.gridOptions.context)==null?void 0:d.options)==null?void 0:u.headerCheckboxSelectionFilteredOnly)??!0,s.headerCheckboxSelectionFilteredOnly!==!0?s.headerCheckboxSelectionCurrentPageOnly=(h=(f=i.gridOptions.context)==null?void 0:f.options)==null?void 0:h.headerCheckboxSelectionCurrentPageOnly:delete s.headerCheckboxSelectionCurrentPageOnly):t==="single"&&(s.headerCheckboxSelection=void 0))})),this}setGridRowDrag(e,t="default"){var i,o,a,s;const n=this.getGrid(e);if((i=n==null?void 0:n.gridOptions)!=null&&i.api){const d=n.gridOptions.api.getColumnDef(nt.GridCheckColumnFieldName);d&&(t===!1?(d.rowDrag=void 0,(o=n==null?void 0:n.gridOptions)==null||o.columnApi.setColumnWidth(d.colId,55)):(t===!0||(a=n.gridOptions.context)!=null&&a.allowDragRow)&&(n.gridOptions.context.allowDragRow=!0,(s=n==null?void 0:n.gridOptions)==null||s.columnApi.setColumnWidth(d.colId,75),d.rowDrag=u=>{var f;return((f=u.context)==null?void 0:f.allowDragRow)&&!u.node.group&&!u.node.footer}),n.gridOptions.rowDragManaged=t),n.gridOptions.api.redrawRows()}return this}addGridColumn(e,t,n){const i=this.getGrid(e);if(i){let o;if(t instanceof Array?o=t:o=[t],o.length>0){const a=i.gridOptions.context.bindingSource,s=i.gridOptions.api.getColumnDefs()||[],c=[];o.forEach(u=>{var f,h,p,g;if(((f=u.field)==null?void 0:f.trim().length)>0){u.field=u.field.trim();const m={name:u.field,capiton:u.headerName,defaultValue:u.defaultValue,type:u.dataType||u.type||"string",maxLength:u.maxLength||-1};a.addField(m),u.colId=u.colId||u.field,i.gridOptions.api.getColumnDef(u.colId)||(u.headerComponentParams={template:`${this.getGridHeaderTemplate({color:u.headerTextColor,backColor:u.headerBackColor,fontSize:u.fontSize,title:u.headerName||u.title||u.caption})}`},u.headerClass=()=>{var T,x,E,D,k;let _="er-grid-header-align-center";return((T=u.headerAlignment)==null?void 0:T.toLowerCase())==="near"||((x=u.headerAlignment)==null?void 0:x.toLowerCase())==="left"?_="er-grid-header-align-left":(((E=u.headerAlignment)==null?void 0:E.toLowerCase())==="far"||((D=u.headerAlignment)==null?void 0:D.toLowerCase())==="right")&&(_="er-grid-header-align-right"),u.required&&((k=u.requiredCondition)==null?void 0:k.trim().length)>0?_=_+" er-grid-header-maroon-star":u.required&&(_=_+" er-grid-header-red-star"),_},u.editable=u.editable===void 0?!0:u.editable,u.autoHeaderHeight=u.autoHeaderHeight===void 0?!0:u.autoHeaderHeight,u.enableRowGroup=u.enableRowGroup===void 0?!0:u.enableRowGroup,typeof u.editable!="function"&&(u.context=u.context||{},u.context.editable=u.editable,u.headerTooltip=u.headerName||u.title||u.caption,u.editable=_=>{var T,x;return((T=_.context)==null?void 0:T.editable)&&((x=_.colDef.context)==null?void 0:x.editable)&&!_.node.rowPinned}),u.filter=u.filter===void 0?"agSetColumnFilter":u.filter,u.filterParams={excelMode:(g=(p=(h=i.gridOptions)==null?void 0:h.context)==null?void 0:p.options)==null?void 0:g.excelMode,showTooltips:!0},c.push(u))}});let d=-1;n&&n.trim().length>0&&(d=s.findIndex(u=>u.colId===n)),d!==-1?s.splice(d,0,...c):s.push(...c),i.gridOptions.api.setColumnDefs(s)}}return this}removeGridColumn(e,t){const n=this.getGrid(e);if(n){let i;if(t instanceof Array?i=t:i=t.split(","),i.length>0){let o=n.gridOptions.api.getColumnDefs()||[];o=o.filter(a=>!i.includes(a.colId)),n.gridOptions.api.setColumnDefs(o)}}return this}getGridColumnFields(e,t="string"){var o,a,s;const n=this.getGrid(e);let i=t==="Array"?[]:void 0;if((a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId){const c=this.getConfigInfo(n.gridOptions.context.configId);((s=c==null?void 0:c.TSI00GRIDCOLUMN)==null?void 0:s.length)>0&&c.TSI00GRIDCOLUMN.forEach(d=>{d.FIELD_NAME.trim().length>0&&d.UNBOUND_TYPE==="0"&&(t==="Array"?i.push(d.FIELD_NAME.trim()):i=i?i+","+d.FIELD_NAME.trim():d.FIELD_NAME.trim())})}return i}setGridEnable(e,t){var i,o,a;const n=this.getGrid(e);return(i=n==null?void 0:n.gridOptions)!=null&&i.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.enable=t,(a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId&&(this.setGridOptions(n.gridOptions.context.configId,"enable",t,!0),document.querySelectorAll(".ag-full-width-row").forEach(c=>{c.style!==void 0&&(t?c.style.pointerEvents="all":c.style.pointerEvents="none")}))),this}setGridEditable(e,t){var i,o,a;const n=this.getGrid(e);return(i=n==null?void 0:n.gridOptions)!=null&&i.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.editable=t,(a=(o=n==null?void 0:n.gridOptions)==null?void 0:o.context)!=null&&a.configId&&this.setGridOptions(n.gridOptions.context.configId,"editable",t,!0)),this}setGridIndicator(e,t,n){if(e&&t&&Object.keys(t).length>0){const i=this.getGrid(e);setTimeout(()=>{var o,a,s,c,d,u,f;if((o=i==null?void 0:i.gridOptions)!=null&&o.api&&((s=(a=i==null?void 0:i.gridOptions)==null?void 0:a.context)!=null&&s.bindingSource)){const h=(c=i==null?void 0:i.gridOptions)==null?void 0:c.api,g=((u=(d=i==null?void 0:i.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource).data().find(m=>{for(const _ in t)if(m[_]!==t[_])return!1;return!0});if(g!=null&&g.uid){h.clearFocusedCell();const m=(f=i==null?void 0:i.gridOptions)==null?void 0:f.api.getRowNode(g==null?void 0:g.uid);m&&this.setGridFocusedCell(e,m.rowIndex,nt.GridCheckColumnFieldName,n)}}},250)}return this}setDragAndDropBetweenGrids(e,t,n,i){const o=this.getGrid(e),a=this.getGrid(t);if(!o)return G.error("fromGrid is not found",e),this;if(!a)return G.error("toGrid is not found",t),this;const s=o.gridOptions.api,c=a.gridOptions.api,d=c.getRowDropZoneParams({onDragStop:u=>{var f,h,p,g;if((i==null?void 0:i.preventDefault)!==!0&&((f=o.gridOptions.context)!=null&&f.configId)&&u.nodes.length>0){const m=u.nodes.map(_=>_.data);if(this.deleteGridRows(o.gridOptions.context.configId,!1,m),u.removedRows=m,(h=u.context)!=null&&h.configId){const _=(p=u.context)==null?void 0:p.bindingSource;u.nodes.forEach(T=>{_.isRemoved(T.data.uid)?this.setGridRowState(a,T.data,"unchanged"):this.setGridRowState(a,T.data,"added")})}}u.formGridContext=o.gridOptions.context,(g=i==null?void 0:i.onDragStop)==null||g.call(i,u)}});if(n){s.addRowDropZone(d);const u=s.getRowDropZoneParams({onDragStop:f=>{var h,p,g,m;if((i==null?void 0:i.preventDefault)!==!0&&((h=a.gridOptions.context)!=null&&h.configId)&&f.nodes.length>0){const _=f.nodes.map(T=>T.data);if(this.deleteGridRows(a.gridOptions.context.configId,!1,_),f.removedRows=_,(p=f.context)!=null&&p.configId){const T=(g=f.context)==null?void 0:g.bindingSource;f.nodes.forEach(x=>{T.isRemoved(x.data.uid)?this.setGridRowState(o,x.data,"unchanged"):this.setGridRowState(o,x.data,"added")})}}f.formGridContext=a.gridOptions.context,(m=i==null?void 0:i.onDragStop)==null||m.call(i,f)}});c.addRowDropZone(u)}return this}refreshGridFooterData(e){var n,i,o;const t=this.getGrid(e);if((n=t==null?void 0:t.gridOptions)!=null&&n.api){const a=(i=t==null?void 0:t.gridOptions)==null?void 0:i.api;if(a.getPinnedBottomRowCount()>0){a.refreshClientSideRowModel("aggregate");const s=a.getModel();a.setPinnedBottomRowData([{...(o=s==null?void 0:s.rootNode)==null?void 0:o.aggData,pinndeRowType:"ErGridSummaryFooter"}])}}return this}setLayoutConfigRelationInfo(e,t){return this._layoutConfigRelationInfo[t]=e,this}getConfigIdbyLayoutName(e){return this._layoutConfigRelationInfo[e]&&this._layoutConfigRelationInfo[e].trim().length>0?this._layoutConfigRelationInfo[e].trim():e}getGridConfigId(e){let t="";return e&&(typeof e=="string"&&this._gridInstanceInfo[e]!==void 0?t=e:e.gridOptions&&e.gridOptions.api&&(t=e.gridOptions.gridId)),t}setWidgetInstanceInfo(e,t,n){return this.isNullOrEmpty(e)||(this._widgetInstanceInfo[e.trim()]===void 0&&(this._widgetInstanceInfo[e.trim()]={}),!this.isNullOrEmpty(t)&&n&&(this._widgetInstanceInfo[e.trim()][t.trim()]=n)),this}setControlVisible(e,t,n,i="none"){return!this.isNullOrEmpty(e)&&(n==null?void 0:n.trim().length)>0&&(e=this.getConfigIdbyLayoutName(e),n.split(",").forEach(a=>{a.trim().length>0&&(i==="empty"?this.setControlEmptyValue(e,a):i==="default"&&this.setControlDefalutValue(e,a),this.setLayoutItemOption(e,a.trim(),{visible:t}))})),this}setGridColumnTitle(e,t){if((t==null?void 0:t.length)>0){const n=this.getGrid(e);n&&(t.forEach(i=>{var a;const o=n.gridOptions.columnApi.getColumn(i.colId);if(o!=null&&o.colDef){const s=((a=o.colDef.context)==null?void 0:a.titleInfo)||{};o.colDef.headerComponentParams={template:`${this.getGridHeaderTemplate({...s,...i})}`}}}),n.gridOptions.api.refreshHeader())}return this}setGridColumnOptions(e,t){if(e&&t instanceof Function){const n=this.getGrid(e);if(n){const i=a=>{var s;((s=a==null?void 0:a.children)==null?void 0:s.length)>0&&a.children.forEach(c=>{i(c)}),t(a)},o=n.gridOptions.api.getColumnDefs();o.forEach(a=>{i(a)}),n.gridOptions.api.setColumnDefs(o)}}return this}setGridOptions(e,t,n,i=!1){return e=(e==null?void 0:e.trim())||"",t=(t==null?void 0:t.trim())||"",e.length>0&&t.length>0&&(i?(this._gridReactiveOptions[e]=this._gridReactiveOptions[e]||{},this._gridReactiveOptions[e][t]=n):(this._gridOptions[e]=this._gridOptions[e]||{},this._gridOptions[e][t]=n)),this}getGridOptions(e,t,n=!1){if(e=(e==null?void 0:e.trim())||"",t=(t==null?void 0:t.trim())||"",e.length>0&&t.length>0){if(n&&this._gridReactiveOptions[e])return this._gridReactiveOptions[e][t];if(!n&&this._gridOptions[e])return this._gridOptions[e][t]}}getLayoutExtentedOptions(e){var o,a;let t={};const n=this.getFormSysInfo("LayoutDefaultOptions");n.trim().length>0&&(t={...JSON.parse(n)});const i=this.getConfigInfo(e);if(((o=i==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0){const s=i.TSI00GRIDVIEW[0];if(((a=s.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);t={...t,...c}}}return t}getGridExtentedOptions(e){var o,a;let t={};const n=this.getFormSysInfo("GridDefaultOptions");n.trim().length>0&&(t={...JSON.parse(n)});const i=this.getConfigInfo(e);if(((o=i==null?void 0:i.TSI00GRIDVIEW)==null?void 0:o.length)>0){const s=i.TSI00GRIDVIEW[0];if(((a=s.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);t={...t,...c}}}return t}getDetailGridRenderOptions(e,t,n,i){const o=this.getGridConfigOptions(e,t,n,i),a={context:o==null?void 0:o.context,defaultColDef:o==null?void 0:o.defaultColDef,groupDisplayType:o==null?void 0:o.groupDisplayType,columnDefs:o==null?void 0:o.columnDefs,groupIncludeTotalFooter:o==null?void 0:o.groupIncludeTotalFooter,groupIncludeFooter:o==null?void 0:o.groupIncludeFooter,suppressRowClickSelection:o==null?void 0:o.suppressRowClickSelection,rowSelection:o==null?void 0:o.rowSelection,groupRowRendererParams:o==null?void 0:o.groupRowRendererParams,localeText:ca(),enableRangeSelection:!0,stopEditingWhenCellsLoseFocus:!0,suppressRowTransform:!0,enableRtl:ii(),statusBar:{statusPanels:[{statusPanel:l.markRaw(E4),statusPanelParams:{configId:e,options:t},key:"AggregationPanel",align:"center"},{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]},onCellValueChanged:s=>{var c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof qr){if(((c=s.data.schemaFields[s.colDef.field])==null?void 0:c.type)==="datetime"||((d=s.data.schemaFields[s.colDef.field])==null?void 0:d.type)==="time")s.data[s.colDef.field]=G.getDateTimeByString(s.newValue);else if(((u=s.data.schemaFields[s.colDef.field])==null?void 0:u.type)==="boolean")s.data[s.colDef.field]=s.newValue===!0||s.newValue==="1"||s.newValue==="True"||s.newValue==="true";else if(((f=s.data.schemaFields[s.colDef.field])==null?void 0:f.type)==="number")s.data[s.colDef.field]=G.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const B=s.colDef.context.displayFormat||"",O=G.toString(s.newValue,!0);if(O.length>0){if(B.trim().startsWith("{0}|")&&O.includes("|")){const M=O.split("|")[0];(p=s.colDef.refData)!=null&&p[M]?s.data[s.colDef.field]=M:s.data[s.colDef.field]=""}else if(B.trim().startsWith("{0}-")&&O.includes("-")){const M=O.split("-")[0];(g=s.colDef.refData)!=null&&g[M]?s.data[s.colDef.field]=M:s.data[s.colDef.field]=""}else if(B.trim().endsWith("{0}|")&&O.includes("|")){const M=O.split("|"),R=M[M.length-1];(m=s.colDef.refData)!=null&&m[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(B.trim().endsWith("{0}-")&&O.includes("-")){const M=O.split("-"),R=M[M.length-1];(_=s.colDef.refData)!=null&&_[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(B.length>0){const M=Object.keys(s.colDef.refData);let R="";for(let H=0;H<M.length;H++)if(((T=s.colDef.refData)==null?void 0:T[M[H]])===O){R=M[H];break}s.data[s.colDef.field]=R}}}}s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0,this.setDropDownAutoFillFieldsForGrid({gridOptions:{...s}},s.colDef.colId,s.node),this.DropDownCascader[e+s.colDef.colId]&&this.DropDownCascader[e+s.colDef.colId].forEach(B=>{var O,M,R;if(B.FUNCTION_TYPE&&B.FUNCTION_ID&&B.ITEM_CODE){let H="";const V=s.data[s.colDef.field],N=this.getSingleItemConfigInfo(B.FUNCTION_ID,B.ITEM_CODE),W=this.getItemDropDownDataSource(B.FUNCTION_ID,B.ITEM_CODE);if(s.data[s.colDef.field]){const j=this.filterDropDownCascaderDataSource(W,B.FORM_FILTER,s.data[s.colDef.field]);if((j==null?void 0:j.length)>0){const U=(O=this.DropDownBindSource[B.FUNCTION_ID])==null?void 0:O[B.ITEM_CODE];U.dataValueField&&(V&&j.some(ie=>ie[U.dataValueField]===V)?H=V:(((M=N==null?void 0:N.DEFAULT_VALUE)==null?void 0:M.trim().toLowerCase())==="$first_row$"||((R=N==null?void 0:N.DEFAULT_VALUE)==null?void 0:R.trim().toLowerCase())==="{first_row}")&&(H=j[0][U.dataValueField]))}}B.FUNCTION_TYPE==="F"?this.setControlValue(B.FUNCTION_ID,B.ITEM_CODE,H):B.FUNCTION_ID===e&&(s.data[B.ITEM_CODE]=H)}});let A=(E=(x=s.context)==null?void 0:x.viewConfig)==null?void 0:E.AUTO_SELECT_MODE;if(A==="2"||A==="3")this.checkGridRow(e,s.data.uid);else if(((P=(k=(D=s.colDef)==null?void 0:D.context)==null?void 0:k.columnConfig)==null?void 0:P.MULTI_ROW_EDIT)==="1"&&((b=s.node)!=null&&b.selected)){const B=this.getGridOptions(e,"multiRowEdit");if(B!==!1&&B!=="0"){let O=!1;(t==null?void 0:t.multiRowEditType)==="all"?s.api.forEachLeafNode(M=>{var R;M!=null&&M.selected&&((R=M.data)!=null&&R.uid)&&M.data.uid!==s.data.uid&&(M.setDataValue(s.colDef.field,s.data[s.colDef.field]),O=!0)}):s.api.forEachNodeAfterFilter(M=>{var R;M!=null&&M.selected&&((R=M.data)!=null&&R.uid)&&M.data.uid!==s.data.uid&&(M.setDataValue(s.colDef.field,s.data[s.colDef.field]),O=!0)}),O&&s.api.refreshCells({columns:[nt.GridCheckColumnFieldName]})}}if(((S=s.context)==null?void 0:S.viewConfig.SHOW_FOOTER)==="1"&&((w=s.context.viewType)==null?void 0:w.toLowerCase())!=="cardview"&&((I=s.context.viewType)==null?void 0:I.toLowerCase())!=="card"){const B=s.api.getModel();s.api.setPinnedBottomRowData([{...(v=B==null?void 0:B.rootNode)==null?void 0:v.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[nt.GridCheckColumnFieldName,s.colDef.colId]})}},getRowId:s=>s.data.uid,getRowStyle:s=>this.getRowStyle(s,{showDefaultFooter:!0}),getMainMenuItems:s=>this.getGridMenuItems(s),getContextMenuItems:s=>{const c=this.getGridContextMenuItems(s)||[];return c.length>0&&c.push("separator"),c.push({name:this.$t("ERX.Export")||"导出",action:()=>{var p,g,m,_,T,x;const d=window.getCurrentFormInfo&&window.getCurrentFormInfo(),u=(d==null?void 0:d.formName)||this.FormName,f=(d==null?void 0:d.formCaption)||this.FormCaption,h=s.columnApi.getAllDisplayedColumns().filter(E=>{var D,k,P;return((P=(k=(D=E.colDef)==null?void 0:D.context)==null?void 0:k.columnConfig)==null?void 0:P.ALLOW_PRINT)!=="0"}).map(E=>{var D;return(D=E.colDef)==null?void 0:D.colId});cr.exportGridToExcel(s.api,s.columnApi,{fileName:`${u}-${f}-${G.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,isBandView:((g=(p=o.context)==null?void 0:p.viewType)==null?void 0:g.toLowerCase())==="bandview"||((_=(m=o.context)==null?void 0:m.viewType)==null?void 0:_.toLowerCase())==="band",isShowFooter:((x=(T=o.context)==null?void 0:T.viewConfig)==null?void 0:x.SHOW_FOOTER)==="1",isCheckedRows:!0,columnKeys:h})}}),c},onGridReady:s=>s.api.setPopupParent(document.querySelector("body")),onRowSelected:s=>this.processRowSelectedEvent(s),onRangeSelectionChanged:s=>{if(s!=null&&s.api){const c=s.api.getStatusPanel("AggregationPanel");c&&c.setAggData()}}};return a.context.isDetailGrid=!0,a}getGridEditable(e){var n,i;const t=this.getGrid(e);return((i=(n=t==null?void 0:t.gridOptions)==null?void 0:n.context)==null?void 0:i.editable)===!0}getControl(e,t,n){let i;if(this._widgetInstanceInfo[e.trim()]&&this._widgetInstanceInfo[e.trim()][t.trim()]&&(i=this._widgetInstanceInfo[e.trim()][t.trim()]),i==null)if(n&&n.trim().length>0)i=G.jQuery("#"+this._formId+e+t);else{const o=this.getSingleItemConfigInfo(e,t);if(o.FUNCTION_TYPE&&o.COLUMN_EDIT){const a=o.FUNCTION_TYPE+o.COLUMN_EDIT;n=this.getControlName(a,o.FORMAT_STRING),i=G.jQuery("#"+this._formId+e+t)}}return i}isControlEmptyValue(e,t,n){let i=!0;const o=this.getControlValue(e,t),a=Object.keys(o);for(let s=0;s<a.length;s++)if(o[a[s]]!==null&&String(o[a[s]]).trim().length>0){i=!1;break}return i}setControlConditionProps(e,t,n="ReadOnly",i,o){if(n=(n==null?void 0:n.trim())||"ReadOnly",(e==null?void 0:e.trim().length)>0){const a=e.trim()+"_"+n+"_"+(t==null?void 0:t.trim());let s=[];if(this._controlConditionProps[a])s=this._controlConditionProps[a];else if(this._configInfo.TSI00GRIDCONDITION&&this._configInfo.TSI00GRIDCONDITION.length>0){const c=this.getSingleViewConfigInfo(e==null?void 0:e.trim());if(c)for(let d=0;d<this._configInfo.TSI00GRIDCONDITION.length;d++){const u=this._configInfo.TSI00GRIDCONDITION[d];if(G.toString(u.FUNCTION_ID,!0)!==e||(t==null?void 0:t.trim().length)>0&&G.toString(u.OPERATE_NAME,!0)!==(t==null?void 0:t.trim())||c.MATCH_FLAG==="1"&&G.toString(u.COMPANY_CODE,!0)!==nt.CompanyCode||G.toString(u.FIELD_NAME_ARRAY,!0).length===0)continue;const f=G.toString(u.FIELD_NAME_ARRAY,!0).split(",");u.FIELD_NAME_ARRAY=f,s.push(u)}}if(s.length>0){this._controlConditionProps[a]=s;const c=this.getAllControlValue(e);s.forEach(d=>{const u=d.FIELD_NAME_ARRAY;let f=i??d.PROP_VALUE??"default";u.forEach(h=>{if(h&&!(o!=null&&o.includes(h))){const p=G.toString(d.REGULAR_EXPRESS,!0),g=p.length===0||p.replaceAll(" ","")==="1=1"||G.checkExpressionValid(c,G.getSystemFormatString(p));f=f==!0||f==="1"||G.toString(f).toLowerCase()==="true",n==="ReadOnly"&&this.setControlReadOnly(e,g?f:"default",h)}})})}}return this}getControlValue(e,t){let n,i;if(e.trim().length>0&&t.trim().length>0){const o=t.split(",").filter(s=>s.trim().length>0);o.length>1&&(i={});const a=this.getLayoutBindModel(e);if(a)for(let s=0;s<o.length;s++){const c=o[s].trim();n=null;const d=this.getLayoutItemOption(e,c,"controlType"),u=this.getLayoutItemOption(e,c,"field");if((u==null?void 0:u.trim().length)>0?n=a[u.trim()]:this._hiddenFields[e.trim()]?n=this._hiddenFields[e.trim()][c]||"":n=a[c],["antInput","antInputGroup","antTextarea","erSelect","erTreeSelect","erMemoEditor"].includes(d))n=n||"";else if(d==="antInputNumber"&&n==null)n=0;else if(["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(d))n=n||[];else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(d)){const f=this.getLayoutItemOption(e,c,"rangePickerStartKey"),h=this.getLayoutItemOption(e,c,"rangePickerEndKey");n=[a[f]||null,a[h]||null]}o.length>1?i[c]=n:i=n}}return i}getControlText(e,t){let n,i;if(e.trim().length>0&&t.trim().length>0){const o=t.split(",");o.length>1&&(i={});const a=this.getLayoutBindModel(e);if(a)for(let s=0;s<o.length;s++){const c=o[s].trim();if(n=null,c.length===0)continue;const d=this.getLayoutItemOption(e,c,"field"),u=this.getLayoutItemOption(e,c,"controlType");let f=this.getLayoutItemOption(e,c,"format");if(f instanceof Array&&f.length>0?f=f[0]:f&&typeof f=="string"?f=f.trim():f="YYYY-MM-DD HH:mm:ss",(d==null?void 0:d.trim().length)>0?n=a[d.trim()]:this._hiddenFields[e.trim()]?n=this._hiddenFields[e.trim()][c]||"":n=a[c],n==null)i="";else{if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect"].includes(u))n=this.getDropDownSelectedText(e,c,n);else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u))n=G.toDateTime(n,"Dayjs").format(f);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const h=this.getLayoutItemOption(e,c,"rangePickerStartKey"),p=this.getLayoutItemOption(e,c,"rangePickerEndKey"),g=a[h]||null,m=a[p]||null;n=G.toDateTime(g,"Dayjs").format(f)+"&"+G.toDateTime(m,"Dayjs").format(f)}else u==="antInputNumber"&&(n=G.formatNumberValue(n,f));o.length>1?i[c]=n:i=n}}}return i}setControlValue(e,t,n){if(G.isNullOrEmpty(e)||G.isNullOrEmpty(t))return this;const i=this.getLayoutBindModel(e==null?void 0:e.trim()),o=this.getLayoutBindForm(e==null?void 0:e.trim()),a=this.getLayoutItemOption(e,t,"controlType"),s=this.getLayoutItemOption(e,t,"field")||(t==null?void 0:t.trim());if(i&&s){if(G.toString(n).trim()===G.toString(i[s]).trim())return this;let c=!0;if(n===void 0&&(n=null,c=!1),["antMultiSelect","erMultiSelect"].includes(a))n?n instanceof Array?i==null||i.set(s,n,e):typeof n=="string"?i==null||i.set(s,n.split(","),e):i==null||i.set(s,[],e):i==null||i.set(s,[],e);else if(n!==null&&(a!=null&&a.startsWith("antCheckbox")||a!=null&&a.startsWith("antSwitch")))i==null||i.set(s,G.toString(n)==="1"||G.toString(n).toLowerCase()==="true",e);else if(n!==null&&["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(a))i==null||i.set(s,G.toDateTime(n,"Dayjs"),e);else if(n instanceof Array&&n.length===2&&["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(a)){const d=this.getLayoutItemOption(e,t,"rangePickerStartKey"),u=this.getLayoutItemOption(e,t,"rangePickerEndKey");n[0]!==void 0&&(i==null||i.set(d,G.toDateTime(n[0],"Dayjs"),e)),n[1]!==void 0&&(i==null||i.set(u,G.toDateTime(n[1],"Dayjs"),e))}else i==null||i.set(s,n,e);c&&setTimeout(()=>{o==null||o.validate(s)})}if(this._layoutConditionStyleInfo[e]){const c=this._layoutConditionStyleInfo[e];Object.keys(c).forEach(d=>{var u,f;(d===t||((f=(u=c[d])==null?void 0:u.condition)==null?void 0:f.indexOf(t))>-1)&&this.setLayoutConditionStyle(e,d)})}return this}setControlValueEx(e,t,...n){const i=Object.keys(t);return(i==null?void 0:i.length)>0&&(n.length===1&&(n=n[0].split(",")),n.length>0?n.forEach(o=>{(t==null?void 0:t[o])!==void 0&&this.setControlValue(e,o,t[o])}):i.forEach(o=>{(t==null?void 0:t[o])!==void 0&&this.setControlValue(e,o,t[o])})),this}setControlCss(e,t,n){if((e==null?void 0:e.trim().length)>0&&(n==null?void 0:n.length)>0){let i;t instanceof Array?i=t:i=t.split(","),i&&i.length>0&&i.forEach(o=>{if(o.trim().length>0){const a=this.getLayoutItemOption(e,o,"controlType");let s=document.getElementsByName(this.FormId+e+o);if((s==null?void 0:s.length)>0){let c;switch(a){case"erSelect":case"erMultiSelect":case"antMultiSelect":case"erTreeSelect":case"erMultiTreeSelect":c=s[0].getElementsByClassName("ant-select-selector");break;case"antInput":case"antInputNumber":c=document.getElementById(this.FormId+e+o);break;case"antDateTimePicker":case"antDatePicker":case"antMonthPicker":case"antYearPicker":c=s[0].getElementsByClassName("ant-picker-input");break}n.forEach(d=>{(c==null?void 0:c.length)>0?d.value!==void 0&&G.jQuery(c).css(d.property,d.value):d.value!==void 0&&G.jQuery(s).css(d.property,d.value)})}else s=document.getElementById(this.FormId+e+o),s&&n.forEach(c=>{c.value!==void 0&&G.jQuery(s).css(c.property,c.value)})}})}return this}setModelDefalutValue(e,t,n,i){let o;t instanceof Array?o=t:o=t.split(",");const a=(s,c)=>{var f,h,p;const d=this.getSingleItemConfigInfo(s,c);let u=null;if(d.DEFAULT_VALUE&&d.DEFAULT_VALUE.trim().length>0?u=d.DEFAULT_VALUE:this._customDefaultValues[s]&&this._customDefaultValues[s][c]!==void 0?u=this._customDefaultValues[s][c]:i&&(u=i),u&&u.trim().length>0&&e.schemaFields[c].type){if(e.schemaFields[c].type==="datetime")e.set(c,G.getDateTimeByString(u),s);else if(e.schemaFields[c].type==="boolean")e.set(c,u==="1"||u.toLowerCase()==="true",s);else if(e.schemaFields[c].type==="number")e.set(c,u,s);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(u)){const g=(h=(f=this._dropDownBindSource)==null?void 0:f[s])==null?void 0:h[c];((p=g==null?void 0:g.dataSource)==null?void 0:p.length)>0&&(g!=null&&g.dataValueField)?u==="$FIRST_ROW$"?u=g.dataSource[0][g.dataValueField]:u==="$LAST_ROW$"?u=g.dataSource[g.dataSource.length-1][g.dataValueField]:u==="$ALL_VALUES$"&&(u="",g.dataSource.forEach(m=>{u=u.length===0?m[g.dataValueField]:u+","+m[g.dataValueField]})):u="",e.set(c,u,s)}else e.set(c,this.getDefaultStringValue(u),s);this.setControlValue(s,c,e[c])}};return n&&n.trim().length>0?o.forEach(s=>{s=this.getConfigIdbyLayoutName(s),e&&n&&e.schemaFields&&e.schemaFields[n]&&a(s,n)}):o.forEach(s=>{s=this.getConfigIdbyLayoutName(s);const c=this.getConfigInfo(s);c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{n=d.ITEM_CODE,e&&n&&e.schemaFields&&e.schemaFields[n]&&a(s,n)})}),this}setModelValue(e,t,...n){return qr.setModelValue(e,t,...n),this}setModelEmptyValue(e,...t){return t.length===1&&(t=t[0].split(",")),t.length>0?t.forEach(n=>{e&&e[n]!==void 0&&e.set(n,null)}):e.schemaFields&&Object.keys(e.schemaFields).forEach(n=>{e.set(n,null)}),this}setControlReadOnlyEx(e,t){return t&&Object.keys(t).forEach(n=>{this.setControlReadOnly(e,t[n],n)}),this}setControlReadOnly(e,t,...n){if(G.isNullOrEmpty(e))return this;n.length===1&&(n=n[0].split(",")),e=this.getConfigIdbyLayoutName(e);for(const i of n){const o=this.getSingleItemConfigInfo(e,i);let a=!0,s=!1;o.FUNCTION_TYPE&&o.COLUMN_EDIT&&(t!=="default"&&!t&&o.READ_ONLY==="1"&&(o.COLUMN_EDIT!=="1"||o.ALLOW_EDIT!=="1")||(t==="default"?(s=o.READ_ONLY==="1"||o.FUNCTION_TYPE!=="F"&&o.ALLOW_EDIT!=="1",a=o.ALLOW_EDIT==="1"):(s=t,a=!s),this.setLayoutItemOption(e,i,{readOnly:s}),o.COLUMN_EDIT==="1"&&this.setLayoutItemOption(e,i,{buttonEnable:a})))}return this}setAllControlReadOnly(e,t){let n;return e instanceof Array?n=e:n=e.split(","),n&&n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{this.setControlReadOnly(i.trim(),t,a.ITEM_CODE)})}}),this}setControlEnable(e,t,...n){if(G.isNullOrEmpty(e))return this;n.length===1&&(n=n[0].split(",")),e=this.getConfigIdbyLayoutName(e);for(const i of n){const o=this.getSingleItemConfigInfo(e,i);let a=!0;o.FUNCTION_TYPE&&o.COLUMN_EDIT&&(t==="default"?a=o.ALLOW_EDIT==="1":a=t,this.setLayoutItemOption(e,i,{allowEdit:a}),o.COLUMN_EDIT==="1"&&this.setLayoutItemOption(e,i,{buttonEnable:a}))}return this}setAllControlEnable(e,t){let n;return e instanceof Array?n=e:n=e.split(","),n&&n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{this.setControlEnable(i.trim(),t,a.ITEM_CODE)})}}),this}setControlEmptyValue(e,...t){if(t.length===1&&(t=t[0].split(",")),!t||t.length===0){const n=this.getConfigInfo(e);n.TSI00GRIDVIEW&&n.TSI00GRIDVIEW.length>0&&n.TSI00GRIDVIEW[0].FUNCTION_TYPE==="F"&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(i=>{this.setControlValue(e,i.ITEM_CODE,void 0)})}else t.forEach(n=>{this.setControlValue(e,n,void 0)});return this}setAllControlDefalutValue(e,t=!1){let n;return e instanceof Array?n=e:n=e.split(","),n.length>0&&n.forEach(i=>{if(i.trim().length>0){const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{var s;((s=a.DEFAULT_VALUE)==null?void 0:s.trim().length)>0?this.setControlDefalutValue(i.trim(),a.ITEM_CODE,t):t||this.setControlEmptyValue(i,a.ITEM_CODE)})}}),this}setControlDefalutValue(e,t,n=!1){var i,o,a,s;if(G.isNullOrEmpty(e)||G.isNullOrEmpty(t))return this;if(e=this.getConfigIdbyLayoutName(e),(e==null?void 0:e.trim().length)>0){const c=this.getLayoutBindModel(e),d=this.getSingleItemConfigInfo(e,t),u=((i=this.getLayoutItemOption(e.trim(),t,"field"))==null?void 0:i.value)||t.trim(),f=c==null?void 0:c.get(u==null?void 0:u.trim());if(f!=null&&n)return this;const h=G.toString(d.DEFAULT_VALUE,!0);if(c&&h.length>0){let p=this.getDefaultStringValue(h),g=null;const m=this.getLayoutItemOption(e.trim(),t,"controlType");if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect","antRadioGroup","erRadioGroup","erCheckboxGroup"].includes(m)&&["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(h)){const _=(a=(o=this._dropDownBindSource)==null?void 0:o[e])==null?void 0:a[t];((s=_==null?void 0:_.dataSource)==null?void 0:s.length)>0&&(_!=null&&_.dataValueField)?h==="$FIRST_ROW$"?p=_.dataSource[0][_.dataValueField]:h==="$LAST_ROW$"?p=_.dataSource[_.dataSource.length-1][_.dataValueField]:["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(m)&&h==="$ALL_VALUES$"&&(p="",_.dataSource.forEach(T=>{p=p.length===0?T[_.dataValueField]:p+","+T[_.dataValueField]})):p=""}if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(m))g=G.getDateTimeByString(p);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(m)){const _=p.split(/[|&]/);g=[G.getDateTimeByString(_[0]),G.getDateTimeByString(_[1])]}else m==="antInputNumber"?g=G.toNumber(p):["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(m)?g=p.split(","):m==="antCheckbox"||m==="antSwitch"?g=p==="1"||p.toLowerCase()==="true":g=p;this.setControlValue(e,t,g)}}return this}getFormButtonConfigInfo(e){let t={},n=[];return this._configInfo.TSI00FORMBUTTON&&this._configInfo.TSI00FORMBUTTON.length>0&&(n=this._configInfo.TSI00FORMBUTTON,n.length>0&&n.every((i,o)=>i.BUTTON_NAME===e?(t=i,!1):!0)),t}getSystemGlobalOptions(){let e={};const t=this.getFormSysInfo("SystemGlobalOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getLayoutGlobalOptions(){let e={};const t=this.getFormSysInfo("LayoutDefaultOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getGridGlobalOptions(){let e={};const t=this.getFormSysInfo("GridDefaultOptions");return t.trim().length>0&&(e=JSON.parse(t)),e}getFormExtentedOptions(){var n,i;let e={};const t=this.getFormSysInfo("FormDefaultOptions");if(t.trim().length>0&&(e={...JSON.parse(t)}),((n=this._configInfo.TSI00FORM)==null?void 0:n.length)>0){const o=this._configInfo.TSI00FORM[0];if(((i=o.EXT_OPTIONS)==null?void 0:i.trim().length)>0){const a=JSON.parse(o.EXT_OPTIONS);e={...e,...a}}}return e}resetLayout(e){let t;return e instanceof Array?t=e:t=e.split(","),t.length>0&&t.forEach(n=>{if(n.trim().length>0){const i=this.getConfigInfo(n.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(o=>{o.DEFAULT_VALUE&&o.DEFAULT_VALUE.trim().length>0?this.setControlDefalutValue(n.trim(),o.ITEM_CODE):this.setControlValue(n.trim(),o.ITEM_CODE,void 0)}),l.nextTick(()=>{this.resetValidator(n.trim())})}}),this}getAllControlValue(e,t,n=!1){const i={};return(e instanceof Array?e:e.split(",")).forEach(a=>{if((a==null?void 0:a.trim().length)>0){const s=this.getLayoutBindModel(a.trim());if(s){const c=this.getConfigInfo(a.trim());c.TSI00GRIDVIEW&&c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{var p,g,m,_;const u=this.getLayoutItemOption(a,d.ITEM_CODE,"controlType"),f=this.getLayoutItemOption(a,d.ITEM_CODE,"field")||d.ITEM_CODE,h=G.toNumber(d.MAX_LENGTH);if(f&&(d.IS_VISIBLE==="1"||n===!1)){let T=s[f];if(u==="antCheckbox"||u==="antSwitch")T=T===!0?"1":"0",i[f]=T;else if(u==="antInputNumber")T=T||0,i[f]=T;else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u)&&T){const x=G.toString(d.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss",E=G.getDateTimeFormatString(T,x);E.substring(0,4)==="0001"||E.substring(0,4)==="1900"||E.substring(0,4)==="1901"?T="":(T=E,h>0&&h<T.length&&(T=T.substring(0,h))),i[f]=T}else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const x=this.getLayoutItemOption(a,d.ITEM_CODE,"rangePickerStartKey"),E=this.getLayoutItemOption(a,d.ITEM_CODE,"rangePickerEndKey"),D=G.toString(d.DATE_TIME_FORMAT,!0);let k="yyyyMMddHHmmss",P="yyyyMMddHHmmss";if(D.length>0){const w=D.split(/[|&]/);((p=w[0])==null?void 0:p.trim().length)>=6&&((g=w[0])==null?void 0:g.trim().toLowerCase())!=="yyyymmdd"&&(k="yyyyMMdd"+w[0].substring(0,6)),((m=w[1])==null?void 0:m.trim().length)>=6&&((_=w[1])==null?void 0:_.trim().toLowerCase())!=="yyyymmdd"&&(P="yyyyMMdd"+w[1].substring(0,6))}let b=G.getDateTimeFormatString(s[x],k),S=G.getDateTimeFormatString(s[E],P);(b.substring(0,4)==="0001"||b.substring(0,4)==="1900"||b.substring(0,4)==="1901")&&(b=""),(S.substring(0,4)==="0001"||S.substring(0,4)==="1900"||S.substring(0,4)==="1901")&&(S=""),h>0&&(b.length>h&&(b=b.substring(0,h)),S.length>h&&(S=S.substring(0,h))),i[x]=b,i[E]=S}else["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(u)&&T&&T instanceof Array?(T=T.join(","),i[f]=T):(T=T||"",i[f]=T)}})}}}),t&&Object.keys(t).length>0&&Object.keys(t).forEach(a=>{i[a]=t[a]}),i}getAllControlValueAsFilterArray(e,t){const n=[];return(e instanceof Array?e:e.split(",")).forEach(o=>{const a=this.getConfigInfo(o);a.TSI00GRIDVIEW&&a.TSI00GRIDCOLUMN&&a.TSI00GRIDCOLUMN.forEach(s=>{var c,d,u,f;if(s.OPERATOR.trim().length>0&&s.OPERATOR.trim()!=="None"&&s.PARA_GROUP.trim().length>0&&s.PARA_GROUP.trim()!=="None"){const h=this.getLayoutItemOption(o,s.ITEM_CODE,"controlType"),p={};t&&Object.keys(t).length>0?Object.keys(t).forEach(T=>{p[T]=t[T]}):p.QUERY_TYPE="",p.ITEM_CODE=G.toString(s.ITEM_CODE,!0,"toLower"),p.ORIGIN_CODE=s.ORIGIN_CODE,p.TABLE_NAME=s.TABLE_NAME,p.FIELD_NAME=G.toString(s.PARA_NAME,!0,"toLower"),p.OPERATOR=s.OPERATOR,p.PARA_GROUP=s.PARA_GROUP,p.SQL_CONTENT=s.SQL_CONTENT,p.OP_VALUE=null,p.DATA_TYPE="String";const g=G.toString(p.PARA_GROUP,!0),m=G.toString(p.OPERATOR,!0);let _=this.getControlValue(o,s.ITEM_CODE)||"";if(m.length>0)switch(h){case"antRadioGroup":case"erRadioGroup":case"erSelect":case"erTreeSelect":{p.OP_VALUE=_,p.ORIGIN_CODE==="4"&&s.SVC_NAME.trim().length>0&&p.OP_VALUE.trim().length>0&&p.OPERATOR==="SQL"&&(p.ORIGIN_CODE="SIU",p.SQL_CONTENT=this.getFormCodeSetFilter(s.SVC_NAME,p.OP_VALUE)),(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antInputNumber":{p.DATA_TYPE="Decimal",p.OP_VALUE=_,p.OP_VALUE===null&&(p.OP_VALUE=0),(g==="2"||G.toNumber(p.OP_VALUE)!==0)&&(p.OP_VALUE=G.toString(p.OP_VALUE),n.push(p));break}case"antCheckbox":case"antSwitch":{p.OPERATOR="=",p.OP_VALUE=_===!0?"1":_===!1?"0":"",(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antMultiSelect":case"erMultiSelect":case"erCheckboxGroup":case"erMultiTreeSelect":{p.OPERATOR="IN",_&&_ instanceof Array&&_.length>0?_=_.join(","):_&&typeof _=="string"&&_.length>0?_=_:_="",p.OP_VALUE=_,(g==="2"||_.length>0)&&n.push(p);break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{if(_){const T=G.toString(s.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss";p.OP_VALUE=G.getDateTimeFormatString(_,T),p.OP_VALUE.length>=4&&(p.OP_VALUE.substring(0,4)==="0001"||p.OP_VALUE.substring(0,4)==="1900")&&(p.OP_VALUE=""),(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p)}break}case"antDateTimeRangePicker":case"antDateRangePicker":case"antMonthRangePicker":case"antYearRangePicker":{if(_ instanceof Array&&_.length===2){const T=G.toString(s.DATE_TIME_FORMAT,!0);let x="yyyyMMddHHmmss",E="yyyyMMddHHmmss";if(T.length>0){const b=T.split(/[|&]/);((c=b[0])==null?void 0:c.trim().length)>=6&&((d=b[0])==null?void 0:d.trim().toLowerCase())!=="yyyymmdd"&&(x="yyyyMMdd"+b[0].substring(0,6)),((u=b[1])==null?void 0:u.trim().length)>=6&&((f=b[1])==null?void 0:f.trim().toLowerCase())!=="yyyymmdd"&&(E="yyyyMMdd"+b[1].substring(0,6))}let D=G.getDateTimeFormatString(_[0],x),k=G.getDateTimeFormatString(_[1],E);(D.substring(0,4)==="0001"||D.substring(0,4)==="1900"||D.substring(0,4)==="1901")&&(D=""),(k.substring(0,4)==="0001"||k.substring(0,4)==="1900"||k.substring(0,4)==="1901")&&(k="");const P=p.ITEM_CODE;(g==="2"||D.length>0)&&n.push({...p,ITEM_CODE:`${P}_beg`,OPERATOR:">=",OP_VALUE:D}),(g==="2"||k.length>0)&&n.push({...p,ITEM_CODE:`${P}_end`,OPERATOR:"<=",OP_VALUE:k})}break}default:{G.toString(_,!0).length>0&&m==="IN"&&(_=_.split(/\n|\t|,|,/).map(T=>T.trim()).filter(T=>T.length>0).join(",")),p.OP_VALUE=_,(g==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}}}})}),n}expandLayoutGroup(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++)if(t[n].trim().length>0){const i=document.getElementById(this.FormId+t[n].trim()+"_content");i&&G.jQuery(i).show()}return this}collapseLayoutGroup(e){let t=[];e&&(e instanceof Array?t=e:t=e.split(",")),t.length===0&&(t=this.getAllConfigIdArray());for(let n=0;n<t.length;n++)if(t[n].trim().length>0){const i=document.getElementById(this.FormId+t[n].trim()+"_content");i&&G.jQuery(i).hide()}return this}async queryByButton(e,t,n,i){var a;const o=this.getFormButtonConfigInfo(e);((a=o==null?void 0:o.SVC_NAME)==null?void 0:a.trim().length)>0?this.queryByService(o==null?void 0:o.SVC_NAME,t,n,i):G.error("未配置按钮["+e+"]的服务信息!")}async queryByService(e,t,n,i){var o;if(e.trim().length>0){let a=new rt;if(t instanceof rt)a=t;else if(((o=t.filterConfigId)==null?void 0:o.trim().length)>0){const c=this.getAllControlValue(t.filterConfigId,t.extendJson),d=this.getAllControlValueAsFilterArray(t.filterConfigId,t.extendJson);if(t.customFilter){const u=G.converCustomFilterToQueryFilter(t.customFilter);u.length>0&&d.push(...u)}a.addMapData("Table0",[c]),a.addMapData("QUERY_FILTER",d)}const s=await Bn.callServiceEx(e,a,i);n&&n instanceof Function?n(s):G.warn("未配置回调函数!")}else G.error("调用服务名为空")}async queryByDataSource(e,t,n,i,o){var a,s,c,d,u,f,h,p;if(e.trim().length>0){let g="",m=e,_="";const T=this.getGridConfig(e);((a=T==null?void 0:T.SVC_NAME)==null?void 0:a.trim().length)>0&&(m=(s=T==null?void 0:T.SVC_NAME)==null?void 0:s.trim(),g=T.FILTER_STRING.trim(),_=e);let x=new rt;if(n instanceof rt)x=n;else if(((c=n.filterConfigId)==null?void 0:c.trim().length)>0){const k=this.getAllControlValue(n.filterConfigId,n.extendJson),P=this.getAllControlValueAsFilterArray(n.filterConfigId,n.extendJson);if(n.customFilter){const b=G.converCustomFilterToQueryFilter(n.customFilter);b.length>0&&P.push(...b)}g.trim().length>0&&P.push(...G.converCustomFilterToQueryFilter(g.trim())),x.addMapData("Table0",[k]),x.addMapData("QUERY_FILTER",P)}const E=(u=(d=this._configInfo)==null?void 0:d.TSI00DATASOURCE)==null?void 0:u.find(k=>k.FUNC_ID===m);(E==null?void 0:E.ORIGIN_CODE)==="SVC"&&((f=E==null?void 0:E.SVC_NAME)==null?void 0:f.trim().length)>0?t=(h=E==null?void 0:E.SVC_NAME)==null?void 0:h.trim():(x.addMapData("DATA_SOURCE",[{FUNCTION_ID:(E==null?void 0:E.FUNC_ID)||m,COMPANY_CODE:nt.CompanyCode}]),t=t.trim()||((p=E==null?void 0:E.SVC_NAME)==null?void 0:p.trim())||nt.dynamicQueryService);const D=await Bn.callServiceEx(t,x,o);(_==null?void 0:_.trim().length)>0&&this.mergeDataToGrid(D,_,!0),i&&i instanceof Function?i(D):G.warn("未配置回调函数!")}else G.error("未传入配置ID信息")}getFormCodeSetFilter(e,t){let n="";if(this._configInfo[this._formName+e]){for(const i of this._configInfo[this._formName+e])if(i.CODE===t){n=i.SQL_CONTENT;break}}return n}getQuerySqlFormat(e,t){return G.getSystemFormatString(e,t)}getFormSysInfo(e){return this._configInfo[nt.SystemParamsBlockName]&&this._configInfo[nt.SystemParamsBlockName].length>0&&e.trim().length>0?G.toString(this._configInfo[nt.SystemParamsBlockName][0][e.trim().toUpperCase()])||G.toString(this._configInfo[nt.SystemParamsBlockName][0][e.trim()]):""}getSysParaValue(e,t,n){return new Promise((i,o)=>{if(this._sysParaInfo&&this._sysParaInfo[e]!==void 0&&this._sysParaInfo[e][t]!==void 0)i(this._sysParaInfo[e][t].toString());else if(t&&t.trim().length>0){let a="";const s=rt.buildMap([{QUERY_TYPE:"system_para",COMPANY_CODE:e,CTRL_CODE:t,EFFECT_ELEMENT_VALUE:n||""}]);Bn.callServiceEx(nt.queryDevConfigService,s,{partition:this._serverPartition}).then(c=>{c.sysFlag>=0&&c.contains("TSIFIAA51")&&c.getMapData("TSIFIAA51").length>0?a=G.toString(c.getMapData("TSIFIAA51")[0].CTRL_NUM):c.sysFlag>=0&&c.contains(nt.SystemParamsBlockName)&&c.getMapData(nt.SystemParamsBlockName).length>0&&(a=G.toString(c.getMapData(nt.SystemParamsBlockName)[0][t.toUpperCase()])),this._sysParaInfo[e]===void 0&&(this._sysParaInfo[e]={}),this._sysParaInfo[e][t]=a,i(a)},()=>{this._sysParaInfo[e]===void 0&&(this._sysParaInfo[e]={}),this._sysParaInfo[e][t]="",i("")})}})}getDefaultStringValue(e){return e.trim().length>14&&e.trim().substring(0,13)==="$FormSysInfo."&&e.trim().substring(e.trim().length-1,e.trim().length)==="$"?e=this.getFormSysInfo(e.trim().substring(13,e.trim().length-1)):e=G.getSystemFormatString(e),e}setCustomDefaultValue(e,t){(e==null?void 0:e.trim().length)>0&&t&&(this._customDefaultValues[e.trim()]=t)}getLayoutConfigDefaultValues(e){const t={};let n;return e instanceof Array?n=e:n=e.split(","),n.length>0&&n.forEach(i=>{const o=this.getConfigInfo(i.trim());o.TSI00GRIDVIEW&&o.TSI00GRIDCOLUMN&&o.TSI00GRIDCOLUMN.forEach(a=>{var s,c,d;if(a.DEFAULT_VALUE&&a.DEFAULT_VALUE.trim().length>0){const u=a.FUNCTION_TYPE+a.COLUMN_EDIT,f=a.DEFAULT_VALUE,h=this.getControlName(u,a.FORMAT_STRING);if(h&&h.trim().length>0&&f.trim().length>0)switch(h){case"antInputNumber":{t[a.ITEM_CODE]=parseFloat(f);break}case"erCheckboxGroup":case"antMultiSelect":case"erMultiSelect":{const p=this.getDefaultStringValue(f).split(",");t[a.ITEM_CODE]=p;break}case"antCheckbox":case"antSwitch":{t[a.ITEM_CODE]=G.toString(f)==="1"||G.toString(f)==="true";break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{t[a.ITEM_CODE]=G.getDateTimeByString(f);break}default:{if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(f)){const p=(c=(s=this._dropDownBindSource)==null?void 0:s[i])==null?void 0:c[a.ITEM_CODE];((d=p==null?void 0:p.dataSource)==null?void 0:d.length)>0&&(p!=null&&p.dataValueField)?f==="$FIRST_ROW$"?t[a.ITEM_CODE]=p.dataSource[0][p.dataValueField]:f==="$LAST_ROW$"?t[a.ITEM_CODE]=p.dataSource[p.dataSource.length-1][p.dataValueField]:f==="$ALL_VALUES$"&&(t[a.ITEM_CODE]="",p.dataSource.forEach(g=>{t[a.ITEM_CODE]=t[a.ITEM_CODE].length===0?g[p.dataValueField]:t[a.ITEM_CODE]+","+g[p.dataValueField]})):t[a.ITEM_CODE]=""}else t[a.ITEM_CODE]=this.getDefaultStringValue(f);break}}}})}),t}getGridConfigDefaultValues(e){const t={},n=this.getConfigInfo(e.trim()),i=this.getBindingTable(e.trim());return i&&n.TSI00GRIDVIEW&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(o=>{var a,s,c;if(i.options.schema&&o.DEFAULT_VALUE&&o.DEFAULT_VALUE.trim().length>0){const d=i.options.schema[o.FIELD_NAME].type;if(d==="datetime")t[o.FIELD_NAME]=G.getDateTimeByString(o.DEFAULT_VALUE);else if(d==="boolean")t[o.FIELD_NAME]=o.DEFAULT_VALUE==="1"||o.DEFAULT_VALUE.toLowerCase()==="true";else if(d==="number")t[o.FIELD_NAME]=G.toNumber(o.DEFAULT_VALUE);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(o.DEFAULT_VALUE)){const u=(s=(a=this._dropDownBindSource)==null?void 0:a[e])==null?void 0:s[o.ITEM_CODE];((c=u==null?void 0:u.dataSource)==null?void 0:c.length)>0&&(u!=null&&u.dataValueField)?o.DEFAULT_VALUE==="$FIRST_ROW$"?t[o.FIELD_NAME]=u.dataSource[0][u.dataValueField]:o.DEFAULT_VALUE==="$LAST_ROW$"?t[o.FIELD_NAME]=u.dataSource[u.dataSource.length-1][u.dataValueField]:o.DEFAULT_VALUE==="$ALL_VALUES$"&&(t[o.FIELD_NAME]="",u.dataSource.forEach(f=>{t[o.FIELD_NAME]=t[o.FIELD_NAME].length===0?f[u.dataValueField]:t[o.FIELD_NAME]+","+f[u.dataValueField]})):t[o.FIELD_NAME]=""}else t[o.FIELD_NAME]=this.getDefaultStringValue(o.DEFAULT_VALUE)}}),t}async loadGrid(e,t,n,i,o){var a,s,c,d,u,f,h,p,g,m,_,T,x,E,D,k,P;if(!this.containsConfig(e)&&(n==null?void 0:n.forceLoadConfig)!==!1&&await this.loadConfig(e),this.containsConfig(e)){if(this._gridInstanceInfo[e]&&(n==null?void 0:n.reload)!==!0)return console.error(`Grid instance ${e} already exists!`),!1;this.getSingleViewConfigInfo(e),this._gridColumnsConfigInfo[e]={},this._allowMergeColumnFields[e]=[],this._gridStyleInfo[e]=this._gridStyleInfo[e]||[],this._gridOptions[e]=this._gridOptions[e]||{};const b=this.getConfigInfo(e);if((a=t==null?void 0:t.gridOptions)!=null&&a.api&&b.TSI00GRIDVIEW&&b.TSI00GRIDVIEW.length>0){const S=b.TSI00GRIDVIEW[0];((s=n==null?void 0:n.cloneTableName)==null?void 0:s.trim().length)>0&&this.cloneTableForLayoutOrGrid(((c=n==null?void 0:n.originTableName)==null?void 0:c.trim())||S.TABLE_NAME.trim(),n.cloneTableName.trim(),e),t.gridOptions.context={configId:e,configCaption:S.FUNCNAME_RES||S.FUNCNAME,options:n},n=n||{},S.SHOW_GROUP==="2"?n.groupDisplayType="singleColumn":S.SHOW_GROUP==="3"?n.groupDisplayType="multipleColumns":n.groupDisplayType="groupRows",(d=this._formOptions)!=null&&d.gridOptions&&(n={...this._formOptions.gridOptions,...n}),((u=S.CUS_EXT_OPTIONS)==null?void 0:u.trim().length)>0&&(n={...JSON.parse(S.CUS_EXT_OPTIONS),...n}),((f=S.EXT_OPTIONS)==null?void 0:f.trim().length)>0&&(n={...JSON.parse(S.EXT_OPTIONS),...n});const w=this.getFormSysInfo("GridDefaultOptions");w.trim().length>0&&(n={...JSON.parse(w),...n}),["disableErMenu","rowDragManaged","groupIncludeFooter","groupIncludeTotalFooter","suppressRowTransform","suppressRowClickSelection","rowMultiSelectWithClick","singleClickEdit"].forEach(B=>{const O=t.gridOptions[B]??n[B];O!==void 0&&(n[B]=O)}),this.setGridToolbarVisible(e,{refresh:S.SHOW_REFRESH==="1",addrow:S.SHOW_ADD==="1",copyrow:S.SHOW_ADDCOPY==="1",delete:S.SHOW_DELETE==="1",cancel:S.SHOW_ADD==="1"||S.SHOW_ADDCOPY==="1"||S.SHOW_DELETE==="1",excel:S.SHOW_EXPORT==="1",import:S.ALLOW_IMPORT==="1"}),((h=S==null?void 0:S.KEY_FIELDS)==null?void 0:h.trim().length)>0&&(this.getGridOptions(e,"primaryKeys")===void 0||((p=this.getGridOptions(e,"primaryKeys"))==null?void 0:p.length)===0)&&this.setGridOptions(e,"primaryKeys",(g=S==null?void 0:S.KEY_FIELDS)==null?void 0:g.trim().split(",").filter(B=>B.trim().length>0)),n.groupDisplayType=n.groupDisplayType||t.gridOptions.groupDisplayType||this.getFormSysInfo("GRIDGROUPDISPLAYTYPE")||"groupRows",n.rowHeight=n.rowHeight||t.gridOptions.rowHeight;const v=this.getGridConfigOptions(e,n,i,o);v.context={...t.gridOptions.context,...v.context},v&&Object.keys(v).forEach(B=>{t.gridOptions[B]=v[B]!==void 0?v[B]:t.gridOptions[B]}),t.gridOptions.defaultColDef=t.gridOptions.defaultColDef||{},t.gridOptions.rowSelection=b.TSI00GRIDVIEW[0].MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single",t.gridOptions.api.selectionService.rowSelection=t.gridOptions.rowSelection,t.gridOptions.api.selectionService.groupSelectsChildren=!0,t.gridOptions.api.setColumnDefs(v.columnDefs),t.gridOptions.api.setRowData([]);const A=(o==null?void 0:o.pagination)===!0||(o==null?void 0:o.pagination)==="client";if(S.ALLOW_CELLMERGE==="1"&&!A&&((m=t.gridOptions.context.mergeColumns)==null?void 0:m.length)>0&&!n.masterDetail&&(t.gridOptions.context.calculateRowSpan=(B=!0)=>{var H,V,N,W,j,U;let O=[];const M=t.gridOptions.columnApi.getRowGroupColumns(),R={};if(M.length===0){B?O=t.gridOptions.context.bindingSource.data():t.gridOptions.api.forEachNodeAfterFilterAndSort(X=>{var Y;(Y=X.data)!=null&&Y.uid&&O.push(X.data)});const ie=((N=(V=(H=t.gridOptions.context)==null?void 0:H.viewConfig)==null?void 0:V.MERGE_COLUMN)==null?void 0:N.trim().length)>0?(U=(j=(W=t.gridOptions.context)==null?void 0:W.viewConfig)==null?void 0:j.MERGE_COLUMN)==null?void 0:U.trim().split(","):[];t.gridOptions.context.mergeColumns.forEach(X=>{R[X]={};const Y={};let Z=0;const ce=[...ie,X];for(let ue=0;ue<O.length;ue++){let he=!0;for(let re=0;re<ce.length;re++){const z=ce[re];if(O[ue][z]!==Y[z]){he=!1;break}}if(!he){if(Object.keys(Y).length>0)for(let re=Z;re<ue;re++){const z=O[re].uid;R[X][z]=re===Z?ue-Z:0}ce.forEach(re=>{Y[re]=O[ue][re]}),Z=ue}if(ue===O.length-1)for(let re=Z;re<=ue;re++){const z=O[re].uid;R[X][z]=re===Z?ue-Z+1:0}}})}return t.gridOptions.context.rowSpanMap=R,O[0]}),(S==null?void 0:S.SHOW_FOOTER)==="1"&&((_=t.gridOptions.context.viewType)==null?void 0:_.toLowerCase())!=="cardview"&&((T=t.gridOptions.context.viewType)==null?void 0:T.toLowerCase())!=="card"&&t.gridOptions.api.setPinnedBottomRowData([{pinndeRowType:"ErGridSummaryFooter"}]),l.nextTick(()=>{var B;t.gridOptions.defaultColDef.floatingFilter===void 0&&t.gridOptions.api.setDefaultColDef({floatingFilter:(S==null?void 0:S.SHOW_FILTER_ROW)==="1"}),((B=n==null?void 0:n.initialData)==null?void 0:B.length)>0&&this.mergeDataToGrid(n.initialData,t)}),t.gridOptions.processCellForClipboard=B=>{var O,M,R,H,V,N,W,j;return(R=(M=(O=B.column)==null?void 0:O.colDef)==null?void 0:M.context)!=null&&R.hideContent?"******":(H=B.node)!=null&&H.footer&&((V=B.node)!=null&&V.group)&&((N=B.context)!=null&&N.focusColId)&&B.node.aggData&&B.node.aggData[B.context.focusColId]?Zr.isPlainObject(B.node.aggData[B.context.focusColId])?`☑️ ${G.formatNumberValue(B.node.aggData[B.context.focusColId].aggValueOfChecked,"")}
|
|
72
72
|
∑ ${G.formatNumberValue(B.node.aggData[B.context.focusColId].aggValue,"")}`:B.node.aggData[B.context.focusColId]:((W=B.context)==null?void 0:W.copyValue)!==!0&&((j=B.column)!=null&&j.colDef.valueFormatter)?B.column.colDef.valueFormatter(B):B.value},n.SORT_FIELD_NAME=((x=n.SORT_FIELD_NAME)==null?void 0:x.trim())||S.SORT_FIELD_NAME,((E=n.SORT_FIELD_NAME)==null?void 0:E.trim().length)>0){const B=n.SORT_FIELD_NAME.split(","),O=[];B.forEach((R,H)=>{const V=R.trim().split(" ");if(V.length>0){const N={colId:V[0].trim().toUpperCase(),sort:"asc",sortIndex:H};V.length>1&&V[1].trim().toLowerCase()==="desc"&&(N.sort=V[1].trim().toLowerCase()),O.push(N)}}),t.gridOptions.columnApi.applyColumnState({state:O});const M=(D=t.gridOptions.api)==null?void 0:D.getStatusPanel("InformationPanel");M?M.setInformation():(P=(k=t.gridOptions.context.informationPanelComponentRef)==null?void 0:k.value)==null||P.setInformation()}this.setGridMainMenuItems(t,n),this.setGridContextMenu(t,n),this.setGridRowStyle(t,n),this.setGridInitialEvent(t,n),this._gridInstanceInfo[e]=t}return!0}return!1}getGridConfigOptions(e,t,n,i){var s,c,d,u;this._gridColumnsConfigInfo[e]={},this._allowMergeColumnFields[e]=[],this._gridStyleInfo[e]=this._gridStyleInfo[e]||[],this._gridOptions[e]=this._gridOptions[e]||{};const o={},a=this.getConfigInfo(e);if(a.TSI00GRIDVIEW&&a.TSI00GRIDVIEW.length>0){const f=a.TSI00GRIDVIEW[0],h=a.TSI00GRIDCOLUMN;o.statusBar={statusPanels:[{statusPanel:"ToolbarButton"}]},o.excelStyles=[{id:"title",alignment:{vertical:"Center",horizontal:"Center",wrapText:!0},font:{bold:!0,size:26}},{id:"header",alignment:{vertical:"Center",horizontal:"Center",wrapText:!0},font:{bold:!0}},{id:"center-cell",alignment:{horizontal:"Center",vertical:"Center"}},{id:"datetime-cell",dataType:"dateTime",numberFormat:{format:"YYYY-MM-DD HH:mm:ss"},alignment:{vertical:"Center",horizontal:"Center"}},{id:"date-cell",dataType:"dateTime",numberFormat:{format:"YYYY-MM-DD"},alignment:{vertical:"Center",horizontal:"Center"}},{id:"center-cell-boolean",alignment:{horizontal:"Center",vertical:"Center"},font:{fontSize:12,fontName:"Wingdings 2",bold:!0}},{id:"right-cell",alignment:{horizontal:"Right",vertical:"Center"}},{id:"left-cell",alignment:{horizontal:"Left",vertical:"Center"}},{id:"center-cell-string",dataType:"String",alignment:{horizontal:"Center",vertical:"Center"}},{id:"right-cell-string",dataType:"String",alignment:{horizontal:"Right",vertical:"Center"}},{id:"left-cell-string",dataType:"String",alignment:{horizontal:"Left",vertical:"Center",wrapText:!0}}],t=t||{},t.rowDragManaged=t.rowDragManaged??f.ALLOW_DRAG.toString()==="1",t.enableHeaderTooltip=t.enableHeaderTooltip??!0,t.enableCellTooltip=t.enableCellTooltip??!0,t.rowHeight=t.rowHeight?t.rowHeight:G.toNumber(f.ROWHIGH)>0?G.toNumber(f.ROWHIGH):void 0;const p=f.MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single";G.toNumber(f.DISPLAY_WIDTH)>0&&this.setGridOptions(e,"miniHeight",G.toNumber(f.DISPLAY_WIDTH)+"px",!0),this.setGridOptions(e,"ShowQuickFilter",f.ALLOW_FIND_MODE,!0),this.setGridOptions(e,"RowSelection",p,!0),this.setGridOptions(e,"toolbarStyle",t.toolbarStyle,!0),o.rowSelection=p,o.treeData=f.FUNCTION_TYPE==="T",o.columnDefs=this.getGridColumnDefs(e,a,o,t),o.rowData=[],o.rowHeight=t.rowHeight,o.groupHeaderHeight=t.groupHeaderHeight,o.groupIncludeFooter=t.groupIncludeFooter??(f.SHOW_FOOTER==="1"&&t.aggDataInGroupRow!==!0),o.groupIncludeTotalFooter=t.groupIncludeTotalFooter??f.SHOW_FOOTER==="1",(((s=t==null?void 0:t.viewType)==null?void 0:s.toLowerCase())==="cardview"||((c=t==null?void 0:t.viewType)==null?void 0:c.toLowerCase())==="card")&&(o.groupIncludeFooter=!1,o.groupIncludeTotalFooter=!1),o.getRowId=m=>m.data.uid,o.gridId=e,o.suppressRowTransform=t.suppressRowTransform??!0,o.suppressRowClickSelection=t.suppressRowClickSelection??f.AUTO_SELECT_MODE.toString()!=="4",o.rowMultiSelectWithClick=t.rowMultiSelectWithClick??!0,o.singleClickEdit=t.singleClickEdit??!0,o.enableCellChangeFlash=t.enableCellChangeFlash??!1,o.rowBuffer=t.rowBuffer??10,o.debug=t.debug??!1,o.suppressCopyRowsToClipboard=t.suppressCopyRowsToClipboard??!1,o.suppressExcelExport=t.suppressExcelExport??!1,o.enableRangeHandle=!0,o.showOpenedGroup=!0,o.suppressPaginationPanel=!0,o.paginateChildRows=!0,o.stopEditingWhenCellsLoseFocus=!0,o.enableCellExpressions=!0,o.defaultColGroupDef={cellClass:"left-cell"},o.groupDisplayType=o.treeData?void 0:t.groupDisplayType||this.getFormSysInfo("GridGroupDisplayType")||"groupRows",o.context.rowSpanMap&&(o.suppressRowTransform=!0),o.groupDisplayType==="groupRows"&&(o.groupRowRendererParams={checkbox:p==="multiple"&&f.SHOW_SELECTION.toString()==="1",suppressCount:t.aggDataInGroupRow===!0,innerRenderer:m=>{var _,T,x,E,D,k,P,b,S;if((T=(_=m.node)==null?void 0:_.rowGroupColumn)!=null&&T.colDef){const w=(E=(x=m.node)==null?void 0:x.rowGroupColumn)==null?void 0:E.colDef;let I=m.node.key;if(w.cellDataType==="number"?I=G.formatNumberValue(m.value,(k=(D=w.context)==null?void 0:D.columnConfig)==null?void 0:k.FORMAT_STRING):((P=w.cellEditor)==null?void 0:P.name)==="DatetimeEditor"?I=G.getDateTimeFormatString(m.value,(S=(b=w.context)==null?void 0:b.columnConfig)==null?void 0:S.FORMAT_STRING):w.refData&&(I=w.refData[m.value]||m.value),t.aggDataInGroupRow===!0){let A=`
|
|
73
73
|
<div style="display: inline-block">
|
|
74
74
|
<span>${`${I}(${m.node.allChildrenCount})`}</span>`;return m.node.aggData&&Object.keys(m.node.aggData).length>0&&Object.keys(m.node.aggData).forEach(B=>{var V,N,W,j;const O=(V=m.columnApi.getColumn(B))==null?void 0:V.colDef,M=((N=O.headerName)==null?void 0:N.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||B,R=(j=(W=O.context)==null?void 0:W.columnConfig)==null?void 0:j.FORMAT_STRING,H=m.node.aggData[B];A+=`<span class="er-grid-group-row-col">${M}:</span>`,Zr.isPlainObject(H)?A+=`<span class="er-grid-group-row-agg">${G.formatNumberValue(H.aggValueOfChecked,R)+"/"+G.formatNumberValue(H.aggValue,R)}</span>`:A+=`<span class="er-grid-group-row-agg">${G.formatNumberValue(H,R)}</span>`}),A+="</div>",A}else return I}else return m.value}}),o.treeData?(o.getDataPath=m=>m[nt.TreeHierarchyFieldName],o.animateRows=(t==null?void 0:t.animateRows)??!0):o.autoGroupColumnDef=(t==null?void 0:t.autoGroupColumnDef)||{tooltipField:o.context.groupColumnFieldId,filter:"agSetColumnFilter",filterParams:{excelMode:(u=(d=o.context)==null?void 0:d.options)==null?void 0:u.excelMode,showTooltips:!0},pinned:"left",resizable:!0,sortable:!0},o.debounceVerticalScrollbar=(t==null?void 0:t.debounceVerticalScrollbar)??!0,o.enableAdvancedFilter=(t==null?void 0:t.enableAdvancedFilter)??!0,o.rowDragManaged=t.rowDragManaged,o.rowDragMultiRow=t.rowDragMultiRow,o.rowDragEntireRow=t.rowDragEntireRow??!1,o.enableRangeSelection=(t==null?void 0:t.enableRangeSelection)===!0||(t==null?void 0:t.enableRangeSelection)!==!1&&f.MULTI_SELECT_MODE.toString()==="3",o.enableBrowserTooltips=(t==null?void 0:t.enableBrowserTooltips)??!1,o.tooltipInteraction=(t==null?void 0:t.tooltipInteraction)??!0,o.allowContextMenuWithControlKey=(t==null?void 0:t.allowContextMenuWithControlKey)??!0,o.groupSelectsChildren=(t==null?void 0:t.groupSelectsChildren)??!0,o.context={...o.context,configId:e,viewType:(t==null?void 0:t.viewType)||"GridView",viewConfig:f,columnsConfig:h,editable:f.ALLOW_EDIT==="1",showPreview:f.SHOW_PREVIEW==="1"&&f.PREVIEW_FIELD_NAME.trim().length>0,previewField:f.PREVIEW_FIELD_NAME,detailConfigId:t==null?void 0:t.detailConfigId,options:t,toolbarOptions:n,pageOptions:i};const g=G.toString(t==null?void 0:t.viewType,!0).toLowerCase()||"gridview";g==="cardview"||g==="card"?o.getRowHeight=m=>{var T,x;return(((x=(T=o.context.options)==null?void 0:T.cardProperty)==null?void 0:x.contentFields.length)||1)*25+100}:o.context.aggForChecked?o.getRowHeight=m=>m.node.rowPinned||m.node.group?35:void 0:o.getRowHeight=t.getRowHeight}return o}setGridInitialEvent(e,t){var n,i;if((i=(n=e==null?void 0:e.gridOptions)==null?void 0:n.context)!=null&&i.configId){const o=e.gridOptions.context.configId,a=this.getConfigInfo(o);e.gridOptions.api.addEventListener("firstDataRendered",s=>{var f,h,p,g,m,_,T;e.gridOptions.context.filterCountsMap={},a.TSI00GRIDVIEW[0].AUTO_EXPAND_GROUP==="1"&&s.api.expandAll();const c=s.api.getFilterModel(),d=s.columnApi.getColumnState().filter(x=>x.sort!==null);if(Object.keys(c).length>0||d.length>0)if(e.gridOptions.context.calculateRowSpan&&e.gridOptions.context.calculateRowSpan instanceof Function){const x=e.gridOptions.context.calculateRowSpan(!1);e.gridOptions.api.redrawRows(),e.gridOptions.context.bindingSource.setCurrent(x)}else cr.setGridFocusedCell(e,0);else{const x=e.gridOptions.context.bindingSource.data()[0];e.gridOptions.context.bindingSource.setCurrent(x)}if((h=(f=e==null?void 0:e.gridOptions)==null?void 0:f.context)!=null&&h.showPreview&&((g=(p=e==null?void 0:e.gridOptions)==null?void 0:p.context)!=null&&g.previewField)&&!t.detailConfigId){const x=e.gridOptions.context.previewField.split(","),E={};x.forEach(k=>{var P;if(k.trim().length>0){let b="";const S=(P=e.gridOptions.context.columnsConfig)==null?void 0:P.find(w=>w.FIELD_NAME===k.trim());S&&(b=(S.CUS_COL_CAPTION||S.COL_CAPTION).replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>","")),E[k.trim()]=b}});const D=Object.keys(E);D.length>0&&(e.gridOptions.context.previewFieldMap=E,s.api.forEachNode(k=>{const P=[];D.forEach(b=>{var S;(S=k.data)!=null&&S[b]&&P.push({label:E[b],value:k.data[b]})}),P.length>0&&(k.data._preview_row_data=P,k.setExpanded(!0))}))}const u=(m=s.api)==null?void 0:m.getStatusPanel("InformationPanel");u?u.setInformation():(T=(_=e.gridOptions.context.informationPanelComponentRef)==null?void 0:_.value)==null||T.setInformation()}),e.gridOptions.api.addEventListener("selectionChanged",s=>{var c,d,u,f;if(e.gridOptions.context.aggForChecked&&((c=s.api)==null||c.refreshCells({force:!0}),this.refreshGridFooterData(e),((d=e.gridOptions.context.options)==null?void 0:d.aggDataInGroupRow)===!0&&s.columnApi.getRowGroupColumns().length>0)){const p=[];(u=s.api)==null||u.forEachNode(g=>{g.group&&p.push(g)}),(f=s.api)==null||f.redrawRows({rowNodes:p})}}),e.gridOptions.api.addEventListener("rowSelected",s=>{s.source==="checkboxSelected"&&this.processRowSelectedEvent(s)}),e.gridOptions.api.addEventListener("cellEditingStarted",s=>{var c;e.gridOptions.suppressContextMenu=!0,(c=e.gridOptions.context.bindingSource)==null||c.setInitialValuesForEdit(s.data,s.colDef.field)}),e.gridOptions.api.addEventListener("cellEditingStopped",s=>{e.gridOptions.suppressContextMenu=!1}),e.gridOptions.api.addEventListener("cellEditingStopped",s=>{e.gridOptions.suppressContextMenu=!1}),e.gridOptions.api.addEventListener("sortChanged",s=>{var u,f,h,p;let c;e.gridOptions.context.calculateRowSpan&&e.gridOptions.context.calculateRowSpan instanceof Function&&(c=e.gridOptions.context.calculateRowSpan(!1)),(t==null?void 0:t.showRowNo)!==!1&&((u=s.api)==null||u.redrawRows()),c?e.gridOptions.context.bindingSource.setCurrent(c):s.api.setFocusedCell(0,nt.GridCheckColumnFieldName);const d=(f=s.api)==null?void 0:f.getStatusPanel("InformationPanel");d?d.setInformation():(p=(h=e.gridOptions.context.informationPanelComponentRef)==null?void 0:h.value)==null||p.setInformation()}),e.gridOptions.api.addEventListener("filterOpened",s=>{s.context.filterCountsMap={}}),e.gridOptions.api.addEventListener("filterChanged",s=>{var u,f,h,p,g,m,_,T,x,E;let c;if(e.gridOptions.context.calculateRowSpan&&e.gridOptions.context.calculateRowSpan instanceof Function&&(c=e.gridOptions.context.calculateRowSpan(!1)),(t==null?void 0:t.showRowNo)!==!1&&((u=s.api)==null||u.redrawRows()),c?e.gridOptions.context.bindingSource.setCurrent(c):((f=e.gridOptions.context.options)==null?void 0:f.showApplyFilterButton)===!0&&s.api.setFocusedCell(0,nt.GridCheckColumnFieldName),((h=s==null?void 0:s.context)==null?void 0:h.viewConfig.SHOW_FOOTER)==="1"&&((p=s==null?void 0:s.context.viewType)==null?void 0:p.toLowerCase())!=="cardview"&&((g=s==null?void 0:s.context.viewType)==null?void 0:g.toLowerCase())!=="card"){const D=s.api.getModel();(_=s.api)==null||_.setPinnedBottomRowData([{...(m=D==null?void 0:D.rootNode)==null?void 0:m.aggData,pinndeRowType:"ErGridSummaryFooter"}])}const d=(T=s.api)==null?void 0:T.getStatusPanel("InformationPanel");d?d.setInformation():(E=(x=e.gridOptions.context.informationPanelComponentRef)==null?void 0:x.value)==null||E.setInformation()}),e.gridOptions.api.addEventListener("rowDragEnd",s=>{var c,d;e.gridOptions.context.calculateRowSpan&&e.gridOptions.context.calculateRowSpan instanceof Function?(e.gridOptions.context.calculateRowSpan(!1),(c=s.api)==null||c.redrawRows()):(t==null?void 0:t.showRowNo)!==!1&&((d=s.api)==null||d.refreshCells({columns:[nt.GridCheckColumnFieldName]}))}),e.gridOptions.api.addEventListener("columnRowGroupChanged",s=>{var c,d;e.gridOptions.context.groupByFields=void 0,e.gridOptions.context.groupColumnFieldId=void 0,e.gridOptions.context.calculateRowSpan&&e.gridOptions.context.calculateRowSpan instanceof Function?(e.gridOptions.context.calculateRowSpan(!1),(c=s.api)==null||c.redrawRows()):(t==null?void 0:t.showRowNo)!==!1&&((d=s.api)==null||d.redrawRows())}),e.gridOptions.api.addEventListener("rowGroupOpened",s=>{var c,d;(c=s.api)==null||c.redrawRows({rowNodes:[s.node]}),(t==null?void 0:t.showRowNo)!==!1&&((d=s.api)==null||d.refreshCells({columns:[nt.GridCheckColumnFieldName]}))}),e.gridOptions.api.addEventListener("expandOrCollapseAll",s=>{var c;(t==null?void 0:t.showRowNo)!==!1&&((c=s.api)==null||c.refreshCells({columns:[nt.GridCheckColumnFieldName]}))}),e.gridOptions.api.addEventListener("cellValueChanged",s=>{var c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v,A,B;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof qr){if(((c=s.data.schemaFields[s.colDef.field])==null?void 0:c.type)==="datetime"||((d=s.data.schemaFields[s.colDef.field])==null?void 0:d.type)==="time")s.data[s.colDef.field]=G.getDateTimeByString(s.newValue);else if(((u=s.data.schemaFields[s.colDef.field])==null?void 0:u.type)==="boolean")s.data[s.colDef.field]=s.newValue===!0||s.newValue==="1"||s.newValue==="True"||s.newValue==="true";else if(((f=s.data.schemaFields[s.colDef.field])==null?void 0:f.type)==="number")s.data[s.colDef.field]=G.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const R=s.colDef.context.displayFormat||"",H=G.toString(s.newValue,!0);if(H.length>0){if(R.trim().startsWith("{0}|")&&H.includes("|")){const V=H.split("|")[0];(p=s.colDef.refData)!=null&&p[V]?s.data[s.colDef.field]=V:s.data[s.colDef.field]=""}else if(R.trim().startsWith("{0}-")&&H.includes("-")){const V=H.split("-")[0];(g=s.colDef.refData)!=null&&g[V]?s.data[s.colDef.field]=V:s.data[s.colDef.field]=""}else if(R.trim().endsWith("{0}|")&&H.includes("|")){const V=H.split("|"),N=V[V.length-1];(m=s.colDef.refData)!=null&&m[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(R.trim().endsWith("{0}-")&&H.includes("-")){const V=H.split("-"),N=V[V.length-1];(_=s.colDef.refData)!=null&&_[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(R.length>0){const V=Object.keys(s.colDef.refData);let N="";for(let W=0;W<V.length;W++)if(((T=s.colDef.refData)==null?void 0:T[V[W]])===H){N=V[W];break}s.data[s.colDef.field]=N}}}}const O=(x=e.gridOptions.context.bindingSource)==null?void 0:x.getInitialValuesForEdit(s.data,s.colDef.field);O!==void 0&&O!==s.data[s.colDef.field]?s.data.dirtyFields[s.colDef.field]=!0:(E=s.data.dirtyFields)==null||delete E[s.colDef.field],s.data.dirty=Object.keys(s.data.dirtyFields).length>0,this.setDropDownAutoFillFieldsForGrid(e,s.colDef.colId,s.node),this.DropDownCascader[o+s.colDef.colId]&&this.DropDownCascader[o+s.colDef.colId].forEach(R=>{var H,V,N;if(R.FUNCTION_TYPE&&R.FUNCTION_ID&&R.ITEM_CODE){let W="";const j=s.data[s.colDef.field],U=this.getSingleItemConfigInfo(R.FUNCTION_ID,R.ITEM_CODE),ie=this.getItemDropDownDataSource(R.FUNCTION_ID,R.ITEM_CODE);if(s.data[s.colDef.field]){const X=this.filterDropDownCascaderDataSource(ie,R.FORM_FILTER,s.data[s.colDef.field]);if((X==null?void 0:X.length)>0){const Y=(H=this.DropDownBindSource[R.FUNCTION_ID])==null?void 0:H[R.ITEM_CODE];Y.dataValueField&&(j&&X.some(Z=>Z[Y.dataValueField]===j)?W=j:(((V=U==null?void 0:U.DEFAULT_VALUE)==null?void 0:V.trim().toLowerCase())==="$first_row$"||((N=U==null?void 0:U.DEFAULT_VALUE)==null?void 0:N.trim().toLowerCase())==="{first_row}")&&(W=X[0][Y.dataValueField]))}}R.FUNCTION_TYPE==="F"?this.setControlValue(R.FUNCTION_ID,R.ITEM_CODE,W):R.FUNCTION_ID===o&&(s.data[R.ITEM_CODE]=W)}});let M=(k=(D=s.context)==null?void 0:D.viewConfig)==null?void 0:k.AUTO_SELECT_MODE;if(M==="2"||M==="3")this.checkGridRow(o,s.data.uid);else if(((S=(b=(P=s.colDef)==null?void 0:P.context)==null?void 0:b.columnConfig)==null?void 0:S.MULTI_ROW_EDIT)==="1"&&((w=s.node)!=null&&w.selected)){const R=this.getGridOptions(o,"multiRowEdit");if(R!==!1&&R!=="0"){let H=!1;(t==null?void 0:t.multiRowEditType)==="all"?e.gridOptions.api.forEachLeafNode(V=>{var N;V!=null&&V.selected&&((N=V.data)!=null&&N.uid)&&V.data.uid!==s.data.uid&&(V.setDataValue(s.colDef.field,s.data[s.colDef.field]),H=!0)}):e.gridOptions.api.forEachNodeAfterFilter(V=>{var N;V!=null&&V.selected&&((N=V.data)!=null&&N.uid)&&V.data.uid!==s.data.uid&&(V.setDataValue(s.colDef.field,s.data[s.colDef.field]),H=!0)}),H&&s.api.refreshCells({columns:[nt.GridCheckColumnFieldName]})}}if(((I=s==null?void 0:s.context)==null?void 0:I.viewConfig.SHOW_FOOTER)==="1"&&((v=s==null?void 0:s.context.viewType)==null?void 0:v.toLowerCase())!=="cardview"&&((A=s==null?void 0:s.context.viewType)==null?void 0:A.toLowerCase())!=="card"){const R=s.api.getModel();s.api.setPinnedBottomRowData([{...(B=R==null?void 0:R.rootNode)==null?void 0:B.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[nt.GridCheckColumnFieldName,s.colDef.colId]})}})}}processRowSelectedEvent(e){var t;if(e.event){const n=((t=e.api)==null?void 0:t.getCellRanges())||[];n.length>0&&n.forEach(i=>{var o;if(i.columns.length===1&&i.columns[0].colId===nt.GridCheckColumnFieldName){const a=(o=e.api)==null?void 0:o.getModel();if(a){const s=[];for(let c=i.startRow.rowIndex;c<=i.endRow.rowIndex;c++){const d=a.getRow(c);d&&s.push(d)}e.api.setNodesSelected({nodes:s,newValue:e.node.isSelected()})}}})}}getGridContextMenuItems(e,t){var i,o,a,s,c,d,u,f,h,p,g,m,_,T,x,E,D,k,P,b,S,w,I,v;const n=[];if(e.api.getDisplayedRowCount()>0){(i=e.node)!=null&&i.group&&((o=e.node)==null?void 0:o.footer)===void 0||(n.push("copy"),n.push({name:this.$t("ERX.ErGrid.CopyValue")||"复制值",action:()=>{e.context.copyValue=!0,e.api.copyToClipboard(),e.context.copyValue=!1}}),n.push("copyWithHeaders"),n.push({name:this.$t("ERX.ErGrid.CopyValueWithHeaders")||"带标题复制值",action:()=>{e.context.copyValue=!0,e.api.copyToClipboard({includeHeaders:!0}),e.context.copyValue=!1}}));const A=this.getConfigInfo(e.context.configId),B=[];if(A.TSI00GRIDSTYLE&&A.TSI00GRIDSTYLE.forEach(O=>{(O.NTYPE==="W_Fore"||O.NTYPE==="W_Back")&&O.REMARK.toUpperCase().trim().length>0&&B.push({text:O.REMARK,type:O.NTYPE,fontName:O.TEXT_COLOR,fontStyle:O.FONTNAME,color:O.FILL_COLOR})}),B.length>0&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.StyleDesc")||"样式说明",action:()=>{Ke.Modal.info({title:this.$t("ERX.ErGrid.StyleDesc")||"样式说明",type:"info",okText:this.$t("ERX.Close")||"关闭",content:()=>l.h("div",{style:{width:"100%"}},B.map(O=>l.h("span",{style:{[O.type==="W_Fore"?"color":"backgroundColor"]:G.toHexColor(O.color),fontFamily:O.fontName,fontStyle:O.fontStyle==="Italic"?"italic":"normal",fontWeight:O.fontStyle==="Bold"?"bold":"normal",display:"block",width:"100%",padding:"4px",marginBottom:"4px",boxSizing:"border-box",lineHeight:"1.2"}},O.text)))})},icon:G.createErSvgElement("style")})),(t==null?void 0:t.showDetailForm)!==!1&&e.node&&e.node.group!==!0&&e.node.rowPinned===void 0&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.ShowDetailForm")||"查看明细",action:async()=>{var M,R,H,V,N,W,j,U,ie,X,Y,Z,ce,ue,he,re,z,K,ke,Q,oe,de,ae,ye,He,ge,We,Te,_e;let O=e.context.detailFormHelper;if(!O){let be=this._formName,xe=(M=e.context)==null?void 0:M.configId,Ie=((H=(R=e.context)==null?void 0:R.viewConfig)==null?void 0:H.EDIT_COLS_COUNT)||3,Se=`${e.context.configCaption||this.$t("ERX.ErGrid.ShowDetailForm")||"查看明细"}`;Ie<=0&&(Ie=3);const Ve=e.columnApi.columnModel.displayedColumns.length;let Ce=Math.floor(Ve/Ie)*30+120;Ce<200?Ce=200:Ce>650&&(Ce=650);let se;if(typeof t.showDetailForm=="string"&&((V=t.showDetailForm)==null?void 0:V.trim().length)>0){const Ne=(N=t.showDetailForm)==null?void 0:N.trim().split(/[./]/);((W=Ne[0])==null?void 0:W.trim().length)>0&&((j=Ne[1])==null?void 0:j.trim().length)>0&&(be=(U=Ne[0])==null?void 0:U.trim(),xe=(ie=Ne[1])==null?void 0:ie.trim(),Ce=void 0,Se=void 0,se=void 0)}else if(Zr.isPlainObject(t.showDetailForm)&&((Y=(X=t.showDetailForm)==null?void 0:X.configId)==null?void 0:Y.trim().length)>0){const Ne=(Z=t.showDetailForm.configId)==null?void 0:Z.trim().split(/[./]/);((ce=Ne[0])==null?void 0:ce.trim().length)>0&&((ue=Ne[1])==null?void 0:ue.trim().length)>0&&(be=(he=Ne[0])==null?void 0:he.trim(),xe=(re=Ne[1])==null?void 0:re.trim(),Ce=t.showDetailForm.height,Se=t.showDetailForm.title,se=t.showDetailForm.width)}const{PopFreeHelper:me}=await Promise.resolve().then(()=>od);O=new me(this._serverPartition,be,xe,this._serviceName),O.setFormOptions({height:Ce,title:Se,width:se}),O.BordStyle="Sizable"}e.context.detailFormHelper=O,(K=(z=e.context)==null?void 0:z.options)!=null&&K.detailItemValueChanged&&((Q=(ke=e==null?void 0:e.context)==null?void 0:ke.options)==null?void 0:Q.detailItemValueChanged)instanceof Function?O.setEvent("itemValueChanged",(de=(oe=e.context)==null?void 0:oe.options)==null?void 0:de.detailItemValueChanged):O.setEvent("ok",be=>{var xe;if((xe=be.dataModel)!=null&&xe.dirty){const Ie={};Object.keys(be.dataModel.dirtyFields).forEach(Se=>{Ie[Se]=be.dataModel[Se]}),e.node.data.setData(Ie)}}),(ye=(ae=e.context)==null?void 0:ae.options)!=null&&ye.detailItemButtonClick&&((ge=(He=e.context)==null?void 0:He.options)==null?void 0:ge.detailItemButtonClick)instanceof Function&&O.setEvent("itemButtonClick",(Te=(We=e.context)==null?void 0:We.options)==null?void 0:Te.detailItemButtonClick),O.ReceiveData(e.node.data),O.EditType=(_e=e.context)!=null&&_e.editable?"Modify":"Query",O.show(null)},icon:G.createErSvgElement("show-detail")})),((a=A.TSI00GRIDCOLUMNURL)==null?void 0:a.length)>0&&((c=(s=e.node)==null?void 0:s.data)!=null&&c.uid)&&!((u=(d=e.node)==null?void 0:d.data)!=null&&u.isNew)){const O=[];if(A.TSI00GRIDCOLUMNURL.forEach(M=>{var R,H,V;((R=M.CALL_FORM)==null?void 0:R.trim().length)>0&&(M.ITEM_CODE==="*"||M.ITEM_CODE===e.column.colDef.colId)&&(((H=M.CONDITION)==null?void 0:H.trim().length)>0&&G.checkExpressionValid(e.node.data,M.CONDITION)||((V=M.CONDITION)==null?void 0:V.trim().length)===0)&&O.push(M)}),O.length>0){let M=1;n.push("separator"),O.forEach(R=>{n.push({name:R.MENU_NAME,action:()=>{var H,V,N,W;if(((H=R.MENU_NAME)==null?void 0:H.trim())==="附件管理"||((V=R.MENU_NAME)==null?void 0:V.trim())==="管理附件"){const j=new g1;j.setOptions({relationId:"",refreshKey:G.guid(),readonly:!1,multiple:!0,maxCount:1,showFileDateTime:!0,showFileSize:!0}),j.showPopAttachment(null)}else{let j=(N=R.CALL_FORM)==null?void 0:N.trim();const U=(W=e.node)==null?void 0:W.data.toJSON();j.endsWith("??")?(j=j.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(U)))):j.endsWith("?")&&(j=j.replace("?",""),encodeURIComponent(JSON.stringify(U))),this.setLocalStorage(j,{senderType:"gridCell",value:e.value,data:U,formNameFrom:this.FormName})}},icon:G.createErSvgElement(`number-${M}`)}),M++})}}if(((h=(f=e.node)==null?void 0:f.childrenAfterFilter)==null?void 0:h.length)>0&&e.node.group===!0&&e.node.footer!==!0&&n.push("separator","expandAll","contractAll"),t!=null&&t.allowImageUpload&&((m=(g=(p=e.column)==null?void 0:p.colDef)==null?void 0:g.cellRenderer)==null?void 0:m.name)==="ImagePreview"&&((T=(_=e.node)==null?void 0:_.data)!=null&&T.uid)&&!((E=(x=e.node)==null?void 0:x.data)!=null&&E.isNew)&&((k=(D=e.column)==null?void 0:D.colDef.context.columnConfig.EXT_OPTIONS)==null?void 0:k.trim().length)>0){const O=JSON.parse((P=e.column)==null?void 0:P.colDef.context.columnConfig.EXT_OPTIONS);if(((b=O==null?void 0:O.imageUploadDir)==null?void 0:b.trim().length)>0&&((S=O.imageUploadKeyField)==null?void 0:S.trim().length)>0){const M=e.node.data[O.imageUploadKeyField];if((M==null?void 0:M.trim().length)>0){let R="";(w=O==null?void 0:O.imageUploadDir)!=null&&w.trim().startsWith("/")?R=(I=O==null?void 0:O.imageUploadDir)==null?void 0:I.trim():R=`/${(v=O==null?void 0:O.imageUploadDir)==null?void 0:v.trim()}`,R=`${R}/${M==null?void 0:M.trim()}`,n.push("separator"),n.push({name:this.$t("ERX.ErGrid.UploadImage")||"上传图片",action:()=>{const H=new g1;H.setOptions({relationId:R,refreshKey:G.guid(),readonly:!1,multiple:!0,maxCount:1,showFileDateTime:!0,showFileSize:!0,afterUpload(V){t!=null&&t.afterUpload&&t.afterUpload instanceof Function&&(e.file=V,t.afterUpload(e))},afterRemove(V){t!=null&&t.afterRemove&&t.afterRemove instanceof Function&&(e.file=V,t.afterRemove(e))}}),H.showPopAttachment(null)}})}}}}if(e.api.isColumnFilterPresent()&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{e.api.setFilterModel(null)}})),t!=null&&t.customContextMenu&&t.customContextMenu instanceof Function){const A=t.customContextMenu(e);A&&A.length>0&&(n.length>0&&n.push("separator"),n.push(...A))}return n}setGridContextMenu(e,t){var i,o;const n=this.getGrid(e);n&&((i=t==null?void 0:t.viewType)==null?void 0:i.toLowerCase())!=="card"&&((o=t==null?void 0:t.viewType)==null?void 0:o.toLowerCase())!=="cardview"&&(n.gridOptions.getContextMenuItems=a=>this.getGridContextMenuItems(a,t))}async getExtendOptions(e,t,n,i,o,a){var h;let s="",c="";if(i&&i.trim().length>0){const p=i.split(",");i=p[0],p.length>1&&(c=p[1])}const d={QUERY_TYPE:e,FORM_NAME:t||this._formName,FUNCTION_ID:n,ROW_GUID:i,COMPANY_CODE:a||this.DefaultConfigCompanyCode,ITEM_CODE:c},u=rt.buildMap([d]),f=await Bn.callServiceEx(nt.queryDevConfigService,u,{partition:o||this._serverPartition});return f.sysFlag>=0&&(s=G.toString((h=f.getMapData("TSI00FORMEXT")[0])==null?void 0:h.EXT_OPTIONS,!0)),s}async showExtOptionsEdit(e,t,n,i,o,a,s=!1,c){var _;const d=new d1({width:600,height:650,extension:"json"});let u="";if(i&&i.trim().length>0){const T=i.split(",");i=T[0],T.length>1&&(u=T[1])}const f={QUERY_TYPE:e,FORM_NAME:t||this._formName,FUNCTION_ID:n,ROW_GUID:i,COMPANY_CODE:a||this.DefaultConfigCompanyCode,ITEM_CODE:u},h=async()=>{const T=rt.buildMap([f]),x=await Bn.callServiceEx(nt.queryDevConfigService,T,{partition:o||this._serverPartition});return x.sysFlag<0&&G.messageError(x.sysMsg),x};let p="",g;const m=await h();if(m.sysFlag>=0){p=G.toString((_=m.getMapData()[0])==null?void 0:_.EXT_OPTIONS,!0);const T=p?JSON.parse(p):{};T.structureOptions&&(g=T.structureOptions,delete T.structureOptions,p=JSON.stringify(T))}d.CancelButtonCaption=G.$t("ERX.Close")||"关闭",d.CloseDialogWhenOkClick=s,d.setEvent("ok",async()=>{if(p=d.Content,g){const E=p?JSON.parse(p):{};p=JSON.stringify({...E,structureOptions:g})}const T=rt.buildMap([{...f,EXT_OPTIONS:p}],f.QUERY_TYPE.toUpperCase()),x=await Bn.callServiceEx(nt.saveDevConfigService,T,{partition:o||this._serverPartition});return x.sysFlag<0?G.messageError(x.sysMsg):G.messageSuccess(G.$t("ERX.OperateSuccess")||"操作成功!"),x.sysFlag>=0}),d.setOptions({title:f.QUERY_TYPE==="tsi00formext"?`Form Extend Options [${f.FORM_NAME}]`:f.QUERY_TYPE==="tsi00gridviewext"?`View Extend Options [${f.FORM_NAME}.${f.FUNCTION_ID}]`:`Item Extend Options [${f.FORM_NAME}.${f.FUNCTION_ID}.${u}]`}),d.show(p)}async showViewOptionsEdit(e,t,n,i=!1,o){let a={};const s=rt.buildMap({QUERY_TYPE:"tsi00gridview",FORM_NAME:e,FUNCTION_ID:t}),c=await Bn.callServiceEx(nt.queryDevConfigService,s,{partition:n||this._serverPartition});if(c.sysFlag<0){G.messageError(c.sysMsg);return}else if(c.getMapData().length===0){G.messageError("Data not found!");return}else a=c.getMapData()[0];const{PopFreeHelper:d}=await Promise.resolve().then(()=>od),u=new d(n||this._serverPartition,a.FUNCTION_TYPE==="F"?"SI00LayoutEdit":a.FUNCTION_TYPE==="T"?"SI00TreeListEdit":"SI00GridViewEdit","LayoutGroupMain",this.InitialService);u.EditType="Modify",u.OkButtonService=nt.saveDevConfigService,u.OkButtonCaption=G.$t("ERX.Save")||"Save",u.CancelButtonCaption=G.$t("ERX.Close")||"Close",u.CloseDialogWhenOkClick=i,u.ReceiveData(a),u.setEvent("open",f=>{o!=null&&o.open&&o.open instanceof Function&&o.open(f)}),o!=null&&o.colse&&o.colse instanceof Function&&u.setEvent("close",f=>{f.isModified&&o.colse(f)}),u.setEvent("itemButtonClick",async f=>{if(f.itemCode==="DATASET_NAME")if(f.type==="clear")u.FormHelper.setControlEmptyValue("LayoutGroupMain","DATASET_NAME,TABLE_NAME");else{const{PopTreeHelper:h}=await Promise.resolve().then(()=>JD),p=new h("CURRENT_NODE_CODE","PARENT_NODE_CODE","CURRENT_NODE_DESC",{title:"DataSet Config List",devTreeNodeIcon:!0});p.BordStyle="Fixed",p.setOptions({showFindPanel:!0});const g=async()=>{const m=await u.FormHelper.callServiceEx(nt.queryDevConfigService,rt.buildMap({QUERY_TYPE:"tsi00datasettree"}));return m.sysFlag<0?(G.messageError(m.sysMsg),[]):m.getMapData()[0]};p.receiveData(g),p.BeforeOkButtonClick=m=>(m==null?void 0:m.NODE_TYPE)!=="DataTable"?!1:m,p.show(null,m=>{m!=null&&m.data&&(u.FormHelper.setControlValue("LayoutGroupMain","DATASET_NAME",m.data.DATASET_NAME),u.FormHelper.setControlValue("LayoutGroupMain","TABLE_NAME",m.data.DATATABLE_NAME))})}}),u.show(null)}async showFormOptionsEdit(e,t,n=!1,i){let o={},a=[],s=rt.buildMap([{QUERY_TYPE:"TSI00MODULE",MODULE_TYPE:"15"}]),c=await this.callServiceEx(nt.queryDevConfigService,s);if(c.sysFlag<0){G.messageError(c.sysMsg);return}else a=c.getMapData().map(f=>({CODE:f.MODULE_ENAME,CODE_DESC_1_CONTENT:f.MODULE_CNAME}));const{PopFreeHelper:d}=await Promise.resolve().then(()=>od),u=new d(t||this._serverPartition,"SI00FormEdit","LayoutGroupMain",this.InitialService);if(u.EditType="Modify",u.OkButtonService=nt.saveDevConfigService,u.OkButtonCaption=G.$t("ERX.Save")||"Save",u.CancelButtonCaption=G.$t("ERX.Close")||"Close",u.CloseDialogWhenOkClick=n,s=rt.buildMap({QUERY_TYPE:"tsi00form",FORM_NAME:e}),c=await this.callServiceEx(nt.queryDevConfigService,s),c.sysFlag<0){G.messageError(c.sysMsg);return}else if(c.getMapData().length===0){G.messageError("Data not found!");return}else o=c.getMapData()[0];u.ReceiveData(o),u.setEvent("initial",()=>{u.FormHelper.reloadDropDownDataSource("LayoutGroupMain","MODULE_TYPE",a)}),u.setEvent("open",f=>{i!=null&&i.open&&i.open instanceof Function&&i.open(f)}),i!=null&&i.colse&&i.colse instanceof Function&&u.setEvent("close",f=>{i.colse(f)}),u.show(null)}getGridColumnDefs(e,t,n,i){var D,k,P,b,S,w,I,v,A,B,O,M,R,H,V,N,W,j,U,ie,X,Y,Z,ce,ue,he;let o=[];const a={};this._gridColumnsConfigInfo[e]={},this._gridOptions[e]=this._gridOptions[e]||{};const s=t.TSI00GRIDVIEW[0],c=t.TSI00GRIDCOLUMN,d=t.TSI00GRIDVIEW[0].TABLE_NAME;this.setBindingTableName(e);const u=(D=this._formDataSet)==null?void 0:D.dataTables[d];u?(u.setBindingInfo(this,e,"Grid"),u.setAllowCancelChanges(i==null?void 0:i.allowCancelChanges)):console.error("ER: Could not find binding table of configuration ["+e+"]"),n.context={options:i,bindingSource:u,bindTableName:d,mergeColumns:[]};const f=[];this._gridOptions[e].styleConfigInfo={rowStyle:[],cellStyle:{}};const h=[];if(t.TSI00GRIDSTYLE&&t.TSI00GRIDSTYLE.length>0){let re=1;t.TSI00GRIDSTYLE.forEach(z=>{const K=`condition-style-${re++}`;z.NTYPE==="W_Back"?(h.push({id:K,condition:z.REGULAR_EXPRESS,columnNames:z.COL_NAME.toUpperCase().trim().split(",").filter(ke=>ke.trim().length>0),style:{id:K,interior:{color:G.toHexColor(z.FILL_COLOR),pattern:"Solid"}}}),n.excelStyles.push({id:K,interior:{color:G.toHexColor(z.FILL_COLOR),pattern:"Solid"}})):z.NTYPE==="W_Fore"&&(h.push({id:K,condition:z.REGULAR_EXPRESS,columnNames:z.COL_NAME.toUpperCase().trim().split(",").filter(ke=>ke.trim().length>0),style:{id:K,font:{color:G.toHexColor(z.FILL_COLOR),name:z.FONTNAME,size:z.FONT_SIZE,bold:z.FONT_WEIGHT==="bold",italic:z.FONT_STYLE==="italic",underline:z.FONT_STYLE==="underline",strike:z.FONT_STYLE==="strike"}}}),n.excelStyles.push({id:K,font:{color:G.toHexColor(z.FILL_COLOR),name:z.FONTNAME,size:z.FONT_SIZE,bold:z.FONT_WEIGHT==="bold",italic:z.FONT_STYLE==="italic",underline:z.FONT_STYLE==="underline",strike:z.FONT_STYLE==="strike"}})),(z.NTYPE==="W_Fore"||z.NTYPE==="W_Back")&&(z.COL_NAME.toUpperCase().trim().length===0?this._gridOptions[e].styleConfigInfo.rowStyle.push({type:z.NTYPE,fillColor:z.FILL_COLOR,fontFamily:z.TEXT_COLOR,fontStyle:z.FONTNAME,columnNames:z.COL_NAME.toUpperCase().trim(),condition:z.REGULAR_EXPRESS}):z.COL_NAME.toUpperCase().trim().split(",").forEach(ke=>{ke.trim().length>0&&(this._gridOptions[e].styleConfigInfo.cellStyle[ke]||(this._gridOptions[e].styleConfigInfo.cellStyle[ke]=[]),this._gridOptions[e].styleConfigInfo.cellStyle[ke].push({id:K,type:z.NTYPE,fillColor:z.FILL_COLOR,fontFamily:z.TEXT_COLOR,fontStyle:z.FONTNAME,columnNames:z.COL_NAME.toUpperCase().trim(),condition:z.REGULAR_EXPRESS}))}))})}n.context.excelStyleConfig=h;const p=this.getModelFields(u),g=[],m={};let _,T;const x=G.toString(i==null?void 0:i.viewType,!0).toLowerCase()||"gridview";(x==="band"||x==="bandview"&&((k=t.TSI00GRIDBAND)==null?void 0:k.length)>0)&&this.createGridBandColumn(t.TSI00GRIDBAND,g,m,void 0,i),g.length>0&&(o=g);let E={};for(let re=0;re<c.length;re++){const z=c[re];if(z.extendOptions=((P=z==null?void 0:z.EXT_OPTIONS)==null?void 0:P.trim().length)>0?JSON.parse(z.EXT_OPTIONS):{},z.FUNCTION_TYPE=s.FUNCTION_TYPE,this._gridColumnsConfigInfo[e][z.ITEM_CODE]=z,g.length>0&&(z.BAND_NAME.toString().trim().length===0||m[z.BAND_NAME.toString().trim()]===void 0))continue;let K;if(p&&p[z.FIELD_NAME]&&p[z.FIELD_NAME].type)K=p[z.FIELD_NAME].type,z.ITEM_MUST_FLAG==="1"&&(p[z.FIELD_NAME].validation={required:!0});else if(z.UNBOUND_TYPE!=="0")switch(z.UNBOUND_TYPE){case"2":case"3":K="number";break;case"4":K="datetime";case"5":K="boolean";break;default:K="string";break}z.COLUMN_EDIT==="B"&&(K="button");let ke=!1;z.CUS_COL_FIX_TYPE?ke=z.CUS_COL_FIX_TYPE==="L"?"left":z.CUS_COL_FIX_TYPE==="R"?"right":!1:ke=z.COL_FIX_TYPE==="L"?"left":z.COL_FIX_TYPE==="R"?"right":!1,this.IsRtl&&(ke==="left"?ke="right":ke==="right"&&(ke="left"));const Q=G.toHexColor(z.HEAD_TEXTCOLOR),oe=G.toHexColor(z.HEAD_BACKCOLOR),de=G.toNumber(z.HEAD_FONTSIZE);let ae="";if(z.ALLOW_EDIT==="1"&&z.UNBOUND_TYPE==="0"&&t.TSI00GRIDSTYLE){const Ie=t.TSI00GRIDSTYLE.find(Se=>{var Ve,Ce;return Se.NTYPE==="W_Hf4Edit"&&(((Ve=Se.COL_NAME)==null?void 0:Ve.trim().length)===0||((Ce=Se.COL_NAME)==null?void 0:Ce.includes(z.FIELD_NAME)))});Ie&&(ae=G.toHexColor(Ie.FILL_COLOR))}E={...z.extendOptions,...(b=i.columnOptions)==null?void 0:b[z.ITEM_CODE]};let ye=z.ALLOW_EDIT==="1";K==="boolean"&&(ye=z.ALLOW_EDIT==="1"&&z.READ_ONLY!=="1"),((w=(S=i.columnOptions)==null?void 0:S[z.ITEM_CODE])==null?void 0:w.editable)!==void 0&&(ye=i.columnOptions[z.ITEM_CODE].editable);const He=K!=="boolean"&&((i==null?void 0:i.wrapText)===!0||G.toString(i==null?void 0:i.wrapText).split(",").includes(z.ITEM_CODE)),ge={isPrimaryKey:(I=this.getGridOptions(e,"primaryKeys"))==null?void 0:I.includes(z.ITEM_CODE),simpleHeader:i==null?void 0:i.simpleHeader,fontSize:de>0?`${de}px`:"unset",color:ae||Q,backgroundColor:oe,title:z.CUS_COL_CAPTION||z.COL_CAPTION},We=z.CUS_GROUP_SORT_TYPE||z.GROUP_SORT_TYPE;if(E={...E,pinned:ke,lockPosition:ke,colId:z.ITEM_CODE,field:K==="button"?void 0:z.FIELD_NAME,headerName:z.CUS_COL_CAPTION||z.COL_CAPTION,headerTooltip:i!=null&&i.enableHeaderTooltip?(z.CUS_COL_CAPTION||z.COL_CAPTION).replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""):void 0,headerComponentParams:{template:`${this.getGridHeaderTemplate(ge)}`},wrapHeaderText:((A=(v=i==null?void 0:i.columnOptions)==null?void 0:v[z.ITEM_CODE])==null?void 0:A.wrapHeaderText)??(i==null?void 0:i.wrapHeaderText)??!0,autoHeaderHeight:x!=="cardview"&&x!=="card",headerClass:Ie=>{var Ve,Ce,se,me,Ne,Qe,lt,qe,Ct,ot,wt,yt,Fe,Ue,ct,at,Et,bt;let Se="er-grid-header-align-center";return((se=(Ce=(Ve=Ie.colDef)==null?void 0:Ve.context)==null?void 0:Ce.columnConfig)==null?void 0:se.HEAD_HALIGNMENT)==="Near"?Se="er-grid-header-align-left":((Qe=(Ne=(me=Ie.colDef)==null?void 0:me.context)==null?void 0:Ne.columnConfig)==null?void 0:Qe.HEAD_HALIGNMENT)==="Far"&&(Se="er-grid-header-align-right"),((Ct=(qe=(lt=Ie.colDef)==null?void 0:lt.context)==null?void 0:qe.columnConfig)==null?void 0:Ct.ITEM_MUST_FLAG)==="1"&&(((wt=(ot=z.extendOptions)==null?void 0:ot.requireCondition)==null?void 0:wt.trim().length)>0||((ct=(Ue=(Fe=(yt=Ie.colDef)==null?void 0:yt.context)==null?void 0:Fe.columnConfig)==null?void 0:Ue.MUST_INPUT_CONDITION)==null?void 0:ct.trim().length)>0)?Se=Se+" er-grid-header-maroon-star":((bt=(Et=(at=Ie.colDef)==null?void 0:at.context)==null?void 0:Et.columnConfig)==null?void 0:bt.ITEM_MUST_FLAG)==="1"&&(Se=Se+" er-grid-header-red-star"),Se},autoHeight:s.ALLOW_CELLMERGE!=="1"&&He||x==="cardview"||x==="card",suppressMovable:z.ALLOW_MOVE==="0",sortable:z.ALLOW_SORT==="1",resizable:z.ALLOW_SIZE==="1",suppressSizeToFit:z.BESTFIT!=="1",suppressColumnsToolPanel:(z.ALLOW_SHOWHIDE==="0"||this.DevelopPermission!=="1")&&z.IS_VISIBLE!=="1",lockVisible:z.ALLOW_SHOWHIDE==="0"||(i==null?void 0:i.groupDisplayType)==="multipleColumns"&&(We==="1"||We==="2"),width:G.toNumber(z.CUS_COL_WIDTH)>0?G.toNumber(z.CUS_COL_WIDTH):G.toNumber(z.COL_WIDTH_WEB)>0?G.toNumber(z.COL_WIDTH_WEB):G.toNumber(z.COL_WIDTH)>0?G.toNumber(z.COL_WIDTH):100,editable:Ie=>{var Se,Ve,Ce,se,me,Ne,Qe,lt,qe,Ct,ot,wt,yt,Fe,Ue,ct,at,Et,bt;if(Ie.node.rowPinned||!((Se=Ie.context)!=null&&Se.editable))return!1;if(((Ve=Ie.column.context)==null?void 0:Ve.editable)!==void 0&&((Ce=Ie.column.context)==null?void 0:Ce.editable)instanceof Function)return(se=Ie.column.context)==null?void 0:se.editable(Ie);if(((me=Ie.column.context)==null?void 0:me.editable)!==void 0&&((Ne=Ie.column.context)==null?void 0:Ne.editable)!=="default")return(Qe=Ie.column.context)==null?void 0:Qe.editable;if(ye!==!1){if(((lt=i==null?void 0:i.keyFields)==null?void 0:lt.trim().length)>0){if((qe=i==null?void 0:i.keyFields)!=null&&qe.includes(Ie.colDef.colId))return Ie.data.isNew}else if(((Ct=s.KEY_FIELDS)==null?void 0:Ct.trim().length)>0&&(ot=s.KEY_FIELDS)!=null&&ot.includes(Ie.colDef.colId))return Ie.data.isNew;return(i==null?void 0:i.checkRowForEdit)===!0?Ie.node.selected&&((yt=(wt=Ie.colDef)==null?void 0:wt.context)==null?void 0:yt.editable):(Ue=(Fe=Ie.colDef)==null?void 0:Fe.context)==null?void 0:Ue.editable}else return(i==null?void 0:i.checkRowForEdit)===!0?Ie.node.selected&&((at=(ct=Ie.colDef)==null?void 0:ct.context)==null?void 0:at.editable):(bt=(Et=Ie.colDef)==null?void 0:Et.context)==null?void 0:bt.editable},enableRowGroup:!n.treeData,rowGroup:n.treeData?void 0:We==="1"||We==="2",sort:i!=null&&i.allowGroupSort&&We==="2"?"desc":i!=null&&i.allowGroupSort&&We==="1"?"asc":void 0,hide:!1,context:{viewOptions:i,viewConfig:s,columnConfig:z,editable:ye,titleInfo:ge}},(i==null?void 0:i.groupDisplayType)==="multipleColumns"&&(We==="1"||z.GROUP_SORT_TYPE==="2")?E.hide=!0:z.ALLOW_SHOWHIDE==="0"?E.hide=z.IS_VISIBLE==="0":z.ALLOW_SHOWHIDE==="1"&&(E.hide=z.CUS_IS_VISIBLE==="0"||z.CUS_IS_VISIBLE===""&&z.IS_VISIBLE==="0"),E.filter="agMultiColumnFilter",E.filterParams={filters:[{filter:"agTextColumnFilter",filterParams:{buttons:(i==null?void 0:i.showApplyFilterButton)===!0?["reset","apply"]:void 0,closeOnApply:i==null?void 0:i.closeOnApplyFilter,maxNumConditions:(i==null?void 0:i.maxNumConditions)||5,textMatcher:({filterOption:Ie,value:Se,filterText:Ve})=>{if(Ve==null)return!1;switch(Ie){case"contains":return Ve.split(" ").filter(Boolean).some(se=>String(Se).includes(se));case"notContains":return!Ve.split(" ").filter(Boolean).some(se=>String(Se).includes(se));case"equals":return Se===Ve;case"notEqual":return Se!=Ve;case"startsWith":return Se.indexOf(Ve)===0;case"endsWith":const Ce=Se.lastIndexOf(Ve);return Ce>=0&&Ce===Se.length-Ve.length;default:return console.warn("invalid filter type "+Ie),!1}}}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:i!=null&&i.showFilterCounts?Ie=>{const Se=this.setGridColumnFilterCountsMap(Ie);return`${Ie.value||"("+G.$t("ERX.Null")+")"} (${Se[Ie.value||"NullFilterValue"]||0})`}:void 0,excelMode:i==null?void 0:i.excelMode,showTooltips:!0,buttons:(i==null?void 0:i.showApplyFilterButton)===!0?["reset","apply"]:void 0,closeOnApply:i==null?void 0:i.closeOnApplyFilter}}]},z.AUTO_FILTER_CONDITION==="Default"||z.AUTO_FILTER_CONDITION==="Contains"?E.filterParams.defaultOption="contains":z.AUTO_FILTER_CONDITION==="Like"||z.AUTO_FILTER_CONDITION==="StartsWith"?E.filterParams.defaultOption="startsWith":z.AUTO_FILTER_CONDITION==="EndsWith"?E.filterParams.defaultOption="endsWith":E.filterParams.defaultOption="equals",(B=this._itemAuthInfo[e])!=null&&B[z.ITEM_CODE]){const Ie=this._itemAuthInfo[e][z.ITEM_CODE];Ie[nt.UserId]==="20"||Ie["*****"]==="20"&&Ie[nt.UserId]!=="11"?(E.suppressColumnsToolPanel=!0,E.hide=!0):(Ie[nt.UserId]==="10"||Ie["*****"]==="10"&&Ie[nt.UserId]!=="11")&&(E.suppressColumnsToolPanel=!0,E.editable=!1,E.context.hideContent=!0)}const Te={},_e={fontWeight:"normal",fontStyle:"normal",textDecoration:"none",background:"",color:"inherit"};switch(z.CELL_TEXTCOLOR.trim().length>0&&(_e.color=G.toHexColor(z.CELL_TEXTCOLOR),G.colorIsTransparentOrEmpty(_e.color)?_e.color="":Te.font={color:G.toHexColor(_e.color)}),z.CELL_BACKCOLOR.trim().length>0&&(_e.background=G.toHexColor(z.CELL_BACKCOLOR),G.colorIsTransparentOrEmpty(_e.background)?_e.background="":Te.interior={color:G.toHexColor(_e.background),pattern:"Solid"}),G.toNumber(z.CELL_FONTSIZE)>0&&(_e.fontSize=`${G.toNumber(z.CELL_FONTSIZE)}px`),He&&s.ALLOW_CELLMERGE!=="1"&&z.ALLOW_CELLMERGE!=="1"?_e.whiteSpace="pre-wrap":z.SUMMARY_TYPE.includes("&")&&(_e.whiteSpace="pre"),z.HALIGNMENT){case"Center":_e.display="block",_e.textAlign="center",(K==="boolean"||K==="button")&&(_e.display="flex",_e.justifyContent="center"),E.cellClass="center-cell";break;case"Far":_e.display="block",_e.textAlign="right",(K==="boolean"||K==="button")&&(_e.display="flex",_e.justifyContent="flex-end"),E.cellClass="right-cell";break;case"Near":_e.display="block",_e.textAlign="left",(K==="boolean"||K==="button")&&(_e.display="flex",_e.justifyContent="flex-start"),E.cellClass="left-cell";break;default:{K==="number"?(_e.display="block",_e.textAlign="right",E.cellClass="right-cell"):K==="datetime"||K==="time"||z.COLUMN_EDIT=="T"?(_e.display="block",_e.textAlign="center",E.cellClass="center-cell"):K==="boolean"||K==="button"||z.COLUMN_EDIT==="S"||K==="button"?(_e.display="flex",_e.justifyContent="center",E.cellClass="center-cell"):E.cellClass="left-cell";break}}K==="string"&&E.cellClass&&(E.cellClass=E.cellClass+"-string"),z.VALIGNMENT,Object.keys(Te).length>0&&(n.excelStyles.push({...Te,id:`column-cell-style-${E.colId.toLowerCase().trim()}`}),n.context.excelStyleConfig.push({id:`column-cell-style-${E.colId.toLowerCase().trim()}`,columnNames:[E.colId.toUpperCase().trim()],condition:"",style:Te})),_===void 0&&!E.hide&&(_=E),T===void 0&&!E.hide&&((this.IsRtl&&E.pinned)==="right"||!this.IsRtl&&E.pinned==="right")&&(T=E),E.context.dataType=K,E.context.cellStyles=_e;const be=this._gridOptions[e].styleConfigInfo.cellStyle[z.ITEM_CODE];if((Object.keys(_e).length>0||be)&&(E.cellStyle=Ie=>{var Ve,Ce,se,me;const Se={...Ie.colDef.context.cellStyles};if(Ie.data&&!((Ve=Ie.node)!=null&&Ve.rowPinned)&&(be==null?void 0:be.length)>0)for(let Ne=0;Ne<be.length;Ne++){const Qe=be[Ne];if((((Ce=Qe.condition)==null?void 0:Ce.trim().length)===0||Qe.condition.trim().replaceAll(" ","")==="1=1"||G.checkExpressionValid(Ie.data,G.getSystemFormatString(Qe.condition)))&&(Qe.type==="Foreground"||Qe.type==="W_Fore"?(Se.color=G.toHexColor(Qe.fillColor),G.colorIsTransparentOrEmpty(Se.color)&&(Se.color="")):(Qe.type==="Background"||Qe.type==="W_Back")&&(Se.background=G.toHexColor(Qe.fillColor),G.colorIsTransparentOrEmpty(Se.background)&&(Se.background="")),Qe.fontStyle&&Qe.fontStyle.trim().length>0))switch(Qe.fontStyle){case"Bold":Se.fontWeight="bold";break;case"Italic":Se.fontStyle="italic";break;case"Strikeout":Se.textDecoration="line-through";break;case"Underline":Se.textDecoration="underline";break}}return(se=Ie.node)!=null&&se.group&&(Se.fontWeight="bold"),(me=Ie.node)!=null&&me.rowPinned&&(Se.fontWeight="bold",delete Se.color,delete Se.background),Se}),p&&p[z.FIELD_NAME]){const Ie=Se=>{let Ve="";return Se==null||(typeof Se=="string"?Ve=G.toString(Se):typeof Se=="number"?Ve=G.formatNumberValue(Se,""):Zr.isPlainObject(Se)&&(Ve=`☑️ ${G.formatNumberValue(Se.aggValueOfChecked,"")}
|