@baosight/er4j 0.1.18 → 0.1.19
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-DJ-bhq3g.js → ErAdvanceFilter-CFmdudu-.js} +2 -2
- package/er4j-dist/{ErAdvanceFilter-DJ-bhq3g.js.map → ErAdvanceFilter-CFmdudu-.js.map} +1 -1
- package/er4j-dist/{ErLayoutDesign-ArUZnezc.js → ErLayoutDesign-eujcyxbB.js} +2 -2
- package/er4j-dist/{ErLayoutDesign-ArUZnezc.js.map → ErLayoutDesign-eujcyxbB.js.map} +1 -1
- package/er4j-dist/{ErPopAttachment-D101CDT1.js → ErPopAttachment-BFlOQl6t.js} +2 -2
- package/er4j-dist/{ErPopAttachment-D101CDT1.js.map → ErPopAttachment-BFlOQl6t.js.map} +1 -1
- package/er4j-dist/{ErPopForm-DQlqNAD3.js → ErPopForm-crQu8tIn.js} +2 -2
- package/er4j-dist/{ErPopForm-DQlqNAD3.js.map → ErPopForm-crQu8tIn.js.map} +1 -1
- package/er4j-dist/ErPopFree-D4XMPer7.js +5 -0
- package/er4j-dist/ErPopFree-D4XMPer7.js.map +1 -0
- package/er4j-dist/ErPopQuery-BoYF0uoI.js +5 -0
- package/er4j-dist/ErPopQuery-BoYF0uoI.js.map +1 -0
- package/er4j-dist/ErPopRichEditor-BN_06Rj_.js +5 -0
- package/er4j-dist/ErPopRichEditor-BN_06Rj_.js.map +1 -0
- package/er4j-dist/ErPopTree-B7R1oBgi.js +5 -0
- package/er4j-dist/ErPopTree-B7R1oBgi.js.map +1 -0
- package/er4j-dist/{ErPopWindow-jhEir-gX.js → ErPopWindow-KOoSvDeJ.js} +2 -2
- package/er4j-dist/{ErPopWindow-jhEir-gX.js.map → ErPopWindow-KOoSvDeJ.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-HtZa_eng.js → index-DW2G-lZd.js} +21 -13
- package/er4j-dist/{index-HtZa_eng.js.map → index-DW2G-lZd.js.map} +1 -1
- package/package.json +1 -1
- package/er4j-dist/ErPopFree-DdNz0zCI.js +0 -5
- package/er4j-dist/ErPopFree-DdNz0zCI.js.map +0 -1
- package/er4j-dist/ErPopQuery-C3JVe1tf.js +0 -5
- package/er4j-dist/ErPopQuery-C3JVe1tf.js.map +0 -1
- package/er4j-dist/ErPopRichEditor-73MvyPIw.js +0 -5
- package/er4j-dist/ErPopRichEditor-73MvyPIw.js.map +0 -1
- package/er4j-dist/ErPopTree-B8kod3_Z.js +0 -5
- package/er4j-dist/ErPopTree-B8kod3_Z.js.map +0 -1
package/er4j-dist/er4j.umd.js
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
`;return Y.jQuery(`<div style="${s}">
|
|
69
69
|
<div style="${d}">${n}</div>
|
|
70
70
|
<div style="${c}"></div>
|
|
71
|
-
</div>`)}static setLocalStorage(r,e){return(r==null?void 0:r.trim().length)>0&&localStorage.setItem(r.trim(),JSON.stringify(e)),localStorage}static debounce(r,e=100){let n;return(...a)=>{n&&clearTimeout(n),n=setTimeout(()=>{r(...a)},e)}}static getLocalStorage(r,e=!0){let n;return(r==null?void 0:r.trim().length)>0&&(r=r.trim(),n=Y.toString(localStorage.getItem(r)),e!==!1&&localStorage.removeItem(r),n&&n.trim().length>0&&(n=JSON.parse(n))),n}static getCallFormParas(r,e=!0){return this.getLocalStorage(r,e)}static copyText(r){const{toClipboard:e}=N4();r instanceof Array?r.forEach(n=>{}):r=String(r||""),(r==null?void 0:r.trim().length)>0&&e(r)}static readClipboardText(){return(navigator==null?void 0:navigator.clipboard.readText())||Promise.resolve("")}static converCustomFilterToQueryFilter(r){const e=[];return Array.isArray(r)&&r.length>0?r.forEach(n=>{n.fieldName&&n.value&&e.push({ITEM_CODE:n.fieldName,FIELD_NAME:n.fieldName,ORIGIN_CODE:"*",TABLE_NAME:"",OPERATOR:n.operator||"=",PARA_GROUP:"1",SQL_CONTENT:"",DATA_TYPE:"",OP_VALUE:n.value})}):this.toString(r,!0).length>0&&e.push({ITEM_CODE:"SQL",FIELD_NAME:"*",ORIGIN_CODE:"*",TABLE_NAME:"",OPERATOR:"para",PARA_GROUP:"1",SQL_CONTENT:this.toString(r,!0),DATA_TYPE:"",OP_VALUE:"*"}),e}}class OC{static setVariable(r,e,n){r.trim().length>0&&e.trim().length>0&&n!==void 0&&n!==null&&Y.setLocalStorage(r+"_"+e,n)}static getVariable(r,e,n=!0){return Y.getLocalStorage(r+"_"+e,n)}static clearVariable(r,e){r&&r.trim().length>0&&localStorage.removeItem(r+"_"+e)}static isNullOrEmpty(r,e){const n=Y.getLocalStorage(r+"_"+e);return n==null}}class Es{constructor(){fe(this,"_events",{});this._events={}}}let Dr=class extends Es{constructor(e,n,a){super();fe(this,"dirty",!1);fe(this,"dirtyFields",{});fe(this,"uid","");fe(this,"isNew",!1);fe(this,"_dataTable");fe(this,"_schemaFields",{});fe(this,"_backup",{});this._schemaFields=n||{},this._dataTable=a,this.accept(e,this._schemaFields)}get schemaFields(){return this._schemaFields}get dataTable(){return this._dataTable}static getFieldDefaultValue(e){return e==null?void 0:e.defaultValue}static setModelValue(e,n,...a){if(n&&Object.keys(n).length>0){let i;a.length===1&&(a=a[0].split(",")),a.length>0?a.forEach(l=>{e&&e.schemaFields&&e.get(l)!==void 0&&n[l]&&(e.schemaFields[l].type==="boolean"?i=n[l]===!0||n[l]==="1"||n[l]==="True"||n[l]==="true":e.schemaFields[l].type==="datetime"?i=Y.toDateTime(n[l]):i=n[l],e.set(l,i),e[l]=i)}):Object.keys(n).forEach((l,s)=>{e&&e.schemaFields&&e.get(l)!==void 0&&n[l]&&(e.schemaFields&&e.schemaFields[l]&&e.schemaFields[l].type==="boolean"?i=n[l]===!0||n[l]==="1"||n[l]==="True"||n[l]==="true":e.schemaFields&&e.schemaFields[l]&&e.schemaFields[l].type==="datetime"?i=Y.toDateTime(n[l]):i=n[l],!e.isNew&&s===0&&e.set(l,i),e.set(l,i))})}}shouldSerialize(e){return!["ID","isNew","uid","dirty","dirtyFields","_backup","_dataTable","_events","_schemaFields","_preview_row_data","_children_data",pt.TreeHierarchyFieldName].includes(e)}forEach(e){for(const n in this)this.shouldSerialize(n)&&e(this[n],n)}toJSON(e){var a,i;let n={};for(const l in this)if(this.shouldSerialize(l)&&(n[l]=this[l],this._schemaFields&&this._schemaFields[l]))switch(this._schemaFields[l].type){case"boolean":n[l]=this[l]?"1":"0";break;case"datetime":n[l]?(bt.isDayjs(n[l])&&bt(n[l]).isValid()?n[l]=n[l].format("YYYYMMDDHHmmss"):n[l]instanceof Date?bt(n[l]).format("YYYYMMDDHHmmss"):typeof n[l]=="string"?n[l]=n[l].replaceAll("-","").replaceAll("/","").replaceAll("T","").replaceAll(":",""):n[l]="",((a=n[l])==null?void 0:a.trim().length)===0||n[l].startsWith("1900")||n[l].startsWith("1901")||n[l].startsWith("0001")?n[l]="":this._schemaFields[l].maxLength>0?n[l]=n[l].padEnd(this._schemaFields[l].maxLength,"0").substring(0,this._schemaFields[l].maxLength):n[l]=n[l].padEnd(14,"0").substring(0,14)):n[l]="";break;case"time":n[l]?(bt.isDayjs(n[l])&&bt(n[l]).isValid()?n[l]=n[l].format("YYYYMMDDHHmmss"):n[l]instanceof Date?bt(n[l]).format("YYYYMMDDHHmmss"):typeof n[l]=="string"?n[l]=n[l].replaceAll("-","").replaceAll("/","").replaceAll("T","").replaceAll(":",""):n[l]="",((i=n[l])==null?void 0:i.trim().length)===0||n[l].startsWith("1900")||n[l].startsWith("1901")||n[l].startsWith("0001")?n[l]="":this._schemaFields[l].maxLength>0&&this._schemaFields[l].maxLength<=6?n[l]=n[l].padEnd(this._schemaFields[l].maxLength,"0").substring(8,8+this._schemaFields[l].maxLength):n[l]=n[l].padEnd(14,"0").substring(8,14)):n[l]="";break;case"string":if(n[l]&&n[l]instanceof Array)n[l]=n[l].join(",");else if(this._schemaFields[l].RGBA){const s=Y.hexToRgba(n[l].trim()).replace(/rgba|\(|\)/gi,"");n[l]=s==="255,255,255,1"?"":s}break;case"number":n[l]=Y.toNumber(n[l]);break;default:n[l]=this[l];break}return e&&(n={...n,...e}),n}setBackup(){this._backup=this.toJSON();for(const e in this)this.shouldSerialize(e)&&(this._backup[e]=this[e]);return this}getBackup(){return this._backup}get(e){return Reflect.get(this,e)}set(e,n,a,i=!1){var l;if(this.shouldSerialize(e))if(this._schemaFields[e]){switch(this._schemaFields[e].type){case"datetime":case"time":n=Y.toDateTime(n,"Dayjs");break;case"boolean":n=Y.toBoolean(n);break;case"number":n=Y.toNumber(n);break;case"string":n=Y.toString(n,!0),this._schemaFields[e].RGBA&&(n=Y.toHexColor(n));break;default:n=n;break}const s={};if(s.oldValue=this[e],s.newValue=n,this.dirtyFields[e]=!0,this.dirty=!0,Reflect.set(this,e,n),this._dataTable&&a!=="setData"){const c=o.isProxy(this._dataTable)?o.toRaw(this._dataTable):this._dataTable;(l=c.BingdingInfo)==null||l.forEach(u=>{if(u.formHelper&&u.configId&&u.configId!==a)if(u.controlType==="Grid"){const f=u.formHelper.getGrid(u.configId);if(f){const h={};h[e]=n,u.formHelper.setGridRowData(f,this.uid,h)}}else u.controlType});const d=c.getEvent("dataChanged");d&&(s.field=e,s.binddingInfo=c.BingdingInfo,d(s))}}else i===!1&&(this[e]=n);return this}reset(){return this.accept(void 0,this._schemaFields),this}setSchema(e,n=!0){return this._schemaFields=e,n&&this.reset(),this}setData(e,n,a=!1){var i;return e&&(Object.keys(e).forEach(l=>{if(this.shouldSerialize(l))if(this._schemaFields[l]){switch(this._schemaFields[l].type){case"datetime":case"time":e[l]=Y.toDateTime(e[l],"Dayjs");break;case"boolean":e[l]=Y.toBoolean(e[l]);break;case"number":e[l]=Y.toNumber(e[l]);break;case"string":e[l]=Y.toString(e[l],!0),this._schemaFields[l].RGBA&&(e[l]=Y.toHexColor(Y.toString(e[l],!0)));break}this.dirtyFields[l]=!0,this.dirty=!0,Reflect.set(this,l,e[l])}else a===!1&&(this[l]=e[l])}),this._dataTable&&((i=(o.isProxy(this._dataTable)?o.toRaw(this._dataTable):this._dataTable).BingdingInfo)==null||i.forEach(s=>{if(s.formHelper&&s.configId&&s.configId!==n&&s.controlType==="Grid"){const c=s.formHelper.getGrid(s.configId);c&&s.formHelper.setGridRowData(c,this.uid,e)}}))),this}addField(...e){return e&&e.length>0&&e.forEach(n=>{this._schemaFields&&n.name&&this._schemaFields[n.name]===void 0&&(this._schemaFields[n.name]=n,this[n.name]=n.defaultValue)}),this}reomveField(...e){return e&&e.length>0&&e.forEach(n=>{this._schemaFields&&n.name&&this._schemaFields[n.name]&&delete this._schemaFields[n.name]}),this}setField(e,n){return(e==null?void 0:e.trim().length)>0&&this._schemaFields&&this._schemaFields[e.trim()]&&(this._schemaFields[e.trim()]={...this._schemaFields[e.trim()],...n}),this}accept(e,n){if(n)for(const a in n){const i=n[a];i&&i.name&&(this[i.name]=i.defaultValue)}if(e){for(const a in e)if(this[a]=e[a],n&&n[a])switch(n[a].type){case"datetime":case"time":this[a]=Y.toDateTime(e[a],"Dayjs");break;case"boolean":this[a]=Y.toBoolean(e[a]);break;case"number":this[a]=Y.toNumber(e[a]);break;case"string":this[a]=Y.toString(e[a],!0),this._schemaFields[a].RGBA&&(this[a]=Y.toHexColor(e[a].trim()));break;default:this[a]=e[a];break}}return this.uid=Y.guid(),this.dirty=!1,this.dirtyFields={},this}};const Ll=class Ll{constructor(){Qr(this,Qo,0);Qr(this,jo,"");Qr(this,Ko,{});Qr(this,Di,new Map);Qr(this,qr,new Map);this.reset()}get sysFlag(){return We(this,Qo)}get sysMsg(){return We(this,jo)}get sysContext(){return We(this,Ko)}get dataMap(){return We(this,qr)}get metaMap(){return We(this,Di)}get size(){return We(this,qr).size}get keys(){return Array.from(We(this,qr).keys())}reset(){return ar(this,Qo,0),ar(this,jo,""),We(this,qr).clear(),We(this,Di).clear(),ar(this,Ko,{company_code:pt.CompanyCode,company_name:pt.CompanyName,formname:"",userid:pt.UserId,username:pt.UserName,culture:pt.Culture}),this}static getInstance(){return new Ll}renameKey(r,e){if((e==null?void 0:e.trim().length)>0){if((r==null?void 0:r.trim().length)===0){const n=Array.from(We(this,qr).keys());n.length>0&&(r=n[0])}r.trim().length>0&&We(this,qr).set(e.trim(),We(this,qr).get(r.trim())||[]).delete(r.trim())}return this}setSys(r){return ar(this,Qo,r.sysFlag??We(this,Qo)),ar(this,jo,r.sysMsg??We(this,jo)),this}setContext(r){return r&&ar(this,Ko,{...We(this,Ko),...r}),this}static buildMap(r,e){const n=new Ll;return r&&Ir.isPlainObject(r)&&(r=[r]),r instanceof Array&&r.length>0&&n.addMapData(e||"Table0",r),n}forEach(r){We(this,qr).forEach((e,n,a)=>{r(e,n,a)})}addMapData(r,e){var n;return r&&r.trim().length>0&&(We(this,qr).has(r.trim())||We(this,qr).set(r.trim(),[]),e&&e.length>0&&((n=We(this,qr).get(r.trim()))==null||n.push(...e))),this}removeMap(r){return r&&r.trim().length>0&&We(this,qr).delete(r.trim()),this}getMapData(r){if(typeof r=="number")if(r>=0&&r<this.keys.length)r=this.keys[r];else return[];if(!r||r.trim().length===0){const e=Array.from(We(this,qr).keys());e.length>0&&(r=e[0])}return r&&r.trim().length>0?We(this,qr).get(r.trim())??[]:[]}contains(r){return(r==null?void 0:r.trim().length)>0?We(this,qr).has(r.trim()):!1}copy(){const r=new Ll;return We(this,qr).forEach((e,n)=>{const a=[...e];r.addMapData(n,a)}),r}getMeta(r){if(!r||r.trim().length===0){const e=Array.from(We(this,qr).keys());e.length>0&&(r=e[0])}return r&&(r==null?void 0:r.trim().length)>0?We(this,Di).get(r.trim())||[]:[]}mergeFromEiInfo(r){return this.reset(),this.setSys({sysFlag:r.getStatus(),sysMsg:r.getMsg()}),Object.keys(r.getBlocks()).forEach(e=>{const n=r.getBlock(e);this.addMapData(e,n.getMappedRows());const a=[],i=n.getBlockMeta().getMetas();Object.keys(i).forEach(l=>{a.push({name:i[l].name,type:i[l].type,desc:i[l].name})}),this.metaMap.set(e,a)}),this}toEiInfo(){const r=new Yt.EiInfo;return this.dataMap.forEach((e,n)=>{const a=Yt.EiBlock.build(n,e);r.addBlock(a)}),this.sysContext,r}};Qo=new WeakMap,jo=new WeakMap,Ko=new WeakMap,Di=new WeakMap,qr=new WeakMap;let st=Ll;class cr{static checkGridRow(r,e,n=!0){var a,i,l,s;(a=r==null?void 0:r.gridOptions)!=null&&a.api&&e!==void 0&&e!==null&&(typeof e=="string"&&e.trim().length>0?e=[e]:e.uid&&(e=[Y.toString(e.uid)]),e instanceof Array&&e.length>0?e.forEach(c=>{const d=r.gridOptions.api.getRowNode(c);d&&d.setSelected(n===!0)}):typeof e=="number"&&e>=0&&((s=(l=(i=r.gridOptions.api)==null?void 0:i.getModel())==null?void 0:l.getRow(e))==null||s.setSelected(n===!0)))}static checkGridCurrentRow(r){if(r){const e=cr.getGridCurrentRow(r);e&&cr.checkGridRow(r,e)}}static checkAllGridRow(r,e=!0){var n;if((n=r==null?void 0:r.gridOptions)!=null&&n.api){const a=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(a&&a.visible){const i=(l,s)=>{l.setSelected(!0)};e?r.gridOptions.api.forEachNodeAfterFilterAndSort(i):r.gridOptions.api.forEachLeafNode(i)}}}static unCheckAllGridRow(r,e=!0){var n;if((n=r==null?void 0:r.gridOptions)!=null&&n.api){const a=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(a&&a.visible){const i=(l,s)=>{l.setSelected(!1)};e?r.gridOptions.api.forEachNodeAfterFilterAndSort(i):r.gridOptions.api.forEachLeafNode(i)}}}static isGridRowChecked(r,e){var n,a;if((n=r==null?void 0:r.gridOptions)!=null&&n.api&&e){const i=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(i&&i.visible)return(a=r.gridOptions.api.getRowNode(e instanceof Dr?e.uid:e))==null?void 0:a.isSelected()}}static setGridFocusedCell(r,e=0,n,a){var i,l,s,c;if((i=r==null?void 0:r.gridOptions)!=null&&i.api){const d=r.gridOptions.api;if(d.clearRangeSelection(),d.getDisplayedRowCount()>0){if(e=e||0,d.ensureIndexVisible(e),n)d.ensureColumnVisible(n),d.setFocusedCell(e,n,a);else if(((s=(l=r.gridOptions.api.columnModel)==null?void 0:l.gridColumns)==null?void 0:s.length)>0){for(let u=0;u<r.gridOptions.api.columnModel.gridColumns.length;u++)if((c=r.gridOptions.api.columnModel.gridColumns[u])!=null&&c.visible){d.ensureColumnVisible(r.gridOptions.api.columnModel.gridColumns[u]),d.setFocusedCell(e,r.gridOptions.api.columnModel.gridColumns[u],a);break}}}}}static validateGridInput(r,e,n,a=!1,i=!0){var c,d,u;n=n||"ChangedRows";let l=!0,s=!1;if((c=r==null?void 0:r.gridOptions)!=null&&c.api){const f=r.gridOptions.api,h=(u=(d=r.gridOptions)==null?void 0:d.context)==null?void 0:u.columnsConfig,p=[];if(a instanceof Array&&a.length>0?a.forEach(E=>{E.trim().length>0&&p.push({ITEM_CODE:E.trim(),FIELD_NAME:E.trim(),CONDITION_TABLE:"",MUST_INPUT_CONDITION:""})}):(s=a===!0,h==null||h.forEach(C=>{C.UNBOUND_TYPE==="0"&&C.ITEM_MUST_FLAG==="1"&&p.push(C)})),p.length>0)if(f.setFilterModel(null),n==="CheckedRows"){const C=f.getSelectedNodes();for(let E=0;E<C.length;E++)if(l=this.validateGridRowInput(f,C[E],p,e,s,i),!l)return l}else if(n==="AllRows"){const C=f.getModel().getRowCount();for(let E=0;E<C;E++){const T=f.getModel().getRow(E);if(T!=null&&T.data&&(l=this.validateGridRowInput(f,T,p,e,s,i),!l))return l}}else{const C=cr.getGridCreatedRows(r),E=cr.getGridModifyRows(r),T=[...C,...E];for(let v=0;v<T.length;v++){const M=f.getModel().getRowNode(T[v].uid);if(M!=null&&M.data&&(l=this.validateGridRowInput(f,M,p,e,s,i),!l))return l}}}return l}static setGridColumnEditable(r,e,...n){var a,i;if((a=r==null?void 0:r.gridOptions)!=null&&a.api){const l=(i=r.gridOptions.api.columnModel)==null?void 0:i.gridColumns;if(n.length===1&&(n=n[0].split(",")),(l==null?void 0:l.length)>0){const s=r.gridOptions.api.getEditingCells();let c="";s.forEach(d=>{var u;c=((u=d.column)==null?void 0:u.getId())||""}),l.forEach(d=>{var u;d.colId!==pt.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(d.colId))&&(d.context=d.context||{},d.context.editable=e,d.colId===c&&e===!1&&r.gridOptions.api.stopEditing(),(d.colDef.cellEditor==="agCheckboxCellEditor"||d.colDef.cellEditType==="switchEditor")&&((u=r==null?void 0:r.gridOptions)==null||u.api.refreshCells({force:!0,columns:[d]})))})}}}static getGridCellRenderText(r,e,n,a){var s,c,d,u;let i="";const l=this.getGridColumnDef(r,e);return l!=null&&l.context&&(l.context.cellEditType==="dateEditor"?i=Y.getDateTimeFormatString(n,a||((s=l.context.columnConfig)==null?void 0:s.FORMAT_STRING)):l.context.cellEditType==="numberEditor"?i=Y.formatNumberValue(n,a||((c=l.context.columnConfig)==null?void 0:c.FORMAT_STRING)):l.refData&&((d=l.context)==null?void 0:d.cellEditType)==="checkGridLookUpEdit"&&l.context.valueField!==l.context.textField?Y.toString(n).trim().split(",").forEach(h=>{const p=l.refData[h]||h;i=i.length===0?p:i+","+p}):((u=l.context)==null?void 0:u.cellEditType)==="gridLookUpEdit"?i=l.refData[n]||n:i=Y.toString(n)),i}static validateGridRowInput(r,e,n,a,i=!1,l=!0){var c,d,u;if(r&&((c=e==null?void 0:e.data)!=null&&c.uid))for(let f=0;f<n.length;f++){const h=n[f].ITEM_CODE,p=n[f].FIELD_NAME,C=n[f].CONDITION_TABLE;let E={};Y.toString(n[f].EXT_OPTIONS).trim().length>0&&(E=JSON.parse(Y.toString(n[f].EXT_OPTIONS)));const T=E.requireCondition||n[f].MUST_INPUT_CONDITION,v=r.getColumnDef(h);if(v&&(!v.visible||!i))if(T.trim().length===0){if(e.rowIndex&&(e==null?void 0:e.data[p])===void 0||(e==null?void 0:e.data[p])===null||Y.toString(e==null?void 0:e.data[p]).trim().length===0||((d=v.context)==null?void 0:d.dataType)==="number"&&(e==null?void 0:e.data[p])===0)return l&&(r.ensureNodeVisible(e,"top"),r.ensureColumnVisible(v.colId,"auto"),r.clearRangeSelection(),r.setFocusedCell(e.rowIndex||0,v.colId),r.startEditingCell({rowIndex:e.rowIndex||0,colKey:v.colId}),o.nextTick(()=>{r.getCellEditorInstances({columns:[v],rowNodes:[e]}).forEach(g=>{g.editorType,g.setBorder?g.setBorder("2px solid red"):g.setInvalid&&g.setInvalid()})}),Y.messageWarning(Y.$t("ERX.InputEmptyMessage"))),!1}else{let M=e==null?void 0:e.data;if(C.trim().length>0&&(a!=null&&a.contains(C.trim()))&&(M=a==null?void 0:a.getCurrentDataObject(C.trim())),M&&M instanceof Dr&&Y.checkExpressionValid(M,Y.getSystemFormatString(T))&&((e==null?void 0:e.data[p])===void 0||(e==null?void 0:e.data[p])===null||Y.toString(e==null?void 0:e.data[p]).trim().length===0||((u=v.context)==null?void 0:u.dataType)==="number"&&(e==null?void 0:e.data[p])===0))return l&&(r.ensureNodeVisible(e,"top"),r.ensureColumnVisible(v.colId,"auto"),r.clearRangeSelection(),r.setFocusedCell(e.rowIndex||0,v.colId),r.startEditingCell({rowIndex:e.rowIndex||0,colKey:v.colId}),Y.messageWarning(Y.$t("ERX.InputEmptyMessage"))),!1}}return!0}static setGridRowData(r,e,n,a=!1){var i;if((i=r==null?void 0:r.gridOptions)!=null&&i.api&&e&&n){n instanceof Dr&&(n=n.toJSON());const l=r.gridOptions.api;if(e instanceof Dr&&(e=e.uid),typeof e=="string"&&e.trim().length>0){const s=l.getModel().getRowNode(e.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])&&(Y.toString(s.data[c]).trim().length===0||a===!1)){const f=l.getColumnDef(c);f?f.cellEditor==="agCheckboxCellEditor"?s.setDataValue(c,n[c]===!0||n[c]==="1"):Ir.isPlainObject(f.cellEditor)&&((u=f.cellEditor)==null?void 0:u.name)==="DatetimeEditor"?Y.toString(n[c]).trim().length===0?s.setDataValue(c,null):s.setDataValue(c,Y.getDateTimeByString(n[c])):s.setDataValue(c,n[c]):s.data[c]=n[c]}}),l.refreshCells({columns:[pt.GridCheckColumnFieldName],rowNodes:[s]}))}}}static setGridCurrentRowData(r,e,n=!1){const a=cr.getGridCurrentRow(r);a&&cr.setGridRowData(r,a,e,n)}static setGridRowState(r,e,n){var a,i,l,s;if((a=r==null?void 0:r.gridOptions)!=null&&a.api&&e){const c=r.gridOptions.api;if(e instanceof Dr&&(e=e.uid),typeof e=="string"&&e.trim().length>0){const d=c.getModel().getRowNode(e.trim());if(d&&((i=d.data)!=null&&i.uid)){const u=(s=(l=r.gridOptions)==null?void 0:l.context)==null?void 0:s.bindingSource;u&&u.setRowState(d.data,n)}}}}static getGridBindingTable(r){var e,n;return(n=(e=r.gridOptions)==null?void 0:e.context)==null?void 0:n.bindingSource}static getGridColumn(r,e){var a,i,l,s;let n;if(e=Y.toString(e,!0),(a=r==null?void 0:r.gridOptions)!=null&&a.api&&((i=r==null?void 0:r.gridOptions)!=null&&i.columnApi))if(e.length>0){const c=(l=r==null?void 0:r.gridOptions)==null?void 0:l.columnApi.getColumns();for(let d=0;d<c.length;d++)if(c[d].colId===e||c[d].field===e){n=c[d];break}}else{const c=(s=r==null?void 0:r.gridOptions)==null?void 0:s.api.getFocusedCell();c&&(n=c.Column)}return n}static getGridColumnDef(r,e){let n;const a=this.getGridColumn(r,e);return a!=null&&a.colDef&&(n=a.colDef),n}static async deleteGridRows(r,e=!1,n){var a,i,l,s,c,d,u,f,h,p;if((a=r==null?void 0:r.gridOptions)!=null&&a.api){const C=n||this.getGridRows(r,"select");if((C==null?void 0:C.length)>0){let E=!0;if(e&&(E=await Y.messageConfirm(Y.$t("ERX.RemoveConfirmMessage")||"是否确认删除?")),E){if((i=r==null?void 0:r.gridOptions)!=null&&i.treeData){const T=[];(s=(l=r==null?void 0:r.gridOptions)==null?void 0:l.api)==null||s.forEachNode(v=>{for(let M=0;M<C.length;M++)C[M][pt.TreeHierarchyFieldName].every(g=>new Set(v.data[pt.TreeHierarchyFieldName]).has(g))&&T.push(v.data)}),(u=(d=(c=r==null?void 0:r.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource)==null||u.remove(T)}else(p=(h=(f=r==null?void 0:r.gridOptions)==null?void 0:f.context)==null?void 0:h.bindingSource)==null||p.remove(C);return!0}}}return!1}static getGridSelectRows(r,e=!1,n=!1){return this.getGridRows(r,"select",e,n)}static getGridCurrentRow(r,e=!1,n=!1){let a;const i=this.getGridRows(r,"current",e,n);return i.length>0&&(a=i[0]),a}static getGridCheckedRows(r,e=!1,n=!1){return this.getGridRows(r,"checked",e,n)}static getGridCheckedAfterFilterRows(r,e=!1,n=!1){return this.getGridRows(r,"checkedAfterFilter",e,n)}static getGridDeletedRows(r,e=!1,n=!1){return this.getGridRows(r,"delete",e,n)}static getGridModifyRows(r,e=!1,n=!1){return this.getGridRows(r,"modify",e,n)}static getGridCreatedRows(r,e=!1,n=!1){return this.getGridRows(r,"add",e,n)}static getGridAllRows(r,e=!1,n=!1){return this.getGridRows(r,"all",e,n)}static getGridRows(r,e,n=!1,a=!1){var c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k;let i=[],l,s;if(r!=null&&r.api&&(r!=null&&r.columnApi)?(l=r.api,s=r.columnApi):(l=(c=r==null?void 0:r.gridOptions)==null?void 0:c.api,s=(d=r==null?void 0:r.gridOptions)==null?void 0:d.columnApi),l&&e&&e.toString().length>0){switch(e){case"current":{const y=l.getFocusedCell();if(y){const R=(f=(u=l.getModel())==null?void 0:u.getRow(y.rowIndex))==null?void 0:f.data;R&&(n instanceof Function?i.push(n(R)||R.toJSON()):i.push(n?R.toJSON():R))}break}case"checked":{const y=l.getSelectedRows();for(let R=0;R<y.length;R++)n instanceof Function?i.push(n(y[R])||y[R].toJSON()):i.push(n?y[R].toJSON():y[R]);break}case"checkedAfterFilter":{l.forEachNodeAfterFilter(y=>{var R;(R=y.data)!=null&&R.uid&&y.isSelected()&&(n instanceof Function?i.push(n(y.data)||y.data.toJSON()):i.push(n?y.data.toJSON():y.data))});break}case"select":if(r!=null&&r.gridOptions){const y=this.getGridColumn(r,pt.GridCheckColumnFieldName);return y&&!y.hide&&((h=r==null?void 0:r.gridOptions.context)==null?void 0:h.viewConfig.SHOW_SELECTION)==="1"?this.getGridRows(r,"checked",n,a):this.getGridRows(r,"current",n,a)}break;case"delete":if((C=(p=r==null?void 0:r.gridOptions)==null?void 0:p.context)!=null&&C.bindingSource){const y=(T=(E=r==null?void 0:r.gridOptions)==null?void 0:E.context)==null?void 0:T.bindingSource;i=y==null?void 0:y.getRows("removed",n)}break;case"modify":if((M=(v=r==null?void 0:r.gridOptions)==null?void 0:v.context)!=null&&M.bindingSource){const y=(F=(g=r==null?void 0:r.gridOptions)==null?void 0:g.context)==null?void 0:F.bindingSource;i=y==null?void 0:y.getRows("updated",n)}break;case"add":if((L=(P=r==null?void 0:r.gridOptions)==null?void 0:P.context)!=null&&L.bindingSource){const y=(S=(x=r==null?void 0:r.gridOptions)==null?void 0:x.context)==null?void 0:S.bindingSource;i=y==null?void 0:y.getRows("created",n)}break;case"all":if((A=(O=r==null?void 0:r.gridOptions)==null?void 0:O.context)!=null&&A.bindingSource){const y=(I=(w=r==null?void 0:r.gridOptions)==null?void 0:w.context)==null?void 0:I.bindingSource;i=y==null?void 0:y.getRows("all",n)}break;case"allAfterFilter":l.forEachNodeAfterFilterAndSort(y=>{var R;(R=y.data)!=null&&R.uid&&(n instanceof Function?i.push(n(y.data)||y.data.toJSON()):i.push(n?y.data.toJSON():y.data))});break}if(s&&a&&(i==null?void 0:i.length)>0){const y=((k=s.getAllGridColumns())==null?void 0:k.map(R=>{var N;return(N=R.colDef)==null?void 0:N.field}))||[];i=i.map(R=>(Object.keys(R).forEach(N=>{y.includes(N)||delete R[N]}),R))}}return i}static getGridChangedRowsAsDataMap(r,e,n,a=!1,i){var d,u,f;n=n||new st,e=e||((f=(u=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource)==null?void 0:f.tableName)||"Table0";const l=this.getGridRows(r,"delete",i??!0,a);l.length>0&&n.addMapData(e+"_DELETE",l);const s=this.getGridRows(r,"modify",i??!0,a);s.length>0&&n.addMapData(e+"_MODIFY",s);const c=this.getGridRows(r,"add",i??!0,a);return c.length>0&&n.addMapData(e+"_ADD",c),n}static mergeGridDataRow(r,e,n=!1,a=!1){if(r&&e){e instanceof Dr&&(e=e.toJSON());const i=Object.keys(r.toJSON()),l=Object.keys(e);(i==null?void 0:i.length)>0&&(l==null?void 0:l.length)>0&&(i.length>l.length?l:i).forEach(c=>{var d;(d=r.schemaFields)!=null&&d[c]&&e[c]!==void 0&&String(r[c]).trim()!==String(e[c]).trim()&&(a||typeof r[c]=="number"||typeof e[c]=="number"||!n||Y.toString(e[c],!0).length===0)&&r.set(c,e[c])})}return r}static clearGridData(r){var e,n,a,i,l;if((e=r==null?void 0:r.gridOptions)!=null&&e.api&&((a=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&a.bindingSource)){const s=(l=(i=r==null?void 0:r.gridOptions)==null?void 0:i.context)==null?void 0:l.bindingSource;s==null||s.clear()}return this}static mergeDataToGrid(r,e,n=!0){var i,l,s,c,d;let a=0;if((i=e==null?void 0:e.gridOptions)!=null&&i.api&&((s=(l=e==null?void 0:e.gridOptions)==null?void 0:l.context)!=null&&s.bindingSource)){const u=(d=(c=e==null?void 0:e.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource;u&&(a=u.merge(r,n))}return a}static importExcelFile(r,e,n,a){var i,l;((l=(i=r==null?void 0:r.gridOptions)==null?void 0:i.context)==null?void 0:l.bindingSource)instanceof un&&Y.readExcelFile(s=>{var c,d,u;if(s.length>0){const f={},h={},p=(c=r==null?void 0:r.gridOptions)==null?void 0:c.columnApi.getColumns(),C=(u=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource,E={},T=(M,g)=>{var F,P,L;if(M==null)return"";if(E[g.field]=E[g.field]||{},E[M])return E[M];if((F=g.refData)!=null&&F[M])return M;{if(Y.toString(M).includes("|")){const S=M.split("|");if((P=g.refData)!=null&&P[S[0]])return S[0]}else if(Y.toString(M).includes("-")){const S=M.split("-");if((L=g.refData)!=null&&L[S[0]])return S[0]}const x=Object.keys(g.refData).find(S=>g.refData[S]===Y.toString(M)||g.refData[S]===`${S}|${Y.toString(M)}`||g.refData[S]===`${S}-${Y.toString(M)}`);return x?(E[g.field][M]=x,x):""}},v=[];s.forEach(M=>{if(M.__EMPTY!==(Y.$t("ERX.Aggregate")||"总计")&&M.__EMPTY!==(Y.$t("ERX.GroupAggregate")||"小计")){Object.keys(M).forEach(F=>{var P,L;if(F&&!F.startsWith("__EMPTY")&&!h[F])for(let x=0;x<p.length;x++){const S=p[x].getColDef(),O=(P=S.headerName)==null?void 0:P.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim(),A=F.replace(/<br\s*\/?>/gi,"").replace(/\s+/g,"").trim();if((O===A||S.field===A)&&S.field&&((L=C.options.schema)!=null&&L[S.field])){f[S.field]={dataKey:F,colDef:S},h[F]=S;break}}});const g={};Object.keys(f).forEach(F=>{var P,L;M[f[F].dataKey]&&(g[f[F].colDef.field]=M[f[F].dataKey],f[F].colDef.refData&&((P=f[F].colDef.cellEditor)==null?void 0:P.name)==="DropdownEditor"?g[f[F].colDef.field]=T(g[f[F].colDef.field],f[F].colDef):((L=f[F].colDef.cellEditor)==null?void 0:L.name)==="DatetimeEditor"&&(g[f[F].colDef.field]=Y.getDateTimeByString(g[f[F].colDef.field])))}),e&&e instanceof Function?e(g)&&v.push(g):v.push(g)}}),n&&n instanceof Function?n(v):C.import(v)}})}static exportGridToExcel(r,e,n){var c,d;let a=u=>{var h,p,C;this.setGridColumnOptions(r,E=>{var T,v,M,g,F;E.cellDataType==="number"?E.cellClass=u!=null&&u.numberAsText?"right-cell-string":"right-cell":((T=E.context)==null?void 0:T.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0&&(((v=E.context.columnConfig)==null?void 0:v.FORMAT_STRING)==="yyyy-MM-dd"||((M=E.context.columnConfig)==null?void 0:M.FORMAT_STRING)==="yyyy/MM/dd"?E.cellClass="date-cell":E.cellClass="datetime-cell"),((g=n==null?void 0:n.excelStyleConfig)==null?void 0:g.length)>0&&((F=n==null?void 0:n.excelStyleConfig)==null||F.forEach(P=>{(P.columnNames.length===0||E.colId&&P.columnNames.includes(E.colId.toUpperCase()))&&(E.cellClassRules=E.cellClassRules||{},u!=null&&u.includeCellStyle?!P.condition||P.condition.trim().length===0||P.condition.trim().replaceAll(" ","")==="1=1"?E.cellClassRules[P.id]=L=>{var x;return((x=L.data)==null?void 0:x.uid)&&!0}:E.cellClassRules[P.id]=L=>{var x;return((x=L.data)==null?void 0:x.uid)&&Y.checkExpressionValid(L.data,Y.getSystemFormatString(P.condition))}:delete E.cellClassRules[P.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:(((C=n==null?void 0:n.columnKeys)==null?void 0:C.length)||1)-1}],height:50}]),r==null||r.exportDataAsExcel({fileName:(u==null?void 0:u.fileName)||"grid.xlsx",sheetName:(u==null?void 0:u.sheetName)||"Sheet1",author:pt.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:E=>{var T,v;return((v=(T=E.column.colDef)==null?void 0:T.headerName)==null?void 0:v.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:E=>!!(u!=null&&u.skipSummaryRows&&E.node.footer===!0&&E.node.group===!0&&E.node.level>=0||u!=null&&u.skipFooterRows&&E.node.footer===!0&&E.node.group===!0&&E.node.level<0),prependContent:(n==null?void 0:n.prependContent)??f,appendContent:n==null?void 0:n.appendContent,processCellCallback:E=>{var M,g,F,P,L,x,S,O,A,w,I,k,y,R,N,U,V,b,W,q,z;const T=Y.toString(E.value).includes("->")?" -> ":"",v=Y.toString(E.value).replace(T,"").trimStart();return(g=(M=E.column.colDef)==null?void 0:M.context)!=null&&g.hideContent||E.value&&Ir.isPlainObject(E.value)&&E.formatValue instanceof Function?E.formatValue(E.value):E.node.group&&E.node.footer!==!0?(F=E.column.colDef)!=null&&F.rowGroup&&E.node.key?((P=E.column.colDef.refData)==null?void 0:P[E.node.key])||E.node.key:((x=(L=E.column.colDef)==null?void 0:L.context)==null?void 0:x.dataType)==="number"?u!=null&&u.numberAsText?E.formatValue(E.value):E.value:T+(((A=(O=(S=E.node.rowGroupColumn)==null?void 0:S.colDef)==null?void 0:O.refData)==null?void 0:A[v])||E.formatValue(v)||v):((I=(w=E.column.colDef)==null?void 0:w.context)==null?void 0:I.dataType)==="number"?u!=null&&u.numberAsText?E.formatValue(E.value):E.value:((y=(k=E.column.colDef)==null?void 0:k.context)==null?void 0:y.dataType)==="boolean"?E.value?"R":"£":((N=(R=E.column.colDef)==null?void 0:R.context)==null?void 0:N.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0?E.value?((b=(V=(U=E.column.colDef)==null?void 0:U.context)==null?void 0:V.columnConfig)==null?void 0:b.FORMAT_STRING)==="yyyy-MM-dd"||((z=(q=(W=E.column.colDef)==null?void 0:W.context)==null?void 0:q.columnConfig)==null?void 0:z.FORMAT_STRING)==="yyyy/MM/dd"?Y.getDateTimeByString(E.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):Y.getDateTimeByString(E.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":E.formatValue(E.value)||E.value}})};const i=[],l=[{label:Y.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"},{label:Y.$t("ERX.ErGrid.ExportOptionsDateAsText")||"日期以文本格式导出",value:"dateAsText"}],s=[{key:"fileName",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsFileName")||"文件名称",required:!0},{key:"sheetName",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsSheetName")||"Sheet名称",required:!0},{key:"contentTitle",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsContentTitle")||"内容标题",required:!1}];n!=null&&n.isCheckedRows&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),n!=null&&n.isBandView&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),e.getRowGroupColumns().length>0&&(l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"}),(n==null?void 0:n.skipGroupRows)!==!1&&i.push("skipGroupRows"),(n==null?void 0:n.skipSummaryRows)!==!1&&i.push("skipSummaryRows")),n!=null&&n.isShowFooter&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),((c=n==null?void 0:n.excelStyleConfig)==null?void 0:c.length)>0&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsIncludeCellStyle")||"包含样式",value:"includeCellStyle"}),n!=null&&n.dateAsText&&i.push("dateAsText"),n!=null&&n.numberAsText&&i.push("numberAsText"),n!=null&&n.skipFooterRows&&i.push("skipFooterRows"),n!=null&&n.includeCellStyle&&i.push("includeCellStyle"),Y.openSelectOptionsModal({title:Y.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:r.getDisplayedRowCount()>0?l:[],inputOptions:s,default:{checkboxOptions:i,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;a({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")}),a=void 0})}static exportMuiltiGridToExcel(r,e){let n=0;const a=[];r.forEach(i=>{const{gridApi:l,sheetName:s}=i;this.setGridColumnOptions(i.gridApi,d=>{var u,f,h;d.cellDataType==="number"?d.cellClass=e!=null&&e.numberAsText?"right-cell-string":"right-cell":((u=d.context)==null?void 0:u.dataType)==="datetime"&&(e==null?void 0:e.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=l==null?void 0:l.getSheetDataForExcel({sheetName:s||`Sheet${n+1}`,author:pt.UserId,skipPinnedBottom:!0,onlySelected:e==null?void 0:e.isCheckedRows,skipRowGroups:e==null?void 0:e.skipGroupRows,skipColumnGroupHeaders:e==null?void 0:e.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=>!!(e!=null&&e.skipSummaryRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level>=0||e!=null&&e.skipFooterRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level<0),processCellCallback:d=>{var h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k,y;const u=Y.toString(d.value).includes("->")?" -> ":"",f=Y.toString(d.value).replace(u,"").trimStart();return d.value&&Ir.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:((E=(C=d.column.colDef)==null?void 0:C.context)==null?void 0:E.dataType)==="number"?e!=null&&e.numberAsText?d.formatValue(d.value):d.value:u+(((M=(v=(T=d.node.rowGroupColumn)==null?void 0:T.colDef)==null?void 0:v.refData)==null?void 0:M[f])||d.formatValue(f)||f):((F=(g=d.column.colDef)==null?void 0:g.context)==null?void 0:F.dataType)==="number"?e!=null&&e.numberAsText?d.formatValue(d.value):d.value:((L=(P=d.column.colDef)==null?void 0:P.context)==null?void 0:L.dataType)==="boolean"?d.value?"R":"£":((S=(x=d.column.colDef)==null?void 0:x.context)==null?void 0:S.dataType)==="datetime"&&(e==null?void 0:e.dateAsText)!==!0?d.value?((w=(A=(O=d.column.colDef)==null?void 0:O.context)==null?void 0:A.columnConfig)==null?void 0:w.FORMAT_STRING)==="yyyy-MM-dd"||((y=(k=(I=d.column.colDef)==null?void 0:I.context)==null?void 0:k.columnConfig)==null?void 0:y.FORMAT_STRING)==="yyyy/MM/dd"?Y.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):Y.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":d.formatValue(d.value)||d.value}});a.push(c)}),a.length>0&&r[0].gridApi.exportMultipleSheetsAsExcel({data:a,fileName:(e==null?void 0:e.fileName)||"grid.xlsx"})}static setGridColumnOptions(r,e){if(r&&e instanceof Function){const n=i=>{var l;((l=i==null?void 0:i.children)==null?void 0:l.length)>0&&i.children.forEach(s=>{n(s)}),e(i)},a=r.getColumnDefs();a&&(a==null||a.forEach(i=>{n(i)}),r.setColumnDefs(a))}}}class Gr{static loading(r,e,n){const a=n||document.documentElement;this.spinTimeoutId!==null&&(clearTimeout(this.spinTimeoutId),this.spinTimeoutId=null),this.spinTimeoutId=setTimeout(()=>{var i,l;if(r)if(this.spinCurrentContainer)this.spinCurrentTarget!==a&&(this.spinCurrentContainer&&(o.render(null,this.spinCurrentContainer),(i=this.spinCurrentContainer.parentNode)==null||i.removeChild(this.spinCurrentContainer),this.spinCurrentContainer=null,this.spinVnode=null,this.spinCurrentTarget=null),this.loading(!0,e,a));else{const s=document.createElement("div");s.id=this.spinId,s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%";const c=o.createVNode(tt.Spin,{spinning:!0,tip:(e==null?void 0:e.text)??(e==null?void 0:e.tip),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.1)",zIndex:9999,width:"100%",height:"100%"}});a.style.position="relative",a.appendChild(s),o.render(c,s),this.spinCurrentContainer=s,this.spinVnode=c,this.spinCurrentTarget=a}else this.spinCurrentContainer&&(o.render(null,this.spinCurrentContainer),(l=this.spinCurrentContainer.parentNode)==null||l.removeChild(this.spinCurrentContainer),this.spinCurrentContainer=null,this.spinVnode=null,this.spinCurrentTarget=null)},(e==null?void 0:e.delay)||0)}static async callService(r,e,n){return new Promise((a,i)=>{var d;const l=(n==null?void 0:n.messageError)??!1;let s=new Yt.EiInfo;r.trim().length===0&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="No service available",a(s));const c=r.split(/[\/.]/).filter(u=>u.trim().length>0);c.length<2&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="Service name error",a(s)),(d=n==null?void 0:n.loadingOptions)!=null&&d.show&&this.loading(!0,n==null?void 0:n.loadingOptions),n!=null&&n.toCamelCase&&Object.keys(e.getBlocks()).forEach(u=>{const f=e.getBlock(u),h=f.getBlockMeta().getMetas(),p=new Yt.EiBlockMeta(f.getBlockId());Object.keys(h).forEach(C=>{const E=new Yt.EiColumn(Y.camelCase(C));E.descName=h[C].name,E.type=h[C].type,p.addMeta(E)}),f.setBlockMeta(p)}),Yt.EiCommunicator.send(c[0],c[1],e,{onSuccess:u=>{this.loading(!1),s=u,s.getStatus()<0&&l&&Y.messageError(`service:${r}, sys.msg:${s.getMsg()}`,l==="modal"),a(s)},onFail:u=>{this.loading(!1),l&&Y.messageError(`service:${r}, sys.msg:${String(u)}`,l==="modal"),console.error(u),s.SysInfo.Flag=-603,s.SysInfo.Msg=u==null?void 0:u.message,a(s)}})})}static async callServiceEx(r,e,n){return new Promise(async(a,i)=>{const l=e.toEiInfo(),s=await this.callService(r,l,n),c=st.getInstance().mergeFromEiInfo(s);a(c)})}}fe(Gr,"spinId","er-global-spin"),fe(Gr,"spinCurrentContainer",null),fe(Gr,"spinVnode",null),fe(Gr,"spinCurrentTarget",null),fe(Gr,"spinTimeoutId",null);let un=(Jo=class extends Es{constructor(e){super();Qr(this,ln);Qr(this,xt,[]);Qr(this,Pn,[]);Qr(this,fn,[]);Qr(this,Xn,[]);Qr(this,qn,{});Qr(this,Br);Qr(this,Mn);Qr(this,wi,!1);Qr(this,Ii);Qr(this,Rr,[]);Qr(this,aa,{});Qr(this,Fi,{});fe(this,"tableName","");this.tableName="Table0",e=e||{schema:{}},this.init(e)}get options(){return We(this,Br)}get BingdingInfo(){return We(this,Rr)}get rowCount(){return We(this,xt).length}get Current(){return We(this,Mn)}get IsHierarchyTable(){var e,n,a,i;return Y.toString((n=(e=We(this,Br))==null?void 0:e.hierarchy)==null?void 0:n.parentField,!0).length>0&&Y.toString((i=(a=We(this,Br))==null?void 0:a.hierarchy)==null?void 0:i.primaryField,!0).length>0}init(e){e&&(ar(this,Br,e),ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,Mn,void 0),Rn(this,ln,D0).call(this))}clone(e){const n=new Jo({...We(this,Br)});return n.tableName=e||this.tableName,n}setBindingInfo(e,n,a,i){var l;e&&n&&n.trim().length>0&&!We(this,Rr).some(s=>{var c;return((c=s.formHelper)==null?void 0:c.FormId)===e.FormId&&s.configId===n})?We(this,Rr).push({formHelper:e,configId:n,dataTable:this,controlType:a}):(l=i==null?void 0:i.gridOptions)!=null&&l.api&&!We(this,Rr).some(s=>s.grid.gridId===i.gridId)&&(i.gridOptions.api.getBindingTable=()=>this,i.gridOptions.getRowId=s=>s.data.uid,i.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,i.gridId),i.gridOptions.context=i.gridOptions.context||{},i.gridOptions.context.focusRowId=u.id,i.gridOptions.context.focusColId=s.column.colId)}}),i.gridOptions.api.addEventListener("rowDataUpdated",s=>{if(s.api.getBindingTable){const c=s.api.getBindingTable();(c.rowsCount=0)&&(i.gridOptions.context=s.context||{},i.gridOptions.context.focusRowId="",i.gridOptions.context.focusColId="")}}),i.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)}),We(this,Rr).push({grid:i,dataTable:this,configId:i.gridId,controlType:a}))}removeBindingInfo(e,n,a){var i,l,s;for(let c=We(this,Rr).length-1;c>=0;c--)We(this,Rr)[c].configId===n&&((l=(i=We(this,Rr)[c])==null?void 0:i.formHelper)==null?void 0:l.FormId)===(e==null?void 0:e.FormId)?We(this,Rr).splice(c,1):(s=a==null?void 0:a.gridOptions)!=null&&s.api&&We(this,Rr)[c].grid.gridId===a.gridId&&(a.gridOptions.getBindingTable&&delete a.gridOptions.getBindingTable,a.gridOptions.getRowId=void 0,We(this,Rr).splice(c,1))}setEvent(e,n){e&&(We(this,Fi)[e]=n)}getEvent(e){return We(this,Fi)[e]}setAllowCancelChanges(e){return ar(this,Ii,e),this}addField(...e){if(e&&e.length>0&&(e.forEach(n=>{n.name&&We(this,Br).schema&&We(this,Br).schema[n.name]===void 0&&(We(this,Br).schema[n.name]=n)}),We(this,xt).length>0))for(let n=0;n<We(this,xt).length;n++)We(this,xt)[n].addField(...e);return this}removeField(...e){if(e&&e.length>0&&(e.forEach(n=>{n.name&&We(this,Br).schema&&We(this,Br).schema[n.name]===void 0&&delete We(this,Br).schema[n.name]}),We(this,xt).length>0))for(let n=0;n<We(this,xt).length;n++)We(this,xt)[n].reomveField(...e);return this}setField(e,n){var a,i;if((e==null?void 0:e.trim().length)>0&&((i=(a=We(this,Br))==null?void 0:a.schema)!=null&&i[e.trim()])&&n){const l=We(this,Br).schema[e.trim()];We(this,Br).schema[e.trim()]={...l,...n}}return this}get(e){for(let n=0;n<We(this,xt).length;n++)if(We(this,xt)[n].uid===e)return We(this,xt)[n]}getRows(e,n=!1){const a=[],i=l=>{n instanceof Function?a.push(n(l)||l.toJSON()):a.push(n?l.toJSON():l)};switch(e){case"created":{We(this,fn).forEach(l=>{i(l)});break}case"updated":{We(this,xt).forEach(l=>{l.dirty&&!l.isNew&&i(l)});break}case"removed":{We(this,Xn).forEach(l=>{i(l)});break}case"unchanged":{We(this,xt).forEach(l=>{!l.dirty&&!l.isNew&&i(l)});break}case"original":{We(this,Pn).forEach(l=>{!l.dirty&&!l.isNew&&i(l)});break}case"all":{We(this,xt).forEach(l=>{i(l)});break}}return a}at(e){return We(this,xt).at(e)}indexOf(e){var n;if(((n=e==null?void 0:e.uid)==null?void 0:n.length)>0){for(let a=0;a<We(this,xt).length;a++)if(We(this,xt)[a].uid===e.uid)return a}return-1}setCurrent(e,n){var s;const a={},i=((s=We(this,Mn))==null?void 0:s.uid)||"",l=(e==null?void 0:e.uid)||"";a.bindingInfo=We(this,Rr),a.oldCurrent=We(this,Mn),a.current=e,a.source=n,ar(this,Mn,e),i!==l&&Rn(this,ln,oa).call(this,"currentChanged",a)}insert(e,n,a){let i;return n&&(i=new Dr(n,We(this,Br).schema,this),a&&a.trim().length>0&&i[a]!==void 0&&(i[a]=Y.guid()),i.isNew=!0,We(this,xt).splice(e,0,i),We(this,fn).push(i),We(this,aa)[i.uid]=i,Rn(this,ln,oa).call(this,"dataInserted",{bindingInfo:We(this,Rr),insertAt:e,current:i}),this.setCurrent(i)),i}add(e,n){const a=new Dr(e,We(this,Br).schema,this);return n&&n.trim().length>0&&a[n]!==void 0&&(a[n]=Y.guid()),a.isNew=!0,We(this,xt).push(a),We(this,fn).push(a),We(this,aa)[a.uid]=a,Rn(this,ln,oa).call(this,"dataAdded",{bindingInfo:We(this,Rr),current:a}),this.setCurrent(a),a}import(e,n=-1,a=!0,i){const l=[];return(e==null?void 0:e.length)>0&&(e.forEach(s=>{if(s!=null){s instanceof Dr&&(s=s.toJSON());const c=new Dr(s,We(this,Br).schema,this);i&&i.trim().length>0&&c[i]!==void 0&&(c[i]=Y.guid()),c.isNew=a,l.push(c),We(this,aa)[c.uid]=c}}),n<0?We(this,xt).push(...l):We(this,xt).splice(n,0,...l),We(this,fn).push(...l),Rn(this,ln,oa).call(this,"dataImported",{bindingInfo:We(this,Rr),models:l,insertAt:n,current:l[e.length-1]}),this.setCurrent(l[e.length-1])),l}remove(e){if(!e)return;let n=[];e instanceof Array&&e.length>0?n=e:e&&(n=[e]);let a=!1;const i=[];if(n.length>0){let l=-1,s=-1;if(n.forEach(c=>{var d;if(l=We(this,xt).findIndex(u=>u.uid===c.uid),(s<0||l<s)&&(s=l),l!==-1){if(a||(a=We(this,xt)[l].uid===((d=We(this,Mn))==null?void 0:d.uid)),We(this,xt)[l].isNew){const u=We(this,fn).indexOf(We(this,xt)[l]);u>=0&&We(this,fn).splice(u,1)}else We(this,Xn).push(We(this,xt)[l]),We(this,qn)[We(this,xt)[l].uid]=We(this,Xn).length-1;i.push(We(this,xt)[l]),We(this,xt).splice(l,1),delete We(this,aa)[c.uid]}}),i.length>0&&Rn(this,ln,oa).call(this,"dataRemoved",{bindingInfo:We(this,Rr),models:i}),a){let c;We(this,xt).length>0&&(We(this,xt).length===s?c=We(this,xt)[s-1]:c=We(this,xt)[s]),this.setCurrent(c)}}}setRowState(e,n){let a=this.indexOf(e);if(a<0&&(We(this,xt).push(e),a=We(this,xt).length-1),a>=0){We(this,xt)[a].dirty=n==="updated",We(this,xt)[a].isNew=n==="added",n==="unchanged"&&(We(this,xt)[a].dirtyFields={},We(this,qn)[e.uid]!==void 0&&(delete We(this,qn)[e.uid],We(this,Xn).splice(We(this,qn)[e.uid],1)));const i=We(this,fn).findIndex(l=>l.uid===e.uid);n==="added"&&i<0?We(this,fn).push(e):i>=0&&We(this,fn).splice(i,1),Rn(this,ln,oa).call(this,"rowStateChanged",{bindingInfo:We(this,Rr),model:We(this,xt)[a],state:n})}}clear(){return ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,Mn,void 0),ar(this,aa,{}),Rn(this,ln,oa).call(this,"dataCleared",{bindingInfo:We(this,Rr)}),this}isRemoved(e){return typeof We(this,qn)[e]=="number"}merge(e,n=!0,a=!1){var s,c,d,u,f;const i=[],l=We(this,xt).length>0;if(n&&(ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,aa,{})),e!==void 0&&e.length>0&&((s=this.options)!=null&&s.schema)){const h=this.options.schema,p=Object.keys(e[0]),C=Object.keys(h),E=C.filter(P=>p.includes(P)),T=C.filter(P=>!p.includes(P)),v=new Map,M=Y.toString((d=(c=We(this,Br))==null?void 0:c.hierarchy)==null?void 0:d.primaryField,!0),g=Y.toString((f=(u=We(this,Br))==null?void 0:u.hierarchy)==null?void 0:f.parentField,!0),F=M.length>0&&g.length>0&&h[M]&&h[g];for(let P=0;P<e.length;P++){const L=new Dr(void 0,void 0,this);L.setSchema(h,!1),E.forEach(x=>{var S,O;switch(h[x].type){case"datetime":case"time":L[x]=Y.toDateTime(e[P][x],"Dayjs");break;case"boolean":L[x]=Y.toBoolean(e[P][x]);break;case"number":L[x]=Y.toNumber(e[P][x]);break;case"string":h[x].RGBA?((S=e[P][x])==null?void 0:S.trim().length)>0?L[x]=Y.toHexColor((O=e[P][x])==null?void 0:O.trim()):L[x]="#ffffff":L[x]=Y.toString(e[P][x],!0);break;default:L[x]=e[P][x];break}}),T.forEach(x=>{switch(h[x].type){case"datetime":case"time":L[x]=null;break;case"boolean":L[x]=!1;break;case"number":L[x]=0;break;case"string":L[x]="";break;default:L[x]=null;break}}),L.isNew=a,i.push(L),We(this,xt).push(L),We(this,aa)[L.uid]=L,F&&L[M]&&v.set(L[M],L)}if(F){const P=L=>{const x=[];for(;L;)x.unshift(L[M]),L=v.get(L[g]);return x};for(let L=0;L<We(this,xt).length;L++)We(this,xt)[L][pt.TreeHierarchyFieldName]=P(We(this,xt)[L])}Rn(this,ln,D0).call(this),ar(this,Mn,We(this,xt)[0]),Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:i,current:We(this,xt)[0]})}else ar(this,Mn,void 0),l&&Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:i,current:void 0});return i}hasChanges(){if(We(this,Xn).length)return!0;for(let e=0;e<We(this,xt).length;e++)if(We(this,xt)[e].isNew||We(this,xt)[e].dirty)return!0;return!1}acceptChanges(){return ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),We(this,xt).forEach(e=>{e.isNew=!1,e.dirty=!1,e.dirtyFields={}}),Rn(this,ln,D0).call(this),Rn(this,ln,oa).call(this,"acceptChanges",{bindingInfo:We(this,Rr),models:We(this,xt),current:void 0}),this}cancelChanges(){return We(this,wi)&&(ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,aa,{}),ar(this,xt,Ir.cloneDeep(We(this,Pn))),We(this,xt).forEach(e=>{We(this,aa)[e.uid]=e}),Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:We(this,xt),current:void 0})),this}totalCount(){return We(this,xt).length}data(e){return e!==void 0&&e.length>0&&this.merge(e,!0,!1),We(this,xt)}originalCopy(){return Ir.cloneDeep(We(this,Pn))}originalModel(e){for(let n=0;n<We(this,Pn).length;n++)if(We(this,Pn)[n].uid===e)return Ir.cloneDeep(We(this,Pn)[n])}static convertDataType(e,n,a,i="all"){var l,s,c;if(i=i||"all",e&&e.length>0&&n&&n.options.schema){const d=n.options.schema,u=Object.keys(e[0]),f=[],h=[],p=[],C={};for(const E of u)((l=d[E])==null?void 0:l.type)==="boolean"&&(i==="all"||i==="boolean")?f.push(E):((s=d[E])==null?void 0:s.type)==="datetime"&&(i==="all"||i==="datetime")?h.push(E):((c=d[E])==null?void 0:c.type)==="number"&&typeof e[0][E]!="number"&&p.push(E);a==="strongly"&&Object.keys(d).forEach(E=>{e[0][E]===void 0&&(d[E].type==="datetime"?C[E]=null:d[E].type==="boolean"?C[E]=d[E].default?d[E].default:!1:d[E].type==="number"?C[E]=Y.toNumber(d[E].default):C[E]="")});for(let E=0;E<e.length;E++){e[E]instanceof Dr&&(e[E]=e[E].toJSON());for(const T of f)if(a==="weakly")e[E][T]=e[E][T]?"1":"0";else{const v=Y.toString(e[E][T],!0,"toLower");e[E][T]=v.length>0&&v!=="0"&&v!=="false"}for(const T of h)Y.toString(e[E][T],!0).length>0?a==="weakly"?(e[E][T]=Y.getDateTimeFormatString(e[E][T],"yyyyMMddHHmmss"),(e[E][T].substring(0,4)==="1901"||e[E][T].substring(0,4)==="0001")&&(e[E][T]=null)):e[E][T]=Y.toDateTime(e[E][T]):e[E][T]=null;for(const T of p)e[E][T]=Y.toNumber(e[E][T]);a==="strongly"&&C&&(e[E]={...C,...e[E]})}}return e}static async createDataTable(e,n,a){let i;const l=st.buildMap({QUERY_TYPE:"tsi00datatable",DATASET_NAME:n,TABLE_NAME:a}),s=await Gr.callServiceEx(pt.queryDevConfigService,l,{partition:e}),c={},d=s.getMapData("TSI00DATATABLE");if((d==null?void 0:d.length)>0){const u={};d.forEach(f=>{if(f.TABLE_NAME===a.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=Y.toNumber(f.DEFAULT_VALUE);break;case"3":h.type="datetime",h.defaultValue=Y.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;case"4":h.type="boolean",h.defaultValue=Y.toBoolean(f.DEFAULT_VALUE);break;case"5":h.type="time",h.defaultValue=Y.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;default:h.type="string",h.defaultValue=Y.getSystemFormatString(f.DEFAULT_VALUE).trim();break}u[f.COL_NAME]=h}}),Object.keys(u).length>0&&(c.schema=u,i=new Jo(c))}return i||console.error(`ER: DataTable [${a}] creation failed!`),i}},xt=new WeakMap,Pn=new WeakMap,fn=new WeakMap,Xn=new WeakMap,qn=new WeakMap,Br=new WeakMap,Mn=new WeakMap,wi=new WeakMap,Ii=new WeakMap,Rr=new WeakMap,aa=new WeakMap,Fi=new WeakMap,ln=new WeakSet,oa=function(e,n){var i;(i=We(this,Rr))==null||i.forEach(l=>{var s,c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k,y,R,N,U,V,b,W,q,z,ee,Q,G,K,ie,J,te,H,Ee,Z,Ve,X,le,se,re,ve,be,_e,$e,Ce,Fe,De,Oe,Ie,Re,Ze,ge;if(l.formHelper&&l.configId||(c=(s=l.grid)==null?void 0:s.gridOptions)!=null&&c.api)if(l.controlType==="Grid"){const oe=l.grid||((d=l.formHelper)==null?void 0:d.getGrid(l.configId));if((u=oe==null?void 0:oe.gridOptions)!=null&&u.api)switch(e){case"dataMerged":{const ye=oe.gridOptions.api.getFilterModel(),Me=oe.gridOptions.columnApi.getColumnState().filter(St=>St.sort!==null);oe.gridOptions.context=oe.gridOptions.context||{},Object.keys(ye).length===0&&Me.length===0&&oe.gridOptions.context.calculateRowSpan&&oe.gridOptions.context.calculateRowSpan instanceof Function&&oe.gridOptions.context.calculateRowSpan(!0),(h=(f=oe.gridOptions)==null?void 0:f.api)==null||h.clearRangeSelection(),oe.gridOptions.context.focusRowId="",oe.gridOptions.context.focusColId="",oe.gridOptions.context.dataMerged=!0,(C=(p=oe.gridOptions)==null?void 0:p.api)==null||C.setRowData(We(this,xt)),We(this,xt).length>0&&Object.keys(ye).length===0&&Me.length===0?(ar(this,Mn,void 0),this.setCurrent(We(this,xt)[0])):(T=(E=oe.gridOptions)==null?void 0:E.api)==null||T.setFocusedCell(0,pt.GridCheckColumnFieldName);let Xe=We(this,xt).length.toString().length*7+20;((M=(v=oe.gridOptions.context)==null?void 0:v.viewConfig)==null?void 0:M.SHOW_SELECTION)==="1"&&(Xe+=20),(g=oe.gridOptions.context)!=null&&g.allowDragRow&&(Xe+=21),((P=(F=oe.gridOptions.context)==null?void 0:F.options)==null?void 0:P.masterDetail)===!0&&(Xe+=22);const mt=(x=(L=oe.gridOptions.columnApi)==null?void 0:L.columnModel)==null?void 0:x.gridColumns,et=mt==null?void 0:mt.find(St=>St.colId===pt.GridCheckColumnFieldName);et&&oe.gridOptions.columnApi.setColumnWidth(et,Xe),(S=l.formHelper)==null||S.setGridOptions(l.configId,"advanceFilterTemplateBillNo","",!0);break}case"dataCleared":{(A=(O=oe.gridOptions)==null?void 0:O.api)==null||A.setRowData([]);break}case"dataRemoved":{if(oe.gridOptions.api.applyTransaction({remove:n.models}),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(w=ye==null?void 0:ye.rootNode)==null?void 0:w.aggData,pinndeRowType:"ErGridSummaryFooter"}])}if(((k=(I=oe.gridOptions.context)==null?void 0:I.options)==null?void 0:k.showRowNo)!==!1&&(oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),oe.gridOptions.context.focusRowId)){const ye=(y=oe==null?void 0:oe.gridOptions)==null?void 0:y.api.getRowNode(oe.gridOptions.context.focusRowId);ye&&(oe.gridOptions.context.focusRowId=ye.id,(R=oe.gridOptions.context)!=null&&R.focusColId||pt.GridCheckColumnFieldName,oe.gridOptions.context.focusColId||(oe.gridOptions.context.focusColId=pt.GridCheckColumnFieldName),cr.setGridFocusedCell(oe,ye.rowIndex,oe.gridOptions.context.focusColId))}break}case"dataAdded":{if(oe.gridOptions.api.applyTransaction({add:[n.current]}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((U=(N=oe.gridOptions.context)==null?void 0:N.viewConfig)==null?void 0:U.AUTO_SELECT_MODE)==="1"||((b=(V=oe.gridOptions.context)==null?void 0:V.viewConfig)==null?void 0:b.AUTO_SELECT_MODE)==="3"||((q=(W=oe.gridOptions.context)==null?void 0:W.options)==null?void 0:q.autoCheckNewRow)===!0)&&((z=l.formHelper)==null||z.checkGridRow(l.configId,n.current)),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(ee=ye==null?void 0:ye.rootNode)==null?void 0:ee.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataInserted":{if(n.insertAt>=0?oe.gridOptions.api.applyTransaction({add:[n.current],addIndex:n.insertAt}):oe.gridOptions.api.applyTransaction({add:[n.current]}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((G=(Q=oe.gridOptions.context)==null?void 0:Q.viewConfig)==null?void 0:G.AUTO_SELECT_MODE)==="1"||((ie=(K=oe.gridOptions.context)==null?void 0:K.viewConfig)==null?void 0:ie.AUTO_SELECT_MODE)==="3"||((te=(J=oe.gridOptions.context)==null?void 0:J.options)==null?void 0:te.autoCheckNewRow)===!0)&&l.formHelper.checkGridRow(l.configId,n.current),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(H=ye==null?void 0:ye.rootNode)==null?void 0:H.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataImported":{if(n.insertAt>=0?oe.gridOptions.api.applyTransaction({add:n.models,addIndex:n.insertAt}):oe.gridOptions.api.applyTransaction({add:n.models}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((Z=(Ee=oe.gridOptions.context)==null?void 0:Ee.viewConfig)==null?void 0:Z.AUTO_SELECT_MODE)==="1"||((X=(Ve=oe.gridOptions.context)==null?void 0:Ve.viewConfig)==null?void 0:X.AUTO_SELECT_MODE)==="3"||((se=(le=oe.gridOptions.context)==null?void 0:le.options)==null?void 0:se.autoCheckNewRow)===!0)&&l.formHelper.checkGridRow(l.configId,n.models),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(re=ye==null?void 0:ye.rootNode)==null?void 0:re.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"currentChanged":{if(We(this,Mn)&&n.source!==l.configId&&((be=(ve=oe.gridOptions.context)==null?void 0:ve.options)==null?void 0:be.suppressDefaultFocusedCell)!==!0){const ye=($e=oe==null?void 0:oe.gridOptions)==null?void 0:$e.api.getRowNode((_e=We(this,Mn))==null?void 0:_e.uid);if((Fe=(Ce=oe.gridOptions)==null?void 0:Ce.api)==null||Fe.clearFocusedCell(),ye){const Me=((De=oe.gridOptions.context)==null?void 0:De.focusColId)||pt.GridCheckColumnFieldName;cr.setGridFocusedCell(oe,ye.rowIndex,Me)}}break}case"rowStateChanged":{if(n.model){const ye=(Oe=oe==null?void 0:oe.gridOptions)==null?void 0:Oe.api.getRowNode(n.model.uid);ye&&((Re=(Ie=oe.gridOptions)==null?void 0:Ie.api)==null||Re.redrawRows({rowNodes:[ye]}))}break}case"acceptChanges":{this.hasChanges()&&((ge=(Ze=oe.gridOptions)==null?void 0:Ze.api)==null||ge.redrawRows());break}}}else l.controlType==="Layout"&&(e==="currentChanged"||e==="dataMerged"||e==="dataCleared")&&l.formHelper.refreshLayoutBindModel(l.configId)});const a=We(this,Fi)[e];a&&a instanceof Function&&a(n)},D0=function(){We(this,Ii)||We(this,Ii)===void 0&&We(this,xt).length<=200?(ar(this,Pn,Ir.cloneDeep(We(this,xt))),ar(this,wi,!0)):(ar(this,Pn,[]),ar(this,wi,!1))},Jo),Qu=class{constructor(r){fe(this,"dataSetName","");fe(this,"dataTables");fe(this,"relations");this.dataTables={},this.relations={},this.dataSetName=(r==null?void 0:r.trim())||""}get Name(){return this.dataSetName}setName(r){return this.dataSetName=(r==null?void 0:r.trim())||"",this}addDataTable(r,e){return e.tableName=r,this.dataTables[r]=e,this}removeDataTable(r){return this.contains(r)&&delete this.dataTables[r.trim()],this}renameDataTable(r,e){return this.contains(r)&&!this.contains(e)&&r.trim().toUpperCase()!==e.trim().toUpperCase()&&(this.addDataTable(e.trim().toUpperCase(),this.dataTables[r.trim().toUpperCase()]),delete this.dataTables[r.trim().toUpperCase()]),this}copyDataTable(r,e){let n,a;return r instanceof un?n=r:typeof r=="string"&&(n=this.dataTables[r]),n&&n.options&&(a=new un({...n.options})),e&&e.trim().length>0&&!this.contains(e)&&(this.dataTables[e.trim()]=a),a}cloneDataTable(r,e){const n=this.copyDataTable(r,e);return n.data([]),n}getDataTable(r){return this.dataTables[r]}getTableName(r){let e;return Object.keys(this.dataTables).every(n=>this.dataTables[n]===r?(e=n,!1):!0),e}clear(...r){let e=Object.keys(this.dataTables);return r.length>0&&(e=r),e.forEach(n=>{this.dataTables[n]&&this.dataTables[n]instanceof un&&this.dataTables[n].clear()}),this}mergeData(r,e,n=!0,a=!1){return(r==null?void 0:r.trim().length)>0&&this.contains(r.trim())&&e&&this.dataTables[r].merge(e,n,a),this}getCurrentDataObject(r){let e;return(r==null?void 0:r.trim().length)>0&&this.contains(r.trim())&&(e=this.dataTables[r].Current),e}tablesCount(){return this.dataTables?Object.keys(this.dataTables).length:0}contains(r){return r&&r.trim().length>0?this.dataTables[r.trim()]!==void 0:!1}isEmpty(){return!(this.dataTables&&Object.keys(this.dataTables).length>0)}hasChanges(r){if(this.dataTables){if(r&&r.trim().length>0&&this.dataTables[r.trim()])return this.dataTables[r.trim()].hasChanges();{const n=Object.keys(this.dataTables);for(let a=0;a<n.length;a++)if(this.dataTables[n[a]].hasChanges())return!0}}return!1}hasRelation(r){return this.dataTables&&r&&r.trim().length>0&&this.relations[r.trim()]&&this.relations[r.trim()].length>0}acceptChanges(){return Object.keys(this.dataTables).forEach(e=>{this.dataTables[e]&&this.dataTables[e]instanceof un&&this.dataTables[e].acceptChanges()}),this}},Oc=class{constructor(r){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",o.ref(!1));fe(this,"_options",o.reactive({title:"标题"}));fe(this,"_resolveDialogResult");fe(this,"_dialogReturnInfo");fe(this,"_events",{});fe(this,"_component");this.setOptions(r||{})}get WindowOpened(){return this._windowOpened}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}show(r,e=!0){return new Promise(async(n,a)=>{var i,l;if(this._app)this._windowOpened.value=!0;else{this._component||this._component||(this._component=await Promise.resolve().then(()=>Uy),(i=this._component)!=null&&i.default&&(this._component=this._component.default));const s=o.createApp(this._component,{popRichEditorProps:this,options:this._options,content:r});((l=this._options)==null?void 0:l.extension)==="dropdown"&&s.component("ag-grid-vue",fr.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:a}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}},ju=class{constructor(r,e,n,a,i){fe(this,"LayoutCaption",{});fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",o.ref(!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,"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",o.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=e,n&&(this._layoutConfigId=n),a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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(r,e){return new Promise((n,a)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(e==null?void 0:e.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d,u,f,h,p,C,E,T,v,M,g;if(i.flag===1){if(((c=(s=(l=this._formHelper)==null?void 0:l.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(F=>F.BUTTON_NAME==="btnOk"?(this.OkButtonService=F.SVC_NAME,!1):!0),((C=(p=(h=this._formHelper)==null?void 0:h.ConfigInfo)==null?void 0:p.TSI00GRIDVIEW)==null?void 0:C.length)>0)for(let F=0;F<((v=(T=(E=this._formHelper)==null?void 0:E.ConfigInfo)==null?void 0:T.TSI00GRIDVIEW)==null?void 0:v.length);F++){const P=(g=(M=this._formHelper)==null?void 0:M.ConfigInfo)==null?void 0:g.TSI00GRIDVIEW[F];F==0&&(this._mainLayoutId=P.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(P.FUNCTION_ID),this._layoutGroupInfo[P.FUNCTION_ID]=P}this._initializeFlag=1}}else{const F="ErPopFreeHelper initialize faild, error msg is ["+i.msg+"]";Y.messageError(F)}n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setSavePartition(r){this._savePartition=r,this._formHelper.setCustomPartition(r)}ReceiveData(r,e){return r&&r instanceof Dr&&(r=r.toJSON()),r&&Object.keys(r).length>0&&(this._receiveData=r,this._readOnlys=e),this._receiveData}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setValue(r,e=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,void 0,e),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,e,n){return new Promise((a,i)=>{const l=s=>{if(this.EditType==="Add"){const c=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={...c,...this._receiveData}}this.WindowOpened.value=!0};e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this.app?l():this.Initialize().then(async s=>{var u;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>By),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const c=o.createApp(this._component,{popFreeHelperProp:this,formWidth:this.getFormOption("width")??this.getFormOption("formWidth"),formHeight:this.getFormOption("height")??this.getFormOption("formHeight")});c.component("ag-grid-vue",fr.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),l()}),this._resolveDialogResult={resolve:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo={...this._dialogReturnInfo,...r}}};const Cs=Object.freeze(Object.defineProperty({__proto__:null,PopFreeHelper:ju},Symbol.toStringTag,{value:"Module"}));let Ku=class{constructor(r,e,n,a){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",o.ref(!1));fe(this,"_options",o.reactive({title:"标题",width:360,height:630}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"_primaryField");fe(this,"_parentField");fe(this,"_displayField");this._primaryField=r,this._parentField=e,this._displayField=n,this.setOptions(a||{})}get FormId(){return Y.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(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}receiveData(r){this._receiveData=r}show(r,e,n){return new Promise(async(a,i)=>{var l;if(e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this._app)this._windowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>qy),(l=this._component)!=null&&l.default&&(this._component=this._component.default)));const s=o.createApp(this._component,{popTreeHelperProp:this});s.component("ag-grid-vue",fr.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:a,reject:i}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}};const DC=Object.freeze(Object.defineProperty({__proto__:null,PopTreeHelper:Ku},Symbol.toStringTag,{value:"Module"}));let Ju=class{constructor(r,e,n,a,i){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",o.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",!0);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",o.reactive({groupDisplayType:"groupRows"}));fe(this,"DetailViewOptions",o.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",o.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"queryMainGridInfo",async(r=!0)=>{var i,l,s,c,d,u,f,h;const e=new st,n=this._formHelper.getAllControlValue(this.LayoutGroupFilterId,this.CustomFilterJson),a=this._formHelper.getAllControlValueAsFilterArray(this.LayoutGroupFilterId,this.CustomFilterJson);if(this.FormButtonQueryFilter.trim().length>0){const p=_.ER.Core.converCustomFilterToQueryFilter(this.FormButtonQueryFilter);p.length>0&&a.push(...p)}if(((i=this.CustomFilterString)==null?void 0:i.trim().length)>0){const p=_.ER.Core.converCustomFilterToQueryFilter(this.CustomFilterString);p.length>0&&a.push(...p)}if(e.addMapData("Table0",[n]),e.addMapData("QUERY_FILTER",a),((s=(l=this.MainViewOptions)==null?void 0:l.pageOptions)==null?void 0:s.pagination)==="server")this._formHelper.setServerPagingQuery(this.MainViewConfigId,e,p=>new Promise(async(C,E)=>{var P,L,x,S,O,A,w,I,k,y;const T=e.copy(),v={flag:-1,msg:"",data:void 0,total:0},g=(L=(P=this._formHelper.getGrid(this.MainViewConfigId).gridOptions.context)==null?void 0:P.pageOptions)==null?void 0:L.pageSize;let F;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)F=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:T,queryPage:p,pageSize:g});else if(((x=this._events)==null?void 0:x.query)instanceof Function)F=await this._events.query({queryHelper:this,queryFilter:T,queryPage:p,pageSize:g});else if(this.FormConfigQueryService.trim().length>0)T.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:g}]),F=await this._formHelper.callServiceEx(this.FormConfigQueryService.trim(),T);else if(this._queryService.trim().length>0){console.log("this._queryService",this._queryService);let R=pt.dynamicQueryService;const N=(O=(S=this._formHelper.ConfigInfo)==null?void 0:S.TSI00DATASOURCE)==null?void 0:O.find(U=>U.FUNC_ID===this._queryService);(N==null?void 0:N.ORIGIN_CODE)==="SVC"&&((A=N==null?void 0:N.SVC_NAME)==null?void 0:A.trim().length)>0?R=(w=N==null?void 0:N.SVC_NAME)==null?void 0:w.trim():(T.addMapData("DATA_SOURCE",[{FUNCTION_ID:(N==null?void 0:N.FUNC_ID)||this._queryService,COMPANY_CODE:pt.CompanyCode}]),R=((I=N==null?void 0:N.SVC_NAME)==null?void 0:I.trim())||pt.dynamicQueryService),T.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:g}]),F=await this._formHelper.callServiceEx(R,T)}else v.flag=-1,v.msg=this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务";if(F instanceof st)v.flag=F.sysFlag,v.msg=F.sysMsg,v.data=F.getMapData(0),v.total=F.getMapData(0).length,F.contains("PAGEINFO")&&(v.total=F.getMapData("PAGEINFO")[0].TOTAL_RECORD);else if(((k=F.sys)==null?void 0:k.status)>=0)v.flag=0,v.data=F.getBlock(0).data,v.total=F.getBlock(0).length,F.contains("PAGEINFO")&&(v.total=F.getMapData("PAGEINFO").data[0].TOTAL_RECORD||0);else if(F.getStatus instanceof Function&&F.getStatus()>=0){v.flag=F.getStatus(),v.msg=F.getMsg();const R=F.getBlock(this._mainTableame)??F.getBlock("TSI00RESULT")??F.getBlock("result");v.data=R.getMappedRows(),v.total=v.data.length,F.getBlock("PAGEINFO")&&(v.total=F.getBlock("PAGEINFO").getMappedRows()[0].TOTAL_RECORD||0)}else v.flag=-1,v.msg=((y=F.sys)==null?void 0:y.msg)||"";C(v)}));else{const p=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);p&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(T=>{T.trim().length>0&&p[T.trim().toUpperCase()]&&(this._keyFieldValue[T.trim().toUpperCase()]=p[T.trim().toUpperCase()])});let C;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)C=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:e});else if(((c=this._events)==null?void 0:c.query)instanceof Function)C=await this._events.query({queryHelper:this,queryFilter:e});else if(this.FormConfigQueryService.trim().length>0)C=await this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson);else if(this._queryService.trim().length>0){let E="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?E=this._serviceFilter+" and "+this.CustomFilterString:E=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(E=this._serviceFilter),C=await this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:E})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}if(C.sys&&((d=C.sys)==null?void 0:d.status)<0){this._formHelper.messageError(C.sys.msg);return}else if(C.getStatus instanceof Function&&C.getStatus()<0){this._formHelper.messageError(C.getMsg());return}else if(C.sysFlag!==void 0&&C.sysFlag<0){this._formHelper.messageError(C.sysMsg);return}else{let E=[];if(((u=C==null?void 0:C.sys)==null?void 0:u.status)>=0)E=C.contains(this._mainTableame)?(f=C.getBlock(this._mainTableame))==null?void 0:f.data:((h=C.getBlock(0))==null?void 0:h.data)??[];else if(C.getStatus instanceof Function&&C.getStatus()>=0){const v=C.getBlock(this._mainTableame)??C.getBlock("TSI00RESULT")??C.getBlock("result")??C.getBlockByIndex(0);E=(v==null?void 0:v.getMappedRows())??[]}else C.sysFlag>=0&&(E=C.getMapData(this._mainTableame)??C.getMapData("TSI00RESULT")??C.getMapData("result")??C.getMapData(0));this._formHelper.mergeDataToGrid(E,this.MainViewConfigId,!0);const T=E.length;T>0?(r&&this._formHelper.messageInfo(Y.$t("ERX.QueryResultWithRecords",[T.toString()])||Y.stringFormat("查询完成,共查询到[{0}]条数据",T)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue),this.autoCheckRows()):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}this.doEvent("afterQuery")}});fe(this,"autoCheckRows",()=>{var r,e;if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const n=this.ChooseKeyValues.trim().split(","),a=this.ErFormHelper.getGrid(this.MainViewConfigId);(e=(r=a==null?void 0:a.gridOptions)==null?void 0:r.api)==null||e.forEachLeafNode(i=>{n.includes(i.data[this.KeyFieldName])&&i.setSelected(!0)})}});this._initializeFlag=0,this._partition=r,this._formName=e,n&&(this._layoutConfigIds=n),a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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(r,e){return new Promise((n,a)=>{this._partition=r&&r.trim()||this._partition,this._serviceName=e&&e.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d;if(i.flag===1)if(((c=(s=(l=this._formHelper)==null?void 0:l.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",u.MULTI_SELECT_MODE=this.ShowCheckBoxColumn?"2":"1"),this._initializeFlag=1}else Y.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else Y.messageError("ErPopQueryHelper initialize faild, error msg is ["+i.msg+"]");n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions,...r})}getFormOption(r){return this._formOptions.value[r]}setQueryPartition(r){this._queryPartition=r,this._formHelper.setCustomPartition(r)}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}show(r,e,n){return new Promise((a,i)=>{e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async l=>{var d,u,f;if(this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>Wy),(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=o.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});s.component("ag-grid-vue",fr.AgGridVue),s.component("v-splitter",pn.Splitpanes),s.component("v-splitter-pane",pn.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:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}};const Zu=Object.freeze(Object.defineProperty({__proto__:null,PopQueryHelper:Ju},Symbol.toStringTag,{value:"Module"}));let wC=class{constructor(r,e,n,a,i){fe(this,"LayoutOptions",{});fe(this,"GridOptions",o.reactive({groupDisplayType:"groupRows"}));fe(this,"LayoutCaption");fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",o.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",o.ref({}));fe(this,"_resolveDialogResult");fe(this,"_component");this._initializeFlag=0,this._partition=r,this._formName=e,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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 r;return o.reactive(((r=this._dataSet)==null?void 0:r.getCurrentDataObject(this._mainTableName))||new Dr)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(r,e){return new Promise((n,a)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(e==null?void 0:e.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d,u,f;if(i.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=(l=this._formHelper)==null?void 0:l.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 ["+i.msg+"]";Y.messageError(h)}n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setSavePartition(r){this._savePartition=r,this._formHelper.setCustomPartition(r)}ReceiveData(r,e){this._receiveData=r,this._readOnlys=e}setEvent(r,e,n=!1){this._events[r]=e,this.PreventDefaultEvent[r]=n}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setValue(r,e=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,e),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,e,n){return new Promise((a,i)=>{const l=()=>{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};e&&this.setEvent("save",e),n&&this.setEvent("close",n),this.app?l():this.Initialize().then(async s=>{var u;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>ik),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this._initializeFlag=1,this.doEvent("initial",this);const c=o.createApp(this._component,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});c.component("ag-grid-vue",fr.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),l()}),this._resolveDialogResult={resolve:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}};bt.locale("zh-cn");const IC=o.defineComponent({name:"DatetimeEditor",components:{"a-date-picker":tt.DatePicker,"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},directives:{focus:t=>{t.children&&o.nextTick(()=>{const r=_.ER.Core.jQuery(t.children);r==null||r.select()})}},props:["params"],setup:t=>{var S,O,A,w,I;const r=o.ref(null),e=o.ref(((O=(S=t.params.colDef.context)==null?void 0:S.columnConfig)==null?void 0:O.READ_ONLY)==="1"),n=((w=(A=t.params.colDef.context)==null?void 0:A.columnConfig)==null?void 0:w.MAX_LENGTH)||14,a=o.ref(_.ER.Core.toDateTime(t.params.value)),i=o.ref(t.params.max),l=o.ref(t.params.min),s=o.ref(t.params.showTime),c=o.ref(t.params.picker),d=t.params.dataType||"datetime",u=o.ref(!0),f=o.ref(!1),h=t.params.format||"YYYY-MM-DD HH:mm:ss",p=_.ER.Core.getDateTimeFormatString(t.params.value,h),C=o.ref(h),E=o.ref(Fr()),T=o.ref(zt());window.$wujie&&((I=window.$wujie.bus)==null||I.$on("changeThemeEmit",k=>{T.value=zt()}));const v=()=>{f.value=!0},M=()=>{if(d==="string"){const k=_.ER.Core.getDateTimeFormatString(a.value,"yyyyMMddHHmmss");return n>0&&k.length>n?k.substring(0,n):k}return _.ER.Core.toDateTime(a.value)},g=()=>!1,F=()=>!1,P=()=>{u.value=!1},L=()=>{u.value=!1,t.params.stopEditing()},x=k=>{k.key==="Escape"||k.key==="Tab"?u.value=!1:k.key==="Enter"&&(u.value=!u.value)};return o.onMounted(()=>{o.nextTick(()=>{if(!e){const k=_.ER.Core.jQuery(r.value);k==null||k.focus()}})}),{h:o.h,ER:_.ER,props:t,readOnly:e,readOnlyValue:p,value:a,dateInputRef:r,max:i,min:l,showTime:s,format:C,picker:c,open:u,antdLocale:E,antdTheme:T,invalid:f,setInvalid:v,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,onOk:P,onChange:L,onKeyDown:x,getValue:M,isCancelBeforeStart:g,isCancelAfterEnd:F}}}),yr=(t,r)=>{const e=t.__vccOpts||t;for(const[n,a]of r)e[n]=a;return e};function FC(t,r,e,n,a,i){const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-tooltip"),c=o.resolveComponent("a-time-picker"),d=o.resolveComponent("a-date-picker"),u=o.resolveComponent("a-config-provider"),f=o.resolveDirective("focus");return o.openBlock(),o.createBlock(u,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[t.readOnly?o.withDirectives((o.openBlock(),o.createBlock(l,{key:0,value:t.readOnlyValue,"allow-clear":!1,readOnly:!0},null,8,["value"])),[[f]]):t.props.params.type==="time"?(o.openBlock(),o.createBlock(c,{key:1,value:t.value,"onUpdate:value":r[0]||(r[0]=h=>t.value=h),ref:"dateInputRef",style:{width:"100%"},open:t.open,format:t.format,max:t.max,min:t.min,autofocus:!0,status:t.invalid?"error":void 0,onKeydown:t.onKeyDown,onChange:t.onChange,onOk:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prevIcon",fn:o.withCtx(()=>[o.createVNode(s,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","open","format","max","min","status","onKeydown","onChange","onOk"])):(o.openBlock(),o.createBlock(d,{key:2,value:t.value,"onUpdate:value":r[1]||(r[1]=h=>t.value=h),ref:"dateInputRef",style:{width:"100%"},picker:t.picker,open:t.open,format:t.format,max:t.max,min:t.min,"show-time":t.showTime,autofocus:!0,status:t.invalid?"error":void 0,onKeydown:t.onKeyDown,onChange:t.onChange,onOk:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prevIcon",fn:o.withCtx(()=>[o.createVNode(s,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.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 Dc=yr(IC,[["render",FC]]),AC=o.defineComponent({name:"DropdownEditor",components:{"a-button":tt.Button,"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},props:["params"],directives:{focus:t=>{t.children&&o.nextTick(()=>{const r=_.ER.Core.jQuery(t.children);r==null||r.select()})}},setup:t=>{var R,N,U,V,b,W,q,z,ee,Q;const r=o.ref(null),e=o.ref(t.params.multiple?"multiple":"single"),n=o.ref(((N=(R=t.params.colDef.context)==null?void 0:R.columnConfig)==null?void 0:N.READ_ONLY)==="1"),a=o.ref(t.params.value),i=o.ref(""),l=o.ref(""),s=o.ref(null),c=o.ref(""),d=[],u="DropdownEditor",f=(U=t.params.colDef.context)==null?void 0:U.iconUrlMap;let h=t.params.dataSource||[],p=t.params.displayColumns||[],C=t.params.valueField||"CODE",E=t.params.textField||"CODE_DESC_1_CONTENT",T=((q=(W=(b=(V=t.params.context)==null?void 0:V.columnConfig)==null?void 0:b[t.params.colDef.colId])==null?void 0:W.extendOptions)==null?void 0:q.showDropdownFilter)??((ee=(z=t.params.context)==null?void 0:z.options)==null?void 0:ee.showDropdownFilter)??5;T=typeof T=="number"&&T>=1?T:5;const v=o.ref(zt()),M=o.ref(Fr());window.$wujie&&((Q=window.$wujie.bus)==null||Q.$on("changeThemeEmit",G=>{v.value=zt()}));const g=()=>a.value,F=()=>n.value!==!0,P=G=>{c.value={...c.value,border:G}},L=()=>!1,x=()=>!1,S=G=>{var K,ie;if(G.event.key==="ArrowUp"||G.event.key==="ArrowDown"){const J=G.api.getFocusedCell();(J==null?void 0:J.rowIndex)>=0&&(a.value=(ie=(K=G.api.getModel())==null?void 0:K.getRow(J.rowIndex))==null?void 0:ie.data[C])}},O=G=>{r.value.gridOptions.api.setQuickFilter(G.target.value)},A=G=>{var K,ie,J;if((K=t.params)!=null&&K.allowNew&&((ie=t.params)==null?void 0:ie.multiple)!==!0)a.value=i.value,i.value="",t.params.stopEditing();else if(((J=t.params)==null?void 0:J.multiple)===!0){const te=r.value.gridOptions.api.getSelectedNodes();let H="";te.forEach(Ee=>{H=H.trim().length===0?_.ER.Core.toString(Ee.data[C]):H+","+_.ER.Core.toString(Ee.data[C])}),a.value=H,t.params.stopEditing()}},w=G=>{t.params.stopEditing()},I=(G,K)=>{const ie=document.createElement("div");ie.style.display="flex";let J;G.startsWith("IconFont:")?(G=G.replace("IconFont:",""),J=_.ER.Core.createErSvgElement(G)):G.startsWith("ImgUrl:")&&(G=G.replace("ImgUrl:",""),J=_.ER.Core.createRemoteImgElement(G)),J&&(J.style.paddingTop="1px",ie.appendChild(J));const te=document.createElement("span");return te.innerHTML=K,te.style.paddingLeft="3px",ie.appendChild(te),ie},k=G=>{var ie,J,te;const K=[];return G.api.getDisplayedRowCount()>0&&(K.push("copy","copyWithHeaders"),((J=(ie=G.columnApi)==null?void 0:ie.getRowGroupColumns())==null?void 0:J.length)>0&&K.push("separator","expandAll","contractAll")),(te=G.api)!=null&&te.isColumnFilterPresent()&&(K.push("separator"),K.push({name:_.ER.Core.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var H;(H=G.api)==null||H.setFilterModel(null)}})),K},y=G=>{var K,ie;if(G.event){const J=((K=G.api)==null?void 0:K.getCellRanges())||[];if(J.length===1&&J[0].columns.length===1&&J[0].columns[0].colId===_.ER.SysInfo.GridCheckColumnFieldName){const te=(ie=G.api)==null?void 0:ie.getModel();if(te){const H=[];for(let Ee=J[0].startRow.rowIndex;Ee<=J[0].endRow.rowIndex;Ee++){const Z=te.getRow(Ee);Z&&H.push(Z)}G.api.setNodesSelected({nodes:H,newValue:G.node.isSelected()})}}}};return o.onBeforeMount(()=>{var G,K,ie,J,te,H,Ee,Z,Ve,X,le;if(n.value===!1){const se=t.params.formHelper,re=(ie=(K=(G=t.params.context)==null?void 0:G.options)==null?void 0:K.dropdownFilter)==null?void 0:ie[t.params.colDef.colId];if(p.length>0)re instanceof Function&&(h=re({data:t.params.data,dataSource:h,value:t.params.value})),p.forEach((ve,be)=>{const _e={colId:ve.field,field:ve.field,tooltipField:ve.field,headerName:ve.headerName||ve.title,minWidth:150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};ve.field===C&&(_e.width=100,_e.minWidth=100,_e.maxWidth=200),d.push(_e)});else if((te=(J=se.DropDownBindSource)==null?void 0:J[t.params.configId])!=null&&te[t.params.colDef.colId]){const ve=se.DropDownBindSource[t.params.configId][t.params.colDef.colId],be=(H=t.params.colDef.context)==null?void 0:H.columnConfig;C=ve.dataValueField||"CODE",E=ve.dataTextField||"CODE_DESC_1_CONTENT",h=ve.dataSource;const _e=((Ee=be==null?void 0:be.FATHER_FIELD)==null?void 0:Ee.trim())||"",$e=((Z=be==null?void 0:be.FORM_FILTER)==null?void 0:Z.trim())||"",Ce=((Ve=be==null?void 0:be.LAYOUT_ID)==null?void 0:Ve.trim())||t.params.configId,Fe=((X=be==null?void 0:be.extendOptions)==null?void 0:X.dropdownOptions)||{};if(_e.length>0&&$e.length>0)if(Ce===t.params.configId&&t.params.data)h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,t.params.data[_e]||"");else{const De=se.getGrid(Ce);if(De){const Oe=se.getGridCurrentRow(De,!0);Oe&&(h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,Oe[_e]||""))}else{const Oe=se.getLayoutBindModel(Ce);Oe&&(h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,Oe[_e]||""))}}re instanceof Function&&(h=re({data:t.params.data,dataSource:h,value:t.params.value})),((le=ve.columns)==null?void 0:le.length)>0&&ve.columns.forEach((De,Oe)=>{var Ze;const Ie={colId:De.field,field:De.field,tooltipField:De.field,headerName:De.title,minWidth:50,width:De.width||150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};f&&Oe===0&&(Ie.cellRenderer=ge=>{var Me,Xe,mt,et;const oe=_.ER.Core.toString(ge.value).replace(/</g,"<"),ye=((Xe=(Me=ge==null?void 0:ge.data)==null?void 0:Me[C])==null?void 0:Xe.trim())||"";if(ye.length>0)return(mt=f[ye])!=null&&mt.trim().startsWith("IconFont:")||(et=f[ye])!=null&&et.startsWith("ImgUrl:")?I(f[ye],oe):oe});const Re=((Ze=Fe==null?void 0:Fe.wrapText)==null?void 0:Ze[Ie.field])??(Fe==null?void 0:Fe.wrapText);Ie.autoHeight=Ie.autoHeight||Re,Ie.wrapText=Ie.wrapText||Re,d.push(Ie)})}(h==null?void 0:h.length)>10&&(s.value={statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]})}else l.value=t.params.colDef.refData[t.params.value]||t.params.value}),o.onMounted(()=>{var G,K,ie,J,te,H,Ee,Z,Ve;if(!n.value){if(d.length===0){const re={colId:"CODE",field:"CODE",tooltipField:"CODE",headerName:_.ER.Core.$t("ERX.CodeColumn")||"代码",minWidth:100,width:100,maxWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};f&&(re.cellRenderer=ve=>{var _e,$e,Ce;const be=_.ER.Core.toString(ve.value).replace(/</g,"<");if(((_e=ve.value)==null?void 0:_e.length)>0)return($e=f[ve.value])!=null&&$e.trim().startsWith("IconFont:")||(Ce=f[ve.value])!=null&&Ce.startsWith("ImgUrl:")?I(f[ve.value],be):be}),d.push(re),d.push({colId:"CODE_DESC_1_CONTENT",field:"CODE_DESC_1_CONTENT",tooltipField:"CODE_DESC_1_CONTENT",headerName:_.ER.Core.$t("ERX.DescriptionColumn")||"描述",width:200,minWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T})}let X=0;d.forEach(re=>{var ve,be;re.width=((be=(ve=t.params.colDef.context)==null?void 0:ve.popColumnsWidth)==null?void 0:be[re.colId])||re.width,X+=re.width||150}),t.params.multiple&&(d.unshift({colId:_.ER.SysInfo.GridCheckColumnFieldName,pinned:mn()?"right":"left",headerCheckboxSelection:re=>!0,headerCheckboxSelectionFilteredOnly:((G=t.params)==null?void 0:G.headerCheckboxSelectionFilteredOnly)??!0,checkboxSelection:re=>!re.node.group&&!re.node.footer,headerName:"",width:30,maxWidth:30,minWidth:30,suppressMenu:!0,resizable:!1,sortable:!1,lockPosition:mn()?"right":"left"}),X+=30);let le=15;(h==null?void 0:h.length)<15&&(le=(h==null?void 0:h.length)+2),le<5&&(le=5),(ie=(K=t.params.colDef)==null?void 0:K.context)!=null&&ie.popWidth&&(X=(te=(J=t.params.colDef)==null?void 0:J.context)==null?void 0:te.popWidth);const se=((Ee=(H=t.params.colDef)==null?void 0:H.context)==null?void 0:Ee.popHeight)||le*25+15;if(c.value={resize:"both",overflow:"auto",height:se+"px",width:X+"px"},r.value.gridOptions.api.selectionService.rowSelection=t.params.multiple?"multiple":"single",r.value.gridOptions.enableRangeSelection=!0,r.value.gridOptions.enableRangeHandle=!0,r.value.gridOptions.debounceVerticalScrollbar=!0,r.value.gridOptions.enableBrowserTooltips=!0,r.value.gridOptions.headerHeight=d.length===1&&h.length<T?0:void 0,r.value.gridOptions.api.setColumnDefs(d),r.value.gridOptions.api.setRowData(h),r.value.gridOptions.api.addEventListener("columnResized",re=>{var ve;t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popColumnsWidth=t.params.colDef.context.popColumnsWidth||{},(ve=re.columns)==null||ve.forEach(be=>{t.params.colDef.context.popColumnsWidth[be.colId]=be.actualWidth})}),!t.params.multiple&&((Ve=(Z=t.params.colDef.context)==null?void 0:Z.columnConfig)==null?void 0:Ve.ADD_EMPTY_ITEM)==="1"){const re={};re[C]="",r.value.gridOptions.api.setPinnedTopRowData([re])}t.params.multiple||r.value.gridOptions.api.addEventListener("cellClicked",re=>{a.value=re.data[C],t.params.stopEditing()}),r.value.gridOptions.api.addEventListener("firstDataRendered",re=>{if(_.ER.Core.toString(a.value,!0).trim().length>0){const ve=_.ER.Core.toString(a.value,!0).split(",");let be=!1;re.api.forEachNodeAfterFilterAndSort(_e=>{ve.includes(_e.data[C])&&(_e.setSelected(!0),re.api.setFocusedCell(_e.rowIndex,E),be||re.api.ensureIndexVisible(_e.rowIndex,"top"),be=!0)})}}),o.nextTick(()=>{_.ER.Core.jQuery(r.value).focus(),new ResizeObserver(_.ER.Core.debounce(ve=>{var $e,Ce,Fe,De,Oe,Ie,Re,Ze;const be=((Ce=($e=ve[0])==null?void 0:$e.contentRect)==null?void 0:Ce.width)||0,_e=((De=(Fe=ve[0])==null?void 0:Fe.contentRect)==null?void 0:De.height)||0;be>0&&(t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popWidth=be),_e>0&&(t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popHeight=_e),(((Oe=t.params.colDef.context)==null?void 0:Oe.popColumnsWidth)===void 0||Object.keys(t.params.colDef.context.popColumnsWidth).length>0)&&((Ze=(Re=(Ie=r==null?void 0:r.value)==null?void 0:Ie.gridOptions)==null?void 0:Re.api)==null||Ze.sizeColumnsToFit())},200)).observe(document.querySelector("#dropdownEditorDiv"))})}}),{h:o.h,isRTL:mn,ER:_.ER,editorType:u,dropDownStyle:c,props:t,readOnly:n,value:a,newValue:i,displayText:l,statusBar:s,dropDownColumns:d,dropDownData:h,agGridVueDropdownRef:r,rowSelection:e,antdTheme:v,antdLocale:M,getAgLocaleText:Na,CheckCircleOutlined:rt.CheckCircleOutlined,CloseCircleOutlined:rt.CloseCircleOutlined,getContextMenuItems:k,setBorder:P,confirmClick:A,cancelClick:w,onCellKeyDown:S,getValue:g,isPopup:F,isCancelBeforeStart:L,isCancelAfterEnd:x,onFilterTextBoxChanged:O,onRowSelected:y}}}),MC={key:0},xC={style:{flex:1,width:"100%"}},RC={key:0,class:"gridDropDownEditorFooter"};function NC(t,r,e,n,a,i){var f,h,p;const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-config-provider"),c=o.resolveComponent("ag-grid-vue"),d=o.resolveComponent("a-button"),u=o.resolveDirective("focus");return t.readOnly?(o.openBlock(),o.createElementBlock("div",MC,[o.createVNode(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(l,{value:t.displayText,"allow-clear":!1,readOnly:!0},null,8,["value"]),[[u]])]),_:1},8,["theme","locale"])])):(o.openBlock(),o.createElementBlock("div",{key:1,id:"dropdownEditorDiv",style:o.normalizeStyle([{display:"flex","flex-direction":"column",height:"100%"},t.dropDownStyle])},[o.createElementVNode("div",xC,[o.createVNode(c,{class:"ag-theme-balham",style:{height:"100%",width:"100%"},ref:"agGridVueDropdownRef",enableRtl:t.isRTL(),localeText:t.getAgLocaleText(),statusBar:t.statusBar,"row-selection":t.rowSelection,enableRangeSelection:t.props.params.multiple,rowMultiSelectWithClick:t.props.params.multiple,enableRangeHandle:t.props.params.multiple,suppressRowClickSelection:(f=t.props.params)==null?void 0:f.multiple,stopEditingWhenCellsLoseFocus:!0,enableBrowserTooltips:!0,getContextMenuItems:t.getContextMenuItems,onRowSelected:t.onRowSelected,onCellKeyDown:t.onCellKeyDown},null,8,["enableRtl","localeText","statusBar","row-selection","enableRangeSelection","rowMultiSelectWithClick","enableRangeHandle","suppressRowClickSelection","getContextMenuItems","onRowSelected","onCellKeyDown"])]),(h=t.props.params)!=null&&h.multiple||(p=t.props.params)!=null&&p.allowNew?(o.openBlock(),o.createElementBlock("div",RC,[o.createVNode(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var C,E;return[(C=t.props.params)!=null&&C.allowNew&&((E=t.props.params)==null?void 0:E.multiple)!==!0?(o.openBlock(),o.createBlock(l,{key:0,onPressEnter:t.confirmClick,placeholder:"请输入其他值",value:t.newValue,"onUpdate:value":r[0]||(r[0]=T=>t.newValue=T),"allow-clear":!0},null,8,["onPressEnter","value"])):o.createCommentVNode("",!0),o.createVNode(d,{type:"primary",class:"er-button",icon:t.h(t.CheckCircleOutlined),onClick:t.confirmClick},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.ER.Core.$t("ERX.Confirm")||"确定"),1)]),_:1},8,["icon","onClick"]),o.createVNode(d,{type:"primary",class:"er-button",icon:t.h(t.CloseCircleOutlined),onClick:t.cancelClick},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.ER.Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["icon","onClick"])]}),_:1},8,["theme","locale"])])):o.createCommentVNode("",!0)],4))}const Oa=yr(AC,[["render",NC]]),bC=o.defineComponent({name:"ButtonEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-input-group":tt.InputGroup,"a-input":tt.Input,"a-button":tt.Button,"a-tooltip":tt.Tooltip},setup:t=>{var p,C,E;const r=o.ref(null),e=o.ref(((C=(p=t.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:C.READ_ONLY)==="1"),n=o.ref(t.params.value),a=o.ref(!1),i=o.ref(Fr()),l=o.ref(zt());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",T=>{l.value=zt()}));const s=()=>n.value,c=()=>{a.value=!0},d=()=>!1,u=()=>!1,f=T=>{if(a.value=!1,_.ER.Core.toString(n,!0).length===0&&t.params.formHelper&&t.params.configId){T.params=t.params,T.isClear=!0;const v=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");if(v&&v instanceof Function&&v(T)===!1)return;t.params.stopEditing()}else if(t.params.maxLength>0){const v=T.target.value||"";let M="",g=0;for(let F=0;F<v.length;F++){const P=v.codePointAt(F);if(P>=128512&&P<=128591?g+=4:P>=19968&&P<=40959||P>=65280&&P<=65519?g+=2:g+=1,g>t.params.maxLength){n.value=M;break}M+=v[F]}}},h=async T=>{if(t.params.formHelper&&t.params.configId){T.params=t.params,t.params.event&&t.params.event instanceof Function&&await t.params.event(T);const v=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");if(v&&v instanceof Function&&v(T)===!1)return;t.params.stopEditing()}};return o.onMounted(()=>{o.nextTick(()=>{_.ER.Core.jQuery(r.value).focus()})}),{h:o.h,ER:_.ER,props:t,value:n,inputRef:r,readOnly:e,antdLocale:i,antdTheme:l,EllipsisOutlined:rt.EllipsisOutlined,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,onChange:f,setInvalid:c,getValue:s,addButtonClick:h,isCancelBeforeStart:d,isCancelAfterEnd:u}}});function kC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-button"),d=o.resolveComponent("a-input-group"),u=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(u,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(d,{style:{display:"flex","align-items":"center",width:"100%"},compact:""},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=f=>t.value=f),ref:"inputRef","allow-clear":!0,readOnly:t.readOnly,style:{flex:1},onChange:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","readOnly","onChange"]),o.createVNode(c,{style:{height:"22px !important",width:"23px","box-shadow":"none !important"},onClick:t.addButtonClick},{icon:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.EllipsisOutlined))))]),_:1},8,["onClick"])]),_:1})]),_:1},8,["theme","locale"])}const PC=yr(bC,[["render",kC]]),LC=o.defineComponent({name:"ColorEditor",props:["params"],components:{"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},setup:t=>{var d;const r=o.ref(Fr()),e=o.ref(zt());window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{e.value=zt()}));const n=o.ref(null),a=o.ref("#ffffff"),i=()=>a.value||"#ffffff",l=()=>!1,s=()=>!1,c=u=>{a.value="#ffffff"};return o.onBeforeMount(()=>{var u;if(((u=t.params.value)==null?void 0:u.trim().length)>0)a.value=_.ER.Core.toHexColor(t.params.value);else return"#ffffff"}),o.onMounted(()=>{}),{h:o.h,value:a,props:t,inputRef:n,antdLocale:r,antdTheme:e,clearButtonClick:c,getValue:i,isCancelBeforeStart:l,isCancelAfterEnd:s}}});function BC(t,r,e,n,a,i){const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(l,{ref:"inputRef",value:t.value,"onUpdate:value":r[1]||(r[1]=c=>t.value=c),style:{paddingTop:"0px",paddingBottom:"0px"},class:"er-color-picker","allow-clear":!0},{addonBefore:o.withCtx(()=>[o.createVNode(l,{type:"color",value:t.value,"onUpdate:value":r[0]||(r[0]=c=>t.value=c)},null,8,["value"])]),_:1},8,["value"])]),_:1},8,["theme","locale"])}const HC=yr(LC,[["render",BC]]),VC=o.defineComponent({name:"NumberEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-tooltip":tt.Tooltip,"a-input":tt.Input,"a-input-number":tt.InputNumber},setup:t=>{var p,C,E;const r=o.ref(null),e=o.ref(((C=(p=t.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:C.READ_ONLY)==="1"),n=o.ref(t.params.zeroDisplayEmpty!==!1&&t.params.value===0?"":t.params.value),a=o.ref(!1),i=t.params.eventKey||"",l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",T=>{s.value=zt()}));const c=()=>n.value===""||n.value===void 0||isNaN(n.value)?null:_.ER.Core.toNumber(n.value),d=()=>{a.value=!0},u=()=>!1,f=()=>{const T=parseFloat(n.value);return t.params.min!==void 0&&T<t.params.min||t.params.max!==void 0&&T>t.params.max?(_.ER.Core.messageWarning((_.ER.Core.$t("ERX.InputValueOutOfRange")||"输入数值超出允许范围")+"["+t.params.min+","+t.params.max+"]"),!0):(a.value=!1,!1)},h=T=>{let v=T.target.value;if(v=v.replace(/(?!^-)[^\d.]/g,""),t.params.precision>=0&&v.includes(".")){const M=v.split(".");M[0]=M[0]||"0",t.params.precision===0?v=M[0]:(M[1]=M[1].slice(0,t.params.precision),v=`${M[0]}.${M[1]}`)}n.value=v};return o.onMounted(()=>{o.nextTick(()=>{const T=_.ER.Core.jQuery(r.value);T==null||T.focus(),i.length===1?n.value=i:T==null||T.select()})}),{h:o.h,ER:_.ER,props:t,readOnly:e,value:n,inputRef:r,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,onChange:h,setInvalid:d,getValue:c,isCancelBeforeStart:u,isCancelAfterEnd:f}}});function UC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-input-number"),d=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(d,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[t.props.params.showNumberControl!==!0?(o.openBlock(),o.createBlock(s,{key:0,value:t.value,"onUpdate:value":r[0]||(r[0]=u=>t.value=u),ref:"inputRef","allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,autofocus:!0,readOnly:t.readOnly,onChange:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange"])):o.createCommentVNode("",!0),t.props.params.showNumberControl===!0?(o.openBlock(),o.createBlock(c,{key:1,value:t.value,"onUpdate:value":r[1]||(r[1]=u=>t.value=u),ref:"inputRef",style:{width:"100%"},"allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,autofocus:!0,readonly:t.readOnly,controls:!0,step:t.props.params.step===!0?1:typeof t.props.params.step=="number"?t.props.params.step:1,formatter:t.props.params.formatter,parser:t.props.params.parser},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readonly","step","formatter","parser"])):o.createCommentVNode("",!0)]),_:1},8,["theme","locale"])}const wc=yr(VC,[["render",UC]]),GC=o.defineComponent({name:"TextEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-input":tt.Input,"a-tooltip":tt.Tooltip},setup:t=>{var v,M,g;const r=o.ref(null),e=o.ref(((M=(v=t.params.colDef.context)==null?void 0:v.columnConfig)==null?void 0:M.READ_ONLY)==="1"),n=o.ref(t.params.value||""),a=o.ref(!1),i=o.ref(""),l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((g=window.$wujie.bus)==null||g.$on("changeThemeEmit",F=>{s.value=zt()}));const c=t.params.eventKey||"",d=t.params.maxLength??-1,u=t.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{a.value=!0},p=()=>!1,C=()=>!1,E=F=>{a.value=!1;const P=F.target.value||"";if(d>0&&P.length>0){let L="",x=0;for(let S=0;S<P.length;S++){const O=P.codePointAt(S);if(O>=128512&&O<=128591?x+=4:O>=19968&&O<=40959||O>=65280&&O<=65519?x+=2:x+=1,x>d){n.value=L;break}L+=P[S]}}if((u==null?void 0:u.length)>0&&_.ER.Core.isValidRegex(u)&&!new RegExp(u).test(P)){a.value=!0,n.value=Array.from(n.value).filter(L=>new RegExp(u).test(L)).join(""),i.value=_.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}},T=F=>{a.value=!1};return o.onMounted(()=>{o.nextTick(()=>{var P;const F=_.ER.Core.jQuery(r.value);F==null||F.focus(),c.length===1?(n.value=c,(P=r.value)==null||P.setSelectionRange(1,1)):F==null||F.select()})}),{h:o.h,ER:_.ER,props:t,value:n,readOnly:e,inputRef:r,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,errorMessage:i,onChange:E,onKeydown:T,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:C}}});function $C(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=d=>t.value=d),ref:"inputRef","allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,readOnly:t.readOnly,onChange:t.onChange,onKeydown:o.withKeys(t.onKeydown,["enter"])},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.errorMessage},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange","onKeydown"])]),_:1},8,["theme","locale"])}const Ic=yr(GC,[["render",$C]]),zC=o.defineComponent({name:"LargeTextEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-textarea":tt.Textarea,"a-tooltip":tt.Tooltip},setup:t=>{var g,F,P;const r=o.ref(null),e=o.ref(((F=(g=t.params.colDef.context)==null?void 0:g.columnConfig)==null?void 0:F.READ_ONLY)==="1"),n=o.ref(t.params.value||""),a=o.ref(!1),i=o.ref(""),l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((P=window.$wujie.bus)==null||P.$on("changeThemeEmit",L=>{s.value=zt()}));let c=!1;const d=t.params.maxLength??-1,u=t.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{a.value=!0},p=()=>!1,C=()=>!1,E=L=>{L.key==="Enter"&&(c||L.shiftKey)&&L.stopPropagation()},T=()=>{c=!0},v=()=>{c=!1},M=L=>{a.value=!1;const x=L.target.value||"";if(d>0&&x.length>0){let S="",O=0;for(let A=0;A<x.length;A++){const w=x.codePointAt(A);if(w>=128512&&w<=128591?O+=4:w>=19968&&w<=40959||w>=65280&&w<=65519?O+=2:O+=1,O>d){n.value=S;break}S+=x[A]}}if((u==null?void 0:u.length)>0&&_.ER.Core.isValidRegex(u)&&!new RegExp(u).test(x)){a.value=!0,n.value=Array.from(n.value).filter(S=>new RegExp(u).test(S)).join(""),i.value=_.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}};return o.onMounted(()=>{o.nextTick(()=>{const L=_.ER.Core.jQuery(r.value);L==null||L.focus(),L==null||L.select()})}),{h:o.h,ER:_.ER,props:t,value:n,inputRef:r,readOnly:e,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,errorMessage:i,onChange:M,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:C,onCompositionstart:T,onCompositionend:v,onKeyDown:E}}});function YC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-textarea"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=d=>t.value=d),ref:"inputRef",class:"grid-cell-editor-textarea","allow-clear":t.readOnly!==!0,maxlength:t.props.params.maxLength,status:t.invalid?"error":void 0,readOnly:t.readOnly===!0,rows:t.props.params.rows,cols:t.props.params.cols,"show-count":t.props.params.showCount,onKeydown:t.onKeyDown,onCompositionstart:t.onCompositionstart,onCompositionend:t.onCompositionend},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.errorMessage},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.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 _s=yr(zC,[["render",YC]]),WC=o.defineComponent({name:"ColorCell",props:["params"],setup:t=>{const r=o.ref("");return o.onMounted(()=>{var e;((e=t.params.value)==null?void 0:e.trim().length)>0&&(r.value=t.params.value==="255,255,255,1"?"":t.params.value)}),{ER:_.ER,value:r}}}),XC={style:{overflow:"hidden",textOverflow:"ellipsis"}};function qC(t,r,e,n,a,i){return o.openBlock(),o.createElementBlock("div",XC,[o.createElementVNode("span",{style:o.normalizeStyle({paddingRight:"5px",borderLeft:t.value.length>0?"10px solid "+t.ER.Core.toHexColor(t.value):""})},null,4),o.createTextVNode(o.toDisplayString(t.value),1)])}const QC=yr(WC,[["render",qC]]),jC=o.defineComponent({name:"ButtonGroup",components:{"a-button":tt.Button,"a-tooltip":tt.Tooltip,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{var l,s,c;const r=o.ref(Fr()),e=o.ref(zt()),n=t.params.columnConfig||{},a=[];(s=(l=t.params)==null?void 0:l.data)!=null&&s.uid&&t.params.buttons.forEach(d=>{var f,h;d.options=d.options||{},d.options.style={height:"16px !important",...d.options.style};const u=((f=d.options)==null?void 0:f.condition)||"";if((u==null?void 0:u.trim().length)>0){const p=((h=t.params.data)==null?void 0:h.toJSON())||{};_.ER.Core.checkExpressionValid(p,u)&&a.push(d)}else a.push(d)}),window.$wujie&&((c=window.$wujie.bus)==null||c.$on("changeThemeEmit",d=>{e.value=zt()}));const i=d=>{var u,f,h,p,C,E;if(t.params.formHelper&&t.params.configId){((u=d.name)==null?void 0:u.toLowerCase())==="addrow"||((f=d.name)==null?void 0:f.toLowerCase())==="newrow"?t.params.formHelper.addRowToGrid(t.params.configId):(((h=d.name)==null?void 0:h.toLowerCase())==="deleterow"||((p=d.name)==null?void 0:p.toLowerCase())==="removerow"||((C=d.name)==null?void 0:C.toLowerCase())==="delete"||((E=d.name)==null?void 0:E.toLowerCase())==="remove")&&t.params.formHelper.deleteGridRows(t.params.configId,!0,[t.params.data]);const T=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");T&&T instanceof Function&&T({...t.params,button:d})}};return o.onMounted(()=>{}),{buttonClick:i,props:t,antdLocale:r,antdTheme:e,columnConfig:n,renderButton:a}}}),KC={key:0,class:"er-grid-button-group",style:{display:"flex","align-items":"center"}};function JC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-button"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var d,u,f;return[!((d=t.props.params.node)!=null&&d.group)&&!((u=t.props.params.node)!=null&&u.rowPinned)?(o.openBlock(),o.createElementBlock("div",KC,[t.props.params.displayValue?(o.openBlock(),o.createBlock(l,{key:0,title:(f=t.props.params)==null?void 0:f.getValue()},{default:o.withCtx(()=>{var h;return[o.createElementVNode("div",null,o.toDisplayString((h=t.props.params)==null?void 0:h.getValue()),1)]}),_:1},8,["title"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.renderButton,(h,p)=>{var C;return o.openBlock(),o.createBlock(l,{key:h.name+"tooltip",title:(C=h.options)!=null&&C.showTooltip?h.caption:void 0},{default:o.withCtx(()=>{var E,T,v,M,g,F,P,L,x,S,O,A;return[o.createVNode(s,{type:((E=h.options)==null?void 0:E.type)||"link",icon:((T=h.options)==null?void 0:T.icon)||void 0,style:o.normalizeStyle((v=h.options)==null?void 0:v.style),ghost:((M=h.options)==null?void 0:M.ghost)===!0,loading:((g=h.options)==null?void 0:g.loading)===!0,shape:((F=h.options)==null?void 0:F.shape)||"default",block:((P=h.options)==null?void 0:P.block)===!0,danger:((L=h.options)==null?void 0:L.danger)===!0||((x=h.name)==null?void 0:x.toLowerCase())==="deleterow"||((S=h.name)==null?void 0:S.toLowerCase())==="removerow"||((O=h.name)==null?void 0:O.toLowerCase())==="delete"||((A=h.name)==null?void 0:A.toLowerCase())==="remove",onClick:w=>t.buttonClick({...h,data:t.props.params.data,index:p})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.caption),1)]),_:2},1032,["type","icon","style","ghost","loading","shape","block","danger","onClick"])]}),_:2},1032,["title"])}),128))])):o.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const ZC=yr(jC,[["render",JC]]),e_=o.defineComponent({name:"ProgressBar",props:["params"],setup:t=>{const r=o.ref(t.params.value),e=o.ref(t.params.maxValue),n=o.ref(t.params.progressBarColor),a=()=>!t.params.value||t.params.value<=0||t.params.maxValue<=0?0:t.params.value/t.params.maxValue>=1?"100%":_.ER.Core.toString(_.ER.Core.toNumber(t.params.value)/_.ER.Core.toNumber(t.params.maxValue)*100)+"%",i=()=>t.params.value?t.params.value<=0||t.params.maxValue<=0?r:_.ER.Core.toString(_.ER.Core.round(t.params.value/t.params.maxValue*100,2))+"%":"";return o.onMounted(()=>{}),{value:r,maxValue:e,progressBarColor:n,percent:a,labelText:i,props:t,ER:_.ER}}}),t_={style:{width:"100%",height:"15px",position:"absolute",color:"",right:0,top:0,zIndex:1}};function r_(t,r,e,n,a,i){return t.value?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({width:"100%",height:"18px",backgroundColor:"transparent",borderColor:t.progressBarColor,position:"relative",borderStyle:"solid",borderWidth:"thin"})},[o.createElementVNode("div",t_,o.toDisplayString(t.labelText()),1),o.createElementVNode("div",{style:o.normalizeStyle({width:t.percent(),height:"100%",backgroundColor:t.progressBarColor,position:"absolute",left:0,right:0,top:0,bottom:0,transition:"width 10s ease-in-out",zIndex:0})},null,4)],4)):o.createCommentVNode("",!0)}const n_=yr(e_,[["render",r_]]),a_=o.defineComponent({name:"DefaultRender",components:{"a-tag":tt.Tag,"a-badge":tt.Badge,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{const r=t.params.click,e=o.ref({});t.params.color&&(e.value.color=t.params.color),t.params.backgroundColor&&(e.value.backgroundColor=t.params.backgroundColor),t.params.boderColor&&(e.value.boxShadow=`0 0 0 1px ${t.params.boderColor} inset`);const n=a=>{a.preventDefault(),r&&r instanceof Function&&r(t.params)};return o.onMounted(()=>{}),{props:t,ER:_.ER,navigateToLink:n,badgeNumberStyle:e}}}),o_={key:0,class:"er-grid-cell-image",style:{display:"inline-block"}},i_={key:0,class:"icon",fill:"currentColor"},l_=["xlink:href"],s_=["src"],c_=["href"];function d_(t,r,e,n,a,i){var c,d,u,f;const l=o.resolveComponent("a-tag"),s=o.resolveComponent("a-badge");return o.openBlock(),o.createElementBlock("div",{style:o.normalizeStyle({display:"block",textAlign:t.props.params.justifyContent==="flex-end"?"right":t.props.params.justifyContent==="center"?"center":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})},[t.props.params.svgIcon||t.props.params.imgIcon||t.props.params.fontIcon?(o.openBlock(),o.createElementBlock("div",o_,[t.props.params.svgIcon?(o.openBlock(),o.createElementBlock("svg",i_,[o.createElementVNode("use",{"xlink:href":t.props.params.svgIcon},null,8,l_)])):t.props.params.fontIcon?(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass(`iconfont icon-${t.props.params.fontIcon} er-iconfont`),style:o.normalizeStyle({height:"16px",width:"16px",fontSize:"14px",color:t.props.params.fontColor})},null,6)):(o.openBlock(),o.createElementBlock("img",{key:2,class:"er-remote-img",src:t.props.params.imgIcon},null,8,s_))])):o.createCommentVNode("",!0),((c=t.props.params.tagText)==null?void 0:c.trim().length)>0&&t.props.params.tagAfterText!==!0?(o.openBlock(),o.createBlock(l,{key:1,style:{display:"inline-block",height:"18px"},color:t.props.params.tagColor||"#87d068",bordered:t.props.params.tagBordered},{default:o.withCtx(()=>{var h;return[o.createTextVNode(o.toDisplayString((h=t.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["color","bordered"])):o.createCommentVNode("",!0),((d=t.props.params.badgeText)==null?void 0:d.trim().length)>0?(o.openBlock(),o.createBlock(s,{key:2,class:"er-badge",count:(u=t.props.params.badgeText)==null?void 0:u.trim(),"number-style":t.badgeNumberStyle,style:{display:"inline-block"}},null,8,["count","number-style"])):o.createCommentVNode("",!0),t.props.params.callFormLink?(o.openBlock(),o.createElementBlock("a",{key:3,onClick:r[0]||(r[0]=o.withModifiers((...h)=>t.navigateToLink&&t.navigateToLink(...h),["prevent"])),style:o.normalizeStyle([{display:"inline-block","text-decoration":"underline"},t.props.params.style])},o.toDisplayString(t.props.params.displayText),5)):t.ER.Core.isUrl(t.props.params.displayText)?(o.openBlock(),o.createElementBlock("a",{key:4,href:t.props.params.displayText,target:"_blank",style:{display:"inline-block"}},o.toDisplayString(t.props.params.displayText),9,c_)):(o.openBlock(),o.createElementBlock("span",{key:5,style:o.normalizeStyle([t.props.params.textStyle,{display:"inline-block"}])},o.toDisplayString(t.props.params.displayText),5)),((f=t.props.params.tagText)==null?void 0:f.trim().length)>0&&t.props.params.tagAfterText===!0?(o.openBlock(),o.createBlock(l,{key:6,style:o.normalizeStyle([{display:"inline-block",height:"18px","margin-left":"5px","padding-left":"1px","padding-right":"1px"},t.props.params.tagStyle]),color:t.props.params.tagColor||"#87d068",bordered:t.props.params.tagBordered},{default:o.withCtx(()=>{var h;return[o.createTextVNode(o.toDisplayString((h=t.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["style","color","bordered"])):o.createCommentVNode("",!0)],4)}const e2=yr(a_,[["render",d_]]),u_=o.defineComponent({name:"ImagePreview",components:{"a-image":tt.Image},props:["params"],setup:t=>{const r=new _.ER.UploadHelper,e=o.ref("");return o.onMounted(async()=>{var n;if(t.params.data){if(t.params.data.imageBlobData)e.value=t.params.data.imageBlobData;else if(t.params.src&&t.params.src.split("/").length>1){const a=await r.downloadFile({key:t.params.src});a.flag&&((n=a.result)!=null&&n.data)&&(e.value=URL.createObjectURL(new Blob([a.result.data])),t.params.data.imageBlobData=e.value)}}}),o.onUnmounted(()=>{}),{props:t,imageUrl:e}}});function f_(t,r,e,n,a,i){const l=o.resolveComponent("a-image");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(l,{src:t.imageUrl||"https://www.antdv.com/#error",alt:"Blob Image",width:t.params.width||100,height:t.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 Fc=yr(u_,[["render",f_]]),h_=o.defineComponent({name:"SwitchRender",components:{"a-switch":tt.Switch,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{var u,f;const r=o.ref(Fr()),e=o.ref(zt()),n=t.params.colDef.cellDataType||"boolean",a=t.params.switchOptions||{},i=o.ref(t.params.value??!1);(n==="string"||n==="text")&&(a!=null&&a.onValue)&&(a!=null&&a.offValue)&&(i.value=t.params.value===(a==null?void 0:a.onValue));const l=o.ref(a==null?void 0:a.onText),s=o.ref(a==null?void 0:a.offText),c=((u=t.params.colDef.context)==null?void 0:u.editable)??!1;window.$wujie&&((f=window.$wujie.bus)==null||f.$on("changeThemeEmit",h=>{e.value=zt()}));const d=h=>{(n==="string"||n==="text")&&(a!=null&&a.onValue)&&(a!=null&&a.offValue)?t.params.setValue(h?a==null?void 0:a.onValue:a==null?void 0:a.offValue):t.params.setValue(i.value)};return o.onMounted(()=>{}),{props:t,antdLocale:r,antdTheme:e,checkedValue:i,editable:c,handleChange:d,checkedChildren:l,unCheckedChildren:s}}}),p_={key:0,style:{display:"flex"}};function m_(t,r,e,n,a,i){const l=o.resolveComponent("a-switch"),s=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var c,d;return[!((c=t.props.params.node)!=null&&c.group)&&!((d=t.props.params.node)!=null&&d.rowPinned)?(o.openBlock(),o.createElementBlock("div",p_,[o.createVNode(l,{checked:t.checkedValue,"onUpdate:checked":r[0]||(r[0]=u=>t.checkedValue=u),disabled:!t.editable,"checked-children":t.checkedChildren,"un-checked-children":t.unCheckedChildren,onChange:t.handleChange},null,8,["checked","disabled","checked-children","un-checked-children","onChange"])])):o.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const t2=yr(h_,[["render",m_]]),g_=o.defineComponent({name:"HeaderGroup",props:["params"],onMounted(){}}),E_={class:"ag-header-group-cell-label"},C_=["innerHTML"];function __(t,r,e,n,a,i){return o.openBlock(),o.createElementBlock("div",E_,[o.createElementVNode("div",{class:"er-header-group-text",innerHTML:t.params.displayName},null,8,C_)])}const T_=yr(g_,[["render",__],["__scopeId","data-v-dbd51531"]]),y_=o.defineComponent({name:"AggregationPanel",props:["params"],setup(t){var a,i;const r=((i=(a=t.params.options)==null?void 0:a.aggregation)==null?void 0:i.format)||"#,##0.######",e=o.reactive({}),n=()=>{var C;const l=(C=t.params.api)!=null&&C.rangeService?t.params.api.rangeService.getCellRanges():void 0;let s=new Er(0),c=0,d=0,u=2,f=null,h=null;const p={};l&&l.length>0&&l.forEach(E=>{let T=t.params.api.rangeService.getRangeStartRow(E);const v=t.params.api.rangeService.getRangeEndRow(E);for(;!(!T||t.params.api.rangeService.rowPositionUtils.before(v,T)||!E.columns);)E.columns.forEach(g=>{var x,S;if(T===null)return;const F=t.params.api.rangeService.cellPositionUtils.createId({rowPinned:T.rowPinned,column:g,rowIndex:T.rowIndex});if(p[F])return;p[F]=!0;const P=t.params.api.rowRenderer.getRowNode(T);if(!P)return;let L=t.params.api.valueService.getValue(g,P);(S=(x=g.colDef)==null?void 0:x.context)!=null&&S.hideContent&&(L="******"),!_.ER.Core.isNullOrEmpty(L)&&(c++,!(typeof L=="object"&&"value"in L&&(L=L.value,L===""))&&(typeof L=="string"&&(L=Number(L)),typeof L=="number"&&!isNaN(L)&&(new Er(L).decimalPlaces()>u&&(u=new Er(L).decimalPlaces()),s=s.add(L),(h===null||L>h)&&(h=L),(f===null||L<f)&&(f=L),d++)))}),T=t.params.api.rangeService.cellNavigationService.getRowBelow(T)}),d>1?(e.average={value:_.ER.Core.formatNumberValue(s.dividedBy(d).toDecimalPlaces(u).toNumber(),r),show:!0},e.sum={value:_.ER.Core.formatNumberValue(s.toNumber(),r),show:!0},e.min={value:_.ER.Core.formatNumberValue(f,r),show:!0},e.max={value:_.ER.Core.formatNumberValue(h,r),show:!0}):(delete e.average,delete e.sum,delete e.min,delete e.max),c>1?e.count={value:c,show:!0}:delete e.count};return{ER:_.ER,aggData:e,setAggData:n}}}),S_={class:"ag-status-panel ag-status-panel-aggregations"},v_={key:0,class:"ag-status-name-value"},O_={class:"ag-status-name-value-value"},D_={key:1,class:"ag-status-name-value"},w_={class:"ag-status-name-value-value"},I_={key:2,class:"ag-status-name-value"},F_={class:"ag-status-name-value-value"},A_={key:3,class:"ag-status-name-value"},M_={class:"ag-status-name-value-value"},x_={key:4,class:"ag-status-name-value"},R_={class:"ag-status-name-value-value"};function N_(t,r,e,n,a,i){var l,s,c,d,u,f,h,p,C,E;return o.openBlock(),o.createElementBlock("div",S_,[(l=t.aggData.average)!=null&&l.show?(o.openBlock(),o.createElementBlock("div",v_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Average")||"平均值")+":",1),o.createElementVNode("span",O_,o.toDisplayString((s=t.aggData.average)==null?void 0:s.value),1)])):o.createCommentVNode("",!0),(c=t.aggData.count)!=null&&c.show?(o.openBlock(),o.createElementBlock("div",D_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Count")||"计数")+":",1),o.createElementVNode("span",w_,o.toDisplayString((d=t.aggData.count)==null?void 0:d.value),1)])):o.createCommentVNode("",!0),(u=t.aggData.max)!=null&&u.show?(o.openBlock(),o.createElementBlock("div",I_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Max")||"最大值")+":",1),o.createElementVNode("span",F_,o.toDisplayString((f=t.aggData.max)==null?void 0:f.value),1)])):o.createCommentVNode("",!0),(h=t.aggData.min)!=null&&h.show?(o.openBlock(),o.createElementBlock("div",A_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Min")||"最小值")+":",1),o.createElementVNode("span",M_,o.toDisplayString((p=t.aggData.min)==null?void 0:p.value),1)])):o.createCommentVNode("",!0),(C=t.aggData.sum)!=null&&C.show?(o.openBlock(),o.createElementBlock("div",x_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Sum")||"总和")+":",1),o.createElementVNode("span",R_,o.toDisplayString((E=t.aggData.sum)==null?void 0:E.value),1)])):o.createCommentVNode("",!0)])}const r2=yr(y_,[["render",N_],["__scopeId","data-v-04a55dad"]]);let Ac=class{constructor(r){fe(this,"UnMountWhenCloseDialog",!0);fe(this,"_app");fe(this,"_options",{});fe(this,"_popWindowOpened",o.ref(!1));fe(this,"_component");this._options=r||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(r){this._options={...this._options,...r}}async showPopAttachment(r){var e;if(this._app)this._options.refreshKey=Y.guid(),this._popWindowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>dk),(e=this._component)!=null&&e.default&&(this._component=this._component.default)));const n=o.createApp(this._component,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=n;const a=document.createElement("div");document.body.appendChild(a),n.mount(a),this._popWindowOpened.value=!0}}},nl=class{static callMenuForm(r,e){}static callDialogForm(r,e,n,a){}static exportGridAsExcel(r,e,n){}static getImportExcelData(r){return Promise.resolve([])}},b_=class{constructor(r,e,n,a,i){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",o.reactive({}));fe(this,"_dropDownBindSource",{});fe(this,"_dropDownCascader",{});fe(this,"_gridOptions",{});fe(this,"_gridReactiveOptions",o.reactive({}));fe(this,"_gridToolbarOptions",o.reactive({}));fe(this,"_hiddenFields",{});fe(this,"_requiredFields",{});fe(this,"_requiredFieldsByCondition",{});fe(this,"_formDataSet",new Qu);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",o.reactive({}));fe(this,"_layoutItemOpitons",o.reactive({}));fe(this,"_layoutBindModelUid",o.reactive({}));fe(this,"_layoutBindModel",{});fe(this,"_controlConditionProps",{});fe(this,"_erxGlobalConfig",{});fe(this,"excuteGridColumnExpressions",(r,e)=>{const n={...r},a=Object.keys(n).sort((l,s)=>l.length>s.length?-1:l.length<s.length?1:0);let i=e;a.forEach(l=>{bt.isDayjs(n[l])?n[l]=n[l].toDate():(n[l]===null||n[l]===void 0)&&(n[l]="");const s=new RegExp(`\\b${l}\\b`,"gi"),c=new RegExp(`[${l}]`.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");c.test(i)?i=i.replaceAll(c,`data.${l}`):s.test(i)&&(i=i.replaceAll(s,`data.${l}`))});try{return new Function("data",i)(n)}catch{console.error("ER: Script has a syntax error: "+i+"; data: "+JSON.stringify(n))}});this._formId=Y.guid(),this._serverPartition=r||this._serverPartition,this._serviceName=n||this._serviceName,this._formName=e||this._formName,this._layoutIds=a,this._initialConfiParas=i,this._currentConfigCompanyCode={},this.SysDefinedParas={GroupCompanyCode:"BS",GroupCompanyName:"宝信软件",DefaultRmbCode:"CNY"}}get App(){return this._app}get Locale(){return Ai()}get IsRtl(){return mn()}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(r,e,n,a,i){var s,c,d,u;this._erxGlobalConfig=await Y.getErxGlobalConfig(),(c=(s=this._erxGlobalConfig)==null?void 0:s.License)!=null&&c[pt.CompanyCode]&&(this._formConfigLicens=(u=(d=this._erxGlobalConfig)==null?void 0:d.License)==null?void 0:u[pt.CompanyCode]);const l=Y.decryptData(this._formConfigLicens,pt.GridCheckColumnFieldName,Y.decryptData(this._privateEncryptKey,pt.GridCheckColumnFieldName,pt.GridCheckColumnFieldName));return this._erxGlobalConfig&&(!this._formConfigLicens||l!==pt.CompanyName)&&this.messageWarning(Y.decryptData(this._formConfigLicensErrorMsg,pt.GridCheckColumnFieldName,pt.GridCheckColumnFieldName)),new Promise((f,h)=>{var E;this._serverPartition=(r==null?void 0:r.trim())||this._serverPartition,this._serviceName=(a==null?void 0:a.trim())||this._serviceName,this._formName=(e==null?void 0:e.trim())||this._formName,this._initialConfiParas=i||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=Y.toString(i==null?void 0:i.dataSetName).trim()||((E=this._dataSetName)==null?void 0:E.trim())||"#";const C=st.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:pt.Culture,FUNCTION_IDS:p,DATASET_NAME:this._dataSetName,TABLE_NAMES:this._tableNames}],"Table0");this._initialConfiParas&&Object.keys(this._initialConfiParas).length>0&&C.addMapData("InitializeFormParas",Object.keys(this._initialConfiParas).map(T=>({PARA_NAME:T,PARA_VALUE:this._initialConfiParas?this._initialConfiParas[T]:""}))),Gr.callServiceEx(this._serviceName,C,{partition:this._serverPartition}).then(T=>{var v,M;T.sysFlag>=0?(T.dataMap.forEach((g,F)=>{this._configInfo[F]=g}),((M=(v=this._configInfo)==null?void 0:v.TSI00FORM)==null?void 0:M.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:T.sysMsg}))},T=>{f({...T,flag:-1,msg:T.msg||"unknown error"})})})}InitializeWithData(){var r,e,n,a,i;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=Y.toNumber(this._formInfo.FORM_WIDTH)||800,this._formHeight=Y.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=((r=this._formInfo.GROUP_COMPANY_CODE)==null?void 0:r.trim())||this._groupCompanyCode,this._groupCompanyName=((e=this._formInfo.GROUP_COMPANY_NAME)==null?void 0:e.trim())||this._groupCompanyName,this._configInfo[pt.SystemParamsBlockName]&&(this._systemInfo=this._configInfo[pt.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)),((i=(a=this._configInfo)==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0?(this.createDataSet(),this._configInfo.TSI00GRIDVIEW.forEach(l=>{this.setDropDownBindSourceAndRequiredFields(l)})):console.error("ER: No view configuration information found")}setMenuFormInstance(r){}async loadConfig(r,e){return new Promise((n,a)=>{var l,s;e={...this._initialConfiParas,...e};const i=r.trim().length>0?r.split(",").filter(c=>c.trim().length>0):[];if(i.length>0){const c=e.reload==="1"?i.join(","):i.filter(u=>!this.containsConfig(u.trim())).join(","),d=(c==null?void 0:c.length)>0?c.split(","):[];if(d.length>0){const u=st.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:pt.Culture,FUNCTION_IDS:c,DATASET_NAME:"#",TABLE_NAMES:"",EXIST_TABLES:((s=Object.keys((l=this._formDataSet)==null?void 0:l.dataTables))==null?void 0:s.join(","))||"",INI_FLAG:this._initializeFlag}],"Table0");e&&Object.keys(e).length>0&&u.addMapData("InitializeFormParas",Object.keys(e).map(f=>({PARA_NAME:f,PARA_VALUE:e?e[f]:""}))),Gr.callServiceEx(this._serviceName,u,{partition:this._serverPartition}).then(f=>{f.sysFlag>=0&&(f.dataMap.forEach((p,C)=>{[pt.SystemParamsBlockName,"TESCOMPANYINFO","TSI00FORM","TSI00DATASOURCE","TSI00DATATABLE","TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].includes(C)||(this._configInfo[C]=p)}),["TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].forEach(p=>{if(f.contains(p)&&this._configInfo[p]&&f.getMapData(p).length>0){if((e==null?void 0:e.reload)==="1"&&this._configInfo[p].length>0)for(let C=this._configInfo[p].length-1;C>=0;C--)d.includes(this._configInfo[p][C].FUNCTION_ID)&&this._configInfo[p].splice(C,1);this._configInfo[p].push(...f.getMapData(p))}}),d.forEach(p=>{var T;(e==null?void 0:e.reload)==="1"&&(this._tempSingleConfigInfo[p]=void 0);const C=this.getSingleViewConfigInfo(p),E=Y.toString(C.TABLE_NAME).trim();if(C&&E.length>0&&!this._formDataSet.contains(E)){this._configInfo.TSI00DATATABLE.some(M=>M.TABLE_NAME===E)||f.getMapData("TSI00DATATABLE").length>0&&this._configInfo.TSI00DATATABLE.push(...f.getMapData("TSI00DATATABLE"));const v={};C.FUNCTION_TYPE==="T"&&((T=C.CURRENT_NODE_DESC)==null?void 0:T.trim().length)>0&&C.FATHER_NODE_DESC.trim().length>0&&(v.hierarchy={primaryField:C.CURRENT_NODE_DESC.trim(),parentField:C.CURRENT_NODE_DESC}),this.createDataTable(E,v)}this.setDropDownBindSourceAndRequiredFields(C)})),n({flag:f.sysFlag>=0?1:-1,msg:f.sysMsg})},f=>{n({...f,flag:-1,msg:"unknown error"})})}else n({flag:1,msg:"Configuration ["+r.trim()+"] already exists"})}else n({flag:-1,msg:"No config id"})})}$t(r,e){var a,i;let n;if((r==null?void 0:r.trim().length)>0){for(let l=0;l<((i=(a=this.ConfigInfo.TSI00FORMRESOURCE)==null?void 0:a.data)==null?void 0:i.length);l++)if(this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_CODE===r){n=this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_VALUE_RES||this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_VALUE;break}n=n??Y.$t(r,e)}return n??""}setFormCapiton(r){return this._formCaption=r,this}setFormOptions(r){return this._formOptions={...this._formOptions,...r},this}setDropDownBindSourceAndRequiredFields(r){const e={},n={},a=[],i=[],l=["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=pt.CompanyCode;r.MATCH_FLAG==="1"&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===r.FUNCTION_ID&&d.COMPANY_CODE===c&&(l.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length===0&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===r.FUNCTION_ID&&d.COMPANY_CODE===this.DefaultConfigCompanyCode&&(l.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length>0&&s.forEach(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;if(l.includes(u))if(d.ORIGIN_CODE!=="0"&&d.SVC_NAME.trim().length>0){if(e[d.ITEM_CODE]=this.setDropDownBindOptions(r.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=r.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=r.FUNCTION_TYPE,this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()].push(f)}n[d.ITEM_CODE]=Y.guid()}else console.warn(`ER: The dropdown data source for [${r.FUNCTION_ID}.${d.ITEM_CODE}] is not configured!`);d.ITEM_MUST_FLAG==="1"&&(d.MUST_INPUT_CONDITION.trim().length>0?i.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}):a.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME}))})}this._dropDownRefreshKey[r.FUNCTION_ID]=n,this._dropDownBindSource[r.FUNCTION_ID]=e,this._requiredFields[r.FUNCTION_ID]=a,this._requiredFieldsByCondition[r.FUNCTION_ID]=i}setCustomPartition(r){return this._customPartition=r,this._customPartition}setLayoutCaption(r,e){this.setLayoutOptions(r,"layoutCaption",e)}getLayoutCaption(r){return Y.toString(this.getLayoutOptions(r,"layoutCaption"))}getLayoutBindModel(r){if(this._layoutBindModel[r]===void 0){const e=new Dr;e.uid="",this._layoutBindModel[r]=o.reactive(e)}return this._layoutBindModel[r]}refreshLayoutBindModel(r){const e=this.getBindingTable(r);let n=e==null?void 0:e.Current;n||(n=new Dr,n.uid=""),this._layoutBindModel[r]=o.reactive(n),this._layoutBindModelUid[r]=n.uid}setLayoutBindForm(r,e){this.setLayoutOptions(r,"bindForm",e)}getLayoutBindForm(r){return this.getLayoutOptions(r,"bindForm")}setLayoutOptions(r,e,n){return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(r=r.trim(),e=e.trim(),this._layoutOpitons[r]=this._layoutOpitons[r]||{},this._layoutOpitons[r][e]=n),this}getLayoutOptions(r,e){let n;return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(r=r.trim(),this._layoutOpitons[r]&&(n=this._layoutOpitons[r][e==null?void 0:e.trim()])),(n==null?void 0:n.value)!==void 0?n==null?void 0:n.value:n}setLayoutItemOption(r,e,n){return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&n&&(this._layoutItemOpitons[r]=this._layoutItemOpitons[r]||{},this._layoutItemOpitons[r][e]=this._layoutItemOpitons[r][e]||{},Object.keys(n).forEach(a=>{o.isRef(this._layoutItemOpitons[r][e][a])?this._layoutItemOpitons[r][e][a].value=n[a]:this._layoutItemOpitons[r][e][a]=o.ref(n[a])})),this}getLayoutItemOption(r,e,n){let a;return this._layoutItemOpitons[r]&&this._layoutItemOpitons[r][e]&&(a=this._layoutItemOpitons[r][e][n]),(a==null?void 0:a.value)!==void 0?a==null?void 0:a.value:a}setLayoutItemValidateRules(r,e,n,a=!1){if((r==null?void 0:r.trim().length)>0&&typeof e=="string"&&(e==null?void 0:e.trim().length)>0){const i=this.getLayoutBindForm(r);if(i!=null&&i.rulesRef)if(i.rulesRef[e]=i.rulesRef[e]||[],a&&i.rulesRef[e])if((n==null?void 0:n.length)>0){const l=[];n.forEach((s,c)=>{n[c].itemCode=e;let d=!1;for(let u=0;u<i.rulesRef[e].length;u++)if(i.rulesRef[e][u].customType===s.customType){i.rulesRef[e][u]=s,d=!0;break}d||l.push(s)}),l.length>0&&i.rulesRef[e].push(...l)}else i.rulesRef[e]=[];else i.rulesRef[e].push(...n)}return this}setLayoutItemValidator(r,e,n,a=!1){const i=[];return i.push({message:"",trigger:"change",itemCode:e,validator:(l,s)=>n instanceof Function?n(s)===!0?(l.message="",Promise.resolve()):(l.message=n(s)||"",Promise.reject(new Error("Invalid value"))):(l.message="",Promise.resolve())}),this.setLayoutItemValidateRules(r,e,i,a),this}setLayoutItemCaptionForeColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{i.trim().length>0&&this.setLayoutItemOption(r,i,{LabelForeColor:n})}),this}setLayoutItemCaptionBackColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{i.trim().length>0&&this.setLayoutItemOption(r,i,{LabelBackColor:n})}),this}setLayoutItemContentForeColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","erTreeSelect","erMultiTreeSelect","antInput","antInputNumber","antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(l)&&this.setControlCss(r,i,[{property:"color",value:n}]),this.setLayoutItemOption(r,i,{TextForeColor:n})}}),this}setLayoutItemContentBackColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","antInput","antInputNumber"].includes(l)&&this.setControlCss(r,i,[{property:"background",value:n}]),this.setLayoutItemOption(r,i,{TextBackColor:n})}}),this}setLayoutConditionStyleConfigInfo(r,e,n){return this._layoutConditionStyleInfo[r]=this._layoutConditionStyleInfo[r]||{},this._layoutConditionStyleInfo[r][e]=n,this}setLayoutConditionStyle(r,e){if((r==null?void 0:r.trim().length)>0){const n=this.getLayoutBindModel(r);if(n&&this._layoutConditionStyleInfo[r==null?void 0:r.trim()]){const a=l=>{var c,d,u,f,h,p,C,E;const s=this._layoutConditionStyleInfo[r==null?void 0:r.trim()][l];s&&(Y.checkExpressionValid(n,Y.getSystemFormatString(s.condition))?(((c=s.labelForeColor)==null?void 0:c.trim().length)>0&&this.setLayoutItemCaptionForeColor(r,l,s.labelForeColor),((d=s.labelBackgroundColor)==null?void 0:d.trim().length)>0&&this.setLayoutItemCaptionBackColor(r,l,s.labelBackgroundColor),((u=s.textForeColor)==null?void 0:u.trim().length)>0&&this.setLayoutItemContentForeColor(r,l,s.textForeColor),((f=s.textBackgroundColor)==null?void 0:f.trim().length)>0&&this.setLayoutItemContentBackColor(r,l,s.textBackgroundColor)):(((h=s.labelForeColor)==null?void 0:h.trim().length)>0&&this.setLayoutItemCaptionForeColor(r,l,""),((p=s.labelBackgroundColor)==null?void 0:p.trim().length)>0&&this.setLayoutItemCaptionBackColor(r,l,""),((C=s.textForeColor)==null?void 0:C.trim().length)>0&&this.setLayoutItemContentForeColor(r,l,""),((E=s.textBackgroundColor)==null?void 0:E.trim().length)>0&&this.setLayoutItemContentBackColor(r,l,"")))};let i;e instanceof Array?i=e:e&&(e==null?void 0:e.trim().length)>0?i=e.split(","):i=Object.keys(this._layoutConditionStyleInfo[r]),(i==null?void 0:i.length)>0&&i.forEach(l=>{a(l)})}}return this}bindGridCustomEvent(r,e,n){return this._gridCustomEvent[r]=this._gridCustomEvent[r]||{},this._gridCustomEvent[r][e]=n,this}getGridCustomEvent(r,e){let n;return this._gridCustomEvent[r]&&this._gridCustomEvent[r][e]&&(n=this._gridCustomEvent[r][e]),n}getCompanyName(r){var n,a,i;let e="";return(r==null?void 0:r.trim().length)>0&&((n=this._configInfo.TESCOMPANYINFO)==null?void 0:n.length)>0&&(e=((i=(a=this._configInfo.TESCOMPANYINFO.find(l=>l.COMPANYCODE===r))==null?void 0:a.COMPANYNAME)==null?void 0:i.trim())||""),e}cloneTableForLayoutOrGrid(r,e,n){var a,i,l,s,c,d;if(this.InitializeFlag>0&&r.trim().length>0&&e.trim().length>0&&n.trim().length>0&&!((a=this._formDataSet)!=null&&a.contains(e.trim())))if(n=n.trim(),r=r.trim(),e=e.trim(),(i=this._formDataSet)!=null&&i.contains(r)||(r=this.getBindingTableName(r)),r.length>0&&((l=this._formDataSet)!=null&&l.contains(r))){const u=(s=this._formDataSet)==null?void 0:s.getDataTable(r),f=(c=this._formDataSet)==null?void 0:c.cloneDataTable(u,e);(d=this._formDataSet)==null||d.addDataTable(e,f),this._configInfo.TSI00GRIDVIEW.every(p=>p.FUNCTION_ID===n?(p.TABLE_NAME=e,!1):!0),this._formBindingRelation[n]=e;const h=this.getGrid(n);h&&(u==null||u.removeBindingInfo(this,n),h.gridOptions.context.bindingSource=f,h.gridOptions.context.bindTableName=e,f==null||f.setBindingInfo(this,n,"Grid"))}else this.messageError(`ER: The origin table [${r}] does not exist!`);return this}containsConfig(r){const e=this.getConfigInfo(r);return!!(e&&e.TSI00GRIDCOLUMN&&e.TSI00GRIDCOLUMN.length>0)}isEmptyConfig(r){return!this.containsConfig(r)}getConfigInfo(r,e=!1){let n={},a=pt.CompanyCode;if(this._tempSingleConfigInfo[r])n=this._tempSingleConfigInfo[r];else{let i=[];if(this._configInfo.TSI00GRIDVIEW&&(i=this._configInfo.TSI00GRIDVIEW.filter(l=>l.FUNCTION_ID===r),i.length>0)){n.TSI00GRIDVIEW=i;const l=n.TSI00GRIDVIEW.FUNCTION_TYPE,s=n.TSI00GRIDVIEW.MATCH_FLAG;this._configInfo.TSI00GRIDCOLUMN&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&(c.IS_VISIBLE==="1"||e===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.IS_VISIBLE==="1"||e===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMN=i),this._configInfo.TSI00GRIDCOLUMNAUTH&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&(c.USER_ID===pt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.USER_ID===pt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNAUTH=i,i.length>0&&(this._itemAuthInfo[r]={},i.forEach(c=>{this._itemAuthInfo[r][c.ITEM_CODE]=this._itemAuthInfo[r][c.ITEM_CODE]||{},this._itemAuthInfo[r][c.ITEM_CODE][c.USER_ID]=c.AUTH_CODE}))),this._configInfo.TSI00GRIDCOLUMNURL&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNURL=i),this._configInfo.TSI00GRIDSTYLE&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDSTYLE=i),this._configInfo.TSI00GRIDBAND&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a),this._currentConfigCompanyCode["TSI00GRIDBAND"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDBAND"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDBAND=i),this._configInfo.TSI00GRIDVIEWCUS&&l!=="F"&&(i=this._configInfo.TSI00GRIDVIEWCUS.filter(c=>c.FUNCTION_ID===r),n.TSI00GRIDVIEWCUS=i),this._tempSingleConfigInfo[r]=n}}return n}getSingleViewConfigInfo(r){let e={};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===r)return this._configInfo.TSI00GRIDVIEW[n]}return e}getSingleItemConfigInfo(r,e,n){var i,l;let a={};if(this._gridColumnsConfigInfo[r]===void 0&&(this._gridColumnsConfigInfo[r]={}),this._gridColumnsConfigInfo[r][e])a=this._gridColumnsConfigInfo[r][e];else{(!n||n.trim().length===0)&&(n=pt.CompanyCode),n||(n=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]);const s=this.getConfigInfo(r);(s==null?void 0:s.TSI00GRIDCOLUMN.length)>0&&(s.TSI00GRIDCOLUMN.every((c,d)=>c.COMPANY_CODE===n&&c.FUNCTION_ID===r&&c.ITEM_CODE===e||c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.FUNCTION_ID===r&&c.ITEM_CODE===e?(a=c,!1):!0),Object.keys(a).length>0&&((i=s.TSI00GRIDVIEW)==null?void 0:i.length)>0&&(a.FUNCTION_TYPE=s.TSI00GRIDVIEW[0].FUNCTION_TYPE,((l=a.EXT_OPTIONS)==null?void 0:l.trim().length)>0&&(a.extendOptions=JSON.parse(a.EXT_OPTIONS))),this._gridColumnsConfigInfo[r][e]=a)}return a}getAllItemCodeArray(r){const e=[];r=this.getConfigIdbyLayoutName(r);const n=this.getConfigInfo(r);if(n.TSI00GRIDCOLUMN){const a=n.TSI00GRIDCOLUMN;a.length>0&&a.forEach(i=>{e.push(i.ITEM_CODE)})}return e}getAllConfigIdArray(){const r=[];if(this._configInfo.TSI00GRIDVIEW){const e=this._configInfo.TSI00GRIDVIEW;e.length>0&&e.forEach(n=>{r.push(n.ITEM_CODE)})}return r}getItemDropDownDataSource(r,e){var i;let n=[];const a=this.getSingleItemConfigInfo(r,e);return((i=a==null?void 0:a.SVC_NAME)==null?void 0:i.trim().length)>0&&(this._configInfo[a.FUNCTION_ID+a.ITEM_CODE+pt.CompanyCode]?n=this._configInfo[a.FUNCTION_ID+a.ITEM_CODE+pt.CompanyCode]:this._configInfo[a.FUNCTION_ID+a.ITEM_CODE]?n=this._configInfo[a.FUNCTION_ID+a.ITEM_CODE]:this._configInfo[a.FUNCTION_ID+a.SVC_NAME]?n=this._configInfo[a.FUNCTION_ID+a.SVC_NAME]:this._configInfo["SI->"+a.SVC_NAME]?n=this._configInfo["SI->"+a.SVC_NAME]:this._configInfo["EP->"+a.SVC_NAME]?n=this._configInfo["EP->"+a.SVC_NAME]:this._configInfo["PM->"+a.SVC_NAME]?n=this._configInfo["PM->"+a.SVC_NAME]:this._configInfo[this._formName+a.SVC_NAME]?n=this._configInfo[this._formName+a.SVC_NAME]:this._configInfo[a.SVC_NAME]?n=this._configInfo[a.SVC_NAME]:this.messageError(`Can not find the data source config for [${r}.${e}]!`)),n}setDropDownBindOptions(r,e,n){var P,L,x,S,O;((P=e.EXT_OPTIONS)==null?void 0:P.trim().length)>0&&(e.extendOptions=JSON.parse(e.EXT_OPTIONS));const a=Y.toString(e.DISPLAY_COLS).toUpperCase();let i=Y.toString(e.DISPLAY_CAPTIONS).trim();const l=((x=(L=e.extendOptions)==null?void 0:L.dropdownOptions)==null?void 0:x.displayWidths)||[];let s=!1;const c=Y.toString(e.VALUE_MEMBER).toUpperCase(),d=Y.toString(e.DISPLAY_MEMBER).toUpperCase(),u=Y.toNumber(e.VALUE_POSITION),f=Y.toNumber(e.DISPLAY_POSITION),h=[],p=Y.$t("ERX.CodeColumn")||"代码",C=Y.$t("ERX.DescriptionColumn")||"描述";i.startsWith("$t(")&&i.endsWith(")")&&(i=i.substring(3,i.length-1),s=!0);let E="CODE";c.trim().length>0&&(E=c.trim());let T="CODE_DESC_1_CONTENT";d.trim().length>0&&(T=d.trim()),h.push(E,T);const v={dataValueField:"",dataTextField:"",dataSource:[],filterFields:h,columns:[{field:E,title:p,width:150},{field:T,title:C,width:150}],codeClass:e.SVC_NAME,layoutType:r,columnConfig:e};let M=[];n&&n instanceof Function&&(n=n());const g=n||this.getItemDropDownDataSource(e.FUNCTION_ID,e.ITEM_CODE)||[];if(a.length>0&&i.length>0){const A=a.split(","),w=i.split(",");if(A.length!==w.length)this.messageError("[DisplayColumns] array length need same to [DisplayCaptions] array length!");else{const I=[];for(let k=0;k<A.length;k++){const y={field:A[k],title:w[k].trim(),width:150};Y.toNumber(l[k])>0&&(y.width=Y.toNumber(l[k])),y.title.startsWith("$t(")&&y.title.endsWith(")")?y.title=Y.$t(y.title.substring(3,y.title.length-1)):s&&(y.title=Y.$t(y.title)),I.push(y),h.push(y.field)}c.trim().length>0&&d.trim().length>0?(E=c.trim(),T=d.trim()):(u>=0&&u<A.length?E=A[u]:E=A[0],f>=0&&u<A.length?T=A[f]:A.length>1?T=A[1]:T=A[0]),v.columns=I,v.dataValueField=E,v.dataTextField=T}}else if(g.length>0){const A=Object.keys(g[0]);(g[0][E]===void 0||g[0][T]===void 0)&&(g[0][E]===void 0&&(E=A[0]),g[0][T]===void 0&&(A.length>1?T=A[1]:T=A[0])),v.columns=e.VALUE_VISIBLE==="1"?[{field:E,title:p,width:Y.toNumber(l[0])||150},{field:T,title:C,width:Y.toNumber(l[1])||150}]:[{field:T,title:C,width:Y.toNumber(l[0])||150}],e.VALUE_VISIBLE==="1"&&h.push(E)}else c.trim().length>0&&d.trim().length>0&&(E=c.trim(),T=d.trim(),v.columns=e.VALUE_VISIBLE==="1"?[{field:E,title:p,width:Y.toNumber(l[0])||150},{field:T,title:C,width:Y.toNumber(l[1])||150}]:[{field:T,title:C,width:Y.toNumber(l[0])||150}],e.VALUE_VISIBLE==="1"&&h.push(E));e.ADD_EMPTY_ITEM==="1"&&(v.optionLabel="—-—"),e.FORMAT_TYPE==="Custom"&&((S=e.FORMAT_STRING)==null?void 0:S.trim().length)>0?v.displayFormat=(O=e.FORMAT_STRING)==null?void 0:O.trim():e.DISPLAY_POSITION===e.VALUE_POSITION&&Y.toNumber(e.VALUE_POSITION)>=0||e.DISPLAY_MEMBER===e.VALUE_MEMBER&&e.VALUE_MEMBER.trim().length>0?v.displayFormat="{0}":e.VALUE_VISIBLE==="1"?v.displayFormat="{0}|{1}":v.displayFormat="{1}",g&&g instanceof Array&&(M=g.map(A=>({...A,value:A[E],label:A[T]}))),h.push(T),v.autoWidth=!0,v.dataSource=M,v.dataValueField=E,v.dataTextField=T;let F=0;return v.columns.forEach(A=>{F+=A.width}),v.dropDownWidth=F,v}filterDropDownCascaderDataSource(r,e,n){const a=[];if(Array.isArray(n)&&n.length>0?a.push(...n):Y.toString(n).length>0&&a.push(Y.toString(n)),r&&r.length>0&&e.length>0&&a.length>0)if(e.toLowerCase().startsWith("script:")&&e.length>7){e=Y.getSystemFormatString(e.substring(7)).replaceAll("{0}",`${a.join(",")}`);const i=[];return r.forEach(l=>{Y.checkExpressionValid(l,e)&&i.push(l)}),i}else{const i=e.indexOf(" like ")>=0?"like":e.indexOf("<>")>=0?"<>":"=",l=e.split(i);if(l.length===2){const s=l[0].trim().toUpperCase(),c=l[1].trim().toUpperCase(),d=[];return r.forEach(u=>{const f=Y.toString(u[s]).trim();if(f.length>0){for(let h=0;h<a.length;h++)if(i==="like"){if(c.startsWith("'%")&&c.endsWith("%'")&&f.indexOf(a[h])>=0){d.push(u);break}else if(c.startsWith("'%")&&f.endsWith(a[h])){d.push(u);break}else if(f.startsWith(a[h])){d.push(u);break}}else if(i==="<>"){if(f!==a[h]){d.push(u);break}}else if(f===a[h]){d.push(u);break}}}),d}}return r}setDropDownCascaderDataSource(r,e,n){this._dropDownCascader[r+e]&&this._dropDownCascader[r+e].length>0&&this._dropDownCascader[r+e].forEach(i=>{if(i.FUNCTION_TYPE==="F"){const l=this._dropDownBindSource[i.FUNCTION_ID][i.ITEM_CODE].dataSource,s=i.FORM_FILTER.trim(),c=this.filterDropDownCascaderDataSource(l,s,n);i.dataSource=c,this.reloadDropDownDataSource(i.FUNCTION_ID,i.ITEM_CODE,i.dataSource)}})}getDropDownCascaderDataTable(r,e,n,a){let i;return r.trim().length>0&&e.trim().length>0&&n.trim().length>0&&a.trim().length>0&&this._dropDownCascader[n.trim()+a.trim()]&&this._dropDownCascader[n.trim()+a.trim()].length>0&&this._dropDownCascader[n.trim()+a.trim()].every(l=>l.FUNCTION_ID===r.trim()&&l.ITEM_CODE===e.trim()?(i=l.dataSource,!1):!0),i}getGridStyleConfig(r){return this._gridStyleInfo[r]}setDropDownAutoFillFieldForLayout(r,e,n){var l,s;n&&n instanceof Array&&(n=n.join(","));const a=this.getSingleItemConfigInfo(r,e),i=((l=a==null?void 0:a.extendOptions)==null?void 0:l.autoFillColumns)||((s=a.AUTOFILL_COLS)==null?void 0:s.trim())||"";if(i.trim().length>0){const c=i.split(";").filter(u=>u.trim().length>0),d=this.getDropDownSelectedData(r,e,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 C="";d.forEach(E=>{const T=Y.toString(E[h]).trim();T.length>0&&(C=C.length===0?T:C+","+T)}),this.setControlValue(r,p,C)}else this.setControlValue(r,p,d[h])}})}}setDropDownAutoFillFieldsForGrid(r,e,n){var i,l,s,c,d,u,f,h,p,C,E,T;const a=this.getGrid(r);if(a&&((i=n==null?void 0:n.data)!=null&&i.uid)){const v=(l=a.gridOptions.context)==null?void 0:l.configId,M=(c=(s=a.gridOptions.context)==null?void 0:s.viewConfig)==null?void 0:c.AUTO_SELECT_MODE,g=this.getGridColumn(r,e);if((u=(d=g==null?void 0:g.colDef)==null?void 0:d.context)!=null&&u.columnConfig){const F=(h=(f=g==null?void 0:g.colDef)==null?void 0:f.context)==null?void 0:h.columnConfig,P=((p=F==null?void 0:F.extendOptions)==null?void 0:p.autoFillColumns)||((C=F.AUTOFILL_COLS)==null?void 0:C.trim())||"";let L=[],x={};if(P.trim().length>0&&F.COLUMN_EDIT!=="3"&&(L=P.split(";"),n.data[e]&&(x=this.getDropDownSelectedData(v,e,n.data[e])),L.forEach(S=>{if(S.trim().length>0){const O=S.trim().split("="),A=O[0].toUpperCase().trim();let w=O[0].toUpperCase().trim();if(O.length>1&&(w=O[1].toUpperCase().trim()),x&&x instanceof Array){let I="";x.forEach(k=>{const y=Y.toString(k[A]).trim();y.length>0&&(I=I.length===0?y:I+","+y)}),n.data.set(w,I)}else n.data.set(w,x[A]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[w,pt.GridCheckColumnFieldName]})}})),n.isSelected()&&F.MULTI_ROW_EDIT==="1"&&M!=="1"&&M!=="3"){const S=this.getGridOptions(v,"multiRowEdit");S!==!1&&S!=="0"&&(((T=(E=a.gridOptions.context)==null?void 0:E.options)==null?void 0:T.multiRowEditType)==="all"?a.gridOptions.api.foreachLeafNode(O=>{var A;O!=null&&O.selected&&((A=O.data)!=null&&A.uid)&&O.data.uid!==n.data.uid&&L.forEach(w=>{if(w.trim().length>0){const I=w.trim().split("="),k=I[0].toUpperCase().trim();let y=I[0].toUpperCase().trim();if(I.length>1&&(y=I[1].toUpperCase().trim()),x&&x instanceof Array){let R="";x.forEach(N=>{const U=Y.toString(N[k]).trim();U.length>0&&(R=R.length===0?U:R+","+U)}),O.setDataValue(y,R)}else O.setDataValue(y,x[k]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[y,pt.GridCheckColumnFieldName]})}})}):a.gridOptions.api.forEachNodeAfterFilter(O=>{var A;O!=null&&O.selected&&((A=O.data)!=null&&A.uid)&&O.data.uid!==n.data.uid&&L.forEach(w=>{if(w.trim().length>0){const I=w.trim().split("="),k=I[0].toUpperCase().trim();let y=I[0].toUpperCase().trim();if(I.length>1&&(y=I[1].toUpperCase().trim()),x&&x instanceof Array){let R="";x.forEach(N=>{const U=Y.toString(N[k]).trim();U.length>0&&(R=R.length===0?U:R+","+U)}),O.setDataValue(y,R)}else O.setDataValue(y,x[k]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[y,pt.GridCheckColumnFieldName]})}})}))}}}}addDropDownCode(r,e,n,a="push"){var i,l;if((r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(n==null?void 0:n.length)>0&&this._dropDownBindSource[r.trim()]&&this._dropDownBindSource[r.trim()][e.trim()]){const s=this._dropDownBindSource[r.trim()][e.trim()];if(s.dataSource!==void 0&&s.dataSource instanceof Array){a==="unshift"?s.dataSource.unshift(...n):s.dataSource.push(...n);const c=this.getSingleItemConfigInfo(r,e);if(c.FUNCTION_TYPE==="F")this._dropDownRefreshKey[r][e]=Y.guid(),this.setControlEmptyValue(r,e);else if(c.FUNCTION_TYPE==="G"||c.FUNCTION_TYPE==="P"){const d=this.getGridColumn(r,e);if(d!=null&&d.colDef){this.setGridColumnDropdown(r,d.colDef,s.dataSource,(i=d.colDef.context)==null?void 0:i.valueField,(l=d.colDef.context)==null?void 0:l.textField,s.displayFormat);const u=this.getGridApi(r);u==null||u.refreshCells({columns:[d.colId]})}}}}}async reloadDropDownDataSource(r,e,n){var a,i,l;if((r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0){const s=this.getSingleItemConfigInfo(r,e);if(s){let c=[];if(n&&n instanceof Function&&(n=n()),n instanceof Array)c=n;else if(s.ORIGIN_CODE==="2"&&s.SVC_NAME.trim().length>0){const u=st.buildMap([{FUNCTION_ID:s.SVC_NAME,COMPANY_CODE:pt.CompanyCode}],"DATA_SOURCE"),f=await this.callServiceEx(pt.dynamicQueryService,u);f.sysFlag>=0&&(c=f.getMapData(0))}const d=this.setDropDownBindOptions(s.FUNCTION_TYPE,s,c);if(this._dropDownBindSource[r.trim()]=this._dropDownBindSource[r.trim()]||{},this._dropDownBindSource[r.trim()][e.trim()]=d,s.FUNCTION_TYPE==="F"){const u=this.getControlValue(r,e);u&&!((a=d==null?void 0:d.dataSource)!=null&&a.some(f=>f[d.dataValueField]===u))&&this.setControlEmptyValue(r,e)}else if(s.FUNCTION_TYPE==="G"||s.FUNCTION_TYPE==="P"){const u=this.getGridColumn(r,e);if(u!=null&&u.colDef){this.setGridColumnDropdown(r,u.colDef,c,(i=u.colDef.context)==null?void 0:i.valueField,(l=u.colDef.context)==null?void 0:l.textField,d.displayFormat);const f=this.getGridApi(r);f==null||f.refreshCells({columns:[u.colId]})}}this._dropDownRefreshKey[r][e]=Y.guid()}}}createDataSet(){var n,a,i;const r=[];let e="";this._configInfo.TSI00GRIDVIEW.forEach(l=>{var s,c,d;if(((s=l.TABLE_NAME)==null?void 0:s.trim().length)>0&&((c=l.DATASET_NAME)==null?void 0:c.trim().length)>0){const u={};l.FUNCTION_TYPE==="T"&&((d=l.CURRENT_NODE_DESC)==null?void 0:d.trim().length)>0&&l.FATHER_NODE_DESC.trim().length>0&&(u.hierarchy={primaryField:l.CURRENT_NODE_DESC.trim(),parentField:l.FATHER_NODE_DESC}),this.createDataTable(l.TABLE_NAME.trim(),u)&&r.push({tableName:l.TABLE_NAME.trim()}),e=l.DATASET_NAME.trim()}}),((a=(n=this._configInfo)==null?void 0:n.TSI00DATARELATION)==null?void 0:a.length)>0&&this._configInfo.TSI00DATARELATION.forEach(l=>{r.findIndex(s=>s.tableName===l.RESERVE1)>=0&&r.findIndex(s=>s.tableName===l.RESERVE7)>=0&&(this._formDataSet.relations[l.RELATION_NAME]=this._formDataSet.relations[l.RELATION_NAME]||[],this._formDataSet.relations[l.RELATION_NAME].push({ParentTable:l.RESERVE1,ChildTable:l.RESERVE7,ParentColumn:l.RESERVE2,ChildColumn:l.RESERVE8}))}),(i=this._formDataSet)==null||i.setName(e)}createDataTable(r,e){var i,l,s,c,d,u;let n;const a={...e};if(r.trim().length>0&&!this._formDataSet.dataTables[r.trim()]){const f={};((i=this._configInfo.TSI00DATATABLE)==null?void 0:i.length)>0&&this._configInfo.TSI00DATATABLE.forEach(h=>{if(h.TABLE_NAME===r.trim()){const p={name:h.COL_NAME,caption:h.COL_CAPTION,maxLength:h.MAX_LENGTH,camelCaseName:Y.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=Y.toNumber(h.DEFAULT_VALUE);break;case"3":case"date":case"datetime":p.type="datetime",p.defaultValue=Y.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;case"4":case"bool":case"boolean":p.type="boolean",p.defaultValue=Y.toBoolean(h.DEFAULT_VALUE);break;case"5":case"time":p.type="time",p.defaultValue=Y.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;default:p.type="string",p.defaultValue=Y.getSystemFormatString(h.DEFAULT_VALUE).trim();break}f[h.COL_NAME]=p}}),Object.keys(f).length>0&&(a.schema=f,n=new un(a),this._formDataSet.addDataTable(r.trim(),n))}else n=(l=this._formDataSet)==null?void 0:l.dataTables[r.trim()],a.schema=(s=n==null?void 0:n.options)==null?void 0:s.schema,a.hierarchy=a.hierarchy||((c=n==null?void 0:n.options)==null?void 0:c.hierarchy);return(d=e==null?void 0:e.hierarchy)!=null&&d.primaryField&&((u=e==null?void 0:e.hierarchy)!=null&&u.parentField)&&(a.schema[e.hierarchy.primaryField]===void 0&&console.error(`ER: Hierarchy DataTable's PrimaryField [${e.hierarchy.primaryField}] not exists!`),a.schema[e.hierarchy.parentField]===void 0&&console.error(`ER: Hierarchy DataTable's ParentField [${e.hierarchy.parentField}] not exists!`)),n||console.error(`ER: DataTable [${r}] creation failed!`),n}getTableName(r){var e;return(e=this._formDataSet)==null?void 0:e.getTableName(r)}getBindingTableName(r){var n;let e="";return(r==null?void 0:r.trim().length)>0&&((n=this._formBindingRelation)!=null&&n[r.trim()])&&(e=this._formBindingRelation[r.trim()]),e}setBindingTableName(r){var n;let e="";if((r==null?void 0:r.trim().length)>0){r=r.trim();const a=this.getSingleViewConfigInfo(r);a&&a.TABLE_NAME&&a.TABLE_NAME.trim().length>0&&((n=this._formDataSet)!=null&&n.contains(a.TABLE_NAME.trim()))&&(e=a.TABLE_NAME.trim(),this._formBindingRelation[r]=e)}return e}getBindingTable(r){var a;let e;const n=this.getBindingTableName(r);return n&&n.trim().length>0&&(e=(a=this._formDataSet)==null?void 0:a.dataTables[n]),e}getBindingTableAsDataMap(r){let e;const n=this.getBindingTable(r);return n&&n instanceof un&&(e=n.data(),e&&(e=un.convertDataType(e,n,"weakly"))),st.buildMap(e||{},"Table0")}hasDataChange(...r){let e=!1;return r.length===0?r=Object.keys(this._formBindingRelation):r.length===1&&(r=r[0].split(",")),r.forEach(n=>{const a=this.getBindingTable(n);if(a&&a instanceof un)if(!e)e=a.hasChanges();else return e}),e}cancelGridChange(r){var n,a;const e=this.getGrid(r);if(e){const i=(a=(n=e.gridOptions)==null?void 0:n.context)==null?void 0:a.bindingSource;i&&i instanceof un&&i.cancelChanges()}return this}mergeData(r,e=!0,...n){var a,i,l;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&&(r instanceof st?r.contains(s.trim())?(a=this._formDataSet)==null||a.mergeData(s.trim(),r.getMapData(s.trim()),e):Object.keys(r).length>0&&((i=this._formDataSet)==null||i.mergeData(s.trim(),r.getMapData(),e)):r instanceof Array&&r&&r.length>0&&((l=this._formDataSet)==null||l.mergeData(s.trim(),r,e)),this.autoBestFit(n[0]))}else if(r instanceof st){const s={};n.forEach(c=>{var u;const d=this.getBindingTableName(c);(d==null?void 0:d.trim().length)>0&&r.contains(d.trim())&&(s[d]||((u=this._formDataSet)==null||u.mergeData(d.trim(),r.getMapData(d.trim()),e),s[d]=!0),this.autoBestFit(c))})}}return this}checkFormChanged(...r){return new Promise(e=>{this.hasDataChange(...r)?this.messageConfirm(Y.$t("ERX.ContinueToOperate")||"继续将丢失未保存的更改,是否继续?").then(n=>{e(n)}).catch(()=>{e(!1)}):e(!0)})}addRowToGrid(r,e=!0,n="default",a=!1){var s,c,d,u,f,h;let i;const l=this.getGrid(r);if((s=l==null?void 0:l.gridOptions.context)!=null&&s.bindingSource){l.gridOptions.context.options=l.gridOptions.context.options||{},l.gridOptions.context.options.autoCheckNewRow=a;let p={};n==="default"&&(n=this.getGridOptions(r,"insertAtTop")||"default"),n==="default"&&(n=((u=(d=(c=l==null?void 0:l.gridOptions)==null?void 0:c.context)==null?void 0:d.options)==null?void 0:u.insertAtTop)||"default");const C=this.getGridOptions(r,"autoGuidField");(e===!0||(e==null?void 0:e.setDefaultValue)===!0)&&(p=this.getGridConfigDefaultValues(r)||{}),this._customDefaultValues[r]&&(p={...p,...this._customDefaultValues[r]}),e!=null&&e.data&&(p={...p,...e.data});const E=(f=l.gridOptions.context)==null?void 0:f.bindingSource;if(n===!0||n==="top")i=E.insert(0,p,C);else if(n==="afterCurrent"||n==="beforeCurrent"){const T=this.getGridCurrentRow(r);if(T){let v=E.indexOf(T);v>=0&&v<E.rowCount&&n==="afterCurrent"?v=v+1:v>0&&n==="beforeCurrent"&&(v=v),i=E.insert(v,p,C)}else i=E.add(p,C)}else typeof n=="number"&&n>=0?i=E.insert(n,p,C):i=E.add(p,C);(h=l==null?void 0:l.gridOptions)!=null&&h.treeData&&(i[pt.TreeHierarchyFieldName]=[Y.guid()])}return i}addCopyRowToGrid(r,e="default",n=!1){var l,s,c;const a=this.getGrid(r);let i;if(a){e==="default"&&(e=this.getGridOptions(r,"insertAtTop")||"default"),e==="default"&&(e=((c=(s=(l=a==null?void 0:a.gridOptions)==null?void 0:l.context)==null?void 0:s.options)==null?void 0:c.insertAtTop)||"default"),(a==null?void 0:a.gridOptions.api).stopEditing();const u=this.getGridSelectRows(a);if(u.length===0){const f=this.getGridCurrentRow(a);f&&u.push(f)}if(u.length===0)i=[this.addRowToGrid(r,!0,e,n)];else{if(this._customDefaultValues[r])for(let h=0;h<u.length;h++)u[h]={...u[h],...this._customDefaultValues[r]};const f=this.getGridBindingTable(r);if(f){let h=-1;e==="top"||e===!0?h=0:e==="afterCurrent"||e==="default"?(h=f.indexOf(u[u.length-1]),h<f.rowCount&&(h=h+1)):e==="beforeCurrent"?(h=f.indexOf(u[0]),h>0&&(h=h-1)):typeof e=="number"&&e>=0&&(h=e),i=f.import(u,h,!0,this.getGridOptions(r,"autoGuidField"))}}}return i}importRowsToGrid(r,e,n=!1,a=!0){var s,c;let i;const l=this.getGrid(r);if((s=l==null?void 0:l.gridOptions.context)!=null&&s.bindingSource){l.gridOptions.context.options=l.gridOptions.context.options||{},l.gridOptions.context.options.autoCheckNewRow=n;const d=(c=l.gridOptions.context)==null?void 0:c.bindingSource;d&&(i=d.import(e,void 0,a))}return i}getGridAggregates(r){var n;let e;if(r){const a=this.getGrid(r);if(a){const i=a.gridOptions.api.getModel();e=(n=i==null?void 0:i.rootNode)==null?void 0:n.aggData}}return e}getModelFromGridOrLayout(r,e,n=!1,a){const i=this.getBindingTable(r);return this.getModelFromDataTable(i,e,n,a)}getModelFromDataTable(r,e,n=!1,a){let i;return typeof r=="string"&&r.trim().length>0&&(r=this.getBindingTable(r)),r&&r instanceof un&&(e&&e.trim().length>0?i=r.get(e.trim()):(i=r.at(0),i=o.reactive(i))),i&&(n instanceof Function?i=n(i)||i.toJSON():i=n?i.toJSON():i,a&&Object.keys(a).forEach(l=>{i[l]=a[l]})),i}getGridDataCount(r){let e=0;const n=this.getGridConfigId(r);if(n){const a=this.getBindingTable(n);a&&a instanceof un&&(e=a.totalCount())}return e}getModelFromDataTableById(r,e,n=!1){var i;let a;return typeof r=="string"&&r.trim().length>0&&this._formBindingRelation[r.trim()].trim().length>0&&(r=(i=this._formDataSet)==null?void 0:i.dataTables[this._formBindingRelation[r.trim()]]),r&&r instanceof un&&e&&e.trim().length>0&&(a=r.get(e.trim()),a&&(n instanceof Function?a=n(a)||a.toJSON():a=n?a.toJSON():a)),a}addModelToLayout(r,e,n){let a;if((r==null?void 0:r.trim().length)>0){const i=this.getBindingTable(r.trim());if(i){i instanceof un&&(a=i.add({}));const l=this.getRelationConfigIdsByTableName(i.tableName);e&&this.setModelDefalutValue(a,l),a=this.getLayoutBindModel(r)}else console.error("ER: Attempting to add model to a non-existent dataTable, configId: "+r)}return a}getModelFields(r){var e;return(e=r==null?void 0:r.options)==null?void 0:e.schema}getControlName(r,e,n){let a="antInput";switch(r){case"F1":case"G3":case"T3":a="antInputGroup";break;case"FB":a="antRadioGroup";break;case"FJ":a="erRadioGroup";break;case"F6":case"F7":case"FA":case"FC":case"FP":case"G1":case"G2":case"GP":case"T1":case"T2":case"TP":a="erSelect";break;case"FD":a="erMultiSelect";break;case"F3":case"G4":case"GD":case"T4":case"TD":a="antMultiSelect";break;case"FL":a="erTreeSelect";break;case"FH":a="erMultiTreeSelect";break;case"F2":case"F9":case"FG":a="antInputNumber";break;case"F4":a="antCheckbox";break;case"FK":a="erCheckboxGroup";break;case"FW":a="antSwitch";break;case"FM":a="scriptEditor";break;case"F5":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===2?a="antTimePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===4?e.toLowerCase()==="hh:mm"?a="antTimePicker":a="antYearPicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===6?e.toLowerCase()==="hh:mm:ss"?a="antTimePicker":a="antMonthPicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===8?a="antDatePicker":a="antDateTimePicker";break;case"FR":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===4||e.toLowerCase()==="yyyy"?a="antYearRangePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===6||e.toLowerCase()==="yyyy-mm"||e.toLowerCase()==="yyyy/mm"||e.toLowerCase()==="yyyymm"?a="antMonthRangePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===8||e.toLowerCase()==="yyyy-mm-dd"||e.toLowerCase()==="yyyy/mm/dd"||e.toLowerCase()==="yyyymmdd"?a="antDateRangePicker":a="antDateTimeRangePicker";break;case"F8":case"G8":case"T8":a="antTextarea";break;case"FE":case"G5":case"T5":a="erMemoEditor";break;case"FN":a="antButton";break;case"FZ":case"GZ":case"TZ":a="antInputColor";break;case"FS":a="label";break;case"FT":a="antDivider";break;default:a="antInput";break}return a}resetValidator(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++){if(e[n].trim().length===0)continue;const a=this.getLayoutBindForm(e[n]);a==null||a.clearValidate()}}getLayoutLabelSpan(r,e){return Y.jQuery("#"+this._formId+r+e+"_span")}getLayoutJqueryElement(r,e){let n;return n=Y.jQuery("#"+this._formId+r+e),n===void 0&&(n=Y.jQuery("#"+r)),n}autoBestFit(r){var n,a,i,l,s;const e=this.getGrid(r);if(e&&this.isGridOnScreen(e)){const c=(a=(n=e.gridOptions.columnApi)==null?void 0:n.columnModel)==null?void 0:a.gridColumns;(c==null?void 0:c.length)>0&&((s=(l=(i=e==null?void 0:e.gridOptions)==null?void 0:i.context)==null?void 0:l.viewConfig)==null?void 0:s.BESTFIT)==="1"&&c.forEach(d=>{d.visible&&!d.colDef.suppressSizeToFit&&e.gridOptions.columnApi.autoSizeColumn(d)})}return this}getGrid(r){var n,a;let e;return r&&typeof r=="string"&&this._gridInstanceInfo[r]!==void 0&&(r=this._gridInstanceInfo[r]),(n=r==null?void 0:r.gridOptions)!=null&&n.api&&((a=r==null?void 0:r.gridOptions)!=null&&a.columnApi)&&(e=r),e}getDetailGrid(r,e){const n=this.getGrid(r);if(n&&e){const a=(typeof e=="string"?e:e==null?void 0:e.uid)||"";if(a.trim().length===0)return;const i=n.gridOptions.api.getDetailGridInfo(`detail_${a}`);if(i)return{gridOptions:{...n.gridOptions.detailGridOptions,...i}}}}getGridApi(r){var e,n;return(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.api}isGridOnScreen(r){const e=this.getGrid(r);return e?Y.isGridOnScreen(e):!1}getGridColumnApi(r){var e,n;return(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.columnApi}getGridConfig(r){var e,n,a;return(a=(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.context)==null?void 0:a.viewConfig}getGridColumn(r,e){const n=this.getGrid(r);return cr.getGridColumn(n,e)}getGridColumnDef(r,e){const n=this.getGrid(r);return cr.getGridColumnDef(n,e)}showGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){const i=[];a.forEach(l=>{i.push({colId:l,hide:!1})}),n.gridOptions.columnApi.applyColumnState({state:i})}}return this}hideGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){const i=[];a.forEach(l=>{i.push({colId:l,hide:!0})}),n.gridOptions.columnApi.applyColumnState({state:i})}}return this}showGridCheckColumn(r){return this.showOrHideGridCheckColumn(r,"show")}hideGridCheckColumn(r){return this.showOrHideGridCheckColumn(r,"hide")}showOrHideGridCheckColumn(r,e="default"){var a,i,l,s;const n=this.getGrid(r);if((a=n==null?void 0:n.gridOptions)!=null&&a.api){const c=n.gridOptions.api,d=c.getColumnDef(pt.GridCheckColumnFieldName);d&&(e==="hide"?(d.checkboxSelection=void 0,d.headerCheckboxSelection=void 0):(e==="show"||((i=n.gridOptions.context)==null?void 0:i.viewConfig.SHOW_SELECTION)==="1")&&(d.checkboxSelection=u=>!u.node.footer,this.getGridOptions((s=(l=n.gridOptions)==null?void 0:l.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(r,e,n="none"){var i,l;const a=this.getGrid(r);return a&&(this.setGridOptions((l=(i=a.gridOptions)==null?void 0:i.context)==null?void 0:l.configId,"RowSelection",e,!0),this.setGridColumnOptions(a,s=>{var c,d,u,f,h;s.colId===pt.GridCheckColumnFieldName&&(n==="show"||n==="hide"||e==="multiple")&&(n==="hide"?(s.checkboxSelection=void 0,s.headerCheckboxSelection=void 0):e==="multiple"?(s.checkboxSelection=p=>!p.node.footer,s.headerCheckboxSelection=n==="show"||((c=a.gridOptions.context)==null?void 0:c.viewConfig.SHOW_SELECTION)==="1",s.headerCheckboxSelectionFilteredOnly=((u=(d=a.gridOptions.context)==null?void 0:d.options)==null?void 0:u.headerCheckboxSelectionFilteredOnly)??!0,s.headerCheckboxSelectionFilteredOnly!==!0?s.headerCheckboxSelectionCurrentPageOnly=(h=(f=a.gridOptions.context)==null?void 0:f.options)==null?void 0:h.headerCheckboxSelectionCurrentPageOnly:delete s.headerCheckboxSelectionCurrentPageOnly):e==="single"&&(s.headerCheckboxSelection=void 0))})),this}setGridRowDrag(r,e="default"){var a,i,l,s;const n=this.getGrid(r);if((a=n==null?void 0:n.gridOptions)!=null&&a.api){const d=n.gridOptions.api.getColumnDef(pt.GridCheckColumnFieldName);d&&(e===!1?(d.rowDrag=void 0,(i=n==null?void 0:n.gridOptions)==null||i.columnApi.setColumnWidth(d.colId,55)):(e===!0||(l=n.gridOptions.context)!=null&&l.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=e),n.gridOptions.api.redrawRows()}return this}addGridColumn(r,e,n){const a=this.getGrid(r);if(a){let i;if(e instanceof Array?i=e:i=[e],i.length>0){const l=a.gridOptions.context.bindingSource,s=a.gridOptions.api.getColumnDefs()||[],c=[];i.forEach(u=>{var f,h,p,C;if(((f=u.field)==null?void 0:f.trim().length)>0){u.field=u.field.trim();const E={name:u.field,capiton:u.headerName,defaultValue:u.defaultValue,type:u.dataType||u.type||"string",maxLength:u.maxLength||-1};l.addField(E),u.colId=u.colId||u.field,a.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 v,M,g,F,P;let T="er-grid-header-align-center";return((v=u.headerAlignment)==null?void 0:v.toLowerCase())==="near"||((M=u.headerAlignment)==null?void 0:M.toLowerCase())==="left"?T="er-grid-header-align-left":(((g=u.headerAlignment)==null?void 0:g.toLowerCase())==="far"||((F=u.headerAlignment)==null?void 0:F.toLowerCase())==="right")&&(T="er-grid-header-align-right"),u.required&&((P=u.requiredCondition)==null?void 0:P.trim().length)>0?T=T+" er-grid-header-maroon-star":u.required&&(T=T+" er-grid-header-red-star"),T},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=T=>{var v,M;return((v=T.context)==null?void 0:v.editable)&&((M=T.colDef.context)==null?void 0:M.editable)&&!T.node.rowPinned}),u.filter=u.filter===void 0?"agSetColumnFilter":u.filter,u.filterParams={excelMode:(C=(p=(h=a.gridOptions)==null?void 0:h.context)==null?void 0:p.options)==null?void 0:C.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),a.gridOptions.api.setColumnDefs(s)}}return this}removeGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){let i=n.gridOptions.api.getColumnDefs()||[];i=i.filter(l=>!a.includes(l.colId)),n.gridOptions.api.setColumnDefs(i)}}return this}getGridColumnFields(r,e="string"){var i,l,s;const n=this.getGrid(r);let a=e==="Array"?[]:void 0;if((l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.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"&&(e==="Array"?a.push(d.FIELD_NAME.trim()):a=a?a+","+d.FIELD_NAME.trim():d.FIELD_NAME.trim())})}return a}setGridEnable(r,e){var a,i,l;const n=this.getGrid(r);return(a=n==null?void 0:n.gridOptions)!=null&&a.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.enable=e,(l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.configId&&(this.setGridOptions(n.gridOptions.context.configId,"enable",e,!0),document.querySelectorAll(".ag-full-width-row").forEach(c=>{c.style!==void 0&&(e?c.style.pointerEvents="all":c.style.pointerEvents="none")}))),this}setGridEditable(r,e){var a,i,l;const n=this.getGrid(r);return(a=n==null?void 0:n.gridOptions)!=null&&a.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.editable=e,(l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.configId&&this.setGridOptions(n.gridOptions.context.configId,"editable",e,!0)),this}setGridIndicator(r,e,n){if(r&&e&&Object.keys(e).length>0){const a=this.getGrid(r);setTimeout(()=>{var i,l,s,c,d,u,f;if((i=a==null?void 0:a.gridOptions)!=null&&i.api&&((s=(l=a==null?void 0:a.gridOptions)==null?void 0:l.context)!=null&&s.bindingSource)){const h=(c=a==null?void 0:a.gridOptions)==null?void 0:c.api,C=((u=(d=a==null?void 0:a.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource).data().find(E=>{for(const T in e)if(E[T]!==e[T])return!1;return!0});if(C!=null&&C.uid){h.clearFocusedCell();const E=(f=a==null?void 0:a.gridOptions)==null?void 0:f.api.getRowNode(C==null?void 0:C.uid);E&&this.setGridFocusedCell(r,E.rowIndex,pt.GridCheckColumnFieldName,n)}}},250)}return this}setDragAndDropBetweenGrids(r,e,n,a){const i=this.getGrid(r),l=this.getGrid(e);if(!i)return Y.error("fromGrid is not found",r),this;if(!l)return Y.error("toGrid is not found",e),this;const s=i.gridOptions.api,c=l.gridOptions.api,d=c.getRowDropZoneParams({onDragStop:u=>{var f,h,p,C;if((a==null?void 0:a.preventDefault)!==!0&&((f=i.gridOptions.context)!=null&&f.configId)&&u.nodes.length>0){const E=u.nodes.map(T=>T.data);if(this.deleteGridRows(i.gridOptions.context.configId,!1,E),u.removedRows=E,(h=u.context)!=null&&h.configId){const T=(p=u.context)==null?void 0:p.bindingSource;u.nodes.forEach(v=>{T.isRemoved(v.data.uid)?this.setGridRowState(l,v.data,"unchanged"):this.setGridRowState(l,v.data,"added")})}}u.formGridContext=i.gridOptions.context,(C=a==null?void 0:a.onDragStop)==null||C.call(a,u)}});if(n){s.addRowDropZone(d);const u=s.getRowDropZoneParams({onDragStop:f=>{var h,p,C,E;if((a==null?void 0:a.preventDefault)!==!0&&((h=l.gridOptions.context)!=null&&h.configId)&&f.nodes.length>0){const T=f.nodes.map(v=>v.data);if(this.deleteGridRows(l.gridOptions.context.configId,!1,T),f.removedRows=T,(p=f.context)!=null&&p.configId){const v=(C=f.context)==null?void 0:C.bindingSource;f.nodes.forEach(M=>{v.isRemoved(M.data.uid)?this.setGridRowState(i,M.data,"unchanged"):this.setGridRowState(i,M.data,"added")})}}f.formGridContext=l.gridOptions.context,(E=a==null?void 0:a.onDragStop)==null||E.call(a,f)}});c.addRowDropZone(u)}return this}refreshGridFooterData(r){var n,a,i;const e=this.getGrid(r);if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const l=(a=e==null?void 0:e.gridOptions)==null?void 0:a.api;if(l.getPinnedBottomRowCount()>0){l.refreshClientSideRowModel("aggregate");const s=l.getModel();l.setPinnedBottomRowData([{...(i=s==null?void 0:s.rootNode)==null?void 0:i.aggData,pinndeRowType:"ErGridSummaryFooter"}])}}return this}setLayoutConfigRelationInfo(r,e){return this._layoutConfigRelationInfo[e]=r,this}getConfigIdbyLayoutName(r){return this._layoutConfigRelationInfo[r]&&this._layoutConfigRelationInfo[r].trim().length>0?this._layoutConfigRelationInfo[r].trim():r}getGridConfigId(r){let e="";return r&&(typeof r=="string"&&this._gridInstanceInfo[r]!==void 0?e=r:r.gridOptions&&r.gridOptions.api&&(e=r.gridOptions.gridId)),e}setWidgetInstanceInfo(r,e,n){return this.isNullOrEmpty(r)||(this._widgetInstanceInfo[r.trim()]===void 0&&(this._widgetInstanceInfo[r.trim()]={}),!this.isNullOrEmpty(e)&&n&&(this._widgetInstanceInfo[r.trim()][e.trim()]=n)),this}setControlVisible(r,e,n,a="none"){return!this.isNullOrEmpty(r)&&(n==null?void 0:n.trim().length)>0&&(r=this.getConfigIdbyLayoutName(r),n.split(",").forEach(l=>{l.trim().length>0&&(a==="empty"?this.setControlEmptyValue(r,l):a==="default"&&this.setControlDefalutValue(r,l),this.setLayoutItemOption(r,l.trim(),{visible:e}))})),this}setGridColumnTitle(r,e){if((e==null?void 0:e.length)>0){const n=this.getGrid(r);n&&(e.forEach(a=>{var l;const i=n.gridOptions.columnApi.getColumn(a.colId);if(i!=null&&i.colDef){const s=((l=i.colDef.context)==null?void 0:l.titleInfo)||{};i.colDef.headerComponentParams={template:`${this.getGridHeaderTemplate({...s,...a})}`}}}),n.gridOptions.api.refreshHeader())}return this}setGridColumnOptions(r,e){if(r&&e instanceof Function){const n=this.getGrid(r);if(n){const a=l=>{var s;((s=l==null?void 0:l.children)==null?void 0:s.length)>0&&l.children.forEach(c=>{a(c)}),e(l)},i=n.gridOptions.api.getColumnDefs();i.forEach(l=>{a(l)}),n.gridOptions.api.setColumnDefs(i)}}return this}setGridOptions(r,e,n,a=!1){return r=(r==null?void 0:r.trim())||"",e=(e==null?void 0:e.trim())||"",r.length>0&&e.length>0&&(a?(this._gridReactiveOptions[r]=this._gridReactiveOptions[r]||{},this._gridReactiveOptions[r][e]=n):(this._gridOptions[r]=this._gridOptions[r]||{},this._gridOptions[r][e]=n)),this}getGridOptions(r,e,n=!1){if(r=(r==null?void 0:r.trim())||"",e=(e==null?void 0:e.trim())||"",r.length>0&&e.length>0){if(n&&this._gridReactiveOptions[r])return this._gridReactiveOptions[r][e];if(!n&&this._gridOptions[r])return this._gridOptions[r][e]}}getLayoutExtentedOptions(r){var i,l;let e={};const n=this.getFormSysInfo("LayoutDefaultOptions");n.trim().length>0&&(e={...JSON.parse(n)});const a=this.getConfigInfo(r);if(((i=a==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0){const s=a.TSI00GRIDVIEW[0];if(((l=s.EXT_OPTIONS)==null?void 0:l.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);e={...e,...c}}}return e}getGridExtentedOptions(r){var i,l;let e={};const n=this.getFormSysInfo("GridDefaultOptions");n.trim().length>0&&(e={...JSON.parse(n)});const a=this.getConfigInfo(r);if(((i=a==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0){const s=a.TSI00GRIDVIEW[0];if(((l=s.EXT_OPTIONS)==null?void 0:l.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);e={...e,...c}}}return e}getDetailGridRenderOptions(r,e,n,a){const i=this.getGridConfigOptions(r,e,n,a),l={context:i==null?void 0:i.context,defaultColDef:i==null?void 0:i.defaultColDef,groupDisplayType:i==null?void 0:i.groupDisplayType,columnDefs:i==null?void 0:i.columnDefs,groupIncludeTotalFooter:i==null?void 0:i.groupIncludeTotalFooter,groupIncludeFooter:i==null?void 0:i.groupIncludeFooter,suppressRowClickSelection:i==null?void 0:i.suppressRowClickSelection,rowSelection:i==null?void 0:i.rowSelection,groupRowRendererParams:i==null?void 0:i.groupRowRendererParams,localeText:Na(),enableRangeSelection:!0,stopEditingWhenCellsLoseFocus:!0,suppressRowTransform:!0,enableRtl:mn(),statusBar:{statusPanels:[{statusPanel:o.markRaw(r2),statusPanelParams:{configId:r,options:e},key:"AggregationPanel",align:"center"},{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]},onCellValueChanged:s=>{var c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof Dr){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]=Y.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]=Y.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const k=s.colDef.context.displayFormat||"",y=Y.toString(s.newValue,!0);if(y.length>0){if(k.trim().startsWith("{0}|")&&y.includes("|")){const R=y.split("|")[0];(p=s.colDef.refData)!=null&&p[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().startsWith("{0}-")&&y.includes("-")){const R=y.split("-")[0];(C=s.colDef.refData)!=null&&C[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}|")&&y.includes("|")){const R=y.split("|"),N=R[R.length-1];(E=s.colDef.refData)!=null&&E[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}-")&&y.includes("-")){const R=y.split("-"),N=R[R.length-1];(T=s.colDef.refData)!=null&&T[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.length>0){const R=Object.keys(s.colDef.refData);let N="";for(let U=0;U<R.length;U++)if(((v=s.colDef.refData)==null?void 0:v[R[U]])===y){N=R[U];break}s.data[s.colDef.field]=N}}}}s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0,this.setDropDownAutoFillFieldsForGrid({gridOptions:{...s}},s.colDef.colId,s.node),this.DropDownCascader[r+s.colDef.colId]&&this.DropDownCascader[r+s.colDef.colId].forEach(k=>{var y,R,N;if(k.FUNCTION_TYPE&&k.FUNCTION_ID&&k.ITEM_CODE){let U="";const V=s.data[s.colDef.field],b=this.getSingleItemConfigInfo(k.FUNCTION_ID,k.ITEM_CODE),W=this.getItemDropDownDataSource(k.FUNCTION_ID,k.ITEM_CODE);if(s.data[s.colDef.field]){const q=this.filterDropDownCascaderDataSource(W,k.FORM_FILTER,s.data[s.colDef.field]);if((q==null?void 0:q.length)>0){const z=(y=this.DropDownBindSource[k.FUNCTION_ID])==null?void 0:y[k.ITEM_CODE];z.dataValueField&&(V&&q.some(ee=>ee[z.dataValueField]===V)?U=V:(((R=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:R.trim().toLowerCase())==="$first_row$"||((N=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:N.trim().toLowerCase())==="{first_row}")&&(U=q[0][z.dataValueField]))}}k.FUNCTION_TYPE==="F"?this.setControlValue(k.FUNCTION_ID,k.ITEM_CODE,U):k.FUNCTION_ID===r&&(s.data[k.ITEM_CODE]=U)}});let I=(g=(M=s.context)==null?void 0:M.viewConfig)==null?void 0:g.AUTO_SELECT_MODE;if(I==="2"||I==="3")this.checkGridRow(r,s.data.uid);else if(((L=(P=(F=s.colDef)==null?void 0:F.context)==null?void 0:P.columnConfig)==null?void 0:L.MULTI_ROW_EDIT)==="1"&&((x=s.node)!=null&&x.selected)){const k=this.getGridOptions(r,"multiRowEdit");if(k!==!1&&k!=="0"){let y=!1;(e==null?void 0:e.multiRowEditType)==="all"?s.api.forEachLeafNode(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}):s.api.forEachNodeAfterFilter(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}),y&&s.api.refreshCells({columns:[pt.GridCheckColumnFieldName]})}}if(((S=s.context)==null?void 0:S.viewConfig.SHOW_FOOTER)==="1"&&((O=s.context.viewType)==null?void 0:O.toLowerCase())!=="cardview"&&((A=s.context.viewType)==null?void 0:A.toLowerCase())!=="card"){const k=s.api.getModel();s.api.setPinnedBottomRowData([{...(w=k==null?void 0:k.rootNode)==null?void 0:w.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[pt.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,C,E,T,v,M;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(g=>{var F,P,L;return((L=(P=(F=g.colDef)==null?void 0:F.context)==null?void 0:P.columnConfig)==null?void 0:L.ALLOW_PRINT)!=="0"}).map(g=>{var F;return(F=g.colDef)==null?void 0:F.colId});cr.exportGridToExcel(s.api,s.columnApi,{fileName:`${u}-${f}-${Y.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,isBandView:((C=(p=i.context)==null?void 0:p.viewType)==null?void 0:C.toLowerCase())==="bandview"||((T=(E=i.context)==null?void 0:E.viewType)==null?void 0:T.toLowerCase())==="band",isShowFooter:((M=(v=i.context)==null?void 0:v.viewConfig)==null?void 0:M.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 l.context.isDetailGrid=!0,l}getGridEditable(r){var n,a;const e=this.getGrid(r);return((a=(n=e==null?void 0:e.gridOptions)==null?void 0:n.context)==null?void 0:a.editable)===!0}getControl(r,e,n){let a;if(this._widgetInstanceInfo[r.trim()]&&this._widgetInstanceInfo[r.trim()][e.trim()]&&(a=this._widgetInstanceInfo[r.trim()][e.trim()]),a==null)if(n&&n.trim().length>0)a=Y.jQuery("#"+this._formId+r+e);else{const i=this.getSingleItemConfigInfo(r,e);if(i.FUNCTION_TYPE&&i.COLUMN_EDIT){const l=i.FUNCTION_TYPE+i.COLUMN_EDIT;n=this.getControlName(l,i.FORMAT_STRING),a=Y.jQuery("#"+this._formId+r+e)}}return a}isControlEmptyValue(r,e,n){let a=!0;const i=this.getControlValue(r,e),l=Object.keys(i);for(let s=0;s<l.length;s++)if(i[l[s]]!==null&&String(i[l[s]]).trim().length>0){a=!1;break}return a}setControlConditionProps(r,e,n="ReadOnly",a,i){if(n=(n==null?void 0:n.trim())||"ReadOnly",(r==null?void 0:r.trim().length)>0){const l=r.trim()+"_"+n+"_"+(e==null?void 0:e.trim());let s=[];if(this._controlConditionProps[l])s=this._controlConditionProps[l];else if(this._configInfo.TSI00GRIDCONDITION&&this._configInfo.TSI00GRIDCONDITION.length>0){const c=this.getSingleViewConfigInfo(r==null?void 0:r.trim());if(c)for(let d=0;d<this._configInfo.TSI00GRIDCONDITION.length;d++){const u=this._configInfo.TSI00GRIDCONDITION[d];if(Y.toString(u.FUNCTION_ID,!0)!==r||(e==null?void 0:e.trim().length)>0&&Y.toString(u.OPERATE_NAME,!0)!==(e==null?void 0:e.trim())||c.MATCH_FLAG==="1"&&Y.toString(u.COMPANY_CODE,!0)!==pt.CompanyCode||Y.toString(u.FIELD_NAME_ARRAY,!0).length===0)continue;const f=Y.toString(u.FIELD_NAME_ARRAY,!0).split(",");u.FIELD_NAME_ARRAY=f,s.push(u)}}if(s.length>0){this._controlConditionProps[l]=s;const c=this.getAllControlValue(r);s.forEach(d=>{const u=d.FIELD_NAME_ARRAY;let f=a??d.PROP_VALUE??"default";u.forEach(h=>{if(h&&!(i!=null&&i.includes(h))){const p=Y.toString(d.REGULAR_EXPRESS,!0),C=p.length===0||p.replaceAll(" ","")==="1=1"||Y.checkExpressionValid(c,Y.getSystemFormatString(p));f=f==!0||f==="1"||Y.toString(f).toLowerCase()==="true",n==="ReadOnly"&&this.setControlReadOnly(r,C?f:"default",h)}})})}}return this}getControlValue(r,e){let n,a;if(r.trim().length>0&&e.trim().length>0){const i=e.split(",").filter(s=>s.trim().length>0);i.length>1&&(a={});const l=this.getLayoutBindModel(r);if(l)for(let s=0;s<i.length;s++){const c=i[s].trim();n=null;const d=this.getLayoutItemOption(r,c,"controlType"),u=this.getLayoutItemOption(r,c,"field");if((u==null?void 0:u.trim().length)>0?n=l[u.trim()]:this._hiddenFields[r.trim()]?n=this._hiddenFields[r.trim()][c]||"":n=l[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(r,c,"rangePickerStartKey"),h=this.getLayoutItemOption(r,c,"rangePickerEndKey");n=[l[f]||null,l[h]||null]}i.length>1?a[c]=n:a=n}}return a}getControlText(r,e){let n,a;if(r.trim().length>0&&e.trim().length>0){const i=e.split(",");i.length>1&&(a={});const l=this.getLayoutBindModel(r);if(l)for(let s=0;s<i.length;s++){const c=i[s].trim();if(n=null,c.length===0)continue;const d=this.getLayoutItemOption(r,c,"field"),u=this.getLayoutItemOption(r,c,"controlType");let f=this.getLayoutItemOption(r,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=l[d.trim()]:this._hiddenFields[r.trim()]?n=this._hiddenFields[r.trim()][c]||"":n=l[c],n==null)a="";else{if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect"].includes(u))n=this.getDropDownSelectedText(r,c,n);else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u))n=Y.toDateTime(n,"Dayjs").format(f);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const h=this.getLayoutItemOption(r,c,"rangePickerStartKey"),p=this.getLayoutItemOption(r,c,"rangePickerEndKey"),C=l[h]||null,E=l[p]||null;n=Y.toDateTime(C,"Dayjs").format(f)+"&"+Y.toDateTime(E,"Dayjs").format(f)}else u==="antInputNumber"&&(n=Y.formatNumberValue(n,f));i.length>1?a[c]=n:a=n}}}return a}setControlValue(r,e,n){if(Y.isNullOrEmpty(r)||Y.isNullOrEmpty(e))return this;const a=this.getLayoutBindModel(r==null?void 0:r.trim()),i=this.getLayoutBindForm(r==null?void 0:r.trim()),l=this.getLayoutItemOption(r,e,"controlType"),s=this.getLayoutItemOption(r,e,"field")||(e==null?void 0:e.trim());if(a&&s){if(Y.toString(n).trim()===Y.toString(a[s]).trim())return this;let c=!0;if(n===void 0&&(n=null,c=!1),["antMultiSelect","erMultiSelect"].includes(l))n?n instanceof Array?a==null||a.set(s,n,r):typeof n=="string"?a==null||a.set(s,n.split(","),r):a==null||a.set(s,[],r):a==null||a.set(s,[],r);else if(n!==null&&(l!=null&&l.startsWith("antCheckbox")||l!=null&&l.startsWith("antSwitch")))a==null||a.set(s,Y.toString(n)==="1"||Y.toString(n).toLowerCase()==="true",r);else if(n!==null&&["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(l))a==null||a.set(s,Y.toDateTime(n,"Dayjs"),r);else if(n instanceof Array&&n.length===2&&["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(l)){const d=this.getLayoutItemOption(r,e,"rangePickerStartKey"),u=this.getLayoutItemOption(r,e,"rangePickerEndKey");n[0]!==void 0&&(a==null||a.set(d,Y.toDateTime(n[0],"Dayjs"),r)),n[1]!==void 0&&(a==null||a.set(u,Y.toDateTime(n[1],"Dayjs"),r))}else a==null||a.set(s,n,r);c&&setTimeout(()=>{i==null||i.validate(s)})}if(this._layoutConditionStyleInfo[r]){const c=this._layoutConditionStyleInfo[r];Object.keys(c).forEach(d=>{var u,f;(d===e||((f=(u=c[d])==null?void 0:u.condition)==null?void 0:f.indexOf(e))>-1)&&this.setLayoutConditionStyle(r,d)})}return this}setControlValueEx(r,e,...n){const a=Object.keys(e);return(a==null?void 0:a.length)>0&&(n.length===1&&(n=n[0].split(",")),n.length>0?n.forEach(i=>{(e==null?void 0:e[i])!==void 0&&this.setControlValue(r,i,e[i])}):a.forEach(i=>{(e==null?void 0:e[i])!==void 0&&this.setControlValue(r,i,e[i])})),this}setControlCss(r,e,n){if((r==null?void 0:r.trim().length)>0&&(n==null?void 0:n.length)>0){let a;e instanceof Array?a=e:a=e.split(","),a&&a.length>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");let s=document.getElementsByName(this.FormId+r+i);if((s==null?void 0:s.length)>0){let c;switch(l){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+r+i);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&&Y.jQuery(c).css(d.property,d.value):d.value!==void 0&&Y.jQuery(s).css(d.property,d.value)})}else s=document.getElementById(this.FormId+r+i),s&&n.forEach(c=>{c.value!==void 0&&Y.jQuery(s).css(c.property,c.value)})}})}return this}setModelDefalutValue(r,e,n,a){let i;e instanceof Array?i=e:i=e.split(",");const l=(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]:a&&(u=a),u&&u.trim().length>0&&r.schemaFields[c].type){if(r.schemaFields[c].type==="datetime")r.set(c,Y.getDateTimeByString(u),s);else if(r.schemaFields[c].type==="boolean")r.set(c,u==="1"||u.toLowerCase()==="true",s);else if(r.schemaFields[c].type==="number")r.set(c,u,s);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(u)){const C=(h=(f=this._dropDownBindSource)==null?void 0:f[s])==null?void 0:h[c];((p=C==null?void 0:C.dataSource)==null?void 0:p.length)>0&&(C!=null&&C.dataValueField)?u==="$FIRST_ROW$"?u=C.dataSource[0][C.dataValueField]:u==="$LAST_ROW$"?u=C.dataSource[C.dataSource.length-1][C.dataValueField]:u==="$ALL_VALUES$"&&(u="",C.dataSource.forEach(E=>{u=u.length===0?E[C.dataValueField]:u+","+E[C.dataValueField]})):u="",r.set(c,u,s)}else r.set(c,this.getDefaultStringValue(u),s);this.setControlValue(s,c,r[c])}};return n&&n.trim().length>0?i.forEach(s=>{s=this.getConfigIdbyLayoutName(s),r&&n&&r.schemaFields&&r.schemaFields[n]&&l(s,n)}):i.forEach(s=>{s=this.getConfigIdbyLayoutName(s);const c=this.getConfigInfo(s);c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{n=d.ITEM_CODE,r&&n&&r.schemaFields&&r.schemaFields[n]&&l(s,n)})}),this}setModelValue(r,e,...n){return Dr.setModelValue(r,e,...n),this}setModelEmptyValue(r,...e){return e.length===1&&(e=e[0].split(",")),e.length>0?e.forEach(n=>{r&&r[n]!==void 0&&r.set(n,null)}):r.schemaFields&&Object.keys(r.schemaFields).forEach(n=>{r.set(n,null)}),this}setControlReadOnlyEx(r,e){return e&&Object.keys(e).forEach(n=>{this.setControlReadOnly(r,e[n],n)}),this}setControlReadOnly(r,e,...n){if(Y.isNullOrEmpty(r))return this;n.length===1&&(n=n[0].split(",")),r=this.getConfigIdbyLayoutName(r);for(const a of n){const i=this.getSingleItemConfigInfo(r,a);let l=!0,s=!1;i.FUNCTION_TYPE&&i.COLUMN_EDIT&&(e!=="default"&&!e&&i.READ_ONLY==="1"&&(i.COLUMN_EDIT!=="1"||i.ALLOW_EDIT!=="1")||(e==="default"?(s=i.READ_ONLY==="1"||i.FUNCTION_TYPE!=="F"&&i.ALLOW_EDIT!=="1",l=i.ALLOW_EDIT==="1"):(s=e,l=!s),this.setLayoutItemOption(r,a,{readOnly:s}),i.COLUMN_EDIT==="1"&&this.setLayoutItemOption(r,a,{buttonEnable:l})))}return this}setAllControlReadOnly(r,e){let n;return r instanceof Array?n=r:n=r.split(","),n&&n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{this.setControlReadOnly(a.trim(),e,l.ITEM_CODE)})}}),this}setControlEnable(r,e,...n){if(Y.isNullOrEmpty(r))return this;n.length===1&&(n=n[0].split(",")),r=this.getConfigIdbyLayoutName(r);for(const a of n){const i=this.getSingleItemConfigInfo(r,a);let l=!0;i.FUNCTION_TYPE&&i.COLUMN_EDIT&&(e==="default"?l=i.ALLOW_EDIT==="1":l=e,this.setLayoutItemOption(r,a,{allowEdit:l}),i.COLUMN_EDIT==="1"&&this.setLayoutItemOption(r,a,{buttonEnable:l}))}return this}setAllControlEnable(r,e){let n;return r instanceof Array?n=r:n=r.split(","),n&&n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{this.setControlEnable(a.trim(),e,l.ITEM_CODE)})}}),this}setControlEmptyValue(r,...e){if(e.length===1&&(e=e[0].split(",")),!e||e.length===0){const n=this.getConfigInfo(r);n.TSI00GRIDVIEW&&n.TSI00GRIDVIEW.length>0&&n.TSI00GRIDVIEW[0].FUNCTION_TYPE==="F"&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(a=>{this.setControlValue(r,a.ITEM_CODE,void 0)})}else e.forEach(n=>{this.setControlValue(r,n,void 0)});return this}setAllControlDefalutValue(r,e=!1){let n;return r instanceof Array?n=r:n=r.split(","),n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{var s;((s=l.DEFAULT_VALUE)==null?void 0:s.trim().length)>0?this.setControlDefalutValue(a.trim(),l.ITEM_CODE,e):e||this.setControlEmptyValue(a,l.ITEM_CODE)})}}),this}setControlDefalutValue(r,e,n=!1){var a,i,l,s;if(Y.isNullOrEmpty(r)||Y.isNullOrEmpty(e))return this;if(r=this.getConfigIdbyLayoutName(r),(r==null?void 0:r.trim().length)>0){const c=this.getLayoutBindModel(r),d=this.getSingleItemConfigInfo(r,e),u=((a=this.getLayoutItemOption(r.trim(),e,"field"))==null?void 0:a.value)||e.trim(),f=c==null?void 0:c.get(u==null?void 0:u.trim());if(f!=null&&n)return this;const h=Y.toString(d.DEFAULT_VALUE,!0);if(c&&h.length>0){let p=this.getDefaultStringValue(h),C=null;const E=this.getLayoutItemOption(r.trim(),e,"controlType");if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect","antRadioGroup","erRadioGroup","erCheckboxGroup"].includes(E)&&["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(h)){const T=(l=(i=this._dropDownBindSource)==null?void 0:i[r])==null?void 0:l[e];((s=T==null?void 0:T.dataSource)==null?void 0:s.length)>0&&(T!=null&&T.dataValueField)?h==="$FIRST_ROW$"?p=T.dataSource[0][T.dataValueField]:h==="$LAST_ROW$"?p=T.dataSource[T.dataSource.length-1][T.dataValueField]:["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(E)&&h==="$ALL_VALUES$"&&(p="",T.dataSource.forEach(v=>{p=p.length===0?v[T.dataValueField]:p+","+v[T.dataValueField]})):p=""}if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(E))C=Y.getDateTimeByString(p);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(E)){const T=p.split(/[|&]/);C=[Y.getDateTimeByString(T[0]),Y.getDateTimeByString(T[1])]}else E==="antInputNumber"?C=Y.toNumber(p):["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(E)?C=p.split(","):E==="antCheckbox"||E==="antSwitch"?C=p==="1"||p.toLowerCase()==="true":C=p;this.setControlValue(r,e,C)}}return this}getFormButtonConfigInfo(r){let e={},n=[];return this._configInfo.TSI00FORMBUTTON&&this._configInfo.TSI00FORMBUTTON.length>0&&(n=this._configInfo.TSI00FORMBUTTON,n.length>0&&n.every((a,i)=>a.BUTTON_NAME===r?(e=a,!1):!0)),e}getSystemGlobalOptions(){let r={};const e=this.getFormSysInfo("SystemGlobalOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getLayoutGlobalOptions(){let r={};const e=this.getFormSysInfo("LayoutDefaultOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getGridGlobalOptions(){let r={};const e=this.getFormSysInfo("GridDefaultOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getFormExtentedOptions(){var n,a;let r={};const e=this.getFormSysInfo("FormDefaultOptions");if(e.trim().length>0&&(r={...JSON.parse(e)}),((n=this._configInfo.TSI00FORM)==null?void 0:n.length)>0){const i=this._configInfo.TSI00FORM[0];if(((a=i.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const l=JSON.parse(i.EXT_OPTIONS);r={...r,...l}}}return r}resetLayout(r){let e;return r instanceof Array?e=r:e=r.split(","),e.length>0&&e.forEach(n=>{if(n.trim().length>0){const a=this.getConfigInfo(n.trim());a.TSI00GRIDVIEW&&a.TSI00GRIDCOLUMN&&a.TSI00GRIDCOLUMN.forEach(i=>{i.DEFAULT_VALUE&&i.DEFAULT_VALUE.trim().length>0?this.setControlDefalutValue(n.trim(),i.ITEM_CODE):this.setControlValue(n.trim(),i.ITEM_CODE,void 0)}),o.nextTick(()=>{this.resetValidator(n.trim())})}}),this}getAllControlValue(r,e,n=!1){const a={};return(r instanceof Array?r:r.split(",")).forEach(l=>{if((l==null?void 0:l.trim().length)>0){const s=this.getLayoutBindModel(l.trim());if(s){const c=this.getConfigInfo(l.trim());c.TSI00GRIDVIEW&&c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{var p,C,E,T;const u=this.getLayoutItemOption(l,d.ITEM_CODE,"controlType"),f=this.getLayoutItemOption(l,d.ITEM_CODE,"field")||d.ITEM_CODE,h=Y.toNumber(d.MAX_LENGTH);if(f&&(d.IS_VISIBLE==="1"||n===!1)){let v=s[f];if(u==="antCheckbox"||u==="antSwitch")v=v===!0?"1":"0",a[f]=v;else if(u==="antInputNumber")v=v||0,a[f]=v;else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u)&&v){const M=Y.toString(d.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss",g=Y.getDateTimeFormatString(v,M);g.substring(0,4)==="0001"||g.substring(0,4)==="1900"||g.substring(0,4)==="1901"?v="":(v=g,h>0&&h<v.length&&(v=v.substring(0,h))),a[f]=v}else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const M=this.getLayoutItemOption(l,d.ITEM_CODE,"rangePickerStartKey"),g=this.getLayoutItemOption(l,d.ITEM_CODE,"rangePickerEndKey"),F=Y.toString(d.DATE_TIME_FORMAT,!0);let P="yyyyMMddHHmmss",L="yyyyMMddHHmmss";if(F.length>0){const O=F.split(/[|&]/);((p=O[0])==null?void 0:p.trim().length)>=6&&((C=O[0])==null?void 0:C.trim().toLowerCase())!=="yyyymmdd"&&(P="yyyyMMdd"+O[0].substring(0,6)),((E=O[1])==null?void 0:E.trim().length)>=6&&((T=O[1])==null?void 0:T.trim().toLowerCase())!=="yyyymmdd"&&(L="yyyyMMdd"+O[1].substring(0,6))}let x=Y.getDateTimeFormatString(s[M],P),S=Y.getDateTimeFormatString(s[g],L);(x.substring(0,4)==="0001"||x.substring(0,4)==="1900"||x.substring(0,4)==="1901")&&(x=""),(S.substring(0,4)==="0001"||S.substring(0,4)==="1900"||S.substring(0,4)==="1901")&&(S=""),h>0&&(x.length>h&&(x=x.substring(0,h)),S.length>h&&(S=S.substring(0,h))),a[M]=x,a[g]=S}else["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(u)&&v&&v instanceof Array?(v=v.join(","),a[f]=v):(v=v||"",a[f]=v)}})}}}),e&&Object.keys(e).length>0&&Object.keys(e).forEach(l=>{a[l]=e[l]}),a}getAllControlValueAsFilterArray(r,e){const n=[];return(r instanceof Array?r:r.split(",")).forEach(i=>{const l=this.getConfigInfo(i);l.TSI00GRIDVIEW&&l.TSI00GRIDCOLUMN&&l.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(i,s.ITEM_CODE,"controlType"),p={};e&&Object.keys(e).length>0?Object.keys(e).forEach(v=>{p[v]=e[v]}):p.QUERY_TYPE="",p.ITEM_CODE=Y.toString(s.ITEM_CODE,!0,"toLower"),p.ORIGIN_CODE=s.ORIGIN_CODE,p.TABLE_NAME=s.TABLE_NAME,p.FIELD_NAME=Y.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 C=Y.toString(p.PARA_GROUP,!0),E=Y.toString(p.OPERATOR,!0);let T=this.getControlValue(i,s.ITEM_CODE)||"";if(E.length>0)switch(h){case"antRadioGroup":case"erRadioGroup":case"erSelect":case"erTreeSelect":{p.OP_VALUE=T,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)),(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antInputNumber":{p.DATA_TYPE="Decimal",p.OP_VALUE=T,p.OP_VALUE===null&&(p.OP_VALUE=0),(C==="2"||Y.toNumber(p.OP_VALUE)!==0)&&(p.OP_VALUE=Y.toString(p.OP_VALUE),n.push(p));break}case"antCheckbox":case"antSwitch":{p.OPERATOR="=",p.OP_VALUE=T===!0?"1":T===!1?"0":"",(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antMultiSelect":case"erMultiSelect":case"erCheckboxGroup":case"erMultiTreeSelect":{p.OPERATOR="IN",T&&T instanceof Array&&T.length>0?T=T.join(","):T&&typeof T=="string"&&T.length>0?T=T:T="",p.OP_VALUE=T,(C==="2"||T.length>0)&&n.push(p);break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{if(T){const v=Y.toString(s.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss";p.OP_VALUE=Y.getDateTimeFormatString(T,v),p.OP_VALUE.length>=4&&(p.OP_VALUE.substring(0,4)==="0001"||p.OP_VALUE.substring(0,4)==="1900")&&(p.OP_VALUE=""),(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p)}break}case"antDateTimeRangePicker":case"antDateRangePicker":case"antMonthRangePicker":case"antYearRangePicker":{if(T instanceof Array&&T.length===2){const v=Y.toString(s.DATE_TIME_FORMAT,!0);let M="yyyyMMddHHmmss",g="yyyyMMddHHmmss";if(v.length>0){const x=v.split(/[|&]/);((c=x[0])==null?void 0:c.trim().length)>=6&&((d=x[0])==null?void 0:d.trim().toLowerCase())!=="yyyymmdd"&&(M="yyyyMMdd"+x[0].substring(0,6)),((u=x[1])==null?void 0:u.trim().length)>=6&&((f=x[1])==null?void 0:f.trim().toLowerCase())!=="yyyymmdd"&&(g="yyyyMMdd"+x[1].substring(0,6))}let F=Y.getDateTimeFormatString(T[0],M),P=Y.getDateTimeFormatString(T[1],g);(F.substring(0,4)==="0001"||F.substring(0,4)==="1900"||F.substring(0,4)==="1901")&&(F=""),(P.substring(0,4)==="0001"||P.substring(0,4)==="1900"||P.substring(0,4)==="1901")&&(P="");const L=p.ITEM_CODE;(C==="2"||F.length>0)&&n.push({...p,ITEM_CODE:`${L}_beg`,OPERATOR:">=",OP_VALUE:F}),(C==="2"||P.length>0)&&n.push({...p,ITEM_CODE:`${L}_end`,OPERATOR:"<=",OP_VALUE:P})}break}default:{Y.toString(T,!0).length>0&&E==="IN"&&(T=T.split(/\n|\t|,|,/).map(v=>v.trim()).filter(v=>v.length>0).join(",")),p.OP_VALUE=T,(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}}}})}),n}expandLayoutGroup(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++)if(e[n].trim().length>0){const a=document.getElementById(this.FormId+e[n].trim()+"_content");a&&Y.jQuery(a).show()}return this}collapseLayoutGroup(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++)if(e[n].trim().length>0){const a=document.getElementById(this.FormId+e[n].trim()+"_content");a&&Y.jQuery(a).hide()}return this}getFormCodeSetFilter(r,e){let n="";if(this._configInfo[this._formName+r]){for(const a of this._configInfo[this._formName+r])if(a.CODE===e){n=a.SQL_CONTENT;break}}return n}getQuerySqlFormat(r,e){return Y.getSystemFormatString(r,e)}getFormSysInfo(r){return this._configInfo[pt.SystemParamsBlockName]&&this._configInfo[pt.SystemParamsBlockName].length>0&&r.trim().length>0?Y.toString(this._configInfo[pt.SystemParamsBlockName][0][r.trim().toUpperCase()]):""}getSysParaValue(r,e,n){return new Promise((a,i)=>{if(this._sysParaInfo&&this._sysParaInfo[r]!==void 0&&this._sysParaInfo[r][e]!==void 0)a(this._sysParaInfo[r][e].toString());else if(e&&e.trim().length>0){let l="";const s=st.buildMap([{QUERY_TYPE:"system_para",COMPANY_CODE:r,CTRL_CODE:e,EFFECT_ELEMENT_VALUE:n||""}]);Gr.callServiceEx(pt.queryDevConfigService,s,{partition:this._serverPartition}).then(c=>{c.sysFlag>=0&&c.contains("TSIFIAA51")&&c.getMapData("TSIFIAA51").length>0?l=Y.toString(c.getMapData("TSIFIAA51")[0].CTRL_NUM):c.sysFlag>=0&&c.contains(pt.SystemParamsBlockName)&&c.getMapData(pt.SystemParamsBlockName).length>0&&(l=Y.toString(c.getMapData(pt.SystemParamsBlockName)[0][e.toUpperCase()])),this._sysParaInfo[r]===void 0&&(this._sysParaInfo[r]={}),this._sysParaInfo[r][e]=l,a(l)},()=>{this._sysParaInfo[r]===void 0&&(this._sysParaInfo[r]={}),this._sysParaInfo[r][e]="",a("")})}})}getDefaultStringValue(r){return r.trim().length>14&&r.trim().substring(0,13)==="$FormSysInfo."&&r.trim().substring(r.trim().length-1,r.trim().length)==="$"?r=this.getFormSysInfo(r.trim().substring(13,r.trim().length-1)):r=Y.getSystemFormatString(r),r}setCustomDefaultValue(r,e){(r==null?void 0:r.trim().length)>0&&e&&(this._customDefaultValues[r.trim()]=e)}getLayoutConfigDefaultValues(r){const e={};let n;return r instanceof Array?n=r:n=r.split(","),n.length>0&&n.forEach(a=>{const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{var s,c,d;if(l.DEFAULT_VALUE&&l.DEFAULT_VALUE.trim().length>0){const u=l.FUNCTION_TYPE+l.COLUMN_EDIT,f=l.DEFAULT_VALUE,h=this.getControlName(u,l.FORMAT_STRING);if(h&&h.trim().length>0&&f.trim().length>0)switch(h){case"antInputNumber":{e[l.ITEM_CODE]=parseFloat(f);break}case"erCheckboxGroup":case"antMultiSelect":case"erMultiSelect":{const p=this.getDefaultStringValue(f).split(",");e[l.ITEM_CODE]=p;break}case"antCheckbox":case"antSwitch":{e[l.ITEM_CODE]=Y.toString(f)==="1"||Y.toString(f)==="true";break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{e[l.ITEM_CODE]=Y.getDateTimeByString(f);break}default:{if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(f)){const p=(c=(s=this._dropDownBindSource)==null?void 0:s[a])==null?void 0:c[l.ITEM_CODE];((d=p==null?void 0:p.dataSource)==null?void 0:d.length)>0&&(p!=null&&p.dataValueField)?f==="$FIRST_ROW$"?e[l.ITEM_CODE]=p.dataSource[0][p.dataValueField]:f==="$LAST_ROW$"?e[l.ITEM_CODE]=p.dataSource[p.dataSource.length-1][p.dataValueField]:f==="$ALL_VALUES$"&&(e[l.ITEM_CODE]="",p.dataSource.forEach(C=>{e[l.ITEM_CODE]=e[l.ITEM_CODE].length===0?C[p.dataValueField]:e[l.ITEM_CODE]+","+C[p.dataValueField]})):e[l.ITEM_CODE]=""}else e[l.ITEM_CODE]=this.getDefaultStringValue(f);break}}}})}),e}getGridConfigDefaultValues(r){const e={},n=this.getConfigInfo(r.trim()),a=this.getBindingTable(r.trim());return a&&n.TSI00GRIDVIEW&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(i=>{var l,s,c;if(a.options.schema&&i.DEFAULT_VALUE&&i.DEFAULT_VALUE.trim().length>0){const d=a.options.schema[i.FIELD_NAME].type;if(d==="datetime")e[i.FIELD_NAME]=Y.getDateTimeByString(i.DEFAULT_VALUE);else if(d==="boolean")e[i.FIELD_NAME]=i.DEFAULT_VALUE==="1"||i.DEFAULT_VALUE.toLowerCase()==="true";else if(d==="number")e[i.FIELD_NAME]=Y.toNumber(i.DEFAULT_VALUE);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(i.DEFAULT_VALUE)){const u=(s=(l=this._dropDownBindSource)==null?void 0:l[r])==null?void 0:s[i.ITEM_CODE];((c=u==null?void 0:u.dataSource)==null?void 0:c.length)>0&&(u!=null&&u.dataValueField)?i.DEFAULT_VALUE==="$FIRST_ROW$"?e[i.FIELD_NAME]=u.dataSource[0][u.dataValueField]:i.DEFAULT_VALUE==="$LAST_ROW$"?e[i.FIELD_NAME]=u.dataSource[u.dataSource.length-1][u.dataValueField]:i.DEFAULT_VALUE==="$ALL_VALUES$"&&(e[i.FIELD_NAME]="",u.dataSource.forEach(f=>{e[i.FIELD_NAME]=e[i.FIELD_NAME].length===0?f[u.dataValueField]:e[i.FIELD_NAME]+","+f[u.dataValueField]})):e[i.FIELD_NAME]=""}else e[i.FIELD_NAME]=this.getDefaultStringValue(i.DEFAULT_VALUE)}}),e}async loadGrid(r,e,n,a,i){var l,s,c,d,u,f,h,p,C,E,T;if(!this.containsConfig(r)&&(n==null?void 0:n.forceLoadConfig)!==!1&&await this.loadConfig(r),this.containsConfig(r)){if(this._gridInstanceInfo[r]&&(n==null?void 0:n.reload)!==!0)return console.error(`Grid instance ${r} already exists!`),!1;const v=this.getSingleViewConfigInfo(r);this.setGridToolbarVisible(r,{refresh:v.SHOW_REFRESH==="1",addrow:v.SHOW_ADD==="1",copyrow:v.SHOW_ADDCOPY==="1",delete:v.SHOW_DELETE==="1",cancel:v.SHOW_ADD==="1"||v.SHOW_ADDCOPY==="1"||v.SHOW_DELETE==="1",excel:v.SHOW_EXPORT==="1",import:v.ALLOW_IMPORT==="1"}),this._gridColumnsConfigInfo[r]={},this._allowMergeColumnFields[r]=[],this._gridStyleInfo[r]=this._gridStyleInfo[r]||[],this._gridOptions[r]=this._gridOptions[r]||{};const M=this.getConfigInfo(r);if((l=e==null?void 0:e.gridOptions)!=null&&l.api&&M.TSI00GRIDVIEW&&M.TSI00GRIDVIEW.length>0){const g=M.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())||g.TABLE_NAME.trim(),n.cloneTableName.trim(),r),e.gridOptions.context={configId:r,configCaption:g.FUNCNAME_RES||g.FUNCNAME,options:n},n=n||{},g.SHOW_GROUP==="2"?n.groupDisplayType="singleColumn":g.SHOW_GROUP==="3"?n.groupDisplayType="multipleColumns":n.groupDisplayType="groupRows",((d=g.CUS_EXT_OPTIONS)==null?void 0:d.trim().length)>0&&(n={...JSON.parse(g.CUS_EXT_OPTIONS),...n}),((u=g.EXT_OPTIONS)==null?void 0:u.trim().length)>0&&(n={...JSON.parse(g.EXT_OPTIONS),...n});const F=this.getFormSysInfo("GridDefaultOptions");F.trim().length>0&&(n={...JSON.parse(F),...n}),["disableErMenu","rowDragManaged","groupIncludeFooter","groupIncludeTotalFooter","suppressRowTransform","suppressRowClickSelection","rowMultiSelectWithClick","singleClickEdit"].forEach(S=>{const O=e.gridOptions[S]??n[S];O!==void 0&&(n[S]=O)}),n.groupDisplayType=n.groupDisplayType||e.gridOptions.groupDisplayType||this.getFormSysInfo("GRIDGROUPDISPLAYTYPE")||"groupRows",n.rowHeight=n.rowHeight||e.gridOptions.rowHeight;const L=this.getGridConfigOptions(r,n,a,i);L.context={...e.gridOptions.context,...L.context},L&&Object.keys(L).forEach(S=>{e.gridOptions[S]=L[S]!==void 0?L[S]:e.gridOptions[S]}),e.gridOptions.defaultColDef=e.gridOptions.defaultColDef||{},e.gridOptions.rowSelection=M.TSI00GRIDVIEW[0].MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single",e.gridOptions.api.selectionService.rowSelection=e.gridOptions.rowSelection,e.gridOptions.api.selectionService.groupSelectsChildren=!0,e.gridOptions.api.setColumnDefs(L.columnDefs),e.gridOptions.api.setRowData([]);const x=(i==null?void 0:i.pagination)===!0||(i==null?void 0:i.pagination)==="client";if(g.ALLOW_CELLMERGE==="1"&&!x&&((f=e.gridOptions.context.mergeColumns)==null?void 0:f.length)>0&&!n.masterDetail&&(e.gridOptions.context.calculateRowSpan=(S=!0)=>{var I,k,y,R,N,U;let O=[];const A=e.gridOptions.columnApi.getRowGroupColumns(),w={};if(A.length===0){S?O=e.gridOptions.context.bindingSource.data():e.gridOptions.api.forEachNodeAfterFilterAndSort(b=>{var W;(W=b.data)!=null&&W.uid&&O.push(b.data)});const V=((y=(k=(I=e.gridOptions.context)==null?void 0:I.viewConfig)==null?void 0:k.MERGE_COLUMN)==null?void 0:y.trim().length)>0?(U=(N=(R=e.gridOptions.context)==null?void 0:R.viewConfig)==null?void 0:N.MERGE_COLUMN)==null?void 0:U.trim().split(","):[];e.gridOptions.context.mergeColumns.forEach(b=>{w[b]={};const W={};let q=0;const z=[...V,b];for(let ee=0;ee<O.length;ee++){let Q=!0;for(let G=0;G<z.length;G++){const K=z[G];if(O[ee][K]!==W[K]){Q=!1;break}}if(!Q){if(Object.keys(W).length>0)for(let G=q;G<ee;G++){const K=O[G].uid;w[b][K]=G===q?ee-q:0}z.forEach(G=>{W[G]=O[ee][G]}),q=ee}if(ee===O.length-1)for(let G=q;G<=ee;G++){const K=O[G].uid;w[b][K]=G===q?ee-q+1:0}}})}return e.gridOptions.context.rowSpanMap=w,O[0]}),(g==null?void 0:g.SHOW_FOOTER)==="1"&&((h=e.gridOptions.context.viewType)==null?void 0:h.toLowerCase())!=="cardview"&&((p=e.gridOptions.context.viewType)==null?void 0:p.toLowerCase())!=="card"&&e.gridOptions.api.setPinnedBottomRowData([{pinndeRowType:"ErGridSummaryFooter"}]),o.nextTick(()=>{var S;e.gridOptions.defaultColDef.floatingFilter===void 0&&e.gridOptions.api.setDefaultColDef({floatingFilter:(g==null?void 0:g.SHOW_FILTER_ROW)==="1"}),((S=n==null?void 0:n.initialData)==null?void 0:S.length)>0&&this.mergeDataToGrid(n.initialData,e)}),e.gridOptions.processCellForClipboard=S=>{var O,A,w,I,k,y,R,N;return(w=(A=(O=S.column)==null?void 0:O.colDef)==null?void 0:A.context)!=null&&w.hideContent?"******":(I=S.node)!=null&&I.footer&&((k=S.node)!=null&&k.group)&&((y=S.context)!=null&&y.focusColId)&&S.node.aggData&&S.node.aggData[S.context.focusColId]?Ir.isPlainObject(S.node.aggData[S.context.focusColId])?`☑️ ${Y.formatNumberValue(S.node.aggData[S.context.focusColId].aggValueOfChecked,"")}
|
|
71
|
+
</div>`)}static setLocalStorage(r,e){return(r==null?void 0:r.trim().length)>0&&localStorage.setItem(r.trim(),JSON.stringify(e)),localStorage}static debounce(r,e=100){let n;return(...a)=>{n&&clearTimeout(n),n=setTimeout(()=>{r(...a)},e)}}static getLocalStorage(r,e=!0){let n;return(r==null?void 0:r.trim().length)>0&&(r=r.trim(),n=Y.toString(localStorage.getItem(r)),e!==!1&&localStorage.removeItem(r),n&&n.trim().length>0&&(n=JSON.parse(n))),n}static getCallFormParas(r,e=!0){return this.getLocalStorage(r,e)}static copyText(r){const{toClipboard:e}=N4();r instanceof Array?r.forEach(n=>{}):r=String(r||""),(r==null?void 0:r.trim().length)>0&&e(r)}static readClipboardText(){return(navigator==null?void 0:navigator.clipboard.readText())||Promise.resolve("")}static converCustomFilterToQueryFilter(r){const e=[];return Array.isArray(r)&&r.length>0?r.forEach(n=>{n.fieldName&&n.value&&e.push({ITEM_CODE:n.fieldName,FIELD_NAME:n.fieldName,ORIGIN_CODE:"*",TABLE_NAME:"",OPERATOR:n.operator||"=",PARA_GROUP:"1",SQL_CONTENT:"",DATA_TYPE:"",OP_VALUE:n.value})}):this.toString(r,!0).length>0&&e.push({ITEM_CODE:"SQL",FIELD_NAME:"*",ORIGIN_CODE:"*",TABLE_NAME:"",OPERATOR:"para",PARA_GROUP:"1",SQL_CONTENT:this.toString(r,!0),DATA_TYPE:"",OP_VALUE:"*"}),e}}class OC{static setVariable(r,e,n){r.trim().length>0&&e.trim().length>0&&n!==void 0&&n!==null&&Y.setLocalStorage(r+"_"+e,n)}static getVariable(r,e,n=!0){return Y.getLocalStorage(r+"_"+e,n)}static clearVariable(r,e){r&&r.trim().length>0&&localStorage.removeItem(r+"_"+e)}static isNullOrEmpty(r,e){const n=Y.getLocalStorage(r+"_"+e);return n==null}}class Es{constructor(){fe(this,"_events",{});this._events={}}}let Dr=class extends Es{constructor(e,n,a){super();fe(this,"dirty",!1);fe(this,"dirtyFields",{});fe(this,"uid","");fe(this,"isNew",!1);fe(this,"_dataTable");fe(this,"_schemaFields",{});fe(this,"_backup",{});this._schemaFields=n||{},this._dataTable=a,this.accept(e,this._schemaFields)}get schemaFields(){return this._schemaFields}get dataTable(){return this._dataTable}static getFieldDefaultValue(e){return e==null?void 0:e.defaultValue}static setModelValue(e,n,...a){if(n&&Object.keys(n).length>0){let i;a.length===1&&(a=a[0].split(",")),a.length>0?a.forEach(l=>{e&&e.schemaFields&&e.get(l)!==void 0&&n[l]&&(e.schemaFields[l].type==="boolean"?i=n[l]===!0||n[l]==="1"||n[l]==="True"||n[l]==="true":e.schemaFields[l].type==="datetime"?i=Y.toDateTime(n[l]):i=n[l],e.set(l,i),e[l]=i)}):Object.keys(n).forEach((l,s)=>{e&&e.schemaFields&&e.get(l)!==void 0&&n[l]&&(e.schemaFields&&e.schemaFields[l]&&e.schemaFields[l].type==="boolean"?i=n[l]===!0||n[l]==="1"||n[l]==="True"||n[l]==="true":e.schemaFields&&e.schemaFields[l]&&e.schemaFields[l].type==="datetime"?i=Y.toDateTime(n[l]):i=n[l],!e.isNew&&s===0&&e.set(l,i),e.set(l,i))})}}shouldSerialize(e){return!["ID","isNew","uid","dirty","dirtyFields","_backup","_dataTable","_events","_schemaFields","_preview_row_data","_children_data",pt.TreeHierarchyFieldName].includes(e)}forEach(e){for(const n in this)this.shouldSerialize(n)&&e(this[n],n)}toJSON(e){var a,i;let n={};for(const l in this)if(this.shouldSerialize(l)&&(n[l]=this[l],this._schemaFields&&this._schemaFields[l]))switch(this._schemaFields[l].type){case"boolean":n[l]=this[l]?"1":"0";break;case"datetime":n[l]?(bt.isDayjs(n[l])&&bt(n[l]).isValid()?n[l]=n[l].format("YYYYMMDDHHmmss"):n[l]instanceof Date?bt(n[l]).format("YYYYMMDDHHmmss"):typeof n[l]=="string"?n[l]=n[l].replaceAll("-","").replaceAll("/","").replaceAll("T","").replaceAll(":",""):n[l]="",((a=n[l])==null?void 0:a.trim().length)===0||n[l].startsWith("1900")||n[l].startsWith("1901")||n[l].startsWith("0001")?n[l]="":this._schemaFields[l].maxLength>0?n[l]=n[l].padEnd(this._schemaFields[l].maxLength,"0").substring(0,this._schemaFields[l].maxLength):n[l]=n[l].padEnd(14,"0").substring(0,14)):n[l]="";break;case"time":n[l]?(bt.isDayjs(n[l])&&bt(n[l]).isValid()?n[l]=n[l].format("YYYYMMDDHHmmss"):n[l]instanceof Date?bt(n[l]).format("YYYYMMDDHHmmss"):typeof n[l]=="string"?n[l]=n[l].replaceAll("-","").replaceAll("/","").replaceAll("T","").replaceAll(":",""):n[l]="",((i=n[l])==null?void 0:i.trim().length)===0||n[l].startsWith("1900")||n[l].startsWith("1901")||n[l].startsWith("0001")?n[l]="":this._schemaFields[l].maxLength>0&&this._schemaFields[l].maxLength<=6?n[l]=n[l].padEnd(this._schemaFields[l].maxLength,"0").substring(8,8+this._schemaFields[l].maxLength):n[l]=n[l].padEnd(14,"0").substring(8,14)):n[l]="";break;case"string":if(n[l]&&n[l]instanceof Array)n[l]=n[l].join(",");else if(this._schemaFields[l].RGBA){const s=Y.hexToRgba(n[l].trim()).replace(/rgba|\(|\)/gi,"");n[l]=s==="255,255,255,1"?"":s}break;case"number":n[l]=Y.toNumber(n[l]);break;default:n[l]=this[l];break}return e&&(n={...n,...e}),n}setBackup(){this._backup=this.toJSON();for(const e in this)this.shouldSerialize(e)&&(this._backup[e]=this[e]);return this}getBackup(){return this._backup}get(e){return Reflect.get(this,e)}set(e,n,a,i=!1){var l;if(this.shouldSerialize(e))if(this._schemaFields[e]){switch(this._schemaFields[e].type){case"datetime":case"time":n=Y.toDateTime(n,"Dayjs");break;case"boolean":n=Y.toBoolean(n);break;case"number":n=Y.toNumber(n);break;case"string":n=Y.toString(n,!0),this._schemaFields[e].RGBA&&(n=Y.toHexColor(n));break;default:n=n;break}const s={};if(s.oldValue=this[e],s.newValue=n,this.dirtyFields[e]=!0,this.dirty=!0,Reflect.set(this,e,n),this._dataTable&&a!=="setData"){const c=o.isProxy(this._dataTable)?o.toRaw(this._dataTable):this._dataTable;(l=c.BingdingInfo)==null||l.forEach(u=>{if(u.formHelper&&u.configId&&u.configId!==a)if(u.controlType==="Grid"){const f=u.formHelper.getGrid(u.configId);if(f){const h={};h[e]=n,u.formHelper.setGridRowData(f,this.uid,h)}}else u.controlType});const d=c.getEvent("dataChanged");d&&(s.field=e,s.binddingInfo=c.BingdingInfo,d(s))}}else i===!1&&(this[e]=n);return this}reset(){return this.accept(void 0,this._schemaFields),this}setSchema(e,n=!0){return this._schemaFields=e,n&&this.reset(),this}setData(e,n,a=!1){var i;return e&&(Object.keys(e).forEach(l=>{if(this.shouldSerialize(l))if(this._schemaFields[l]){switch(this._schemaFields[l].type){case"datetime":case"time":e[l]=Y.toDateTime(e[l],"Dayjs");break;case"boolean":e[l]=Y.toBoolean(e[l]);break;case"number":e[l]=Y.toNumber(e[l]);break;case"string":e[l]=Y.toString(e[l],!0),this._schemaFields[l].RGBA&&(e[l]=Y.toHexColor(Y.toString(e[l],!0)));break}this.dirtyFields[l]=!0,this.dirty=!0,Reflect.set(this,l,e[l])}else a===!1&&(this[l]=e[l])}),this._dataTable&&((i=(o.isProxy(this._dataTable)?o.toRaw(this._dataTable):this._dataTable).BingdingInfo)==null||i.forEach(s=>{if(s.formHelper&&s.configId&&s.configId!==n&&s.controlType==="Grid"){const c=s.formHelper.getGrid(s.configId);c&&s.formHelper.setGridRowData(c,this.uid,e)}}))),this}addField(...e){return e&&e.length>0&&e.forEach(n=>{this._schemaFields&&n.name&&this._schemaFields[n.name]===void 0&&(this._schemaFields[n.name]=n,this[n.name]=n.defaultValue)}),this}reomveField(...e){return e&&e.length>0&&e.forEach(n=>{this._schemaFields&&n.name&&this._schemaFields[n.name]&&delete this._schemaFields[n.name]}),this}setField(e,n){return(e==null?void 0:e.trim().length)>0&&this._schemaFields&&this._schemaFields[e.trim()]&&(this._schemaFields[e.trim()]={...this._schemaFields[e.trim()],...n}),this}accept(e,n){if(n)for(const a in n){const i=n[a];i&&i.name&&(this[i.name]=i.defaultValue)}if(e){for(const a in e)if(this[a]=e[a],n&&n[a])switch(n[a].type){case"datetime":case"time":this[a]=Y.toDateTime(e[a],"Dayjs");break;case"boolean":this[a]=Y.toBoolean(e[a]);break;case"number":this[a]=Y.toNumber(e[a]);break;case"string":this[a]=Y.toString(e[a],!0),this._schemaFields[a].RGBA&&(this[a]=Y.toHexColor(e[a].trim()));break;default:this[a]=e[a];break}}return this.uid=Y.guid(),this.dirty=!1,this.dirtyFields={},this}};const Ll=class Ll{constructor(){Qr(this,Qo,0);Qr(this,jo,"");Qr(this,Ko,{});Qr(this,Di,new Map);Qr(this,qr,new Map);this.reset()}get sysFlag(){return We(this,Qo)}get sysMsg(){return We(this,jo)}get sysContext(){return We(this,Ko)}get dataMap(){return We(this,qr)}get metaMap(){return We(this,Di)}get size(){return We(this,qr).size}get keys(){return Array.from(We(this,qr).keys())}reset(){return ar(this,Qo,0),ar(this,jo,""),We(this,qr).clear(),We(this,Di).clear(),ar(this,Ko,{company_code:pt.CompanyCode,company_name:pt.CompanyName,formname:"",userid:pt.UserId,username:pt.UserName,culture:pt.Culture}),this}static getInstance(){return new Ll}renameKey(r,e){if((e==null?void 0:e.trim().length)>0){if((r==null?void 0:r.trim().length)===0){const n=Array.from(We(this,qr).keys());n.length>0&&(r=n[0])}r.trim().length>0&&We(this,qr).set(e.trim(),We(this,qr).get(r.trim())||[]).delete(r.trim())}return this}setSys(r){return ar(this,Qo,r.sysFlag??We(this,Qo)),ar(this,jo,r.sysMsg??We(this,jo)),this}setContext(r){return r&&ar(this,Ko,{...We(this,Ko),...r}),this}static buildMap(r,e){const n=new Ll;return r&&Ir.isPlainObject(r)&&(r=[r]),r instanceof Array&&r.length>0&&n.addMapData(e||"Table0",r),n}forEach(r){We(this,qr).forEach((e,n,a)=>{r(e,n,a)})}addMapData(r,e){var n;return r&&r.trim().length>0&&(We(this,qr).has(r.trim())||We(this,qr).set(r.trim(),[]),e&&e.length>0&&((n=We(this,qr).get(r.trim()))==null||n.push(...e))),this}removeMap(r){return r&&r.trim().length>0&&We(this,qr).delete(r.trim()),this}getMapData(r){if(typeof r=="number")if(r>=0&&r<this.keys.length)r=this.keys[r];else return[];if(!r||r.trim().length===0){const e=Array.from(We(this,qr).keys());e.length>0&&(r=e[0])}return r&&r.trim().length>0?We(this,qr).get(r.trim())??[]:[]}contains(r){return(r==null?void 0:r.trim().length)>0?We(this,qr).has(r.trim()):!1}copy(){const r=new Ll;return We(this,qr).forEach((e,n)=>{const a=[...e];r.addMapData(n,a)}),r}getMeta(r){if(!r||r.trim().length===0){const e=Array.from(We(this,qr).keys());e.length>0&&(r=e[0])}return r&&(r==null?void 0:r.trim().length)>0?We(this,Di).get(r.trim())||[]:[]}mergeFromEiInfo(r){return this.reset(),this.setSys({sysFlag:r.getStatus(),sysMsg:r.getMsg()}),Object.keys(r.getBlocks()).forEach(e=>{const n=r.getBlock(e);this.addMapData(e,n.getMappedRows());const a=[],i=n.getBlockMeta().getMetas();Object.keys(i).forEach(l=>{a.push({name:i[l].name,type:i[l].type,desc:i[l].name})}),this.metaMap.set(e,a)}),this}toEiInfo(){const r=new Yt.EiInfo;return this.dataMap.forEach((e,n)=>{const a=Yt.EiBlock.build(n,e);r.addBlock(a)}),this.sysContext,r}};Qo=new WeakMap,jo=new WeakMap,Ko=new WeakMap,Di=new WeakMap,qr=new WeakMap;let st=Ll;class cr{static checkGridRow(r,e,n=!0){var a,i,l,s;(a=r==null?void 0:r.gridOptions)!=null&&a.api&&e!==void 0&&e!==null&&(typeof e=="string"&&e.trim().length>0?e=[e]:e.uid&&(e=[Y.toString(e.uid)]),e instanceof Array&&e.length>0?e.forEach(c=>{const d=r.gridOptions.api.getRowNode(c);d&&d.setSelected(n===!0)}):typeof e=="number"&&e>=0&&((s=(l=(i=r.gridOptions.api)==null?void 0:i.getModel())==null?void 0:l.getRow(e))==null||s.setSelected(n===!0)))}static checkGridCurrentRow(r){if(r){const e=cr.getGridCurrentRow(r);e&&cr.checkGridRow(r,e)}}static checkAllGridRow(r,e=!0){var n;if((n=r==null?void 0:r.gridOptions)!=null&&n.api){const a=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(a&&a.visible){const i=(l,s)=>{l.setSelected(!0)};e?r.gridOptions.api.forEachNodeAfterFilterAndSort(i):r.gridOptions.api.forEachLeafNode(i)}}}static unCheckAllGridRow(r,e=!0){var n;if((n=r==null?void 0:r.gridOptions)!=null&&n.api){const a=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(a&&a.visible){const i=(l,s)=>{l.setSelected(!1)};e?r.gridOptions.api.forEachNodeAfterFilterAndSort(i):r.gridOptions.api.forEachLeafNode(i)}}}static isGridRowChecked(r,e){var n,a;if((n=r==null?void 0:r.gridOptions)!=null&&n.api&&e){const i=cr.getGridColumn(r,pt.GridCheckColumnFieldName);if(i&&i.visible)return(a=r.gridOptions.api.getRowNode(e instanceof Dr?e.uid:e))==null?void 0:a.isSelected()}}static setGridFocusedCell(r,e=0,n,a){var i,l,s,c;if((i=r==null?void 0:r.gridOptions)!=null&&i.api){const d=r.gridOptions.api;if(d.clearRangeSelection(),d.getDisplayedRowCount()>0){if(e=e||0,d.ensureIndexVisible(e),n)d.ensureColumnVisible(n),d.setFocusedCell(e,n,a);else if(((s=(l=r.gridOptions.api.columnModel)==null?void 0:l.gridColumns)==null?void 0:s.length)>0){for(let u=0;u<r.gridOptions.api.columnModel.gridColumns.length;u++)if((c=r.gridOptions.api.columnModel.gridColumns[u])!=null&&c.visible){d.ensureColumnVisible(r.gridOptions.api.columnModel.gridColumns[u]),d.setFocusedCell(e,r.gridOptions.api.columnModel.gridColumns[u],a);break}}}}}static validateGridInput(r,e,n,a=!1,i=!0){var c,d,u;n=n||"ChangedRows";let l=!0,s=!1;if((c=r==null?void 0:r.gridOptions)!=null&&c.api){const f=r.gridOptions.api,h=(u=(d=r.gridOptions)==null?void 0:d.context)==null?void 0:u.columnsConfig,p=[];if(a instanceof Array&&a.length>0?a.forEach(E=>{E.trim().length>0&&p.push({ITEM_CODE:E.trim(),FIELD_NAME:E.trim(),CONDITION_TABLE:"",MUST_INPUT_CONDITION:""})}):(s=a===!0,h==null||h.forEach(C=>{C.UNBOUND_TYPE==="0"&&C.ITEM_MUST_FLAG==="1"&&p.push(C)})),p.length>0)if(f.setFilterModel(null),n==="CheckedRows"){const C=f.getSelectedNodes();for(let E=0;E<C.length;E++)if(l=this.validateGridRowInput(f,C[E],p,e,s,i),!l)return l}else if(n==="AllRows"){const C=f.getModel().getRowCount();for(let E=0;E<C;E++){const T=f.getModel().getRow(E);if(T!=null&&T.data&&(l=this.validateGridRowInput(f,T,p,e,s,i),!l))return l}}else{const C=cr.getGridCreatedRows(r),E=cr.getGridModifyRows(r),T=[...C,...E];for(let v=0;v<T.length;v++){const M=f.getModel().getRowNode(T[v].uid);if(M!=null&&M.data&&(l=this.validateGridRowInput(f,M,p,e,s,i),!l))return l}}}return l}static setGridColumnEditable(r,e,...n){var a,i;if((a=r==null?void 0:r.gridOptions)!=null&&a.api){const l=(i=r.gridOptions.api.columnModel)==null?void 0:i.gridColumns;if(n.length===1&&(n=n[0].split(",")),(l==null?void 0:l.length)>0){const s=r.gridOptions.api.getEditingCells();let c="";s.forEach(d=>{var u;c=((u=d.column)==null?void 0:u.getId())||""}),l.forEach(d=>{var u;d.colId!==pt.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(d.colId))&&(d.context=d.context||{},d.context.editable=e,d.colId===c&&e===!1&&r.gridOptions.api.stopEditing(),(d.colDef.cellEditor==="agCheckboxCellEditor"||d.colDef.cellEditType==="switchEditor")&&((u=r==null?void 0:r.gridOptions)==null||u.api.refreshCells({force:!0,columns:[d]})))})}}}static getGridCellRenderText(r,e,n,a){var s,c,d,u;let i="";const l=this.getGridColumnDef(r,e);return l!=null&&l.context&&(l.context.cellEditType==="dateEditor"?i=Y.getDateTimeFormatString(n,a||((s=l.context.columnConfig)==null?void 0:s.FORMAT_STRING)):l.context.cellEditType==="numberEditor"?i=Y.formatNumberValue(n,a||((c=l.context.columnConfig)==null?void 0:c.FORMAT_STRING)):l.refData&&((d=l.context)==null?void 0:d.cellEditType)==="checkGridLookUpEdit"&&l.context.valueField!==l.context.textField?Y.toString(n).trim().split(",").forEach(h=>{const p=l.refData[h]||h;i=i.length===0?p:i+","+p}):((u=l.context)==null?void 0:u.cellEditType)==="gridLookUpEdit"?i=l.refData[n]||n:i=Y.toString(n)),i}static validateGridRowInput(r,e,n,a,i=!1,l=!0){var c,d,u;if(r&&((c=e==null?void 0:e.data)!=null&&c.uid))for(let f=0;f<n.length;f++){const h=n[f].ITEM_CODE,p=n[f].FIELD_NAME,C=n[f].CONDITION_TABLE;let E={};Y.toString(n[f].EXT_OPTIONS).trim().length>0&&(E=JSON.parse(Y.toString(n[f].EXT_OPTIONS)));const T=E.requireCondition||n[f].MUST_INPUT_CONDITION,v=r.getColumnDef(h);if(v&&(!v.visible||!i))if(T.trim().length===0){if(e.rowIndex&&(e==null?void 0:e.data[p])===void 0||(e==null?void 0:e.data[p])===null||Y.toString(e==null?void 0:e.data[p]).trim().length===0||((d=v.context)==null?void 0:d.dataType)==="number"&&(e==null?void 0:e.data[p])===0)return l&&(r.ensureNodeVisible(e,"top"),r.ensureColumnVisible(v.colId,"auto"),r.clearRangeSelection(),r.setFocusedCell(e.rowIndex||0,v.colId),r.startEditingCell({rowIndex:e.rowIndex||0,colKey:v.colId}),o.nextTick(()=>{r.getCellEditorInstances({columns:[v],rowNodes:[e]}).forEach(g=>{g.editorType,g.setBorder?g.setBorder("2px solid red"):g.setInvalid&&g.setInvalid()})}),Y.messageWarning(Y.$t("ERX.InputEmptyMessage"))),!1}else{let M=e==null?void 0:e.data;if(C.trim().length>0&&(a!=null&&a.contains(C.trim()))&&(M=a==null?void 0:a.getCurrentDataObject(C.trim())),M&&M instanceof Dr&&Y.checkExpressionValid(M,Y.getSystemFormatString(T))&&((e==null?void 0:e.data[p])===void 0||(e==null?void 0:e.data[p])===null||Y.toString(e==null?void 0:e.data[p]).trim().length===0||((u=v.context)==null?void 0:u.dataType)==="number"&&(e==null?void 0:e.data[p])===0))return l&&(r.ensureNodeVisible(e,"top"),r.ensureColumnVisible(v.colId,"auto"),r.clearRangeSelection(),r.setFocusedCell(e.rowIndex||0,v.colId),r.startEditingCell({rowIndex:e.rowIndex||0,colKey:v.colId}),Y.messageWarning(Y.$t("ERX.InputEmptyMessage"))),!1}}return!0}static setGridRowData(r,e,n,a=!1){var i;if((i=r==null?void 0:r.gridOptions)!=null&&i.api&&e&&n){n instanceof Dr&&(n=n.toJSON());const l=r.gridOptions.api;if(e instanceof Dr&&(e=e.uid),typeof e=="string"&&e.trim().length>0){const s=l.getModel().getRowNode(e.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])&&(Y.toString(s.data[c]).trim().length===0||a===!1)){const f=l.getColumnDef(c);f?f.cellEditor==="agCheckboxCellEditor"?s.setDataValue(c,n[c]===!0||n[c]==="1"):Ir.isPlainObject(f.cellEditor)&&((u=f.cellEditor)==null?void 0:u.name)==="DatetimeEditor"?Y.toString(n[c]).trim().length===0?s.setDataValue(c,null):s.setDataValue(c,Y.getDateTimeByString(n[c])):s.setDataValue(c,n[c]):s.data[c]=n[c]}}),l.refreshCells({columns:[pt.GridCheckColumnFieldName],rowNodes:[s]}))}}}static setGridCurrentRowData(r,e,n=!1){const a=cr.getGridCurrentRow(r);a&&cr.setGridRowData(r,a,e,n)}static setGridRowState(r,e,n){var a,i,l,s;if((a=r==null?void 0:r.gridOptions)!=null&&a.api&&e){const c=r.gridOptions.api;if(e instanceof Dr&&(e=e.uid),typeof e=="string"&&e.trim().length>0){const d=c.getModel().getRowNode(e.trim());if(d&&((i=d.data)!=null&&i.uid)){const u=(s=(l=r.gridOptions)==null?void 0:l.context)==null?void 0:s.bindingSource;u&&u.setRowState(d.data,n)}}}}static getGridBindingTable(r){var e,n;return(n=(e=r.gridOptions)==null?void 0:e.context)==null?void 0:n.bindingSource}static getGridColumn(r,e){var a,i,l,s;let n;if(e=Y.toString(e,!0),(a=r==null?void 0:r.gridOptions)!=null&&a.api&&((i=r==null?void 0:r.gridOptions)!=null&&i.columnApi))if(e.length>0){const c=(l=r==null?void 0:r.gridOptions)==null?void 0:l.columnApi.getColumns();for(let d=0;d<c.length;d++)if(c[d].colId===e||c[d].field===e){n=c[d];break}}else{const c=(s=r==null?void 0:r.gridOptions)==null?void 0:s.api.getFocusedCell();c&&(n=c.Column)}return n}static getGridColumnDef(r,e){let n;const a=this.getGridColumn(r,e);return a!=null&&a.colDef&&(n=a.colDef),n}static async deleteGridRows(r,e=!1,n){var a,i,l,s,c,d,u,f,h,p;if((a=r==null?void 0:r.gridOptions)!=null&&a.api){const C=n||this.getGridRows(r,"select");if((C==null?void 0:C.length)>0){let E=!0;if(e&&(E=await Y.messageConfirm(Y.$t("ERX.RemoveConfirmMessage")||"是否确认删除?")),E){if((i=r==null?void 0:r.gridOptions)!=null&&i.treeData){const T=[];(s=(l=r==null?void 0:r.gridOptions)==null?void 0:l.api)==null||s.forEachNode(v=>{for(let M=0;M<C.length;M++)C[M][pt.TreeHierarchyFieldName].every(g=>new Set(v.data[pt.TreeHierarchyFieldName]).has(g))&&T.push(v.data)}),(u=(d=(c=r==null?void 0:r.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource)==null||u.remove(T)}else(p=(h=(f=r==null?void 0:r.gridOptions)==null?void 0:f.context)==null?void 0:h.bindingSource)==null||p.remove(C);return!0}}}return!1}static getGridSelectRows(r,e=!1,n=!1){return this.getGridRows(r,"select",e,n)}static getGridCurrentRow(r,e=!1,n=!1){let a;const i=this.getGridRows(r,"current",e,n);return i.length>0&&(a=i[0]),a}static getGridCheckedRows(r,e=!1,n=!1){return this.getGridRows(r,"checked",e,n)}static getGridCheckedAfterFilterRows(r,e=!1,n=!1){return this.getGridRows(r,"checkedAfterFilter",e,n)}static getGridDeletedRows(r,e=!1,n=!1){return this.getGridRows(r,"delete",e,n)}static getGridModifyRows(r,e=!1,n=!1){return this.getGridRows(r,"modify",e,n)}static getGridCreatedRows(r,e=!1,n=!1){return this.getGridRows(r,"add",e,n)}static getGridAllRows(r,e=!1,n=!1){return this.getGridRows(r,"all",e,n)}static getGridRows(r,e,n=!1,a=!1){var c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k;let i=[],l,s;if(r!=null&&r.api&&(r!=null&&r.columnApi)?(l=r.api,s=r.columnApi):(l=(c=r==null?void 0:r.gridOptions)==null?void 0:c.api,s=(d=r==null?void 0:r.gridOptions)==null?void 0:d.columnApi),l&&e&&e.toString().length>0){switch(e){case"current":{const y=l.getFocusedCell();if(y){const R=(f=(u=l.getModel())==null?void 0:u.getRow(y.rowIndex))==null?void 0:f.data;R&&(n instanceof Function?i.push(n(R)||R.toJSON()):i.push(n?R.toJSON():R))}break}case"checked":{const y=l.getSelectedRows();for(let R=0;R<y.length;R++)n instanceof Function?i.push(n(y[R])||y[R].toJSON()):i.push(n?y[R].toJSON():y[R]);break}case"checkedAfterFilter":{l.forEachNodeAfterFilter(y=>{var R;(R=y.data)!=null&&R.uid&&y.isSelected()&&(n instanceof Function?i.push(n(y.data)||y.data.toJSON()):i.push(n?y.data.toJSON():y.data))});break}case"select":if(r!=null&&r.gridOptions){const y=this.getGridColumn(r,pt.GridCheckColumnFieldName);return y&&!y.hide&&((h=r==null?void 0:r.gridOptions.context)==null?void 0:h.viewConfig.SHOW_SELECTION)==="1"?this.getGridRows(r,"checked",n,a):this.getGridRows(r,"current",n,a)}break;case"delete":if((C=(p=r==null?void 0:r.gridOptions)==null?void 0:p.context)!=null&&C.bindingSource){const y=(T=(E=r==null?void 0:r.gridOptions)==null?void 0:E.context)==null?void 0:T.bindingSource;i=y==null?void 0:y.getRows("removed",n)}break;case"modify":if((M=(v=r==null?void 0:r.gridOptions)==null?void 0:v.context)!=null&&M.bindingSource){const y=(F=(g=r==null?void 0:r.gridOptions)==null?void 0:g.context)==null?void 0:F.bindingSource;i=y==null?void 0:y.getRows("updated",n)}break;case"add":if((L=(P=r==null?void 0:r.gridOptions)==null?void 0:P.context)!=null&&L.bindingSource){const y=(S=(x=r==null?void 0:r.gridOptions)==null?void 0:x.context)==null?void 0:S.bindingSource;i=y==null?void 0:y.getRows("created",n)}break;case"all":if((A=(O=r==null?void 0:r.gridOptions)==null?void 0:O.context)!=null&&A.bindingSource){const y=(I=(w=r==null?void 0:r.gridOptions)==null?void 0:w.context)==null?void 0:I.bindingSource;i=y==null?void 0:y.getRows("all",n)}break;case"allAfterFilter":l.forEachNodeAfterFilterAndSort(y=>{var R;(R=y.data)!=null&&R.uid&&(n instanceof Function?i.push(n(y.data)||y.data.toJSON()):i.push(n?y.data.toJSON():y.data))});break}if(s&&a&&(i==null?void 0:i.length)>0){const y=((k=s.getAllGridColumns())==null?void 0:k.map(R=>{var N;return(N=R.colDef)==null?void 0:N.field}))||[];i=i.map(R=>(Object.keys(R).forEach(N=>{y.includes(N)||delete R[N]}),R))}}return i}static getGridChangedRowsAsDataMap(r,e,n,a=!1,i){var d,u,f;n=n||new st,e=e||((f=(u=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource)==null?void 0:f.tableName)||"Table0";const l=this.getGridRows(r,"delete",i??!0,a);l.length>0&&n.addMapData(e+"_DELETE",l);const s=this.getGridRows(r,"modify",i??!0,a);s.length>0&&n.addMapData(e+"_MODIFY",s);const c=this.getGridRows(r,"add",i??!0,a);return c.length>0&&n.addMapData(e+"_ADD",c),n}static mergeGridDataRow(r,e,n=!1,a=!1){if(r&&e){e instanceof Dr&&(e=e.toJSON());const i=Object.keys(r.toJSON()),l=Object.keys(e);(i==null?void 0:i.length)>0&&(l==null?void 0:l.length)>0&&(i.length>l.length?l:i).forEach(c=>{var d;(d=r.schemaFields)!=null&&d[c]&&e[c]!==void 0&&String(r[c]).trim()!==String(e[c]).trim()&&(a||typeof r[c]=="number"||typeof e[c]=="number"||!n||Y.toString(e[c],!0).length===0)&&r.set(c,e[c])})}return r}static clearGridData(r){var e,n,a,i,l;if((e=r==null?void 0:r.gridOptions)!=null&&e.api&&((a=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&a.bindingSource)){const s=(l=(i=r==null?void 0:r.gridOptions)==null?void 0:i.context)==null?void 0:l.bindingSource;s==null||s.clear()}return this}static mergeDataToGrid(r,e,n=!0){var i,l,s,c,d;let a=0;if((i=e==null?void 0:e.gridOptions)!=null&&i.api&&((s=(l=e==null?void 0:e.gridOptions)==null?void 0:l.context)!=null&&s.bindingSource)){const u=(d=(c=e==null?void 0:e.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource;u&&(a=u.merge(r,n))}return a}static importExcelFile(r,e,n,a){var i,l;((l=(i=r==null?void 0:r.gridOptions)==null?void 0:i.context)==null?void 0:l.bindingSource)instanceof un&&Y.readExcelFile(s=>{var c,d,u;if(s.length>0){const f={},h={},p=(c=r==null?void 0:r.gridOptions)==null?void 0:c.columnApi.getColumns(),C=(u=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource,E={},T=(M,g)=>{var F,P,L;if(M==null)return"";if(E[g.field]=E[g.field]||{},E[M])return E[M];if((F=g.refData)!=null&&F[M])return M;{if(Y.toString(M).includes("|")){const S=M.split("|");if((P=g.refData)!=null&&P[S[0]])return S[0]}else if(Y.toString(M).includes("-")){const S=M.split("-");if((L=g.refData)!=null&&L[S[0]])return S[0]}const x=Object.keys(g.refData).find(S=>g.refData[S]===Y.toString(M)||g.refData[S]===`${S}|${Y.toString(M)}`||g.refData[S]===`${S}-${Y.toString(M)}`);return x?(E[g.field][M]=x,x):""}},v=[];s.forEach(M=>{if(M.__EMPTY!==(Y.$t("ERX.Aggregate")||"总计")&&M.__EMPTY!==(Y.$t("ERX.GroupAggregate")||"小计")){Object.keys(M).forEach(F=>{var P,L;if(F&&!F.startsWith("__EMPTY")&&!h[F])for(let x=0;x<p.length;x++){const S=p[x].getColDef(),O=(P=S.headerName)==null?void 0:P.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim(),A=F.replace(/<br\s*\/?>/gi,"").replace(/\s+/g,"").trim();if((O===A||S.field===A)&&S.field&&((L=C.options.schema)!=null&&L[S.field])){f[S.field]={dataKey:F,colDef:S},h[F]=S;break}}});const g={};Object.keys(f).forEach(F=>{var P,L;M[f[F].dataKey]&&(g[f[F].colDef.field]=M[f[F].dataKey],f[F].colDef.refData&&((P=f[F].colDef.cellEditor)==null?void 0:P.name)==="DropdownEditor"?g[f[F].colDef.field]=T(g[f[F].colDef.field],f[F].colDef):((L=f[F].colDef.cellEditor)==null?void 0:L.name)==="DatetimeEditor"&&(g[f[F].colDef.field]=Y.getDateTimeByString(g[f[F].colDef.field])))}),e&&e instanceof Function?e(g)&&v.push(g):v.push(g)}}),n&&n instanceof Function?n(v):C.import(v)}})}static exportGridToExcel(r,e,n){var c,d;let a=u=>{var h,p,C;this.setGridColumnOptions(r,E=>{var T,v,M,g,F;E.cellDataType==="number"?E.cellClass=u!=null&&u.numberAsText?"right-cell-string":"right-cell":((T=E.context)==null?void 0:T.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0&&(((v=E.context.columnConfig)==null?void 0:v.FORMAT_STRING)==="yyyy-MM-dd"||((M=E.context.columnConfig)==null?void 0:M.FORMAT_STRING)==="yyyy/MM/dd"?E.cellClass="date-cell":E.cellClass="datetime-cell"),((g=n==null?void 0:n.excelStyleConfig)==null?void 0:g.length)>0&&((F=n==null?void 0:n.excelStyleConfig)==null||F.forEach(P=>{(P.columnNames.length===0||E.colId&&P.columnNames.includes(E.colId.toUpperCase()))&&(E.cellClassRules=E.cellClassRules||{},u!=null&&u.includeCellStyle?!P.condition||P.condition.trim().length===0||P.condition.trim().replaceAll(" ","")==="1=1"?E.cellClassRules[P.id]=L=>{var x;return((x=L.data)==null?void 0:x.uid)&&!0}:E.cellClassRules[P.id]=L=>{var x;return((x=L.data)==null?void 0:x.uid)&&Y.checkExpressionValid(L.data,Y.getSystemFormatString(P.condition))}:delete E.cellClassRules[P.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:(((C=n==null?void 0:n.columnKeys)==null?void 0:C.length)||1)-1}],height:50}]),r==null||r.exportDataAsExcel({fileName:(u==null?void 0:u.fileName)||"grid.xlsx",sheetName:(u==null?void 0:u.sheetName)||"Sheet1",author:pt.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:E=>{var T,v;return((v=(T=E.column.colDef)==null?void 0:T.headerName)==null?void 0:v.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:E=>!!(u!=null&&u.skipSummaryRows&&E.node.footer===!0&&E.node.group===!0&&E.node.level>=0||u!=null&&u.skipFooterRows&&E.node.footer===!0&&E.node.group===!0&&E.node.level<0),prependContent:(n==null?void 0:n.prependContent)??f,appendContent:n==null?void 0:n.appendContent,processCellCallback:E=>{var M,g,F,P,L,x,S,O,A,w,I,k,y,R,N,U,V,b,W,q,z;const T=Y.toString(E.value).includes("->")?" -> ":"",v=Y.toString(E.value).replace(T,"").trimStart();return(g=(M=E.column.colDef)==null?void 0:M.context)!=null&&g.hideContent||E.value&&Ir.isPlainObject(E.value)&&E.formatValue instanceof Function?E.formatValue(E.value):E.node.group&&E.node.footer!==!0?(F=E.column.colDef)!=null&&F.rowGroup&&E.node.key?((P=E.column.colDef.refData)==null?void 0:P[E.node.key])||E.node.key:((x=(L=E.column.colDef)==null?void 0:L.context)==null?void 0:x.dataType)==="number"?u!=null&&u.numberAsText?E.formatValue(E.value):E.value:T+(((A=(O=(S=E.node.rowGroupColumn)==null?void 0:S.colDef)==null?void 0:O.refData)==null?void 0:A[v])||E.formatValue(v)||v):((I=(w=E.column.colDef)==null?void 0:w.context)==null?void 0:I.dataType)==="number"?u!=null&&u.numberAsText?E.formatValue(E.value):E.value:((y=(k=E.column.colDef)==null?void 0:k.context)==null?void 0:y.dataType)==="boolean"?E.value?"R":"£":((N=(R=E.column.colDef)==null?void 0:R.context)==null?void 0:N.dataType)==="datetime"&&(u==null?void 0:u.dateAsText)!==!0?E.value?((b=(V=(U=E.column.colDef)==null?void 0:U.context)==null?void 0:V.columnConfig)==null?void 0:b.FORMAT_STRING)==="yyyy-MM-dd"||((z=(q=(W=E.column.colDef)==null?void 0:W.context)==null?void 0:q.columnConfig)==null?void 0:z.FORMAT_STRING)==="yyyy/MM/dd"?Y.getDateTimeByString(E.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):Y.getDateTimeByString(E.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":E.formatValue(E.value)||E.value}})};const i=[],l=[{label:Y.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"},{label:Y.$t("ERX.ErGrid.ExportOptionsDateAsText")||"日期以文本格式导出",value:"dateAsText"}],s=[{key:"fileName",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsFileName")||"文件名称",required:!0},{key:"sheetName",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsSheetName")||"Sheet名称",required:!0},{key:"contentTitle",type:"input",title:Y.$t("ERX.ErGrid.ExportOptionsContentTitle")||"内容标题",required:!1}];n!=null&&n.isCheckedRows&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),n!=null&&n.isBandView&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),e.getRowGroupColumns().length>0&&(l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"}),(n==null?void 0:n.skipGroupRows)!==!1&&i.push("skipGroupRows"),(n==null?void 0:n.skipSummaryRows)!==!1&&i.push("skipSummaryRows")),n!=null&&n.isShowFooter&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),((c=n==null?void 0:n.excelStyleConfig)==null?void 0:c.length)>0&&l.push({label:Y.$t("ERX.ErGrid.ExportOptionsIncludeCellStyle")||"包含样式",value:"includeCellStyle"}),n!=null&&n.dateAsText&&i.push("dateAsText"),n!=null&&n.numberAsText&&i.push("numberAsText"),n!=null&&n.skipFooterRows&&i.push("skipFooterRows"),n!=null&&n.includeCellStyle&&i.push("includeCellStyle"),Y.openSelectOptionsModal({title:Y.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:r.getDisplayedRowCount()>0?l:[],inputOptions:s,default:{checkboxOptions:i,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;a({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")}),a=void 0})}static exportMuiltiGridToExcel(r,e){let n=0;const a=[];r.forEach(i=>{const{gridApi:l,sheetName:s}=i;this.setGridColumnOptions(i.gridApi,d=>{var u,f,h;d.cellDataType==="number"?d.cellClass=e!=null&&e.numberAsText?"right-cell-string":"right-cell":((u=d.context)==null?void 0:u.dataType)==="datetime"&&(e==null?void 0:e.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=l==null?void 0:l.getSheetDataForExcel({sheetName:s||`Sheet${n+1}`,author:pt.UserId,skipPinnedBottom:!0,onlySelected:e==null?void 0:e.isCheckedRows,skipRowGroups:e==null?void 0:e.skipGroupRows,skipColumnGroupHeaders:e==null?void 0:e.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=>!!(e!=null&&e.skipSummaryRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level>=0||e!=null&&e.skipFooterRows&&d.node.footer===!0&&d.node.group===!0&&d.node.level<0),processCellCallback:d=>{var h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k,y;const u=Y.toString(d.value).includes("->")?" -> ":"",f=Y.toString(d.value).replace(u,"").trimStart();return d.value&&Ir.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:((E=(C=d.column.colDef)==null?void 0:C.context)==null?void 0:E.dataType)==="number"?e!=null&&e.numberAsText?d.formatValue(d.value):d.value:u+(((M=(v=(T=d.node.rowGroupColumn)==null?void 0:T.colDef)==null?void 0:v.refData)==null?void 0:M[f])||d.formatValue(f)||f):((F=(g=d.column.colDef)==null?void 0:g.context)==null?void 0:F.dataType)==="number"?e!=null&&e.numberAsText?d.formatValue(d.value):d.value:((L=(P=d.column.colDef)==null?void 0:P.context)==null?void 0:L.dataType)==="boolean"?d.value?"R":"£":((S=(x=d.column.colDef)==null?void 0:x.context)==null?void 0:S.dataType)==="datetime"&&(e==null?void 0:e.dateAsText)!==!0?d.value?((w=(A=(O=d.column.colDef)==null?void 0:O.context)==null?void 0:A.columnConfig)==null?void 0:w.FORMAT_STRING)==="yyyy-MM-dd"||((y=(k=(I=d.column.colDef)==null?void 0:I.context)==null?void 0:k.columnConfig)==null?void 0:y.FORMAT_STRING)==="yyyy/MM/dd"?Y.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDT00:00:00"):Y.getDateTimeByString(d.value,"Dayjs").format("YYYY-MM-DDTHH:mm:ss"):"":d.formatValue(d.value)||d.value}});a.push(c)}),a.length>0&&r[0].gridApi.exportMultipleSheetsAsExcel({data:a,fileName:(e==null?void 0:e.fileName)||"grid.xlsx"})}static setGridColumnOptions(r,e){if(r&&e instanceof Function){const n=i=>{var l;((l=i==null?void 0:i.children)==null?void 0:l.length)>0&&i.children.forEach(s=>{n(s)}),e(i)},a=r.getColumnDefs();a&&(a==null||a.forEach(i=>{n(i)}),r.setColumnDefs(a))}}}class Gr{static loading(r,e,n){const a=n||document.documentElement;this.spinTimeoutId!==null&&(clearTimeout(this.spinTimeoutId),this.spinTimeoutId=null),this.spinTimeoutId=setTimeout(()=>{var i,l;if(r)if(this.spinCurrentContainer)this.spinCurrentTarget!==a&&(this.spinCurrentContainer&&(o.render(null,this.spinCurrentContainer),(i=this.spinCurrentContainer.parentNode)==null||i.removeChild(this.spinCurrentContainer),this.spinCurrentContainer=null,this.spinVnode=null,this.spinCurrentTarget=null),this.loading(!0,e,a));else{const s=document.createElement("div");s.id=this.spinId,s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%";const c=o.createVNode(tt.Spin,{spinning:!0,tip:(e==null?void 0:e.text)??(e==null?void 0:e.tip),style:{display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.1)",zIndex:9999,width:"100%",height:"100%"}});a.style.position="relative",a.appendChild(s),o.render(c,s),this.spinCurrentContainer=s,this.spinVnode=c,this.spinCurrentTarget=a}else this.spinCurrentContainer&&(o.render(null,this.spinCurrentContainer),(l=this.spinCurrentContainer.parentNode)==null||l.removeChild(this.spinCurrentContainer),this.spinCurrentContainer=null,this.spinVnode=null,this.spinCurrentTarget=null)},(e==null?void 0:e.delay)||0)}static async callService(r,e,n){return new Promise((a,i)=>{var d;const l=(n==null?void 0:n.messageError)??!1;let s=new Yt.EiInfo;r.trim().length===0&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="No service available",a(s));const c=r.split(/[\/.]/).filter(u=>u.trim().length>0);c.length<2&&(s.SysInfo.Flag=-603,s.SysInfo.Msg="Service name error",a(s)),(d=n==null?void 0:n.loadingOptions)!=null&&d.show&&this.loading(!0,n==null?void 0:n.loadingOptions),n!=null&&n.toCamelCase&&Object.keys(e.getBlocks()).forEach(u=>{const f=e.getBlock(u),h=f.getBlockMeta().getMetas(),p=new Yt.EiBlockMeta(f.getBlockId());Object.keys(h).forEach(C=>{const E=new Yt.EiColumn(Y.camelCase(C));E.descName=h[C].name,E.type=h[C].type,p.addMeta(E)}),f.setBlockMeta(p)}),Yt.EiCommunicator.send(c[0],c[1],e,{onSuccess:u=>{this.loading(!1),s=u,s.getStatus()<0&&l&&Y.messageError(`service:${r}, sys.msg:${s.getMsg()}`,l==="modal"),a(s)},onFail:u=>{this.loading(!1),l&&Y.messageError(`service:${r}, sys.msg:${String(u)}`,l==="modal"),console.error(u),s.SysInfo.Flag=-603,s.SysInfo.Msg=u==null?void 0:u.message,a(s)}})})}static async callServiceEx(r,e,n){return new Promise(async(a,i)=>{const l=e.toEiInfo(),s=await this.callService(r,l,n),c=st.getInstance().mergeFromEiInfo(s);a(c)})}}fe(Gr,"spinId","er-global-spin"),fe(Gr,"spinCurrentContainer",null),fe(Gr,"spinVnode",null),fe(Gr,"spinCurrentTarget",null),fe(Gr,"spinTimeoutId",null);let un=(Jo=class extends Es{constructor(e){super();Qr(this,ln);Qr(this,xt,[]);Qr(this,Pn,[]);Qr(this,fn,[]);Qr(this,Xn,[]);Qr(this,qn,{});Qr(this,Br);Qr(this,Mn);Qr(this,wi,!1);Qr(this,Ii);Qr(this,Rr,[]);Qr(this,aa,{});Qr(this,Fi,{});fe(this,"tableName","");this.tableName="Table0",e=e||{schema:{}},this.init(e)}get options(){return We(this,Br)}get BingdingInfo(){return We(this,Rr)}get rowCount(){return We(this,xt).length}get Current(){return We(this,Mn)}get IsHierarchyTable(){var e,n,a,i;return Y.toString((n=(e=We(this,Br))==null?void 0:e.hierarchy)==null?void 0:n.parentField,!0).length>0&&Y.toString((i=(a=We(this,Br))==null?void 0:a.hierarchy)==null?void 0:i.primaryField,!0).length>0}init(e){e&&(ar(this,Br,e),ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,Mn,void 0),Rn(this,ln,D0).call(this))}clone(e){const n=new Jo({...We(this,Br)});return n.tableName=e||this.tableName,n}setBindingInfo(e,n,a,i){var l;e&&n&&n.trim().length>0&&!We(this,Rr).some(s=>{var c;return((c=s.formHelper)==null?void 0:c.FormId)===e.FormId&&s.configId===n})?We(this,Rr).push({formHelper:e,configId:n,dataTable:this,controlType:a}):(l=i==null?void 0:i.gridOptions)!=null&&l.api&&!We(this,Rr).some(s=>s.grid.gridId===i.gridId)&&(i.gridOptions.api.getBindingTable=()=>this,i.gridOptions.getRowId=s=>s.data.uid,i.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,i.gridId),i.gridOptions.context=i.gridOptions.context||{},i.gridOptions.context.focusRowId=u.id,i.gridOptions.context.focusColId=s.column.colId)}}),i.gridOptions.api.addEventListener("rowDataUpdated",s=>{if(s.api.getBindingTable){const c=s.api.getBindingTable();(c.rowsCount=0)&&(i.gridOptions.context=s.context||{},i.gridOptions.context.focusRowId="",i.gridOptions.context.focusColId="")}}),i.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)}),We(this,Rr).push({grid:i,dataTable:this,configId:i.gridId,controlType:a}))}removeBindingInfo(e,n,a){var i,l,s;for(let c=We(this,Rr).length-1;c>=0;c--)We(this,Rr)[c].configId===n&&((l=(i=We(this,Rr)[c])==null?void 0:i.formHelper)==null?void 0:l.FormId)===(e==null?void 0:e.FormId)?We(this,Rr).splice(c,1):(s=a==null?void 0:a.gridOptions)!=null&&s.api&&We(this,Rr)[c].grid.gridId===a.gridId&&(a.gridOptions.getBindingTable&&delete a.gridOptions.getBindingTable,a.gridOptions.getRowId=void 0,We(this,Rr).splice(c,1))}setEvent(e,n){e&&(We(this,Fi)[e]=n)}getEvent(e){return We(this,Fi)[e]}setAllowCancelChanges(e){return ar(this,Ii,e),this}addField(...e){if(e&&e.length>0&&(e.forEach(n=>{n.name&&We(this,Br).schema&&We(this,Br).schema[n.name]===void 0&&(We(this,Br).schema[n.name]=n)}),We(this,xt).length>0))for(let n=0;n<We(this,xt).length;n++)We(this,xt)[n].addField(...e);return this}removeField(...e){if(e&&e.length>0&&(e.forEach(n=>{n.name&&We(this,Br).schema&&We(this,Br).schema[n.name]===void 0&&delete We(this,Br).schema[n.name]}),We(this,xt).length>0))for(let n=0;n<We(this,xt).length;n++)We(this,xt)[n].reomveField(...e);return this}setField(e,n){var a,i;if((e==null?void 0:e.trim().length)>0&&((i=(a=We(this,Br))==null?void 0:a.schema)!=null&&i[e.trim()])&&n){const l=We(this,Br).schema[e.trim()];We(this,Br).schema[e.trim()]={...l,...n}}return this}get(e){for(let n=0;n<We(this,xt).length;n++)if(We(this,xt)[n].uid===e)return We(this,xt)[n]}getRows(e,n=!1){const a=[],i=l=>{n instanceof Function?a.push(n(l)||l.toJSON()):a.push(n?l.toJSON():l)};switch(e){case"created":{We(this,fn).forEach(l=>{i(l)});break}case"updated":{We(this,xt).forEach(l=>{l.dirty&&!l.isNew&&i(l)});break}case"removed":{We(this,Xn).forEach(l=>{i(l)});break}case"unchanged":{We(this,xt).forEach(l=>{!l.dirty&&!l.isNew&&i(l)});break}case"original":{We(this,Pn).forEach(l=>{!l.dirty&&!l.isNew&&i(l)});break}case"all":{We(this,xt).forEach(l=>{i(l)});break}}return a}at(e){return We(this,xt).at(e)}indexOf(e){var n;if(((n=e==null?void 0:e.uid)==null?void 0:n.length)>0){for(let a=0;a<We(this,xt).length;a++)if(We(this,xt)[a].uid===e.uid)return a}return-1}setCurrent(e,n){var s;const a={},i=((s=We(this,Mn))==null?void 0:s.uid)||"",l=(e==null?void 0:e.uid)||"";a.bindingInfo=We(this,Rr),a.oldCurrent=We(this,Mn),a.current=e,a.source=n,ar(this,Mn,e),i!==l&&Rn(this,ln,oa).call(this,"currentChanged",a)}insert(e,n,a){let i;return n&&(i=new Dr(n,We(this,Br).schema,this),a&&a.trim().length>0&&i[a]!==void 0&&(i[a]=Y.guid()),i.isNew=!0,We(this,xt).splice(e,0,i),We(this,fn).push(i),We(this,aa)[i.uid]=i,Rn(this,ln,oa).call(this,"dataInserted",{bindingInfo:We(this,Rr),insertAt:e,current:i}),this.setCurrent(i)),i}add(e,n){const a=new Dr(e,We(this,Br).schema,this);return n&&n.trim().length>0&&a[n]!==void 0&&(a[n]=Y.guid()),a.isNew=!0,We(this,xt).push(a),We(this,fn).push(a),We(this,aa)[a.uid]=a,Rn(this,ln,oa).call(this,"dataAdded",{bindingInfo:We(this,Rr),current:a}),this.setCurrent(a),a}import(e,n=-1,a=!0,i){const l=[];return(e==null?void 0:e.length)>0&&(e.forEach(s=>{if(s!=null){s instanceof Dr&&(s=s.toJSON());const c=new Dr(s,We(this,Br).schema,this);i&&i.trim().length>0&&c[i]!==void 0&&(c[i]=Y.guid()),c.isNew=a,l.push(c),We(this,aa)[c.uid]=c}}),n<0?We(this,xt).push(...l):We(this,xt).splice(n,0,...l),We(this,fn).push(...l),Rn(this,ln,oa).call(this,"dataImported",{bindingInfo:We(this,Rr),models:l,insertAt:n,current:l[e.length-1]}),this.setCurrent(l[e.length-1])),l}remove(e){if(!e)return;let n=[];e instanceof Array&&e.length>0?n=e:e&&(n=[e]);let a=!1;const i=[];if(n.length>0){let l=-1,s=-1;if(n.forEach(c=>{var d;if(l=We(this,xt).findIndex(u=>u.uid===c.uid),(s<0||l<s)&&(s=l),l!==-1){if(a||(a=We(this,xt)[l].uid===((d=We(this,Mn))==null?void 0:d.uid)),We(this,xt)[l].isNew){const u=We(this,fn).indexOf(We(this,xt)[l]);u>=0&&We(this,fn).splice(u,1)}else We(this,Xn).push(We(this,xt)[l]),We(this,qn)[We(this,xt)[l].uid]=We(this,Xn).length-1;i.push(We(this,xt)[l]),We(this,xt).splice(l,1),delete We(this,aa)[c.uid]}}),i.length>0&&Rn(this,ln,oa).call(this,"dataRemoved",{bindingInfo:We(this,Rr),models:i}),a){let c;We(this,xt).length>0&&(We(this,xt).length===s?c=We(this,xt)[s-1]:c=We(this,xt)[s]),this.setCurrent(c)}}}setRowState(e,n){let a=this.indexOf(e);if(a<0&&(We(this,xt).push(e),a=We(this,xt).length-1),a>=0){We(this,xt)[a].dirty=n==="updated",We(this,xt)[a].isNew=n==="added",n==="unchanged"&&(We(this,xt)[a].dirtyFields={},We(this,qn)[e.uid]!==void 0&&(delete We(this,qn)[e.uid],We(this,Xn).splice(We(this,qn)[e.uid],1)));const i=We(this,fn).findIndex(l=>l.uid===e.uid);n==="added"&&i<0?We(this,fn).push(e):i>=0&&We(this,fn).splice(i,1),Rn(this,ln,oa).call(this,"rowStateChanged",{bindingInfo:We(this,Rr),model:We(this,xt)[a],state:n})}}clear(){return ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,Mn,void 0),ar(this,aa,{}),Rn(this,ln,oa).call(this,"dataCleared",{bindingInfo:We(this,Rr)}),this}isRemoved(e){return typeof We(this,qn)[e]=="number"}merge(e,n=!0,a=!1){var s,c,d,u,f;const i=[],l=We(this,xt).length>0;if(n&&(ar(this,xt,[]),ar(this,Pn,[]),ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,aa,{})),e!==void 0&&e.length>0&&((s=this.options)!=null&&s.schema)){const h=this.options.schema,p=Object.keys(e[0]),C=Object.keys(h),E=C.filter(P=>p.includes(P)),T=C.filter(P=>!p.includes(P)),v=new Map,M=Y.toString((d=(c=We(this,Br))==null?void 0:c.hierarchy)==null?void 0:d.primaryField,!0),g=Y.toString((f=(u=We(this,Br))==null?void 0:u.hierarchy)==null?void 0:f.parentField,!0),F=M.length>0&&g.length>0&&h[M]&&h[g];for(let P=0;P<e.length;P++){const L=new Dr(void 0,void 0,this);L.setSchema(h,!1),E.forEach(x=>{var S,O;switch(h[x].type){case"datetime":case"time":L[x]=Y.toDateTime(e[P][x],"Dayjs");break;case"boolean":L[x]=Y.toBoolean(e[P][x]);break;case"number":L[x]=Y.toNumber(e[P][x]);break;case"string":h[x].RGBA?((S=e[P][x])==null?void 0:S.trim().length)>0?L[x]=Y.toHexColor((O=e[P][x])==null?void 0:O.trim()):L[x]="#ffffff":L[x]=Y.toString(e[P][x],!0);break;default:L[x]=e[P][x];break}}),T.forEach(x=>{switch(h[x].type){case"datetime":case"time":L[x]=null;break;case"boolean":L[x]=!1;break;case"number":L[x]=0;break;case"string":L[x]="";break;default:L[x]=null;break}}),L.isNew=a,i.push(L),We(this,xt).push(L),We(this,aa)[L.uid]=L,F&&L[M]&&v.set(L[M],L)}if(F){const P=L=>{const x=[];for(;L;)x.unshift(L[M]),L=v.get(L[g]);return x};for(let L=0;L<We(this,xt).length;L++)We(this,xt)[L][pt.TreeHierarchyFieldName]=P(We(this,xt)[L])}Rn(this,ln,D0).call(this),ar(this,Mn,We(this,xt)[0]),Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:i,current:We(this,xt)[0]})}else ar(this,Mn,void 0),l&&Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:i,current:void 0});return i}hasChanges(){if(We(this,Xn).length)return!0;for(let e=0;e<We(this,xt).length;e++)if(We(this,xt)[e].isNew||We(this,xt)[e].dirty)return!0;return!1}acceptChanges(){return ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),We(this,xt).forEach(e=>{e.isNew=!1,e.dirty=!1,e.dirtyFields={}}),Rn(this,ln,D0).call(this),Rn(this,ln,oa).call(this,"acceptChanges",{bindingInfo:We(this,Rr),models:We(this,xt),current:void 0}),this}cancelChanges(){return We(this,wi)&&(ar(this,fn,[]),ar(this,Xn,[]),ar(this,qn,{}),ar(this,aa,{}),ar(this,xt,Ir.cloneDeep(We(this,Pn))),We(this,xt).forEach(e=>{We(this,aa)[e.uid]=e}),Rn(this,ln,oa).call(this,"dataMerged",{bindingInfo:We(this,Rr),models:We(this,xt),current:void 0})),this}totalCount(){return We(this,xt).length}data(e){return e!==void 0&&e.length>0&&this.merge(e,!0,!1),We(this,xt)}originalCopy(){return Ir.cloneDeep(We(this,Pn))}originalModel(e){for(let n=0;n<We(this,Pn).length;n++)if(We(this,Pn)[n].uid===e)return Ir.cloneDeep(We(this,Pn)[n])}static convertDataType(e,n,a,i="all"){var l,s,c;if(i=i||"all",e&&e.length>0&&n&&n.options.schema){const d=n.options.schema,u=Object.keys(e[0]),f=[],h=[],p=[],C={};for(const E of u)((l=d[E])==null?void 0:l.type)==="boolean"&&(i==="all"||i==="boolean")?f.push(E):((s=d[E])==null?void 0:s.type)==="datetime"&&(i==="all"||i==="datetime")?h.push(E):((c=d[E])==null?void 0:c.type)==="number"&&typeof e[0][E]!="number"&&p.push(E);a==="strongly"&&Object.keys(d).forEach(E=>{e[0][E]===void 0&&(d[E].type==="datetime"?C[E]=null:d[E].type==="boolean"?C[E]=d[E].default?d[E].default:!1:d[E].type==="number"?C[E]=Y.toNumber(d[E].default):C[E]="")});for(let E=0;E<e.length;E++){e[E]instanceof Dr&&(e[E]=e[E].toJSON());for(const T of f)if(a==="weakly")e[E][T]=e[E][T]?"1":"0";else{const v=Y.toString(e[E][T],!0,"toLower");e[E][T]=v.length>0&&v!=="0"&&v!=="false"}for(const T of h)Y.toString(e[E][T],!0).length>0?a==="weakly"?(e[E][T]=Y.getDateTimeFormatString(e[E][T],"yyyyMMddHHmmss"),(e[E][T].substring(0,4)==="1901"||e[E][T].substring(0,4)==="0001")&&(e[E][T]=null)):e[E][T]=Y.toDateTime(e[E][T]):e[E][T]=null;for(const T of p)e[E][T]=Y.toNumber(e[E][T]);a==="strongly"&&C&&(e[E]={...C,...e[E]})}}return e}static async createDataTable(e,n,a){let i;const l=st.buildMap({QUERY_TYPE:"tsi00datatable",DATASET_NAME:n,TABLE_NAME:a}),s=await Gr.callServiceEx(pt.queryDevConfigService,l,{partition:e}),c={},d=s.getMapData("TSI00DATATABLE");if((d==null?void 0:d.length)>0){const u={};d.forEach(f=>{if(f.TABLE_NAME===a.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=Y.toNumber(f.DEFAULT_VALUE);break;case"3":h.type="datetime",h.defaultValue=Y.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;case"4":h.type="boolean",h.defaultValue=Y.toBoolean(f.DEFAULT_VALUE);break;case"5":h.type="time",h.defaultValue=Y.getDateTimeByString(f.DEFAULT_VALUE,"Dayjs");break;default:h.type="string",h.defaultValue=Y.getSystemFormatString(f.DEFAULT_VALUE).trim();break}u[f.COL_NAME]=h}}),Object.keys(u).length>0&&(c.schema=u,i=new Jo(c))}return i||console.error(`ER: DataTable [${a}] creation failed!`),i}},xt=new WeakMap,Pn=new WeakMap,fn=new WeakMap,Xn=new WeakMap,qn=new WeakMap,Br=new WeakMap,Mn=new WeakMap,wi=new WeakMap,Ii=new WeakMap,Rr=new WeakMap,aa=new WeakMap,Fi=new WeakMap,ln=new WeakSet,oa=function(e,n){var i;(i=We(this,Rr))==null||i.forEach(l=>{var s,c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w,I,k,y,R,N,U,V,b,W,q,z,ee,Q,G,K,ie,J,te,H,Ee,Z,Ve,X,le,se,re,ve,be,_e,$e,Ce,Fe,De,Oe,Ie,Re,Ze,ge;if(l.formHelper&&l.configId||(c=(s=l.grid)==null?void 0:s.gridOptions)!=null&&c.api)if(l.controlType==="Grid"){const oe=l.grid||((d=l.formHelper)==null?void 0:d.getGrid(l.configId));if((u=oe==null?void 0:oe.gridOptions)!=null&&u.api)switch(e){case"dataMerged":{const ye=oe.gridOptions.api.getFilterModel(),Me=oe.gridOptions.columnApi.getColumnState().filter(St=>St.sort!==null);oe.gridOptions.context=oe.gridOptions.context||{},Object.keys(ye).length===0&&Me.length===0&&oe.gridOptions.context.calculateRowSpan&&oe.gridOptions.context.calculateRowSpan instanceof Function&&oe.gridOptions.context.calculateRowSpan(!0),(h=(f=oe.gridOptions)==null?void 0:f.api)==null||h.clearRangeSelection(),oe.gridOptions.context.focusRowId="",oe.gridOptions.context.focusColId="",oe.gridOptions.context.dataMerged=!0,(C=(p=oe.gridOptions)==null?void 0:p.api)==null||C.setRowData(We(this,xt)),We(this,xt).length>0&&Object.keys(ye).length===0&&Me.length===0?(ar(this,Mn,void 0),this.setCurrent(We(this,xt)[0])):(T=(E=oe.gridOptions)==null?void 0:E.api)==null||T.setFocusedCell(0,pt.GridCheckColumnFieldName);let Xe=We(this,xt).length.toString().length*7+20;((M=(v=oe.gridOptions.context)==null?void 0:v.viewConfig)==null?void 0:M.SHOW_SELECTION)==="1"&&(Xe+=20),(g=oe.gridOptions.context)!=null&&g.allowDragRow&&(Xe+=21),((P=(F=oe.gridOptions.context)==null?void 0:F.options)==null?void 0:P.masterDetail)===!0&&(Xe+=22);const mt=(x=(L=oe.gridOptions.columnApi)==null?void 0:L.columnModel)==null?void 0:x.gridColumns,et=mt==null?void 0:mt.find(St=>St.colId===pt.GridCheckColumnFieldName);et&&oe.gridOptions.columnApi.setColumnWidth(et,Xe),(S=l.formHelper)==null||S.setGridOptions(l.configId,"advanceFilterTemplateBillNo","",!0);break}case"dataCleared":{(A=(O=oe.gridOptions)==null?void 0:O.api)==null||A.setRowData([]);break}case"dataRemoved":{if(oe.gridOptions.api.applyTransaction({remove:n.models}),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(w=ye==null?void 0:ye.rootNode)==null?void 0:w.aggData,pinndeRowType:"ErGridSummaryFooter"}])}if(((k=(I=oe.gridOptions.context)==null?void 0:I.options)==null?void 0:k.showRowNo)!==!1&&(oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),oe.gridOptions.context.focusRowId)){const ye=(y=oe==null?void 0:oe.gridOptions)==null?void 0:y.api.getRowNode(oe.gridOptions.context.focusRowId);ye&&(oe.gridOptions.context.focusRowId=ye.id,(R=oe.gridOptions.context)!=null&&R.focusColId||pt.GridCheckColumnFieldName,oe.gridOptions.context.focusColId||(oe.gridOptions.context.focusColId=pt.GridCheckColumnFieldName),cr.setGridFocusedCell(oe,ye.rowIndex,oe.gridOptions.context.focusColId))}break}case"dataAdded":{if(oe.gridOptions.api.applyTransaction({add:[n.current]}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((U=(N=oe.gridOptions.context)==null?void 0:N.viewConfig)==null?void 0:U.AUTO_SELECT_MODE)==="1"||((b=(V=oe.gridOptions.context)==null?void 0:V.viewConfig)==null?void 0:b.AUTO_SELECT_MODE)==="3"||((q=(W=oe.gridOptions.context)==null?void 0:W.options)==null?void 0:q.autoCheckNewRow)===!0)&&((z=l.formHelper)==null||z.checkGridRow(l.configId,n.current)),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(ee=ye==null?void 0:ye.rootNode)==null?void 0:ee.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataInserted":{if(n.insertAt>=0?oe.gridOptions.api.applyTransaction({add:[n.current],addIndex:n.insertAt}):oe.gridOptions.api.applyTransaction({add:[n.current]}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((G=(Q=oe.gridOptions.context)==null?void 0:Q.viewConfig)==null?void 0:G.AUTO_SELECT_MODE)==="1"||((ie=(K=oe.gridOptions.context)==null?void 0:K.viewConfig)==null?void 0:ie.AUTO_SELECT_MODE)==="3"||((te=(J=oe.gridOptions.context)==null?void 0:J.options)==null?void 0:te.autoCheckNewRow)===!0)&&l.formHelper.checkGridRow(l.configId,n.current),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(H=ye==null?void 0:ye.rootNode)==null?void 0:H.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"dataImported":{if(n.insertAt>=0?oe.gridOptions.api.applyTransaction({add:n.models,addIndex:n.insertAt}):oe.gridOptions.api.applyTransaction({add:n.models}),oe.gridOptions.api.refreshCells({columns:[pt.GridCheckColumnFieldName]}),(((Z=(Ee=oe.gridOptions.context)==null?void 0:Ee.viewConfig)==null?void 0:Z.AUTO_SELECT_MODE)==="1"||((X=(Ve=oe.gridOptions.context)==null?void 0:Ve.viewConfig)==null?void 0:X.AUTO_SELECT_MODE)==="3"||((se=(le=oe.gridOptions.context)==null?void 0:le.options)==null?void 0:se.autoCheckNewRow)===!0)&&l.formHelper.checkGridRow(l.configId,n.models),oe.gridOptions.api.getPinnedBottomRowCount()>0){oe.gridOptions.api.refreshClientSideRowModel("aggregate");const ye=oe.gridOptions.api.getModel();oe.gridOptions.api.setPinnedBottomRowData([{...(re=ye==null?void 0:ye.rootNode)==null?void 0:re.aggData,pinndeRowType:"ErGridSummaryFooter"}])}break}case"currentChanged":{if(We(this,Mn)&&n.source!==l.configId&&((be=(ve=oe.gridOptions.context)==null?void 0:ve.options)==null?void 0:be.suppressDefaultFocusedCell)!==!0){const ye=($e=oe==null?void 0:oe.gridOptions)==null?void 0:$e.api.getRowNode((_e=We(this,Mn))==null?void 0:_e.uid);if((Fe=(Ce=oe.gridOptions)==null?void 0:Ce.api)==null||Fe.clearFocusedCell(),ye){const Me=((De=oe.gridOptions.context)==null?void 0:De.focusColId)||pt.GridCheckColumnFieldName;cr.setGridFocusedCell(oe,ye.rowIndex,Me)}}break}case"rowStateChanged":{if(n.model){const ye=(Oe=oe==null?void 0:oe.gridOptions)==null?void 0:Oe.api.getRowNode(n.model.uid);ye&&((Re=(Ie=oe.gridOptions)==null?void 0:Ie.api)==null||Re.redrawRows({rowNodes:[ye]}))}break}case"acceptChanges":{this.hasChanges()&&((ge=(Ze=oe.gridOptions)==null?void 0:Ze.api)==null||ge.redrawRows());break}}}else l.controlType==="Layout"&&(e==="currentChanged"||e==="dataMerged"||e==="dataCleared")&&l.formHelper.refreshLayoutBindModel(l.configId)});const a=We(this,Fi)[e];a&&a instanceof Function&&a(n)},D0=function(){We(this,Ii)||We(this,Ii)===void 0&&We(this,xt).length<=200?(ar(this,Pn,Ir.cloneDeep(We(this,xt))),ar(this,wi,!0)):(ar(this,Pn,[]),ar(this,wi,!1))},Jo),Qu=class{constructor(r){fe(this,"dataSetName","");fe(this,"dataTables");fe(this,"relations");this.dataTables={},this.relations={},this.dataSetName=(r==null?void 0:r.trim())||""}get Name(){return this.dataSetName}setName(r){return this.dataSetName=(r==null?void 0:r.trim())||"",this}addDataTable(r,e){return e.tableName=r,this.dataTables[r]=e,this}removeDataTable(r){return this.contains(r)&&delete this.dataTables[r.trim()],this}renameDataTable(r,e){return this.contains(r)&&!this.contains(e)&&r.trim().toUpperCase()!==e.trim().toUpperCase()&&(this.addDataTable(e.trim().toUpperCase(),this.dataTables[r.trim().toUpperCase()]),delete this.dataTables[r.trim().toUpperCase()]),this}copyDataTable(r,e){let n,a;return r instanceof un?n=r:typeof r=="string"&&(n=this.dataTables[r]),n&&n.options&&(a=new un({...n.options})),e&&e.trim().length>0&&!this.contains(e)&&(this.dataTables[e.trim()]=a),a}cloneDataTable(r,e){const n=this.copyDataTable(r,e);return n.data([]),n}getDataTable(r){return this.dataTables[r]}getTableName(r){let e;return Object.keys(this.dataTables).every(n=>this.dataTables[n]===r?(e=n,!1):!0),e}clear(...r){let e=Object.keys(this.dataTables);return r.length>0&&(e=r),e.forEach(n=>{this.dataTables[n]&&this.dataTables[n]instanceof un&&this.dataTables[n].clear()}),this}mergeData(r,e,n=!0,a=!1){return(r==null?void 0:r.trim().length)>0&&this.contains(r.trim())&&e&&this.dataTables[r].merge(e,n,a),this}getCurrentDataObject(r){let e;return(r==null?void 0:r.trim().length)>0&&this.contains(r.trim())&&(e=this.dataTables[r].Current),e}tablesCount(){return this.dataTables?Object.keys(this.dataTables).length:0}contains(r){return r&&r.trim().length>0?this.dataTables[r.trim()]!==void 0:!1}isEmpty(){return!(this.dataTables&&Object.keys(this.dataTables).length>0)}hasChanges(r){if(this.dataTables){if(r&&r.trim().length>0&&this.dataTables[r.trim()])return this.dataTables[r.trim()].hasChanges();{const n=Object.keys(this.dataTables);for(let a=0;a<n.length;a++)if(this.dataTables[n[a]].hasChanges())return!0}}return!1}hasRelation(r){return this.dataTables&&r&&r.trim().length>0&&this.relations[r.trim()]&&this.relations[r.trim()].length>0}acceptChanges(){return Object.keys(this.dataTables).forEach(e=>{this.dataTables[e]&&this.dataTables[e]instanceof un&&this.dataTables[e].acceptChanges()}),this}},Oc=class{constructor(r){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",o.ref(!1));fe(this,"_options",o.reactive({title:"标题"}));fe(this,"_resolveDialogResult");fe(this,"_dialogReturnInfo");fe(this,"_events",{});fe(this,"_component");this.setOptions(r||{})}get WindowOpened(){return this._windowOpened}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}show(r,e=!0){return new Promise(async(n,a)=>{var i,l;if(this._app)this._windowOpened.value=!0;else{this._component||this._component||(this._component=await Promise.resolve().then(()=>Uy),(i=this._component)!=null&&i.default&&(this._component=this._component.default));const s=o.createApp(this._component,{popRichEditorProps:this,options:this._options,content:r});((l=this._options)==null?void 0:l.extension)==="dropdown"&&s.component("ag-grid-vue",fr.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:a}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}},ju=class{constructor(r,e,n,a,i){fe(this,"LayoutCaption",{});fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",o.ref(!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,"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",o.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=e,n&&(this._layoutConfigId=n),a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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(r,e){return new Promise((n,a)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(e==null?void 0:e.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d,u,f,h,p,C,E,T,v,M,g;if(i.flag===1){if(((c=(s=(l=this._formHelper)==null?void 0:l.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(F=>F.BUTTON_NAME==="btnOk"?(this.OkButtonService=F.SVC_NAME,!1):!0),((C=(p=(h=this._formHelper)==null?void 0:h.ConfigInfo)==null?void 0:p.TSI00GRIDVIEW)==null?void 0:C.length)>0)for(let F=0;F<((v=(T=(E=this._formHelper)==null?void 0:E.ConfigInfo)==null?void 0:T.TSI00GRIDVIEW)==null?void 0:v.length);F++){const P=(g=(M=this._formHelper)==null?void 0:M.ConfigInfo)==null?void 0:g.TSI00GRIDVIEW[F];F==0&&(this._mainLayoutId=P.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(P.FUNCTION_ID),this._layoutGroupInfo[P.FUNCTION_ID]=P}this._initializeFlag=1}}else{const F="ErPopFreeHelper initialize faild, error msg is ["+i.msg+"]";Y.messageError(F)}n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setSavePartition(r){this._savePartition=r,this._formHelper.setCustomPartition(r)}ReceiveData(r,e){return r&&r instanceof Dr&&(r=r.toJSON()),r&&Object.keys(r).length>0&&(this._receiveData=r,this._readOnlys=e),this._receiveData}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setValue(r,e=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,void 0,e),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,e,n){return new Promise((a,i)=>{const l=s=>{if(this.EditType==="Add"){const c=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={...c,...this._receiveData}}this.WindowOpened.value=!0};e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this.app?l():this.Initialize().then(async s=>{var u;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>By),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const c=o.createApp(this._component,{popFreeHelperProp:this,formWidth:this.getFormOption("width")??this.getFormOption("formWidth"),formHeight:this.getFormOption("height")??this.getFormOption("formHeight")});c.component("ag-grid-vue",fr.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),l()}),this._resolveDialogResult={resolve:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo={...this._dialogReturnInfo,...r}}};const Cs=Object.freeze(Object.defineProperty({__proto__:null,PopFreeHelper:ju},Symbol.toStringTag,{value:"Module"}));let Ku=class{constructor(r,e,n,a){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",o.ref(!1));fe(this,"_options",o.reactive({title:"标题",width:360,height:630}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"_primaryField");fe(this,"_parentField");fe(this,"_displayField");this._primaryField=r,this._parentField=e,this._displayField=n,this.setOptions(a||{})}get FormId(){return Y.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(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}receiveData(r){this._receiveData=r}show(r,e,n){return new Promise(async(a,i)=>{var l;if(e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this._app)this._windowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>qy),(l=this._component)!=null&&l.default&&(this._component=this._component.default)));const s=o.createApp(this._component,{popTreeHelperProp:this});s.component("ag-grid-vue",fr.AgGridVue),this._app=s;const c=document.createElement("div");document.body.appendChild(c),s.mount(c),this._windowOpened.value=!0}this._resolveDialogResult={resolve:a,reject:i}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}};const DC=Object.freeze(Object.defineProperty({__proto__:null,PopTreeHelper:Ku},Symbol.toStringTag,{value:"Module"}));let Ju=class{constructor(r,e,n,a,i){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",o.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",!0);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",o.reactive({groupDisplayType:"groupRows"}));fe(this,"DetailViewOptions",o.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",o.ref({}));fe(this,"_component");fe(this,"_resolveDialogResult");fe(this,"queryMainGridInfo",async(r=!0)=>{var i,l,s,c,d,u,f,h;const e=new st,n=this._formHelper.getAllControlValue(this.LayoutGroupFilterId,this.CustomFilterJson),a=this._formHelper.getAllControlValueAsFilterArray(this.LayoutGroupFilterId,this.CustomFilterJson);if(this.FormButtonQueryFilter.trim().length>0){const p=_.ER.Core.converCustomFilterToQueryFilter(this.FormButtonQueryFilter);p.length>0&&a.push(...p)}if(((i=this.CustomFilterString)==null?void 0:i.trim().length)>0){const p=_.ER.Core.converCustomFilterToQueryFilter(this.CustomFilterString);p.length>0&&a.push(...p)}if(e.addMapData("Table0",[n]),e.addMapData("QUERY_FILTER",a),((s=(l=this.MainViewOptions)==null?void 0:l.pageOptions)==null?void 0:s.pagination)==="server")this._formHelper.setServerPagingQuery(this.MainViewConfigId,e,p=>new Promise(async(C,E)=>{var P,L,x,S,O,A,w,I,k,y;const T=e.copy(),v={flag:-1,msg:"",data:void 0,total:0},g=(L=(P=this._formHelper.getGrid(this.MainViewConfigId).gridOptions.context)==null?void 0:P.pageOptions)==null?void 0:L.pageSize;let F;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)F=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:T,queryPage:p,pageSize:g});else if(((x=this._events)==null?void 0:x.query)instanceof Function)F=await this._events.query({queryHelper:this,queryFilter:T,queryPage:p,pageSize:g});else if(this.FormConfigQueryService.trim().length>0)T.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:g}]),F=await this._formHelper.callServiceEx(this.FormConfigQueryService.trim(),T);else if(this._queryService.trim().length>0){console.log("this._queryService",this._queryService);let R=pt.dynamicQueryService;const N=(O=(S=this._formHelper.ConfigInfo)==null?void 0:S.TSI00DATASOURCE)==null?void 0:O.find(U=>U.FUNC_ID===this._queryService);(N==null?void 0:N.ORIGIN_CODE)==="SVC"&&((A=N==null?void 0:N.SVC_NAME)==null?void 0:A.trim().length)>0?R=(w=N==null?void 0:N.SVC_NAME)==null?void 0:w.trim():(T.addMapData("DATA_SOURCE",[{FUNCTION_ID:(N==null?void 0:N.FUNC_ID)||this._queryService,COMPANY_CODE:pt.CompanyCode}]),R=((I=N==null?void 0:N.SVC_NAME)==null?void 0:I.trim())||pt.dynamicQueryService),T.addMapData("PAGEINFO",[{PAGE_NUM:p,PAGE_SIZE:g}]),F=await this._formHelper.callServiceEx(R,T)}else v.flag=-1,v.msg=this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务";if(F instanceof st)v.flag=F.sysFlag,v.msg=F.sysMsg,v.data=F.getMapData(0),v.total=F.getMapData(0).length,F.contains("PAGEINFO")&&(v.total=F.getMapData("PAGEINFO")[0].TOTAL_RECORD);else if(((k=F.sys)==null?void 0:k.status)>=0)v.flag=0,v.data=F.getBlock(0).data,v.total=F.getBlock(0).length,F.contains("PAGEINFO")&&(v.total=F.getMapData("PAGEINFO").data[0].TOTAL_RECORD||0);else if(F.getStatus instanceof Function&&F.getStatus()>=0){v.flag=F.getStatus(),v.msg=F.getMsg();const R=F.getBlock(this._mainTableame)??F.getBlock("TSI00RESULT")??F.getBlock("result");v.data=R.getMappedRows(),v.total=v.data.length,F.getBlock("PAGEINFO")&&(v.total=F.getBlock("PAGEINFO").getMappedRows()[0].TOTAL_RECORD||0)}else v.flag=-1,v.msg=((y=F.sys)==null?void 0:y.msg)||"";C(v)}));else{const p=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);p&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(T=>{T.trim().length>0&&p[T.trim().toUpperCase()]&&(this._keyFieldValue[T.trim().toUpperCase()]=p[T.trim().toUpperCase()])});let C;if(this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)C=await this.MainInfoQueryMethod({queryHelper:this,queryFilter:e});else if(((c=this._events)==null?void 0:c.query)instanceof Function)C=await this._events.query({queryHelper:this,queryFilter:e});else if(this.FormConfigQueryService.trim().length>0)C=await this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson);else if(this._queryService.trim().length>0){let E="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?E=this._serviceFilter+" and "+this.CustomFilterString:E=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(E=this._serviceFilter),C=await this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:E})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}if(C.sys&&((d=C.sys)==null?void 0:d.status)<0){this._formHelper.messageError(C.sys.msg);return}else if(C.getStatus instanceof Function&&C.getStatus()<0){this._formHelper.messageError(C.getMsg());return}else if(C.sysFlag!==void 0&&C.sysFlag<0){this._formHelper.messageError(C.sysMsg);return}else{let E=[];if(((u=C==null?void 0:C.sys)==null?void 0:u.status)>=0)E=C.contains(this._mainTableame)?(f=C.getBlock(this._mainTableame))==null?void 0:f.data:((h=C.getBlock(0))==null?void 0:h.data)??[];else if(C.getStatus instanceof Function&&C.getStatus()>=0){const v=C.getBlock(this._mainTableame)??C.getBlock("TSI00RESULT")??C.getBlock("result")??C.getBlockByIndex(0);E=(v==null?void 0:v.getMappedRows())??[]}else C.sysFlag>=0&&(E=C.getMapData(this._mainTableame)??C.getMapData("TSI00RESULT")??C.getMapData("result")??C.getMapData(0));this._formHelper.mergeDataToGrid(E,this.MainViewConfigId,!0);const T=E.length;T>0?(r&&this._formHelper.messageInfo(Y.$t("ERX.QueryResultWithRecords",[T.toString()])||Y.stringFormat("查询完成,共查询到[{0}]条数据",T)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue),this.autoCheckRows()):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}this.doEvent("afterQuery")}});fe(this,"autoCheckRows",()=>{var r,e;if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const n=this.ChooseKeyValues.trim().split(","),a=this.ErFormHelper.getGrid(this.MainViewConfigId);(e=(r=a==null?void 0:a.gridOptions)==null?void 0:r.api)==null||e.forEachLeafNode(i=>{n.includes(i.data[this.KeyFieldName])&&i.setSelected(!0)})}});this._initializeFlag=0,this._partition=r,this._formName=e,n&&(this._layoutConfigIds=n),a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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(r,e){return new Promise((n,a)=>{this._partition=r&&r.trim()||this._partition,this._serviceName=e&&e.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d;if(i.flag===1)if(((c=(s=(l=this._formHelper)==null?void 0:l.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",u.MULTI_SELECT_MODE=this.ShowCheckBoxColumn?"2":"1"),this._initializeFlag=1}else Y.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else Y.messageError("ErPopQueryHelper initialize faild, error msg is ["+i.msg+"]");n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions,...r})}getFormOption(r){return this._formOptions.value[r]}setQueryPartition(r){this._queryPartition=r,this._formHelper.setCustomPartition(r)}setEvent(r,e){this._events[r]=e}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}show(r,e,n){return new Promise((a,i)=>{e&&this.setEvent("ok",e),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async l=>{var d,u,f;if(this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>Wy),(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=o.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});s.component("ag-grid-vue",fr.AgGridVue),s.component("v-splitter",pn.Splitpanes),s.component("v-splitter-pane",pn.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:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}};const Zu=Object.freeze(Object.defineProperty({__proto__:null,PopQueryHelper:Ju},Symbol.toStringTag,{value:"Module"}));let wC=class{constructor(r,e,n,a,i){fe(this,"LayoutOptions",{});fe(this,"GridOptions",o.reactive({groupDisplayType:"groupRows"}));fe(this,"LayoutCaption");fe(this,"EditType","Add");fe(this,"Context",{});fe(this,"WindowOpened",o.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",o.ref({}));fe(this,"_resolveDialogResult");fe(this,"_component");this._initializeFlag=0,this._partition=r,this._formName=e,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,a&&a.trim().length>0&&(this._serviceName=a),this._sysConfiParas=i,this._formHelper=new _.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 r;return o.reactive(((r=this._dataSet)==null?void 0:r.getCurrentDataObject(this._mainTableName))||new Dr)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(r,e){return new Promise((n,a)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(e==null?void 0:e.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(i=>{var l,s,c,d,u,f;if(i.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=(l=this._formHelper)==null?void 0:l.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 ["+i.msg+"]";Y.messageError(h)}n(this._initializeFlag)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setSavePartition(r){this._savePartition=r,this._formHelper.setCustomPartition(r)}ReceiveData(r,e){this._receiveData=r,this._readOnlys=e}setEvent(r,e,n=!1){this._events[r]=e,this.PreventDefaultEvent[r]=n}getEvent(r){return this._events[r]}doEvent(r,e){const n=this._events[r];if(n)return n(e)}setValue(r,e=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,e),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,e,n){return new Promise((a,i)=>{const l=()=>{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};e&&this.setEvent("save",e),n&&this.setEvent("close",n),this.app?l():this.Initialize().then(async s=>{var u;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>ik),(u=this._component)!=null&&u.default&&(this._component=this._component.default))),this._initializeFlag=1,this.doEvent("initial",this);const c=o.createApp(this._component,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});c.component("ag-grid-vue",fr.AgGridVue),this.app=c;const d=document.createElement("div");document.body.appendChild(d),this.div=d,c.mount(d),l()}),this._resolveDialogResult={resolve:a,reject:i}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}};bt.locale("zh-cn");const IC=o.defineComponent({name:"DatetimeEditor",components:{"a-date-picker":tt.DatePicker,"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},directives:{focus:t=>{t.children&&o.nextTick(()=>{const r=_.ER.Core.jQuery(t.children);r==null||r.select()})}},props:["params"],setup:t=>{var S,O,A,w,I;const r=o.ref(null),e=o.ref(((O=(S=t.params.colDef.context)==null?void 0:S.columnConfig)==null?void 0:O.READ_ONLY)==="1"),n=((w=(A=t.params.colDef.context)==null?void 0:A.columnConfig)==null?void 0:w.MAX_LENGTH)||14,a=o.ref(_.ER.Core.toDateTime(t.params.value)),i=o.ref(t.params.max),l=o.ref(t.params.min),s=o.ref(t.params.showTime),c=o.ref(t.params.picker),d=t.params.dataType||"datetime",u=o.ref(!0),f=o.ref(!1),h=t.params.format||"YYYY-MM-DD HH:mm:ss",p=_.ER.Core.getDateTimeFormatString(t.params.value,h),C=o.ref(h),E=o.ref(Fr()),T=o.ref(zt());window.$wujie&&((I=window.$wujie.bus)==null||I.$on("changeThemeEmit",k=>{T.value=zt()}));const v=()=>{f.value=!0},M=()=>{if(d==="string"){const k=_.ER.Core.getDateTimeFormatString(a.value,"yyyyMMddHHmmss");return n>0&&k.length>n?k.substring(0,n):k}return _.ER.Core.toDateTime(a.value)},g=()=>!1,F=()=>!1,P=()=>{u.value=!1},L=()=>{u.value=!1,t.params.stopEditing()},x=k=>{k.key==="Escape"||k.key==="Tab"?u.value=!1:k.key==="Enter"&&(u.value=!u.value)};return o.onMounted(()=>{o.nextTick(()=>{if(!e){const k=_.ER.Core.jQuery(r.value);k==null||k.focus()}})}),{h:o.h,ER:_.ER,props:t,readOnly:e,readOnlyValue:p,value:a,dateInputRef:r,max:i,min:l,showTime:s,format:C,picker:c,open:u,antdLocale:E,antdTheme:T,invalid:f,setInvalid:v,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,onOk:P,onChange:L,onKeyDown:x,getValue:M,isCancelBeforeStart:g,isCancelAfterEnd:F}}}),yr=(t,r)=>{const e=t.__vccOpts||t;for(const[n,a]of r)e[n]=a;return e};function FC(t,r,e,n,a,i){const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-tooltip"),c=o.resolveComponent("a-time-picker"),d=o.resolveComponent("a-date-picker"),u=o.resolveComponent("a-config-provider"),f=o.resolveDirective("focus");return o.openBlock(),o.createBlock(u,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[t.readOnly?o.withDirectives((o.openBlock(),o.createBlock(l,{key:0,value:t.readOnlyValue,"allow-clear":!1,readOnly:!0},null,8,["value"])),[[f]]):t.props.params.type==="time"?(o.openBlock(),o.createBlock(c,{key:1,value:t.value,"onUpdate:value":r[0]||(r[0]=h=>t.value=h),ref:"dateInputRef",style:{width:"100%"},open:t.open,format:t.format,max:t.max,min:t.min,autofocus:!0,status:t.invalid?"error":void 0,onKeydown:t.onKeyDown,onChange:t.onChange,onOk:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prevIcon",fn:o.withCtx(()=>[o.createVNode(s,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","open","format","max","min","status","onKeydown","onChange","onOk"])):(o.openBlock(),o.createBlock(d,{key:2,value:t.value,"onUpdate:value":r[1]||(r[1]=h=>t.value=h),ref:"dateInputRef",style:{width:"100%"},picker:t.picker,open:t.open,format:t.format,max:t.max,min:t.min,"show-time":t.showTime,autofocus:!0,status:t.invalid?"error":void 0,onKeydown:t.onKeyDown,onChange:t.onChange,onOk:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prevIcon",fn:o.withCtx(()=>[o.createVNode(s,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.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 Dc=yr(IC,[["render",FC]]),AC=o.defineComponent({name:"DropdownEditor",components:{"a-button":tt.Button,"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},props:["params"],directives:{focus:t=>{t.children&&o.nextTick(()=>{const r=_.ER.Core.jQuery(t.children);r==null||r.select()})}},setup:t=>{var R,N,U,V,b,W,q,z,ee,Q;const r=o.ref(null),e=o.ref(t.params.multiple?"multiple":"single"),n=o.ref(((N=(R=t.params.colDef.context)==null?void 0:R.columnConfig)==null?void 0:N.READ_ONLY)==="1"),a=o.ref(t.params.value),i=o.ref(""),l=o.ref(""),s=o.ref(null),c=o.ref(""),d=[],u="DropdownEditor",f=(U=t.params.colDef.context)==null?void 0:U.iconUrlMap;let h=t.params.dataSource||[],p=t.params.displayColumns||[],C=t.params.valueField||"CODE",E=t.params.textField||"CODE_DESC_1_CONTENT",T=((q=(W=(b=(V=t.params.context)==null?void 0:V.columnConfig)==null?void 0:b[t.params.colDef.colId])==null?void 0:W.extendOptions)==null?void 0:q.showDropdownFilter)??((ee=(z=t.params.context)==null?void 0:z.options)==null?void 0:ee.showDropdownFilter)??5;T=typeof T=="number"&&T>=1?T:5;const v=o.ref(zt()),M=o.ref(Fr());window.$wujie&&((Q=window.$wujie.bus)==null||Q.$on("changeThemeEmit",G=>{v.value=zt()}));const g=()=>a.value,F=()=>n.value!==!0,P=G=>{c.value={...c.value,border:G}},L=()=>!1,x=()=>!1,S=G=>{var K,ie;if(G.event.key==="ArrowUp"||G.event.key==="ArrowDown"){const J=G.api.getFocusedCell();(J==null?void 0:J.rowIndex)>=0&&(a.value=(ie=(K=G.api.getModel())==null?void 0:K.getRow(J.rowIndex))==null?void 0:ie.data[C])}},O=G=>{r.value.gridOptions.api.setQuickFilter(G.target.value)},A=G=>{var K,ie,J;if((K=t.params)!=null&&K.allowNew&&((ie=t.params)==null?void 0:ie.multiple)!==!0)a.value=i.value,i.value="",t.params.stopEditing();else if(((J=t.params)==null?void 0:J.multiple)===!0){const te=r.value.gridOptions.api.getSelectedNodes();let H="";te.forEach(Ee=>{H=H.trim().length===0?_.ER.Core.toString(Ee.data[C]):H+","+_.ER.Core.toString(Ee.data[C])}),a.value=H,t.params.stopEditing()}},w=G=>{t.params.stopEditing()},I=(G,K)=>{const ie=document.createElement("div");ie.style.display="flex";let J;G.startsWith("IconFont:")?(G=G.replace("IconFont:",""),J=_.ER.Core.createErSvgElement(G)):G.startsWith("ImgUrl:")&&(G=G.replace("ImgUrl:",""),J=_.ER.Core.createRemoteImgElement(G)),J&&(J.style.paddingTop="1px",ie.appendChild(J));const te=document.createElement("span");return te.innerHTML=K,te.style.paddingLeft="3px",ie.appendChild(te),ie},k=G=>{var ie,J,te;const K=[];return G.api.getDisplayedRowCount()>0&&(K.push("copy","copyWithHeaders"),((J=(ie=G.columnApi)==null?void 0:ie.getRowGroupColumns())==null?void 0:J.length)>0&&K.push("separator","expandAll","contractAll")),(te=G.api)!=null&&te.isColumnFilterPresent()&&(K.push("separator"),K.push({name:_.ER.Core.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var H;(H=G.api)==null||H.setFilterModel(null)}})),K},y=G=>{var K,ie;if(G.event){const J=((K=G.api)==null?void 0:K.getCellRanges())||[];if(J.length===1&&J[0].columns.length===1&&J[0].columns[0].colId===_.ER.SysInfo.GridCheckColumnFieldName){const te=(ie=G.api)==null?void 0:ie.getModel();if(te){const H=[];for(let Ee=J[0].startRow.rowIndex;Ee<=J[0].endRow.rowIndex;Ee++){const Z=te.getRow(Ee);Z&&H.push(Z)}G.api.setNodesSelected({nodes:H,newValue:G.node.isSelected()})}}}};return o.onBeforeMount(()=>{var G,K,ie,J,te,H,Ee,Z,Ve,X,le;if(n.value===!1){const se=t.params.formHelper,re=(ie=(K=(G=t.params.context)==null?void 0:G.options)==null?void 0:K.dropdownFilter)==null?void 0:ie[t.params.colDef.colId];if(p.length>0)re instanceof Function&&(h=re({data:t.params.data,dataSource:h,value:t.params.value})),p.forEach((ve,be)=>{const _e={colId:ve.field,field:ve.field,tooltipField:ve.field,headerName:ve.headerName||ve.title,minWidth:150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};ve.field===C&&(_e.width=100,_e.minWidth=100,_e.maxWidth=200),d.push(_e)});else if((te=(J=se.DropDownBindSource)==null?void 0:J[t.params.configId])!=null&&te[t.params.colDef.colId]){const ve=se.DropDownBindSource[t.params.configId][t.params.colDef.colId],be=(H=t.params.colDef.context)==null?void 0:H.columnConfig;C=ve.dataValueField||"CODE",E=ve.dataTextField||"CODE_DESC_1_CONTENT",h=ve.dataSource;const _e=((Ee=be==null?void 0:be.FATHER_FIELD)==null?void 0:Ee.trim())||"",$e=((Z=be==null?void 0:be.FORM_FILTER)==null?void 0:Z.trim())||"",Ce=((Ve=be==null?void 0:be.LAYOUT_ID)==null?void 0:Ve.trim())||t.params.configId,Fe=((X=be==null?void 0:be.extendOptions)==null?void 0:X.dropdownOptions)||{};if(_e.length>0&&$e.length>0)if(Ce===t.params.configId&&t.params.data)h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,t.params.data[_e]||"");else{const De=se.getGrid(Ce);if(De){const Oe=se.getGridCurrentRow(De,!0);Oe&&(h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,Oe[_e]||""))}else{const Oe=se.getLayoutBindModel(Ce);Oe&&(h=se.filterDropDownCascaderDataSource(ve.dataSource,$e,Oe[_e]||""))}}re instanceof Function&&(h=re({data:t.params.data,dataSource:h,value:t.params.value})),((le=ve.columns)==null?void 0:le.length)>0&&ve.columns.forEach((De,Oe)=>{var Ze;const Ie={colId:De.field,field:De.field,tooltipField:De.field,headerName:De.title,minWidth:50,width:De.width||150,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};f&&Oe===0&&(Ie.cellRenderer=ge=>{var Me,Xe,mt,et;const oe=_.ER.Core.toString(ge.value).replace(/</g,"<"),ye=((Xe=(Me=ge==null?void 0:ge.data)==null?void 0:Me[C])==null?void 0:Xe.trim())||"";if(ye.length>0)return(mt=f[ye])!=null&&mt.trim().startsWith("IconFont:")||(et=f[ye])!=null&&et.startsWith("ImgUrl:")?I(f[ye],oe):oe});const Re=((Ze=Fe==null?void 0:Fe.wrapText)==null?void 0:Ze[Ie.field])??(Fe==null?void 0:Fe.wrapText);Ie.autoHeight=Ie.autoHeight||Re,Ie.wrapText=Ie.wrapText||Re,d.push(Ie)})}(h==null?void 0:h.length)>10&&(s.value={statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]})}else l.value=t.params.colDef.refData[t.params.value]||t.params.value}),o.onMounted(()=>{var G,K,ie,J,te,H,Ee,Z,Ve;if(!n.value){if(d.length===0){const re={colId:"CODE",field:"CODE",tooltipField:"CODE",headerName:_.ER.Core.$t("ERX.CodeColumn")||"代码",minWidth:100,width:100,maxWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T};f&&(re.cellRenderer=ve=>{var _e,$e,Ce;const be=_.ER.Core.toString(ve.value).replace(/</g,"<");if(((_e=ve.value)==null?void 0:_e.length)>0)return($e=f[ve.value])!=null&&$e.trim().startsWith("IconFont:")||(Ce=f[ve.value])!=null&&Ce.startsWith("ImgUrl:")?I(f[ve.value],be):be}),d.push(re),d.push({colId:"CODE_DESC_1_CONTENT",field:"CODE_DESC_1_CONTENT",tooltipField:"CODE_DESC_1_CONTENT",headerName:_.ER.Core.$t("ERX.DescriptionColumn")||"描述",width:200,minWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:h.length>=T})}let X=0;d.forEach(re=>{var ve,be;re.width=((be=(ve=t.params.colDef.context)==null?void 0:ve.popColumnsWidth)==null?void 0:be[re.colId])||re.width,X+=re.width||150}),t.params.multiple&&(d.unshift({colId:_.ER.SysInfo.GridCheckColumnFieldName,pinned:mn()?"right":"left",headerCheckboxSelection:re=>!0,headerCheckboxSelectionFilteredOnly:((G=t.params)==null?void 0:G.headerCheckboxSelectionFilteredOnly)??!0,checkboxSelection:re=>!re.node.group&&!re.node.footer,headerName:"",width:30,maxWidth:30,minWidth:30,suppressMenu:!0,resizable:!1,sortable:!1,lockPosition:mn()?"right":"left"}),X+=30);let le=15;(h==null?void 0:h.length)<15&&(le=(h==null?void 0:h.length)+2),le<5&&(le=5),(ie=(K=t.params.colDef)==null?void 0:K.context)!=null&&ie.popWidth&&(X=(te=(J=t.params.colDef)==null?void 0:J.context)==null?void 0:te.popWidth);const se=((Ee=(H=t.params.colDef)==null?void 0:H.context)==null?void 0:Ee.popHeight)||le*25+15;if(c.value={resize:"both",overflow:"auto",height:se+"px",width:X+"px"},r.value.gridOptions.api.selectionService.rowSelection=t.params.multiple?"multiple":"single",r.value.gridOptions.enableRangeSelection=!0,r.value.gridOptions.enableRangeHandle=!0,r.value.gridOptions.debounceVerticalScrollbar=!0,r.value.gridOptions.enableBrowserTooltips=!0,r.value.gridOptions.headerHeight=d.length===1&&h.length<T?0:void 0,r.value.gridOptions.api.setColumnDefs(d),r.value.gridOptions.api.setRowData(h),r.value.gridOptions.api.addEventListener("columnResized",re=>{var ve;t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popColumnsWidth=t.params.colDef.context.popColumnsWidth||{},(ve=re.columns)==null||ve.forEach(be=>{t.params.colDef.context.popColumnsWidth[be.colId]=be.actualWidth})}),!t.params.multiple&&((Ve=(Z=t.params.colDef.context)==null?void 0:Z.columnConfig)==null?void 0:Ve.ADD_EMPTY_ITEM)==="1"){const re={};re[C]="",r.value.gridOptions.api.setPinnedTopRowData([re])}t.params.multiple||r.value.gridOptions.api.addEventListener("cellClicked",re=>{a.value=re.data[C],t.params.stopEditing()}),r.value.gridOptions.api.addEventListener("firstDataRendered",re=>{if(_.ER.Core.toString(a.value,!0).trim().length>0){const ve=_.ER.Core.toString(a.value,!0).split(",");let be=!1;re.api.forEachNodeAfterFilterAndSort(_e=>{ve.includes(_e.data[C])&&(_e.setSelected(!0),re.api.setFocusedCell(_e.rowIndex,E),be||re.api.ensureIndexVisible(_e.rowIndex,"top"),be=!0)})}}),o.nextTick(()=>{_.ER.Core.jQuery(r.value).focus(),new ResizeObserver(_.ER.Core.debounce(ve=>{var $e,Ce,Fe,De,Oe,Ie,Re,Ze;const be=((Ce=($e=ve[0])==null?void 0:$e.contentRect)==null?void 0:Ce.width)||0,_e=((De=(Fe=ve[0])==null?void 0:Fe.contentRect)==null?void 0:De.height)||0;be>0&&(t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popWidth=be),_e>0&&(t.params.colDef.context=t.params.colDef.context||{},t.params.colDef.context.popHeight=_e),(((Oe=t.params.colDef.context)==null?void 0:Oe.popColumnsWidth)===void 0||Object.keys(t.params.colDef.context.popColumnsWidth).length>0)&&((Ze=(Re=(Ie=r==null?void 0:r.value)==null?void 0:Ie.gridOptions)==null?void 0:Re.api)==null||Ze.sizeColumnsToFit())},200)).observe(document.querySelector("#dropdownEditorDiv"))})}}),{h:o.h,isRTL:mn,ER:_.ER,editorType:u,dropDownStyle:c,props:t,readOnly:n,value:a,newValue:i,displayText:l,statusBar:s,dropDownColumns:d,dropDownData:h,agGridVueDropdownRef:r,rowSelection:e,antdTheme:v,antdLocale:M,getAgLocaleText:Na,CheckCircleOutlined:rt.CheckCircleOutlined,CloseCircleOutlined:rt.CloseCircleOutlined,getContextMenuItems:k,setBorder:P,confirmClick:A,cancelClick:w,onCellKeyDown:S,getValue:g,isPopup:F,isCancelBeforeStart:L,isCancelAfterEnd:x,onFilterTextBoxChanged:O,onRowSelected:y}}}),MC={key:0},xC={style:{flex:1,width:"100%"}},RC={key:0,class:"gridDropDownEditorFooter"};function NC(t,r,e,n,a,i){var f,h,p;const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-config-provider"),c=o.resolveComponent("ag-grid-vue"),d=o.resolveComponent("a-button"),u=o.resolveDirective("focus");return t.readOnly?(o.openBlock(),o.createElementBlock("div",MC,[o.createVNode(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.withDirectives(o.createVNode(l,{value:t.displayText,"allow-clear":!1,readOnly:!0},null,8,["value"]),[[u]])]),_:1},8,["theme","locale"])])):(o.openBlock(),o.createElementBlock("div",{key:1,id:"dropdownEditorDiv",style:o.normalizeStyle([{display:"flex","flex-direction":"column",height:"100%"},t.dropDownStyle])},[o.createElementVNode("div",xC,[o.createVNode(c,{class:"ag-theme-balham",style:{height:"100%",width:"100%"},ref:"agGridVueDropdownRef",enableRtl:t.isRTL(),localeText:t.getAgLocaleText(),statusBar:t.statusBar,"row-selection":t.rowSelection,enableRangeSelection:t.props.params.multiple,rowMultiSelectWithClick:t.props.params.multiple,enableRangeHandle:t.props.params.multiple,suppressRowClickSelection:(f=t.props.params)==null?void 0:f.multiple,stopEditingWhenCellsLoseFocus:!0,enableBrowserTooltips:!0,getContextMenuItems:t.getContextMenuItems,onRowSelected:t.onRowSelected,onCellKeyDown:t.onCellKeyDown},null,8,["enableRtl","localeText","statusBar","row-selection","enableRangeSelection","rowMultiSelectWithClick","enableRangeHandle","suppressRowClickSelection","getContextMenuItems","onRowSelected","onCellKeyDown"])]),(h=t.props.params)!=null&&h.multiple||(p=t.props.params)!=null&&p.allowNew?(o.openBlock(),o.createElementBlock("div",RC,[o.createVNode(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var C,E;return[(C=t.props.params)!=null&&C.allowNew&&((E=t.props.params)==null?void 0:E.multiple)!==!0?(o.openBlock(),o.createBlock(l,{key:0,onPressEnter:t.confirmClick,placeholder:"请输入其他值",value:t.newValue,"onUpdate:value":r[0]||(r[0]=T=>t.newValue=T),"allow-clear":!0},null,8,["onPressEnter","value"])):o.createCommentVNode("",!0),o.createVNode(d,{type:"primary",class:"er-button",icon:t.h(t.CheckCircleOutlined),onClick:t.confirmClick},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.ER.Core.$t("ERX.Confirm")||"确定"),1)]),_:1},8,["icon","onClick"]),o.createVNode(d,{type:"primary",class:"er-button",icon:t.h(t.CloseCircleOutlined),onClick:t.cancelClick},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.ER.Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["icon","onClick"])]}),_:1},8,["theme","locale"])])):o.createCommentVNode("",!0)],4))}const Oa=yr(AC,[["render",NC]]),bC=o.defineComponent({name:"ButtonEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-input-group":tt.InputGroup,"a-input":tt.Input,"a-button":tt.Button,"a-tooltip":tt.Tooltip},setup:t=>{var p,C,E;const r=o.ref(null),e=o.ref(((C=(p=t.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:C.READ_ONLY)==="1"),n=o.ref(t.params.value),a=o.ref(!1),i=o.ref(Fr()),l=o.ref(zt());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",T=>{l.value=zt()}));const s=()=>n.value,c=()=>{a.value=!0},d=()=>!1,u=()=>!1,f=T=>{if(a.value=!1,_.ER.Core.toString(n,!0).length===0&&t.params.formHelper&&t.params.configId){T.params=t.params,T.isClear=!0;const v=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");if(v&&v instanceof Function&&v(T)===!1)return;t.params.stopEditing()}else if(t.params.maxLength>0){const v=T.target.value||"";let M="",g=0;for(let F=0;F<v.length;F++){const P=v.codePointAt(F);if(P>=128512&&P<=128591?g+=4:P>=19968&&P<=40959||P>=65280&&P<=65519?g+=2:g+=1,g>t.params.maxLength){n.value=M;break}M+=v[F]}}},h=async T=>{if(t.params.formHelper&&t.params.configId){T.params=t.params,t.params.event&&t.params.event instanceof Function&&await t.params.event(T);const v=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");if(v&&v instanceof Function&&v(T)===!1)return;t.params.stopEditing()}};return o.onMounted(()=>{o.nextTick(()=>{_.ER.Core.jQuery(r.value).focus()})}),{h:o.h,ER:_.ER,props:t,value:n,inputRef:r,readOnly:e,antdLocale:i,antdTheme:l,EllipsisOutlined:rt.EllipsisOutlined,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,onChange:f,setInvalid:c,getValue:s,addButtonClick:h,isCancelBeforeStart:d,isCancelAfterEnd:u}}});function kC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-button"),d=o.resolveComponent("a-input-group"),u=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(u,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(d,{style:{display:"flex","align-items":"center",width:"100%"},compact:""},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=f=>t.value=f),ref:"inputRef","allow-clear":!0,readOnly:t.readOnly,style:{flex:1},onChange:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","readOnly","onChange"]),o.createVNode(c,{style:{height:"22px !important",width:"23px","box-shadow":"none !important"},onClick:t.addButtonClick},{icon:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.EllipsisOutlined))))]),_:1},8,["onClick"])]),_:1})]),_:1},8,["theme","locale"])}const PC=yr(bC,[["render",kC]]),LC=o.defineComponent({name:"ColorEditor",props:["params"],components:{"a-input":tt.Input,"a-config-provider":tt.ConfigProvider},setup:t=>{var d;const r=o.ref(Fr()),e=o.ref(zt());window.$wujie&&((d=window.$wujie.bus)==null||d.$on("changeThemeEmit",u=>{e.value=zt()}));const n=o.ref(null),a=o.ref("#ffffff"),i=()=>a.value||"#ffffff",l=()=>!1,s=()=>!1,c=u=>{a.value="#ffffff"};return o.onBeforeMount(()=>{var u;if(((u=t.params.value)==null?void 0:u.trim().length)>0)a.value=_.ER.Core.toHexColor(t.params.value);else return"#ffffff"}),o.onMounted(()=>{}),{h:o.h,value:a,props:t,inputRef:n,antdLocale:r,antdTheme:e,clearButtonClick:c,getValue:i,isCancelBeforeStart:l,isCancelAfterEnd:s}}});function BC(t,r,e,n,a,i){const l=o.resolveComponent("a-input"),s=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(l,{ref:"inputRef",value:t.value,"onUpdate:value":r[1]||(r[1]=c=>t.value=c),style:{paddingTop:"0px",paddingBottom:"0px"},class:"er-color-picker","allow-clear":!0},{addonBefore:o.withCtx(()=>[o.createVNode(l,{type:"color",value:t.value,"onUpdate:value":r[0]||(r[0]=c=>t.value=c)},null,8,["value"])]),_:1},8,["value"])]),_:1},8,["theme","locale"])}const HC=yr(LC,[["render",BC]]),VC=o.defineComponent({name:"NumberEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-tooltip":tt.Tooltip,"a-input":tt.Input,"a-input-number":tt.InputNumber},setup:t=>{var p,C,E;const r=o.ref(null),e=o.ref(((C=(p=t.params.colDef.context)==null?void 0:p.columnConfig)==null?void 0:C.READ_ONLY)==="1"),n=o.ref(t.params.zeroDisplayEmpty!==!1&&t.params.value===0?"":t.params.value),a=o.ref(!1),i=t.params.eventKey||"",l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((E=window.$wujie.bus)==null||E.$on("changeThemeEmit",T=>{s.value=zt()}));const c=()=>n.value===""||n.value===void 0||isNaN(n.value)?null:_.ER.Core.toNumber(n.value),d=()=>{a.value=!0},u=()=>!1,f=()=>{const T=parseFloat(n.value);return t.params.min!==void 0&&T<t.params.min||t.params.max!==void 0&&T>t.params.max?(_.ER.Core.messageWarning((_.ER.Core.$t("ERX.InputValueOutOfRange")||"输入数值超出允许范围")+"["+t.params.min+","+t.params.max+"]"),!0):(a.value=!1,!1)},h=T=>{let v=T.target.value;if(v=v.replace(/(?!^-)[^\d.]/g,""),t.params.precision>=0&&v.includes(".")){const M=v.split(".");M[0]=M[0]||"0",t.params.precision===0?v=M[0]:(M[1]=M[1].slice(0,t.params.precision),v=`${M[0]}.${M[1]}`)}n.value=v};return o.onMounted(()=>{o.nextTick(()=>{const T=_.ER.Core.jQuery(r.value);T==null||T.focus(),i.length===1?n.value=i:T==null||T.select()})}),{h:o.h,ER:_.ER,props:t,readOnly:e,value:n,inputRef:r,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,onChange:h,setInvalid:d,getValue:c,isCancelBeforeStart:u,isCancelAfterEnd:f}}});function UC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-input-number"),d=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(d,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[t.props.params.showNumberControl!==!0?(o.openBlock(),o.createBlock(s,{key:0,value:t.value,"onUpdate:value":r[0]||(r[0]=u=>t.value=u),ref:"inputRef","allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,autofocus:!0,readOnly:t.readOnly,onChange:t.onChange},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange"])):o.createCommentVNode("",!0),t.props.params.showNumberControl===!0?(o.openBlock(),o.createBlock(c,{key:1,value:t.value,"onUpdate:value":r[1]||(r[1]=u=>t.value=u),ref:"inputRef",style:{width:"100%"},"allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,autofocus:!0,readonly:t.readOnly,controls:!0,step:t.props.params.step===!0?1:typeof t.props.params.step=="number"?t.props.params.step:1,formatter:t.props.params.formatter,parser:t.props.params.parser},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.ER.Core.$t("ERX.InputEmptyMessage")},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readonly","step","formatter","parser"])):o.createCommentVNode("",!0)]),_:1},8,["theme","locale"])}const wc=yr(VC,[["render",UC]]),GC=o.defineComponent({name:"TextEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-input":tt.Input,"a-tooltip":tt.Tooltip},setup:t=>{var v,M,g;const r=o.ref(null),e=o.ref(((M=(v=t.params.colDef.context)==null?void 0:v.columnConfig)==null?void 0:M.READ_ONLY)==="1"),n=o.ref(t.params.value||""),a=o.ref(!1),i=o.ref(""),l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((g=window.$wujie.bus)==null||g.$on("changeThemeEmit",F=>{s.value=zt()}));const c=t.params.eventKey||"",d=t.params.maxLength??-1,u=t.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{a.value=!0},p=()=>!1,C=()=>!1,E=F=>{a.value=!1;const P=F.target.value||"";if(d>0&&P.length>0){let L="",x=0;for(let S=0;S<P.length;S++){const O=P.codePointAt(S);if(O>=128512&&O<=128591?x+=4:O>=19968&&O<=40959||O>=65280&&O<=65519?x+=2:x+=1,x>d){n.value=L;break}L+=P[S]}}if((u==null?void 0:u.length)>0&&_.ER.Core.isValidRegex(u)&&!new RegExp(u).test(P)){a.value=!0,n.value=Array.from(n.value).filter(L=>new RegExp(u).test(L)).join(""),i.value=_.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}},T=F=>{a.value=!1};return o.onMounted(()=>{o.nextTick(()=>{var P;const F=_.ER.Core.jQuery(r.value);F==null||F.focus(),c.length===1?(n.value=c,(P=r.value)==null||P.setSelectionRange(1,1)):F==null||F.select()})}),{h:o.h,ER:_.ER,props:t,value:n,readOnly:e,inputRef:r,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,errorMessage:i,onChange:E,onKeydown:T,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:C}}});function $C(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-input"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=d=>t.value=d),ref:"inputRef","allow-clear":t.readOnly!==!0,status:t.invalid?"error":void 0,readOnly:t.readOnly,onChange:t.onChange,onKeydown:o.withKeys(t.onKeydown,["enter"])},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.errorMessage},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.ExclamationCircleOutlined,{style:{color:"red"}}))))]),_:1},8,["title"])]),key:"0"}:void 0]),1032,["value","allow-clear","status","readOnly","onChange","onKeydown"])]),_:1},8,["theme","locale"])}const Ic=yr(GC,[["render",$C]]),zC=o.defineComponent({name:"LargeTextEditor",props:["params"],components:{"a-config-provider":tt.ConfigProvider,"a-textarea":tt.Textarea,"a-tooltip":tt.Tooltip},setup:t=>{var g,F,P;const r=o.ref(null),e=o.ref(((F=(g=t.params.colDef.context)==null?void 0:g.columnConfig)==null?void 0:F.READ_ONLY)==="1"),n=o.ref(t.params.value||""),a=o.ref(!1),i=o.ref(""),l=o.ref(Fr()),s=o.ref(zt());window.$wujie&&((P=window.$wujie.bus)==null||P.$on("changeThemeEmit",L=>{s.value=zt()}));let c=!1;const d=t.params.maxLength??-1,u=t.params.pattern??"",f=()=>(n==null?void 0:n.value)||"",h=()=>{a.value=!0},p=()=>!1,C=()=>!1,E=L=>{L.key==="Enter"&&(c||L.shiftKey)&&L.stopPropagation()},T=()=>{c=!0},v=()=>{c=!1},M=L=>{a.value=!1;const x=L.target.value||"";if(d>0&&x.length>0){let S="",O=0;for(let A=0;A<x.length;A++){const w=x.codePointAt(A);if(w>=128512&&w<=128591?O+=4:w>=19968&&w<=40959||w>=65280&&w<=65519?O+=2:O+=1,O>d){n.value=S;break}S+=x[A]}}if((u==null?void 0:u.length)>0&&_.ER.Core.isValidRegex(u)&&!new RegExp(u).test(x)){a.value=!0,n.value=Array.from(n.value).filter(S=>new RegExp(u).test(S)).join(""),i.value=_.ER.Core.$t("ERX.InputValueNotMatchRegex")+`${u}`;return}};return o.onMounted(()=>{o.nextTick(()=>{const L=_.ER.Core.jQuery(r.value);L==null||L.focus(),L==null||L.select()})}),{h:o.h,ER:_.ER,props:t,value:n,inputRef:r,readOnly:e,antdLocale:l,antdTheme:s,ExclamationCircleOutlined:rt.ExclamationCircleOutlined,invalid:a,errorMessage:i,onChange:M,setInvalid:h,getValue:f,isCancelBeforeStart:p,isCancelAfterEnd:C,onCompositionstart:T,onCompositionend:v,onKeyDown:E}}});function YC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-textarea"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>[o.createVNode(s,{value:t.value,"onUpdate:value":r[0]||(r[0]=d=>t.value=d),ref:"inputRef",class:"grid-cell-editor-textarea","allow-clear":t.readOnly!==!0,maxlength:t.props.params.maxLength,status:t.invalid?"error":void 0,readOnly:t.readOnly===!0,rows:t.props.params.rows,cols:t.props.params.cols,"show-count":t.props.params.showCount,onKeydown:t.onKeyDown,onCompositionstart:t.onCompositionstart,onCompositionend:t.onCompositionend},o.createSlots({_:2},[t.invalid?{name:"prefix",fn:o.withCtx(()=>[o.createVNode(l,{title:t.errorMessage},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.h(t.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 _s=yr(zC,[["render",YC]]),WC=o.defineComponent({name:"ColorCell",props:["params"],setup:t=>{const r=o.ref("");return o.onMounted(()=>{var e;((e=t.params.value)==null?void 0:e.trim().length)>0&&(r.value=t.params.value==="255,255,255,1"?"":t.params.value)}),{ER:_.ER,value:r}}}),XC={style:{overflow:"hidden",textOverflow:"ellipsis"}};function qC(t,r,e,n,a,i){return o.openBlock(),o.createElementBlock("div",XC,[o.createElementVNode("span",{style:o.normalizeStyle({paddingRight:"5px",borderLeft:t.value.length>0?"10px solid "+t.ER.Core.toHexColor(t.value):""})},null,4),o.createTextVNode(o.toDisplayString(t.value),1)])}const QC=yr(WC,[["render",qC]]),jC=o.defineComponent({name:"ButtonGroup",components:{"a-button":tt.Button,"a-tooltip":tt.Tooltip,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{var l,s,c;const r=o.ref(Fr()),e=o.ref(zt()),n=t.params.columnConfig||{},a=[];(s=(l=t.params)==null?void 0:l.data)!=null&&s.uid&&t.params.buttons.forEach(d=>{var f,h;d.options=d.options||{},d.options.style={height:"16px !important",...d.options.style};const u=((f=d.options)==null?void 0:f.condition)||"";if((u==null?void 0:u.trim().length)>0){const p=((h=t.params.data)==null?void 0:h.toJSON())||{};_.ER.Core.checkExpressionValid(p,u)&&a.push(d)}else a.push(d)}),window.$wujie&&((c=window.$wujie.bus)==null||c.$on("changeThemeEmit",d=>{e.value=zt()}));const i=d=>{var u,f,h,p,C,E;if(t.params.formHelper&&t.params.configId){((u=d.name)==null?void 0:u.toLowerCase())==="addrow"||((f=d.name)==null?void 0:f.toLowerCase())==="newrow"?t.params.formHelper.addRowToGrid(t.params.configId):(((h=d.name)==null?void 0:h.toLowerCase())==="deleterow"||((p=d.name)==null?void 0:p.toLowerCase())==="removerow"||((C=d.name)==null?void 0:C.toLowerCase())==="delete"||((E=d.name)==null?void 0:E.toLowerCase())==="remove")&&t.params.formHelper.deleteGridRows(t.params.configId,!0,[t.params.data]);const T=t.params.formHelper.getGridCustomEvent(t.params.configId,"cellButtonClick");T&&T instanceof Function&&T({...t.params,button:d})}};return o.onMounted(()=>{}),{buttonClick:i,props:t,antdLocale:r,antdTheme:e,columnConfig:n,renderButton:a}}}),KC={key:0,class:"er-grid-button-group",style:{display:"flex","align-items":"center"}};function JC(t,r,e,n,a,i){const l=o.resolveComponent("a-tooltip"),s=o.resolveComponent("a-button"),c=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(c,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var d,u,f;return[!((d=t.props.params.node)!=null&&d.group)&&!((u=t.props.params.node)!=null&&u.rowPinned)?(o.openBlock(),o.createElementBlock("div",KC,[t.props.params.displayValue?(o.openBlock(),o.createBlock(l,{key:0,title:(f=t.props.params)==null?void 0:f.getValue()},{default:o.withCtx(()=>{var h;return[o.createElementVNode("div",null,o.toDisplayString((h=t.props.params)==null?void 0:h.getValue()),1)]}),_:1},8,["title"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.renderButton,(h,p)=>{var C;return o.openBlock(),o.createBlock(l,{key:h.name+"tooltip",title:(C=h.options)!=null&&C.showTooltip?h.caption:void 0},{default:o.withCtx(()=>{var E,T,v,M,g,F,P,L,x,S,O,A;return[o.createVNode(s,{type:((E=h.options)==null?void 0:E.type)||"link",icon:((T=h.options)==null?void 0:T.icon)||void 0,style:o.normalizeStyle((v=h.options)==null?void 0:v.style),ghost:((M=h.options)==null?void 0:M.ghost)===!0,loading:((g=h.options)==null?void 0:g.loading)===!0,shape:((F=h.options)==null?void 0:F.shape)||"default",block:((P=h.options)==null?void 0:P.block)===!0,danger:((L=h.options)==null?void 0:L.danger)===!0||((x=h.name)==null?void 0:x.toLowerCase())==="deleterow"||((S=h.name)==null?void 0:S.toLowerCase())==="removerow"||((O=h.name)==null?void 0:O.toLowerCase())==="delete"||((A=h.name)==null?void 0:A.toLowerCase())==="remove",onClick:w=>t.buttonClick({...h,data:t.props.params.data,index:p})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h.caption),1)]),_:2},1032,["type","icon","style","ghost","loading","shape","block","danger","onClick"])]}),_:2},1032,["title"])}),128))])):o.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const ZC=yr(jC,[["render",JC]]),e_=o.defineComponent({name:"ProgressBar",props:["params"],setup:t=>{const r=o.ref(t.params.value),e=o.ref(t.params.maxValue),n=o.ref(t.params.progressBarColor),a=()=>!t.params.value||t.params.value<=0||t.params.maxValue<=0?0:t.params.value/t.params.maxValue>=1?"100%":_.ER.Core.toString(_.ER.Core.toNumber(t.params.value)/_.ER.Core.toNumber(t.params.maxValue)*100)+"%",i=()=>t.params.value?t.params.value<=0||t.params.maxValue<=0?r:_.ER.Core.toString(_.ER.Core.round(t.params.value/t.params.maxValue*100,2))+"%":"";return o.onMounted(()=>{}),{value:r,maxValue:e,progressBarColor:n,percent:a,labelText:i,props:t,ER:_.ER}}}),t_={style:{width:"100%",height:"15px",position:"absolute",color:"",right:0,top:0,zIndex:1}};function r_(t,r,e,n,a,i){return t.value?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({width:"100%",height:"18px",backgroundColor:"transparent",borderColor:t.progressBarColor,position:"relative",borderStyle:"solid",borderWidth:"thin"})},[o.createElementVNode("div",t_,o.toDisplayString(t.labelText()),1),o.createElementVNode("div",{style:o.normalizeStyle({width:t.percent(),height:"100%",backgroundColor:t.progressBarColor,position:"absolute",left:0,right:0,top:0,bottom:0,transition:"width 10s ease-in-out",zIndex:0})},null,4)],4)):o.createCommentVNode("",!0)}const n_=yr(e_,[["render",r_]]),a_=o.defineComponent({name:"DefaultRender",components:{"a-tag":tt.Tag,"a-badge":tt.Badge,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{const r=t.params.click,e=o.ref({});t.params.color&&(e.value.color=t.params.color),t.params.backgroundColor&&(e.value.backgroundColor=t.params.backgroundColor),t.params.boderColor&&(e.value.boxShadow=`0 0 0 1px ${t.params.boderColor} inset`);const n=a=>{a.preventDefault(),r&&r instanceof Function&&r(t.params)};return o.onMounted(()=>{}),{props:t,ER:_.ER,navigateToLink:n,badgeNumberStyle:e}}}),o_={key:0,class:"er-grid-cell-image",style:{display:"inline-block"}},i_={key:0,class:"icon",fill:"currentColor"},l_=["xlink:href"],s_=["src"],c_=["href"];function d_(t,r,e,n,a,i){var c,d,u,f;const l=o.resolveComponent("a-tag"),s=o.resolveComponent("a-badge");return o.openBlock(),o.createElementBlock("div",{style:o.normalizeStyle({display:"block",textAlign:t.props.params.justifyContent==="flex-end"?"right":t.props.params.justifyContent==="center"?"center":"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"})},[t.props.params.svgIcon||t.props.params.imgIcon||t.props.params.fontIcon?(o.openBlock(),o.createElementBlock("div",o_,[t.props.params.svgIcon?(o.openBlock(),o.createElementBlock("svg",i_,[o.createElementVNode("use",{"xlink:href":t.props.params.svgIcon},null,8,l_)])):t.props.params.fontIcon?(o.openBlock(),o.createElementBlock("i",{key:1,class:o.normalizeClass(`iconfont icon-${t.props.params.fontIcon} er-iconfont`),style:o.normalizeStyle({height:"16px",width:"16px",fontSize:"14px",color:t.props.params.fontColor})},null,6)):(o.openBlock(),o.createElementBlock("img",{key:2,class:"er-remote-img",src:t.props.params.imgIcon},null,8,s_))])):o.createCommentVNode("",!0),((c=t.props.params.tagText)==null?void 0:c.trim().length)>0&&t.props.params.tagAfterText!==!0?(o.openBlock(),o.createBlock(l,{key:1,style:{display:"inline-block",height:"18px"},color:t.props.params.tagColor||"#87d068",bordered:t.props.params.tagBordered},{default:o.withCtx(()=>{var h;return[o.createTextVNode(o.toDisplayString((h=t.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["color","bordered"])):o.createCommentVNode("",!0),((d=t.props.params.badgeText)==null?void 0:d.trim().length)>0?(o.openBlock(),o.createBlock(s,{key:2,class:"er-badge",count:(u=t.props.params.badgeText)==null?void 0:u.trim(),"number-style":t.badgeNumberStyle,style:{display:"inline-block"}},null,8,["count","number-style"])):o.createCommentVNode("",!0),t.props.params.callFormLink?(o.openBlock(),o.createElementBlock("a",{key:3,onClick:r[0]||(r[0]=o.withModifiers((...h)=>t.navigateToLink&&t.navigateToLink(...h),["prevent"])),style:o.normalizeStyle([{display:"inline-block","text-decoration":"underline"},t.props.params.style])},o.toDisplayString(t.props.params.displayText),5)):t.ER.Core.isUrl(t.props.params.displayText)?(o.openBlock(),o.createElementBlock("a",{key:4,href:t.props.params.displayText,target:"_blank",style:{display:"inline-block"}},o.toDisplayString(t.props.params.displayText),9,c_)):(o.openBlock(),o.createElementBlock("span",{key:5,style:o.normalizeStyle([t.props.params.textStyle,{display:"inline-block"}])},o.toDisplayString(t.props.params.displayText),5)),((f=t.props.params.tagText)==null?void 0:f.trim().length)>0&&t.props.params.tagAfterText===!0?(o.openBlock(),o.createBlock(l,{key:6,style:o.normalizeStyle([{display:"inline-block",height:"18px","margin-left":"5px","padding-left":"1px","padding-right":"1px"},t.props.params.tagStyle]),color:t.props.params.tagColor||"#87d068",bordered:t.props.params.tagBordered},{default:o.withCtx(()=>{var h;return[o.createTextVNode(o.toDisplayString((h=t.props.params.tagText)==null?void 0:h.trim()),1)]}),_:1},8,["style","color","bordered"])):o.createCommentVNode("",!0)],4)}const e2=yr(a_,[["render",d_]]),u_=o.defineComponent({name:"ImagePreview",components:{"a-image":tt.Image},props:["params"],setup:t=>{const r=new _.ER.UploadHelper,e=o.ref("");return o.onMounted(async()=>{var n;if(t.params.data){if(t.params.data.imageBlobData)e.value=t.params.data.imageBlobData;else if(t.params.src&&t.params.src.split("/").length>1){const a=await r.downloadFile({key:t.params.src});a.flag&&((n=a.result)!=null&&n.data)&&(e.value=URL.createObjectURL(new Blob([a.result.data])),t.params.data.imageBlobData=e.value)}}}),o.onUnmounted(()=>{}),{props:t,imageUrl:e}}});function f_(t,r,e,n,a,i){const l=o.resolveComponent("a-image");return o.openBlock(),o.createElementBlock("div",null,[o.createVNode(l,{src:t.imageUrl||"https://www.antdv.com/#error",alt:"Blob Image",width:t.params.width||100,height:t.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 Fc=yr(u_,[["render",f_]]),h_=o.defineComponent({name:"SwitchRender",components:{"a-switch":tt.Switch,"a-config-provider":tt.ConfigProvider},props:["params"],setup:t=>{var u,f;const r=o.ref(Fr()),e=o.ref(zt()),n=t.params.colDef.cellDataType||"boolean",a=t.params.switchOptions||{},i=o.ref(t.params.value??!1);(n==="string"||n==="text")&&(a!=null&&a.onValue)&&(a!=null&&a.offValue)&&(i.value=t.params.value===(a==null?void 0:a.onValue));const l=o.ref(a==null?void 0:a.onText),s=o.ref(a==null?void 0:a.offText),c=((u=t.params.colDef.context)==null?void 0:u.editable)??!1;window.$wujie&&((f=window.$wujie.bus)==null||f.$on("changeThemeEmit",h=>{e.value=zt()}));const d=h=>{(n==="string"||n==="text")&&(a!=null&&a.onValue)&&(a!=null&&a.offValue)?t.params.setValue(h?a==null?void 0:a.onValue:a==null?void 0:a.offValue):t.params.setValue(i.value)};return o.onMounted(()=>{}),{props:t,antdLocale:r,antdTheme:e,checkedValue:i,editable:c,handleChange:d,checkedChildren:l,unCheckedChildren:s}}}),p_={key:0,style:{display:"flex"}};function m_(t,r,e,n,a,i){const l=o.resolveComponent("a-switch"),s=o.resolveComponent("a-config-provider");return o.openBlock(),o.createBlock(s,{theme:t.antdTheme,locale:t.antdLocale,componentSize:"small"},{default:o.withCtx(()=>{var c,d;return[!((c=t.props.params.node)!=null&&c.group)&&!((d=t.props.params.node)!=null&&d.rowPinned)?(o.openBlock(),o.createElementBlock("div",p_,[o.createVNode(l,{checked:t.checkedValue,"onUpdate:checked":r[0]||(r[0]=u=>t.checkedValue=u),disabled:!t.editable,"checked-children":t.checkedChildren,"un-checked-children":t.unCheckedChildren,onChange:t.handleChange},null,8,["checked","disabled","checked-children","un-checked-children","onChange"])])):o.createCommentVNode("",!0)]}),_:1},8,["theme","locale"])}const t2=yr(h_,[["render",m_]]),g_=o.defineComponent({name:"HeaderGroup",props:["params"],onMounted(){}}),E_={class:"ag-header-group-cell-label"},C_=["innerHTML"];function __(t,r,e,n,a,i){return o.openBlock(),o.createElementBlock("div",E_,[o.createElementVNode("div",{class:"er-header-group-text",innerHTML:t.params.displayName},null,8,C_)])}const T_=yr(g_,[["render",__],["__scopeId","data-v-dbd51531"]]),y_=o.defineComponent({name:"AggregationPanel",props:["params"],setup(t){var a,i;const r=((i=(a=t.params.options)==null?void 0:a.aggregation)==null?void 0:i.format)||"#,##0.######",e=o.reactive({}),n=()=>{var C;const l=(C=t.params.api)!=null&&C.rangeService?t.params.api.rangeService.getCellRanges():void 0;let s=new Er(0),c=0,d=0,u=2,f=null,h=null;const p={};l&&l.length>0&&l.forEach(E=>{let T=t.params.api.rangeService.getRangeStartRow(E);const v=t.params.api.rangeService.getRangeEndRow(E);for(;!(!T||t.params.api.rangeService.rowPositionUtils.before(v,T)||!E.columns);)E.columns.forEach(g=>{var x,S;if(T===null)return;const F=t.params.api.rangeService.cellPositionUtils.createId({rowPinned:T.rowPinned,column:g,rowIndex:T.rowIndex});if(p[F])return;p[F]=!0;const P=t.params.api.rowRenderer.getRowNode(T);if(!P)return;let L=t.params.api.valueService.getValue(g,P);(S=(x=g.colDef)==null?void 0:x.context)!=null&&S.hideContent&&(L="******"),!_.ER.Core.isNullOrEmpty(L)&&(c++,!(typeof L=="object"&&"value"in L&&(L=L.value,L===""))&&(typeof L=="string"&&(L=Number(L)),typeof L=="number"&&!isNaN(L)&&(new Er(L).decimalPlaces()>u&&(u=new Er(L).decimalPlaces()),s=s.add(L),(h===null||L>h)&&(h=L),(f===null||L<f)&&(f=L),d++)))}),T=t.params.api.rangeService.cellNavigationService.getRowBelow(T)}),d>1?(e.average={value:_.ER.Core.formatNumberValue(s.dividedBy(d).toDecimalPlaces(u).toNumber(),r),show:!0},e.sum={value:_.ER.Core.formatNumberValue(s.toNumber(),r),show:!0},e.min={value:_.ER.Core.formatNumberValue(f,r),show:!0},e.max={value:_.ER.Core.formatNumberValue(h,r),show:!0}):(delete e.average,delete e.sum,delete e.min,delete e.max),c>1?e.count={value:c,show:!0}:delete e.count};return{ER:_.ER,aggData:e,setAggData:n}}}),S_={class:"ag-status-panel ag-status-panel-aggregations"},v_={key:0,class:"ag-status-name-value"},O_={class:"ag-status-name-value-value"},D_={key:1,class:"ag-status-name-value"},w_={class:"ag-status-name-value-value"},I_={key:2,class:"ag-status-name-value"},F_={class:"ag-status-name-value-value"},A_={key:3,class:"ag-status-name-value"},M_={class:"ag-status-name-value-value"},x_={key:4,class:"ag-status-name-value"},R_={class:"ag-status-name-value-value"};function N_(t,r,e,n,a,i){var l,s,c,d,u,f,h,p,C,E;return o.openBlock(),o.createElementBlock("div",S_,[(l=t.aggData.average)!=null&&l.show?(o.openBlock(),o.createElementBlock("div",v_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Average")||"平均值")+":",1),o.createElementVNode("span",O_,o.toDisplayString((s=t.aggData.average)==null?void 0:s.value),1)])):o.createCommentVNode("",!0),(c=t.aggData.count)!=null&&c.show?(o.openBlock(),o.createElementBlock("div",D_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Count")||"计数")+":",1),o.createElementVNode("span",w_,o.toDisplayString((d=t.aggData.count)==null?void 0:d.value),1)])):o.createCommentVNode("",!0),(u=t.aggData.max)!=null&&u.show?(o.openBlock(),o.createElementBlock("div",I_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Max")||"最大值")+":",1),o.createElementVNode("span",F_,o.toDisplayString((f=t.aggData.max)==null?void 0:f.value),1)])):o.createCommentVNode("",!0),(h=t.aggData.min)!=null&&h.show?(o.openBlock(),o.createElementBlock("div",A_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Min")||"最小值")+":",1),o.createElementVNode("span",M_,o.toDisplayString((p=t.aggData.min)==null?void 0:p.value),1)])):o.createCommentVNode("",!0),(C=t.aggData.sum)!=null&&C.show?(o.openBlock(),o.createElementBlock("div",x_,[o.createElementVNode("span",null,o.toDisplayString(t.ER.Core.$t("ERX.Sum")||"总和")+":",1),o.createElementVNode("span",R_,o.toDisplayString((E=t.aggData.sum)==null?void 0:E.value),1)])):o.createCommentVNode("",!0)])}const r2=yr(y_,[["render",N_],["__scopeId","data-v-04a55dad"]]);let Ac=class{constructor(r){fe(this,"UnMountWhenCloseDialog",!0);fe(this,"_app");fe(this,"_options",{});fe(this,"_popWindowOpened",o.ref(!1));fe(this,"_component");this._options=r||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(r){this._options={...this._options,...r}}async showPopAttachment(r){var e;if(this._app)this._options.refreshKey=Y.guid(),this._popWindowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>dk),(e=this._component)!=null&&e.default&&(this._component=this._component.default)));const n=o.createApp(this._component,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=n;const a=document.createElement("div");document.body.appendChild(a),n.mount(a),this._popWindowOpened.value=!0}}},nl=class{static callMenuForm(r,e){}static callDialogForm(r,e,n,a){}static exportGridAsExcel(r,e,n){}static getImportExcelData(r){return Promise.resolve([])}},b_=class{constructor(r,e,n,a,i){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",o.reactive({}));fe(this,"_dropDownBindSource",{});fe(this,"_dropDownCascader",{});fe(this,"_gridOptions",{});fe(this,"_gridReactiveOptions",o.reactive({}));fe(this,"_gridToolbarOptions",o.reactive({}));fe(this,"_hiddenFields",{});fe(this,"_requiredFields",{});fe(this,"_requiredFieldsByCondition",{});fe(this,"_formDataSet",new Qu);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",o.reactive({}));fe(this,"_layoutItemOpitons",o.reactive({}));fe(this,"_layoutBindModelUid",o.reactive({}));fe(this,"_layoutBindModel",{});fe(this,"_controlConditionProps",{});fe(this,"_erxGlobalConfig",{});fe(this,"excuteGridColumnExpressions",(r,e)=>{const n={...r},a=Object.keys(n).sort((l,s)=>l.length>s.length?-1:l.length<s.length?1:0);let i=e;a.forEach(l=>{bt.isDayjs(n[l])?n[l]=n[l].toDate():(n[l]===null||n[l]===void 0)&&(n[l]="");const s=new RegExp(`\\b${l}\\b`,"gi"),c=new RegExp(`[${l}]`.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");c.test(i)?i=i.replaceAll(c,`data.${l}`):s.test(i)&&(i=i.replaceAll(s,`data.${l}`))});try{return new Function("data",i)(n)}catch{console.error("ER: Script has a syntax error: "+i+"; data: "+JSON.stringify(n))}});this._formId=Y.guid(),this._serverPartition=r||this._serverPartition,this._serviceName=n||this._serviceName,this._formName=e||this._formName,this._layoutIds=a,this._initialConfiParas=i,this._currentConfigCompanyCode={},this.SysDefinedParas={GroupCompanyCode:"BS",GroupCompanyName:"宝信软件",DefaultRmbCode:"CNY"}}get App(){return this._app}get Locale(){return Ai()}get IsRtl(){return mn()}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(r,e,n,a,i){var s,c,d,u;this._erxGlobalConfig=await Y.getErxGlobalConfig(),(c=(s=this._erxGlobalConfig)==null?void 0:s.License)!=null&&c[pt.CompanyCode]&&(this._formConfigLicens=(u=(d=this._erxGlobalConfig)==null?void 0:d.License)==null?void 0:u[pt.CompanyCode]);const l=Y.decryptData(this._formConfigLicens,pt.GridCheckColumnFieldName,Y.decryptData(this._privateEncryptKey,pt.GridCheckColumnFieldName,pt.GridCheckColumnFieldName));return this._erxGlobalConfig&&(!this._formConfigLicens||l!==pt.CompanyName)&&this.messageWarning(Y.decryptData(this._formConfigLicensErrorMsg,pt.GridCheckColumnFieldName,pt.GridCheckColumnFieldName)),new Promise((f,h)=>{var E;this._serverPartition=(r==null?void 0:r.trim())||this._serverPartition,this._serviceName=(a==null?void 0:a.trim())||this._serviceName,this._formName=(e==null?void 0:e.trim())||this._formName,this._initialConfiParas=i||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=Y.toString(i==null?void 0:i.dataSetName).trim()||((E=this._dataSetName)==null?void 0:E.trim())||"#";const C=st.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:pt.Culture,FUNCTION_IDS:p,DATASET_NAME:this._dataSetName,TABLE_NAMES:this._tableNames}],"Table0");this._initialConfiParas&&Object.keys(this._initialConfiParas).length>0&&C.addMapData("InitializeFormParas",Object.keys(this._initialConfiParas).map(T=>({PARA_NAME:T,PARA_VALUE:this._initialConfiParas?this._initialConfiParas[T]:""}))),Gr.callServiceEx(this._serviceName,C,{partition:this._serverPartition}).then(T=>{var v,M;T.sysFlag>=0?(T.dataMap.forEach((g,F)=>{this._configInfo[F]=g}),((M=(v=this._configInfo)==null?void 0:v.TSI00FORM)==null?void 0:M.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:T.sysMsg}))},T=>{f({...T,flag:-1,msg:T.msg||"unknown error"})})})}InitializeWithData(){var r,e,n,a,i;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=Y.toNumber(this._formInfo.FORM_WIDTH)||800,this._formHeight=Y.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=((r=this._formInfo.GROUP_COMPANY_CODE)==null?void 0:r.trim())||this._groupCompanyCode,this._groupCompanyName=((e=this._formInfo.GROUP_COMPANY_NAME)==null?void 0:e.trim())||this._groupCompanyName,this._configInfo[pt.SystemParamsBlockName]&&(this._systemInfo=this._configInfo[pt.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)),((i=(a=this._configInfo)==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0?(this.createDataSet(),this._configInfo.TSI00GRIDVIEW.forEach(l=>{this.setDropDownBindSourceAndRequiredFields(l)})):console.error("ER: No view configuration information found")}setMenuFormInstance(r){var e,n,a,i,l,s,c,d,u;if(r){const f=(e=r==null?void 0:r.attrs)==null?void 0:e.__eiInfo;this._currentFormRegitInfo.formEname=(n=f==null?void 0:f.extAttr)==null?void 0:n.efFormEname,this._currentFormRegitInfo.formCname=(a=f==null?void 0:f.extAttr)==null?void 0:a.efFormCname,this._currentFormRegitInfo.formLoadPath=(i=f==null?void 0:f.extAttr)==null?void 0:i.efFormLoadPath,this._currentFormRegitInfo.formInfo=f==null?void 0:f.extAttr,this._currentFormRegitInfo.formQueryParams=Y.getQueryParams((l=f==null?void 0:f.extAttr)==null?void 0:l.efFormLoadPath),this._currentFormRegitInfo.formButtons={},(c=(s=r==null?void 0:r.attrs)==null?void 0:s.__buttonsEi)!=null&&c.blocks&&Object.keys((u=(d=r==null?void 0:r.attrs)==null?void 0:d.__buttonsEi)==null?void 0:u.blocks).forEach(h=>{var p,C;this._currentFormRegitInfo.formButtons[h]=(C=(p=r==null?void 0:r.attrs)==null?void 0:p.__buttonsEi)==null?void 0:C.getBlock(h).getMappedRows(),this._formAuthButtons[h]=this._currentFormRegitInfo.formButtons[h]})}}async loadConfig(r,e){return new Promise((n,a)=>{var l,s;e={...this._initialConfiParas,...e};const i=r.trim().length>0?r.split(",").filter(c=>c.trim().length>0):[];if(i.length>0){const c=e.reload==="1"?i.join(","):i.filter(u=>!this.containsConfig(u.trim())).join(","),d=(c==null?void 0:c.length)>0?c.split(","):[];if(d.length>0){const u=st.buildMap([{DEFAULT_COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:this._formName,TYPE_CODE:pt.Culture,FUNCTION_IDS:c,DATASET_NAME:"#",TABLE_NAMES:"",EXIST_TABLES:((s=Object.keys((l=this._formDataSet)==null?void 0:l.dataTables))==null?void 0:s.join(","))||"",INI_FLAG:this._initializeFlag}],"Table0");e&&Object.keys(e).length>0&&u.addMapData("InitializeFormParas",Object.keys(e).map(f=>({PARA_NAME:f,PARA_VALUE:e?e[f]:""}))),Gr.callServiceEx(this._serviceName,u,{partition:this._serverPartition}).then(f=>{f.sysFlag>=0&&(f.dataMap.forEach((p,C)=>{[pt.SystemParamsBlockName,"TESCOMPANYINFO","TSI00FORM","TSI00DATASOURCE","TSI00DATATABLE","TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].includes(C)||(this._configInfo[C]=p)}),["TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDBAND","TSI00GRIDCONDITION"].forEach(p=>{if(f.contains(p)&&this._configInfo[p]&&f.getMapData(p).length>0){if((e==null?void 0:e.reload)==="1"&&this._configInfo[p].length>0)for(let C=this._configInfo[p].length-1;C>=0;C--)d.includes(this._configInfo[p][C].FUNCTION_ID)&&this._configInfo[p].splice(C,1);this._configInfo[p].push(...f.getMapData(p))}}),d.forEach(p=>{var T;(e==null?void 0:e.reload)==="1"&&(this._tempSingleConfigInfo[p]=void 0);const C=this.getSingleViewConfigInfo(p),E=Y.toString(C.TABLE_NAME).trim();if(C&&E.length>0&&!this._formDataSet.contains(E)){this._configInfo.TSI00DATATABLE.some(M=>M.TABLE_NAME===E)||f.getMapData("TSI00DATATABLE").length>0&&this._configInfo.TSI00DATATABLE.push(...f.getMapData("TSI00DATATABLE"));const v={};C.FUNCTION_TYPE==="T"&&((T=C.CURRENT_NODE_DESC)==null?void 0:T.trim().length)>0&&C.FATHER_NODE_DESC.trim().length>0&&(v.hierarchy={primaryField:C.CURRENT_NODE_DESC.trim(),parentField:C.CURRENT_NODE_DESC}),this.createDataTable(E,v)}this.setDropDownBindSourceAndRequiredFields(C)})),n({flag:f.sysFlag>=0?1:-1,msg:f.sysMsg})},f=>{n({...f,flag:-1,msg:"unknown error"})})}else n({flag:1,msg:"Configuration ["+r.trim()+"] already exists"})}else n({flag:-1,msg:"No config id"})})}$t(r,e){var a,i;let n;if((r==null?void 0:r.trim().length)>0){for(let l=0;l<((i=(a=this.ConfigInfo.TSI00FORMRESOURCE)==null?void 0:a.data)==null?void 0:i.length);l++)if(this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_CODE===r){n=this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_VALUE_RES||this.ConfigInfo.TSI00FORMRESOURCE.data[l].ITEM_VALUE;break}n=n??Y.$t(r,e)}return n??""}setFormCapiton(r){return this._formCaption=r,this}setFormOptions(r){return this._formOptions={...this._formOptions,...r},this}setDropDownBindSourceAndRequiredFields(r){const e={},n={},a=[],i=[],l=["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=pt.CompanyCode;r.MATCH_FLAG==="1"&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===r.FUNCTION_ID&&d.COMPANY_CODE===c&&(l.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length===0&&(s=this._configInfo.TSI00GRIDCOLUMN.filter(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;return d.FUNCTION_ID===r.FUNCTION_ID&&d.COMPANY_CODE===this.DefaultConfigCompanyCode&&(l.includes(u)||d.ITEM_MUST_FLAG==="1")})),s.length>0&&s.forEach(d=>{const u=(r.FUNCTION_TYPE==="F"?"F":"G")+d.COLUMN_EDIT;if(l.includes(u))if(d.ORIGIN_CODE!=="0"&&d.SVC_NAME.trim().length>0){if(e[d.ITEM_CODE]=this.setDropDownBindOptions(r.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=r.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=r.FUNCTION_TYPE,this._dropDownCascader[d.LAYOUT_ID.trim()+d.FATHER_FIELD.trim()].push(f)}n[d.ITEM_CODE]=Y.guid()}else console.warn(`ER: The dropdown data source for [${r.FUNCTION_ID}.${d.ITEM_CODE}] is not configured!`);d.ITEM_MUST_FLAG==="1"&&(d.MUST_INPUT_CONDITION.trim().length>0?i.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}):a.push({ITEM_CODE:d.ITEM_CODE,COL_CAPTION:d.COL_CAPTION,FIELD_NAME:d.FIELD_NAME}))})}this._dropDownRefreshKey[r.FUNCTION_ID]=n,this._dropDownBindSource[r.FUNCTION_ID]=e,this._requiredFields[r.FUNCTION_ID]=a,this._requiredFieldsByCondition[r.FUNCTION_ID]=i}setCustomPartition(r){return this._customPartition=r,this._customPartition}setLayoutCaption(r,e){this.setLayoutOptions(r,"layoutCaption",e)}getLayoutCaption(r){return Y.toString(this.getLayoutOptions(r,"layoutCaption"))}getLayoutBindModel(r){if(this._layoutBindModel[r]===void 0){const e=new Dr;e.uid="",this._layoutBindModel[r]=o.reactive(e)}return this._layoutBindModel[r]}refreshLayoutBindModel(r){const e=this.getBindingTable(r);let n=e==null?void 0:e.Current;n||(n=new Dr,n.uid=""),this._layoutBindModel[r]=o.reactive(n),this._layoutBindModelUid[r]=n.uid}setLayoutBindForm(r,e){this.setLayoutOptions(r,"bindForm",e)}getLayoutBindForm(r){return this.getLayoutOptions(r,"bindForm")}setLayoutOptions(r,e,n){return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(r=r.trim(),e=e.trim(),this._layoutOpitons[r]=this._layoutOpitons[r]||{},this._layoutOpitons[r][e]=n),this}getLayoutOptions(r,e){let n;return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(r=r.trim(),this._layoutOpitons[r]&&(n=this._layoutOpitons[r][e==null?void 0:e.trim()])),(n==null?void 0:n.value)!==void 0?n==null?void 0:n.value:n}setLayoutItemOption(r,e,n){return(r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&n&&(this._layoutItemOpitons[r]=this._layoutItemOpitons[r]||{},this._layoutItemOpitons[r][e]=this._layoutItemOpitons[r][e]||{},Object.keys(n).forEach(a=>{o.isRef(this._layoutItemOpitons[r][e][a])?this._layoutItemOpitons[r][e][a].value=n[a]:this._layoutItemOpitons[r][e][a]=o.ref(n[a])})),this}getLayoutItemOption(r,e,n){let a;return this._layoutItemOpitons[r]&&this._layoutItemOpitons[r][e]&&(a=this._layoutItemOpitons[r][e][n]),(a==null?void 0:a.value)!==void 0?a==null?void 0:a.value:a}setLayoutItemValidateRules(r,e,n,a=!1){if((r==null?void 0:r.trim().length)>0&&typeof e=="string"&&(e==null?void 0:e.trim().length)>0){const i=this.getLayoutBindForm(r);if(i!=null&&i.rulesRef)if(i.rulesRef[e]=i.rulesRef[e]||[],a&&i.rulesRef[e])if((n==null?void 0:n.length)>0){const l=[];n.forEach((s,c)=>{n[c].itemCode=e;let d=!1;for(let u=0;u<i.rulesRef[e].length;u++)if(i.rulesRef[e][u].customType===s.customType){i.rulesRef[e][u]=s,d=!0;break}d||l.push(s)}),l.length>0&&i.rulesRef[e].push(...l)}else i.rulesRef[e]=[];else i.rulesRef[e].push(...n)}return this}setLayoutItemValidator(r,e,n,a=!1){const i=[];return i.push({message:"",trigger:"change",itemCode:e,validator:(l,s)=>n instanceof Function?n(s)===!0?(l.message="",Promise.resolve()):(l.message=n(s)||"",Promise.reject(new Error("Invalid value"))):(l.message="",Promise.resolve())}),this.setLayoutItemValidateRules(r,e,i,a),this}setLayoutItemCaptionForeColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{i.trim().length>0&&this.setLayoutItemOption(r,i,{LabelForeColor:n})}),this}setLayoutItemCaptionBackColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{i.trim().length>0&&this.setLayoutItemOption(r,i,{LabelBackColor:n})}),this}setLayoutItemContentForeColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","erTreeSelect","erMultiTreeSelect","antInput","antInputNumber","antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(l)&&this.setControlCss(r,i,[{property:"color",value:n}]),this.setLayoutItemOption(r,i,{TextForeColor:n})}}),this}setLayoutItemContentBackColor(r,e,n){let a;return e instanceof Array?a=e:a=e.split(","),(a==null?void 0:a.length)>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");["erSelect","erMultiSelect","antSelect","antMultiSelect","antInput","antInputNumber"].includes(l)&&this.setControlCss(r,i,[{property:"background",value:n}]),this.setLayoutItemOption(r,i,{TextBackColor:n})}}),this}setLayoutConditionStyleConfigInfo(r,e,n){return this._layoutConditionStyleInfo[r]=this._layoutConditionStyleInfo[r]||{},this._layoutConditionStyleInfo[r][e]=n,this}setLayoutConditionStyle(r,e){if((r==null?void 0:r.trim().length)>0){const n=this.getLayoutBindModel(r);if(n&&this._layoutConditionStyleInfo[r==null?void 0:r.trim()]){const a=l=>{var c,d,u,f,h,p,C,E;const s=this._layoutConditionStyleInfo[r==null?void 0:r.trim()][l];s&&(Y.checkExpressionValid(n,Y.getSystemFormatString(s.condition))?(((c=s.labelForeColor)==null?void 0:c.trim().length)>0&&this.setLayoutItemCaptionForeColor(r,l,s.labelForeColor),((d=s.labelBackgroundColor)==null?void 0:d.trim().length)>0&&this.setLayoutItemCaptionBackColor(r,l,s.labelBackgroundColor),((u=s.textForeColor)==null?void 0:u.trim().length)>0&&this.setLayoutItemContentForeColor(r,l,s.textForeColor),((f=s.textBackgroundColor)==null?void 0:f.trim().length)>0&&this.setLayoutItemContentBackColor(r,l,s.textBackgroundColor)):(((h=s.labelForeColor)==null?void 0:h.trim().length)>0&&this.setLayoutItemCaptionForeColor(r,l,""),((p=s.labelBackgroundColor)==null?void 0:p.trim().length)>0&&this.setLayoutItemCaptionBackColor(r,l,""),((C=s.textForeColor)==null?void 0:C.trim().length)>0&&this.setLayoutItemContentForeColor(r,l,""),((E=s.textBackgroundColor)==null?void 0:E.trim().length)>0&&this.setLayoutItemContentBackColor(r,l,"")))};let i;e instanceof Array?i=e:e&&(e==null?void 0:e.trim().length)>0?i=e.split(","):i=Object.keys(this._layoutConditionStyleInfo[r]),(i==null?void 0:i.length)>0&&i.forEach(l=>{a(l)})}}return this}bindGridCustomEvent(r,e,n){return this._gridCustomEvent[r]=this._gridCustomEvent[r]||{},this._gridCustomEvent[r][e]=n,this}getGridCustomEvent(r,e){let n;return this._gridCustomEvent[r]&&this._gridCustomEvent[r][e]&&(n=this._gridCustomEvent[r][e]),n}getCompanyName(r){var n,a,i;let e="";return(r==null?void 0:r.trim().length)>0&&((n=this._configInfo.TESCOMPANYINFO)==null?void 0:n.length)>0&&(e=((i=(a=this._configInfo.TESCOMPANYINFO.find(l=>l.COMPANYCODE===r))==null?void 0:a.COMPANYNAME)==null?void 0:i.trim())||""),e}cloneTableForLayoutOrGrid(r,e,n){var a,i,l,s,c,d;if(this.InitializeFlag>0&&r.trim().length>0&&e.trim().length>0&&n.trim().length>0&&!((a=this._formDataSet)!=null&&a.contains(e.trim())))if(n=n.trim(),r=r.trim(),e=e.trim(),(i=this._formDataSet)!=null&&i.contains(r)||(r=this.getBindingTableName(r)),r.length>0&&((l=this._formDataSet)!=null&&l.contains(r))){const u=(s=this._formDataSet)==null?void 0:s.getDataTable(r),f=(c=this._formDataSet)==null?void 0:c.cloneDataTable(u,e);(d=this._formDataSet)==null||d.addDataTable(e,f),this._configInfo.TSI00GRIDVIEW.every(p=>p.FUNCTION_ID===n?(p.TABLE_NAME=e,!1):!0),this._formBindingRelation[n]=e;const h=this.getGrid(n);h&&(u==null||u.removeBindingInfo(this,n),h.gridOptions.context.bindingSource=f,h.gridOptions.context.bindTableName=e,f==null||f.setBindingInfo(this,n,"Grid"))}else this.messageError(`ER: The origin table [${r}] does not exist!`);return this}containsConfig(r){const e=this.getConfigInfo(r);return!!(e&&e.TSI00GRIDCOLUMN&&e.TSI00GRIDCOLUMN.length>0)}isEmptyConfig(r){return!this.containsConfig(r)}getConfigInfo(r,e=!1){let n={},a=pt.CompanyCode;if(this._tempSingleConfigInfo[r])n=this._tempSingleConfigInfo[r];else{let i=[];if(this._configInfo.TSI00GRIDVIEW&&(i=this._configInfo.TSI00GRIDVIEW.filter(l=>l.FUNCTION_ID===r),i.length>0)){n.TSI00GRIDVIEW=i;const l=n.TSI00GRIDVIEW.FUNCTION_TYPE,s=n.TSI00GRIDVIEW.MATCH_FLAG;this._configInfo.TSI00GRIDCOLUMN&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&(c.IS_VISIBLE==="1"||e===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMN.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.IS_VISIBLE==="1"||e===!1)),this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMN=i),this._configInfo.TSI00GRIDCOLUMNAUTH&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&(c.USER_ID===pt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMNAUTH.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&(c.USER_ID===pt.UserId||c.USER_ID==="*****")),this._currentConfigCompanyCode["TSI00GRIDCOLUMNAUTH"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNAUTH=i,i.length>0&&(this._itemAuthInfo[r]={},i.forEach(c=>{this._itemAuthInfo[r][c.ITEM_CODE]=this._itemAuthInfo[r][c.ITEM_CODE]||{},this._itemAuthInfo[r][c.ITEM_CODE][c.USER_ID]=c.AUTH_CODE}))),this._configInfo.TSI00GRIDCOLUMNURL&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDCOLUMNURL.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDCOLUMNURL"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDCOLUMNURL=i),this._configInfo.TSI00GRIDSTYLE&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDSTYLE.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.NTYPE.length>2&&c.NTYPE.substring(0,2).toUpperCase()==="W_"),this._currentConfigCompanyCode["TSI00GRIDSTYLE"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDSTYLE=i),this._configInfo.TSI00GRIDBAND&&l!=="F"&&(i=[],s==="1"&&(i=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===a),this._currentConfigCompanyCode["TSI00GRIDBAND"+r]=a),i.length===0&&(i=this._configInfo.TSI00GRIDBAND.filter(c=>c.FUNCTION_ID===r&&c.COMPANY_CODE===this.DefaultConfigCompanyCode),this._currentConfigCompanyCode["TSI00GRIDBAND"+r]=this.DefaultConfigCompanyCode),n.TSI00GRIDBAND=i),this._configInfo.TSI00GRIDVIEWCUS&&l!=="F"&&(i=this._configInfo.TSI00GRIDVIEWCUS.filter(c=>c.FUNCTION_ID===r),n.TSI00GRIDVIEWCUS=i),this._tempSingleConfigInfo[r]=n}}return n}getSingleViewConfigInfo(r){let e={};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===r)return this._configInfo.TSI00GRIDVIEW[n]}return e}getSingleItemConfigInfo(r,e,n){var i,l;let a={};if(this._gridColumnsConfigInfo[r]===void 0&&(this._gridColumnsConfigInfo[r]={}),this._gridColumnsConfigInfo[r][e])a=this._gridColumnsConfigInfo[r][e];else{(!n||n.trim().length===0)&&(n=pt.CompanyCode),n||(n=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]);const s=this.getConfigInfo(r);(s==null?void 0:s.TSI00GRIDCOLUMN.length)>0&&(s.TSI00GRIDCOLUMN.every((c,d)=>c.COMPANY_CODE===n&&c.FUNCTION_ID===r&&c.ITEM_CODE===e||c.COMPANY_CODE===this.DefaultConfigCompanyCode&&c.FUNCTION_ID===r&&c.ITEM_CODE===e?(a=c,!1):!0),Object.keys(a).length>0&&((i=s.TSI00GRIDVIEW)==null?void 0:i.length)>0&&(a.FUNCTION_TYPE=s.TSI00GRIDVIEW[0].FUNCTION_TYPE,((l=a.EXT_OPTIONS)==null?void 0:l.trim().length)>0&&(a.extendOptions=JSON.parse(a.EXT_OPTIONS))),this._gridColumnsConfigInfo[r][e]=a)}return a}getAllItemCodeArray(r){const e=[];r=this.getConfigIdbyLayoutName(r);const n=this.getConfigInfo(r);if(n.TSI00GRIDCOLUMN){const a=n.TSI00GRIDCOLUMN;a.length>0&&a.forEach(i=>{e.push(i.ITEM_CODE)})}return e}getAllConfigIdArray(){const r=[];if(this._configInfo.TSI00GRIDVIEW){const e=this._configInfo.TSI00GRIDVIEW;e.length>0&&e.forEach(n=>{r.push(n.ITEM_CODE)})}return r}getItemDropDownDataSource(r,e){var i;let n=[];const a=this.getSingleItemConfigInfo(r,e);return((i=a==null?void 0:a.SVC_NAME)==null?void 0:i.trim().length)>0&&(this._configInfo[a.FUNCTION_ID+a.ITEM_CODE+pt.CompanyCode]?n=this._configInfo[a.FUNCTION_ID+a.ITEM_CODE+pt.CompanyCode]:this._configInfo[a.FUNCTION_ID+a.ITEM_CODE]?n=this._configInfo[a.FUNCTION_ID+a.ITEM_CODE]:this._configInfo[a.FUNCTION_ID+a.SVC_NAME]?n=this._configInfo[a.FUNCTION_ID+a.SVC_NAME]:this._configInfo["SI->"+a.SVC_NAME]?n=this._configInfo["SI->"+a.SVC_NAME]:this._configInfo["EP->"+a.SVC_NAME]?n=this._configInfo["EP->"+a.SVC_NAME]:this._configInfo["PM->"+a.SVC_NAME]?n=this._configInfo["PM->"+a.SVC_NAME]:this._configInfo[this._formName+a.SVC_NAME]?n=this._configInfo[this._formName+a.SVC_NAME]:this._configInfo[a.SVC_NAME]?n=this._configInfo[a.SVC_NAME]:this.messageError(`Can not find the data source config for [${r}.${e}]!`)),n}setDropDownBindOptions(r,e,n){var P,L,x,S,O;((P=e.EXT_OPTIONS)==null?void 0:P.trim().length)>0&&(e.extendOptions=JSON.parse(e.EXT_OPTIONS));const a=Y.toString(e.DISPLAY_COLS).toUpperCase();let i=Y.toString(e.DISPLAY_CAPTIONS).trim();const l=((x=(L=e.extendOptions)==null?void 0:L.dropdownOptions)==null?void 0:x.displayWidths)||[];let s=!1;const c=Y.toString(e.VALUE_MEMBER).toUpperCase(),d=Y.toString(e.DISPLAY_MEMBER).toUpperCase(),u=Y.toNumber(e.VALUE_POSITION),f=Y.toNumber(e.DISPLAY_POSITION),h=[],p=Y.$t("ERX.CodeColumn")||"代码",C=Y.$t("ERX.DescriptionColumn")||"描述";i.startsWith("$t(")&&i.endsWith(")")&&(i=i.substring(3,i.length-1),s=!0);let E="CODE";c.trim().length>0&&(E=c.trim());let T="CODE_DESC_1_CONTENT";d.trim().length>0&&(T=d.trim()),h.push(E,T);const v={dataValueField:"",dataTextField:"",dataSource:[],filterFields:h,columns:[{field:E,title:p,width:150},{field:T,title:C,width:150}],codeClass:e.SVC_NAME,layoutType:r,columnConfig:e};let M=[];n&&n instanceof Function&&(n=n());const g=n||this.getItemDropDownDataSource(e.FUNCTION_ID,e.ITEM_CODE)||[];if(a.length>0&&i.length>0){const A=a.split(","),w=i.split(",");if(A.length!==w.length)this.messageError("[DisplayColumns] array length need same to [DisplayCaptions] array length!");else{const I=[];for(let k=0;k<A.length;k++){const y={field:A[k],title:w[k].trim(),width:150};Y.toNumber(l[k])>0&&(y.width=Y.toNumber(l[k])),y.title.startsWith("$t(")&&y.title.endsWith(")")?y.title=Y.$t(y.title.substring(3,y.title.length-1)):s&&(y.title=Y.$t(y.title)),I.push(y),h.push(y.field)}c.trim().length>0&&d.trim().length>0?(E=c.trim(),T=d.trim()):(u>=0&&u<A.length?E=A[u]:E=A[0],f>=0&&u<A.length?T=A[f]:A.length>1?T=A[1]:T=A[0]),v.columns=I,v.dataValueField=E,v.dataTextField=T}}else if(g.length>0){const A=Object.keys(g[0]);(g[0][E]===void 0||g[0][T]===void 0)&&(g[0][E]===void 0&&(E=A[0]),g[0][T]===void 0&&(A.length>1?T=A[1]:T=A[0])),v.columns=e.VALUE_VISIBLE==="1"?[{field:E,title:p,width:Y.toNumber(l[0])||150},{field:T,title:C,width:Y.toNumber(l[1])||150}]:[{field:T,title:C,width:Y.toNumber(l[0])||150}],e.VALUE_VISIBLE==="1"&&h.push(E)}else c.trim().length>0&&d.trim().length>0&&(E=c.trim(),T=d.trim(),v.columns=e.VALUE_VISIBLE==="1"?[{field:E,title:p,width:Y.toNumber(l[0])||150},{field:T,title:C,width:Y.toNumber(l[1])||150}]:[{field:T,title:C,width:Y.toNumber(l[0])||150}],e.VALUE_VISIBLE==="1"&&h.push(E));e.ADD_EMPTY_ITEM==="1"&&(v.optionLabel="—-—"),e.FORMAT_TYPE==="Custom"&&((S=e.FORMAT_STRING)==null?void 0:S.trim().length)>0?v.displayFormat=(O=e.FORMAT_STRING)==null?void 0:O.trim():e.DISPLAY_POSITION===e.VALUE_POSITION&&Y.toNumber(e.VALUE_POSITION)>=0||e.DISPLAY_MEMBER===e.VALUE_MEMBER&&e.VALUE_MEMBER.trim().length>0?v.displayFormat="{0}":e.VALUE_VISIBLE==="1"?v.displayFormat="{0}|{1}":v.displayFormat="{1}",g&&g instanceof Array&&(M=g.map(A=>({...A,value:A[E],label:A[T]}))),h.push(T),v.autoWidth=!0,v.dataSource=M,v.dataValueField=E,v.dataTextField=T;let F=0;return v.columns.forEach(A=>{F+=A.width}),v.dropDownWidth=F,v}filterDropDownCascaderDataSource(r,e,n){const a=[];if(Array.isArray(n)&&n.length>0?a.push(...n):Y.toString(n).length>0&&a.push(Y.toString(n)),r&&r.length>0&&e.length>0&&a.length>0)if(e.toLowerCase().startsWith("script:")&&e.length>7){e=Y.getSystemFormatString(e.substring(7)).replaceAll("{0}",`${a.join(",")}`);const i=[];return r.forEach(l=>{Y.checkExpressionValid(l,e)&&i.push(l)}),i}else{const i=e.indexOf(" like ")>=0?"like":e.indexOf("<>")>=0?"<>":"=",l=e.split(i);if(l.length===2){const s=l[0].trim().toUpperCase(),c=l[1].trim().toUpperCase(),d=[];return r.forEach(u=>{const f=Y.toString(u[s]).trim();if(f.length>0){for(let h=0;h<a.length;h++)if(i==="like"){if(c.startsWith("'%")&&c.endsWith("%'")&&f.indexOf(a[h])>=0){d.push(u);break}else if(c.startsWith("'%")&&f.endsWith(a[h])){d.push(u);break}else if(f.startsWith(a[h])){d.push(u);break}}else if(i==="<>"){if(f!==a[h]){d.push(u);break}}else if(f===a[h]){d.push(u);break}}}),d}}return r}setDropDownCascaderDataSource(r,e,n){this._dropDownCascader[r+e]&&this._dropDownCascader[r+e].length>0&&this._dropDownCascader[r+e].forEach(i=>{if(i.FUNCTION_TYPE==="F"){const l=this._dropDownBindSource[i.FUNCTION_ID][i.ITEM_CODE].dataSource,s=i.FORM_FILTER.trim(),c=this.filterDropDownCascaderDataSource(l,s,n);i.dataSource=c,this.reloadDropDownDataSource(i.FUNCTION_ID,i.ITEM_CODE,i.dataSource)}})}getDropDownCascaderDataTable(r,e,n,a){let i;return r.trim().length>0&&e.trim().length>0&&n.trim().length>0&&a.trim().length>0&&this._dropDownCascader[n.trim()+a.trim()]&&this._dropDownCascader[n.trim()+a.trim()].length>0&&this._dropDownCascader[n.trim()+a.trim()].every(l=>l.FUNCTION_ID===r.trim()&&l.ITEM_CODE===e.trim()?(i=l.dataSource,!1):!0),i}getGridStyleConfig(r){return this._gridStyleInfo[r]}setDropDownAutoFillFieldForLayout(r,e,n){var l,s;n&&n instanceof Array&&(n=n.join(","));const a=this.getSingleItemConfigInfo(r,e),i=((l=a==null?void 0:a.extendOptions)==null?void 0:l.autoFillColumns)||((s=a.AUTOFILL_COLS)==null?void 0:s.trim())||"";if(i.trim().length>0){const c=i.split(";").filter(u=>u.trim().length>0),d=this.getDropDownSelectedData(r,e,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 C="";d.forEach(E=>{const T=Y.toString(E[h]).trim();T.length>0&&(C=C.length===0?T:C+","+T)}),this.setControlValue(r,p,C)}else this.setControlValue(r,p,d[h])}})}}setDropDownAutoFillFieldsForGrid(r,e,n){var i,l,s,c,d,u,f,h,p,C,E,T;const a=this.getGrid(r);if(a&&((i=n==null?void 0:n.data)!=null&&i.uid)){const v=(l=a.gridOptions.context)==null?void 0:l.configId,M=(c=(s=a.gridOptions.context)==null?void 0:s.viewConfig)==null?void 0:c.AUTO_SELECT_MODE,g=this.getGridColumn(r,e);if((u=(d=g==null?void 0:g.colDef)==null?void 0:d.context)!=null&&u.columnConfig){const F=(h=(f=g==null?void 0:g.colDef)==null?void 0:f.context)==null?void 0:h.columnConfig,P=((p=F==null?void 0:F.extendOptions)==null?void 0:p.autoFillColumns)||((C=F.AUTOFILL_COLS)==null?void 0:C.trim())||"";let L=[],x={};if(P.trim().length>0&&F.COLUMN_EDIT!=="3"&&(L=P.split(";"),n.data[e]&&(x=this.getDropDownSelectedData(v,e,n.data[e])),L.forEach(S=>{if(S.trim().length>0){const O=S.trim().split("="),A=O[0].toUpperCase().trim();let w=O[0].toUpperCase().trim();if(O.length>1&&(w=O[1].toUpperCase().trim()),x&&x instanceof Array){let I="";x.forEach(k=>{const y=Y.toString(k[A]).trim();y.length>0&&(I=I.length===0?y:I+","+y)}),n.data.set(w,I)}else n.data.set(w,x[A]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[w,pt.GridCheckColumnFieldName]})}})),n.isSelected()&&F.MULTI_ROW_EDIT==="1"&&M!=="1"&&M!=="3"){const S=this.getGridOptions(v,"multiRowEdit");S!==!1&&S!=="0"&&(((T=(E=a.gridOptions.context)==null?void 0:E.options)==null?void 0:T.multiRowEditType)==="all"?a.gridOptions.api.foreachLeafNode(O=>{var A;O!=null&&O.selected&&((A=O.data)!=null&&A.uid)&&O.data.uid!==n.data.uid&&L.forEach(w=>{if(w.trim().length>0){const I=w.trim().split("="),k=I[0].toUpperCase().trim();let y=I[0].toUpperCase().trim();if(I.length>1&&(y=I[1].toUpperCase().trim()),x&&x instanceof Array){let R="";x.forEach(N=>{const U=Y.toString(N[k]).trim();U.length>0&&(R=R.length===0?U:R+","+U)}),O.setDataValue(y,R)}else O.setDataValue(y,x[k]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[y,pt.GridCheckColumnFieldName]})}})}):a.gridOptions.api.forEachNodeAfterFilter(O=>{var A;O!=null&&O.selected&&((A=O.data)!=null&&A.uid)&&O.data.uid!==n.data.uid&&L.forEach(w=>{if(w.trim().length>0){const I=w.trim().split("="),k=I[0].toUpperCase().trim();let y=I[0].toUpperCase().trim();if(I.length>1&&(y=I[1].toUpperCase().trim()),x&&x instanceof Array){let R="";x.forEach(N=>{const U=Y.toString(N[k]).trim();U.length>0&&(R=R.length===0?U:R+","+U)}),O.setDataValue(y,R)}else O.setDataValue(y,x[k]);a.gridOptions.api.refreshCells({rowNodes:[n],columns:[y,pt.GridCheckColumnFieldName]})}})}))}}}}addDropDownCode(r,e,n,a="push"){var i,l;if((r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0&&(n==null?void 0:n.length)>0&&this._dropDownBindSource[r.trim()]&&this._dropDownBindSource[r.trim()][e.trim()]){const s=this._dropDownBindSource[r.trim()][e.trim()];if(s.dataSource!==void 0&&s.dataSource instanceof Array){a==="unshift"?s.dataSource.unshift(...n):s.dataSource.push(...n);const c=this.getSingleItemConfigInfo(r,e);if(c.FUNCTION_TYPE==="F")this._dropDownRefreshKey[r][e]=Y.guid(),this.setControlEmptyValue(r,e);else if(c.FUNCTION_TYPE==="G"||c.FUNCTION_TYPE==="P"){const d=this.getGridColumn(r,e);if(d!=null&&d.colDef){this.setGridColumnDropdown(r,d.colDef,s.dataSource,(i=d.colDef.context)==null?void 0:i.valueField,(l=d.colDef.context)==null?void 0:l.textField,s.displayFormat);const u=this.getGridApi(r);u==null||u.refreshCells({columns:[d.colId]})}}}}}async reloadDropDownDataSource(r,e,n){var a,i,l;if((r==null?void 0:r.trim().length)>0&&(e==null?void 0:e.trim().length)>0){const s=this.getSingleItemConfigInfo(r,e);if(s){let c=[];if(n&&n instanceof Function&&(n=n()),n instanceof Array)c=n;else if(s.ORIGIN_CODE==="2"&&s.SVC_NAME.trim().length>0){const u=st.buildMap([{FUNCTION_ID:s.SVC_NAME,COMPANY_CODE:pt.CompanyCode}],"DATA_SOURCE"),f=await this.callServiceEx(pt.dynamicQueryService,u);f.sysFlag>=0&&(c=f.getMapData(0))}const d=this.setDropDownBindOptions(s.FUNCTION_TYPE,s,c);if(this._dropDownBindSource[r.trim()]=this._dropDownBindSource[r.trim()]||{},this._dropDownBindSource[r.trim()][e.trim()]=d,s.FUNCTION_TYPE==="F"){const u=this.getControlValue(r,e);u&&!((a=d==null?void 0:d.dataSource)!=null&&a.some(f=>f[d.dataValueField]===u))&&this.setControlEmptyValue(r,e)}else if(s.FUNCTION_TYPE==="G"||s.FUNCTION_TYPE==="P"){const u=this.getGridColumn(r,e);if(u!=null&&u.colDef){this.setGridColumnDropdown(r,u.colDef,c,(i=u.colDef.context)==null?void 0:i.valueField,(l=u.colDef.context)==null?void 0:l.textField,d.displayFormat);const f=this.getGridApi(r);f==null||f.refreshCells({columns:[u.colId]})}}this._dropDownRefreshKey[r][e]=Y.guid()}}}createDataSet(){var n,a,i;const r=[];let e="";this._configInfo.TSI00GRIDVIEW.forEach(l=>{var s,c,d;if(((s=l.TABLE_NAME)==null?void 0:s.trim().length)>0&&((c=l.DATASET_NAME)==null?void 0:c.trim().length)>0){const u={};l.FUNCTION_TYPE==="T"&&((d=l.CURRENT_NODE_DESC)==null?void 0:d.trim().length)>0&&l.FATHER_NODE_DESC.trim().length>0&&(u.hierarchy={primaryField:l.CURRENT_NODE_DESC.trim(),parentField:l.FATHER_NODE_DESC}),this.createDataTable(l.TABLE_NAME.trim(),u)&&r.push({tableName:l.TABLE_NAME.trim()}),e=l.DATASET_NAME.trim()}}),((a=(n=this._configInfo)==null?void 0:n.TSI00DATARELATION)==null?void 0:a.length)>0&&this._configInfo.TSI00DATARELATION.forEach(l=>{r.findIndex(s=>s.tableName===l.RESERVE1)>=0&&r.findIndex(s=>s.tableName===l.RESERVE7)>=0&&(this._formDataSet.relations[l.RELATION_NAME]=this._formDataSet.relations[l.RELATION_NAME]||[],this._formDataSet.relations[l.RELATION_NAME].push({ParentTable:l.RESERVE1,ChildTable:l.RESERVE7,ParentColumn:l.RESERVE2,ChildColumn:l.RESERVE8}))}),(i=this._formDataSet)==null||i.setName(e)}createDataTable(r,e){var i,l,s,c,d,u;let n;const a={...e};if(r.trim().length>0&&!this._formDataSet.dataTables[r.trim()]){const f={};((i=this._configInfo.TSI00DATATABLE)==null?void 0:i.length)>0&&this._configInfo.TSI00DATATABLE.forEach(h=>{if(h.TABLE_NAME===r.trim()){const p={name:h.COL_NAME,caption:h.COL_CAPTION,maxLength:h.MAX_LENGTH,camelCaseName:Y.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=Y.toNumber(h.DEFAULT_VALUE);break;case"3":case"date":case"datetime":p.type="datetime",p.defaultValue=Y.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;case"4":case"bool":case"boolean":p.type="boolean",p.defaultValue=Y.toBoolean(h.DEFAULT_VALUE);break;case"5":case"time":p.type="time",p.defaultValue=Y.getDateTimeByString(h.DEFAULT_VALUE,"Dayjs");break;default:p.type="string",p.defaultValue=Y.getSystemFormatString(h.DEFAULT_VALUE).trim();break}f[h.COL_NAME]=p}}),Object.keys(f).length>0&&(a.schema=f,n=new un(a),this._formDataSet.addDataTable(r.trim(),n))}else n=(l=this._formDataSet)==null?void 0:l.dataTables[r.trim()],a.schema=(s=n==null?void 0:n.options)==null?void 0:s.schema,a.hierarchy=a.hierarchy||((c=n==null?void 0:n.options)==null?void 0:c.hierarchy);return(d=e==null?void 0:e.hierarchy)!=null&&d.primaryField&&((u=e==null?void 0:e.hierarchy)!=null&&u.parentField)&&(a.schema[e.hierarchy.primaryField]===void 0&&console.error(`ER: Hierarchy DataTable's PrimaryField [${e.hierarchy.primaryField}] not exists!`),a.schema[e.hierarchy.parentField]===void 0&&console.error(`ER: Hierarchy DataTable's ParentField [${e.hierarchy.parentField}] not exists!`)),n||console.error(`ER: DataTable [${r}] creation failed!`),n}getTableName(r){var e;return(e=this._formDataSet)==null?void 0:e.getTableName(r)}getBindingTableName(r){var n;let e="";return(r==null?void 0:r.trim().length)>0&&((n=this._formBindingRelation)!=null&&n[r.trim()])&&(e=this._formBindingRelation[r.trim()]),e}setBindingTableName(r){var n;let e="";if((r==null?void 0:r.trim().length)>0){r=r.trim();const a=this.getSingleViewConfigInfo(r);a&&a.TABLE_NAME&&a.TABLE_NAME.trim().length>0&&((n=this._formDataSet)!=null&&n.contains(a.TABLE_NAME.trim()))&&(e=a.TABLE_NAME.trim(),this._formBindingRelation[r]=e)}return e}getBindingTable(r){var a;let e;const n=this.getBindingTableName(r);return n&&n.trim().length>0&&(e=(a=this._formDataSet)==null?void 0:a.dataTables[n]),e}getBindingTableAsDataMap(r){let e;const n=this.getBindingTable(r);return n&&n instanceof un&&(e=n.data(),e&&(e=un.convertDataType(e,n,"weakly"))),st.buildMap(e||{},"Table0")}hasDataChange(...r){let e=!1;return r.length===0?r=Object.keys(this._formBindingRelation):r.length===1&&(r=r[0].split(",")),r.forEach(n=>{const a=this.getBindingTable(n);if(a&&a instanceof un)if(!e)e=a.hasChanges();else return e}),e}cancelGridChange(r){var n,a;const e=this.getGrid(r);if(e){const i=(a=(n=e.gridOptions)==null?void 0:n.context)==null?void 0:a.bindingSource;i&&i instanceof un&&i.cancelChanges()}return this}mergeData(r,e=!0,...n){var a,i,l;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&&(r instanceof st?r.contains(s.trim())?(a=this._formDataSet)==null||a.mergeData(s.trim(),r.getMapData(s.trim()),e):Object.keys(r).length>0&&((i=this._formDataSet)==null||i.mergeData(s.trim(),r.getMapData(),e)):r instanceof Array&&r&&r.length>0&&((l=this._formDataSet)==null||l.mergeData(s.trim(),r,e)),this.autoBestFit(n[0]))}else if(r instanceof st){const s={};n.forEach(c=>{var u;const d=this.getBindingTableName(c);(d==null?void 0:d.trim().length)>0&&r.contains(d.trim())&&(s[d]||((u=this._formDataSet)==null||u.mergeData(d.trim(),r.getMapData(d.trim()),e),s[d]=!0),this.autoBestFit(c))})}}return this}checkFormChanged(...r){return new Promise(e=>{this.hasDataChange(...r)?this.messageConfirm(Y.$t("ERX.ContinueToOperate")||"继续将丢失未保存的更改,是否继续?").then(n=>{e(n)}).catch(()=>{e(!1)}):e(!0)})}addRowToGrid(r,e=!0,n="default",a=!1){var s,c,d,u,f,h;let i;const l=this.getGrid(r);if((s=l==null?void 0:l.gridOptions.context)!=null&&s.bindingSource){l.gridOptions.context.options=l.gridOptions.context.options||{},l.gridOptions.context.options.autoCheckNewRow=a;let p={};n==="default"&&(n=this.getGridOptions(r,"insertAtTop")||"default"),n==="default"&&(n=((u=(d=(c=l==null?void 0:l.gridOptions)==null?void 0:c.context)==null?void 0:d.options)==null?void 0:u.insertAtTop)||"default");const C=this.getGridOptions(r,"autoGuidField");(e===!0||(e==null?void 0:e.setDefaultValue)===!0)&&(p=this.getGridConfigDefaultValues(r)||{}),this._customDefaultValues[r]&&(p={...p,...this._customDefaultValues[r]}),e!=null&&e.data&&(p={...p,...e.data});const E=(f=l.gridOptions.context)==null?void 0:f.bindingSource;if(n===!0||n==="top")i=E.insert(0,p,C);else if(n==="afterCurrent"||n==="beforeCurrent"){const T=this.getGridCurrentRow(r);if(T){let v=E.indexOf(T);v>=0&&v<E.rowCount&&n==="afterCurrent"?v=v+1:v>0&&n==="beforeCurrent"&&(v=v),i=E.insert(v,p,C)}else i=E.add(p,C)}else typeof n=="number"&&n>=0?i=E.insert(n,p,C):i=E.add(p,C);(h=l==null?void 0:l.gridOptions)!=null&&h.treeData&&(i[pt.TreeHierarchyFieldName]=[Y.guid()])}return i}addCopyRowToGrid(r,e="default",n=!1){var l,s,c;const a=this.getGrid(r);let i;if(a){e==="default"&&(e=this.getGridOptions(r,"insertAtTop")||"default"),e==="default"&&(e=((c=(s=(l=a==null?void 0:a.gridOptions)==null?void 0:l.context)==null?void 0:s.options)==null?void 0:c.insertAtTop)||"default"),(a==null?void 0:a.gridOptions.api).stopEditing();const u=this.getGridSelectRows(a);if(u.length===0){const f=this.getGridCurrentRow(a);f&&u.push(f)}if(u.length===0)i=[this.addRowToGrid(r,!0,e,n)];else{if(this._customDefaultValues[r])for(let h=0;h<u.length;h++)u[h]={...u[h],...this._customDefaultValues[r]};const f=this.getGridBindingTable(r);if(f){let h=-1;e==="top"||e===!0?h=0:e==="afterCurrent"||e==="default"?(h=f.indexOf(u[u.length-1]),h<f.rowCount&&(h=h+1)):e==="beforeCurrent"?(h=f.indexOf(u[0]),h>0&&(h=h-1)):typeof e=="number"&&e>=0&&(h=e),i=f.import(u,h,!0,this.getGridOptions(r,"autoGuidField"))}}}return i}importRowsToGrid(r,e,n=!1,a=!0){var s,c;let i;const l=this.getGrid(r);if((s=l==null?void 0:l.gridOptions.context)!=null&&s.bindingSource){l.gridOptions.context.options=l.gridOptions.context.options||{},l.gridOptions.context.options.autoCheckNewRow=n;const d=(c=l.gridOptions.context)==null?void 0:c.bindingSource;d&&(i=d.import(e,void 0,a))}return i}getGridAggregates(r){var n;let e;if(r){const a=this.getGrid(r);if(a){const i=a.gridOptions.api.getModel();e=(n=i==null?void 0:i.rootNode)==null?void 0:n.aggData}}return e}getModelFromGridOrLayout(r,e,n=!1,a){const i=this.getBindingTable(r);return this.getModelFromDataTable(i,e,n,a)}getModelFromDataTable(r,e,n=!1,a){let i;return typeof r=="string"&&r.trim().length>0&&(r=this.getBindingTable(r)),r&&r instanceof un&&(e&&e.trim().length>0?i=r.get(e.trim()):(i=r.at(0),i=o.reactive(i))),i&&(n instanceof Function?i=n(i)||i.toJSON():i=n?i.toJSON():i,a&&Object.keys(a).forEach(l=>{i[l]=a[l]})),i}getGridDataCount(r){let e=0;const n=this.getGridConfigId(r);if(n){const a=this.getBindingTable(n);a&&a instanceof un&&(e=a.totalCount())}return e}getModelFromDataTableById(r,e,n=!1){var i;let a;return typeof r=="string"&&r.trim().length>0&&this._formBindingRelation[r.trim()].trim().length>0&&(r=(i=this._formDataSet)==null?void 0:i.dataTables[this._formBindingRelation[r.trim()]]),r&&r instanceof un&&e&&e.trim().length>0&&(a=r.get(e.trim()),a&&(n instanceof Function?a=n(a)||a.toJSON():a=n?a.toJSON():a)),a}addModelToLayout(r,e,n){let a;if((r==null?void 0:r.trim().length)>0){const i=this.getBindingTable(r.trim());if(i){i instanceof un&&(a=i.add({}));const l=this.getRelationConfigIdsByTableName(i.tableName);e&&this.setModelDefalutValue(a,l),a=this.getLayoutBindModel(r)}else console.error("ER: Attempting to add model to a non-existent dataTable, configId: "+r)}return a}getModelFields(r){var e;return(e=r==null?void 0:r.options)==null?void 0:e.schema}getControlName(r,e,n){let a="antInput";switch(r){case"F1":case"G3":case"T3":a="antInputGroup";break;case"FB":a="antRadioGroup";break;case"FJ":a="erRadioGroup";break;case"F6":case"F7":case"FA":case"FC":case"FP":case"G1":case"G2":case"GP":case"T1":case"T2":case"TP":a="erSelect";break;case"FD":a="erMultiSelect";break;case"F3":case"G4":case"GD":case"T4":case"TD":a="antMultiSelect";break;case"FL":a="erTreeSelect";break;case"FH":a="erMultiTreeSelect";break;case"F2":case"F9":case"FG":a="antInputNumber";break;case"F4":a="antCheckbox";break;case"FK":a="erCheckboxGroup";break;case"FW":a="antSwitch";break;case"FM":a="scriptEditor";break;case"F5":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===2?a="antTimePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===4?e.toLowerCase()==="hh:mm"?a="antTimePicker":a="antYearPicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===6?e.toLowerCase()==="hh:mm:ss"?a="antTimePicker":a="antMonthPicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===8?a="antDatePicker":a="antDateTimePicker";break;case"FR":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===4||e.toLowerCase()==="yyyy"?a="antYearRangePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===6||e.toLowerCase()==="yyyy-mm"||e.toLowerCase()==="yyyy/mm"||e.toLowerCase()==="yyyymm"?a="antMonthRangePicker":Y.toNumber(n==null?void 0:n.MAX_LENGTH)===8||e.toLowerCase()==="yyyy-mm-dd"||e.toLowerCase()==="yyyy/mm/dd"||e.toLowerCase()==="yyyymmdd"?a="antDateRangePicker":a="antDateTimeRangePicker";break;case"F8":case"G8":case"T8":a="antTextarea";break;case"FE":case"G5":case"T5":a="erMemoEditor";break;case"FN":a="antButton";break;case"FZ":case"GZ":case"TZ":a="antInputColor";break;case"FS":a="label";break;case"FT":a="antDivider";break;default:a="antInput";break}return a}resetValidator(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++){if(e[n].trim().length===0)continue;const a=this.getLayoutBindForm(e[n]);a==null||a.clearValidate()}}getLayoutLabelSpan(r,e){return Y.jQuery("#"+this._formId+r+e+"_span")}getLayoutJqueryElement(r,e){let n;return n=Y.jQuery("#"+this._formId+r+e),n===void 0&&(n=Y.jQuery("#"+r)),n}autoBestFit(r){var n,a,i,l,s;const e=this.getGrid(r);if(e&&this.isGridOnScreen(e)){const c=(a=(n=e.gridOptions.columnApi)==null?void 0:n.columnModel)==null?void 0:a.gridColumns;(c==null?void 0:c.length)>0&&((s=(l=(i=e==null?void 0:e.gridOptions)==null?void 0:i.context)==null?void 0:l.viewConfig)==null?void 0:s.BESTFIT)==="1"&&c.forEach(d=>{d.visible&&!d.colDef.suppressSizeToFit&&e.gridOptions.columnApi.autoSizeColumn(d)})}return this}getGrid(r){var n,a;let e;return r&&typeof r=="string"&&this._gridInstanceInfo[r]!==void 0&&(r=this._gridInstanceInfo[r]),(n=r==null?void 0:r.gridOptions)!=null&&n.api&&((a=r==null?void 0:r.gridOptions)!=null&&a.columnApi)&&(e=r),e}getDetailGrid(r,e){const n=this.getGrid(r);if(n&&e){const a=(typeof e=="string"?e:e==null?void 0:e.uid)||"";if(a.trim().length===0)return;const i=n.gridOptions.api.getDetailGridInfo(`detail_${a}`);if(i)return{gridOptions:{...n.gridOptions.detailGridOptions,...i}}}}getGridApi(r){var e,n;return(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.api}isGridOnScreen(r){const e=this.getGrid(r);return e?Y.isGridOnScreen(e):!1}getGridColumnApi(r){var e,n;return(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.columnApi}getGridConfig(r){var e,n,a;return(a=(n=(e=this.getGrid(r))==null?void 0:e.gridOptions)==null?void 0:n.context)==null?void 0:a.viewConfig}getGridColumn(r,e){const n=this.getGrid(r);return cr.getGridColumn(n,e)}getGridColumnDef(r,e){const n=this.getGrid(r);return cr.getGridColumnDef(n,e)}showGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){const i=[];a.forEach(l=>{i.push({colId:l,hide:!1})}),n.gridOptions.columnApi.applyColumnState({state:i})}}return this}hideGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){const i=[];a.forEach(l=>{i.push({colId:l,hide:!0})}),n.gridOptions.columnApi.applyColumnState({state:i})}}return this}showGridCheckColumn(r){return this.showOrHideGridCheckColumn(r,"show")}hideGridCheckColumn(r){return this.showOrHideGridCheckColumn(r,"hide")}showOrHideGridCheckColumn(r,e="default"){var a,i,l,s;const n=this.getGrid(r);if((a=n==null?void 0:n.gridOptions)!=null&&a.api){const c=n.gridOptions.api,d=c.getColumnDef(pt.GridCheckColumnFieldName);d&&(e==="hide"?(d.checkboxSelection=void 0,d.headerCheckboxSelection=void 0):(e==="show"||((i=n.gridOptions.context)==null?void 0:i.viewConfig.SHOW_SELECTION)==="1")&&(d.checkboxSelection=u=>!u.node.footer,this.getGridOptions((s=(l=n.gridOptions)==null?void 0:l.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(r,e,n="none"){var i,l;const a=this.getGrid(r);return a&&(this.setGridOptions((l=(i=a.gridOptions)==null?void 0:i.context)==null?void 0:l.configId,"RowSelection",e,!0),this.setGridColumnOptions(a,s=>{var c,d,u,f,h;s.colId===pt.GridCheckColumnFieldName&&(n==="show"||n==="hide"||e==="multiple")&&(n==="hide"?(s.checkboxSelection=void 0,s.headerCheckboxSelection=void 0):e==="multiple"?(s.checkboxSelection=p=>!p.node.footer,s.headerCheckboxSelection=n==="show"||((c=a.gridOptions.context)==null?void 0:c.viewConfig.SHOW_SELECTION)==="1",s.headerCheckboxSelectionFilteredOnly=((u=(d=a.gridOptions.context)==null?void 0:d.options)==null?void 0:u.headerCheckboxSelectionFilteredOnly)??!0,s.headerCheckboxSelectionFilteredOnly!==!0?s.headerCheckboxSelectionCurrentPageOnly=(h=(f=a.gridOptions.context)==null?void 0:f.options)==null?void 0:h.headerCheckboxSelectionCurrentPageOnly:delete s.headerCheckboxSelectionCurrentPageOnly):e==="single"&&(s.headerCheckboxSelection=void 0))})),this}setGridRowDrag(r,e="default"){var a,i,l,s;const n=this.getGrid(r);if((a=n==null?void 0:n.gridOptions)!=null&&a.api){const d=n.gridOptions.api.getColumnDef(pt.GridCheckColumnFieldName);d&&(e===!1?(d.rowDrag=void 0,(i=n==null?void 0:n.gridOptions)==null||i.columnApi.setColumnWidth(d.colId,55)):(e===!0||(l=n.gridOptions.context)!=null&&l.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=e),n.gridOptions.api.redrawRows()}return this}addGridColumn(r,e,n){const a=this.getGrid(r);if(a){let i;if(e instanceof Array?i=e:i=[e],i.length>0){const l=a.gridOptions.context.bindingSource,s=a.gridOptions.api.getColumnDefs()||[],c=[];i.forEach(u=>{var f,h,p,C;if(((f=u.field)==null?void 0:f.trim().length)>0){u.field=u.field.trim();const E={name:u.field,capiton:u.headerName,defaultValue:u.defaultValue,type:u.dataType||u.type||"string",maxLength:u.maxLength||-1};l.addField(E),u.colId=u.colId||u.field,a.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 v,M,g,F,P;let T="er-grid-header-align-center";return((v=u.headerAlignment)==null?void 0:v.toLowerCase())==="near"||((M=u.headerAlignment)==null?void 0:M.toLowerCase())==="left"?T="er-grid-header-align-left":(((g=u.headerAlignment)==null?void 0:g.toLowerCase())==="far"||((F=u.headerAlignment)==null?void 0:F.toLowerCase())==="right")&&(T="er-grid-header-align-right"),u.required&&((P=u.requiredCondition)==null?void 0:P.trim().length)>0?T=T+" er-grid-header-maroon-star":u.required&&(T=T+" er-grid-header-red-star"),T},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=T=>{var v,M;return((v=T.context)==null?void 0:v.editable)&&((M=T.colDef.context)==null?void 0:M.editable)&&!T.node.rowPinned}),u.filter=u.filter===void 0?"agSetColumnFilter":u.filter,u.filterParams={excelMode:(C=(p=(h=a.gridOptions)==null?void 0:h.context)==null?void 0:p.options)==null?void 0:C.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),a.gridOptions.api.setColumnDefs(s)}}return this}removeGridColumn(r,e){const n=this.getGrid(r);if(n){let a;if(e instanceof Array?a=e:a=e.split(","),a.length>0){let i=n.gridOptions.api.getColumnDefs()||[];i=i.filter(l=>!a.includes(l.colId)),n.gridOptions.api.setColumnDefs(i)}}return this}getGridColumnFields(r,e="string"){var i,l,s;const n=this.getGrid(r);let a=e==="Array"?[]:void 0;if((l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.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"&&(e==="Array"?a.push(d.FIELD_NAME.trim()):a=a?a+","+d.FIELD_NAME.trim():d.FIELD_NAME.trim())})}return a}setGridEnable(r,e){var a,i,l;const n=this.getGrid(r);return(a=n==null?void 0:n.gridOptions)!=null&&a.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.enable=e,(l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.configId&&(this.setGridOptions(n.gridOptions.context.configId,"enable",e,!0),document.querySelectorAll(".ag-full-width-row").forEach(c=>{c.style!==void 0&&(e?c.style.pointerEvents="all":c.style.pointerEvents="none")}))),this}setGridEditable(r,e){var a,i,l;const n=this.getGrid(r);return(a=n==null?void 0:n.gridOptions)!=null&&a.context&&(n.gridOptions.api.stopEditing(),n.gridOptions.context.editable=e,(l=(i=n==null?void 0:n.gridOptions)==null?void 0:i.context)!=null&&l.configId&&this.setGridOptions(n.gridOptions.context.configId,"editable",e,!0)),this}setGridIndicator(r,e,n){if(r&&e&&Object.keys(e).length>0){const a=this.getGrid(r);setTimeout(()=>{var i,l,s,c,d,u,f;if((i=a==null?void 0:a.gridOptions)!=null&&i.api&&((s=(l=a==null?void 0:a.gridOptions)==null?void 0:l.context)!=null&&s.bindingSource)){const h=(c=a==null?void 0:a.gridOptions)==null?void 0:c.api,C=((u=(d=a==null?void 0:a.gridOptions)==null?void 0:d.context)==null?void 0:u.bindingSource).data().find(E=>{for(const T in e)if(E[T]!==e[T])return!1;return!0});if(C!=null&&C.uid){h.clearFocusedCell();const E=(f=a==null?void 0:a.gridOptions)==null?void 0:f.api.getRowNode(C==null?void 0:C.uid);E&&this.setGridFocusedCell(r,E.rowIndex,pt.GridCheckColumnFieldName,n)}}},250)}return this}setDragAndDropBetweenGrids(r,e,n,a){const i=this.getGrid(r),l=this.getGrid(e);if(!i)return Y.error("fromGrid is not found",r),this;if(!l)return Y.error("toGrid is not found",e),this;const s=i.gridOptions.api,c=l.gridOptions.api,d=c.getRowDropZoneParams({onDragStop:u=>{var f,h,p,C;if((a==null?void 0:a.preventDefault)!==!0&&((f=i.gridOptions.context)!=null&&f.configId)&&u.nodes.length>0){const E=u.nodes.map(T=>T.data);if(this.deleteGridRows(i.gridOptions.context.configId,!1,E),u.removedRows=E,(h=u.context)!=null&&h.configId){const T=(p=u.context)==null?void 0:p.bindingSource;u.nodes.forEach(v=>{T.isRemoved(v.data.uid)?this.setGridRowState(l,v.data,"unchanged"):this.setGridRowState(l,v.data,"added")})}}u.formGridContext=i.gridOptions.context,(C=a==null?void 0:a.onDragStop)==null||C.call(a,u)}});if(n){s.addRowDropZone(d);const u=s.getRowDropZoneParams({onDragStop:f=>{var h,p,C,E;if((a==null?void 0:a.preventDefault)!==!0&&((h=l.gridOptions.context)!=null&&h.configId)&&f.nodes.length>0){const T=f.nodes.map(v=>v.data);if(this.deleteGridRows(l.gridOptions.context.configId,!1,T),f.removedRows=T,(p=f.context)!=null&&p.configId){const v=(C=f.context)==null?void 0:C.bindingSource;f.nodes.forEach(M=>{v.isRemoved(M.data.uid)?this.setGridRowState(i,M.data,"unchanged"):this.setGridRowState(i,M.data,"added")})}}f.formGridContext=l.gridOptions.context,(E=a==null?void 0:a.onDragStop)==null||E.call(a,f)}});c.addRowDropZone(u)}return this}refreshGridFooterData(r){var n,a,i;const e=this.getGrid(r);if((n=e==null?void 0:e.gridOptions)!=null&&n.api){const l=(a=e==null?void 0:e.gridOptions)==null?void 0:a.api;if(l.getPinnedBottomRowCount()>0){l.refreshClientSideRowModel("aggregate");const s=l.getModel();l.setPinnedBottomRowData([{...(i=s==null?void 0:s.rootNode)==null?void 0:i.aggData,pinndeRowType:"ErGridSummaryFooter"}])}}return this}setLayoutConfigRelationInfo(r,e){return this._layoutConfigRelationInfo[e]=r,this}getConfigIdbyLayoutName(r){return this._layoutConfigRelationInfo[r]&&this._layoutConfigRelationInfo[r].trim().length>0?this._layoutConfigRelationInfo[r].trim():r}getGridConfigId(r){let e="";return r&&(typeof r=="string"&&this._gridInstanceInfo[r]!==void 0?e=r:r.gridOptions&&r.gridOptions.api&&(e=r.gridOptions.gridId)),e}setWidgetInstanceInfo(r,e,n){return this.isNullOrEmpty(r)||(this._widgetInstanceInfo[r.trim()]===void 0&&(this._widgetInstanceInfo[r.trim()]={}),!this.isNullOrEmpty(e)&&n&&(this._widgetInstanceInfo[r.trim()][e.trim()]=n)),this}setControlVisible(r,e,n,a="none"){return!this.isNullOrEmpty(r)&&(n==null?void 0:n.trim().length)>0&&(r=this.getConfigIdbyLayoutName(r),n.split(",").forEach(l=>{l.trim().length>0&&(a==="empty"?this.setControlEmptyValue(r,l):a==="default"&&this.setControlDefalutValue(r,l),this.setLayoutItemOption(r,l.trim(),{visible:e}))})),this}setGridColumnTitle(r,e){if((e==null?void 0:e.length)>0){const n=this.getGrid(r);n&&(e.forEach(a=>{var l;const i=n.gridOptions.columnApi.getColumn(a.colId);if(i!=null&&i.colDef){const s=((l=i.colDef.context)==null?void 0:l.titleInfo)||{};i.colDef.headerComponentParams={template:`${this.getGridHeaderTemplate({...s,...a})}`}}}),n.gridOptions.api.refreshHeader())}return this}setGridColumnOptions(r,e){if(r&&e instanceof Function){const n=this.getGrid(r);if(n){const a=l=>{var s;((s=l==null?void 0:l.children)==null?void 0:s.length)>0&&l.children.forEach(c=>{a(c)}),e(l)},i=n.gridOptions.api.getColumnDefs();i.forEach(l=>{a(l)}),n.gridOptions.api.setColumnDefs(i)}}return this}setGridOptions(r,e,n,a=!1){return r=(r==null?void 0:r.trim())||"",e=(e==null?void 0:e.trim())||"",r.length>0&&e.length>0&&(a?(this._gridReactiveOptions[r]=this._gridReactiveOptions[r]||{},this._gridReactiveOptions[r][e]=n):(this._gridOptions[r]=this._gridOptions[r]||{},this._gridOptions[r][e]=n)),this}getGridOptions(r,e,n=!1){if(r=(r==null?void 0:r.trim())||"",e=(e==null?void 0:e.trim())||"",r.length>0&&e.length>0){if(n&&this._gridReactiveOptions[r])return this._gridReactiveOptions[r][e];if(!n&&this._gridOptions[r])return this._gridOptions[r][e]}}getLayoutExtentedOptions(r){var i,l;let e={};const n=this.getFormSysInfo("LayoutDefaultOptions");n.trim().length>0&&(e={...JSON.parse(n)});const a=this.getConfigInfo(r);if(((i=a==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0){const s=a.TSI00GRIDVIEW[0];if(((l=s.EXT_OPTIONS)==null?void 0:l.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);e={...e,...c}}}return e}getGridExtentedOptions(r){var i,l;let e={};const n=this.getFormSysInfo("GridDefaultOptions");n.trim().length>0&&(e={...JSON.parse(n)});const a=this.getConfigInfo(r);if(((i=a==null?void 0:a.TSI00GRIDVIEW)==null?void 0:i.length)>0){const s=a.TSI00GRIDVIEW[0];if(((l=s.EXT_OPTIONS)==null?void 0:l.trim().length)>0){const c=JSON.parse(s.EXT_OPTIONS);e={...e,...c}}}return e}getDetailGridRenderOptions(r,e,n,a){const i=this.getGridConfigOptions(r,e,n,a),l={context:i==null?void 0:i.context,defaultColDef:i==null?void 0:i.defaultColDef,groupDisplayType:i==null?void 0:i.groupDisplayType,columnDefs:i==null?void 0:i.columnDefs,groupIncludeTotalFooter:i==null?void 0:i.groupIncludeTotalFooter,groupIncludeFooter:i==null?void 0:i.groupIncludeFooter,suppressRowClickSelection:i==null?void 0:i.suppressRowClickSelection,rowSelection:i==null?void 0:i.rowSelection,groupRowRendererParams:i==null?void 0:i.groupRowRendererParams,localeText:Na(),enableRangeSelection:!0,stopEditingWhenCellsLoseFocus:!0,suppressRowTransform:!0,enableRtl:mn(),statusBar:{statusPanels:[{statusPanel:o.markRaw(r2),statusPanelParams:{configId:r,options:e},key:"AggregationPanel",align:"center"},{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]},onCellValueChanged:s=>{var c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof Dr){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]=Y.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]=Y.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const k=s.colDef.context.displayFormat||"",y=Y.toString(s.newValue,!0);if(y.length>0){if(k.trim().startsWith("{0}|")&&y.includes("|")){const R=y.split("|")[0];(p=s.colDef.refData)!=null&&p[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().startsWith("{0}-")&&y.includes("-")){const R=y.split("-")[0];(C=s.colDef.refData)!=null&&C[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}|")&&y.includes("|")){const R=y.split("|"),N=R[R.length-1];(E=s.colDef.refData)!=null&&E[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}-")&&y.includes("-")){const R=y.split("-"),N=R[R.length-1];(T=s.colDef.refData)!=null&&T[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.length>0){const R=Object.keys(s.colDef.refData);let N="";for(let U=0;U<R.length;U++)if(((v=s.colDef.refData)==null?void 0:v[R[U]])===y){N=R[U];break}s.data[s.colDef.field]=N}}}}s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0,this.setDropDownAutoFillFieldsForGrid({gridOptions:{...s}},s.colDef.colId,s.node),this.DropDownCascader[r+s.colDef.colId]&&this.DropDownCascader[r+s.colDef.colId].forEach(k=>{var y,R,N;if(k.FUNCTION_TYPE&&k.FUNCTION_ID&&k.ITEM_CODE){let U="";const V=s.data[s.colDef.field],b=this.getSingleItemConfigInfo(k.FUNCTION_ID,k.ITEM_CODE),W=this.getItemDropDownDataSource(k.FUNCTION_ID,k.ITEM_CODE);if(s.data[s.colDef.field]){const q=this.filterDropDownCascaderDataSource(W,k.FORM_FILTER,s.data[s.colDef.field]);if((q==null?void 0:q.length)>0){const z=(y=this.DropDownBindSource[k.FUNCTION_ID])==null?void 0:y[k.ITEM_CODE];z.dataValueField&&(V&&q.some(ee=>ee[z.dataValueField]===V)?U=V:(((R=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:R.trim().toLowerCase())==="$first_row$"||((N=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:N.trim().toLowerCase())==="{first_row}")&&(U=q[0][z.dataValueField]))}}k.FUNCTION_TYPE==="F"?this.setControlValue(k.FUNCTION_ID,k.ITEM_CODE,U):k.FUNCTION_ID===r&&(s.data[k.ITEM_CODE]=U)}});let I=(g=(M=s.context)==null?void 0:M.viewConfig)==null?void 0:g.AUTO_SELECT_MODE;if(I==="2"||I==="3")this.checkGridRow(r,s.data.uid);else if(((L=(P=(F=s.colDef)==null?void 0:F.context)==null?void 0:P.columnConfig)==null?void 0:L.MULTI_ROW_EDIT)==="1"&&((x=s.node)!=null&&x.selected)){const k=this.getGridOptions(r,"multiRowEdit");if(k!==!1&&k!=="0"){let y=!1;(e==null?void 0:e.multiRowEditType)==="all"?s.api.forEachLeafNode(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}):s.api.forEachNodeAfterFilter(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}),y&&s.api.refreshCells({columns:[pt.GridCheckColumnFieldName]})}}if(((S=s.context)==null?void 0:S.viewConfig.SHOW_FOOTER)==="1"&&((O=s.context.viewType)==null?void 0:O.toLowerCase())!=="cardview"&&((A=s.context.viewType)==null?void 0:A.toLowerCase())!=="card"){const k=s.api.getModel();s.api.setPinnedBottomRowData([{...(w=k==null?void 0:k.rootNode)==null?void 0:w.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[pt.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,C,E,T,v,M;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(g=>{var F,P,L;return((L=(P=(F=g.colDef)==null?void 0:F.context)==null?void 0:P.columnConfig)==null?void 0:L.ALLOW_PRINT)!=="0"}).map(g=>{var F;return(F=g.colDef)==null?void 0:F.colId});cr.exportGridToExcel(s.api,s.columnApi,{fileName:`${u}-${f}-${Y.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,isBandView:((C=(p=i.context)==null?void 0:p.viewType)==null?void 0:C.toLowerCase())==="bandview"||((T=(E=i.context)==null?void 0:E.viewType)==null?void 0:T.toLowerCase())==="band",isShowFooter:((M=(v=i.context)==null?void 0:v.viewConfig)==null?void 0:M.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 l.context.isDetailGrid=!0,l}getGridEditable(r){var n,a;const e=this.getGrid(r);return((a=(n=e==null?void 0:e.gridOptions)==null?void 0:n.context)==null?void 0:a.editable)===!0}getControl(r,e,n){let a;if(this._widgetInstanceInfo[r.trim()]&&this._widgetInstanceInfo[r.trim()][e.trim()]&&(a=this._widgetInstanceInfo[r.trim()][e.trim()]),a==null)if(n&&n.trim().length>0)a=Y.jQuery("#"+this._formId+r+e);else{const i=this.getSingleItemConfigInfo(r,e);if(i.FUNCTION_TYPE&&i.COLUMN_EDIT){const l=i.FUNCTION_TYPE+i.COLUMN_EDIT;n=this.getControlName(l,i.FORMAT_STRING),a=Y.jQuery("#"+this._formId+r+e)}}return a}isControlEmptyValue(r,e,n){let a=!0;const i=this.getControlValue(r,e),l=Object.keys(i);for(let s=0;s<l.length;s++)if(i[l[s]]!==null&&String(i[l[s]]).trim().length>0){a=!1;break}return a}setControlConditionProps(r,e,n="ReadOnly",a,i){if(n=(n==null?void 0:n.trim())||"ReadOnly",(r==null?void 0:r.trim().length)>0){const l=r.trim()+"_"+n+"_"+(e==null?void 0:e.trim());let s=[];if(this._controlConditionProps[l])s=this._controlConditionProps[l];else if(this._configInfo.TSI00GRIDCONDITION&&this._configInfo.TSI00GRIDCONDITION.length>0){const c=this.getSingleViewConfigInfo(r==null?void 0:r.trim());if(c)for(let d=0;d<this._configInfo.TSI00GRIDCONDITION.length;d++){const u=this._configInfo.TSI00GRIDCONDITION[d];if(Y.toString(u.FUNCTION_ID,!0)!==r||(e==null?void 0:e.trim().length)>0&&Y.toString(u.OPERATE_NAME,!0)!==(e==null?void 0:e.trim())||c.MATCH_FLAG==="1"&&Y.toString(u.COMPANY_CODE,!0)!==pt.CompanyCode||Y.toString(u.FIELD_NAME_ARRAY,!0).length===0)continue;const f=Y.toString(u.FIELD_NAME_ARRAY,!0).split(",");u.FIELD_NAME_ARRAY=f,s.push(u)}}if(s.length>0){this._controlConditionProps[l]=s;const c=this.getAllControlValue(r);s.forEach(d=>{const u=d.FIELD_NAME_ARRAY;let f=a??d.PROP_VALUE??"default";u.forEach(h=>{if(h&&!(i!=null&&i.includes(h))){const p=Y.toString(d.REGULAR_EXPRESS,!0),C=p.length===0||p.replaceAll(" ","")==="1=1"||Y.checkExpressionValid(c,Y.getSystemFormatString(p));f=f==!0||f==="1"||Y.toString(f).toLowerCase()==="true",n==="ReadOnly"&&this.setControlReadOnly(r,C?f:"default",h)}})})}}return this}getControlValue(r,e){let n,a;if(r.trim().length>0&&e.trim().length>0){const i=e.split(",").filter(s=>s.trim().length>0);i.length>1&&(a={});const l=this.getLayoutBindModel(r);if(l)for(let s=0;s<i.length;s++){const c=i[s].trim();n=null;const d=this.getLayoutItemOption(r,c,"controlType"),u=this.getLayoutItemOption(r,c,"field");if((u==null?void 0:u.trim().length)>0?n=l[u.trim()]:this._hiddenFields[r.trim()]?n=this._hiddenFields[r.trim()][c]||"":n=l[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(r,c,"rangePickerStartKey"),h=this.getLayoutItemOption(r,c,"rangePickerEndKey");n=[l[f]||null,l[h]||null]}i.length>1?a[c]=n:a=n}}return a}getControlText(r,e){let n,a;if(r.trim().length>0&&e.trim().length>0){const i=e.split(",");i.length>1&&(a={});const l=this.getLayoutBindModel(r);if(l)for(let s=0;s<i.length;s++){const c=i[s].trim();if(n=null,c.length===0)continue;const d=this.getLayoutItemOption(r,c,"field"),u=this.getLayoutItemOption(r,c,"controlType");let f=this.getLayoutItemOption(r,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=l[d.trim()]:this._hiddenFields[r.trim()]?n=this._hiddenFields[r.trim()][c]||"":n=l[c],n==null)a="";else{if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect"].includes(u))n=this.getDropDownSelectedText(r,c,n);else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u))n=Y.toDateTime(n,"Dayjs").format(f);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const h=this.getLayoutItemOption(r,c,"rangePickerStartKey"),p=this.getLayoutItemOption(r,c,"rangePickerEndKey"),C=l[h]||null,E=l[p]||null;n=Y.toDateTime(C,"Dayjs").format(f)+"&"+Y.toDateTime(E,"Dayjs").format(f)}else u==="antInputNumber"&&(n=Y.formatNumberValue(n,f));i.length>1?a[c]=n:a=n}}}return a}setControlValue(r,e,n){if(Y.isNullOrEmpty(r)||Y.isNullOrEmpty(e))return this;const a=this.getLayoutBindModel(r==null?void 0:r.trim()),i=this.getLayoutBindForm(r==null?void 0:r.trim()),l=this.getLayoutItemOption(r,e,"controlType"),s=this.getLayoutItemOption(r,e,"field")||(e==null?void 0:e.trim());if(a&&s){if(Y.toString(n).trim()===Y.toString(a[s]).trim())return this;let c=!0;if(n===void 0&&(n=null,c=!1),["antMultiSelect","erMultiSelect"].includes(l))n?n instanceof Array?a==null||a.set(s,n,r):typeof n=="string"?a==null||a.set(s,n.split(","),r):a==null||a.set(s,[],r):a==null||a.set(s,[],r);else if(n!==null&&(l!=null&&l.startsWith("antCheckbox")||l!=null&&l.startsWith("antSwitch")))a==null||a.set(s,Y.toString(n)==="1"||Y.toString(n).toLowerCase()==="true",r);else if(n!==null&&["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(l))a==null||a.set(s,Y.toDateTime(n,"Dayjs"),r);else if(n instanceof Array&&n.length===2&&["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(l)){const d=this.getLayoutItemOption(r,e,"rangePickerStartKey"),u=this.getLayoutItemOption(r,e,"rangePickerEndKey");n[0]!==void 0&&(a==null||a.set(d,Y.toDateTime(n[0],"Dayjs"),r)),n[1]!==void 0&&(a==null||a.set(u,Y.toDateTime(n[1],"Dayjs"),r))}else a==null||a.set(s,n,r);c&&setTimeout(()=>{i==null||i.validate(s)})}if(this._layoutConditionStyleInfo[r]){const c=this._layoutConditionStyleInfo[r];Object.keys(c).forEach(d=>{var u,f;(d===e||((f=(u=c[d])==null?void 0:u.condition)==null?void 0:f.indexOf(e))>-1)&&this.setLayoutConditionStyle(r,d)})}return this}setControlValueEx(r,e,...n){const a=Object.keys(e);return(a==null?void 0:a.length)>0&&(n.length===1&&(n=n[0].split(",")),n.length>0?n.forEach(i=>{(e==null?void 0:e[i])!==void 0&&this.setControlValue(r,i,e[i])}):a.forEach(i=>{(e==null?void 0:e[i])!==void 0&&this.setControlValue(r,i,e[i])})),this}setControlCss(r,e,n){if((r==null?void 0:r.trim().length)>0&&(n==null?void 0:n.length)>0){let a;e instanceof Array?a=e:a=e.split(","),a&&a.length>0&&a.forEach(i=>{if(i.trim().length>0){const l=this.getLayoutItemOption(r,i,"controlType");let s=document.getElementsByName(this.FormId+r+i);if((s==null?void 0:s.length)>0){let c;switch(l){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+r+i);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&&Y.jQuery(c).css(d.property,d.value):d.value!==void 0&&Y.jQuery(s).css(d.property,d.value)})}else s=document.getElementById(this.FormId+r+i),s&&n.forEach(c=>{c.value!==void 0&&Y.jQuery(s).css(c.property,c.value)})}})}return this}setModelDefalutValue(r,e,n,a){let i;e instanceof Array?i=e:i=e.split(",");const l=(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]:a&&(u=a),u&&u.trim().length>0&&r.schemaFields[c].type){if(r.schemaFields[c].type==="datetime")r.set(c,Y.getDateTimeByString(u),s);else if(r.schemaFields[c].type==="boolean")r.set(c,u==="1"||u.toLowerCase()==="true",s);else if(r.schemaFields[c].type==="number")r.set(c,u,s);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(u)){const C=(h=(f=this._dropDownBindSource)==null?void 0:f[s])==null?void 0:h[c];((p=C==null?void 0:C.dataSource)==null?void 0:p.length)>0&&(C!=null&&C.dataValueField)?u==="$FIRST_ROW$"?u=C.dataSource[0][C.dataValueField]:u==="$LAST_ROW$"?u=C.dataSource[C.dataSource.length-1][C.dataValueField]:u==="$ALL_VALUES$"&&(u="",C.dataSource.forEach(E=>{u=u.length===0?E[C.dataValueField]:u+","+E[C.dataValueField]})):u="",r.set(c,u,s)}else r.set(c,this.getDefaultStringValue(u),s);this.setControlValue(s,c,r[c])}};return n&&n.trim().length>0?i.forEach(s=>{s=this.getConfigIdbyLayoutName(s),r&&n&&r.schemaFields&&r.schemaFields[n]&&l(s,n)}):i.forEach(s=>{s=this.getConfigIdbyLayoutName(s);const c=this.getConfigInfo(s);c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{n=d.ITEM_CODE,r&&n&&r.schemaFields&&r.schemaFields[n]&&l(s,n)})}),this}setModelValue(r,e,...n){return Dr.setModelValue(r,e,...n),this}setModelEmptyValue(r,...e){return e.length===1&&(e=e[0].split(",")),e.length>0?e.forEach(n=>{r&&r[n]!==void 0&&r.set(n,null)}):r.schemaFields&&Object.keys(r.schemaFields).forEach(n=>{r.set(n,null)}),this}setControlReadOnlyEx(r,e){return e&&Object.keys(e).forEach(n=>{this.setControlReadOnly(r,e[n],n)}),this}setControlReadOnly(r,e,...n){if(Y.isNullOrEmpty(r))return this;n.length===1&&(n=n[0].split(",")),r=this.getConfigIdbyLayoutName(r);for(const a of n){const i=this.getSingleItemConfigInfo(r,a);let l=!0,s=!1;i.FUNCTION_TYPE&&i.COLUMN_EDIT&&(e!=="default"&&!e&&i.READ_ONLY==="1"&&(i.COLUMN_EDIT!=="1"||i.ALLOW_EDIT!=="1")||(e==="default"?(s=i.READ_ONLY==="1"||i.FUNCTION_TYPE!=="F"&&i.ALLOW_EDIT!=="1",l=i.ALLOW_EDIT==="1"):(s=e,l=!s),this.setLayoutItemOption(r,a,{readOnly:s}),i.COLUMN_EDIT==="1"&&this.setLayoutItemOption(r,a,{buttonEnable:l})))}return this}setAllControlReadOnly(r,e){let n;return r instanceof Array?n=r:n=r.split(","),n&&n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{this.setControlReadOnly(a.trim(),e,l.ITEM_CODE)})}}),this}setControlEnable(r,e,...n){if(Y.isNullOrEmpty(r))return this;n.length===1&&(n=n[0].split(",")),r=this.getConfigIdbyLayoutName(r);for(const a of n){const i=this.getSingleItemConfigInfo(r,a);let l=!0;i.FUNCTION_TYPE&&i.COLUMN_EDIT&&(e==="default"?l=i.ALLOW_EDIT==="1":l=e,this.setLayoutItemOption(r,a,{allowEdit:l}),i.COLUMN_EDIT==="1"&&this.setLayoutItemOption(r,a,{buttonEnable:l}))}return this}setAllControlEnable(r,e){let n;return r instanceof Array?n=r:n=r.split(","),n&&n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{this.setControlEnable(a.trim(),e,l.ITEM_CODE)})}}),this}setControlEmptyValue(r,...e){if(e.length===1&&(e=e[0].split(",")),!e||e.length===0){const n=this.getConfigInfo(r);n.TSI00GRIDVIEW&&n.TSI00GRIDVIEW.length>0&&n.TSI00GRIDVIEW[0].FUNCTION_TYPE==="F"&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(a=>{this.setControlValue(r,a.ITEM_CODE,void 0)})}else e.forEach(n=>{this.setControlValue(r,n,void 0)});return this}setAllControlDefalutValue(r,e=!1){let n;return r instanceof Array?n=r:n=r.split(","),n.length>0&&n.forEach(a=>{if(a.trim().length>0){const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{var s;((s=l.DEFAULT_VALUE)==null?void 0:s.trim().length)>0?this.setControlDefalutValue(a.trim(),l.ITEM_CODE,e):e||this.setControlEmptyValue(a,l.ITEM_CODE)})}}),this}setControlDefalutValue(r,e,n=!1){var a,i,l,s;if(Y.isNullOrEmpty(r)||Y.isNullOrEmpty(e))return this;if(r=this.getConfigIdbyLayoutName(r),(r==null?void 0:r.trim().length)>0){const c=this.getLayoutBindModel(r),d=this.getSingleItemConfigInfo(r,e),u=((a=this.getLayoutItemOption(r.trim(),e,"field"))==null?void 0:a.value)||e.trim(),f=c==null?void 0:c.get(u==null?void 0:u.trim());if(f!=null&&n)return this;const h=Y.toString(d.DEFAULT_VALUE,!0);if(c&&h.length>0){let p=this.getDefaultStringValue(h),C=null;const E=this.getLayoutItemOption(r.trim(),e,"controlType");if(["antMultiSelect","erMultiSelect","erSelect","erTreeSelect","erMultiTreeSelect","antRadioGroup","erRadioGroup","erCheckboxGroup"].includes(E)&&["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(h)){const T=(l=(i=this._dropDownBindSource)==null?void 0:i[r])==null?void 0:l[e];((s=T==null?void 0:T.dataSource)==null?void 0:s.length)>0&&(T!=null&&T.dataValueField)?h==="$FIRST_ROW$"?p=T.dataSource[0][T.dataValueField]:h==="$LAST_ROW$"?p=T.dataSource[T.dataSource.length-1][T.dataValueField]:["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(E)&&h==="$ALL_VALUES$"&&(p="",T.dataSource.forEach(v=>{p=p.length===0?v[T.dataValueField]:p+","+v[T.dataValueField]})):p=""}if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(E))C=Y.getDateTimeByString(p);else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(E)){const T=p.split(/[|&]/);C=[Y.getDateTimeByString(T[0]),Y.getDateTimeByString(T[1])]}else E==="antInputNumber"?C=Y.toNumber(p):["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(E)?C=p.split(","):E==="antCheckbox"||E==="antSwitch"?C=p==="1"||p.toLowerCase()==="true":C=p;this.setControlValue(r,e,C)}}return this}getFormButtonConfigInfo(r){let e={},n=[];return this._configInfo.TSI00FORMBUTTON&&this._configInfo.TSI00FORMBUTTON.length>0&&(n=this._configInfo.TSI00FORMBUTTON,n.length>0&&n.every((a,i)=>a.BUTTON_NAME===r?(e=a,!1):!0)),e}getSystemGlobalOptions(){let r={};const e=this.getFormSysInfo("SystemGlobalOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getLayoutGlobalOptions(){let r={};const e=this.getFormSysInfo("LayoutDefaultOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getGridGlobalOptions(){let r={};const e=this.getFormSysInfo("GridDefaultOptions");return e.trim().length>0&&(r=JSON.parse(e)),r}getFormExtentedOptions(){var n,a;let r={};const e=this.getFormSysInfo("FormDefaultOptions");if(e.trim().length>0&&(r={...JSON.parse(e)}),((n=this._configInfo.TSI00FORM)==null?void 0:n.length)>0){const i=this._configInfo.TSI00FORM[0];if(((a=i.EXT_OPTIONS)==null?void 0:a.trim().length)>0){const l=JSON.parse(i.EXT_OPTIONS);r={...r,...l}}}return r}resetLayout(r){let e;return r instanceof Array?e=r:e=r.split(","),e.length>0&&e.forEach(n=>{if(n.trim().length>0){const a=this.getConfigInfo(n.trim());a.TSI00GRIDVIEW&&a.TSI00GRIDCOLUMN&&a.TSI00GRIDCOLUMN.forEach(i=>{i.DEFAULT_VALUE&&i.DEFAULT_VALUE.trim().length>0?this.setControlDefalutValue(n.trim(),i.ITEM_CODE):this.setControlValue(n.trim(),i.ITEM_CODE,void 0)}),o.nextTick(()=>{this.resetValidator(n.trim())})}}),this}getAllControlValue(r,e,n=!1){const a={};return(r instanceof Array?r:r.split(",")).forEach(l=>{if((l==null?void 0:l.trim().length)>0){const s=this.getLayoutBindModel(l.trim());if(s){const c=this.getConfigInfo(l.trim());c.TSI00GRIDVIEW&&c.TSI00GRIDCOLUMN&&c.TSI00GRIDCOLUMN.forEach(d=>{var p,C,E,T;const u=this.getLayoutItemOption(l,d.ITEM_CODE,"controlType"),f=this.getLayoutItemOption(l,d.ITEM_CODE,"field")||d.ITEM_CODE,h=Y.toNumber(d.MAX_LENGTH);if(f&&(d.IS_VISIBLE==="1"||n===!1)){let v=s[f];if(u==="antCheckbox"||u==="antSwitch")v=v===!0?"1":"0",a[f]=v;else if(u==="antInputNumber")v=v||0,a[f]=v;else if(["antTimePicker","antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(u)&&v){const M=Y.toString(d.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss",g=Y.getDateTimeFormatString(v,M);g.substring(0,4)==="0001"||g.substring(0,4)==="1900"||g.substring(0,4)==="1901"?v="":(v=g,h>0&&h<v.length&&(v=v.substring(0,h))),a[f]=v}else if(["antDateTimeRangePicker","antDateRangePicker","antMonthRangePicker","antYearRangePicker"].includes(u)){const M=this.getLayoutItemOption(l,d.ITEM_CODE,"rangePickerStartKey"),g=this.getLayoutItemOption(l,d.ITEM_CODE,"rangePickerEndKey"),F=Y.toString(d.DATE_TIME_FORMAT,!0);let P="yyyyMMddHHmmss",L="yyyyMMddHHmmss";if(F.length>0){const O=F.split(/[|&]/);((p=O[0])==null?void 0:p.trim().length)>=6&&((C=O[0])==null?void 0:C.trim().toLowerCase())!=="yyyymmdd"&&(P="yyyyMMdd"+O[0].substring(0,6)),((E=O[1])==null?void 0:E.trim().length)>=6&&((T=O[1])==null?void 0:T.trim().toLowerCase())!=="yyyymmdd"&&(L="yyyyMMdd"+O[1].substring(0,6))}let x=Y.getDateTimeFormatString(s[M],P),S=Y.getDateTimeFormatString(s[g],L);(x.substring(0,4)==="0001"||x.substring(0,4)==="1900"||x.substring(0,4)==="1901")&&(x=""),(S.substring(0,4)==="0001"||S.substring(0,4)==="1900"||S.substring(0,4)==="1901")&&(S=""),h>0&&(x.length>h&&(x=x.substring(0,h)),S.length>h&&(S=S.substring(0,h))),a[M]=x,a[g]=S}else["antMultiSelect","erMultiSelect","erCheckboxGroup"].includes(u)&&v&&v instanceof Array?(v=v.join(","),a[f]=v):(v=v||"",a[f]=v)}})}}}),e&&Object.keys(e).length>0&&Object.keys(e).forEach(l=>{a[l]=e[l]}),a}getAllControlValueAsFilterArray(r,e){const n=[];return(r instanceof Array?r:r.split(",")).forEach(i=>{const l=this.getConfigInfo(i);l.TSI00GRIDVIEW&&l.TSI00GRIDCOLUMN&&l.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(i,s.ITEM_CODE,"controlType"),p={};e&&Object.keys(e).length>0?Object.keys(e).forEach(v=>{p[v]=e[v]}):p.QUERY_TYPE="",p.ITEM_CODE=Y.toString(s.ITEM_CODE,!0,"toLower"),p.ORIGIN_CODE=s.ORIGIN_CODE,p.TABLE_NAME=s.TABLE_NAME,p.FIELD_NAME=Y.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 C=Y.toString(p.PARA_GROUP,!0),E=Y.toString(p.OPERATOR,!0);let T=this.getControlValue(i,s.ITEM_CODE)||"";if(E.length>0)switch(h){case"antRadioGroup":case"erRadioGroup":case"erSelect":case"erTreeSelect":{p.OP_VALUE=T,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)),(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antInputNumber":{p.DATA_TYPE="Decimal",p.OP_VALUE=T,p.OP_VALUE===null&&(p.OP_VALUE=0),(C==="2"||Y.toNumber(p.OP_VALUE)!==0)&&(p.OP_VALUE=Y.toString(p.OP_VALUE),n.push(p));break}case"antCheckbox":case"antSwitch":{p.OPERATOR="=",p.OP_VALUE=T===!0?"1":T===!1?"0":"",(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}case"antMultiSelect":case"erMultiSelect":case"erCheckboxGroup":case"erMultiTreeSelect":{p.OPERATOR="IN",T&&T instanceof Array&&T.length>0?T=T.join(","):T&&typeof T=="string"&&T.length>0?T=T:T="",p.OP_VALUE=T,(C==="2"||T.length>0)&&n.push(p);break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{if(T){const v=Y.toString(s.DATE_TIME_FORMAT,!0)||"yyyyMMddHHmmss";p.OP_VALUE=Y.getDateTimeFormatString(T,v),p.OP_VALUE.length>=4&&(p.OP_VALUE.substring(0,4)==="0001"||p.OP_VALUE.substring(0,4)==="1900")&&(p.OP_VALUE=""),(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p)}break}case"antDateTimeRangePicker":case"antDateRangePicker":case"antMonthRangePicker":case"antYearRangePicker":{if(T instanceof Array&&T.length===2){const v=Y.toString(s.DATE_TIME_FORMAT,!0);let M="yyyyMMddHHmmss",g="yyyyMMddHHmmss";if(v.length>0){const x=v.split(/[|&]/);((c=x[0])==null?void 0:c.trim().length)>=6&&((d=x[0])==null?void 0:d.trim().toLowerCase())!=="yyyymmdd"&&(M="yyyyMMdd"+x[0].substring(0,6)),((u=x[1])==null?void 0:u.trim().length)>=6&&((f=x[1])==null?void 0:f.trim().toLowerCase())!=="yyyymmdd"&&(g="yyyyMMdd"+x[1].substring(0,6))}let F=Y.getDateTimeFormatString(T[0],M),P=Y.getDateTimeFormatString(T[1],g);(F.substring(0,4)==="0001"||F.substring(0,4)==="1900"||F.substring(0,4)==="1901")&&(F=""),(P.substring(0,4)==="0001"||P.substring(0,4)==="1900"||P.substring(0,4)==="1901")&&(P="");const L=p.ITEM_CODE;(C==="2"||F.length>0)&&n.push({...p,ITEM_CODE:`${L}_beg`,OPERATOR:">=",OP_VALUE:F}),(C==="2"||P.length>0)&&n.push({...p,ITEM_CODE:`${L}_end`,OPERATOR:"<=",OP_VALUE:P})}break}default:{Y.toString(T,!0).length>0&&E==="IN"&&(T=T.split(/\n|\t|,|,/).map(v=>v.trim()).filter(v=>v.length>0).join(",")),p.OP_VALUE=T,(C==="2"||p.OP_VALUE.trim().length>0)&&n.push(p);break}}}})}),n}expandLayoutGroup(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++)if(e[n].trim().length>0){const a=document.getElementById(this.FormId+e[n].trim()+"_content");a&&Y.jQuery(a).show()}return this}collapseLayoutGroup(r){let e=[];r&&(r instanceof Array?e=r:e=r.split(",")),e.length===0&&(e=this.getAllConfigIdArray());for(let n=0;n<e.length;n++)if(e[n].trim().length>0){const a=document.getElementById(this.FormId+e[n].trim()+"_content");a&&Y.jQuery(a).hide()}return this}getFormCodeSetFilter(r,e){let n="";if(this._configInfo[this._formName+r]){for(const a of this._configInfo[this._formName+r])if(a.CODE===e){n=a.SQL_CONTENT;break}}return n}getQuerySqlFormat(r,e){return Y.getSystemFormatString(r,e)}getFormSysInfo(r){return this._configInfo[pt.SystemParamsBlockName]&&this._configInfo[pt.SystemParamsBlockName].length>0&&r.trim().length>0?Y.toString(this._configInfo[pt.SystemParamsBlockName][0][r.trim().toUpperCase()]):""}getSysParaValue(r,e,n){return new Promise((a,i)=>{if(this._sysParaInfo&&this._sysParaInfo[r]!==void 0&&this._sysParaInfo[r][e]!==void 0)a(this._sysParaInfo[r][e].toString());else if(e&&e.trim().length>0){let l="";const s=st.buildMap([{QUERY_TYPE:"system_para",COMPANY_CODE:r,CTRL_CODE:e,EFFECT_ELEMENT_VALUE:n||""}]);Gr.callServiceEx(pt.queryDevConfigService,s,{partition:this._serverPartition}).then(c=>{c.sysFlag>=0&&c.contains("TSIFIAA51")&&c.getMapData("TSIFIAA51").length>0?l=Y.toString(c.getMapData("TSIFIAA51")[0].CTRL_NUM):c.sysFlag>=0&&c.contains(pt.SystemParamsBlockName)&&c.getMapData(pt.SystemParamsBlockName).length>0&&(l=Y.toString(c.getMapData(pt.SystemParamsBlockName)[0][e.toUpperCase()])),this._sysParaInfo[r]===void 0&&(this._sysParaInfo[r]={}),this._sysParaInfo[r][e]=l,a(l)},()=>{this._sysParaInfo[r]===void 0&&(this._sysParaInfo[r]={}),this._sysParaInfo[r][e]="",a("")})}})}getDefaultStringValue(r){return r.trim().length>14&&r.trim().substring(0,13)==="$FormSysInfo."&&r.trim().substring(r.trim().length-1,r.trim().length)==="$"?r=this.getFormSysInfo(r.trim().substring(13,r.trim().length-1)):r=Y.getSystemFormatString(r),r}setCustomDefaultValue(r,e){(r==null?void 0:r.trim().length)>0&&e&&(this._customDefaultValues[r.trim()]=e)}getLayoutConfigDefaultValues(r){const e={};let n;return r instanceof Array?n=r:n=r.split(","),n.length>0&&n.forEach(a=>{const i=this.getConfigInfo(a.trim());i.TSI00GRIDVIEW&&i.TSI00GRIDCOLUMN&&i.TSI00GRIDCOLUMN.forEach(l=>{var s,c,d;if(l.DEFAULT_VALUE&&l.DEFAULT_VALUE.trim().length>0){const u=l.FUNCTION_TYPE+l.COLUMN_EDIT,f=l.DEFAULT_VALUE,h=this.getControlName(u,l.FORMAT_STRING);if(h&&h.trim().length>0&&f.trim().length>0)switch(h){case"antInputNumber":{e[l.ITEM_CODE]=parseFloat(f);break}case"erCheckboxGroup":case"antMultiSelect":case"erMultiSelect":{const p=this.getDefaultStringValue(f).split(",");e[l.ITEM_CODE]=p;break}case"antCheckbox":case"antSwitch":{e[l.ITEM_CODE]=Y.toString(f)==="1"||Y.toString(f)==="true";break}case"antTimePicker":case"antYearPicker":case"antMonthPicker":case"antDatePicker":case"antDateTimePicker":{e[l.ITEM_CODE]=Y.getDateTimeByString(f);break}default:{if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(f)){const p=(c=(s=this._dropDownBindSource)==null?void 0:s[a])==null?void 0:c[l.ITEM_CODE];((d=p==null?void 0:p.dataSource)==null?void 0:d.length)>0&&(p!=null&&p.dataValueField)?f==="$FIRST_ROW$"?e[l.ITEM_CODE]=p.dataSource[0][p.dataValueField]:f==="$LAST_ROW$"?e[l.ITEM_CODE]=p.dataSource[p.dataSource.length-1][p.dataValueField]:f==="$ALL_VALUES$"&&(e[l.ITEM_CODE]="",p.dataSource.forEach(C=>{e[l.ITEM_CODE]=e[l.ITEM_CODE].length===0?C[p.dataValueField]:e[l.ITEM_CODE]+","+C[p.dataValueField]})):e[l.ITEM_CODE]=""}else e[l.ITEM_CODE]=this.getDefaultStringValue(f);break}}}})}),e}getGridConfigDefaultValues(r){const e={},n=this.getConfigInfo(r.trim()),a=this.getBindingTable(r.trim());return a&&n.TSI00GRIDVIEW&&n.TSI00GRIDCOLUMN&&n.TSI00GRIDCOLUMN.forEach(i=>{var l,s,c;if(a.options.schema&&i.DEFAULT_VALUE&&i.DEFAULT_VALUE.trim().length>0){const d=a.options.schema[i.FIELD_NAME].type;if(d==="datetime")e[i.FIELD_NAME]=Y.getDateTimeByString(i.DEFAULT_VALUE);else if(d==="boolean")e[i.FIELD_NAME]=i.DEFAULT_VALUE==="1"||i.DEFAULT_VALUE.toLowerCase()==="true";else if(d==="number")e[i.FIELD_NAME]=Y.toNumber(i.DEFAULT_VALUE);else if(["$FIRST_ROW$","$LAST_ROW$","$ALL_VALUES$"].includes(i.DEFAULT_VALUE)){const u=(s=(l=this._dropDownBindSource)==null?void 0:l[r])==null?void 0:s[i.ITEM_CODE];((c=u==null?void 0:u.dataSource)==null?void 0:c.length)>0&&(u!=null&&u.dataValueField)?i.DEFAULT_VALUE==="$FIRST_ROW$"?e[i.FIELD_NAME]=u.dataSource[0][u.dataValueField]:i.DEFAULT_VALUE==="$LAST_ROW$"?e[i.FIELD_NAME]=u.dataSource[u.dataSource.length-1][u.dataValueField]:i.DEFAULT_VALUE==="$ALL_VALUES$"&&(e[i.FIELD_NAME]="",u.dataSource.forEach(f=>{e[i.FIELD_NAME]=e[i.FIELD_NAME].length===0?f[u.dataValueField]:e[i.FIELD_NAME]+","+f[u.dataValueField]})):e[i.FIELD_NAME]=""}else e[i.FIELD_NAME]=this.getDefaultStringValue(i.DEFAULT_VALUE)}}),e}async loadGrid(r,e,n,a,i){var l,s,c,d,u,f,h,p,C,E,T;if(!this.containsConfig(r)&&(n==null?void 0:n.forceLoadConfig)!==!1&&await this.loadConfig(r),this.containsConfig(r)){if(this._gridInstanceInfo[r]&&(n==null?void 0:n.reload)!==!0)return console.error(`Grid instance ${r} already exists!`),!1;const v=this.getSingleViewConfigInfo(r);this.setGridToolbarVisible(r,{refresh:v.SHOW_REFRESH==="1",addrow:v.SHOW_ADD==="1",copyrow:v.SHOW_ADDCOPY==="1",delete:v.SHOW_DELETE==="1",cancel:v.SHOW_ADD==="1"||v.SHOW_ADDCOPY==="1"||v.SHOW_DELETE==="1",excel:v.SHOW_EXPORT==="1",import:v.ALLOW_IMPORT==="1"}),this._gridColumnsConfigInfo[r]={},this._allowMergeColumnFields[r]=[],this._gridStyleInfo[r]=this._gridStyleInfo[r]||[],this._gridOptions[r]=this._gridOptions[r]||{};const M=this.getConfigInfo(r);if((l=e==null?void 0:e.gridOptions)!=null&&l.api&&M.TSI00GRIDVIEW&&M.TSI00GRIDVIEW.length>0){const g=M.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())||g.TABLE_NAME.trim(),n.cloneTableName.trim(),r),e.gridOptions.context={configId:r,configCaption:g.FUNCNAME_RES||g.FUNCNAME,options:n},n=n||{},g.SHOW_GROUP==="2"?n.groupDisplayType="singleColumn":g.SHOW_GROUP==="3"?n.groupDisplayType="multipleColumns":n.groupDisplayType="groupRows",((d=g.CUS_EXT_OPTIONS)==null?void 0:d.trim().length)>0&&(n={...JSON.parse(g.CUS_EXT_OPTIONS),...n}),((u=g.EXT_OPTIONS)==null?void 0:u.trim().length)>0&&(n={...JSON.parse(g.EXT_OPTIONS),...n});const F=this.getFormSysInfo("GridDefaultOptions");F.trim().length>0&&(n={...JSON.parse(F),...n}),["disableErMenu","rowDragManaged","groupIncludeFooter","groupIncludeTotalFooter","suppressRowTransform","suppressRowClickSelection","rowMultiSelectWithClick","singleClickEdit"].forEach(S=>{const O=e.gridOptions[S]??n[S];O!==void 0&&(n[S]=O)}),n.groupDisplayType=n.groupDisplayType||e.gridOptions.groupDisplayType||this.getFormSysInfo("GRIDGROUPDISPLAYTYPE")||"groupRows",n.rowHeight=n.rowHeight||e.gridOptions.rowHeight;const L=this.getGridConfigOptions(r,n,a,i);L.context={...e.gridOptions.context,...L.context},L&&Object.keys(L).forEach(S=>{e.gridOptions[S]=L[S]!==void 0?L[S]:e.gridOptions[S]}),e.gridOptions.defaultColDef=e.gridOptions.defaultColDef||{},e.gridOptions.rowSelection=M.TSI00GRIDVIEW[0].MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single",e.gridOptions.api.selectionService.rowSelection=e.gridOptions.rowSelection,e.gridOptions.api.selectionService.groupSelectsChildren=!0,e.gridOptions.api.setColumnDefs(L.columnDefs),e.gridOptions.api.setRowData([]);const x=(i==null?void 0:i.pagination)===!0||(i==null?void 0:i.pagination)==="client";if(g.ALLOW_CELLMERGE==="1"&&!x&&((f=e.gridOptions.context.mergeColumns)==null?void 0:f.length)>0&&!n.masterDetail&&(e.gridOptions.context.calculateRowSpan=(S=!0)=>{var I,k,y,R,N,U;let O=[];const A=e.gridOptions.columnApi.getRowGroupColumns(),w={};if(A.length===0){S?O=e.gridOptions.context.bindingSource.data():e.gridOptions.api.forEachNodeAfterFilterAndSort(b=>{var W;(W=b.data)!=null&&W.uid&&O.push(b.data)});const V=((y=(k=(I=e.gridOptions.context)==null?void 0:I.viewConfig)==null?void 0:k.MERGE_COLUMN)==null?void 0:y.trim().length)>0?(U=(N=(R=e.gridOptions.context)==null?void 0:R.viewConfig)==null?void 0:N.MERGE_COLUMN)==null?void 0:U.trim().split(","):[];e.gridOptions.context.mergeColumns.forEach(b=>{w[b]={};const W={};let q=0;const z=[...V,b];for(let ee=0;ee<O.length;ee++){let Q=!0;for(let G=0;G<z.length;G++){const K=z[G];if(O[ee][K]!==W[K]){Q=!1;break}}if(!Q){if(Object.keys(W).length>0)for(let G=q;G<ee;G++){const K=O[G].uid;w[b][K]=G===q?ee-q:0}z.forEach(G=>{W[G]=O[ee][G]}),q=ee}if(ee===O.length-1)for(let G=q;G<=ee;G++){const K=O[G].uid;w[b][K]=G===q?ee-q+1:0}}})}return e.gridOptions.context.rowSpanMap=w,O[0]}),(g==null?void 0:g.SHOW_FOOTER)==="1"&&((h=e.gridOptions.context.viewType)==null?void 0:h.toLowerCase())!=="cardview"&&((p=e.gridOptions.context.viewType)==null?void 0:p.toLowerCase())!=="card"&&e.gridOptions.api.setPinnedBottomRowData([{pinndeRowType:"ErGridSummaryFooter"}]),o.nextTick(()=>{var S;e.gridOptions.defaultColDef.floatingFilter===void 0&&e.gridOptions.api.setDefaultColDef({floatingFilter:(g==null?void 0:g.SHOW_FILTER_ROW)==="1"}),((S=n==null?void 0:n.initialData)==null?void 0:S.length)>0&&this.mergeDataToGrid(n.initialData,e)}),e.gridOptions.processCellForClipboard=S=>{var O,A,w,I,k,y,R,N;return(w=(A=(O=S.column)==null?void 0:O.colDef)==null?void 0:A.context)!=null&&w.hideContent?"******":(I=S.node)!=null&&I.footer&&((k=S.node)!=null&&k.group)&&((y=S.context)!=null&&y.focusColId)&&S.node.aggData&&S.node.aggData[S.context.focusColId]?Ir.isPlainObject(S.node.aggData[S.context.focusColId])?`☑️ ${Y.formatNumberValue(S.node.aggData[S.context.focusColId].aggValueOfChecked,"")}
|
|
72
72
|
∑ ${Y.formatNumberValue(S.node.aggData[S.context.focusColId].aggValue,"")}`:S.node.aggData[S.context.focusColId]:((R=S.context)==null?void 0:R.copyValue)!==!0&&((N=S.column)!=null&&N.colDef.valueFormatter)?S.column.colDef.valueFormatter(S):S.value},n.SORT_FIELD_NAME=((C=n.SORT_FIELD_NAME)==null?void 0:C.trim())||g.SORT_FIELD_NAME,((E=n.SORT_FIELD_NAME)==null?void 0:E.trim().length)>0){const S=n.SORT_FIELD_NAME.split(","),O=[];S.forEach((w,I)=>{const k=w.trim().split(" ");if(k.length>0){const y={colId:k[0].trim().toUpperCase(),sort:"asc",sortIndex:I};k.length>1&&k[1].trim().toLowerCase()==="desc"&&(y.sort=k[1].trim().toLowerCase()),O.push(y)}}),e.gridOptions.columnApi.applyColumnState({state:O});const A=(T=e.gridOptions.api)==null?void 0:T.getStatusPanel("InformationPanel");A&&A.setInformation()}this.setGridMainMenuItems(e,n),this.setGridContextMenu(e,n),this.setGridRowStyle(e,n),this.setGridInitialEvent(e,n),this._gridInstanceInfo[r]=e}return!0}return!1}getGridConfigOptions(r,e,n,a){var s,c,d,u;this._gridColumnsConfigInfo[r]={},this._allowMergeColumnFields[r]=[],this._gridStyleInfo[r]=this._gridStyleInfo[r]||[],this._gridOptions[r]=this._gridOptions[r]||{};const i={},l=this.getConfigInfo(r);if(l.TSI00GRIDVIEW&&l.TSI00GRIDVIEW.length>0){const f=l.TSI00GRIDVIEW[0],h=l.TSI00GRIDCOLUMN;i.statusBar={statusPanels:[{statusPanel:"ToolbarButton"}]},i.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"}},{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"},font:{fontSize:12,fontName:"Wingdings 2",bold:!0}},{id:"right-cell",alignment:{horizontal:"Right"}},{id:"left-cell",alignment:{horizontal:"Left"}},{id:"center-cell-string",dataType:"String",alignment:{horizontal:"Center"}},{id:"right-cell-string",dataType:"String",alignment:{horizontal:"Right"}},{id:"left-cell-string",dataType:"String",alignment:{horizontal:"Left"}}],e=e||{},e.rowDragManaged=e.rowDragManaged??f.ALLOW_DRAG.toString()==="1",e.enableHeaderTooltip=e.enableHeaderTooltip??!0,e.enableCellTooltip=e.enableCellTooltip??!0,e.rowHeight=e.rowHeight?e.rowHeight:Y.toNumber(f.ROWHIGH)>0?Y.toNumber(f.ROWHIGH):void 0;const p=f.MULTI_SELECT_MODE.toString()!=="1"?"multiple":"single";Y.toNumber(f.DISPLAY_WIDTH)>0&&this.setGridOptions(r,"miniHeight",Y.toNumber(f.DISPLAY_WIDTH)+"px",!0),this.setGridOptions(r,"ShowQuickFilter",f.ALLOW_FIND_MODE,!0),this.setGridOptions(r,"RowSelection",p,!0),this.setGridOptions(r,"toolbarStyle",e.toolbarStyle,!0),i.rowSelection=p,i.treeData=f.FUNCTION_TYPE==="T",i.columnDefs=this.getGridColumnDefs(r,l,i,e),i.rowData=[],i.rowHeight=e.rowHeight,i.groupHeaderHeight=e.groupHeaderHeight,i.groupIncludeFooter=e.groupIncludeFooter??(f.SHOW_FOOTER==="1"&&e.aggDataInGroupRow!==!0),i.groupIncludeTotalFooter=e.groupIncludeTotalFooter??f.SHOW_FOOTER==="1",(((s=e==null?void 0:e.viewType)==null?void 0:s.toLowerCase())==="cardview"||((c=e==null?void 0:e.viewType)==null?void 0:c.toLowerCase())==="card")&&(i.groupIncludeFooter=!1,i.groupIncludeTotalFooter=!1),i.getRowId=E=>E.data.uid,i.gridId=r,i.suppressRowTransform=e.suppressRowTransform??!0,i.suppressRowClickSelection=e.suppressRowClickSelection??f.AUTO_SELECT_MODE.toString()!=="4",i.rowMultiSelectWithClick=e.rowMultiSelectWithClick??!0,i.singleClickEdit=e.singleClickEdit??!0,i.enableCellChangeFlash=e.enableCellChangeFlash??!1,i.rowBuffer=e.rowBuffer??10,i.debug=e.debug??!1,i.suppressCopyRowsToClipboard=e.suppressCopyRowsToClipboard??!1,i.suppressExcelExport=e.suppressExcelExport??!1,i.enableRangeHandle=!0,i.showOpenedGroup=!0,i.suppressPaginationPanel=!0,i.paginateChildRows=!0,i.stopEditingWhenCellsLoseFocus=!0,i.enableCellExpressions=!0,i.defaultColGroupDef={cellClass:"left-cell"},i.groupDisplayType=i.treeData?void 0:e.groupDisplayType||this.getFormSysInfo("GridGroupDisplayType")||"groupRows",i.context.rowSpanMap&&(i.suppressRowTransform=!0),i.groupDisplayType==="groupRows"&&(i.groupRowRendererParams={checkbox:p==="multiple"&&f.SHOW_SELECTION.toString()==="1",suppressCount:e.aggDataInGroupRow===!0,innerRenderer:E=>{var T,v,M,g,F,P,L,x,S;if((v=(T=E.node)==null?void 0:T.rowGroupColumn)!=null&&v.colDef){const O=(g=(M=E.node)==null?void 0:M.rowGroupColumn)==null?void 0:g.colDef;let A=E.node.key;if(O.cellDataType==="number"?A=Y.formatNumberValue(E.value,(P=(F=O.context)==null?void 0:F.columnConfig)==null?void 0:P.FORMAT_STRING):((L=O.cellEditor)==null?void 0:L.name)==="DatetimeEditor"?A=Y.getDateTimeFormatString(E.value,(S=(x=O.context)==null?void 0:x.columnConfig)==null?void 0:S.FORMAT_STRING):O.refData&&(A=O.refData[E.value]||E.value),e.aggDataInGroupRow===!0){let I=`
|
|
73
73
|
<div style="display: inline-block">
|
|
74
74
|
<span>${`${A}(${E.node.allChildrenCount})`}</span>`;return E.node.aggData&&Object.keys(E.node.aggData).length>0&&Object.keys(E.node.aggData).forEach(k=>{var V,b,W,q;const y=(V=E.columnApi.getColumn(k))==null?void 0:V.colDef,R=((b=y.headerName)==null?void 0:b.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||k,N=(q=(W=y.context)==null?void 0:W.columnConfig)==null?void 0:q.FORMAT_STRING,U=E.node.aggData[k];I+=`<span class="er-grid-group-row-col">${R}:</span>`,Ir.isPlainObject(U)?I+=`<span class="er-grid-group-row-agg">${Y.formatNumberValue(U.aggValueOfChecked,N)+"/"+Y.formatNumberValue(U.aggValue,N)}</span>`:I+=`<span class="er-grid-group-row-agg">${Y.formatNumberValue(U,N)}</span>`}),I+="</div>",I}else return A}else return E.value}}),i.treeData?(i.getDataPath=E=>E[pt.TreeHierarchyFieldName],i.animateRows=(e==null?void 0:e.animateRows)??!0):i.autoGroupColumnDef=(e==null?void 0:e.autoGroupColumnDef)||{tooltipField:i.context.groupColumnFieldId,filter:"agSetColumnFilter",filterParams:{excelMode:(u=(d=i.context)==null?void 0:d.options)==null?void 0:u.excelMode,showTooltips:!0},pinned:"left",resizable:!0,sortable:!0},i.debounceVerticalScrollbar=(e==null?void 0:e.debounceVerticalScrollbar)??!0,i.enableAdvancedFilter=(e==null?void 0:e.enableAdvancedFilter)??!0,i.rowDragManaged=e.rowDragManaged,i.rowDragMultiRow=e.rowDragMultiRow,i.rowDragEntireRow=e.rowDragEntireRow??!1,i.enableRangeSelection=(e==null?void 0:e.enableRangeSelection)===!0||(e==null?void 0:e.enableRangeSelection)!==!1&&f.MULTI_SELECT_MODE.toString()==="3",i.enableBrowserTooltips=(e==null?void 0:e.enableBrowserTooltips)??!1,i.tooltipInteraction=(e==null?void 0:e.tooltipInteraction)??!0,i.allowContextMenuWithControlKey=(e==null?void 0:e.allowContextMenuWithControlKey)??!0,i.groupSelectsChildren=(e==null?void 0:e.groupSelectsChildren)??!0,i.context={...i.context,configId:r,viewType:(e==null?void 0:e.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:e==null?void 0:e.detailConfigId,options:e,toolbarOptions:n,pageOptions:a};const C=Y.toString(e==null?void 0:e.viewType,!0).toLowerCase()||"gridview";C==="cardview"||C==="card"?i.getRowHeight=E=>{var v,M;return(((M=(v=i.context.options)==null?void 0:v.cardProperty)==null?void 0:M.contentFields.length)||1)*25+100}:i.context.aggForChecked?i.getRowHeight=E=>E.node.rowPinned||E.node.group?35:void 0:i.getRowHeight=e.getRowHeight}return i}setGridInitialEvent(r,e){var n,a;if((a=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&a.configId){const i=r.gridOptions.context.configId,l=this.getConfigInfo(i);r.gridOptions.api.addEventListener("firstDataRendered",s=>{var f,h,p,C,E;r.gridOptions.context.filterCountsMap={},l.TSI00GRIDVIEW[0].AUTO_EXPAND_GROUP==="1"&&s.api.expandAll();const c=s.api.getFilterModel(),d=s.columnApi.getColumnState().filter(T=>T.sort!==null);if(Object.keys(c).length>0||d.length>0)if(r.gridOptions.context.calculateRowSpan&&r.gridOptions.context.calculateRowSpan instanceof Function){const T=r.gridOptions.context.calculateRowSpan(!1);r.gridOptions.api.redrawRows(),r.gridOptions.context.bindingSource.setCurrent(T)}else cr.setGridFocusedCell(r,0);else{const T=r.gridOptions.context.bindingSource.data()[0];r.gridOptions.context.bindingSource.setCurrent(T)}if((h=(f=r==null?void 0:r.gridOptions)==null?void 0:f.context)!=null&&h.showPreview&&((C=(p=r==null?void 0:r.gridOptions)==null?void 0:p.context)!=null&&C.previewField)&&!e.detailConfigId){const T=r.gridOptions.context.previewField.split(","),v={};T.forEach(g=>{var F;if(g.trim().length>0){let P="";const L=(F=r.gridOptions.context.columnsConfig)==null?void 0:F.find(x=>x.FIELD_NAME===g.trim());L&&(P=(L.CUS_COL_CAPTION||L.COL_CAPTION).replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>","")),v[g.trim()]=P}});const M=Object.keys(v);M.length>0&&(r.gridOptions.context.previewFieldMap=v,s.api.forEachNode(g=>{const F=[];M.forEach(P=>{var L;(L=g.data)!=null&&L[P]&&F.push({label:v[P],value:g.data[P]})}),F.length>0&&(g.data._preview_row_data=F,g.setExpanded(!0))}))}const u=(E=s.api)==null?void 0:E.getStatusPanel("InformationPanel");u&&u.setInformation()}),r.gridOptions.api.addEventListener("selectionChanged",s=>{var c,d,u,f;if(r.gridOptions.context.aggForChecked&&((c=s.api)==null||c.refreshCells({force:!0}),this.refreshGridFooterData(r),((d=r.gridOptions.context.options)==null?void 0:d.aggDataInGroupRow)===!0&&s.columnApi.getRowGroupColumns().length>0)){const p=[];(u=s.api)==null||u.forEachNode(C=>{C.group&&p.push(C)}),(f=s.api)==null||f.redrawRows({rowNodes:p})}}),r.gridOptions.api.addEventListener("rowSelected",s=>{s.source==="checkboxSelected"&&this.processRowSelectedEvent(s)}),r.gridOptions.api.addEventListener("cellEditingStarted",s=>{r.gridOptions.suppressContextMenu=!0}),r.gridOptions.api.addEventListener("cellEditingStopped",s=>{r.gridOptions.suppressContextMenu=!1}),r.gridOptions.api.addEventListener("cellEditingStopped",s=>{r.gridOptions.suppressContextMenu=!1}),r.gridOptions.api.addEventListener("sortChanged",s=>{var u,f;let c;r.gridOptions.context.calculateRowSpan&&r.gridOptions.context.calculateRowSpan instanceof Function&&(c=r.gridOptions.context.calculateRowSpan(!1)),(e==null?void 0:e.showRowNo)!==!1&&((u=s.api)==null||u.redrawRows()),c?r.gridOptions.context.bindingSource.setCurrent(c):s.api.setFocusedCell(0,pt.GridCheckColumnFieldName);const d=(f=s.api)==null?void 0:f.getStatusPanel("InformationPanel");d&&d.setInformation()}),r.gridOptions.api.addEventListener("filterOpened",s=>{s.context.filterCountsMap={}}),r.gridOptions.api.addEventListener("filterChanged",s=>{var u,f,h,p,C,E,T,v;let c;if(r.gridOptions.context.calculateRowSpan&&r.gridOptions.context.calculateRowSpan instanceof Function&&(c=r.gridOptions.context.calculateRowSpan(!1)),(e==null?void 0:e.showRowNo)!==!1&&((u=s.api)==null||u.redrawRows()),c?r.gridOptions.context.bindingSource.setCurrent(c):((f=r.gridOptions.context.options)==null?void 0:f.showApplyFilterButton)===!0&&s.api.setFocusedCell(0,pt.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"&&((C=s==null?void 0:s.context.viewType)==null?void 0:C.toLowerCase())!=="card"){const M=s.api.getModel();(T=s.api)==null||T.setPinnedBottomRowData([{...(E=M==null?void 0:M.rootNode)==null?void 0:E.aggData,pinndeRowType:"ErGridSummaryFooter"}])}const d=(v=s.api)==null?void 0:v.getStatusPanel("InformationPanel");d&&d.setInformation()}),r.gridOptions.api.addEventListener("rowDragEnd",s=>{var c,d;r.gridOptions.context.calculateRowSpan&&r.gridOptions.context.calculateRowSpan instanceof Function?(r.gridOptions.context.calculateRowSpan(!1),(c=s.api)==null||c.redrawRows()):(e==null?void 0:e.showRowNo)!==!1&&((d=s.api)==null||d.refreshCells({columns:[pt.GridCheckColumnFieldName]}))}),r.gridOptions.api.addEventListener("columnRowGroupChanged",s=>{var c,d;r.gridOptions.context.groupByFields=void 0,r.gridOptions.context.groupColumnFieldId=void 0,r.gridOptions.context.calculateRowSpan&&r.gridOptions.context.calculateRowSpan instanceof Function?(r.gridOptions.context.calculateRowSpan(!1),(c=s.api)==null||c.redrawRows()):(e==null?void 0:e.showRowNo)!==!1&&((d=s.api)==null||d.redrawRows())}),r.gridOptions.api.addEventListener("rowGroupOpened",s=>{var c,d;(c=s.api)==null||c.redrawRows({rowNodes:[s.node]}),(e==null?void 0:e.showRowNo)!==!1&&((d=s.api)==null||d.refreshCells({columns:[pt.GridCheckColumnFieldName]}))}),r.gridOptions.api.addEventListener("expandOrCollapseAll",s=>{var c;(e==null?void 0:e.showRowNo)!==!1&&((c=s.api)==null||c.refreshCells({columns:[pt.GridCheckColumnFieldName]}))}),r.gridOptions.api.addEventListener("cellValueChanged",s=>{var c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w;if(s.data&&s.colDef&&s.colDef.field){if(s.source==="paste"&&s.data instanceof Dr){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]=Y.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]=Y.toNumber(s.newValue);else if(s.colDef.context.cellEditType==="gridLookUpEdit"&&((h=s.colDef.refData)==null?void 0:h[s.newValue])===void 0){const k=s.colDef.context.displayFormat||"",y=Y.toString(s.newValue,!0);if(y.length>0){if(k.trim().startsWith("{0}|")&&y.includes("|")){const R=y.split("|")[0];(p=s.colDef.refData)!=null&&p[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().startsWith("{0}-")&&y.includes("-")){const R=y.split("-")[0];(C=s.colDef.refData)!=null&&C[R]?s.data[s.colDef.field]=R:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}|")&&y.includes("|")){const R=y.split("|"),N=R[R.length-1];(E=s.colDef.refData)!=null&&E[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.trim().endsWith("{0}-")&&y.includes("-")){const R=y.split("-"),N=R[R.length-1];(T=s.colDef.refData)!=null&&T[N]?s.data[s.colDef.field]=N:s.data[s.colDef.field]=""}else if(k.length>0){const R=Object.keys(s.colDef.refData);let N="";for(let U=0;U<R.length;U++)if(((v=s.colDef.refData)==null?void 0:v[R[U]])===y){N=R[U];break}s.data[s.colDef.field]=N}}}}s.data.dirty=!0,s.data.dirtyFields[s.colDef.field]=!0,this.setDropDownAutoFillFieldsForGrid(r,s.colDef.colId,s.node),this.DropDownCascader[i+s.colDef.colId]&&this.DropDownCascader[i+s.colDef.colId].forEach(k=>{var y,R,N;if(k.FUNCTION_TYPE&&k.FUNCTION_ID&&k.ITEM_CODE){let U="";const V=s.data[s.colDef.field],b=this.getSingleItemConfigInfo(k.FUNCTION_ID,k.ITEM_CODE),W=this.getItemDropDownDataSource(k.FUNCTION_ID,k.ITEM_CODE);if(s.data[s.colDef.field]){const q=this.filterDropDownCascaderDataSource(W,k.FORM_FILTER,s.data[s.colDef.field]);if((q==null?void 0:q.length)>0){const z=(y=this.DropDownBindSource[k.FUNCTION_ID])==null?void 0:y[k.ITEM_CODE];z.dataValueField&&(V&&q.some(ee=>ee[z.dataValueField]===V)?U=V:(((R=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:R.trim().toLowerCase())==="$first_row$"||((N=b==null?void 0:b.DEFAULT_VALUE)==null?void 0:N.trim().toLowerCase())==="{first_row}")&&(U=q[0][z.dataValueField]))}}k.FUNCTION_TYPE==="F"?this.setControlValue(k.FUNCTION_ID,k.ITEM_CODE,U):k.FUNCTION_ID===i&&(s.data[k.ITEM_CODE]=U)}});let I=(g=(M=s.context)==null?void 0:M.viewConfig)==null?void 0:g.AUTO_SELECT_MODE;if(I==="2"||I==="3")this.checkGridRow(i,s.data.uid);else if(((L=(P=(F=s.colDef)==null?void 0:F.context)==null?void 0:P.columnConfig)==null?void 0:L.MULTI_ROW_EDIT)==="1"&&((x=s.node)!=null&&x.selected)){const k=this.getGridOptions(i,"multiRowEdit");if(k!==!1&&k!=="0"){let y=!1;(e==null?void 0:e.multiRowEditType)==="all"?r.gridOptions.api.forEachLeafNode(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}):r.gridOptions.api.forEachNodeAfterFilter(R=>{var N;R!=null&&R.selected&&((N=R.data)!=null&&N.uid)&&R.data.uid!==s.data.uid&&(R.setDataValue(s.colDef.field,s.data[s.colDef.field]),y=!0)}),y&&s.api.refreshCells({columns:[pt.GridCheckColumnFieldName]})}}if(((S=s==null?void 0:s.context)==null?void 0:S.viewConfig.SHOW_FOOTER)==="1"&&((O=s==null?void 0:s.context.viewType)==null?void 0:O.toLowerCase())!=="cardview"&&((A=s==null?void 0:s.context.viewType)==null?void 0:A.toLowerCase())!=="card"){const k=s.api.getModel();s.api.setPinnedBottomRowData([{...(w=k==null?void 0:k.rootNode)==null?void 0:w.aggData,pinndeRowType:"ErGridSummaryFooter"}])}s.api.refreshCells({rowNodes:[s.node],columns:[pt.GridCheckColumnFieldName,s.colDef.colId]})}})}}processRowSelectedEvent(r){var e;if(r.event){const n=((e=r.api)==null?void 0:e.getCellRanges())||[];n.length>0&&n.forEach(a=>{var i;if(a.columns.length===1&&a.columns[0].colId===pt.GridCheckColumnFieldName){const l=(i=r.api)==null?void 0:i.getModel();if(l){const s=[];for(let c=a.startRow.rowIndex;c<=a.endRow.rowIndex;c++){const d=l.getRow(c);d&&s.push(d)}r.api.setNodesSelected({nodes:s,newValue:r.node.isSelected()})}}})}}getGridContextMenuItems(r,e){var a,i,l,s,c,d,u,f,h,p,C,E,T,v,M,g,F,P,L,x,S,O,A,w;const n=[];if(r.api.getDisplayedRowCount()>0){(a=r.node)!=null&&a.group&&((i=r.node)==null?void 0:i.footer)===void 0||(n.push("copy"),n.push({name:this.$t("ERX.ErGrid.CopyValue")||"复制值",action:()=>{r.context.copyValue=!0,r.api.copyToClipboard(),r.context.copyValue=!1}}),n.push("copyWithHeaders"),n.push({name:this.$t("ERX.ErGrid.CopyValueWithHeaders")||"带标题复制值",action:()=>{r.context.copyValue=!0,r.api.copyToClipboard({includeHeaders:!0}),r.context.copyValue=!1}}));const I=this.getConfigInfo(r.context.configId),k=[];if(I.TSI00GRIDSTYLE&&I.TSI00GRIDSTYLE.forEach(y=>{(y.NTYPE==="W_Fore"||y.NTYPE==="W_Back")&&y.REMARK.toUpperCase().trim().length>0&&k.push({text:y.REMARK,type:y.NTYPE,fontName:y.TEXT_COLOR,fontStyle:y.FONTNAME,color:y.FILL_COLOR})}),k.length>0&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.StyleDesc")||"样式说明",action:()=>{tt.Modal.info({title:this.$t("ERX.ErGrid.StyleDesc")||"样式说明",type:"info",okText:this.$t("ERX.Close")||"关闭",content:()=>o.h("div",{style:{width:"100%"}},k.map(y=>o.h("span",{style:{[y.type==="W_Fore"?"color":"backgroundColor"]:Y.toHexColor(y.color),fontFamily:y.fontName,fontStyle:y.fontStyle==="Italic"?"italic":"normal",fontWeight:y.fontStyle==="Bold"?"bold":"normal",display:"block",width:"100%",padding:"4px",marginBottom:"4px",boxSizing:"border-box",lineHeight:"1.2"}},y.text)))})},icon:Y.createErSvgElement("style")})),(e==null?void 0:e.showDetailForm)!==!1&&r.node&&r.node.group!==!0&&r.node.rowPinned===void 0&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.ShowDetailForm")||"查看明细",action:async()=>{var R,N,U,V,b,W,q,z,ee,Q,G,K,ie,J,te,H,Ee,Z,Ve,X,le,se,re,ve,be,_e,$e,Ce,Fe;let y=r.context.detailFormHelper;if(!y){let De=this._formName,Oe=(R=r.context)==null?void 0:R.configId,Ie=((U=(N=r.context)==null?void 0:N.viewConfig)==null?void 0:U.EDIT_COLS_COUNT)||3,Re=`${r.context.configCaption||this.$t("ERX.ErGrid.ShowDetailForm")||"查看明细"}`;Ie<=0&&(Ie=3);const Ze=r.columnApi.columnModel.displayedColumns.length;let ge=Math.floor(Ze/Ie)*30+120;ge<200?ge=200:ge>650&&(ge=650);let oe;if(typeof e.showDetailForm=="string"&&((V=e.showDetailForm)==null?void 0:V.trim().length)>0){const Me=(b=e.showDetailForm)==null?void 0:b.trim().split(/[./]/);((W=Me[0])==null?void 0:W.trim().length)>0&&((q=Me[1])==null?void 0:q.trim().length)>0&&(De=(z=Me[0])==null?void 0:z.trim(),Oe=(ee=Me[1])==null?void 0:ee.trim(),ge=void 0,Re=void 0,oe=void 0)}else if(Ir.isPlainObject(e.showDetailForm)&&((G=(Q=e.showDetailForm)==null?void 0:Q.configId)==null?void 0:G.trim().length)>0){const Me=(K=e.showDetailForm.configId)==null?void 0:K.trim().split(/[./]/);((ie=Me[0])==null?void 0:ie.trim().length)>0&&((J=Me[1])==null?void 0:J.trim().length)>0&&(De=(te=Me[0])==null?void 0:te.trim(),Oe=(H=Me[1])==null?void 0:H.trim(),ge=e.showDetailForm.height,Re=e.showDetailForm.title,oe=e.showDetailForm.width)}const{PopFreeHelper:ye}=await Promise.resolve().then(()=>Cs);y=new ye(this._serverPartition,De,Oe,this._serviceName),y.setFormOptions({height:ge,title:Re,width:oe}),y.BordStyle="Sizable"}r.context.detailFormHelper=y,(Z=(Ee=r.context)==null?void 0:Ee.options)!=null&&Z.detailItemValueChanged&&((X=(Ve=r==null?void 0:r.context)==null?void 0:Ve.options)==null?void 0:X.detailItemValueChanged)instanceof Function?y.setEvent("itemValueChanged",(se=(le=r.context)==null?void 0:le.options)==null?void 0:se.detailItemValueChanged):y.setEvent("ok",De=>{var Oe;if((Oe=De.dataModel)!=null&&Oe.dirty){const Ie={};Object.keys(De.dataModel.dirtyFields).forEach(Re=>{Ie[Re]=De.dataModel[Re]}),r.node.data.setData(Ie)}}),(ve=(re=r.context)==null?void 0:re.options)!=null&&ve.detailItemButtonClick&&((_e=(be=r.context)==null?void 0:be.options)==null?void 0:_e.detailItemButtonClick)instanceof Function&&y.setEvent("itemButtonClick",(Ce=($e=r.context)==null?void 0:$e.options)==null?void 0:Ce.detailItemButtonClick),y.ReceiveData(r.node.data),y.EditType=(Fe=r.context)!=null&&Fe.editable?"Modify":"Query",y.show(null)},icon:Y.createErSvgElement("show-detail")})),((l=I.TSI00GRIDCOLUMNURL)==null?void 0:l.length)>0&&((c=(s=r.node)==null?void 0:s.data)!=null&&c.uid)&&!((u=(d=r.node)==null?void 0:d.data)!=null&&u.isNew)){const y=[];if(I.TSI00GRIDCOLUMNURL.forEach(R=>{var N,U,V;((N=R.CALL_FORM)==null?void 0:N.trim().length)>0&&(R.ITEM_CODE==="*"||R.ITEM_CODE===r.column.colDef.colId)&&(((U=R.CONDITION)==null?void 0:U.trim().length)>0&&Y.checkExpressionValid(r.node.data,R.CONDITION)||((V=R.CONDITION)==null?void 0:V.trim().length)===0)&&y.push(R)}),y.length>0){let R=1;n.push("separator"),y.forEach(N=>{n.push({name:N.MENU_NAME,action:()=>{var U,V,b,W;if(((U=N.MENU_NAME)==null?void 0:U.trim())==="附件管理"||((V=N.MENU_NAME)==null?void 0:V.trim())==="管理附件"){const q=new Ac;q.setOptions({relationId:"",refreshKey:Y.guid(),readonly:!1,multiple:!0,maxCount:1,showFileDateTime:!0,showFileSize:!0}),q.showPopAttachment(null)}else{let q=(b=N.CALL_FORM)==null?void 0:b.trim();const z=(W=r.node)==null?void 0:W.data.toJSON();q.endsWith("??")?(q=q.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(z)))):q.endsWith("?")&&(q=q.replace("?",""),encodeURIComponent(JSON.stringify(z))),this.setLocalStorage(q,{senderType:"gridCell",value:r.value,data:z,formNameFrom:this.FormName})}},icon:Y.createErSvgElement(`number-${R}`)}),R++})}}if(((h=(f=r.node)==null?void 0:f.childrenAfterFilter)==null?void 0:h.length)>0&&r.node.group===!0&&r.node.footer!==!0&&n.push("separator","expandAll","contractAll"),e!=null&&e.allowImageUpload&&((E=(C=(p=r.column)==null?void 0:p.colDef)==null?void 0:C.cellRenderer)==null?void 0:E.name)==="ImagePreview"&&((v=(T=r.node)==null?void 0:T.data)!=null&&v.uid)&&!((g=(M=r.node)==null?void 0:M.data)!=null&&g.isNew)&&((P=(F=r.column)==null?void 0:F.colDef.context.columnConfig.EXT_OPTIONS)==null?void 0:P.trim().length)>0){const y=JSON.parse((L=r.column)==null?void 0:L.colDef.context.columnConfig.EXT_OPTIONS);if(((x=y==null?void 0:y.imageUploadDir)==null?void 0:x.trim().length)>0&&((S=y.imageUploadKeyField)==null?void 0:S.trim().length)>0){const R=r.node.data[y.imageUploadKeyField];if((R==null?void 0:R.trim().length)>0){let N="";(O=y==null?void 0:y.imageUploadDir)!=null&&O.trim().startsWith("/")?N=(A=y==null?void 0:y.imageUploadDir)==null?void 0:A.trim():N=`/${(w=y==null?void 0:y.imageUploadDir)==null?void 0:w.trim()}`,N=`${N}/${R==null?void 0:R.trim()}`,n.push("separator"),n.push({name:this.$t("ERX.ErGrid.UploadImage")||"上传图片",action:()=>{const U=new Ac;U.setOptions({relationId:N,refreshKey:Y.guid(),readonly:!1,multiple:!0,maxCount:1,showFileDateTime:!0,showFileSize:!0,afterUpload(V){e!=null&&e.afterUpload&&e.afterUpload instanceof Function&&(r.file=V,e.afterUpload(r))},afterRemove(V){e!=null&&e.afterRemove&&e.afterRemove instanceof Function&&(r.file=V,e.afterRemove(r))}}),U.showPopAttachment(null)}})}}}}if(r.api.isColumnFilterPresent()&&(n.push("separator"),n.push({name:this.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{r.api.setFilterModel(null)}})),e!=null&&e.customContextMenu&&e.customContextMenu instanceof Function){const I=e.customContextMenu(r);I&&I.length>0&&(n.length>0&&n.push("separator"),n.push(...I))}return n}setGridContextMenu(r,e){var a,i;const n=this.getGrid(r);n&&((a=e==null?void 0:e.viewType)==null?void 0:a.toLowerCase())!=="card"&&((i=e==null?void 0:e.viewType)==null?void 0:i.toLowerCase())!=="cardview"&&(n.gridOptions.getContextMenuItems=l=>this.getGridContextMenuItems(l,e))}async getExtendOptions(r,e,n,a,i,l){var h;let s="",c="";if(a&&a.trim().length>0){const p=a.split(",");a=p[0],p.length>1&&(c=p[1])}const d={QUERY_TYPE:r,FORM_NAME:e||this._formName,FUNCTION_ID:n,ROW_GUID:a,COMPANY_CODE:l||this.DefaultConfigCompanyCode,ITEM_CODE:c},u=st.buildMap([d]),f=await Gr.callServiceEx(pt.queryDevConfigService,u,{partition:i||this._serverPartition});return f.sysFlag>=0&&(s=Y.toString((h=f.getMapData("TSI00FORMEXT")[0])==null?void 0:h.EXT_OPTIONS,!0)),s}async showExtOptionsEdit(r,e,n,a,i,l,s=!1,c){var T;const d=new Oc({width:450,height:550,extension:"json"});let u="";if(a&&a.trim().length>0){const v=a.split(",");a=v[0],v.length>1&&(u=v[1])}const f={QUERY_TYPE:r,FORM_NAME:e||this._formName,FUNCTION_ID:n,ROW_GUID:a,COMPANY_CODE:l||this.DefaultConfigCompanyCode,ITEM_CODE:u},h=async()=>{const v=st.buildMap([f]),M=await Gr.callServiceEx(pt.queryDevConfigService,v,{partition:i||this._serverPartition});return M.sysFlag<0&&Y.messageError(M.sysMsg),M};let p="",C;const E=await h();if(E.sysFlag>=0){p=Y.toString((T=E.getMapData()[0])==null?void 0:T.EXT_OPTIONS,!0);const v=p?JSON.parse(p):{};v.structureOptions&&(C=v.structureOptions,delete v.structureOptions,p=JSON.stringify(v))}d.CancelButtonCaption=Y.$t("ERX.Close")||"关闭",d.CloseDialogWhenOkClick=s,d.setEvent("ok",async()=>{if(p=d.Content,C){const g=p?JSON.parse(p):{};p=JSON.stringify({...g,structureOptions:C})}const v=st.buildMap([{...f,EXT_OPTIONS:p}],f.QUERY_TYPE.toUpperCase()),M=await Gr.callServiceEx(pt.saveDevConfigService,v,{partition:i||this._serverPartition});return M.sysFlag<0?Y.messageError(M.sysMsg):Y.messageSuccess(Y.$t("ERX.OperateSuccess")||"操作成功!"),M.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(r,e,n,a=!1,i){let l={};const s=st.buildMap({QUERY_TYPE:"tsi00gridview",FORM_NAME:r,FUNCTION_ID:e}),c=await Gr.callServiceEx(pt.queryDevConfigService,s,{partition:n||this._serverPartition});if(c.sysFlag<0){Y.messageError(c.sysMsg);return}else if(c.getMapData().length===0){Y.messageError("Data not found!");return}else l=c.getMapData()[0];const{PopFreeHelper:d}=await Promise.resolve().then(()=>Cs),u=new d(n||this._serverPartition,l.FUNCTION_TYPE==="F"?"SI00LayoutEdit":l.FUNCTION_TYPE==="T"?"SI00TreeListEdit":"SI00GridViewEdit","LayoutGroupMain",this.InitialService);u.EditType="Modify",u.OkButtonService=pt.saveDevConfigService,u.OkButtonCaption=Y.$t("ERX.Save")||"Save",u.CancelButtonCaption=Y.$t("ERX.Close")||"Close",u.CloseDialogWhenOkClick=a,u.ReceiveData(l),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=>{f.isModified&&i.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(()=>DC),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 C=async()=>{const E=await u.FormHelper.callServiceEx(pt.queryDevConfigService,st.buildMap({QUERY_TYPE:"tsi00datasettree"}));return E.sysFlag<0?(Y.messageError(E.sysMsg),[]):E.getMapData()[0]};p.receiveData(C),p.BeforeOkButtonClick=E=>(E==null?void 0:E.NODE_TYPE)!=="DataTable"?!1:E,p.show(null,E=>{E!=null&&E.data&&(u.FormHelper.setControlValue("LayoutGroupMain","DATASET_NAME",E.data.DATASET_NAME),u.FormHelper.setControlValue("LayoutGroupMain","TABLE_NAME",E.data.DATATABLE_NAME))})}}),u.show(null)}async showFormOptionsEdit(r,e,n=!1,a){let i={},l=[],s=st.buildMap([{QUERY_TYPE:"TSI00MODULE",MODULE_TYPE:"15"}]),c=await this.callServiceEx(pt.queryDevConfigService,s);if(c.sysFlag<0){Y.messageError(c.sysMsg);return}else l=c.getMapData()[0].map(f=>({CODE:f.MODULE_ENAME,CODE_DESC_1_CONTENT:f.MODULE_CNAME}));const{PopFreeHelper:d}=await Promise.resolve().then(()=>Cs),u=new d(e||this._serverPartition,"SI00FormEdit","LayoutGroupMain",this.InitialService);if(u.EditType="Modify",u.OkButtonService=pt.saveDevConfigService,u.OkButtonCaption=Y.$t("ERX.Save")||"Save",u.CancelButtonCaption=Y.$t("ERX.Close")||"Close",u.CloseDialogWhenOkClick=n,s=st.buildMap({QUERY_TYPE:"tsi00form",FORM_NAME:r}),c=await this.callServiceEx(pt.queryDevConfigService,s),c.sysFlag<0){Y.messageError(c.sysMsg);return}else if(c.getMapData().length===0){Y.messageError("Data not found!");return}else i=c.getMapData()[0];u.ReceiveData(i),u.setEvent("initial",()=>{u.FormHelper.reloadDropDownDataSource("LayoutGroupMain","MODULE_TYPE",l)}),u.setEvent("open",f=>{a!=null&&a.open&&a.open instanceof Function&&a.open(f)}),a!=null&&a.colse&&a.colse instanceof Function&&u.setEvent("close",f=>{a.colse(f)}),u.show(null)}getGridColumnDefs(r,e,n,a){var F,P,L,x,S,O,A,w,I,k,y,R,N,U,V,b,W,q,z,ee,Q,G,K,ie,J;let i=[];const l={};this._gridColumnsConfigInfo[r]={},this._gridOptions[r]=this._gridOptions[r]||{};const s=e.TSI00GRIDVIEW[0],c=e.TSI00GRIDCOLUMN,d=e.TSI00GRIDVIEW[0].TABLE_NAME;this.setBindingTableName(r);const u=(F=this._formDataSet)==null?void 0:F.dataTables[d];u?(u.setBindingInfo(this,r,"Grid"),u.setAllowCancelChanges(a==null?void 0:a.allowCancelChanges)):console.error("ER: Could not find binding table of configuration ["+r+"]"),n.context={options:a,bindingSource:u,bindTableName:d,mergeColumns:[]};const f=[];this._gridOptions[r].styleConfigInfo={rowStyle:[],cellStyle:{}};const h=[];if(e.TSI00GRIDSTYLE&&e.TSI00GRIDSTYLE.length>0){let te=1;e.TSI00GRIDSTYLE.forEach(H=>{const Ee=`condition-style-${te++}`;H.NTYPE==="W_Back"?(h.push({id:Ee,condition:H.REGULAR_EXPRESS,columnNames:H.COL_NAME.toUpperCase().trim().split(",").filter(Z=>Z.trim().length>0),style:{id:Ee,interior:{color:Y.toHexColor(H.FILL_COLOR),pattern:"Solid"}}}),n.excelStyles.push({id:Ee,interior:{color:Y.toHexColor(H.FILL_COLOR),pattern:"Solid"}})):H.NTYPE==="W_Fore"&&(h.push({id:Ee,condition:H.REGULAR_EXPRESS,columnNames:H.COL_NAME.toUpperCase().trim().split(",").filter(Z=>Z.trim().length>0),style:{id:Ee,font:{color:Y.toHexColor(H.FILL_COLOR),name:H.FONTNAME,size:H.FONT_SIZE,bold:H.FONT_WEIGHT==="bold",italic:H.FONT_STYLE==="italic",underline:H.FONT_STYLE==="underline",strike:H.FONT_STYLE==="strike"}}}),n.excelStyles.push({id:Ee,font:{color:Y.toHexColor(H.FILL_COLOR),name:H.FONTNAME,size:H.FONT_SIZE,bold:H.FONT_WEIGHT==="bold",italic:H.FONT_STYLE==="italic",underline:H.FONT_STYLE==="underline",strike:H.FONT_STYLE==="strike"}})),(H.NTYPE==="W_Fore"||H.NTYPE==="W_Back")&&(H.COL_NAME.toUpperCase().trim().length===0?this._gridOptions[r].styleConfigInfo.rowStyle.push({type:H.NTYPE,fillColor:H.FILL_COLOR,fontFamily:H.TEXT_COLOR,fontStyle:H.FONTNAME,columnNames:H.COL_NAME.toUpperCase().trim(),condition:H.REGULAR_EXPRESS}):H.COL_NAME.toUpperCase().trim().split(",").forEach(Z=>{Z.trim().length>0&&(this._gridOptions[r].styleConfigInfo.cellStyle[Z]||(this._gridOptions[r].styleConfigInfo.cellStyle[Z]=[]),this._gridOptions[r].styleConfigInfo.cellStyle[Z].push({id:Ee,type:H.NTYPE,fillColor:H.FILL_COLOR,fontFamily:H.TEXT_COLOR,fontStyle:H.FONTNAME,columnNames:H.COL_NAME.toUpperCase().trim(),condition:H.REGULAR_EXPRESS}))}))})}n.context.excelStyleConfig=h;const p=this.getModelFields(u),C=[],E={};let T,v;const M=Y.toString(a==null?void 0:a.viewType,!0).toLowerCase()||"gridview";(M==="band"||M==="bandview"&&((P=e.TSI00GRIDBAND)==null?void 0:P.length)>0)&&this.createGridBandColumn(e.TSI00GRIDBAND,C,E,void 0,a),C.length>0&&(i=C);let g={};for(let te=0;te<c.length;te++){const H=c[te];if(H.extendOptions=((L=H==null?void 0:H.EXT_OPTIONS)==null?void 0:L.trim().length)>0?JSON.parse(H.EXT_OPTIONS):{},H.FUNCTION_TYPE=s.FUNCTION_TYPE,this._gridColumnsConfigInfo[r][H.ITEM_CODE]=H,C.length>0&&(H.BAND_NAME.toString().trim().length===0||E[H.BAND_NAME.toString().trim()]===void 0))continue;let Ee;if(p&&p[H.FIELD_NAME]&&p[H.FIELD_NAME].type)Ee=p[H.FIELD_NAME].type,H.ITEM_MUST_FLAG==="1"&&(p[H.FIELD_NAME].validation={required:!0});else if(H.UNBOUND_TYPE!=="0")switch(H.UNBOUND_TYPE){case"2":case"3":Ee="number";break;case"4":Ee="datetime";case"5":Ee="boolean";break;default:Ee="string";break}let Z=!1;H.CUS_COL_FIX_TYPE?Z=H.CUS_COL_FIX_TYPE==="L"?"left":H.CUS_COL_FIX_TYPE==="R"?"right":!1:Z=H.COL_FIX_TYPE==="L"?"left":H.COL_FIX_TYPE==="R"?"right":!1,this.IsRtl&&(Z==="left"?Z="right":Z==="right"&&(Z="left"));const Ve=Y.toHexColor(H.HEAD_TEXTCOLOR),X=Y.toHexColor(H.HEAD_BACKCOLOR),le=Y.toNumber(H.HEAD_FONTSIZE);let se="";if(H.ALLOW_EDIT==="1"&&H.UNBOUND_TYPE==="0"&&e.TSI00GRIDSTYLE){const Oe=e.TSI00GRIDSTYLE.find(Ie=>{var Re,Ze;return Ie.NTYPE==="W_Hf4Edit"&&(((Re=Ie.COL_NAME)==null?void 0:Re.trim().length)===0||((Ze=Ie.COL_NAME)==null?void 0:Ze.includes(H.FIELD_NAME)))});Oe&&(se=Y.toHexColor(Oe.FILL_COLOR))}g={...H.extendOptions,...(x=a.columnOptions)==null?void 0:x[H.ITEM_CODE]};let re=H.ALLOW_EDIT==="1";Ee==="boolean"&&(re=H.ALLOW_EDIT==="1"&&H.READ_ONLY!=="1"),((O=(S=a.columnOptions)==null?void 0:S[H.ITEM_CODE])==null?void 0:O.editable)!==void 0&&(re=a.columnOptions[H.ITEM_CODE].editable);const ve=Ee!=="boolean"&&((a==null?void 0:a.wrapText)===!0||Y.toString(a==null?void 0:a.wrapText).split(",").includes(H.ITEM_CODE)),be={simpleHeader:a==null?void 0:a.simpleHeader,fontSize:le>0?`${le}px`:"unset",color:se||Ve,backgroundColor:X,title:H.CUS_COL_CAPTION||H.COL_CAPTION},_e=H.CUS_GROUP_SORT_TYPE||H.GROUP_SORT_TYPE;if(g={...g,pinned:Z,lockPosition:Z,colId:H.ITEM_CODE,field:H.FIELD_NAME,headerName:H.CUS_COL_CAPTION||H.COL_CAPTION,headerTooltip:a!=null&&a.enableHeaderTooltip?(H.CUS_COL_CAPTION||H.COL_CAPTION).replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""):void 0,headerComponentParams:{template:`${this.getGridHeaderTemplate(be)}`},wrapHeaderText:((w=(A=a==null?void 0:a.columnOptions)==null?void 0:A[H.ITEM_CODE])==null?void 0:w.wrapHeaderText)??(a==null?void 0:a.wrapHeaderText)??!0,autoHeaderHeight:M!=="cardview"&&M!=="card",headerClass:Oe=>{var Re,Ze,ge,oe,ye,Me,Xe,mt,et,St,ot,gt,_t,Le,Ue,ft,Tt,wt;let Ie="er-grid-header-align-center";return((ge=(Ze=(Re=Oe.colDef)==null?void 0:Re.context)==null?void 0:Ze.columnConfig)==null?void 0:ge.HEAD_HALIGNMENT)==="Near"?Ie="er-grid-header-align-left":((Me=(ye=(oe=Oe.colDef)==null?void 0:oe.context)==null?void 0:ye.columnConfig)==null?void 0:Me.HEAD_HALIGNMENT)==="Far"&&(Ie="er-grid-header-align-right"),((et=(mt=(Xe=Oe.colDef)==null?void 0:Xe.context)==null?void 0:mt.columnConfig)==null?void 0:et.ITEM_MUST_FLAG)==="1"&&(((ot=(St=H.extendOptions)==null?void 0:St.requireCondition)==null?void 0:ot.trim().length)>0||((Ue=(Le=(_t=(gt=Oe.colDef)==null?void 0:gt.context)==null?void 0:_t.columnConfig)==null?void 0:Le.MUST_INPUT_CONDITION)==null?void 0:Ue.trim().length)>0)?Ie=Ie+" er-grid-header-maroon-star":((wt=(Tt=(ft=Oe.colDef)==null?void 0:ft.context)==null?void 0:Tt.columnConfig)==null?void 0:wt.ITEM_MUST_FLAG)==="1"&&(Ie=Ie+" er-grid-header-red-star"),Ie},autoHeight:s.ALLOW_CELLMERGE!=="1"&&ve||M==="cardview"||M==="card",suppressMovable:H.ALLOW_MOVE==="0",sortable:H.ALLOW_SORT==="1",resizable:H.ALLOW_SIZE==="1",suppressSizeToFit:H.BESTFIT!=="1",suppressColumnsToolPanel:(H.ALLOW_SHOWHIDE==="0"||this.DevelopPermission!=="1")&&H.IS_VISIBLE!=="1",lockVisible:H.ALLOW_SHOWHIDE==="0"||(a==null?void 0:a.groupDisplayType)==="multipleColumns"&&(_e==="1"||_e==="2"),width:Y.toNumber(H.CUS_COL_WIDTH)>0?Y.toNumber(H.CUS_COL_WIDTH):Y.toNumber(H.COL_WIDTH_WEB)>0?Y.toNumber(H.COL_WIDTH_WEB):Y.toNumber(H.COL_WIDTH)>0?Y.toNumber(H.COL_WIDTH):100,editable:Oe=>{var Ie,Re,Ze,ge,oe,ye,Me,Xe,mt,et,St,ot,gt,_t,Le;if(Oe.node.rowPinned||!((Ie=Oe.context)!=null&&Ie.editable))return!1;if(((Re=Oe.column.context)==null?void 0:Re.editable)!==void 0&&((Ze=Oe.column.context)==null?void 0:Ze.editable)instanceof Function)return(ge=Oe.column.context)==null?void 0:ge.editable(Oe);if(((oe=Oe.column.context)==null?void 0:oe.editable)!==void 0&&((ye=Oe.column.context)==null?void 0:ye.editable)!=="default")return(Me=Oe.column.context)==null?void 0:Me.editable;if(re!==!1){if(((Xe=a==null?void 0:a.keyFields)==null?void 0:Xe.trim().length)>0){if((mt=a==null?void 0:a.keyFields)!=null&&mt.includes(Oe.colDef.colId))return Oe.data.isNew}else if(((et=s.KEY_FIELDS)==null?void 0:et.trim().length)>0&&(St=s.KEY_FIELDS)!=null&&St.includes(Oe.colDef.colId))return Oe.data.isNew;return(gt=(ot=Oe.colDef)==null?void 0:ot.context)==null?void 0:gt.editable}else return(Le=(_t=Oe.colDef)==null?void 0:_t.context)==null?void 0:Le.editable},enableRowGroup:!n.treeData,rowGroup:n.treeData?void 0:_e==="1"||_e==="2",sort:a!=null&&a.allowGroupSort&&_e==="2"?"desc":a!=null&&a.allowGroupSort&&_e==="1"?"asc":void 0,hide:!1,context:{viewOptions:a,viewConfig:s,columnConfig:H,editable:re,titleInfo:be}},(a==null?void 0:a.groupDisplayType)==="multipleColumns"&&(_e==="1"||H.GROUP_SORT_TYPE==="2")?g.hide=!0:H.ALLOW_SHOWHIDE==="0"?g.hide=H.IS_VISIBLE==="0":H.ALLOW_SHOWHIDE==="1"&&(g.hide=H.CUS_IS_VISIBLE==="0"||H.CUS_IS_VISIBLE===""&&H.IS_VISIBLE==="0"),g.filter="agMultiColumnFilter",g.filterParams={filters:[{filter:"agTextColumnFilter",filterParams:{buttons:(a==null?void 0:a.showApplyFilterButton)===!0?["reset","apply"]:void 0,closeOnApply:a==null?void 0:a.closeOnApplyFilter,maxNumConditions:(a==null?void 0:a.maxNumConditions)||5,textMatcher:({filterOption:Oe,value:Ie,filterText:Re})=>{if(Re==null)return!1;switch(Oe){case"contains":return Re.split(" ").filter(Boolean).some(ge=>String(Ie).includes(ge));case"notContains":return!Re.split(" ").filter(Boolean).some(ge=>String(Ie).includes(ge));case"equals":return Ie===Re;case"notEqual":return Ie!=Re;case"startsWith":return Ie.indexOf(Re)===0;case"endsWith":const Ze=Ie.lastIndexOf(Re);return Ze>=0&&Ze===Ie.length-Re.length;default:return console.warn("invalid filter type "+Oe),!1}}}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:a!=null&&a.showFilterCounts?Oe=>{const Ie=this.setGridColumnFilterCountsMap(Oe);return`${Oe.value||"("+Y.$t("ERX.Null")+")"} (${Ie[Oe.value||"NullFilterValue"]||0})`}:void 0,excelMode:a==null?void 0:a.excelMode,showTooltips:!0,buttons:(a==null?void 0:a.showApplyFilterButton)===!0?["reset","apply"]:void 0,closeOnApply:a==null?void 0:a.closeOnApplyFilter}}]},H.AUTO_FILTER_CONDITION==="Default"||H.AUTO_FILTER_CONDITION==="Contains"?g.filterParams.defaultOption="contains":H.AUTO_FILTER_CONDITION==="Like"||H.AUTO_FILTER_CONDITION==="StartsWith"?g.filterParams.defaultOption="startsWith":H.AUTO_FILTER_CONDITION==="EndsWith"?g.filterParams.defaultOption="endsWith":g.filterParams.defaultOption="equals",(I=this._itemAuthInfo[r])!=null&&I[H.ITEM_CODE]){const Oe=this._itemAuthInfo[r][H.ITEM_CODE];Oe[pt.UserId]==="20"||Oe["*****"]==="20"&&Oe[pt.UserId]!=="11"?(g.suppressColumnsToolPanel=!0,g.hide=!0):(Oe[pt.UserId]==="10"||Oe["*****"]==="10"&&Oe[pt.UserId]!=="11")&&(g.suppressColumnsToolPanel=!0,g.editable=!1,g.context.hideContent=!0)}const $e={},Ce={fontWeight:"normal",fontStyle:"normal",textDecoration:"none",background:"",color:"inherit"};switch(H.CELL_TEXTCOLOR.trim().length>0&&(Ce.color=Y.toHexColor(H.CELL_TEXTCOLOR),Y.colorIsTransparentOrEmpty(Ce.color)?Ce.color="":$e.font={color:Y.toHexColor(Ce.color)}),H.CELL_BACKCOLOR.trim().length>0&&(Ce.background=Y.toHexColor(H.CELL_BACKCOLOR),Y.colorIsTransparentOrEmpty(Ce.background)?Ce.background="":$e.interior={color:Y.toHexColor(Ce.background),pattern:"Solid"}),Y.toNumber(H.CELL_FONTSIZE)>0&&(Ce.fontSize=`${Y.toNumber(H.CELL_FONTSIZE)}px`),ve?Ce.whiteSpace="pre-wrap":H.SUMMARY_TYPE.includes("&")&&(Ce.whiteSpace="pre"),H.HALIGNMENT){case"Center":Ce.display="block",Ce.textAlign="center",Ee==="boolean"&&(Ce.display="flex",Ce.justifyContent="center"),g.cellClass="center-cell";break;case"Far":Ce.display="block",Ce.textAlign="right",Ee==="boolean"&&(Ce.display="flex",Ce.justifyContent="flex-end"),g.cellClass="right-cell";break;case"Near":Ce.display="block",Ce.textAlign="left",Ee==="boolean"&&(Ce.display="flex",Ce.justifyContent="flex-start"),g.cellClass="left-cell";break;default:{Ee==="number"?(Ce.display="block",Ce.textAlign="right",g.cellClass="right-cell"):Ee==="datetime"||Ee==="time"||H.COLUMN_EDIT=="T"?(Ce.display="block",Ce.textAlign="center",g.cellClass="center-cell"):Ee==="boolean"||H.COLUMN_EDIT==="S"?(Ce.display="flex",Ce.justifyContent="center",g.cellClass="center-cell"):g.cellClass="left-cell";break}}Ee==="string"&&g.cellClass&&(g.cellClass=g.cellClass+"-string"),H.VALIGNMENT,Object.keys($e).length>0&&(n.excelStyles.push({...$e,id:`column-cell-style-${g.colId.toLowerCase().trim()}`}),n.context.excelStyleConfig.push({id:`column-cell-style-${g.colId.toLowerCase().trim()}`,columnNames:[g.colId.toUpperCase().trim()],condition:"",style:$e})),T===void 0&&!g.hide&&(T=g),v===void 0&&!g.hide&&((this.IsRtl&&g.pinned)==="right"||!this.IsRtl&&g.pinned==="right")&&(v=g),g.context.dataType=Ee,g.context.cellStyles=Ce;const Fe=this._gridOptions[r].styleConfigInfo.cellStyle[H.ITEM_CODE];if((Object.keys(Ce).length>0||Fe)&&(g.cellStyle=Oe=>{var Re,Ze,ge,oe;const Ie={...Oe.colDef.context.cellStyles};if(Oe.data&&!((Re=Oe.node)!=null&&Re.rowPinned)&&(Fe==null?void 0:Fe.length)>0)for(let ye=0;ye<Fe.length;ye++){const Me=Fe[ye];if((((Ze=Me.condition)==null?void 0:Ze.trim().length)===0||Me.condition.trim().replaceAll(" ","")==="1=1"||Y.checkExpressionValid(Oe.data,Y.getSystemFormatString(Me.condition)))&&(Me.type==="Foreground"||Me.type==="W_Fore"?(Ie.color=Y.toHexColor(Me.fillColor),Y.colorIsTransparentOrEmpty(Ie.color)&&(Ie.color="")):(Me.type==="Background"||Me.type==="W_Back")&&(Ie.background=Y.toHexColor(Me.fillColor),Y.colorIsTransparentOrEmpty(Ie.background)&&(Ie.background="")),Me.fontStyle&&Me.fontStyle.trim().length>0))switch(Me.fontStyle){case"Bold":Ie.fontWeight="bold";break;case"Italic":Ie.fontStyle="italic";break;case"Strikeout":Ie.textDecoration="line-through";break;case"Underline":Ie.textDecoration="underline";break}}return(ge=Oe.node)!=null&&ge.group&&(Ie.fontWeight="bold"),(oe=Oe.node)!=null&&oe.rowPinned&&(Ie.fontWeight="bold",delete Ie.color,delete Ie.background),Ie}),p&&p[H.FIELD_NAME]){const Oe=Ie=>{let Re="";return Ie==null||(typeof Ie=="string"?Re=Y.toString(Ie):typeof Ie=="number"?Re=Y.formatNumberValue(Ie,""):Ir.isPlainObject(Ie)&&(Re=`☑️ ${Y.formatNumberValue(Ie.aggValueOfChecked,"")}
|