@baosight/er4j 0.0.25 → 0.0.26

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.
@@ -77,7 +77,7 @@
77
77
  `):void 0,Fe==="datetime")this.setGridColumnDateTimePicker(r,J,Y.FORMAT_STRING);else if(Fe==="boolean")J.context.cellEditType="checkEditor",J.cellEditor="agCheckboxCellEditor",J.cellDataType="boolean",J.cellRenderer=void 0;else if(Fe==="number"){const Ye={};t.toNumber(Y.DATA_ACCU)>=0&&(Ye.precision=t.toNumber(Y.DATA_ACCU));const st=t.toNumber(Y.MAX_LENGTH)>0?t.getMaxNumber(t.toNumber(Y.MAX_LENGTH),t.toNumber(Y.DATA_ACCU)):void 0;(t.toNumber(Y.MAX_VAL)!==-1||st!==void 0)&&(st!==void 0&&t.toNumber(Y.MAX_VAL)!==-1&&st>t.toNumber(Y.MAX_VAL)?Ye.max=t.toNumber(Y.MAX_VAL):Ye.max=st),(t.toNumber(Y.MIN_VAL)!==-1||st!==void 0)&&(st!==void 0&&t.toNumber(Y.MIN_VAL)!==-1&&-1*st<t.toNumber(Y.MIN_VAL)?Ye.min=t.toNumber(Y.MIN_VAL):st!==void 0&&(Ye.min=-1*st)),Y.COLUMN_EDIT==="G"?Ye.progressBar=!0:(Ye.format=Y.FORMAT_STRING,Ye.summaryFormat=Y.SUMMARY_FORMAT_STRING,Ye.groupFormat=Y.GROUP_FORMAT_STRING),this.setGridColumnNumberEditor(r,J,Ye)}else if(["1","2","4","D","P"].includes(Y.COLUMN_EDIT)){if(J.enablePivot=!0,J.context.columnEditable=Y.ALLOW_EDIT==="1",J.context.cellEditType=["4","D"].includes(Y.COLUMN_EDIT)?"checkGridLookUpEdit":"gridLookUpEdit",this._dropDownBindSource[r]&&this._dropDownBindSource[r][J.colId]){const Ye=this._dropDownBindSource[r][J.colId];Ye.dataSource&&Ye.dataValueField&&Ye.dataTextField&&this.setGridColumnDropdown(r,J,Ye.dataSource,Ye.dataValueField,Ye.dataTextField,Ye.displayFormat)}}else Y.COLUMN_EDIT==="X"?(J.enablePivot=!0,J.context.columnEditable=Y.ALLOW_EDIT==="1",this.setGridColumnImageUpload(r,J,c)):Y.COLUMN_EDIT==="3"?(J.context.cellEditType="buttonEditor",J.cellEditor=q1,J.cellEditorParams={readonly:Y.READ_ONLY==="1",maxLength:t.toNumber(Y.MAX_LENGTH),formHelper:this,configId:r},((Z=Y.POP_FORM)!=null&&Z.trim().startsWith("MenuForm:")||(Te=Y.POP_FORM)!=null&&Te.trim().startsWith("PopFormINQ:"))&&((ce=Y.AUTOFILL_COLS)==null?void 0:ce.trim().length)>0&&(J.cellEditorParams.event=Ye=>{var Qt,St,nr,Tt;const st=Y.AUTOFILL_COLS;let mt="",At=!0;(Qt=Y.POP_FORM)!=null&&Qt.trim().startsWith("MenuForm:")?mt=(St=Y.POP_FORM)==null?void 0:St.trim().substring(9):(nr=Y.POP_FORM)!=null&&nr.trim().startsWith("PopFormINQ:")&&(mt=(Tt=Y.POP_FORM)==null?void 0:Tt.trim().substring(11),At=!1);const Rt=tr=>{st.length>0&&st.split(";").forEach(ae=>{if(ae.trim().length>0){const q=ae.trim().split("="),ee=q[0].toUpperCase().trim();let ne=q[0].toUpperCase().trim();q.length>1&&(ne=q[1].toUpperCase().trim()),Ye.params.data.set(ne,tr[ee]),Ye.params.api.refreshCells({rowNodes:[Ye.params.node],columns:[ne,e.SysInfo.GridCheckColumnFieldName]})}})};if(!At){const tr=new D(this._serverPartition,mt,"",this.InitialService);tr.SelectMode="single",tr.show(null,L=>{L.checkedItem&&Rt(L.checkedItem)})}})):Y.COLUMN_EDIT==="Z"?(J.context.cellEditType="colorEditor",J.cellRenderer=h3,J.cellEditor=e3,J.cellEditorParams={readonly:Y.READ_ONLY==="1",formHelper:this,configId:r}):["5","8"].includes(Y.COLUMN_EDIT)?(J.enablePivot=!0,J.context.cellEditType="largeTextEditor",J.cellEditor=c3,J.cellEditorPopup=!0,J.cellEditorParams={readonly:Y.READ_ONLY==="1",maxLength:t.toNumber(Y.MAX_LENGTH)>0?t.toNumber(Y.MAX_LENGTH):void 0,rows:10,cols:50}):(J.enablePivot=!0,J.context.cellEditType="textEditor",J.cellEditor=o3,J.cellEditorParams={readonly:Y.READ_ONLY==="1",formHelper:this,configId:r,maxLength:t.toNumber(Y.MAX_LENGTH)>0?t.toNumber(Y.MAX_LENGTH):void 0})}else Y.UNBOUND_TYPE!=="0"&&this.setGridColumnUnboundExpression(r,J,c);if(Y.COLUMN_EDIT==="B"){let Ze=["button"],Ye=["按钮"];((ze=Y.DISPLAY_COLS)==null?void 0:ze.trim().length)>0&&(Ze=Y.DISPLAY_COLS.split(",")),((Me=Y.DISPLAY_CAPTIONS)==null?void 0:Me.trim().length)>0&&(Ye=Y.DISPLAY_CAPTIONS.split(","));const st=[];Ye.forEach((mt,At)=>{st.push({name:Ze[At],caption:mt})}),J.enablePivot=!0,J.editable=!1,J.floatingFilter=!1,J.filter=!1,J.sortable=!1,J.cellRenderer=C3,J.cellRendererParams={buttons:st,formHelper:this,configId:r,columnConfig:Y,itemCode:Y.ITEM_CODE,field:Y.FIELD_NAME}}const ct={};Y.ALLOW_CELLMERGE==="1"&&Y.ALLOW_EDIT!=="1"&&p.ALLOW_CELLMERGE==="1"&&(n.context.mergeColumns.push(Y.ITEM_CODE),J.rowSpan=Ze=>{var Ye,st,mt;return Ze.colDef&&((Ye=Ze.data)!=null&&Ye.uid)&&((st=Ze.context)!=null&&st.rowSpanMap)?((mt=Ze.context.rowSpanMap[Ze.colDef.field])==null?void 0:mt[Ze.data.uid])??1:1},ct["er-grid-cell-span"]=Ze=>{var st,mt,At;let Ye=1;return Ze.colDef&&((st=Ze.data)!=null&&st.uid)&&((mt=Ze.context)!=null&&mt.rowSpanMap)&&(Ye=((At=Ze.context.rowSpanMap[Ze.colDef.field])==null?void 0:At[Ze.data.uid])??1),Ye>1}),Object.keys(ct).length>0&&(J.cellClassRules=ct),this.setGridColumnAggFunc(r,J,Y.SUMMARY_TYPE,n,Y),B.length>0?(J.enablePivot=!1,Q[Y.BAND_NAME.toString().trim()].children.push(J)):d.push(J),!n.treeData&&J.rowGroup&&v.push({field:J.field,caption:J.headerTooltip,sort:Y.GROUP_SORT_TYPE,editorType:J.context.cellEditType})}if(n.context.allowDragRow=c==null?void 0:c.rowDragManaged,(c==null?void 0:c.groupDisplayType)!=="multipleColumns"&&(c==null?void 0:c.groupDisplayType)!=="singleColumn"&&v.length>1&&(c==null?void 0:c.mergeColumnsGroup)!==!1){d.forEach(ke=>{ke.rowGroup=!1,ke.sort=void 0});const le="er_grid_multiple_column_group_field_"+t.guid();let Y="";v.forEach(ke=>{Y=Y.length===0?ke.caption:Y+" "+ke.caption}),n.rowGroupPanelShow="never",n.context.groupByFields=v,n.context.groupColumnFieldId=le;const Fe=ke=>{var at,pt;let Ve="";return(pt=(at=ke.context)==null?void 0:at.groupByFields)==null||pt.forEach(ht=>{if(ke.data&&(ht!=null&&ht.caption)&&(ht!=null&&ht.field)){let Ct=`${ht.caption}:${ke.data[ht.field]}`;if(["checkGridLookUpEdit","gridLookUpEdit"].includes(ht.editorType)){const _t=ke.api.getColumnDef(ht.field);Ct=`${ht.caption}:${_t.refData[ke.data[ht.field]]||ke.data[ht.field]}`}else ht.editorType==="checkEditor"&&(Ct=`${ht.caption}:${ke.data[ht.field]?"是":"否"}`);Ve=Ve.length===0?Ct:Ve+"; "+Ct}}),Ve};J={colId:le,field:le,headerName:Y,suppressColumnsToolPanel:!0,sortable:!0,sort:v[0].sort==="2"?"desc":"asc",lockVisible:!0,initialRowGroup:!0,enableRowGroup:!1,showRowGroup:!1,rowGroup:!0,hide:!0,valueGetter:Fe,tootipField:le,tootipValueGetter:Fe},d.push(J)}if(J={colId:e.SysInfo.GridCheckColumnFieldName,pinned:this.IsRtl?"right":"left",rowDrag:c!=null&&c.rowDragManaged?le=>{var Y;return((Y=le.context)==null?void 0:Y.allowDragRow)&&!le.node.group&&!le.node.footer}:void 0,checkboxSelection:p.SHOW_SELECTION.toString()==="1"?le=>!le.node.footer:!1,headerName:"",width:c!=null&&c.rowDragManaged?70:50,minWidth:45,suppressColumnsToolPanel:!0,suppressSizeToFit:!0,suppressMenu:!0,resizable:!0,sortable:!1,suppressMovable:!0,floatingFilter:!1,lockPosition:this.IsRtl?"right":"left"},this.getGridOptions(r,"RowSelection",!0)==="multiple"&&(J.headerCheckboxSelectionFilteredOnly=(c==null?void 0:c.headerCheckboxSelectionFilteredOnly)??!0,J.headerCheckboxSelectionFilteredOnly!==!0?J.headerCheckboxSelectionCurrentPageOnly=c==null?void 0:c.headerCheckboxSelectionCurrentPageOnly:delete J.headerCheckboxSelectionCurrentPageOnly,J.headerCheckboxSelection=(c==null?void 0:c.headerCheckboxSelection)===!1?!1:p.SHOW_SELECTION==="1"),(c==null?void 0:c.showRowNo)!==!1&&!n.treeData&&(J.valueFormatter=le=>{var Y,Fe;return le.node.rowPinned?((Y=le.node.data)==null?void 0:Y.pinndeRowType)==="ErGridSummaryFooter"&&(c==null?void 0:c.showAggreateTitle)!==!1?e.Core.$t("ERX.Aggregate")||"总计":"":le.node.footer&&le.node.level>=0?(c==null?void 0:c.showAggreateTitle)!==!1?e.Core.$t("ERX.GroupAggregate")||"小计":"":le.node.footer?(c==null?void 0:c.showAggreateTitle)!==!1?e.Core.$t("ERX.Aggregate")||"总计":"":le.node.group?c!=null&&c.showGroupRowNo||c!=null&&c.showGroupNo?(e.Core.$t("ERX.GroupAggregate")||"分组")+this.getGroupIndexName(le.node,""):"":((Fe=le.node)==null?void 0:Fe.childIndex)+1},J.cellClass=le=>{var Y,Fe,ke,Ve;return le.node.rowPinned?"er-grid-indicator-rowno-group":le.node.footer&&le.node.level>=0?"er-grid-indicator-rowno":le.node.footer||le.node.group?"er-grid-indicator-rowno-group":(Fe=(Y=le.node)==null?void 0:Y.data)!=null&&Fe.isNew?"er-grid-indicator-rowno-add":(Ve=(ke=le.node)==null?void 0:ke.data)!=null&&Ve.dirty?"er-grid-indicator-rowno-modify":"er-grid-indicator-rowno"},((ge=c.detailConfigId)==null?void 0:ge.trim().length)>0&&c.masterDetail&&(J.cellRenderer="agGroupCellRenderer",J.width=c!=null&&c.rowDragManaged?90:70),J.tooltipValueGetter=c!=null&&c.enableCellTooltip?le=>{var Y;if(!le.node.footer&&!le.node.rowPinned&&!le.node.group)return((Y=le.node)==null?void 0:Y.childIndex)+1}:void 0),n.treeData&&(W||N)){const le=W||N;n.autoGroupColumnDef={colId:le.colId,headerName:le.headerName,field:le.field,pinned:le.pinned,width:le.width,headerTooltip:le.headerTooltip,tooltipField:le.tooltipField,headerComponentParams:le.headerComponentParams,headerClass:le.headerClass,wrapText:le.wrapText,resizable:le.resizable,suppressMovable:!0,lockVisible:!0,suppressSizeToFit:le.suppressSizeToFit,filter:le.filter,filterParams:le.filterParams,cellRendererParams:{suppressCount:!0}};for(let Y=0;Y<d.length;Y++)if(d[Y].field===le.field){d[Y].hide=!0,d[Y].suppressColumnsToolPanel=!0;break}}return c!=null&&c.indicatorWidth&&typeof(c==null?void 0:c.indicatorWidth)=="number"&&(c==null?void 0:c.indicatorWidth)>0&&(J.width=c==null?void 0:c.indicatorWidth),(p.SHOW_SELECTION.toString()==="1"||(c==null?void 0:c.showRowNo)!==!1)&&d.unshift(J),(c==null?void 0:c.showSingleColumnBand)!==!0&&Q&&Object.keys(Q).length>0&&d.forEach((le,Y,Fe)=>{var ke;((ke=le.children)==null?void 0:ke.length)===1&&(Fe[Y]=le.children[0],Fe[Y].autoHeaderHeight=void 0)}),d}getGridHeaderTemplate(r){return t.getGridHeaderTemplate(r)}setGridColumnFilterCountsMap(r){if(r.context.filterCountsMap=r.context.filterCountsMap||{},!r.context.filterCountsMap[r.column.colDef.field]){const i=r.api.getFilterModel();delete i[r.column.colDef.field];let n=r.column.colDef.context.columnConfig.UNBOUND_EXPRESSION;(n==null?void 0:n.trim().length)>0&&!(n!=null&&n.trim().startsWith("return"))&&(n="return "+n);const c={};r.api.forEachLeafNode(d=>{var _;let p=d.data;(n==null?void 0:n.trim().length)>0&&(p={...d.data},p[r.column.colDef.field]=this.excuteGridColumnExpressions(d.data,n));let m=!0;if(Object.entries(i).forEach(([E,v])=>{const A=r.api.getFilterInstance(E);A!=null&&A.doesFilterPass&&(A.doesFilterPass({node:d,data:p})||(m=!1))}),m){let E=(p==null?void 0:p[r.column.colDef.field])||"NullFilterValue";(((_=r.column.colDef.cellEditor)==null?void 0:_.name)==="DatetimeEditor"||r.column.colDef.context.columnConfig.UNBOUND_TYPE==="4")&&(E=t.getDateTimeFormatString(E,r.column.colDef.context.formatString)||E),c[E]=c[E]===void 0?1:c[E]+1}}),r.context.filterCountsMap[r.column.colDef.field]=c}return r.context.filterCountsMap[r.column.colDef.field]}getGroupIndexName(r,i){var n;return i=i.length>0?`${t.toString(r.childIndex+1)}-${i}`:t.toString(r.childIndex+1),((n=r==null?void 0:r.parent)==null?void 0:n.childIndex)===void 0?i:this.getGroupIndexName(r==null?void 0:r.parent,i)}createGridBandColumn(r,i,n,c,d){let p;c===void 0||c.groupId===void 0?p=r.filter(m=>m.FATHER_NODE_CODE.trim().length===0):p=r.filter(m=>m.FATHER_NODE_CODE.trim()===c.groupId),p&&p.length>0&&p.forEach(m=>{const _={groupId:m.CURRENT_NODE_CODE,headerName:m.CURRENT_NODE_DESC,headerGroupComponent:H3,marryChildren:!0,headerClass:"er-grid-band-align-center",children:[]};(d==null?void 0:d.bandTextAlign)==="left"?_.headerClass="er-grid-band-align-left":(d==null?void 0:d.bandTextAlign)==="right"&&(_.headerClass="er-grid-band-align-right"),n[m.CURRENT_NODE_CODE]=_,c&&c.children?(c.children.push(_),delete n[c.groupId]):i.push(_),this.createGridBandColumn(r,i,n,_,d)})}setGridColumnAggFunc(r,i,n,c,d){var p,m,_,E,v,A,B,Q,N,W,J,re;if(n instanceof Function)i.aggFunc=n;else if((n==null?void 0:n.trim().length)>0){const Se=(ue,me)=>{ue.childrenAfterFilter.forEach(Z=>{Z.group?Se(Z,me):me.push(Z)})};switch(n){case"Sum":i.aggFunc=ue=>{var me;try{let Z=new Gt(0);return(me=ue.values)==null||me.forEach(Te=>{Z=Z.plus(new Gt(Te||0))}),Z.toNumber()}catch(Z){return console.error(Z),0}};break;case"SumForChecked":c.context.aggForChecked=!0,i.context.aggForChecked=!0,i.aggFunc=ue=>{var me,Z,Te;try{let ce=new Gt(0);return((Z=(me=ue.rowNode)==null?void 0:me.childrenAfterFilter)==null?void 0:Z.length)>0&&((Te=ue.rowNode)==null||Te.childrenAfterFilter.forEach(ze=>{var Me;ze.group&&ze.aggData?ce=ce.plus(new Gt(ze.aggData[ue.colDef.field]||0)):(Me=ze.data)!=null&&Me.uid&&ze.selected&&(ce=ce.plus(new Gt(ze.data[ue.colDef.field]||0)))})),ce.toNumber()}catch(ce){return console.error(ce),0}};break;case"Sum&ForChecked":c.context.aggForChecked=!0,i.context.aggForChecked=!0,i.aggFunc=ue=>{var me,Z,Te;try{let ce=new Gt(0),ze=new Gt(0);return((Z=(me=ue.rowNode)==null?void 0:me.childrenAfterFilter)==null?void 0:Z.length)>0&&((Te=ue.rowNode)==null||Te.childrenAfterFilter.forEach(Me=>{var ge;Me.group&&Me.aggData?(ce=ce.plus(new Gt(Me.aggData[ue.colDef.field].aggValue||0)),ze=ze.plus(new Gt(Me.aggData[ue.colDef.field].aggValueOfChecked||0))):(ge=Me.data)!=null&&ge.uid&&(Me.selected&&(ze=ze.plus(new Gt(Me.data[ue.colDef.field]||0))),ce=ce.plus(new Gt(Me.data[ue.colDef.field]||0)))})),{aggValue:ce.toNumber(),aggValueOfChecked:ze.toNumber()}}catch(ce){return console.error(ce),{aggValue:0,aggValueOfChecked:0}}};break;case"SumForDistinct":i.context.weightColumnField=((p=d.WEIGHT_COLUMN)==null?void 0:p.trim())||d.FIELD_NAME,i.context.weightColumnField=i.context.weightColumnField.split(","),i.aggFunc=ue=>{var me,Z,Te,ce,ze,Me;try{let ge=new Gt(0);const le={};return((Te=(Z=(me=ue.colDef)==null?void 0:me.context)==null?void 0:Z.weightColumnField)==null?void 0:Te.length)>0&&((ze=(ce=ue.rowNode)==null?void 0:ce.childrenAfterFilter)==null?void 0:ze.length)>0&&((Me=ue.rowNode)==null||Me.childrenAfterFilter.forEach(Y=>{var Fe,ke,Ve;if(Y.group&&Y.aggData)ge=ge.plus(new Gt(Y.aggData[ue.colDef.field]||0));else if((Fe=Y.data)!=null&&Fe.uid){let at="";(Ve=(ke=ue.colDef)==null?void 0:ke.context)==null||Ve.weightColumnField.forEach(pt=>{const ht=this.getGridCellRenderText(r,pt,Y.data[pt]);at=at.length===0?ht:at+"&"+ht}),le[at]===void 0&&(ge=ge.plus(new Gt(Y.data[ue.colDef.field]||0)),le[at]=!0)}})),ge.toNumber()}catch(ge){return console.error(ge),0}};break;case"CountForChecked":c.context.aggForChecked=!0,i.context.aggForChecked=!0,i.aggFunc=ue=>{var me,Z,Te;try{let ce=0;return((Z=(me=ue.rowNode)==null?void 0:me.childrenAfterFilter)==null?void 0:Z.length)>0&&((Te=ue.rowNode)==null||Te.childrenAfterFilter.forEach(ze=>{var Me;ze.group&&ze.aggData?ce=ce+e.Core.toNumber(ze.aggData[ue.colDef.field]):(Me=ze.data)!=null&&Me.uid&&ze.selected&&(ce+=1)})),ce}catch(ce){return console.error(ce),0}};break;case"Count&ForChecked":c.context.aggForChecked=!0,i.context.aggForChecked=!0,i.aggFunc=ue=>{var me,Z,Te;try{let ce=new Gt(0),ze=new Gt(0);return((Z=(me=ue.rowNode)==null?void 0:me.childrenAfterFilter)==null?void 0:Z.length)>0&&((Te=ue.rowNode)==null||Te.childrenAfterFilter.forEach(Me=>{var ge;Me.group&&Me.aggData?(ce=ce.plus(new Gt(Me.aggData[ue.colDef.field].aggValue||0)),ze=ze.plus(new Gt(Me.aggData[ue.colDef.field].aggValueOfChecked||0))):(ge=Me.data)!=null&&ge.uid&&(Me.selected&&(ze=ze.plus(1)),ce=ce.plus(1))})),{aggValue:ce.toNumber(),aggValueOfChecked:ze.toNumber()}}catch(ce){return console.error(ce),{aggValue:0,aggValueOfChecked:0}}};break;case"CountForDistinct":i.context.weightColumnField=((m=d.WEIGHT_COLUMN)==null?void 0:m.trim())||d.FIELD_NAME,i.context.weightColumnField=i.context.weightColumnField.split(","),i.aggFunc=ue=>{var me,Z,Te,ce,ze,Me;try{let ge=new Gt(0);const le={};return((Te=(Z=(me=ue.colDef)==null?void 0:me.context)==null?void 0:Z.weightColumnField)==null?void 0:Te.length)>0&&((ze=(ce=ue.rowNode)==null?void 0:ce.childrenAfterFilter)==null?void 0:ze.length)>0&&((Me=ue.rowNode)==null||Me.childrenAfterFilter.forEach(Y=>{var Fe,ke,Ve;if(Y.group&&Y.aggData)ge=ge.plus(new Gt(Y.aggData[ue.colDef.field]||0));else if((Fe=Y.data)!=null&&Fe.uid){let at="";(Ve=(ke=ue.colDef)==null?void 0:ke.context)==null||Ve.weightColumnField.forEach(pt=>{const ht=this.getGridCellRenderText(r,pt,Y.data[pt]);at=at.length===0?ht:at+"&"+ht}),le[at]===void 0&&(ge=ge.plus(1),le[at]=!0)}})),ge.toNumber()}catch(ge){return console.error(ge),0}};break;case"WeightedAverage":case"WeightedAverageEx":if(((_=d.WEIGHT_COLUMN)==null?void 0:_.trim().length)>0){let ue="",me="";const Z=(E=d.WEIGHT_COLUMN)==null?void 0:E.trim().split("/");Z.length>1?(ue=Z[0],me=Z[1]):(ue=d.FIELD_NAME,me=Z[0]),(Q=(B=(A=(v=c.context)==null?void 0:v.bindingSource)==null?void 0:A.options)==null?void 0:B.schema)!=null&&Q[ue]&&((re=(J=(W=(N=c.context)==null?void 0:N.bindingSource)==null?void 0:W.options)==null?void 0:J.schema)!=null&&re[me])&&(i.context.weightColumnField=me,i.aggFunc=Te=>{try{let ce=new Gt(0),ze=new Gt(0);const Me=[];return Se(Te.rowNode,Me),Me.forEach(ge=>{const le=new Gt(ge.data[ue]||0),Y=new Gt(ge.data[me]||0);n==="WeightedAverageEx"?ce=ce.plus(le):ce=ce.plus(le.times(Y)),ze=ze.plus(Y)}),ze.toNumber()!==0?ce.dividedBy(ze).toNumber():0}catch(ce){return console.error(ce),0}})}break;case"Count":i.aggFunc=ue=>{var me,Z,Te;try{let ce=new Gt(0);return((Z=(me=ue.rowNode)==null?void 0:me.childrenAfterFilter)==null?void 0:Z.length)>0&&((Te=ue.rowNode)==null||Te.childrenAfterFilter.forEach(ze=>{var Me;ze.group&&ze.aggData?ce=ce.plus(new Gt(ze.aggData[ue.colDef.field]||0)):(Me=ze.data)!=null&&Me.uid&&(ce=ce.plus(1))})),ce.toNumber()}catch(ce){return console.error(ce),0}};break;case"Average":i.aggFunc=ue=>{var me;try{let Z=new Gt(0),Te=0;return(me=ue.values)==null||me.forEach(ce=>{Z=Z.plus(new Gt(ce||0)),Te++}),Te>0?Z.dividedBy(Te).toNumber():0}catch(Z){return console.error(Z),0}};break;case"Max":i.aggFunc=ue=>{var me;return(me=ue.values)==null?void 0:me.reduce((Z,Te)=>Te>Z?Te:Z,ue.values[0])};break;case"Min":i.aggFunc=ue=>{var me;return(me=ue.values)==null?void 0:me.reduce((Z,Te)=>Te<Z?Te:Z,ue.values[0])};break}}return i}setGridColumnDropdown(r,i,n,c="CODE",d,p="default"){var v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me,ge,le,Y;i.cellEditorPopup=((A=(v=i.context)==null?void 0:v.columnConfig)==null?void 0:A.READ_ONLY)!=="1",i.cellEditor=Y1,i.cellEditorParams={readonly:((Q=(B=i.context)==null?void 0:B.columnConfig)==null?void 0:Q.READ_ONLY)==="1",formHelper:this,configId:r,multiple:i.context.cellEditType==="checkGridLookUpEdit"},i.context=i.context||{},i.context.valueField=c,i.context.textField=d;const m={},_={},E=Fe=>{var Ve,at;let ke="";return p&&p instanceof Function?ke=p(Fe):p==="default"?ke=((at=(Ve=i.context)==null?void 0:Ve.columnConfig)==null?void 0:at.VALUE_VISIBLE)==="1"?"{0}|{1}":"{1}":typeof p=="string"&&p.trim().length>0&&(ke=p.trim()),ke=ke||"{1}",ke.replaceAll("{0}",Fe[c]).replaceAll("{1}",Fe[d])};return(n==null?void 0:n.length)>0&&n.forEach(Fe=>{var ke,Ve;m[Fe[c]]=E(Fe),((ke=i.context.columnConfig)==null?void 0:ke.COLUMN_EDIT)==="P"&&((Ve=Fe.IMAGE_URL)==null?void 0:Ve.trim().length)>0&&(_[Fe[c]]=Fe.IMAGE_URL)}),i.context.iconUrlMap=((N=i.context.columnConfig)==null?void 0:N.COLUMN_EDIT)==="P"?_:void 0,i.refData=m,i.valueFormatter=Fe=>{var Ve,at,pt,ht,Ct,_t,Qe,U,gt;let ke="";if(Fe.node.rowPinned||Fe.node.group){const rt=Fe.value,ct=(Fe.node.rowPinned?(ht=(pt=(at=(Ve=Fe.column)==null?void 0:Ve.colDef)==null?void 0:at.context)==null?void 0:pt.columnConfig)==null?void 0:ht.SUMMARY_FORMAT_STRING:(Qe=(_t=(Ct=Fe.column.colDef)==null?void 0:Ct.context)==null?void 0:_t.columnConfig)==null?void 0:Qe.GROUP_FORMAT_STRING)||"";typeof rt=="string"?ke=t.toString(rt):typeof rt=="number"?ke=t.formatNumberValue(rt,ct):Wr.isPlainObject(rt)&&(ke=`${t.formatNumberValue(rt.aggValueOfChecked,ct)}<br>${t.formatNumberValue(rt.aggValue,ct)}`)}else{let rt=e.Core.toString(Fe.value).trim();Fe.data&&Fe.colDef&&(rt=e.Core.toString(Fe.data[Fe.colDef.field]).trim()),rt.length>0&&(((U=i.context)==null?void 0:U.cellEditType)==="checkGridLookUpEdit"&&c!==d?rt.split(",").forEach(Ze=>{var Ye,st;ke=ke.length===0?m[Ze]||((Ye=i.context)!=null&&Ye.viewOptions.nullSelectOptionTag?`❓${rt}`:rt):ke+","+(m[Ze]||((st=i.context)!=null&&st.viewOptions.nullSelectOptionTag?`❓${rt}`:rt))}):ke=m[rt]||((gt=i.context)!=null&&gt.viewOptions.nullSelectOptionTag?`❓${rt}`:rt))}return ke},(((W=i.context.columnConfig)==null?void 0:W.COLUMN_EDIT)==="P"||((re=(J=i.context)==null?void 0:J.columnConfig)==null?void 0:re.CALL_FORM.trim().length)>0)&&(i.cellRenderer=Fe=>{var ht,Ct,_t,Qe,U,gt,rt,ct,Ze,Ye;const ke=i.valueFormatter(Fe).replace(/</g,"&lt;");let Ve="",at="";(ht=Fe.data)!=null&&ht.uid&&Fe.value&&((Ct=i.context.columnConfig)==null?void 0:Ct.COLUMN_EDIT)==="P"&&((_t=_[Fe.value])==null?void 0:_t.trim().length)>0&&((Qe=_[Fe.value])!=null&&Qe.trim().startsWith("IconFont:")?Ve="#icon-"+_[Fe.value].replace("IconFont:",""):(U=_[Fe.value])!=null&&U.trim().startsWith("ImgUrl:")&&(at=`${e.Core.getBaseUrl()}svg/${_[Fe.value].replace("ImgUrl:","")}`));const pt=((rt=(gt=i.context)==null?void 0:gt.columnConfig)==null?void 0:rt.CALL_FORM.trim().length)>0&&((ct=Fe.node)==null?void 0:ct.data)instanceof e.Model;return pt||Ve||at?t.createVNodeElement(l.createVNode(_i,{params:{...Fe,svgIcon:Ve,imgIcon:at,callFormLink:pt,displayText:ke,justifyContent:((Ze=i.context.columnConfig)==null?void 0:Ze.HALIGNMENT)==="Far"?"flex-end":((Ye=i.context.columnConfig)==null?void 0:Ye.HALIGNMENT)==="Center"?"center":"flex-start",click:pt?st=>{var Rt;let mt=i.context.columnConfig.CALL_FORM;const At=(Rt=st.node)==null?void 0:Rt.data.toJSON();mt.endsWith("??")?(mt=mt.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(At)))):mt.endsWith("?")&&(mt=mt.replace("?",""),encodeURIComponent(JSON.stringify(At))),this.setLocalStorage(mt,{senderType:"gridCell",value:st.value,data:At,formNameFrom:this.FormName})}:void 0}})):ke}),i.context.columnConfig.ALLOW_FILTER==="0"?i.filter=!1:(i.filter="agMultiColumnFilter",i.filterParams={filters:[{filter:"agTextColumnFilter",filterParams:{textMatcher:({filterOption:Fe,value:ke,filterText:Ve})=>{if(Ve==null)return!1;switch(ke=m[ke]||ke,Fe){case"contains":return ke.indexOf(Ve)>=0;case"notContains":return ke.indexOf(Ve)<0;case"equals":return ke===Ve;case"notEqual":return ke!=Ve;case"startsWith":return ke.indexOf(Ve)===0;case"endsWith":const at=ke.lastIndexOf(Ve);return at>=0&&at===ke.length-Ve.length;default:return console.warn("invalid filter type "+Wr.filter),!1}},caseSensitive:!0,buttons:((ue=(Se=i.context)==null?void 0:Se.viewOptions)==null?void 0:ue.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(Z=(me=i.context)==null?void 0:me.viewOptions)==null?void 0:Z.closeOnApplyFilter}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:(ce=(Te=i.context)==null?void 0:Te.viewOptions)!=null&&ce.showFilterCounts?Fe=>{const ke=this.setGridColumnFilterCountsMap(Fe);return Fe.value,`${m[Fe.value]||Fe.value||"("+this.$t("ERX.Null")+")"} (${ke[Fe.value||"NullFilterValue"]||0})`}:void 0,showTooltips:!0,buttons:((Me=(ze=i.context)==null?void 0:ze.viewOptions)==null?void 0:Me.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(le=(ge=i.context)==null?void 0:ge.viewOptions)==null?void 0:le.closeOnApplyFilter}}]},i.context.columnConfig.AUTO_FILTER_CONDITION==="Default"||i.context.columnConfig.AUTO_FILTER_CONDITION==="Contains"?i.filterParams.defaultOption="contains":i.context.columnConfig.AUTO_FILTER_CONDITION==="Like"||i.context.columnConfig.AUTO_FILTER_CONDITION==="StartsWith"?i.filterParams.defaultOption="startsWith":i.context.columnConfig.AUTO_FILTER_CONDITION==="EndsWith"?i.filterParams.defaultOption="endsWith":i.filterParams.defaultOption="equals"),i.getQuickFilterText=i.valueFormatter,i.tooltipField=void 0,i.tooltipValueGetter=(Y=i.context.viewOptions)!=null&&Y.enableCellTooltip?Fe=>i.valueFormatter(Fe):void 0,this}setGridColumnDateTimePicker(r,i,n="yyyy-MM-dd HH:mm:ss"){var d,p,m,_,E,v,A,B,Q,N,W,J,re,Se,ue;i.enablePivot=!0,i.context.cellEditType="dateEditor",i.cellDataType=!1,i.cellEditor=U1,i.cellEditorParams={readonly:((p=(d=i.context)==null?void 0:d.columnConfig)==null?void 0:p.READ_ONLY)==="1",formHelper:this,configId:r},i.aggFunc=void 0;const c=t.toString(n,!0);if(i.cellEditorParams.type=c.includes("HH")?"datetime":"date",i.cellEditorParams.showTime=c.includes("HH"),i.cellEditorParams.format=c.replaceAll("y","Y").replaceAll("d","D").replaceAll("/","-"),i.cellEditorParams.picker=["YYYY-MM","YYYY/MM"].includes(c.toUpperCase())?"month":c.toUpperCase()==="YYYY"?"year":void 0,i.context.columnConfig.ALLOW_FILTER==="0")i.filter=!1;else{const me=["DateSmart","DateAlt","Date"].includes(i.context.columnConfig.FILTER_POPMODE);i.filter="agMultiColumnFilter",i.filterParams={filters:[{filter:me?"agDateColumnFilter":"agTextColumnFilter",filterParams:{inRangeInclusive:me,comparator:me?(Z,Te)=>{if(Te==null)return 0;const ce=Ut(Te).toDate();return Z<ce?1:Z>ce?-1:0}:void 0,buttons:((_=(m=i.context)==null?void 0:m.viewOptions)==null?void 0:_.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(v=(E=i.context)==null?void 0:E.viewOptions)==null?void 0:v.closeOnApplyFilter}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:(B=(A=i.context)==null?void 0:A.viewOptions)!=null&&B.showFilterCounts?Z=>{const Te=this.setGridColumnFilterCountsMap(Z);return`${Z.value||"("+this.$t("ERX.Null")+")"} (${Te[Z.value||"NullFilterValue"]||0})`}:void 0,showTooltips:!0,buttons:((N=(Q=i.context)==null?void 0:Q.viewOptions)==null?void 0:N.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(J=(W=i.context)==null?void 0:W.viewOptions)==null?void 0:J.closeOnApplyFilter}}]},i.filterValueGetter=Z=>{var Te;if((Te=Z.data)!=null&&Te[Z.column.colDef.field])return t.getDateTimeFormatString(Z.data[Z.column.colDef.field],c)},i.context.columnConfig.AUTO_FILTER_CONDITION==="Contains"?i.filterParams.defaultOption=me?"inRange":"contains":i.context.columnConfig.AUTO_FILTER_CONDITION==="Like"||i.context.columnConfig.AUTO_FILTER_CONDITION==="StartsWith"?i.filterParams.defaultOption=me?"greaterThan":"startsWith":i.context.columnConfig.AUTO_FILTER_CONDITION==="EndsWith"?i.filterParams.defaultOption=me?"lessThan":"endsWith":i.filterParams.defaultOption="equals"}return i.valueFormatter=me=>{var ze,Me,ge,le,Y,Fe,ke,Ve,at,pt;let Z,Te=c,ce="";return(Me=(ze=me.node)==null?void 0:ze.rowGroupColumn)!=null&&Me.colDef&&me.value?Z=me.value:me.node.rowPinned||me.node.group?(Z=me.value,Te=(me.node.rowPinned?(Fe=(Y=(le=(ge=me.column)==null?void 0:ge.colDef)==null?void 0:le.context)==null?void 0:Y.columnConfig)==null?void 0:Fe.SUMMARY_FORMAT_STRING:(pt=(at=(Ve=(ke=me.column)==null?void 0:ke.colDef)==null?void 0:Ve.context)==null?void 0:at.columnConfig)==null?void 0:pt.GROUP_FORMAT_STRING)||Te):me.value&&(Z=me.value),Z!==void 0&&(typeof Z=="string"||Ut.isDayjs(Z)||Z instanceof Date?ce=t.getDateTimeFormatString(Z,Te):typeof Z=="number"?ce=t.formatNumberValue(Z,Te):Wr.isPlainObject(Z)&&(ce=`☑️ ${t.formatNumberValue(Z.aggValueOfChecked,Te)}
78
78
  ∑ ${t.formatNumberValue(Z.aggValue,Te)}`)),ce},((Se=(re=i.context)==null?void 0:re.columnConfig)==null?void 0:Se.CALL_FORM.trim().length)>0&&(i.cellRenderer=me=>{var Z,Te,ce;if(me.node.rowPinned)return i.valueFormatter(me);if(me.value!==void 0){const ze=i.valueFormatter(me);return((Z=me.node)==null?void 0:Z.data)instanceof e.Model&&ze?t.createVNodeElement(l.createVNode(_i,{params:{...me,callFormLink:!0,displayText:ze,justifyContent:((Te=i.context.columnConfig)==null?void 0:Te.HALIGNMENT)==="Near"?"flex-start":((ce=i.context.columnConfig)==null?void 0:ce.HALIGNMENT)==="Far"?"flex-end":"center",click:Me=>{var Y;let ge=i.context.columnConfig.CALL_FORM;const le=(Y=Me.node)==null?void 0:Y.data.toJSON();ge.endsWith("??")?(ge=ge.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(le)))):ge.endsWith("?")&&(ge=ge.replace("?",""),encodeURIComponent(JSON.stringify(le))),this.setLocalStorage(ge,{senderType:"gridCell",value:Me.value,data:le,formNameFrom:this.FormName})}}})):ze}}),i.tooltipField=void 0,i.tooltipValueGetter=(ue=i.context.viewOptions)!=null&&ue.enableCellTooltip?me=>i.valueFormatter(me):void 0,this}setGridColumnNumberEditor(r,i,n){var c,d,p,m,_,E,v,A,B,Q,N,W,J,re,Se;return i.context.cellEditType="numberEditor",i.enableValue=!0,i.cellEditor=a3,i.cellDataType="number",i.cellEditorParams={readonly:((d=(c=i.context)==null?void 0:c.columnConfig)==null?void 0:d.READ_ONLY)==="1",formHelper:this,configId:r},(n==null?void 0:n.precision)>0&&(i.cellEditorParams.precision=n.precision),i.cellEditorParams.max=n==null?void 0:n.max,i.cellEditorParams.min=n==null?void 0:n.min,i.context.columnConfig.ALLOW_FILTER==="0"?i.filter=!1:(i.filter="agMultiColumnFilter",i.filterParams={filters:[{filter:"agNumberColumnFilter",filterParams:{buttons:((m=(p=i.context)==null?void 0:p.viewOptions)==null?void 0:m.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(E=(_=i.context)==null?void 0:_.viewOptions)==null?void 0:E.closeOnApplyFilter}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:(A=(v=i.context)==null?void 0:v.viewOptions)!=null&&A.showFilterCounts?ue=>{const me=this.setGridColumnFilterCountsMap(ue);return`${ue.value||"("+this.$t("ERX.Null")+")"} (${me[ue.value||"NullFilterValue"]||0})`}:void 0,showTooltips:!0,buttons:((Q=(B=i.context)==null?void 0:B.viewOptions)==null?void 0:Q.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:(W=(N=i.context)==null?void 0:N.viewOptions)==null?void 0:W.closeOnApplyFilter,comparator:(ue,me)=>{const Z=parseFloat(ue),Te=parseFloat(me);return Z===Te?0:Z>Te?1:-1}}}]},i.context.columnConfig.AUTO_FILTER_CONDITION==="Contains"?i.filterParams.defaultOption="inRange":i.context.columnConfig.AUTO_FILTER_CONDITION==="Like"||i.context.columnConfig.AUTO_FILTER_CONDITION==="StartsWith"?i.filterParams.defaultOption="greaterThan":i.context.columnConfig.AUTO_FILTER_CONDITION==="EndsWith"?i.filterParams.defaultOption="lessThan":i.filterParams.defaultOption="equals"),i.valueFormatter=ue=>{var ce,ze,Me,ge,le,Y,Fe,ke,Ve,at;let me,Z=(ce=n==null?void 0:n.format)==null?void 0:ce.trim(),Te="";return(Me=(ze=ue.node)==null?void 0:ze.rowGroupColumn)!=null&&Me.colDef&&ue.value!==void 0?(me=ue.value,Z=((le=(ge=i.context)==null?void 0:ge.columnConfig)==null?void 0:le.FORMAT_STRING)||Z):ue.node.rowPinned||ue.node.group?(me=ue.value,Z=(ue.node.rowPinned?(Y=n==null?void 0:n.summaryFormat)==null?void 0:Y.trim():(Fe=n==null?void 0:n.groupFormat)==null?void 0:Fe.trim())||((ke=n==null?void 0:n.format)==null?void 0:ke.trim())||""):ue.value!==void 0&&(me=ue.value,Z=((at=(Ve=i.context)==null?void 0:Ve.columnConfig)==null?void 0:at.FORMAT_STRING)||Z),me!==void 0&&(typeof me=="number"?Te=t.formatNumberValue(me,Z):Wr.isPlainObject(me)?Te=`☑️ ${t.formatNumberValue(me.aggValueOfChecked,Z)}
79
79
  ∑ ${t.formatNumberValue(me.aggValue,Z)}`:Te=t.formatNumberValue(me,Z)),Te},n.progressBar?(i.cellRenderer=x3,i.cellRendererParams=ue=>{var Z;ue.displayText=t.formatNumberValue(ue.value,(Z=n==null?void 0:n.format)==null?void 0:Z.trim()),ue.maxValue=(n==null?void 0:n.max)>0?n==null?void 0:n.max:100,ue.progressBarColor="#299a8c";const me=this.getGridCustomEvent(r,"cellProgressBarColor");if(me&&me instanceof Function){const Te=me(ue);Te&&(ue.progressBarColor=Te)}return ue}):((re=(J=i.context)==null?void 0:J.columnConfig)==null?void 0:re.CALL_FORM.trim().length)>0&&(i.cellRenderer=ue=>{var me,Z,Te,ce,ze,Me,ge;if(ue.node.rowPinned)return(me=n==null?void 0:n.summaryFormat)!=null&&me.trim()||((Z=n==null?void 0:n.format)==null||Z.trim()),i.valueFormatter(ue);if(ue.value!==void 0){const le=i.valueFormatter(ue),Y=((ce=(Te=i.context)==null?void 0:Te.columnConfig)==null?void 0:ce.CALL_FORM.trim().length)>0&&((ze=ue.node)==null?void 0:ze.data)instanceof e.Model;return Y&&(le==null?void 0:le.length)>0?t.createVNodeElement(l.createVNode(_i,{params:{...ue,callFormLink:Y,displayText:le,antTooltip:!0,justifyContent:((Me=i.context.columnConfig)==null?void 0:Me.HALIGNMENT)==="Near"?"flex-start":((ge=i.context.columnConfig)==null?void 0:ge.HALIGNMENT)==="Center"?"center":"flex-end",click:Y?Fe=>{var at;let ke=i.context.columnConfig.CALL_FORM;const Ve=(at=Fe.node)==null?void 0:at.data.toJSON();ke.endsWith("??")?(ke=ke.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(Ve)))):ke.endsWith("?")&&(ke=ke.replace("?",""),encodeURIComponent(JSON.stringify(Ve))),this.setLocalStorage(ke,{senderType:"gridCell",value:Fe.value,data:Ve,formNameFrom:this.FormName})}:void 0}})):le}}),i.tooltipField=void 0,i.tooltipValueGetter=(Se=i.context.viewOptions)!=null&&Se.enableCellTooltip?ue=>{var me,Z,Te;return ue.node.rowPinned?(me=n==null?void 0:n.summaryFormat)==null||me.trim():ue.node.group?(Z=n==null?void 0:n.groupFormat)==null||Z.trim():(Te=n==null?void 0:n.format)==null||Te.trim(),i.valueFormatter(ue).replaceAll("<br>",`
80
- `)}:void 0,this}setGridColumnImageUpload(r,i,n){return i.editable=!1,i.cellRenderer=Mn,i.cellRendererParams=c=>{var d,p,m;if((d=c.data)!=null&&d.uid&&((p=c.value)==null?void 0:p.trim().length)>0)return c.src=(m=c.value)==null?void 0:m.trim(),c.width=c.colDef.width||200,c.height=n.rowHeight||100,c.configId=r,c},this}setGridColumnUnboundExpression(r,i,n){var d;i.field=i.context.columnConfig.ITEM_CODE,i.editable=!1,i.tooltipField=void 0,i.enablePivot=i.context.columnConfig.UNBOUND_TYPE==="1",i.valueGetter=p=>{var m,_;if(!p.node.rowPinned&&p.data&&((m=i.context.columnConfig.UNBOUND_EXPRESSION)==null?void 0:m.trim().length)>0){let E=i.context.columnConfig.UNBOUND_EXPRESSION;E!=null&&E.trim().startsWith("return")||(E="return "+E);const v=this.excuteGridColumnExpressions(p.data,E);if(v!==void 0)return i.context.columnConfig.UNBOUND_TYPE==="2"||i.context.columnConfig.UNBOUND_TYPE==="3"?t.toNumber(v):i.context.columnConfig.UNBOUND_TYPE==="4"?t.toDateTime(v):i.context.columnConfig.UNBOUND_TYPE==="5"?t.toBoolean(v):t.toString(v)}else return(_=p.data)==null?void 0:_[i.context.columnConfig.ITEM_CODE]};const c=p=>{let m="";if(p.value!==void 0)if(i.context.columnConfig.UNBOUND_TYPE==="2"||i.context.columnConfig.UNBOUND_TYPE==="3"){const _=p.node.rowPinned?i.context.columnConfig.SUMMARY_FORMAT_STRING.trim():p.node.group?i.context.columnConfig.GROUP_FORMAT_STRING.trim():i.context.columnConfig.FORMAT_STRING;m=t.formatNumberValue(p.value,_||i.context.columnConfig.FORMAT_STRING)}else i.context.columnConfig.UNBOUND_TYPE==="4"?m=t.getDateTimeFormatString(p.value,i.context.columnConfig.FORMAT_STRING):m=t.toString(p.value);return m};return i.valueFormatter=p=>{if(p.value!==void 0)return c(p)},((d=i.context.columnConfig.CALL_FORM)==null?void 0:d.trim().length)>0&&(i.cellRenderer=p=>{var m,_,E;if(p.value!==void 0){const v=c(p),A=((m=p.node)==null?void 0:m.data)instanceof e.Model;return(v==null?void 0:v.length)>0&&A?t.createVNodeElement(l.createVNode(_i,{params:{...p,displayText:v,justifyContent:((_=i.context.columnConfig)==null?void 0:_.HALIGNMENT)==="Far"?"flex-end":((E=i.context.columnConfig)==null?void 0:E.HALIGNMENT)==="Center"?"center":"flex-start",callFormLink:A,antTooltip:!0,click:A?B=>{var W;let Q=i.context.columnConfig.CALL_FORM;const N=(W=B.node)==null?void 0:W.data.toJSON();Q.endsWith("??")?(Q=Q.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(N)))):Q.endsWith("?")&&(Q=Q.replace("?",""),encodeURIComponent(JSON.stringify(N))),this.setLocalStorage(Q,{senderType:"gridCell",value:B.value,data:N,formNameFrom:this.FormName})}:void 0}})):v}}),i.tooltipField=void 0,i.tooltipValueGetter=n!=null&&n.enableCellTooltip?p=>c(p):void 0,i.filter="agMultiColumnFilter",i.filterParams={filters:[{filter:"agTextColumnFilter",filterParams:{buttons:(n==null?void 0:n.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:n==null?void 0:n.closeOnApplyFilter,maxNumConditions:(n==null?void 0:n.maxNumConditions)||5}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:n!=null&&n.showFilterCounts?p=>{const m=this.setGridColumnFilterCountsMap(p);return`${p.value||"("+this.$t("ERX.Null")+")"} (${m[p.value||"NullFilterValue"]||0})`}:void 0,showTooltips:!0,buttons:(n==null?void 0:n.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:n==null?void 0:n.closeOnApplyFilter}}]},this}getGridMenuItems(r){var m,_,E,v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me,ge,le,Y,Fe,ke,Ve,at,pt,ht,Ct,_t,Qe,U,gt,rt,ct,Ze,Ye,st,mt,At,Rt,Qt,St,nr,Tt,tr,L,ae,q,ee,ne,se,be,Ue,De,Ae,Pe,tt,k,ie,Ce,we,Xe,ft,V,de,w,Oe,We,Be,ye,je,ot,He,nt,dt,Et,yt,bt,kt,Lt,g,qt,Wt,Ca,Ga,za,$a;const i=(_=(m=r.column)==null?void 0:m.gridOptionsService)==null?void 0:_.gridOptions,n=(E=r==null?void 0:r.context)==null?void 0:E.options,c=(v=i==null?void 0:i.context)==null?void 0:v.configId,d=r.defaultItems;d.length=0,d.push("pinSubMenu","separator","autoSizeThis","autoSizeAll","separator");const p=(vt=!1)=>{var xt;const Yt=new e.PopQueryHelper(this._serverPartition,"SI00DataTableCols","LayoutGroupFilter,gridView1",this._serviceName);Yt.AutoRefresh=!0,Yt.AutoQuery=!0,Yt.DefaultValues={values:{DATASET_NAME:this._formDataSet.Name,TABLE_NAME:(xt=r.context)==null?void 0:xt.bindTableName},readonly:{DATASET_NAME:!0,TABLE_NAME:!0}},Yt.ShowCheckBoxColumn=!0,Yt.setFormOptions({beforeBindData:Dt=>(Dt=Dt.filter(rr=>!r.columnApi.columnModel.gridColumns.some(ar=>ar.colId===rr.COL_NAME)),Dt)}),Yt.setEvent("ok",async Dt=>{var Pr,da;const rr=(wt,ea)=>{var qe,cr,pr,or;return((qe=wt.FIELD_NAME)==null?void 0:qe.trim().length)===0||(wt.DATA_TYPE==="2"?(wt.FORMAT_TYPE="Numeric",["金额","税额","发生额","款"].some(Jt=>{var lt;return(lt=wt.COL_CAPTION)==null?void 0:lt.includes(Jt)})?wt.FORMAT_STRING="#,##0.00":wt.FORMAT_STRING="#,##0",["数量","件数","重量","毛重","净重"].some(Jt=>{var lt;return(lt=wt.COL_CAPTION)==null?void 0:lt.includes(Jt)})&&(wt.FORMAT_STRING="#,##0.###")):wt.DATA_TYPE==="3"?(wt.FORMAT_TYPE="DateTime",(cr=wt.COL_CAPTION)!=null&&cr.includes("日期")?wt.FORMAT_STRING="yyyy-MM-dd":((pr=wt.COL_CAPTION)!=null&&pr.includes("时间")||(or=wt.COL_CAPTION)!=null&&or.includes("时刻"))&&(wt.FORMAT_STRING="yyyy-MM-dd HH:mm:ss")):wt.DATA_TYPE==="5"&&(wt.FORMAT_TYPE="Time",wt.FORMAT_STRING="HH:mm:ss")),wt},ar=r.columnApi.columnModel.gridColumns;let Zt=ar.length;const Kt=[],Re=await e.Core.createDataTable("Master","DataSet_SI000","TSI00GRIDCOLUMN");(Pr=Dt.checkedItemArray)==null||Pr.forEach(wt=>{if(!ar.some(ea=>ea.colId===wt.COL_NAME)){const ea=Re.add(rr({COMPANY_CODE:this.DefaultConfigCompanyCode,COMPANY_CNAME:this.DefaultConfigCompanyName,ROW_GUID:e.Core.guid(),FORM_NAME:this.FormName,FUNCTION_ID:c,ITEM_CODE:wt.COL_NAME,COL_CAPTION:wt.COL_CAPTION,FIELD_NAME:wt.COL_NAME,MAX_LENGTH:wt.MAX_LENGTH,DATA_ACCU:wt.PRECISION||-1,DATA_TYPE:wt.DATA_TYPE,ALLOW_EDIT:vt?"0":"1",IS_VISIBLE:vt?"0":"1",C_SEQ_ID:String(Zt++).padStart(3,"0")}));Kt.push({field:ea.FIELD_NAME,headerName:ea.COL_CAPTION,editable:!vt,context:{columnConfig:ea.toJSON()}})}});const zr=Re.getRowsAsBlock("all");zr.rename("TSI00GRIDCOLUMN_ADD");const Zr=new s;Zr.addBlock(zr);let ca=await this.callService(e.SysInfo.saveDevConfigService,Zr);ca.getStatus()<0&&this.messageError(this.$t("ERX.ErGrid.AddColumnFailed")||"添加列失败"),this.addGridColumn(c,Kt),this.messageInfo(this.$t("ERX.ErGrid.AddColumnSuccess")||"添加列成功"),vt&&(ca=await this.uploadGridColumnCustomConfig(c,r.columnApi.columnModel.gridOptionsService.gridOptions,!1),((da=ca.sys)==null?void 0:da.status)>=0?(r.columnApi.columnModel.gridColumns.forEach(wt=>{wt.colDef.width=wt.actualWidth}),console.info("ER: The grid custom configuration synchronization was successful!")):this.messageError(this.$t("ERX.ErGrid.SaveUserConfigFailed")||"保存用户配置失败"))}),Yt.show(null)};if(r.api.getDisplayedRowCount()>0&&((B=(A=r.columnApi)==null?void 0:A.getRowGroupColumns())==null?void 0:B.length)>0&&d.push("expandAll","contractAll","separator"),r.context.isDetailGrid!==!0&&((n==null?void 0:n.allowAdvanceFilter)!==!1&&((Q=n==null?void 0:n.advanceFilter)==null?void 0:Q.allow)!==!1&&(((N=n==null?void 0:n.advanceFilterService)==null?void 0:N.length)>0||((J=(W=n==null?void 0:n.advanceFilter)==null?void 0:W.service)==null?void 0:J.length)>0),this.getGridOptions(c,"ShowQuickFilter",!0)!=="2"&&(this.getGridOptions(c,"ShowQuickFilter",!0)==="1"?d.push({name:this.$t("ERX.ErGrid.HideQuickFilter")||"隐藏快速搜索栏",action:()=>{this.setGridOptions(c,"ShowQuickFilter","0",!0)},icon:e.Core.createErSvgElement("un-search")}):d.push({name:this.$t("ERX.ErGrid.ShowQuickFilter")||"显示快速搜索栏",action:()=>{this.setGridOptions(c,"ShowQuickFilter","1",!0)},icon:e.Core.createErSvgElement("search")})),i!=null&&i.floatingFilter?d.push({name:this.$t("ERX.ErGrid.HideFilterRow")||"隐藏过滤行",action:()=>{this.setGridColumnOptions(c,vt=>{vt.floatingFilter=!1}),i.floatingFilter=!1},icon:e.Core.createErSvgElement("un-filter")}):d.push({name:this.$t("ERX.ErGrid.ShowFilterRow")||"显示过滤行",action:()=>{this.setGridColumnOptions(c,vt=>{vt.children||(vt.floatingFilter=!0)}),i.floatingFilter=!0},icon:e.Core.createErSvgElement("filter")}),this.getGridOptions(c,"ShowGroupPanel",!0)?d.push({name:this.$t("ERX.ErGrid.HideGroupPanel")||"隐藏分组依据栏",action:()=>{this.setGridOptions(c,"ShowGroupPanel",!1,!0)},icon:e.Core.createErSvgElement("group")}):d.push({name:this.$t("ERX.ErGrid.ShowGroupPanel")||"显示分组依据栏",action:()=>{this.setGridOptions(c,"ShowGroupPanel",!0,!0)},icon:e.Core.createErSvgElement("group")})),(re=r.api)!=null&&re.isColumnFilterPresent()&&(d.push("separator"),d.push({name:this.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var vt;(vt=r.api)==null||vt.setFilterModel(null)}})),(Se=r.column.colDef.context)!=null&&Se.columnConfig&&(this.DevelopPermisson==="1"||(n==null?void 0:n.disableErMenu)!==!0)&&(d.push("separator"),n!=null&&n.allowCustomColumns&&t.toString((me=(ue=r.context)==null?void 0:ue.options)==null?void 0:me.viewType,!0,"toLower")!=="bandview"&&d.push({name:this.$t("ERX.ErGrid.AddCustomColumn")||"添加自定义列",action:async()=>{p(!0)},icon:e.Core.createErSvgElement("add-column")}),n!=null&&n.allowCustomTitle||d.push({name:this.$t("ERX.ErGrid.CustomColumnTitle")||"自定义列标题",action:async()=>{var xt,Dt,rr;const vt=(this.$t("ERX.ErGrid.CustomColumnTitle")||"自定义列标题")+"->"+((rr=(Dt=(xt=r.column.colDef.context)==null?void 0:xt.columnConfig)==null?void 0:Dt.COL_CAPTION)==null?void 0:rr.trim()),Yt=new e.PopRichEditor({extension:"text",width:300,height:120,title:vt});Yt.CancelButtonCaption=e.Core.$t("ERX.Close")||"关闭",Yt.setEvent("ok",async()=>{var Kt,Re,zr,Zr;const Zt={title:((Kt=Yt.Content)==null?void 0:Kt.trim())||((Zr=(zr=(Re=r.column.colDef.context)==null?void 0:Re.columnConfig)==null?void 0:zr.COL_CAPTION)==null?void 0:Zr.trim())};this.setGridColumnOptions(c,ca=>{ca.colId===r.column.colDef.colId&&(ca.headerName=Zt.title,ca.headerTooltip=Zt.title.trim().replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""),ca.headerComponentParams={template:`${this.getGridHeaderTemplate(Zt)}`})})}),Yt.show(null,r.column.colDef.headerName)},icon:e.Core.createErSvgElement("edit-title")}),d.push({name:this.$t("ERX.ErGrid.SaveUserConfig")||"保存用户配置",action:async()=>{const vt=await this.uploadGridColumnCustomConfig(c,r.columnApi.columnModel.gridOptionsService.gridOptions);vt.getStatus()>=0?(r.columnApi.columnModel.gridColumns.forEach(Yt=>{r.column.colDef.width=r.column.actualWidth}),console.info("ER: The grid custom configuration synchronization was successful!")):this.messageError((this.$t("ERX.ErGrid.SaveUserConfigFailed")||"保存用户配置失败")+"->"+vt.getMsg())},icon:e.Core.createErSvgElement("add-user")}),d.push({name:this.$t("ERX.ErGrid.ResetUserConfig")||"重置用户配置",action:()=>{this.deleteGridColumnCustomConfig(c,o.UserId).then(()=>{r.columnApi.columnModel.gridColumns.forEach(vt=>{vt.colDef.width=vt.actualWidth}),console.info("ER: The grid custom configuration reset operation was successful!")})},icon:e.Core.createErSvgElement("delete-user")}),this.DevelopPermisson==="1"&&d.push({name:this.$t("ERX.ErGrid.ResetAllUserConfig")||"重置所有人配置",action:()=>{this.deleteGridColumnCustomConfig(c).then(()=>{r.columnApi.columnModel.gridColumns.forEach(vt=>{vt.colDef.width=vt.actualWidth}),console.info("ER: The grid all custom configuration reset operation was successful!")})},icon:e.Core.createErSvgElement("disabled-users")})),this.DevelopPermisson==="1"&&((Z=r.column.colDef.context)!=null&&Z.columnConfig)){d.push("separator"),d.push({name:"Add Columns",action:async()=>{p(!0)},icon:e.Core.createErSvgElement("add-column")}),d.push({name:"Remove Column",action:async()=>{var xt,Dt,rr;if((rr=(Dt=(xt=r.column)==null?void 0:xt.colDef)==null?void 0:Dt.context)!=null&&rr.columnConfig&&await e.Core.messageConfirm()){const ar=t.buildEiInfo(r.column.colDef.context.columnConfig,"TSI00GRIDCOLUMN_DELETE");(await this.callService(e.SysInfo.saveDevConfigService,ar)).getStatus()<0?this.messageError(this.$t("ERX.ErGrid.RemoveColumnFailed")||"移除列失败"):(this.removeGridColumn(c,r.column.colDef.colId),this.messageInfo(this.$t("ERX.ErGrid.RemoveColumnSuccess")||"移除列成功"))}},icon:e.Core.createErSvgElement("delete-column")}),d.push({name:"Save Column Width",action:()=>{this.uploadGridColumnWidth(c,[r.column]).then(()=>{r.column.colDef.width=r.column.actualWidth,console.info("ER: The grid column width synchronization was successful!")})},icon:e.Core.createErSvgElement("column-width")}),d.push({name:"Save All Column Width",action:()=>{this.uploadGridColumnWidth(c,r.columnApi.columnModel.gridColumns).then(()=>{r.columnApi.columnModel.gridColumns.forEach(xt=>{xt.colDef.width=xt.actualWidth}),console.info("ER: The grid all column width synchronization was successful!")})},icon:e.Core.createErSvgElement("all-column-width")}),d.push({name:"Save Column Order",action:()=>{this.uploadGridColumnSeq(c,r.columnApi.columnModel.gridOptionsService.gridOptions).then(()=>{console.info("ER: The grid column order synchronization was successful!")})},icon:e.Core.createErSvgElement("column-drag")}),d.push({name:"Horizontal Alignment",subMenu:[{name:"Default",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Default").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.dataType==="number"?(r.column.colDef.context.cellStyles.textAlign="right",r.column.colDef.context.cellStyles.justifyContent="right"):r.column.colDef.context.dataType==="datetime"?(r.column.colDef.context.cellStyles.textAlign="center",r.column.colDef.context.cellStyles.justifyContent="center"):r.column.colDef.context.dataType==="boolean"?(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="center"):(r.column.colDef.context.cellStyles.textAlign="left",r.column.colDef.context.cellStyles.justifyContent="left"),r.api.redrawRows())})}},{name:"Left",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Near").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.cellStyles.textAlign="left",r.column.colDef.context.cellStyles.justifyContent="left",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="left"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-left")},{name:"Center",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Center").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.cellStyles.textAlign="center",r.column.colDef.context.cellStyles.justifyContent="center",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="center"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-center")},{name:"Right",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Far").then(()=>{var xt,Dt;(Dt=(xt=r.column.colDef.context)==null?void 0:xt.cellStyles)!=null&&Dt.textAlign&&(r.column.colDef.context.cellStyles.textAlign="right",r.column.colDef.context.cellStyles.justifyContent="right",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="right"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-right")}],icon:e.Core.createErSvgElement("halign")});const vt=[{name:"FormName->"+this.FormName,action:()=>{e.Core.copyText(this.FormName)},icon:e.Core.createErSvgElement("page-config")},{name:"ViewName->"+c,action:()=>{e.Core.copyText(c)},icon:e.Core.createErSvgElement("layout")},{name:"DataSet->"+((Te=this.FormDataSet)==null?void 0:Te.Name),action:()=>{var xt;e.Core.copyText((xt=this.FormDataSet)==null?void 0:xt.Name)},icon:e.Core.createErSvgElement("dataset")},{name:"Table->"+((ce=i.context)==null?void 0:ce.bindTableName),action:()=>{var xt;e.Core.copyText((xt=i.context)==null?void 0:xt.bindTableName)},icon:e.Core.createErSvgElement("table")}];((ge=(Me=(ze=i.context)==null?void 0:ze.viewConfig)==null?void 0:Me.SVC_NAME)==null?void 0:ge.trim().length)>0&&vt.push({name:"DataSource->"+((Fe=(Y=(le=i.context)==null?void 0:le.viewConfig)==null?void 0:Y.SVC_NAME)==null?void 0:Fe.trim()),action:()=>{var xt,Dt,rr;e.Core.copyText((rr=(Dt=(xt=i.context)==null?void 0:xt.viewConfig)==null?void 0:Dt.SVC_NAME)==null?void 0:rr.trim())},icon:e.Core.createErSvgElement("datasource-sql")}),vt.push({name:"Extend Options",action:()=>{this.showExtOptionsEdit("tsi00gridviewext",this._formName,c,"","","",!1)},icon:e.Core.createErSvgElement("json-options")}),vt.push({name:"More...",action:()=>{this.showViewOptionsEdit(this.FormName,c)},icon:e.Core.createErSvgElement("more")}),vt.push("separator"),vt.push({name:"ShowCheckBox",subMenu:[{name:"True",disabled:((Ve=(ke=i.context)==null?void 0:ke.viewConfig)==null?void 0:Ve.SHOW_SELECTION)==="1",action:()=>{this.uploadGridViewProps(c,"SHOW_SELECTION","1").then(()=>{i.context.viewConfig.SHOW_SELECTION="1",this.setGridOptions(c,"multiSelectMode","1")})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:((pt=(at=i.context)==null?void 0:at.viewConfig)==null?void 0:pt.SHOW_SELECTION)!=="1",action:()=>{this.uploadGridViewProps(c,"SHOW_SELECTION","0").then(()=>{i.context.viewConfig.SHOW_SELECTION="0"})},icon:e.Core.createErSvgElement("disabled")}],icon:e.Core.createErSvgElement("checkbox-1")}),vt.push({name:"MultiSelectMode",subMenu:[{name:"SingleRow",disabled:((Ct=(ht=i.context)==null?void 0:ht.viewConfig)==null?void 0:Ct.MULTI_SELECT_MODE)==="1",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","1").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="1",this.setGridOptions(c,"RowSelection","single",!0),this.getGrid(c).gridOptions.enableRangeSelection=!1})}},{name:"MultiRow",disabled:((Qe=(_t=i.context)==null?void 0:_t.viewConfig)==null?void 0:Qe.MULTI_SELECT_MODE)==="2",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","2").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="2",this.setGridOptions(c,"RowSelection","multiple",!0),this.getGrid(c).gridOptions.enableRangeSelection=!1})}},{name:"MultiCell",disabled:((gt=(U=i.context)==null?void 0:U.viewConfig)==null?void 0:gt.MULTI_SELECT_MODE)==="3",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","3").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="3",this.setGridOptions(c,"RowSelection","multiple",!0),this.getGrid(c).gridOptions.enableRangeSelection=!0})}}]}),vt.push({name:"AutoSelectMode",subMenu:[{name:"None",disabled:((ct=(rt=i.context)==null?void 0:rt.viewConfig)==null?void 0:ct.AUTO_SELECT_MODE)==="0",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","0").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="0",this.setGridOptions(c,"autoSelectMode","0",!0)})}},{name:"NewRow",disabled:((Ye=(Ze=i.context)==null?void 0:Ze.viewConfig)==null?void 0:Ye.AUTO_SELECT_MODE)==="1",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","1").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="1",this.setGridOptions(c,"autoSelectMode","1",!0)})}},{name:"EditRow",disabled:((mt=(st=i.context)==null?void 0:st.viewConfig)==null?void 0:mt.AUTO_SELECT_MODE)==="2",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","2").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="2",this.setGridOptions(c,"autoSelectMode","2",!0)})}},{name:"NewRow|EditRow",disabled:((Rt=(At=i.context)==null?void 0:At.viewConfig)==null?void 0:Rt.AUTO_SELECT_MODE)==="3",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","3").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="3",this.setGridOptions(c,"autoSelectMode","3",!0)})}},{name:"ClickRow",disabled:((St=(Qt=i.context)==null?void 0:Qt.viewConfig)==null?void 0:St.AUTO_SELECT_MODE)==="4",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","4").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="4",this.setGridOptions(c,"autoSelectMode","4",!0)})}}]}),vt.push({name:"AllowEdit",subMenu:[{name:"True",disabled:i.context.editable,action:()=>{this.uploadGridViewProps(c,"ALLOW_EDIT","1").then(()=>{i.context.viewConfig.ALLOW_EDIT="1",i.context.editable=!0})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!i.context.editable,action:()=>{this.uploadGridViewProps(c,"ALLOW_EDIT","0").then(()=>{i.context.viewConfig.ALLOW_EDIT="0",i.api.stopEditing(),i.context.editable=!1})},icon:e.Core.createErSvgElement("disabled")}]}),vt.push({name:"AllowDragRow",subMenu:[{name:"True",disabled:i.context.allowDragRow,action:()=>{this.uploadGridViewProps(c,"ALLOW_DRAG","1").then(()=>{i.context.viewConfig.ALLOW_DRAG="1",i.context.allowDragRow=!0})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!i.context.allowDragRow,action:()=>{this.uploadGridViewProps(c,"ALLOW_DRAG","0").then(()=>{i.context.viewConfig.ALLOW_DRAG="0",i.context.allowDragRow=!0})},icon:e.Core.createErSvgElement("disabled")}]}),vt.push({name:"AllowImport",subMenu:[{name:"True",disabled:this.getGridToolbarVisible(c,"import"),action:()=>{this.uploadGridViewProps(c,"ALLOW_IMPORT","1").then(()=>{this.setGridToolbarVisible(c,{import:!0})})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!this.getGridToolbarVisible(c,"import"),action:()=>{this.uploadGridViewProps(c,"ALLOW_IMPORT","0").then(()=>{this.setGridToolbarVisible(c,{import:!0})})},icon:e.Core.createErSvgElement("disabled")}]}),d.push({name:"Form Properties",action:()=>{this.showFormOptionsEdit(this.FormName)},icon:e.Core.createErSvgElement("form-config")}),d.push({name:"View Properties",subMenu:vt});const Yt=[{name:"FieldName->"+r.column.colDef.field,action:()=>{e.Core.copyText(r.column.colDef.field)}},{name:"ColumnType->"+r.column.colDef.context.dataType,action:()=>{e.Core.copyText(r.column.colDef.context.dataType)}},{name:"ColumnEdit->"+(typeof r.column.colDef.cellEditor=="string"?r.column.colDef.cellEditor:(nr=r.column.colDef.cellEditor)==null?void 0:nr.name),action:()=>{var xt;e.Core.copyText(typeof r.column.colDef.cellEditor=="string"?r.column.colDef.cellEditor:(xt=r.column.colDef.cellEditor)==null?void 0:xt.name)}},{name:"ColumnWidth->"+r.column.actualWidth,action:()=>{e.Core.copyText(r.column.actualWidth)}}];if(((tr=(Tt=r.column.colDef.context)==null?void 0:Tt.columnConfig)==null?void 0:tr.ORIGIN_CODE)!=="0"&&((q=(ae=(L=r.column.colDef.context)==null?void 0:L.columnConfig)==null?void 0:ae.SVC_NAME)==null?void 0:q.trim().length)>0){const xt=((ne=(ee=r.column.colDef.context)==null?void 0:ee.columnConfig)==null?void 0:ne.ORIGIN_CODE)==="2"?"DataSource":((be=(se=r.column.colDef.context)==null?void 0:se.columnConfig)==null?void 0:be.ORIGIN_CODE)==="4"?"CodeSets":((De=(Ue=r.column.colDef.context)==null?void 0:Ue.columnConfig)==null?void 0:De.ORIGIN_CODE)==="5"?"SI->Code":((Pe=(Ae=r.column.colDef.context)==null?void 0:Ae.columnConfig)==null?void 0:Pe.ORIGIN_CODE)==="6"?"EP->Code":((k=(tt=r.column.colDef.context)==null?void 0:tt.columnConfig)==null?void 0:k.ORIGIN_CODE)==="7"?"PM->Code":"BasicCode";Yt.push({name:"DropDownSource->"+xt+"."+((we=(Ce=(ie=r.column.colDef.context)==null?void 0:ie.columnConfig)==null?void 0:Ce.SVC_NAME)==null?void 0:we.trim()),action:()=>{var rr,ar,Zt;e.Core.copyText((Zt=(ar=(rr=r.column.colDef.context)==null?void 0:rr.columnConfig)==null?void 0:ar.SVC_NAME)==null?void 0:Zt.trim())}});const Dt=((ft=(Xe=this._dropDownBindSource[c])==null?void 0:Xe[r.column.colDef.colId])==null?void 0:ft.displayFormat)??"{0}|{1}";Yt.push({name:"DisplayFormat",subMenu:[{name:"Value|Text",disabled:Dt==="{0}|{1}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{0}|{1}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{0}|{1}"})}},{name:"Text",disabled:Dt==="{1}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{1}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{1}"})}},{name:"Value",disabled:Dt==="{0}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{0}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{0}"})}}]})}Yt.push("separator"),Yt.push({name:"AllowEdit",subMenu:[{name:"True",disabled:((de=(V=r.column.colDef.context)==null?void 0:V.columnConfig)==null?void 0:de.ALLOW_EDIT)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_EDIT","1").then(()=>{r.column.colDef.context.columnConfig.ALLOW_EDIT="1",this.setGridColumnEditable(c,!0,r.column.colDef.colId)})}},{name:"False",disabled:((Oe=(w=r.column.colDef.context)==null?void 0:w.columnConfig)==null?void 0:Oe.ALLOW_EDIT)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_EDIT","0").then(()=>{r.column.colDef.context.columnConfig.ALLOW_EDIT="0",this.setGridColumnEditable(c,!1,r.column.colDef.colId)})}}]}),((Be=(We=r.column.colDef.context)==null?void 0:We.columnConfig)==null?void 0:Be.ALLOW_EDIT)==="1"&&((je=(ye=r.column.colDef.context)==null?void 0:ye.columnConfig)==null?void 0:je.READ_ONLY)==="0"&&Yt.push({name:"MultiRowEdit",subMenu:[{name:"True",disabled:((He=(ot=r.column.colDef.context)==null?void 0:ot.columnConfig)==null?void 0:He.MULTI_ROW_EDIT)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"MULTI_ROW_EDIT","1").then(()=>{r.column.colDef.context.columnConfig.MULTI_ROW_EDIT="1"})}},{name:"False",disabled:((dt=(nt=r.column.colDef.context)==null?void 0:nt.columnConfig)==null?void 0:dt.MULTI_ROW_EDIT)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"MULTI_ROW_EDIT","0").then(()=>{r.column.colDef.context.columnConfig.MULTI_ROW_EDIT="0"})}}]}),Yt.push({name:"ReadOnly",subMenu:[{name:"True",disabled:((yt=(Et=r.column.colDef.context)==null?void 0:Et.columnConfig)==null?void 0:yt.READ_ONLY)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"READ_ONLY","1").then(()=>{r.column.colDef.context.columnConfig.READ_ONLY="1"})}},{name:"False",disabled:((kt=(bt=r.column.colDef.context)==null?void 0:bt.columnConfig)==null?void 0:kt.READ_ONLY)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"READ_ONLY","0").then(()=>{r.column.colDef.context.columnConfig.READ_ONLY="0"})}}]}),Yt.push({name:"RequireInput",subMenu:[{name:"True",disabled:((g=(Lt=r.column.colDef.context)==null?void 0:Lt.columnConfig)==null?void 0:g.ITEM_MUST_FLAG)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ITEM_MUST_FLAG","1").then(()=>{r.column.colDef.context.columnConfig.ITEM_MUST_FLAG="1",r.api.refreshHeader()})}},{name:"False",disabled:((Wt=(qt=r.column.colDef.context)==null?void 0:qt.columnConfig)==null?void 0:Wt.ITEM_MUST_FLAG)!=="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ITEM_MUST_FLAG","0").then(()=>{r.column.colDef.context.columnConfig.ITEM_MUST_FLAG="0",r.api.refreshHeader()})}}]}),Yt.push({name:"AllowShowHide",subMenu:[{name:"True",disabled:((Ga=(Ca=r.column.colDef.context)==null?void 0:Ca.columnConfig)==null?void 0:Ga.ALLOW_SHOWHIDE)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_SHOWHIDE","1").then(()=>{r.column.colDef.context.columnConfig.ALLOW_SHOWHIDE="1",this.setGridColumnOptions(c,xt=>{xt.colId===r.column.colDef.colId&&(xt.lockVisible=!1)})})}},{name:"False",disabled:(($a=(za=r.column.colDef.context)==null?void 0:za.columnConfig)==null?void 0:$a.ALLOW_SHOWHIDE)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_SHOWHIDE","0").then(()=>{r.column.colDef.context.columnConfig.ALLOW_SHOWHIDE="0",this.setGridColumnOptions(c,xt=>{xt.colId===r.column.colDef.colId&&(xt.lockVisible=!0)})})}}]}),Yt.push({name:"Extend Options",action:()=>{var xt,Dt,rr;this.showExtOptionsEdit("tsi00gridcolumnext",this._formName,c,((xt=r.column.colDef.context)==null?void 0:xt.columnConfig.ROW_GUID)+","+((Dt=r.column.colDef.context)==null?void 0:Dt.columnConfig.ITEM_CODE),"",(rr=r.column.colDef.context)==null?void 0:rr.columnConfig.COMPANY_CODE,!1)},icon:e.Core.createErSvgElement("json-options")}),d.push({name:"Column Properties",subMenu:Yt})}return d}setGridMainMenuItems(r,i){var n,c,d,p;return(c=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&c.configId&&((p=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null||p.configId,r.gridOptions.getMainMenuItems=m=>this.getGridMenuItems(m)),this}setGridRowStyle(r,i){var n,c;return(c=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&c.configId&&(r.gridOptions.getRowStyle=d=>this.getRowStyle(d,i)),this}getRowStyle(r,i){var d,p,m;const n={fontWeight:"normal"},c=(d=r==null?void 0:r.context)==null?void 0:d.configId;if((p=r.node)!=null&&p.rowPinned)return{fontWeight:"bold"};if(r.node.footer&&r.node.level<0&&(i==null?void 0:i.showDefaultFooter)!==!0)return{display:"none"};if(this._gridOptions[c].styleConfigInfo.rowStyle.length>0&&r.data)for(let _=0;_<this._gridOptions[c].styleConfigInfo.rowStyle.length;_++){const E=this._gridOptions[c].styleConfigInfo.rowStyle[_];if((((m=E.condition)==null?void 0:m.trim().length)===0||E.condition.trim().replaceAll(" ","")==="1=1"||t.checkExpressionValid(r.data,e.Core.getSystemFormatString(E.condition)))&&(E.type==="Foreground"||E.type==="W_Fore"?n.color=t.toHexColor(E.fillColor):(E.type==="Background"||E.type==="W_Back")&&(n.background=t.toHexColor(E.fillColor)),E.fontStyle&&E.fontStyle.trim().length>0))switch(E.fontStyle){case"Bold":n.fontWeight="bold";break;case"Italic":n.fontStyle="italic";break;case"Strikeout":n.textDecoration="line-through";break;case"Underline":n.textDecoration="underline";break}}return n}setGridColumnEditable(r,i,...n){var d,p;const c=this.getGrid(r);if((d=c==null?void 0:c.gridOptions)!=null&&d.api){const m=(p=c.gridOptions.api.columnModel)==null?void 0:p.gridColumns;n.length===1&&(n=n[0].split(",")),(m==null?void 0:m.length)>0&&(c.gridOptions.api.stopEditing(),m.forEach(_=>{_.colId!==o.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(_.colId))&&(_.context=_.context||{},_.context.editable=i)}))}return this}getGridCellRenderText(r,i,n,c){var m,_,E,v;let d="";const p=this.getGridColumnDef(r,i);return p!=null&&p.context&&(p.context.cellEditType==="dateEditor"?d=t.getDateTimeFormatString(n,c||((m=p.context.columnConfig)==null?void 0:m.FORMAT_STRING)):p.context.cellEditType==="numberEditor"?d=t.formatNumberValue(n,c||((_=p.context.columnConfig)==null?void 0:_.FORMAT_STRING)):p.refData&&((E=p.context)==null?void 0:E.cellEditType)==="checkGridLookUpEdit"&&p.context.valueField!==p.context.textField?e.Core.toString(n).trim().split(",").forEach(B=>{const Q=p.refData[B]||B;d=d.length===0?Q:d+","+Q}):((v=p.context)==null?void 0:v.cellEditType)==="gridLookUpEdit"?d=p.refData[n]||n:d=t.toString(n)),d}getDropDownSelectedData(r,i,n){let c=[];if(this._dropDownBindSource[r]&&this._dropDownBindSource[r][i]){const d=this._dropDownBindSource[r][i];if(d.dataSource&&d.dataSource.length>0){const p=d.dataValueField,m=d.dataSource;if(n||(n=this.getControlValue(r,i)),n===!0&&(n="1"),(m==null?void 0:m.length)>0&&n&&t.toString(n).trim().length>0){const _=t.toString(n).trim().split(",");for(let E=0;E<m.length;E++)if(m[E])if(_.length>1){if(_.includes(t.toString(m[E][p]))&&c.push(m[E]),c.length===_.length||E===m.length-1)break}else t.toString(m[E][p])===t.toString(n)&&(c=m[E])}}}return c}getDropDownSelectedText(r,i,n){var d,p,m;let c="";if(this._dropDownBindSource[r]&&this._dropDownBindSource[r][i]){const _=this._dropDownBindSource[r][i];if(((d=_==null?void 0:_.dataSource)==null?void 0:d.length)>0&&((p=_==null?void 0:_.dataValueField)==null?void 0:p.trim().length)>0&&((m=_==null?void 0:_.dataTextField)==null?void 0:m.trim().length)>0){const E=_.dataValueField.trim(),v=_.dataTextField.trim(),A=_.dataSource;n==null&&(n=this.getControlValue(r,i)),n===!0&&(n="1");let B=[];if(n&&typeof n=="string"?B=n.split(","):n instanceof Array&&(B=n),(A==null?void 0:A.length)>0&&B.length>0){c=[];for(let Q=0;Q<A.length;Q++)if(A[Q])if(B.length>1){if(B.includes(t.toString(A[Q][E]))&&c.push(A[Q][v]),c.length===B.length||Q===A.length-1){c=c.join(",");break}}else t.toString(A[Q][E])===t.toString(n)&&(c=A[Q][v])}}}return c}async uploadGridColumnSeq(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p=[];if((r==null?void 0:r.trim().length)>0&&i){r=r.trim();let m=0;i.columnApi.columnModel.gridColumns.forEach(_=>{var E,v;if(_.colId&&_.colId!==e.SysInfo.GridCheckColumnFieldName&&_.colDef.cellRenderer!=="agGroupCellRenderer"){const A=(v=(E=_.colDef)==null?void 0:E.context)==null?void 0:v.columnConfig;A&&A.ROW_GUID&&(A.IS_VISIBLE=_.visible===!1?"0":"1",A.COL_WIDTH_WEB=_.width,A.GROUP_SORT_TYPE="0",A.C_SEQ_ID=`${++m}`.padStart(3,"0"),A.COL_FIX_TYPE=_.pinned==="left"?"L":_.pinned==="right"?"R":"N",_.rowGroupActive&&(A.GROUP_SORT_TYPE="1"),p.push(A))}})}if(p.length>0){const m=this.buildEiBlock(p,"TSI00GRIDCOLUMN_VISIBLEINDEX"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm("是否确定同步列顺序?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})}else d.SysInfo.Flag=-603,d.SysInfo.Msg="No EiInfo data available",n(d)})}async uploadGridColumnProps(r,i,n,c){return new Promise((d,p)=>{const m=this.getSingleItemConfigInfo(r,i,this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]);let _=new ut.EiInfo;const E=t.buildEiBlock([{COMPANY_CODE:m.COMPANY_CODE,FORM_NAME:m.FORM_NAME,FUNCTION_ID:m.FUNCTION_ID,ITEM_CODE:m.ITEM_CODE,PROPERTY_NAME:n,PROPERTY_VALUE:c}],"TSI00GRIDCOLUMN_PROPERTY");t.messageConfirm("是否确定更改配置?").then(v=>{if(v){const A=new ut.EiInfo;A.addBlock(E),t.callService(e.SysInfo.saveDevConfigService,A).then(B=>{_=B,d(_)})}else _.SysInfo.Flag=999,_.SysInfo.Msg="Cancel operation",d(_)})})}async uploadGridColumnPropsEx(r){return new Promise((i,n)=>{let c=new ut.EiInfo;const d=t.buildEiBlock(r,"TSI00GRIDCOLUMN_PROPERTY");t.messageConfirm("是否确定更改配置?").then(p=>{if(p){const m=new ut.EiInfo;m.addBlock(d),t.callService(e.SysInfo.saveDevConfigService,m).then(_=>{c=_,i(c)})}else c.SysInfo.Flag=999,c.SysInfo.Msg="Cancel operation",i(c)})})}async uploadGridViewProps(r,i,n){return new Promise((c,d)=>{const p=this.getSingleViewConfigInfo(r);let m=new ut.EiInfo;const _=t.buildEiBlock([{COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:p.FORM_NAME,FUNCTION_ID:p.FUNCTION_ID,PROPERTY_NAME:i,PROPERTY_VALUE:n}],"TSI00GRIDVIEW_PROPERTY");t.messageConfirm("是否确定更改配置?").then(E=>{if(E){const v=new ut.EiInfo;v.addBlock(_),t.callService(e.SysInfo.saveDevConfigService,v).then(A=>{m=A,c(m)})}else m.SysInfo.Flag=999,m.SysInfo.Msg="Cancel operation",c(m)})})}async uploadGridViewPropsEx(r){return new Promise((i,n)=>{let c=new ut.EiInfo;const d=t.buildEiBlock(r,"TSI00GRIDVIEW_PROPERTY");t.messageConfirm("是否确定更改配置?").then(p=>{if(p){const m=new ut.EiInfo;m.addBlock(d),t.callService(e.SysInfo.saveDevConfigService,m).then(_=>{c=_,i(c)})}else c.SysInfo.Flag=999,c.SysInfo.Msg="Cancel operation",i(c)})})}async uploadGridColumnWidth(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p=[];if(i.forEach(m=>{var _,E;if(m.colDef.colId!==e.SysInfo.GridCheckColumnFieldName){const v=(E=(_=m.colDef)==null?void 0:_.context)==null?void 0:E.columnConfig;v&&v.ROW_GUID&&(v.COL_WIDTH_WEB=m.actualWidth,p.push(v))}}),p.length>0){const m=this.buildEiBlock(p,"TSI00GRIDCOLUMN_WIDTH_WEB"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm("是否确定同步列宽?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})}else d.SysInfo.Flag=-603,d.SysInfo.Msg="No EiInfo data available",n(d)})}async uploadGridColumnCustomConfig(r,i,n=!0){return new Promise(async(c,d)=>{if((r==null?void 0:r.trim().length)>0&&i){r=r.trim();let p=new ut.EiInfo;const m=[];let _=0;if(i.columnApi.columnModel.gridColumns.forEach(E=>{var v,A;if(E.colId&&E.colId!==e.SysInfo.GridCheckColumnFieldName&&((A=(v=E.colDef)==null?void 0:v.context)!=null&&A.columnConfig)&&E.colDef.cellRenderer!=="agGroupCellRenderer"){const B={...E.colDef.context.columnConfig};B&&B.ROW_GUID&&(delete B.extendOptions,B.IS_VISIBLE=E.visible===!1?"0":"1",B.TYPE_CODE=e.SysInfo.Culture,B.COL_WIDTH=E.actualWidth,B.GROUP_SORT_TYPE="0",B.C_SEQ_ID=`${++_}`.padStart(3,"0"),B.COL_FIX_TYPE=E.pinned==="left"?"L":E.pinned==="right"?"R":"N",B.COL_CAPTION=E.colDef.headerName,E.rowGroupActive&&(B.GROUP_SORT_TYPE="1"),m.push(B))}}),m.length>0){const E=this.buildEiBlock(m,"TSI00GRIDCOLUMN_CUS_UPLOAD"),v=new ut.EiInfo;v.addBlock(E);const A={COMPANY_CODE:this.DefaultConfigCompanyCode,COMPANY_CNAME:this.DefaultConfigCompanyName,FORM_NAME:this._formName,FUNCTION_ID:r,DEVICE_ID:e.SysInfo.Culture},B=i.columnApi.getColumnState().filter(J=>J.sort!==null).sort((J,re)=>(J.sortIndex??0)-(re.sortIndex??0));let Q="";B.length>0&&(B.forEach(J=>{const re=J.sort==="desc"?J.colId+" desc":J.colId;Q+=re+","}),Q=Q.substring(0,Q.length-1)),A.EXT_OPTIONS=JSON.stringify({SORT_FIELD_NAME:Q});const N=t.buildEiBlock([A],"TSI00GRIDVIEWCUS_ADD");v.addBlock(N);let W=!0;n&&(W=await t.messageConfirm(this.$t("ERX.ErGrid.SaveUserConfig")||"是否确定同步个人配置?")),W?t.callService(e.SysInfo.saveDevConfigService,v).then(J=>{p=J,c(p)}):n&&(p.setStatus(999),p.setMsg("Cancel operation"),c(p))}else p.setStatus(-603),p.setMsg("No EiInfo data available"),c(p)}})}async deleteGridColumnCustomConfig(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p={};p.COMPANY_CODE=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r],p.FORM_NAME=this._formName,p.FUNCTION_ID=r,p.TYPE_CODE="zh_Hans",i&&i.trim().length>0&&(p.REC_CREATOR=e.SysInfo.UserId);const m=this.buildEiBlock([p],"TSI00GRIDCOLUMN_CUS_DELETE"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm(i?"是否确定重置个人配置?":"是否确定重置所有个人配置?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})})}checkRequiredInput(r,i=!1){return new Promise(async(n,c)=>{let d=!0,p=[];r&&(r instanceof Array?p=r:p=r.split(",")),p.length===0&&(p=this.getAllConfigIdArray());for(let m=0;m<p.length;m++){if(p[m].trim().length===0)continue;if(this.getSingleViewConfigInfo(p[m]).FUNCTION_TYPE==="F"){const E=this.getLayoutBindForm(p[m]);E&&await E.validate().then(()=>{d=d&&!0}).catch(()=>{d=!1})}else d=d&&this.checkGridInput(p[m],"ChangedRows",!1,!1)}!d&&i===!0&&this.messageWarning(this.$t("ERX.InputInvalidMessage")||"输入验证未通过!"),n(d)})}checkGridInput(r,i,n=!1,c=!0){var m,_,E;let d=!0,p=[];r&&(r instanceof Array?p=r:typeof r=="string"?p=r.split(","):p=[r]);for(let v=0;v<p.length;v++){const A=this.getGrid(p[v]);if((m=A==null?void 0:A.gridOptions)!=null&&m.api){(!i||i.trim().length===0)&&(i="ChangedRows");const B=A.gridOptions.api,Q=(E=(_=A.gridOptions)==null?void 0:_.context)==null?void 0:E.columnsConfig,N=[];if(Q==null||Q.forEach(W=>{W.UNBOUND_TYPE==="0"&&W.ITEM_MUST_FLAG==="1"&&N.push(W)}),N.length>0)if(B.setFilterModel(null),i==="CheckedRows"){const W=B.getSelectedNodes();for(let J=0;J<W.length;J++)if(d=this.checkGridRowInput(B,W[J],N,n,c),!d)return d}else if(i==="AllRows"){const W=B.getModel().getRowCount();for(let J=0;J<W;J++){const re=B.getModel().getRow(J);if(re!=null&&re.data&&(d=this.checkGridRowInput(B,re,N,n,c),!d))return d}}else{const W=this.getGridCreatedRows(r),J=this.getGridModifyRows(r),re=[...W,...J];for(let Se=0;Se<re.length;Se++){const ue=B.getModel().getRowNode(re[Se].uid);if(ue!=null&&ue.data&&(d=this.checkGridRowInput(B,ue,N,n,c),!d))return d}}}}return d}checkGridRowInput(r,i,n,c=!1,d=!0){var m,_,E,v;if(r&&(i!=null&&i.data))for(let A=0;A<n.length;A++){const B=n[A].ITEM_CODE,Q=n[A].FIELD_NAME,N=n[A].CONDITION_TABLE;let W={};t.toString(n[A].EXT_OPTIONS).trim().length>0&&(W=JSON.parse(t.toString(n[A].EXT_OPTIONS)));const J=W.requireCondition||n[A].MUST_INPUT_CONDITION,re=r.getColumnDef(B);if(re&&(!re.visible||!c))if(J.trim().length===0){if(i.rowIndex&&(i==null?void 0:i.data[Q])===void 0||(i==null?void 0:i.data[Q])===null||t.toString(i==null?void 0:i.data[Q]).trim().length===0||((m=re.context)==null?void 0:m.dataType)==="number"&&(i==null?void 0:i.data[Q])===0)return d&&(r.ensureNodeVisible(i,"top"),r.ensureColumnVisible(re.colId,"auto"),r.startEditingCell({rowIndex:i.rowIndex||0,colKey:re.colId}),t.messageWarning(e.Core.$t("ERX.InputEmptyMessage"))),r.getCellEditorInstances({columns:[re],rowNodes:[i]}).forEach(ue=>{ue.editorType,ue.setBorder?ue.setBorder("2px solid red"):ue.setInvalid&&ue.setInvalid()}),!1}else{let Se=i==null?void 0:i.data;if(N.trim().length>0&&((_=this._formDataSet)!=null&&_.contains(N.trim()))&&(Se=(E=this._formDataSet)==null?void 0:E.getCurrentDataObject(N.trim())),t.checkExpressionValid(Se,e.Core.getSystemFormatString(J))&&((i==null?void 0:i.data[Q])===void 0||(i==null?void 0:i.data[Q])===null||t.toString(i==null?void 0:i.data[Q]).trim().length===0||((v=re.context)==null?void 0:v.dataType)==="number"&&(i==null?void 0:i.data[Q])===0))return d&&(r.ensureNodeVisible(i,"top"),r.ensureColumnVisible(re.colId,"auto"),r.startEditingCell({rowIndex:i.rowIndex||0,colKey:re.colId}),t.messageWarning(e.Core.$t("ERX.InputEmptyMessage"))),!1}}return!0}checkGridRow(r,i,n=!0){const c=this.getGrid(r);return c&&i&&(typeof i=="string"&&i.trim().length>0?i=[i]:i.uid&&(i=[t.toString(i.uid)]),i instanceof Array&&i.length>0&&i.forEach(d=>{const p=c.gridOptions.api.getRowNode(d.uid?d.uid:d);p&&p.setSelected(n===!0)})),this}checkGridCurrentRow(r){if(r){const i=this.getGridCurrentRow(r);i&&this.checkGridRow(r,i)}}checkAllGridRow(r,i=!0){const n=this.getGrid(r);if(n){const c=this.getGridColumn(n,o.GridCheckColumnFieldName);if(c&&c.visible){const d=(p,m)=>{p.setSelected(!0)};i?n.gridOptions.api.forEachNodeAfterFilterAndSort(d):n.gridOptions.api.forEachLeafNode(d)}}}unCheckAllGridRow(r,i=!0){const n=this.getGrid(r);if(n){const c=this.getGridColumn(n,o.GridCheckColumnFieldName);if(c&&c.visible){const d=(p,m)=>{p.setSelected(!1)};i?n.gridOptions.api.forEachNodeAfterFilterAndSort(d):n.gridOptions.api.forEachLeafNode(d)}}}isGridRowChecked(r,i){var c;const n=this.getGrid(r);if(n&&i){const d=this.getGridColumn(n,o.GridCheckColumnFieldName);if(d&&d.visible)return(c=n.gridOptions.api.getRowNode(i instanceof T?i.uid:i))==null?void 0:c.isSelected()}}isGridCurrentRowChecked(r){const i=this.getGridCurrentRow(r);if(i)return this.isGridRowChecked(r,i)}setLocalStorage(r,i){return t.setLocalStorage(r,i)}getLocalStorage(r,i=!0){return t.getLocalStorage(r,i)}getCallFormParas(r,i=!0){return t.getCallFormParas(r,i)}callForm(r,i,n=!0){return t.callForm(r,i,n)}copyText(r){t.copyText(r)}readClipboardText(){return t.readClipboardText()}getTextWidth(r){return t.getTextWidth(r)}getGuid(){return t.guid()}round(r,i){return t.round(r,i)}loading(r,i,n){t.loading(r,i,n)}stringFormat(r,...i){return t.stringFormat(r,...i)}isNullOrEmpty(r){return t.isNullOrEmpty(r)}checkNullOrEmpty(r,i){const n=this.isNullOrEmpty(r);return n&&i&&i.trim().length>0&&this.messageWarning(i.trim()),n}callService(r,i,n,c){var d;return c=c||{},c.messageError=c.messageError??!1,c.messageError!=="modal"&&c.messageError!==!1&&(c.messageError=((d=this.getFormSysInfo("ERRORMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true"?"modal":!0),t.callService(r,i,n,c)}async querySql(r,...i){return t.querySql(this._serverPartition,r,...i)}messageConfirm(r,i,n){return t.messageConfirm(r,i,n)}messageSuccess(r,...i){var d;let n=e.Core.$t("ERX.OperateSuccess")||"操作成功!",c=((d=this.getFormSysInfo("SUCCESSMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageInfo(n,c)}messageInfo(r,...i){var d;let n="",c=((d=this.getFormSysInfo("INFOMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageInfo(n,c)}messageWarning(r,...i){var d;let n="",c=((d=this.getFormSysInfo("WARNINGMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageWarning(n,c)}messageError(r,...i){var d;let n="",c=((d=this.getFormSysInfo("ERRORMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageError(n,c)}buildEiBlock(r,i){return t.buildEiBlock(r,i)}getCurrentDataObject(r){var n;let i;if(r&&r.trim().length>0){const c=this.getGrid(r);if(c)i=this.getGridCurrentRow(c);else{const d=this.getBindingTableName(r.trim());d&&d.trim().length>0&&(i=(n=this._formDataSet)==null?void 0:n.getCurrentDataObject(d))}}return i}stopGridEditing(r,i){return new Promise((n,c)=>{let d;r instanceof Array?d=r:typeof r=="string"?d=r.split(","):d=[r],(d==null?void 0:d.length)>0&&d.forEach(p=>{var m;(m=this.getGridApi(p))==null||m.stopEditing()}),setTimeout(()=>{try{const p=i();n(p)}catch(p){c(p)}},250)})}async deleteGridRows(r,i=!1,n){const c=this.getGrid(r);return c?t.deleteGridRows(c,i,n):!1}setGridFocusedCell(r,i=0,n,c){const d=this.getGrid(r);d&&t.setGridFocusedCell(d,i,n,c)}setGridRowData(r,i,n,c=!1){if(i&&n){n instanceof e.Model&&(n=n.toJSON());const d=this.getGrid(r);if(d){const p=d.gridOptions.api;if(i instanceof e.Model&&(i=i.uid),typeof i=="string"&&i.trim().length>0){const m=p.getModel().getRowNode(i.trim());m&&m.data&&Object.keys(n).forEach(_=>{if(!["isNew","uid","dirty","dirtyFields","_events","_schemaFields","_preview_row_data","_children_data"].includes(_)&&typeof n[_]!="function"&&m.data[_]!==void 0&&(String(n[_]).trim().length===0||c===!1)){const E=p.getColumnDef(_);E?E.cellEditor==="agCheckboxCellEditor"?m.setDataValue(_,n[_]===!0||n[_]==="1"):m.setDataValue(_,n[_]):m.data[_]=n[_]}})}}}return this}setGridCurrentRowData(r,i,n=!1){const c=this.getGridCurrentRow(r);return c&&this.setGridRowData(r,c,i,n),this}setGridRowState(r,i,n){var c,d,p;if(r&&i){const m=this.getGrid(r);if(m){const _=m.gridOptions.api;if(i instanceof e.Model&&(i=i.uid),typeof i=="string"&&i.trim().length>0){const E=_.getModel().getRowNode(i.trim());if(E&&((c=E.data)!=null&&c.uid)){const v=(p=(d=m.gridOptions)==null?void 0:d.context)==null?void 0:p.bindingSource;v&&v.setRowState(E.data,n)}}}}return this}getGridBindingTable(r){var c,d;let i;const n=this.getGrid(r);return n&&(i=(d=(c=n.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource),i}getGridStructureAsBlock(r,i=!1,n){var p,m,_,E;n=(n==null?void 0:n.trim())||"result";const c=new ut.EiBlock(n),d=this.getGridBindingTable(r);if((p=d==null?void 0:d.options)!=null&&p.schema){const v=B=>{const Q=new ut.EiColumn(B.name);return Q.type=B.type==="number"?"N":"C",Q.name=B.name,Q.descName=B.caption,Q},A=[];i?(_=(m=r==null?void 0:r.gridOptions)==null?void 0:m.columnApi.getAllGridColumns())==null||_.forEach(B=>{var Q,N,W,J,re,Se,ue;if((W=(Q=d==null?void 0:d.options)==null?void 0:Q.schema)!=null&&W[(N=B.colDef)==null?void 0:N.field]){const me=v((re=d==null?void 0:d.options)==null?void 0:re.schema[(J=B.colDef)==null?void 0:J.field]);me.descName=(ue=(Se=B.colDef)==null?void 0:Se.headerName)==null?void 0:ue.replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""),c.addColumn(me),A.push({name:me.name,type:me.type})}}):Object.keys((E=d==null?void 0:d.options)==null?void 0:E.schema).forEach(B=>{var N,W;const Q=v((W=(N=d==null?void 0:d.options)==null?void 0:N.schema)==null?void 0:W[B]);c.addColumn(Q),A.push({name:Q.name,type:Q.type})})}return c.setAttr({offset:0,limit:-1,orderBy:""}),c}getGridSelectRows(r,i=!1,n=!1){const c=this.getGrid(r);return this.getGridRows(c,"select",i,n)}getGridSelectRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"select",i,n,c,d)}getGridCurrentRow(r,i=!1,n=!1){let c;const d=this.getGridRows(r,"current",i,n);return d.length>0&&(c=d[0]),c}getGridCurrentRowAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"current",i,n,c,d)}getGridCheckedRows(r,i=!1,n=!1){return this.getGridRows(r,"checked",i,n)}getGridCheckedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"checked",i,n,c,d)}getGridCheckedAfterFilterRows(r,i=!1,n=!1){return this.getGridRows(r,"checkedAfterFilter",i,n)}getGridCheckedAfterFilterRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"checkedAfterFilter",i,n,c,d)}getGridDeletedRows(r,i=!1,n=!1){return this.getGridRows(r,"delete",i,n)}getGridDeletedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"delete",i,n,c,d)}getGridModifyRows(r,i=!1,n=!1){return this.getGridRows(r,"modify",i,n)}getGridModifyRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"modify",i,n,c,d)}getGridCreatedRows(r,i=!1,n=!1){return this.getGridRows(r,"add",i,n)}getGridCreatedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"add",i,n,c,d)}getGridAllRows(r,i=!1,n=!1){return this.getGridRows(r,"all",i,n)}getGridAllRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"all",i,n,c,d)}getGridChangedRowsAsEiInfo(r,i,n,c=!1,d){i==null&&(i=new ut.EiInfo);let p;return r instanceof Array?p=r:typeof r=="string"?p=r.split(","):p=[r],p&&p.length>0&&p.forEach(m=>{const _=this.getGrid(m);_&&(i=t.getGridChangedRowsAsEiInfo(_,p.length===1?n:"",i,c,d))}),i}getGridRows(r,i,n=!1,c=!1){const d=this.getGrid(r);return t.getGridRows(d,i,n,c)}getGridRowsAsBlock(r,i,n,c=!1,d,p){const m=this.getGrid(r);return t.getGridRowsAsBlock(m,i,n,c,d,p)}initialGridToolbar(r,i,n){return r=(r||"").trim(),this._gridToolbarOptions[r]=this._gridToolbarOptions[r]||{},this._gridToolbarOptions[r]={...this._gridToolbarOptions[r],...n},r.length>0&&i&&Object.keys(i).forEach(c=>{const d=i[c];this._gridToolbarOptions[r][c]=this._gridToolbarOptions[r][c]||{},d.action!==void 0&&(this._gridToolbarOptions[r][c].action=d.action),d.preventDefault!==void 0&&(this._gridToolbarOptions[r][c].preventDefault=d.preventDefault),d.messageConfirm!==void 0&&(this._gridToolbarOptions[r][c].messageConfirm=d.messageConfirm),d.visible!==void 0&&(this._gridToolbarOptions[r][c].visible=d.visible),d.showIco!==void 0&&(this._gridToolbarOptions[r][c].showIco=l.ref(d.showIco)),d.showText!==void 0&&(this._gridToolbarOptions[r][c].showText=l.ref(d.showText)),t.toString(d.caption,!0).length>0&&(this._gridToolbarOptions[r][c].caption=t.toString(d.caption,!0)),d.ico&&(this._gridToolbarOptions[r][c].ico=d.ico)}),this}setGridToolbarVisible(r,i){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r]=this._gridToolbarOptions[r]||{},Object.keys(i).forEach(n=>{this._gridToolbarOptions[r][n]=this._gridToolbarOptions[r][n]||{},this._gridToolbarOptions[r][n].visible=l.ref(i[n])})),this}setGridToolbarAction(r,i,n,c,d){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r][i].action=n,c!==void 0&&(this._gridToolbarOptions[r][i].preventDefault=c),d!==void 0&&(this._gridToolbarOptions[r][i].messageConfirm=d)),this}setGridAuthButtonAction(r,i){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r].authButtonAction={action:i}),this}getGridToolbarVisible(r,i){var n,c,d,p;if((r==null?void 0:r.trim().length)>0&&this._gridToolbarOptions[r]&&((n=this._gridToolbarOptions[r][i])==null?void 0:n.visible)!==void 0)return((c=this._gridToolbarOptions[r][i])==null?void 0:c.visible.value)!==void 0?(d=this._gridToolbarOptions[r][i])==null?void 0:d.visible.value:(p=this._gridToolbarOptions[r][i])==null?void 0:p.visible}sleep(r){return t.sleep(r)}setGlobalStyleProperty(r,i,n){t.setGlobalStyleProperty(r,i,n)}getGlobalStyleProperty(r){return t.getGlobalStyleProperty(r)}removeGlobalStyleProperty(r){return t.removeGlobalStyleProperty(r)}mergeGridDataRow(r,i,n=!1){return t.mergeGridDataRow(r,i,n)}mergeDataToDataTable(r,i,n=!0){return t.mergeDataToDataTable(r,i,n)}mergeDataToGrid(r,i,n=!0){let c=0;const d=this.getGrid(i);return d?(c=t.mergeDataToGrid(r,d,n),this.autoBestFit(d)):console.warn("ER: Attempting to bind data to a non-existent grid"),c}mergeEiBlockToGrid(r,i,n=!0){const c=this.getGrid(i);return this.mergeDataToGrid(r==null?void 0:r.getMappedRows(),c,n)}mergeEiInfoToGrid(r,...i){this.isNullOrEmpty(i)?i=Object.keys(this._gridOptions):i.length===1&&i[0]&&typeof i[0]=="string"&&(i=i[0].split(",")),new ut.EiInfo,i.forEach(n=>{var p,m,_,E;const c=this.getGrid(n),d=(E=(_=(m=(p=c==null?void 0:c.gridOptions)==null?void 0:p.context)==null?void 0:m.bindingSource)==null?void 0:_.tableName)==null?void 0:E.trim();(d==null?void 0:d.trim().length)>0&&r.getBlock(d.trim())?this.mergeEiBlockToGrid(r.getBlock(d.trim()),c):i.length===1&&this.mergeEiBlockToGrid(r.getBlockByIndex(0),c)})}clearGridData(...r){r&&r.length>0&&r.forEach(i=>{const n=this.getGrid(i);n&&t.clearGridData(n)})}clearLayoutData(...r){if(this.isNullOrEmpty(r)?r=Object.keys(this._formBindingRelation):r.length===1&&r[0]&&typeof r[0]=="string"&&(r=r[0].split(",")),r&&r.length>0){const i=[];r.forEach(n=>{if(n.trim().length>0)if(this._formBindingRelation[n.trim()]&&this._formBindingRelation[n.trim()].length>0){const c=this._formBindingRelation[n.trim()];this.getRelationConfigIdsByTableName(c).forEach(p=>{var m,_;if(this._gridOptions[p]===void 0){if((m=this._formDataSet)!=null&&m.dataTables[this._formBindingRelation[p]]){const E=(_=this._formDataSet)==null?void 0:_.dataTables[c];i.includes(c)||(E.clear(),i.push(c))}this.setControlEmptyValue(p)}})}else this.setControlEmptyValue(n.trim())})}}clearLayoutOrGridData(...r){if(this.isNullOrEmpty(r)?r=Object.keys(this._formBindingRelation):r.length===1&&r[0]&&typeof r[0]=="string"&&(r=r[0].split(",")),r&&r.length>0){const i=[];r.forEach(n=>{if(n.trim().length>0)if(this._formBindingRelation[n.trim()]&&this._formBindingRelation[n.trim()].length>0){const c=this._formBindingRelation[n.trim()];this.getRelationConfigIdsByTableName(c).forEach(p=>{var m,_;if((m=this._formDataSet)!=null&&m.dataTables[this._formBindingRelation[p]]){const E=(_=this._formDataSet)==null?void 0:_.dataTables[c];i.includes(c)||(E.clear(),i.push(c))}this._gridOptions[p]})}else this.setControlEmptyValue(n.trim())})}}getRelationConfigIdsByTableName(r){const i=[];return(r==null?void 0:r.trim().length)>0&&this._formBindingRelation&&Object.keys(this._formBindingRelation).forEach(n=>{this._formBindingRelation[n]===r.trim()&&i.push(n)}),i}setGridServerPagingQuery(r,i,n,c=!0){var d,p,m,_;if(r){const E=this.getGrid(r);E&&((p=(d=E.gridOptions.context)==null?void 0:d.pageOptions)==null?void 0:p.pagination)==="server"&&((_=(m=E.gridOptions.context)==null?void 0:m.pageOptions)==null?void 0:_.pageSize)>0&&(E.gridOptions.context.pageOptions.pageFilter=i,E.gridOptions.context.pageOptions.pageQuery=n,c&&this.excuteGridServerPaging(E,1))}}setGridServerPagingService(r,i,n,c=!0){r&&(n==null?void 0:n.trim().length)>0&&this.setGridServerPagingQuery(r,i,d=>new Promise(async(p,m)=>{var B,Q;const _=new ut.EiInfo;Object.keys(i.getBlocks()).forEach(N=>{_.addBlock(i.getBlock(N))});const E={flag:-1,msg:"",data:void 0,total:0},A=(Q=(B=this.getGrid(r).gridOptions.context)==null?void 0:B.pageOptions)==null?void 0:Q.pageSize;_.addBlock(e.Core.buildEiBlock([{PAGE_NUM:d,PAGE_SIZE:A}],"PAGEINFO")),await this.callService(n.trim(),_,void 0,{messageError:!0}).then(N=>{N.sys.status>=0&&(E.flag=0,E.data=N.getBlock(0),E.total=N.getBlock(0).length,N.contains("PAGEINFO")&&(E.total=N.getBlock("PAGEINFO").data[0].TOTAL_RECORD))}),p(E)}),c)}setGridServerPagingDataSource(r,i,n,c,d=!0){r&&(n==null?void 0:n.trim().length)>0&&(c==null?void 0:c.trim().length)>0&&this.setGridServerPagingQuery(r,i,p=>new Promise(async(m,_)=>{var Q,N;const E=new ut.EiInfo;Object.keys(i.getBlocks()).forEach(W=>{E.addBlock(i.getBlock(W))});const v={flag:-1,msg:"",data:void 0,total:0},B=(N=(Q=this.getGrid(r).gridOptions.context)==null?void 0:Q.pageOptions)==null?void 0:N.pageSize;E.addBlock(e.Core.buildEiBlock([{FUNCTION_ID:n}],"DATA_SOURCE")),E.addBlock(e.Core.buildEiBlock([{PAGE_NUM:p,PAGE_SIZE:B}],"PAGEINFO")),await this.callService(c.trim(),E).then(W=>{W.sys.status>=0&&(v.flag=0,v.data=W.getBlock(0),v.total=W.getBlock(0).length,W.contains("PAGEINFO")&&(v.total=W.getBlock("PAGEINFO").data[0].TOTAL_RECORD))}),m(v)}),d)}async excuteGridServerPaging(r,i){var c,d,p,m;const n=this.getGrid(r);if(n&&((p=(d=(c=n.gridOptions)==null?void 0:c.context)==null?void 0:d.pageOptions)!=null&&p.pageQuery)){const _=await n.gridOptions.context.pageOptions.pageQuery(i>0?i-1:0);if((_==null?void 0:_.flag)>=0&&_.data){this.mergeDataToGrid(_.data,r);const E=(m=n.gridOptions)==null?void 0:m.api.getStatusPanel("PaginationPanel");E&&E.setPagination({currentPage:i,totalCount:_.total})}return _}}}e.FormHelper=y;class O{constructor(r,i){j(this,"_formHelper");this._formHelper=r}}e.BillFormHelper=O;class D{constructor(r,i,n,c,d){j(this,"MasterDetailView",!0);j(this,"FormConfigQueryService","");j(this,"FormCaption","");j(this,"CustomFilterString","");j(this,"CustomFilterJson");j(this,"BordStyle");j(this,"app");j(this,"div");j(this,"DefaultValues",{values:{},readonly:{}});j(this,"Context");j(this,"WindowOpened",l.ref(!1));j(this,"DataModelId","");j(this,"ShowCheckBoxColumn");j(this,"SelectMode");j(this,"ShowQueryButton",!0);j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"QueryButtonCaption","");j(this,"OkButtonCaption","");j(this,"CancelButtonCaption","");j(this,"CloseDialogWhenOkClick",!0);j(this,"ShowQueryNoDetailInfoMsg",!0);j(this,"ButtonPreventDefault",{ok:!1,cancel:!1,query:!1,mainViewFocusChanged:!1});j(this,"UnMountWhenCloseDialog",!1);j(this,"AutoQuery",!1);j(this,"AutoRefresh",!1);j(this,"KeyFieldName","");j(this,"DescFieldName","");j(this,"ChooseKeyValues","");j(this,"ReceiveJsonData");j(this,"LayoutGroupFilterId","LayoutGroupFilter");j(this,"MainViewConfigId","gridView1");j(this,"DetailViewConfigId","gridView2");j(this,"LayoutFilterOptions",{});j(this,"MainViewOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"DetailViewOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"MainInfoQueryMethod");j(this,"DetailInfoQueryMethod");j(this,"_partition");j(this,"_queryPartition");j(this,"_formName","");j(this,"_layoutConfigIds","");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dialogReturnInfo");j(this,"_mainTableame","");j(this,"_detailTableame","");j(this,"_queryService","");j(this,"_serviceFilter","");j(this,"_keyFieldValue",{});j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_component");j(this,"_resolveDialogResult");j(this,"queryMainGridInfo",(r=!0)=>{const i=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);if(i&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(c=>{c.trim().length>0&&i[c.trim().toUpperCase()]&&(this._keyFieldValue[c.trim().toUpperCase()]=i[c.trim().toUpperCase()])}),this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)this.MainInfoQueryMethod(this),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue);else if(this.FormConfigQueryService.trim().length>0)this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson).then(n=>{var c,d,p;if(e.Core.toNumber((c=n==null?void 0:n.SysInfo)==null?void 0:c.Flag)===-603){this._formHelper.messageWarning(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}else if(e.Core.toNumber((d=n==null?void 0:n.SysInfo)==null?void 0:d.Flag)<0){this._formHelper.messageError(((p=n==null?void 0:n.SysInfo)==null?void 0:p.Msg)||"");return}else{n.getBlock(this._mainTableame)?this._formHelper.mergeDataToLayoutOrGrid(n.getBlock(this._mainTableame),!0,this.MainViewConfigId):this._formHelper.mergeDataToLayoutOrGrid(n.getBlockByIndex(0),!0,this.MainViewConfigId);const m=this._formHelper.getGridDataCount(this.MainViewConfigId);m>0?(r&&this._formHelper.messageInfo(e.Core.$t("ERX.QueryResultWithRecords",[m.toString()])||e.Core.stringFormat("查询完成,共查询到[{0}]条数据",m)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue)):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}});else if(this._queryService.trim().length>0){let n="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?n=this._serviceFilter+" and "+this.CustomFilterString:n=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(n=this._serviceFilter),this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:n}).then(c=>{var d,p,m;if(e.Core.toNumber((d=c==null?void 0:c.SysInfo)==null?void 0:d.Flag)===-603){this._formHelper.messageWarning(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}else if(e.Core.toNumber((p=c==null?void 0:c.SysInfo)==null?void 0:p.Flag)<0){this._formHelper.messageError(((m=c==null?void 0:c.SysInfo)==null?void 0:m.Msg)||"");return}else{this._formHelper.mergeDataToLayoutOrGrid(c.getBlockByIndex(0),!0,this.MainViewConfigId);const _=this._formHelper.getGridDataCount(this.MainViewConfigId);_>0?(r&&this._formHelper.messageInfo(e.Core.$t("ERX.QueryResultWithRecords",[_.toString()])||e.Core.stringFormat("查询完成,共查询到[{0}]条数据",_)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue)):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}});j(this,"autoCheckRows",()=>{if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const r=this.ChooseKeyValues.trim().split(","),i=this.ErFormHelper.getGrid(this.MainViewConfigId);i&&this.ErFormHelper.getGridAllRows(i).forEach(c=>{r.findIndex(p=>p===c[this.KeyFieldName])>=0&&this.ErFormHelper.checkGridRow(i,c)})}});this._initializeFlag=0,this._partition=r,this._formName=i,n&&(this._layoutConfigIds=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new e.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,i){return new Promise((n,c)=>{this._partition=r&&r.trim()||this._partition,this._serviceName=i&&i.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B;if(d.flag===1)if(((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0){const Q=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORM)==null?void 0:B.getMappedRows()[0];this._formOptions.value.title=this._formOptions.value.title??Q.FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??t.toNumber(Q.FORM_WIDTH),this._formOptions.value.height=this._formOptions.value.height??t.toNumber(Q.FORM_HEIGHT),this.BordStyle=this.BordStyle??(Q.FORM_STYLE==="3"?"Fixed":"Sizable");const N=this._formHelper.getSingleViewConfigInfo(this.MainViewConfigId);N&&(this._mainTableame=N.TABLE_NAME,this._queryService=N.SVC_NAME,this._serviceFilter=N.FILTER_STRING,this.KeyFieldName.trim().length===0&&(this.KeyFieldName=N.KEY_FIELDS)),this._formHelper.containsConfig(this.DetailViewConfigId)||(this.DetailViewConfigId=""),this.ShowCheckBoxColumn!==void 0&&(N.SHOW_SELECTION=this.ShowCheckBoxColumn?"1":"0",N.MULTI_SELECT_MODE=this.ShowCheckBoxColumn?"2":"1"),this._initializeFlag=1}else t.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else t.messageError("ErPopQueryHelper initialize faild, error msg is ["+d.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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i,n){return new Promise((c,d)=>{i&&this.setEvent("ok",i),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async p=>{var E,v;if(this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>ep),(E=this._component)!=null&&E.default&&(this._component=this._component.default))),this.doEvent("initial",this),this.FormConfigQueryService.trim().length===0){const A=this._formHelper.getFormButtonConfigInfo("btnQuery");this.FormConfigQueryService=((v=A==null?void 0:A.SVC_NAME)==null?void 0:v.trim())||""}this.MainViewOptions.masterDetail=this.MasterDetailView,this._initializeFlag=1;const m=l.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});m.component("ag-grid-vue",Pt.AgGridVue),m.component("v-splitter",Ia.Splitpanes),m.component("v-splitter-pane",Ia.Pane),this.app=m;const _=document.createElement("div");document.body.appendChild(_),this.div=_,m.mount(_),this.WindowOpened.value=!0}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}}e.PopQueryHelper=D;class I{constructor(r,i,n,c,d){j(this,"LayoutCaption",{});j(this,"EditType","Add");j(this,"Context",{});j(this,"WindowOpened",l.ref(!1));j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"CancelButtonPreventDefault",!1);j(this,"OkButtonService","");j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"ExtendJsonData");j(this,"BeforeCallService");j(this,"app");j(this,"div");j(this,"_partition");j(this,"_savePartition");j(this,"_formName","");j(this,"_tableName","");j(this,"_layoutConfigId","");j(this,"_layoutGroupIdArray",[]);j(this,"_layoutGroupInfo",{});j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dataSet");j(this,"_dataTable");j(this,"_mainLayoutId","");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_readOnlys");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_component");j(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=i,n&&(this._layoutConfigId=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new y(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,i){return new Promise((n,c)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me,ge;if(d.flag===1){if(((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0){const le=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORM)==null?void 0:B.getMappedRows()[0];if(this._formOptions.value.title=this._formOptions.value.title??le.FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??t.toNumber(le.FORM_WIDTH),this._formOptions.value.height=this._formOptions.value.height??t.toNumber(le.FORM_HEIGHT),this.BordStyle=this.BordStyle??(le.FORM_STYLE==="3"?"Fixed":"Sizable"),((J=(W=(N=(Q=this._formHelper)==null?void 0:Q.ConfigInfo)==null?void 0:N.TSI00FORMBUTTON)==null?void 0:W.getMappedRows())==null?void 0:J.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.getMappedRows().every(Y=>Y.BUTTON_NAME==="btnOk"?(this.OkButtonService=Y.SVC_NAME,!1):!0),((me=(ue=(Se=(re=this._formHelper)==null?void 0:re.ConfigInfo)==null?void 0:Se.TSI00GRIDVIEW)==null?void 0:ue.getMappedRows())==null?void 0:me.length)>0)for(let Y=0;Y<((ce=(Te=(Z=this._formHelper)==null?void 0:Z.ConfigInfo)==null?void 0:Te.TSI00GRIDVIEW)==null?void 0:ce.getMappedRows().length);Y++){const Fe=(ge=(Me=(ze=this._formHelper)==null?void 0:ze.ConfigInfo)==null?void 0:Me.TSI00GRIDVIEW)==null?void 0:ge.getMappedRows()[Y];Y==0&&(this._mainLayoutId=Fe.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(Fe.FUNCTION_ID),this._layoutGroupInfo[Fe.FUNCTION_ID]=Fe}this._initializeFlag=1}}else{const le="ErPopFreeHelper initialize faild, error msg is ["+d.msg+"]";t.messageError(le)}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,i){return r&&r instanceof T&&(r=r.toJSON()),r&&Object.keys(r).length>0&&(this._receiveData=r,this._readOnlys=i),this._receiveData}setEvent(r,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setValue(r,i=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,void 0,i),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,i,n){return new Promise((c,d)=>{const p=m=>{if(this.EditType==="Add"){const _=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={..._,...this._receiveData}}this.WindowOpened.value=!0};i&&this.setEvent("ok",i),n&&this.setEvent("cancel",n),this.app?p():this.Initialize().then(async m=>{var v;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>Y5),(v=this._component)!=null&&v.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const _=l.createApp(this._component,{popFreeHelperProp:this,formWidth:Number(this.getFormOption("width")??this.getFormOption("formWidth")??-1),formHeight:Number(this.getFormOption("height")??this.getFormOption("formHeight")??-1)});_.component("ag-grid-vue",Pt.AgGridVue),this.app=_;const E=document.createElement("div");document.body.appendChild(E),this.div=E,_.mount(E),p()}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo={...this._dialogReturnInfo,...r}}}e.PopFreeHelper=I;class M{constructor(r,i,n,c,d){j(this,"LayoutOptions",{});j(this,"GridOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"LayoutCaption");j(this,"EditType","Add");j(this,"Context",{});j(this,"WindowOpened",l.ref(!1));j(this,"ShowSaveButton",!0);j(this,"ShowCloseButton",!0);j(this,"SaveButtonCaption","");j(this,"CloseButtonCaption","");j(this,"CloseDialogWhenSaveClick",!1);j(this,"PreventDefaultEvent",{});j(this,"OkButtonService","");j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"ExtendJsonData");j(this,"BeforeCallService");j(this,"app");j(this,"div");j(this,"_partition");j(this,"_savePartition");j(this,"_formName","");j(this,"_mainTableName","");j(this,"_detailTableName","");j(this,"_layoutConfigId","LayoutGroupMain");j(this,"_gridConfigId","gridView1");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dataSet");j(this,"_mainDataTable");j(this,"_detailDataTable");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_readOnlys");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=i,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new y(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 l.reactive(((r=this._dataSet)==null?void 0:r.getCurrentDataObject(this._mainTableName))||new e.Model)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(r,i){return new Promise((n,c)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B,Q;if(d.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),((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM.data[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((Q=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORMBUTTON)==null?void 0:B.getMappedRows())==null?void 0:Q.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.getMappedRows().every(N=>N.BUTTON_NAME==="btnOk"?(this.OkButtonService=N.SVC_NAME,!1):!0),this._initializeFlag=1);else{const N="ErPopFormHelper initialize faild, error msg is ["+d.msg+"]";t.messageError(N)}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,i){this._receiveData=r,this._readOnlys=i}setEvent(r,i,n=!1){this._events[r]=i,this.PreventDefaultEvent[r]=n}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setValue(r,i=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,i),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,i,n){return new Promise((c,d)=>{const p=()=>{var m,_,E;if(this.EditType==="Add"){const v=this._formHelper.getLayoutConfigDefaultValues(this._layoutConfigId);this._receiveData={...v,...this._receiveData}}(m=this.DataModel)==null||m.reset(),(_=this.DataModel)==null||_.setData(this._receiveData),this.DataModel.dirty=!1,this.DataModel.dirtyFields={},(E=this._dataSet)==null||E.acceptChanges(),this.WindowOpened.value=!0};i&&this.setEvent("save",i),n&&this.setEvent("close",n),this.app?p():this.Initialize().then(m=>{this._initializeFlag=1,this.doEvent("initial",this);const _=l.createApp(r,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});_.component("ag-grid-vue",Pt.AgGridVue),this.app=_;const E=document.createElement("div");document.body.appendChild(E),this.div=E,_.mount(E),p()}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}}e.PopFormHelper=M;class G{constructor(r,i,n,c){j(this,"Context",{});j(this,"BordStyle");j(this,"AutoRefresh",!1);j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"CancelButtonPreventDefault",!1);j(this,"UnMountWhenCloseDialog",!1);j(this,"BeforeOkButtonClick");j(this,"_app");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_events",{});j(this,"_windowOpened",l.ref(!1));j(this,"_options",l.reactive({title:"标题",width:360,height:630}));j(this,"_component");j(this,"_resolveDialogResult");j(this,"_primaryField");j(this,"_parentField");j(this,"_displayField");this._primaryField=r,this._parentField=i,this._displayField=n,this.setOptions(c||{})}get FormId(){return t.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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}receiveData(r){this._receiveData=r}show(r,i,n){return new Promise(async(c,d)=>{var p;if(i&&this.setEvent("ok",i),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(()=>rp),(p=this._component)!=null&&p.default&&(this._component=this._component.default)));const m=l.createApp(this._component,{popTreeHelperProp:this});m.component("ag-grid-vue",Pt.AgGridVue),this._app=m;const _=document.createElement("div");document.body.appendChild(_),m.mount(_),this._windowOpened.value=!0}this._resolveDialogResult={resolve:c,reject:d}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}}e.PopTreeHelper=G;class te{constructor(r){j(this,"Content","");j(this,"Context",{});j(this,"BordStyle");j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"UnMountWhenCloseDialog",!1);j(this,"BeforeOkButtonClick");j(this,"_app");j(this,"_windowOpened",l.ref(!1));j(this,"_options",l.reactive({title:"标题"}));j(this,"_resolveDialogResult");j(this,"_dialogReturnInfo");j(this,"_events",{});j(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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i,n=!0){return new Promise(async(c,d)=>{var p,m;if(this._app)this._windowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>q5),(p=this._component)!=null&&p.default&&(this._component=this._component.default)));const _=l.createApp(this._component,{popRichEditorProps:this,options:this._options,content:i});_.use(et),((m=this._options)==null?void 0:m.extension)==="dropdown"&&_.component("ag-grid-vue",Pt.AgGridVue),this._app=_;const E=document.createElement("div");document.body.appendChild(E),_.mount(E),this._windowOpened.value=!0}this._resolveDialogResult={resolve:c,reject:d}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}}e.PopRichEditor=te;class b{constructor(r,i,n){j(this,"_app");j(this,"_component");j(this,"_windowOpened",l.ref(!1));j(this,"_partition","");j(this,"_formName","");j(this,"_gridConfigId","");j(this,"_erGrid","");j(this,"_resolveDialogResult");var c,d;this._erGrid=n,this._partition=r,this._formName=i,this._gridConfigId=(d=(c=n==null?void 0:n.gridOptions)==null?void 0:c.context)==null?void 0:d.configId}get WindowOpened(){return this._windowOpened}get Partition(){return this._partition}get FormName(){return this._formName}get GridConfigId(){return this._gridConfigId}get ErGrid(){return this._erGrid}show(){return new Promise(async(r,i)=>{var n;if(this._app)this._windowOpened.value=!0;else if((n=this._component)!=null&&n.default&&this._gridConfigId){const c=l.createApp(this._component.default,{popGridGroupHelperProps:this});c.component("ag-grid-vue",Pt.AgGridVue),c.component("v-splitter",Ia.Splitpanes),c.component("v-splitter-pane",Ia.Pane),this._app=c;const d=document.createElement("div");document.body.appendChild(d),c.mount(d),this._windowOpened.value=!0}else i({result:"import component error!"});this._resolveDialogResult={resolve:r,reject:i}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve({result:"success"})}}e.PopGridGroupHelper=b;class P{constructor(r,i,n,c,d){j(this,"FormCaption");j(this,"Context");j(this,"WindowOpened",l.ref(!1));j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"app");j(this,"_partition");j(this,"_formName","");j(this,"_configIds","");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",l.ref(0));j(this,"_formHelper");j(this,"_dataSet");j(this,"_dialogReturnInfo");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_resolveDialogResult");this._initializeFlag.value=0,this._partition=r,this._formName=i,n&&(this._configIds=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new e.FormHelper(this._partition,this._formName,this._serviceName)}get Partiton(){return this._partition?this._partition:""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag.value}get FormHelper(){return this._formHelper}get DialogReturnInfo(){return this._dialogReturnInfo}get DataSet(){return this._dataSet}async Initialize(r,i){return new Promise((n,c)=>{r&&r.trim().length>0&&(this._partition=r),i&&i.trim().length>0&&(this._serviceName=i),this._formHelper.Initialize(this._partition,this._formName,this._configIds,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_;d.flag===1?(this._dataSet=this._formHelper.FormDataSet,((_=(m=(p=this._formHelper.ConfigInfo)==null?void 0:p.TSI00FORM)==null?void 0:m.getMappedRows())==null?void 0:_.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM.data[0].FORM_STYLE==="3"?"Fixed":"Sizable"),this._initializeFlag.value=1)):t.messageError("ErPopWindowHelper initialize faild, error msg is ["+d.msg+"]"),n(this._initializeFlag.value)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setEvent(r,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i){return new Promise(async(n,c)=>{r&&this.setEvent("ok",r),i&&this.setEvent("cancel",i),this.InitializeFlag<=0&&await this.Initialize(),this.WindowOpened.value=!0,this._resolveDialogResult={resolve:n,reject:c}})}OpenDialog(r,i){return this.show(r,i)}CloseDialog(){this.WindowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}}e.PopWindowHelper=P;class Ee{static showErPopQuery(r,i,n,c){return i.show(r,n,c)}static showErPopFree(r,i,n,c){return i.show(r,n,c)}static showErPopApprovalSteps(r,i,n){i.showPopApprovalSteps(r,n.partition,n.instanceId,n.companyCode,n.bizBillNo,n.tableName,n.bizData)}}e.PopUtils=Ee;class fe{constructor(){j(this,"_app");j(this,"_partition","");j(this,"_instanceId","");j(this,"_companyCode","");j(this,"_bizBillNo","");j(this,"_tableName","");j(this,"_sysInfoFlag",0);j(this,"_sysInfoMsg","");j(this,"_popWindowOpened",l.ref(!1));j(this,"_isEmpty",l.ref(!0));j(this,"_haveSteps",l.ref(!1));j(this,"_activeSteps",l.ref(0));j(this,"_workStepsInfo",l.ref([]));j(this,"_approveInfo",l.ref([]));j(this,"_approveResultMap",{S:"报批",C:"撤销",Y:"通过",N:"否决",R:"退回"});this.reset()}get Partition(){return this._partition}get InstanceId(){return this._instanceId}get CompanyCode(){return this._companyCode}get BizBillNo(){return this._bizBillNo}get TableName(){return this._tableName}get SysInfoFlag(){return this._sysInfoFlag}get SysInfoMsg(){return this._sysInfoMsg}get HaveSteps(){return this._haveSteps.value}get ActiveSteps(){return this._activeSteps.value}get WorkStepsInfo(){return this._workStepsInfo.value}get ApproveInfo(){return this._approveInfo.value}get IsEmpty(){return this._isEmpty.value}get PopWindowOpened(){return this._popWindowOpened.value}async getApprovalInfo(r,i,n,c,d,p){return new Promise(async(m,_)=>{let E=[],v=[],A=0;this._partition=r,this._instanceId=i,this._companyCode=n,this._bizBillNo=c,this._tableName=d,this._sysInfoFlag=0,this._sysInfoMsg="",p===void 0&&(p={}),p.WF_REC_ID=i,p.BIZ_BILL_NO=c,p.COMPANY_CODE=n,p.TABLE_NAME=d;const B=new ut.EiInfo,Q=t.buildEiBlock([p]);B.addBlock(Q),await t.callService("si00wf_inq",B).then(N=>{var W,J,re,Se,ue;if(e.Core.toNumber((W=N==null?void 0:N.SysInfo)==null?void 0:W.Flag)!==0)this._sysInfoFlag=((J=N==null?void 0:N.SysInfo)==null?void 0:J.Flag)||-1,this._sysInfoMsg=((re=N==null?void 0:N.SysInfo)==null?void 0:re.Msg)||"",t.messageError("获取审批信息出错,业务单据号["+c+"],流程实例["+i+"],错误信息["+this._sysInfoMsg+"]");else if(((Se=N.getBlock("WORKFLOW"))==null?void 0:Se.getMappedRows().length)>0){let me=!1;E=N.getBlock("WORKFLOW").getMappedRows(),E.forEach(Z=>{if(t.toString(Z.EXEC_PERSON).length>0)A++;else if(N.getBlock("EXCUTEUSERINFO")&&!me){let Te=N.getBlock("EXCUTEUSERINFO").getMappedRows().length;Te>5&&(Te=5);let ce="";for(let ze=0;ze<Te;ze++){let Me=t.toString(N.getBlock("EXCUTEUSERINFO").getMappedRows()[ze].USER_NAME);Me=Me.substring(Me.indexOf(":")+1),ce.length===0?ce=Me:ce+=","+Me}Z.EXEC_PERSON=ce,me=!0}else Z.EXEC_PERSON="";if(t.toString(Z.EXEC_DATETIME).length>=14&&Z.EXEC_DATETIME.substring(0,4)!=="1901"){const Te=Z.EXEC_DATETIME;Z.EXEC_DATETIME=Te.substring(0,4)+"-"+Te.substring(4,6)+"-"+Te.substring(6,8)+" "+Te.substring(8,10)+":"+Te.substring(10,12)+":"+Te.substring(12,14)}else Z.EXEC_DATETIME="";Z.title=Z.NODE_NAME,Z.description=Z.EXEC_PERSON+" "+Z.EXEC_DATETIME}),this._haveSteps.value=!0,this._workStepsInfo.value=E,this._activeSteps.value=A}else this._haveSteps.value=!1,this._workStepsInfo.value=[],this._activeSteps.value=-1;((ue=N.getBlock("TSI00APPROVEINFO"))==null?void 0:ue.getMappedRows().length)>0?(N.getBlock("TSI00APPROVEINFO").getMappedRows().forEach(me=>{if(me.APPROVE_RESULT_DESC=this._approveResultMap[me.APPROVE_RESULT]||me.APPROVE_RESULT,me.APPROVE_TIME&&me.APPROVE_TIME.trim().length>=14){const Z=me.APPROVE_TIME;me.APPROVE_TIME=Z.substring(0,4)+"-"+Z.substring(4,6)+"-"+Z.substring(6,8)+" "+Z.substring(8,10)+":"+Z.substring(10,12)+":"+Z.substring(12,14)}}),this._approveInfo.value=v):this._approveInfo.value=[],this._isEmpty.value=!this._haveSteps.value&&v.length===0,m(this)})})}reset(){this._partition="",this._instanceId="",this._companyCode="",this._bizBillNo="",this._tableName="",this._sysInfoFlag=0,this._sysInfoMsg="",this._isEmpty.value=!0,this._haveSteps.value=!1,this._activeSteps.value=0,this._workStepsInfo.value=[],this._approveInfo.value=[]}showPopApprovalSteps(r,i,n,c,d,p,m){this.getApprovalInfo(i,n,c,d,p,m).then(_=>{if(this._app)this._popWindowOpened.value=!0;else{const E=l.createApp(r,{approvalStepsHelperProp:this,formWidth:-1,formHeight:-1});E.component("ag-grid-vue",Pt.AgGridVue),E.component("v-splitter",Ia.Splitpanes),E.component("v-splitter-pane",Ia.Pane),this._app=E;const v=document.createElement("div");document.body.appendChild(v),E.mount(v),this._popWindowOpened.value=!0}})}}e.ApprovalStepsHelper=fe;class H{constructor(r){j(this,"UnMountWhenCloseDialog",!0);j(this,"_app");j(this,"_options",{});j(this,"_popWindowOpened",l.ref(!1));this._options=r||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(r){this._options={...this._options,...r}}showPopAttachment(r){if(this._app)this._options.refreshKey=e.Core.guid(),this._popWindowOpened.value=!0;else{const i=l.createApp(r,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=i;const n=document.createElement("div");document.body.appendChild(n),i.mount(n),this._popWindowOpened.value=!0}}}e.AttachmentHelper=H})(F.ER||(F.ER={}));const $7={style:{display:"inline-block"}},W7=l.defineComponent({name:"ErFormToolbar",components:{"a-button":et.Button,"a-tooltip":et.Tooltip,"a-config-providver":et.ConfigProvider}}),Do=l.defineComponent({...W7,props:{height:{type:String,default:"22px",require:!1},showPageButton:{type:Boolean,default:!0,require:!1},showPrintButton:{type:Boolean,default:!1,require:!1},showRefreshButton:{type:Boolean,default:!0,require:!1},showAddButton:{type:Boolean,default:!0,require:!1},showAddCopyButton:{type:Boolean,default:!0,require:!1},showDeleteButton:{type:Boolean,default:!0,require:!1},showSaveButton:{type:Boolean,default:!0,require:!1}},emits:["toolbarClick"],setup(e,{emit:a}){var T;const t=e,o=a,s=l.ref([]),f=l.ref([{name:"ToolbarFirst",caption:F.ER.Core.$t("ERX.ErFormToolbar.First")||"第一页",icon:l.h(it.StepBackwardOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarPre",caption:F.ER.Core.$t("ERX.ErFormToolbar.Pre")||"上一页",icon:l.h(it.CaretLeftOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarNext",caption:F.ER.Core.$t("ERX.ErFormToolbar.Next")||"下一页",icon:l.h(it.CaretRightOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarLast",caption:F.ER.Core.$t("ERX.ErFormToolbar.Last")||"最后一页",icon:l.h(it.StepForwardOutlined),type:"primary",ontSize:"18px"},{name:"ToolbarPrint",caption:F.ER.Core.$t("ERX.ErFormToolbar.Print")||"打印",icon:l.h(it.PrinterOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarRefresh",caption:F.ER.Core.$t("ERX.ErFormToolbar.Refresh")||"刷新",icon:l.h(it.SyncOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarAdd",caption:F.ER.Core.$t("ERX.ErFormToolbar.Add")||"新增",icon:l.h(it.PlusOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarAddCopy",caption:F.ER.Core.$t("ERX.ErFormToolbar.AddCopy")||"复制新增",icon:l.h(it.CopyOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarDelete",caption:F.ER.Core.$t("ERX.ErFormToolbar.Delete")||"删除",icon:l.h(it.CloseOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarSave",caption:F.ER.Core.$t("ERX.ErFormToolbar.Save")||"保存",icon:l.h(it.CheckOutlined),type:"primary",fontSize:"18px"}]),u=l.ref(yr()),h=l.ref(zt());window.$wujie&&((T=window.$wujie.bus)==null||T.$on("changeThemeEmit",S=>{h.value=zt()}));const C=S=>{o("toolbarClick",{sender:S})};return l.onMounted(()=>{t.showPageButton||s.value.push("ToolbarFirst","ToolbarPre","ToolbarNext","ToolbarLast"),t.showPrintButton||s.value.push("ToolbarPrint"),t.showRefreshButton||s.value.push("ToolbarRefresh"),t.showAddButton||s.value.push("ToolbarAdd"),t.showAddCopyButton||s.value.push("ToolbarAddCopy"),t.showDeleteButton||s.value.push("ToolbarDelete"),t.showSaveButton||s.value.push("ToolbarSave")}),(S,x)=>{const y=l.resolveComponent("a-button"),O=l.resolveComponent("a-tooltip"),D=l.resolveComponent("a-config-providver");return l.openBlock(),l.createElementBlock("div",$7,[l.createVNode(D,{theme:h.value,locale:u.value,componentSize:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,I=>(l.openBlock(),l.createBlock(O,{key:I.name+"tooltip",title:I.caption},{default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createBlock(y,{key:I.name,id:I.name,icon:I.icon,type:I.type,onClick:M=>C(I),style:{padding:"1px 5px !important",margin:"1px","font-size":"13px"}},null,8,["id","icon","type","onClick"])),[[l.vShow,s.value.length>0?!(s.value.findIndex(M=>M===I.name)>=0):!0]])]),_:2},1032,["title"]))),128))]),_:1},8,["theme","locale"])])}}});function Bs(){var s;const e=l.getCurrentInstance();let a=e==null?void 0:e.appContext.config.globalProperties.$t;const t=e==null?void 0:e.appContext.config.globalProperties.hasOwnProperty("$t"),o=(s=ni==null?void 0:ni.global)==null?void 0:s.hasOwnProperty("t");if(!t&&o&&(a=ni.global.t),!t&&!o){const f=require("../../locales/erLocale/locale.zh_Hans.ts"),u=Object.keys(f)[0];a=h=>h.split(".").reduce((S,x)=>S?S[x]:void 0,f[u].default)}return{$t:a}}let On;const Y7=new Uint8Array(16);function X7(){if(!On&&(On=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!On))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return On(Y7)}const Ir=[];for(let e=0;e<256;++e)Ir.push((e+256).toString(16).slice(1));function Q7(e,a=0){return Ir[e[a+0]]+Ir[e[a+1]]+Ir[e[a+2]]+Ir[e[a+3]]+"-"+Ir[e[a+4]]+Ir[e[a+5]]+"-"+Ir[e[a+6]]+Ir[e[a+7]]+"-"+Ir[e[a+8]]+Ir[e[a+9]]+"-"+Ir[e[a+10]]+Ir[e[a+11]]+Ir[e[a+12]]+Ir[e[a+13]]+Ir[e[a+14]]+Ir[e[a+15]]}const Hs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function q7(e,a,t){if(Hs.randomUUID&&!e)return Hs.randomUUID();e=e||{};const o=e.random||(e.rng||X7)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Q7(o)}const j7=l.defineComponent({name:"ErPanel",components:{CaretUpOutlined:it.CaretUpOutlined,CaretDownOutlined:it.CaretDownOutlined},props:{showHeader:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!0},flex:{type:Number||String,default:1},title:{type:String,default:""},height:{type:String,default:"auto",require:!1},padding:{type:String,default:"5px",require:!1},innerPadding:{type:String,default:"5px",require:!1},openHeaderShow:{type:Boolean,default:!1,require:!1},id:{type:String,default:`ef_panel_${q7()}`,require:!1},menuFormInstance:{type:Object,default:void 0,require:!1},buttonRegionId:{type:String,default:"",require:!1},isCollapsed:{type:Boolean,default:!1,require:!1}},emits:["queryClick","openHeaderChange","authButtonClick"],setup(e,{emit:a}){const{$t:t}=Bs(),o=l.ref([]),s=l.ref(!(e.isCollapsed&&e.openHeaderShow)),f=()=>{a("queryClick")},u=l.computed(()=>`${e.id}_query`),h=l.ref(e.isCollapsed&&e.openHeaderShow?"flex: none":typeof e.flex=="number"?`flex: ${e.flex}; overflow: hidden`:`flex: ${e.flex}; overflow: auto`),C=l.ref(e.isCollapsed&&e.openHeaderShow?"height: auto":`height: ${e.height}`),T=()=>{s.value=!s.value,h.value=s.value?`flex: ${e.flex}; overflow: hidden`:"flex: none",C.value=s.value?`height: ${e.height}`:"height: auto",a("openHeaderChange",s.value)},S=x=>{a("authButtonClick",x)};return l.onBeforeMount(()=>{var x,y,O,D,I;if((y=(x=e.menuFormInstance)==null?void 0:x.attrs)!=null&&y.__buttonsEi){const M=e.buttonRegionId||e.id;o.value=((I=(D=(O=e.menuFormInstance)==null?void 0:O.attrs)==null?void 0:D.__buttonsEi.getBlock(M))==null?void 0:I.getMappedRows())||[]}}),{tI18n:t,openHeader:s,flexStyle:h,heightStyle:C,searchButtonId:u,query:f,openHeaderChange:T,onAuthButtonClick:S,layoutAuthButtons:o}}}),K7=["id"],J7={key:0,class:"card-header"},Z7={class:"header-title"},eh={class:"header-right"},th={class:"customBtn"},rh={class:"openHeader"},ah={class:"body-content"};function ih(e,a,t,o,s,f){const u=l.resolveComponent("a-button"),h=l.resolveComponent("CaretDownOutlined"),C=l.resolveComponent("CaretUpOutlined");return l.openBlock(),l.createElementBlock("div",{class:"erpanel-root",id:e.id,style:l.normalizeStyle(`padding: ${e.padding}; ${e.flexStyle}; ${e.heightStyle};`)},[l.createElementVNode("div",{class:l.normalizeClass(["form-container erpanel-card",{"erpanel-border":e.showBorder}])},[e.showHeader?(l.openBlock(),l.createElementBlock("div",J7,[l.createElementVNode("div",Z7,l.toDisplayString(e.title?e.title:e.tI18n("ERX.Title")),1),l.createElementVNode("div",eh,[l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.layoutAuthButtons,T=>(l.openBlock(),l.createBlock(u,{style:{height:"21px",padding:"1px 5px !important",margin:"1px","font-size":"13px"},key:T.button_ename,name:T.button_ename,type:"primary",onClick:S=>e.onAuthButtonClick({buttonInfo:T,buttonName:T.button_ename,buttonCaption:T.button_cname})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T.button_cname),1)]),_:2},1032,["name","onClick"]))),128))]),l.createElementVNode("div",th,[l.renderSlot(e.$slots,"customButtonSlot")]),l.withDirectives(l.createElementVNode("div",rh,[e.openHeader?(l.openBlock(),l.createBlock(h,{key:0,style:{"font-size":"13px"},onClick:e.openHeaderChange},null,8,["onClick"])):(l.openBlock(),l.createBlock(C,{key:1,style:{"font-size":"13px"},onClick:e.openHeaderChange},null,8,["onClick"]))],512),[[l.vShow,e.openHeaderShow]])])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["card-body",e.showHeader?"haveHeaderHeight":"noHeaderHeight"]),style:l.normalizeStyle(`padding: ${e.innerPadding};`)},[l.withDirectives(l.createElementVNode("div",ah,[l.renderSlot(e.$slots,"contentSlot")],512),[[l.vShow,e.openHeader]])],6)],2)],12,K7)}const Dr=sr(j7,[["render",ih]]),nh=l.defineComponent({props:{sameApp:{type:Boolean,required:!0},formName:{type:String,default:""},sameAppformName:{type:String,default:""},parentFormRef:{type:Object,default:null},modalZIndex:{type:Number,default:1e3},title:{type:String,default:""},width:{type:[String,Number],default:"50%"},height:{type:[String,Number],default:"50%"},message:{type:Object,default:()=>({})},destroy:{type:Function,default:()=>{}},debounce:{type:Boolean,default:!1},debounceWait:{type:Number,default:200},defaultWidth:{type:[String,Number],default:"50%"},defaultHeight:{type:[String,Number],default:"50%"},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},actions:{type:Array,default:["maximize","close"]}},components:{},emits:["clickClose","formResize","open"],setup(e,{emit:a}){const t=l.ref(),o=l.ref(),s=l.ref(),f=l.ref({x:0,y:0});l.ref({x:0,y:0});const u=l.ref(!1),h=l.ref({startX:0,startY:0,width:0,height:0,left:0,top:0}),C=l.ref(!1),T=l.ref(""),S=l.ref(!1),x=l.ref(""),y=l.ref(null);l.ref(!1);const O=l.ref(null),D=l.ref(""),I=l.computed(()=>{var r,i;return e.sameApp?{}:{prefix:(i=(r=window.$wujie)==null?void 0:r.props)==null?void 0:i.prefix,toSubPage:e.message,toXrEfForm:{showCloseEfDialogFormButton:!0}}}),M=l.computed(()=>{var r,i,n,c;return e.sameAppformName?`${(i=(r=he.value)==null?void 0:r[0])==null?void 0:i.DESCRIPTION}[${e.sameAppformName}]`:`${(c=(n=he.value)==null?void 0:n[0])==null?void 0:c.DESCRIPTION}[${e.formName}]`}),G=()=>{t.value&&a("formResize")},te=e.debounce?new ResizeObserver(qs.debounce(G,e.debounceWait)):new ResizeObserver(G),b=new IntersectionObserver(r=>{r[0].intersectionRatio>0&&e.parentFormRef&&S.value&&setTimeout(()=>{window.removeEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0)},1)}),P=()=>{e.parentFormRef&&b.observe(e.parentFormRef.value.$el)},Ee=()=>{e.parentFormRef&&b.unobserve(e.parentFormRef.value.$el)},fe=r=>{},H=async()=>{S.value=!0,l.nextTick(()=>{a("open"),te.observe(t.value)}),e.sameApp?e.sameAppformName&&z(e.sameAppformName):(P(),e.parentFormRef&&window.removeEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0)),l.nextTick(()=>{var r,i,n;e.draggable&&((r=s.value)==null||r.addEventListener("mousedown",ve)),e.resizable&&((i=t.value)==null||i.addEventListener("mousedown",$e),(n=t.value)==null||n.addEventListener("mousemove",Ke))})},oe=()=>{var r,i,n;(r=s.value)==null||r.removeEventListener("mousedown",ve),(i=t.value)==null||i.removeEventListener("mousedown",$e),(n=t.value)==null||n.removeEventListener("mousemove",Ke),document==null||document.removeEventListener("mousemove",Ke),document==null||document.removeEventListener("mouseup",X)},R=()=>{Ee(),t.value&&te.unobserve(t.value),e.sameApp?(oe(),S.value=!1):(e.parentFormRef&&window.addEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0),e.destroy(()=>{oe(),S.value=!1},()=>{}))},K=()=>{a("clickClose"),R()},he=l.ref(),z=async r=>l.ref("").value,Ie=l.ref({zIndex:e.modalZIndex+1,width:"",height:"",top:"",left:""}),Ne=l.ref(e.width==="100%"&&e.height==="100%"),xe=()=>{if(Ne.value=!Ne.value,Ne.value)Ie.value.left="0",Ie.value.top="0",Ie.value.width="100%",Ie.value.height="100%";else{if(e.width==="100%"&&e.height==="100%"){const r=e.defaultWidth?e.defaultWidth==="100%"?"50%":e.defaultWidth:"50%",i=e.defaultHeight?e.defaultHeight==="100%"?"50%":e.defaultHeight:"50%";return Le(r,i),!1}Le()}},Le=(r,i)=>{let n="",c="",d="",p="";const m=r||e.width,_=i||e.height;if(typeof m=="string"){if(m.includes("%")){const E=+m.split("%")[0];n=E+"vw",p=`calc(50vw - ${E/2}vw)`}else if(m.includes("px")){const E=+m.split("px")[0];n=E+"px",p=`calc(50vw - ${E/2}px)`}}else typeof m=="number"&&(n=m+"px",p=`calc(50vw - ${m/2}px)`);if(typeof _=="string"){if(_.includes("%")){const E=+_.split("%")[0];c=E+"vh",d=`calc(50vh - ${E/2}vh)`}else if(_.includes("px")){const E=+_.split("px")[0];c=E+"px",d=`calc(50vh - ${E/2}px)`}}else typeof _=="number"&&(c=_+"px",d=`calc(50vh - ${_/2}px)`);Ie.value.left=p,Ie.value.top=d,Ie.value.width=n,Ie.value.height=c};Le();const ve=r=>{u.value=!0,f.value.x=r.clientX-t.value.offsetLeft,f.value.y=r.clientY-t.value.offsetTop,document.addEventListener("mousemove",Ge),document.addEventListener("mouseup",_e)},Ge=r=>{if(!u.value||C.value)return;const i=r.clientX-f.value.x,n=r.clientY-f.value.y;t.value.style.left=i+"px",t.value.style.top=n+"px",y.value&&(y.value.style.pointerEvents="none")},_e=r=>{u.value=!1,y.value&&(y.value.style.pointerEvents="auto")},$e=r=>{let i=pe(r);i!==""&&(C.value=!0,T.value=i,h.value.startX=r.clientX,h.value.startY=r.clientY,h.value.width=t.value.offsetWidth,h.value.height=t.value.offsetHeight,h.value.left=t.value.offsetLeft,h.value.top=t.value.offsetTop),C.value&&(document.body.style.userSelect="none"),document.addEventListener("mousemove",Ke),document.addEventListener("mouseup",X)},Ke=r=>{const i=pe(r);let n;if(i===""?n="default":n=i+"-resize",!!t.value&&(t.value.style.cursor=n,C.value)){if(y.value&&(y.value.style.pointerEvents="none"),T.value.indexOf("e")!==-1){const c=r.clientX-h.value.startX;t.value.style.width=h.value.width+c+"px",t.value.style.left=h.value.left+"px"}if(T.value.indexOf("w")!==-1){const c=r.clientX-h.value.startX;t.value.style.left=h.value.left+c+"px",t.value.style.width=h.value.width-c+"px"}if(T.value.indexOf("n")!==-1){const c=r.clientY-h.value.startY;t.value.style.top=h.value.top+c+"px",t.value.style.height=h.value.height-c+"px"}if(T.value.indexOf("s")!==-1){const c=r.clientY-h.value.startY;t.value.style.height=h.value.height+c+"px",t.value.style.top=h.value.top+"px"}}},X=()=>{y.value&&(y.value.style.pointerEvents="auto"),C.value=!1,C.value||(document.body.style.userSelect="auto")},pe=r=>{var n,c,d;let i="";return r.target.className.indexOf?(r.target.className.indexOf("top")>=0?i+="n":((n=r.target.className)==null?void 0:n.indexOf("bottom"))>=0&&(i+="s"),((c=r.target.className)==null?void 0:c.indexOf("left"))>=0?i+="w":((d=r.target.className)==null?void 0:d.indexOf("right"))>=0&&(i+="e"),i):""};return l.onMounted(()=>{}),l.onBeforeUnmount(()=>{Ee()}),l.onUnmounted(()=>{}),{beforeUnmount:fe,getDialogTitle:M,wujieProps:I,wujieAppName:D,wujieContainer:O,iframeRef:y,erDialogBaseStyle:Ie,dialogVisible:S,open:H,close:R,wujieAppUrl:x,clickCloseIcon:K,dialogHeaderRef:s,dialogContRef:t,dialogRef:o,isMaximine:Ne,changeMaxMin:xe,setEfDialogFormStyle:Le}}}),oh={class:"xr-er-dialog__content"},lh={style:{height:"100%",overflow:"auto"}},sh={key:0,class:"xr-er-dialog__footer"},ch={key:1,class:"er-dialog-form__content"};function dh(e,a,t,o,s,f){return l.withDirectives((l.openBlock(),l.createElementBlock("div",{ref:"dialogContRef",style:l.normalizeStyle(e.erDialogBaseStyle),class:l.normalizeClass(e.sameApp?"xr-er-dialog":"er-dialog-form")},[l.createElementVNode("div",{class:l.normalizeClass(e.sameApp?"xr-er-dialog__body":"er-dialog-form_body")},[l.createElementVNode("div",{ref:"dialogHeaderRef",class:l.normalizeClass(e.sameApp?"xr-er-dialog__header":"er-dialog-form__header"),style:l.normalizeStyle({cursor:e.draggable?"move":"pointer"})},[l.createElementVNode("div",null,[e.sameApp?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(e.title?e.title:e.getDialogTitle)+" ",1),l.renderSlot(e.$slots,"title")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.title?e.title:e.getDialogTitle),1)],64))]),l.createElementVNode("div",null,[e.actions.includes("maximize")?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["iconfont header-icon-button",e.isMaximine?"icon-compress":"icon-expend"]),onClick:a[0]||(a[0]=(...u)=>e.changeMaxMin&&e.changeMaxMin(...u))},null,2)):l.createCommentVNode("",!0),e.actions.includes("close")?(l.openBlock(),l.createElementBlock("span",{key:1,class:"iconfont header-icon-button icon-close",onClick:a[1]||(a[1]=(...u)=>e.clickCloseIcon&&e.clickCloseIcon(...u))})):l.createCommentVNode("",!0)])],6),e.sameApp?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",oh,[l.createElementVNode("div",lh,[l.renderSlot(e.$slots,"content")])]),e.$slots.footer?(l.openBlock(),l.createElementBlock("div",sh,[l.renderSlot(e.$slots,"footer")])):l.createCommentVNode("",!0)],64)):(l.openBlock(),l.createElementBlock("div",ch))],2),a[2]||(a[2]=l.createStaticVNode('<div class="resize-bar top"></div><div class="resize-bar right"></div><div class="resize-bar bottom"></div><div class="resize-bar left"></div><div class="resize-point top-right"></div><div class="resize-point top-left"></div><div class="resize-point bottom-right"></div><div class="resize-point bottom-left"></div>',8))],6)),[[l.vShow,e.dialogVisible]])}const fh=sr(nh,[["render",dh]]),uh=l.defineComponent({components:{dialogBase:fh},props:{debounce:{type:Boolean,default:!1},debounceWait:{type:Number,default:200},visible:{type:Boolean,required:!0},title:{type:String,default:""},width:{type:[String,Number],default:"50%"},height:{type:[String,Number],default:"50%"},modal:{type:Boolean,default:!0},defaultFooter:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!0},showConfirm:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},parentFormRef:{type:Object,default:null},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},actions:{type:Array,default:["maximize","close"]},id:{type:String,default:""},customClass:{type:String,default:""},formName:{type:String,default:""}},emits:["update:visible","clickCloseIcon","confirm","cancel","dialogResize","open"],setup(e,{emit:a}){const{$t:t}=Bs(),o=l.ref(!0),s=l.ref(900),f=l.ref(null),u=l.ref(null),h=l.ref(e.width),C=l.ref(e.height),T=()=>{const te=document.querySelectorAll(".xr-er-dialog__wrapper"),b=document.querySelectorAll(".er-dialog-form__wrapper");if(te.length||b.length){const P=[];return[...te,...b].forEach(Ee=>{P.push(Ee.style.zIndex)}),Math.max(...P)+1}else return s.value},S=new IntersectionObserver(te=>{te[0].intersectionRatio>0&&e.parentFormRef&&e.visible&&setTimeout(()=>{window.removeEventListener("keydown",e.parentFormRef.handleKeyDown,!0)},1)}),x=()=>{e.parentFormRef&&S.observe(e.parentFormRef.$el)},y=()=>{e.parentFormRef&&S.unobserve(e.parentFormRef.$el)};l.watch(()=>e.visible,(te,b)=>{var P,Ee;if(e.visible)s.value=T(),x(),e.parentFormRef&&window.removeEventListener("keydown",e.parentFormRef.handleKeyDown,!0),e.destroyOnClose?(o.value=!0,s.value=T()):f.value.setEfDialogFormStyle(),l.nextTick(()=>{var fe;(fe=f.value)==null||fe.open()});else if(e.parentFormRef&&window.addEventListener("keydown",e.parentFormRef.handleKeyDown,!0),(P=f.value)==null||P.close(),e.destroyOnClose)o.value=!1;else if((Ee=f.value)==null||Ee.setEfDialogFormStyle(),f.value){const fe=f.value.$el.style.width,H=f.value.$el.style.height;h.value=fe.includes("vw")?fe.replace("vw","%"):fe,C.value=H.includes("vh")?H.replace("vh","%"):H}else h.value=e.width},{immediate:!0});const O=()=>{a("open")},D=()=>{a("update:visible",!1),a("clickCloseIcon")},I=()=>{a("confirm")},M=()=>{a("cancel")},G=()=>{a("dialogResize")};return l.onMounted(()=>{}),l.onBeforeUnmount(()=>{y()}),l.onUnmounted(()=>{}),{tI18n:t,dialogHeight:C,dialogWidth:h,isRender:o,dialogBaseRef:f,xrEfDialogRef:u,onClickClose:D,dialogZIndex:s,confirmClick:I,cancelClick:M,dialogResize:G,onOpen:O}}}),hh=["id"];function ph(e,a,t,o,s,f){const u=l.resolveComponent("dialog-base");return e.isRender?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.withDirectives(l.createElementVNode("div",{class:"xr-er-dialog__modal",style:l.normalizeStyle({"z-index":e.dialogZIndex})},null,4),[[l.vShow,e.visible&&e.modal]]),l.withDirectives(l.createElementVNode("div",{ref:"xrEfDialogRef",class:l.normalizeClass(["xr-er-dialog__wrapper",e.customClass]),id:e.id,style:l.normalizeStyle({"z-index":e.dialogZIndex})},[l.createVNode(u,{ref:"dialogBaseRef",sameApp:!0,modalZIndex:e.dialogZIndex,title:e.title?e.title:"",sameAppformName:e.formName,width:e.dialogWidth,height:e.dialogHeight,defaultWidth:e.width,defaultHeight:e.height,debounce:e.debounce,debounceWait:e.debounceWait,xrEfDialogDefaultFooter:e.defaultFooter,resizable:e.resizable,draggable:e.draggable,actions:e.actions,onClickClose:e.onClickClose,onFormResize:e.dialogResize,onOpen:e.onOpen},l.createSlots({title:l.withCtx(()=>[l.renderSlot(e.$slots,"title",{},void 0,!0)]),content:l.withCtx(()=>[l.renderSlot(e.$slots,"default",{},void 0,!0)]),_:2},[e.$slots["footer-left"]||e.$slots["footer-right"]||e.defaultFooter?{name:"footer",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"footer-left",{},void 0,!0),e.defaultFooter?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[e.showConfirm?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:a[0]||(a[0]=(...h)=>e.confirmClick&&e.confirmClick(...h))},l.toDisplayString(e.tI18n("ERX.confirm")),1)):l.createCommentVNode("",!0),e.showCancel?(l.openBlock(),l.createElementBlock("button",{key:1,class:"xr-er-button",onClick:a[1]||(a[1]=(...h)=>e.cancelClick&&e.cancelClick(...h))},l.toDisplayString(e.tI18n("ERX.cancel")),1)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),l.renderSlot(e.$slots,"footer-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["modalZIndex","title","sameAppformName","width","height","defaultWidth","defaultHeight","debounce","debounceWait","xrEfDialogDefaultFooter","resizable","draggable","actions","onClickClose","onFormResize","onOpen"])],14,hh),[[l.vShow,e.visible]])],64)):l.createCommentVNode("",!0)}const Oa=sr(uh,[["render",ph],["__scopeId","data-v-9d9eb986"]]),mh=l.defineComponent({name:"ToolbarPanel",props:["params"],components:{"a-config-providver":et.ConfigProvider,"a-tooltip":et.Tooltip,"a-button":et.Button},setup(e){const a=l.ref(yr()),t=l.ref(zt()),o=l.ref("icon"),s=C=>{o.value=C},f=()=>{var D,I,M,G,te,b,P,Ee,fe,H,oe,R,K,he;let C=["save"],T=(D=e.params)==null?void 0:D.configId;const S=(G=(I=e.params)==null?void 0:I.formHelper)==null?void 0:G.getSingleViewConfigInfo((M=e.params)==null?void 0:M.configId);if(((te=S.EXT_OPTIONS)==null?void 0:te.trim().length)>0){const z=JSON.parse(S.EXT_OPTIONS);((b=z.buttonRegionId)==null?void 0:b.trim().length)>0&&(T=z.buttonRegionId),z.defaultAuthButtons instanceof Array?C=z.defaultAuthButtons:z.defaultAuthButtons instanceof String&&(C=z.defaultAuthButtons.split(","))}const x=(fe=(P=e.params)==null?void 0:P.formHelper)==null?void 0:fe.GridToolbarOptions[(Ee=e.params)==null?void 0:Ee.configId],y=(x==null?void 0:x.defaultButtons)||[{name:"refresh",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Refresh")||"刷新",icon:l.h(it.SyncOutlined),type:"primary",isAuthButton:C.includes("refresh")},{name:"addrow",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.AddRow")||"新增行",icon:l.h(it.PlusOutlined),type:"primary",isAuthButton:C.includes("addrow")},{name:"copyrow",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.CopyRow")||"复制行",icon:l.h(it.CopyOutlined),type:"primary",isAuthButton:C.includes("copyrow")},{name:"delete",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Delete")||"删除行",icon:l.h(it.CloseOutlined),type:"primary",isAuthButton:C.includes("delete")},{name:"save",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Save")||"保存",icon:l.h(it.CheckOutlined),type:"primary",isAuthButton:C.includes("save")},{name:"cancel",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Cancel")||"撤销",icon:l.h(it.UndoOutlined),type:"primary",isAuthButton:C.includes("cancel")},{name:"excel",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Export")||"导出",icon:l.h(it.FileExcelOutlined),type:"primary",isAuthButton:C.includes("excel")},{name:"import",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Import")||"导入",icon:l.h(it.UploadOutlined),type:"primary",isAuthButton:C.includes("import")}],O=(oe=(H=e.params)==null?void 0:H.formHelper)==null?void 0:oe.FormAuthButtons[T];return O&&O.length>0&&O.forEach(z=>{var Ie,Ne,xe;(xe=(Ie=e.params)==null?void 0:Ie.formHelper)==null||xe.setGridToolbarVisible((Ne=e.params)==null?void 0:Ne.configId,{[z.button_ename]:!0}),y.push({name:z.button_ename,caption:z.button_cname,type:"primary",showText:!0,isAuthButton:!0})}),C.forEach(z=>{var Ne,xe,Le;const Ie=O.find(ve=>ve.name===z);(Le=(Ne=e.params)==null?void 0:Ne.formHelper)==null||Le.setGridToolbarVisible((xe=e.params)==null?void 0:xe.configId,{[z]:Ie})}),((K=(R=e.params)==null?void 0:R.customButtons)==null?void 0:K.length)>0&&((he=e.params)==null||he.customButtons.forEach(z=>{var Ie,Ne,xe,Le,ve,Ge;if(((Ie=z.name)==null?void 0:Ie.trim().length)>0&&((Ne=z.caption)==null?void 0:Ne.trim().length)>0){const _e={};_e[(xe=z.name)==null?void 0:xe.trim()]=z.visible,(Ge=(Le=e.params)==null?void 0:Le.formHelper)==null||Ge.setGridToolbarVisible((ve=e.params)==null?void 0:ve.configId,_e),y.push({...z,icon:l.h(it.MoreOutlined),type:"primary",showText:z.showText!==!1,isAuthButton:!1})}})),y},u=(C,T)=>{var x,y,O;const S=(O=(x=e.params)==null?void 0:x.formHelper)==null?void 0:O.GridToolbarOptions[(y=e.params)==null?void 0:y.configId];if(S&&S[C]&&S[C][T]!==void 0)return l.isRef(S[C][T])?S[C][T].value:S[C][T]},h=async C=>{var T,S,x;if(C.isAuthButton){const y=u("authButtonAction","action");y&&y({...C,params:e.params})}else{let y=!1,O=C.action,D=!1;const I={};e.params[C.name]?(O=e.params[C.name].action,y=e.params[C.name].preventDefault,D=e.params[C.name].messageConfirm):O||(O=u(C.name,"action"),y=u(C.name,"preventDefault"),D=u(C.name,"messageConfirm")),(x=(T=e.params)==null?void 0:T.formHelper)==null||x.stopGridEditing((S=e.params)==null?void 0:S.configId,async()=>{var M,G,te,b,P,Ee,fe,H,oe,R,K,he,z,Ie,Ne,xe,Le,ve,Ge,_e,$e,Ke,X,pe,r,i,n,c,d,p,m,_,E,v,A,B,Q,N,W,J,re,Se;if(y!==!0)switch(C.name){case"refresh":case"cancel":{if((te=(M=e.params)==null?void 0:M.formHelper)!=null&&te.hasDataChange((G=e.params)==null?void 0:G.configId)){if(D!==!1&&!await((P=(b=e.params)==null?void 0:b.formHelper)==null?void 0:P.messageConfirm(`${F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.MessageConfirm")||"确认"}${C.caption}?`)))return;(H=(Ee=e.params)==null?void 0:Ee.formHelper)==null||H.cancelGridChange((fe=e.params)==null?void 0:fe.configId)}break}case"addrow":{const ue=(K=(oe=e.params)==null?void 0:oe.formHelper)==null?void 0:K.addRowToGrid((R=e.params)==null?void 0:R.configId);ue&&(I.models=[ue]);break}case"copyrow":{I.models=(Ie=(he=e.params)==null?void 0:he.formHelper)==null?void 0:Ie.addCopyRowToGrid((z=e.params)==null?void 0:z.configId);break}case"delete":{if(((Le=(Ne=e.params)==null?void 0:Ne.formHelper)==null?void 0:Le.getGridSelectRows((xe=e.params)==null?void 0:xe.configId)).length>0){if(D!==!1&&!await((Ge=(ve=e.params)==null?void 0:ve.formHelper)==null?void 0:Ge.messageConfirm(`${F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.MessageConfirm")||"确认"}${C.caption}?`)))return;I.models=(Ke=(_e=e.params)==null?void 0:_e.formHelper)==null?void 0:Ke.deleteGridRows(($e=e.params)==null?void 0:$e.configId)}break}case"excel":{const ue=(X=e.params)==null?void 0:X.formHelper.FormName,me=(pe=e.params)==null?void 0:pe.formHelper.FormCaption,Z=(i=e.params)==null?void 0:i.formHelper.getGrid((r=e.params)==null?void 0:r.configId),Te={fileName:`${(n=e.params)==null?void 0:n.formHelper.FormName}-${F.ER.Core.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,exportData:(d=(c=Z==null?void 0:Z.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource,header:{titleType:"both"}},ce=(m=e.params)==null?void 0:m.formHelper.getGridOptions((p=e.params)==null?void 0:p.configId,"excel");(ce==null?void 0:ce.fileName.trim().length)>0?Te.fileName=ce==null?void 0:ce.fileName.trim():Te.fileName=(E=(_=e.params)==null?void 0:_.formHelper)==null?void 0:E.getFormSysInfo("GRIDEXPORTFILENAME"),Te.fileName=(Te.fileName||"{formName}-{dateNow}").replace("{formName}",ue).replace("{formCaption}",me).replace("{dateNow}",F.ER.Core.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")),(v=ce==null?void 0:ce.header)!=null&&v.titleType&&(Te.header.titleType=(A=ce==null?void 0:ce.header)==null?void 0:A.titleType);const ze=Me=>{e.params.api.exportDataAsExcel({fileName:Te.fileName,sheetName:(Me==null?void 0:Me.sheetName)||"Sheet1",author:F.ER.SysInfo.UserId,skipPinnedBottom:!0,onlySelected:Me==null?void 0:Me.selectedRows,skipRowGroups:Me==null?void 0:Me.skipGroupRows,skipColumnGroupHeaders:Me==null?void 0:Me.skipBandRows,processHeaderCallback:ge=>{var le,Y;return((Y=(le=ge.column.colDef)==null?void 0:le.headerName)==null?void 0:Y.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:ge=>!!(Me!=null&&Me.skipSummaryRows&&ge.node.footer===!0&&ge.node.group===!0&&ge.node.level>=0||Me!=null&&Me.skipFooterRows&&ge.node.footer===!0&&ge.node.group===!0&&ge.node.level<0),processCellCallback:ge=>{var le,Y,Fe,ke,Ve,at;return ge.node.group&&ge.node.footer!==!0?(le=ge.column.colDef)!=null&&le.rowGroup&&ge.node.key?((Y=ge.column.colDef.refData)==null?void 0:Y[ge.node.key])||ge.node.key:ge.formatValue(ge.value):ge.value&&Wr.isPlainObject(ge.value)&&ge.formatValue instanceof Function?ge.formatValue(ge.value):((ke=(Fe=ge.column.colDef)==null?void 0:Fe.context)==null?void 0:ke.dataType)==="number"&&(Me==null?void 0:Me.numberAsText)!==!0?ge.value:((at=(Ve=ge.column.colDef)==null?void 0:Ve.context)==null?void 0:at.dataType)==="boolean"?ge.value?"1":"0":ge.formatValue(ge.value)}})};if(e.params.api.getDisplayedRowCount()===0)ze();else{const Me=[{label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"}];((B=F.ER.Core.getGridRows(Z,"checkedAfterFilter"))==null?void 0:B.length)>0&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),((N=(Q=Z.gridOptions.context)==null?void 0:Q.options)==null?void 0:N.viewType)==="BandView"&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),Z.gridOptions.columnApi.getRowGroupColumns().length>0&&(Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"})),((J=(W=Z.gridOptions.context)==null?void 0:W.viewConfig)==null?void 0:J.SHOW_FOOTER)==="1"&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),F.ER.Core.openSelectOptionsModal({title:F.ER.Core.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:Me,default:{checkboxOptions:["skipSummaryRows"]}},ge=>{ze({selectedRows:ge.checkboxes.some(le=>le==="selectedRows"),numberAsText:ge.checkboxes.some(le=>le==="numberAsText"),skipBandRows:ge.checkboxes.some(le=>le==="skipBandRows"),skipGroupRows:ge.checkboxes.some(le=>le==="skipGroupRows"),skipSummaryRows:ge.checkboxes.some(le=>le==="skipSummaryRows"),skipFooterRows:ge.checkboxes.some(le=>le==="skipFooterRows")})})}break}case"import":{const ue=(Se=e.params)==null?void 0:Se.formHelper.getGrid((re=e.params)==null?void 0:re.configId);F.ER.Core.importExcelFile(ue,void 0,me=>{I.models=me});break}}O&&typeof O=="function"&&O(I)})}};return{ER:F.ER,antdTheme:t,antdLocale:a,getDefaultButtons:f,getToolbarOption:u,toolbarClick:h,toolbarStyle:o,setToolbarStyle:s}}}),gh={style:{display:"inline-block"}};function Eh(e,a,t,o,s,f){const u=l.resolveComponent("a-button"),h=l.resolveComponent("a-tooltip"),C=l.resolveComponent("a-config-providver");return l.openBlock(),l.createElementBlock("div",gh,[l.createVNode(C,{theme:e.antdTheme,locale:e.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.getDefaultButtons(),T=>(l.openBlock(),l.createBlock(h,{key:T.name+"tooltip",title:T.caption},{default:l.withCtx(()=>{var S;return[e.getToolbarOption(T.name,"visible")?(l.openBlock(),l.createBlock(u,{key:T.name,id:T.name,icon:((S=e.params)==null?void 0:S.showIco)!==!1?T.icon:void 0,type:T.type||"primary",onClick:x=>e.toolbarClick(T),style:{height:"20px",padding:"0px 5px",margin:"1px","font-size":"13px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T.showText||e.toolbarStyle==="text"||e.toolbarStyle==="both"?T.caption:""),1)]),_:2},1032,["id","icon","type","onClick"])):l.createCommentVNode("",!0)]}),_:2},1032,["title"]))),128))]),_:1},8,["theme","locale"])])}const Ch=sr(mh,[["render",Eh]]),_h=l.defineComponent({name:"PaginationPanel",props:["params"],setup(e){var b,P,Ee;const a=l.ref(((b=e.params.pageOptions)==null?void 0:b.pageSize)||100),t=l.ref(((Ee=(P=e.params.pageOptions)==null?void 0:P.pageSizes)==null?void 0:Ee.length)>0?e.params.pageOptions.pageSizes:[10,50,100,200,500,1e3]),o=l.ref(0),s=l.ref(1),f=l.ref(1),u=e.params.api,h=l.ref(!0),C=l.ref(!0),T=l.ref(!0),S=l.ref(!0),x=()=>{h.value=f.value===1,C.value=f.value===1,T.value=f.value===s.value,S.value=f.value===s.value},y=fe=>{var H,oe;if(((H=e.params.pageOptions)==null?void 0:H.pagination)==="server")o.value=(fe==null?void 0:fe.totalCount)||0,a.value=(fe==null?void 0:fe.pageSize)||a.value,s.value=Math.ceil(o.value/a.value)||1,(fe==null?void 0:fe.currentPage)<=0?f.value=1:(fe==null?void 0:fe.currentPage)>s.value?f.value=s.value:f.value=fe==null?void 0:fe.currentPage;else{let R=0;const K=(oe=e.params.formHelper)==null?void 0:oe.getBindingTable(e.params.configId);K&&(R=K.rowCount||0),o.value=R,s.value=u.paginationGetTotalPages()||1,f.value=u.paginationGetCurrentPage()+1,a.value=u.paginationGetPageSize()}x()},O=()=>{var fe,H,oe,R,K;f.value>1&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToFirstPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,1))},D=()=>{var fe,H,oe,R,K;f.value<s.value&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToLastPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,s.value))},I=()=>{var fe,H,oe,R,K;f.value>1&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToPreviousPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value-1))},M=()=>{var fe,H,oe,R,K;f.value<s.value&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToNextPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value+1))},G=()=>{var fe,H,oe,R,K;((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToPage(f.value-1):((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value)},te=()=>{var fe,H,oe,R,K,he,z;if(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client")u.paginationSetPageSize(a.value);else if(((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"){const Ie=e.params.formHelper.getGrid(e.params.configId);(z=(he=Ie==null?void 0:Ie.gridOptions)==null?void 0:he.context)!=null&&z.pageOptions&&(Ie.gridOptions.context.pageOptions.pageSize=a.value,e.params.formHelper.excuteGridServerPaging(e.params.configId,1))}};return{gridApi:u,ER:F.ER,pageSize:a,pageSizes:t,totalPages:s,currentPage:f,totalCount:o,onPageSizeChanged:te,onPageChanged:G,toFirst:O,toLast:D,toPre:I,toNext:M,setPagination:y,firstDisabled:h,preDisabled:C,nextDisabled:T,lastDisabled:S}}}),Th={class:"ag-statusBar-pagination-panel"},Sh=["disabled"],xh=["disabled"],yh=["value"],vh=["disabled"],Fh=["disabled"],Oh={class:"ag-pagesize-box"},Ih=["value"],Dh={class:"ag-totalPages-box"},Ah={id:"totalPages"};function wh(e,a,t,o,s,f){return l.openBlock(),l.createElementBlock("div",Th,[l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.firstDisabled?"ag-disabled":""]),role:"button",disabled:e.firstDisabled,onClick:a[0]||(a[0]=(...u)=>e.toFirst&&e.toFirst(...u))},a[8]||(a[8]=[l.createElementVNode("span",{class:"ag-icon ag-icon-first"},null,-1)]),10,Sh),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.preDisabled?"ag-disabled":""]),role:"button",disabled:e.preDisabled,onClick:a[1]||(a[1]=(...u)=>e.toPre&&e.toPre(...u))},a[9]||(a[9]=[l.createElementVNode("span",{class:"ag-icon ag-icon-previous"},null,-1)]),10,xh),l.withDirectives(l.createElementVNode("select",{onChange:a[2]||(a[2]=u=>e.onPageChanged()),"onUpdate:modelValue":a[3]||(a[3]=u=>e.currentPage=u),class:"ag-grid-page-select"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.totalPages,u=>(l.openBlock(),l.createElementBlock("option",{value:u},l.toDisplayString(u),9,yh))),256))],544),[[l.vModelSelect,e.currentPage]]),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.nextDisabled?"ag-disabled":""]),role:"button",disabled:e.nextDisabled,onClick:a[4]||(a[4]=(...u)=>e.toNext&&e.toNext(...u))},a[10]||(a[10]=[l.createElementVNode("span",{class:"ag-icon ag-icon-next"},null,-1)]),10,vh),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.lastDisabled?"ag-disabled":""]),role:"button",disabled:e.lastDisabled,onClick:a[5]||(a[5]=(...u)=>e.toLast&&e.toLast(...u))},a[11]||(a[11]=[l.createElementVNode("span",{class:"ag-icon ag-icon-last"},null,-1)]),10,Fh),l.createElementVNode("div",Oh,[l.withDirectives(l.createElementVNode("select",{onChange:a[6]||(a[6]=u=>e.onPageSizeChanged()),id:"page-size","onUpdate:modelValue":a[7]||(a[7]=u=>e.pageSize=u),class:"ag-grid-pageSize-select"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.pageSizes,u=>(l.openBlock(),l.createElementBlock("option",{key:u,value:u},l.toDisplayString(u),9,Ih))),128))],544),[[l.vModelSelect,e.pageSize]]),l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.RowsPerPage")||"行每页"),1)]),l.createElementVNode("div",Dh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.Total")||"共"),1),l.createElementVNode("span",Ah,l.toDisplayString(e.totalCount),1),l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.Rows")||"行"),1)])])}const Mh=sr(_h,[["render",wh],["__scopeId","data-v-e4676776"]]),kh=l.defineComponent({name:"AggregationPanel",props:["params"],setup(e){const a=l.reactive({}),t=()=>{var x;const o=(x=e.params.api)!=null&&x.rangeService?e.params.api.rangeService.getCellRanges():void 0;let s=new Gt(0),f=0,u=0,h=2,C=null,T=null;const S={};o&&o.length>0&&o.forEach(y=>{let O=e.params.api.rangeService.getRangeStartRow(y);const D=e.params.api.rangeService.getRangeEndRow(y);for(;!(!O||e.params.api.rangeService.rowPositionUtils.before(D,O)||!y.columns);)y.columns.forEach(M=>{if(O===null)return;var G=e.params.api.rangeService.cellPositionUtils.createId({rowPinned:O.rowPinned,column:M,rowIndex:O.rowIndex});if(S[G])return;S[G]=!0;var te=e.params.api.rowRenderer.getRowNode(O);if(!te)return;let b=e.params.api.valueService.getValue(M,te);F.ER.Core.isNullOrEmpty(b)||(f++,!(typeof b=="object"&&"value"in b&&(b=b.value,b===""))&&(typeof b=="string"&&(b=Number(b)),typeof b=="number"&&!isNaN(b)&&(new Gt(b).decimalPlaces()>h&&(h=new Gt(b).decimalPlaces()),s=s.add(b),(T===null||b>T)&&(T=b),(C===null||b<C)&&(C=b),u++)))}),O=e.params.api.rangeService.cellNavigationService.getRowBelow(O)}),u>1?(a.average={value:F.ER.Core.formatNumberValue(s.dividedBy(u).toDecimalPlaces(h).toNumber(),"#,##0.######"),show:!0},a.sum={value:F.ER.Core.formatNumberValue(s.toNumber(),"#,##0.######"),show:!0},a.min={value:F.ER.Core.formatNumberValue(C,"#,##0.######"),show:!0},a.max={value:F.ER.Core.formatNumberValue(T,"#,##0.######"),show:!0}):(delete a.average,delete a.sum,delete a.min,delete a.max),f>1?a.count={value:f,show:!0}:delete a.count};return{ER:F.ER,aggData:a,setAggData:t}}}),bh={class:"ag-status-panel ag-status-panel-aggregations"},Rh={key:0,class:"ag-status-name-value"},Nh={class:"ag-status-name-value-value"},Lh={key:1,class:"ag-status-name-value"},Ph={class:"ag-status-name-value-value"},Bh={key:2,class:"ag-status-name-value"},Hh={class:"ag-status-name-value-value"},Vh={key:3,class:"ag-status-name-value"},Uh={class:"ag-status-name-value-value"},Gh={key:4,class:"ag-status-name-value"},zh={class:"ag-status-name-value-value"};function $h(e,a,t,o,s,f){var u,h,C,T,S,x,y,O,D,I;return l.openBlock(),l.createElementBlock("div",bh,[(u=e.aggData.average)!=null&&u.show?(l.openBlock(),l.createElementBlock("div",Rh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Average")||"平均值")+":",1),l.createElementVNode("span",Nh,l.toDisplayString((h=e.aggData.average)==null?void 0:h.value),1)])):l.createCommentVNode("",!0),(C=e.aggData.count)!=null&&C.show?(l.openBlock(),l.createElementBlock("div",Lh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Count")||"计数")+":",1),l.createElementVNode("span",Ph,l.toDisplayString((T=e.aggData.count)==null?void 0:T.value),1)])):l.createCommentVNode("",!0),(S=e.aggData.max)!=null&&S.show?(l.openBlock(),l.createElementBlock("div",Bh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Max")||"最大值")+":",1),l.createElementVNode("span",Hh,l.toDisplayString((x=e.aggData.max)==null?void 0:x.value),1)])):l.createCommentVNode("",!0),(y=e.aggData.min)!=null&&y.show?(l.openBlock(),l.createElementBlock("div",Vh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Min")||"最小值")+":",1),l.createElementVNode("span",Uh,l.toDisplayString((O=e.aggData.min)==null?void 0:O.value),1)])):l.createCommentVNode("",!0),(D=e.aggData.sum)!=null&&D.show?(l.openBlock(),l.createElementBlock("div",Gh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Sum")||"总和")+":",1),l.createElementVNode("span",zh,l.toDisplayString((I=e.aggData.sum)==null?void 0:I.value),1)])):l.createCommentVNode("",!0)])}const Wh=sr(kh,[["render",$h],["__scopeId","data-v-73cdb637"]]),Yh=l.defineComponent({name:"InformationPanel",props:["params"],components:{"a-tooltip":et.Tooltip},setup(e){const a=l.reactive({}),t=l.ref(null),o=l.ref(null),s=h=>{const C=e.params.api.getFilterModel(),T=e.params.columnApi.getColumnState().filter(S=>S.sort!==null).sort((S,x)=>(S.sortIndex??0)-(x.sortIndex??0));t.value=Object.keys(C).map(S=>`${e.params.columnApi.getColumn(S).getColDef().headerName}`).join(`
80
+ `)}:void 0,this}setGridColumnImageUpload(r,i,n){return i.editable=!1,i.cellRenderer=Mn,i.cellRendererParams=c=>{var d,p,m;if((d=c.data)!=null&&d.uid&&((p=c.value)==null?void 0:p.trim().length)>0)return c.src=(m=c.value)==null?void 0:m.trim(),c.width=c.colDef.width||200,c.height=n.rowHeight||100,c.configId=r,c},this}setGridColumnUnboundExpression(r,i,n){var d;i.field=i.context.columnConfig.ITEM_CODE,i.editable=!1,i.tooltipField=void 0,i.enablePivot=i.context.columnConfig.UNBOUND_TYPE==="1",i.valueGetter=p=>{var m,_;if(!p.node.rowPinned&&p.data&&((m=i.context.columnConfig.UNBOUND_EXPRESSION)==null?void 0:m.trim().length)>0){let E=i.context.columnConfig.UNBOUND_EXPRESSION;E!=null&&E.trim().startsWith("return")||(E="return "+E);const v=this.excuteGridColumnExpressions(p.data,E);if(v!==void 0)return i.context.columnConfig.UNBOUND_TYPE==="2"||i.context.columnConfig.UNBOUND_TYPE==="3"?t.toNumber(v):i.context.columnConfig.UNBOUND_TYPE==="4"?t.toDateTime(v):i.context.columnConfig.UNBOUND_TYPE==="5"?t.toBoolean(v):t.toString(v)}else return(_=p.data)==null?void 0:_[i.context.columnConfig.ITEM_CODE]};const c=p=>{let m="";if(p.value!==void 0)if(i.context.columnConfig.UNBOUND_TYPE==="2"||i.context.columnConfig.UNBOUND_TYPE==="3"){const _=p.node.rowPinned?i.context.columnConfig.SUMMARY_FORMAT_STRING.trim():p.node.group?i.context.columnConfig.GROUP_FORMAT_STRING.trim():i.context.columnConfig.FORMAT_STRING;m=t.formatNumberValue(p.value,_||i.context.columnConfig.FORMAT_STRING)}else i.context.columnConfig.UNBOUND_TYPE==="4"?m=t.getDateTimeFormatString(p.value,i.context.columnConfig.FORMAT_STRING):m=t.toString(p.value);return m};return i.valueFormatter=p=>{if(p.value!==void 0)return c(p)},((d=i.context.columnConfig.CALL_FORM)==null?void 0:d.trim().length)>0&&(i.cellRenderer=p=>{var m,_,E;if(p.value!==void 0){const v=c(p),A=((m=p.node)==null?void 0:m.data)instanceof e.Model;return(v==null?void 0:v.length)>0&&A?t.createVNodeElement(l.createVNode(_i,{params:{...p,displayText:v,justifyContent:((_=i.context.columnConfig)==null?void 0:_.HALIGNMENT)==="Far"?"flex-end":((E=i.context.columnConfig)==null?void 0:E.HALIGNMENT)==="Center"?"center":"flex-start",callFormLink:A,antTooltip:!0,click:A?B=>{var W;let Q=i.context.columnConfig.CALL_FORM;const N=(W=B.node)==null?void 0:W.data.toJSON();Q.endsWith("??")?(Q=Q.replace("??",""),encodeURIComponent(encodeURIComponent(JSON.stringify(N)))):Q.endsWith("?")&&(Q=Q.replace("?",""),encodeURIComponent(JSON.stringify(N))),this.setLocalStorage(Q,{senderType:"gridCell",value:B.value,data:N,formNameFrom:this.FormName})}:void 0}})):v}}),i.tooltipField=void 0,i.tooltipValueGetter=n!=null&&n.enableCellTooltip?p=>c(p):void 0,i.filter="agMultiColumnFilter",i.filterParams={filters:[{filter:"agTextColumnFilter",filterParams:{buttons:(n==null?void 0:n.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:n==null?void 0:n.closeOnApplyFilter,maxNumConditions:(n==null?void 0:n.maxNumConditions)||5}},{filter:"agSetColumnFilter",filterParams:{valueFormatter:n!=null&&n.showFilterCounts?p=>{const m=this.setGridColumnFilterCountsMap(p);return`${p.value||"("+this.$t("ERX.Null")+")"} (${m[p.value||"NullFilterValue"]||0})`}:void 0,showTooltips:!0,buttons:(n==null?void 0:n.showApplyFilterButton)!==!1?["reset","apply"]:void 0,closeOnApply:n==null?void 0:n.closeOnApplyFilter}}]},this}getGridMenuItems(r){var m,_,E,v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me,ge,le,Y,Fe,ke,Ve,at,pt,ht,Ct,_t,Qe,U,gt,rt,ct,Ze,Ye,st,mt,At,Rt,Qt,St,nr,Tt,tr,L,ae,q,ee,ne,se,be,Ue,De,Ae,Pe,tt,k,ie,Ce,we,Xe,ft,V,de,w,Oe,We,Be,ye,je,ot,He,nt,dt,Et,yt,bt,kt,Lt,g,qt,Wt,Ca,Ga,za,$a;const i=(_=(m=r.column)==null?void 0:m.gridOptionsService)==null?void 0:_.gridOptions,n=(E=r==null?void 0:r.context)==null?void 0:E.options,c=(v=i==null?void 0:i.context)==null?void 0:v.configId,d=r.defaultItems;d.length=0,d.push("pinSubMenu","separator","autoSizeThis","autoSizeAll","separator");const p=(vt=!1)=>{var xt;const Yt=new e.PopQueryHelper(this._serverPartition,"SI00DataTableCols","LayoutGroupFilter,gridView1",this._serviceName);Yt.AutoRefresh=!0,Yt.AutoQuery=!0,Yt.DefaultValues={values:{DATASET_NAME:this._formDataSet.Name,TABLE_NAME:(xt=r.context)==null?void 0:xt.bindTableName},readonly:{DATASET_NAME:!0,TABLE_NAME:!0}},Yt.ShowCheckBoxColumn=!0,Yt.setFormOptions({beforeBindData:Dt=>(Dt=Dt.filter(rr=>!r.columnApi.columnModel.gridColumns.some(ar=>ar.colId===rr.COL_NAME)),Dt)}),Yt.setEvent("ok",async Dt=>{var Pr,da;const rr=(wt,ea)=>{var qe,cr,pr,or;return((qe=wt.FIELD_NAME)==null?void 0:qe.trim().length)===0||(wt.DATA_TYPE==="2"?(wt.FORMAT_TYPE="Numeric",["金额","税额","发生额","款"].some(Jt=>{var lt;return(lt=wt.COL_CAPTION)==null?void 0:lt.includes(Jt)})?wt.FORMAT_STRING="#,##0.00":wt.FORMAT_STRING="#,##0",["数量","件数","重量","毛重","净重"].some(Jt=>{var lt;return(lt=wt.COL_CAPTION)==null?void 0:lt.includes(Jt)})&&(wt.FORMAT_STRING="#,##0.###")):wt.DATA_TYPE==="3"?(wt.FORMAT_TYPE="DateTime",(cr=wt.COL_CAPTION)!=null&&cr.includes("日期")?wt.FORMAT_STRING="yyyy-MM-dd":((pr=wt.COL_CAPTION)!=null&&pr.includes("时间")||(or=wt.COL_CAPTION)!=null&&or.includes("时刻"))&&(wt.FORMAT_STRING="yyyy-MM-dd HH:mm:ss")):wt.DATA_TYPE==="5"&&(wt.FORMAT_TYPE="Time",wt.FORMAT_STRING="HH:mm:ss")),wt},ar=r.columnApi.columnModel.gridColumns;let Zt=ar.length;const Kt=[],Re=await e.Core.createDataTable("Master","DataSet_SI000","TSI00GRIDCOLUMN");(Pr=Dt.checkedItemArray)==null||Pr.forEach(wt=>{if(!ar.some(ea=>ea.colId===wt.COL_NAME)){const ea=Re.add(rr({COMPANY_CODE:this.DefaultConfigCompanyCode,COMPANY_CNAME:this.DefaultConfigCompanyName,ROW_GUID:e.Core.guid(),FORM_NAME:this.FormName,FUNCTION_ID:c,ITEM_CODE:wt.COL_NAME,COL_CAPTION:wt.COL_CAPTION,FIELD_NAME:wt.COL_NAME,MAX_LENGTH:wt.MAX_LENGTH,DATA_ACCU:wt.PRECISION||-1,DATA_TYPE:wt.DATA_TYPE,ALLOW_EDIT:vt?"0":"1",IS_VISIBLE:vt?"0":"1",C_SEQ_ID:String(Zt++).padStart(3,"0")}));Kt.push({field:ea.FIELD_NAME,headerName:ea.COL_CAPTION,editable:!vt,context:{columnConfig:ea.toJSON()}})}});const zr=Re.getRowsAsBlock("all");zr.rename("TSI00GRIDCOLUMN_ADD");const Zr=new s;Zr.addBlock(zr);let ca=await this.callService(e.SysInfo.saveDevConfigService,Zr);ca.getStatus()<0&&this.messageError(this.$t("ERX.ErGrid.AddColumnFailed")||"添加列失败"),this.addGridColumn(c,Kt),this.messageInfo(this.$t("ERX.ErGrid.AddColumnSuccess")||"添加列成功"),vt&&(ca=await this.uploadGridColumnCustomConfig(c,r.columnApi.columnModel.gridOptionsService.gridOptions,!1),((da=ca.sys)==null?void 0:da.status)>=0?(r.columnApi.columnModel.gridColumns.forEach(wt=>{wt.colDef.width=wt.actualWidth}),console.info("ER: The grid custom configuration synchronization was successful!")):this.messageError(this.$t("ERX.ErGrid.SaveUserConfigFailed")||"保存用户配置失败"))}),Yt.show(null)};if(r.api.getDisplayedRowCount()>0&&((B=(A=r.columnApi)==null?void 0:A.getRowGroupColumns())==null?void 0:B.length)>0&&d.push("expandAll","contractAll","separator"),r.context.isDetailGrid!==!0&&((n==null?void 0:n.allowAdvanceFilter)!==!1&&((Q=n==null?void 0:n.advanceFilter)==null?void 0:Q.allow)!==!1&&(((N=n==null?void 0:n.advanceFilterService)==null?void 0:N.length)>0||((J=(W=n==null?void 0:n.advanceFilter)==null?void 0:W.service)==null?void 0:J.length)>0),this.getGridOptions(c,"ShowQuickFilter",!0)!=="2"&&(this.getGridOptions(c,"ShowQuickFilter",!0)==="1"?d.push({name:this.$t("ERX.ErGrid.HideQuickFilter")||"隐藏快速搜索栏",action:()=>{this.setGridOptions(c,"ShowQuickFilter","0",!0)},icon:e.Core.createErSvgElement("un-search")}):d.push({name:this.$t("ERX.ErGrid.ShowQuickFilter")||"显示快速搜索栏",action:()=>{this.setGridOptions(c,"ShowQuickFilter","1",!0)},icon:e.Core.createErSvgElement("search")})),i!=null&&i.floatingFilter?d.push({name:this.$t("ERX.ErGrid.HideFilterRow")||"隐藏过滤行",action:()=>{this.setGridColumnOptions(c,vt=>{vt.floatingFilter=!1}),i.floatingFilter=!1},icon:e.Core.createErSvgElement("un-filter")}):d.push({name:this.$t("ERX.ErGrid.ShowFilterRow")||"显示过滤行",action:()=>{this.setGridColumnOptions(c,vt=>{vt.children||(vt.floatingFilter=!0)}),i.floatingFilter=!0},icon:e.Core.createErSvgElement("filter")}),this.getGridOptions(c,"ShowGroupPanel",!0)?d.push({name:this.$t("ERX.ErGrid.HideGroupPanel")||"隐藏分组依据栏",action:()=>{this.setGridOptions(c,"ShowGroupPanel",!1,!0)},icon:e.Core.createErSvgElement("group")}):d.push({name:this.$t("ERX.ErGrid.ShowGroupPanel")||"显示分组依据栏",action:()=>{this.setGridOptions(c,"ShowGroupPanel",!0,!0)},icon:e.Core.createErSvgElement("group")})),(re=r.api)!=null&&re.isColumnFilterPresent()&&(d.push("separator"),d.push({name:this.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var vt;(vt=r.api)==null||vt.setFilterModel(null)}})),(Se=r.column.colDef.context)!=null&&Se.columnConfig&&(this.DevelopPermisson==="1"||(n==null?void 0:n.disableErMenu)!==!0)&&(d.push("separator"),n!=null&&n.allowCustomColumns&&t.toString((me=(ue=r.context)==null?void 0:ue.options)==null?void 0:me.viewType,!0,"toLower")!=="bandview"&&d.push({name:this.$t("ERX.ErGrid.AddCustomColumn")||"添加自定义列",action:async()=>{p(!0)},icon:e.Core.createErSvgElement("add-column")}),n!=null&&n.allowCustomTitle||d.push({name:this.$t("ERX.ErGrid.CustomColumnTitle")||"自定义列标题",action:async()=>{var xt,Dt,rr;const vt=(this.$t("ERX.ErGrid.CustomColumnTitle")||"自定义列标题")+"->"+((rr=(Dt=(xt=r.column.colDef.context)==null?void 0:xt.columnConfig)==null?void 0:Dt.COL_CAPTION)==null?void 0:rr.trim()),Yt=new e.PopRichEditor({extension:"text",width:300,height:120,title:vt});Yt.CancelButtonCaption=e.Core.$t("ERX.Close")||"关闭",Yt.setEvent("ok",async()=>{var Kt,Re,zr,Zr;const Zt={title:((Kt=Yt.Content)==null?void 0:Kt.trim())||((Zr=(zr=(Re=r.column.colDef.context)==null?void 0:Re.columnConfig)==null?void 0:zr.COL_CAPTION)==null?void 0:Zr.trim())};this.setGridColumnOptions(c,ca=>{ca.colId===r.column.colDef.colId&&(ca.headerName=Zt.title,ca.headerTooltip=Zt.title.trim().replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""),ca.headerComponentParams={template:`${this.getGridHeaderTemplate(Zt)}`})})}),Yt.show(null,r.column.colDef.headerName)},icon:e.Core.createErSvgElement("edit-title")}),d.push({name:this.$t("ERX.ErGrid.SaveUserConfig")||"保存用户配置",action:async()=>{const vt=await this.uploadGridColumnCustomConfig(c,r.columnApi.columnModel.gridOptionsService.gridOptions);vt.getStatus()>=0?(r.columnApi.columnModel.gridColumns.forEach(Yt=>{r.column.colDef.width=r.column.actualWidth}),console.info("ER: The grid custom configuration synchronization was successful!")):this.messageError((this.$t("ERX.ErGrid.SaveUserConfigFailed")||"保存用户配置失败")+"->"+vt.getMsg())},icon:e.Core.createErSvgElement("add-user")}),d.push({name:this.$t("ERX.ErGrid.ResetUserConfig")||"重置用户配置",action:()=>{this.deleteGridColumnCustomConfig(c,o.UserId).then(()=>{r.columnApi.columnModel.gridColumns.forEach(vt=>{vt.colDef.width=vt.actualWidth}),console.info("ER: The grid custom configuration reset operation was successful!")})},icon:e.Core.createErSvgElement("delete-user")}),this.DevelopPermisson==="1"&&d.push({name:this.$t("ERX.ErGrid.ResetAllUserConfig")||"重置所有人配置",action:()=>{this.deleteGridColumnCustomConfig(c).then(()=>{r.columnApi.columnModel.gridColumns.forEach(vt=>{vt.colDef.width=vt.actualWidth}),console.info("ER: The grid all custom configuration reset operation was successful!")})},icon:e.Core.createErSvgElement("disabled-users")})),this.DevelopPermisson==="1"&&((Z=r.column.colDef.context)!=null&&Z.columnConfig)){d.push("separator"),d.push({name:"Add Columns",action:async()=>{p(!0)},icon:e.Core.createErSvgElement("add-column")}),d.push({name:"Remove Column",action:async()=>{var xt,Dt,rr;if((rr=(Dt=(xt=r.column)==null?void 0:xt.colDef)==null?void 0:Dt.context)!=null&&rr.columnConfig&&await e.Core.messageConfirm()){const ar=t.buildEiInfo(r.column.colDef.context.columnConfig,"TSI00GRIDCOLUMN_DELETE");(await this.callService(e.SysInfo.saveDevConfigService,ar)).getStatus()<0?this.messageError(this.$t("ERX.ErGrid.RemoveColumnFailed")||"移除列失败"):(this.removeGridColumn(c,r.column.colDef.colId),this.messageInfo(this.$t("ERX.ErGrid.RemoveColumnSuccess")||"移除列成功"))}},icon:e.Core.createErSvgElement("delete-column")}),d.push({name:"Save Column Width",action:()=>{this.uploadGridColumnWidth(c,[r.column]).then(()=>{r.column.colDef.width=r.column.actualWidth,console.info("ER: The grid column width synchronization was successful!")})},icon:e.Core.createErSvgElement("column-width")}),d.push({name:"Save All Column Width",action:()=>{this.uploadGridColumnWidth(c,r.columnApi.columnModel.gridColumns).then(()=>{r.columnApi.columnModel.gridColumns.forEach(xt=>{xt.colDef.width=xt.actualWidth}),console.info("ER: The grid all column width synchronization was successful!")})},icon:e.Core.createErSvgElement("all-column-width")}),d.push({name:"Save Column Order",action:()=>{this.uploadGridColumnSeq(c,r.columnApi.columnModel.gridOptionsService.gridOptions).then(()=>{console.info("ER: The grid column order synchronization was successful!")})},icon:e.Core.createErSvgElement("column-drag")}),d.push({name:"Horizontal Alignment",subMenu:[{name:"Default",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Default").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.dataType==="number"?(r.column.colDef.context.cellStyles.textAlign="right",r.column.colDef.context.cellStyles.justifyContent="right"):r.column.colDef.context.dataType==="datetime"?(r.column.colDef.context.cellStyles.textAlign="center",r.column.colDef.context.cellStyles.justifyContent="center"):r.column.colDef.context.dataType==="boolean"?(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="center"):(r.column.colDef.context.cellStyles.textAlign="left",r.column.colDef.context.cellStyles.justifyContent="left"),r.api.redrawRows())})}},{name:"Left",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Near").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.cellStyles.textAlign="left",r.column.colDef.context.cellStyles.justifyContent="left",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="left"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-left")},{name:"Center",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Center").then(()=>{var xt;(xt=r.column.colDef.context)!=null&&xt.cellStyles&&(r.column.colDef.context.cellStyles.textAlign="center",r.column.colDef.context.cellStyles.justifyContent="center",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="center"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-center")},{name:"Right",action:()=>{this.uploadGridColumnProps(c,r.column.colId,"HALIGNMENT","Far").then(()=>{var xt,Dt;(Dt=(xt=r.column.colDef.context)==null?void 0:xt.cellStyles)!=null&&Dt.textAlign&&(r.column.colDef.context.cellStyles.textAlign="right",r.column.colDef.context.cellStyles.justifyContent="right",r.column.colDef.context.dataType==="boolean"&&(r.column.colDef.context.cellStyles.display="flex",r.column.colDef.context.cellStyles.justifyContent="right"),r.api.redrawRows())})},icon:e.Core.createErSvgElement("halign-right")}],icon:e.Core.createErSvgElement("halign")});const vt=[{name:"FormName->"+this.FormName,action:()=>{e.Core.copyText(this.FormName)},icon:e.Core.createErSvgElement("page-config")},{name:"ViewName->"+c,action:()=>{e.Core.copyText(c)},icon:e.Core.createErSvgElement("layout")},{name:"DataSet->"+((Te=this.FormDataSet)==null?void 0:Te.Name),action:()=>{var xt;e.Core.copyText((xt=this.FormDataSet)==null?void 0:xt.Name)},icon:e.Core.createErSvgElement("dataset")},{name:"Table->"+((ce=i.context)==null?void 0:ce.bindTableName),action:()=>{var xt;e.Core.copyText((xt=i.context)==null?void 0:xt.bindTableName)},icon:e.Core.createErSvgElement("table")}];((ge=(Me=(ze=i.context)==null?void 0:ze.viewConfig)==null?void 0:Me.SVC_NAME)==null?void 0:ge.trim().length)>0&&vt.push({name:"DataSource->"+((Fe=(Y=(le=i.context)==null?void 0:le.viewConfig)==null?void 0:Y.SVC_NAME)==null?void 0:Fe.trim()),action:()=>{var xt,Dt,rr;e.Core.copyText((rr=(Dt=(xt=i.context)==null?void 0:xt.viewConfig)==null?void 0:Dt.SVC_NAME)==null?void 0:rr.trim())},icon:e.Core.createErSvgElement("datasource-sql")}),vt.push({name:"Extend Options",action:()=>{this.showExtOptionsEdit("tsi00gridviewext",this._formName,c,"","","",!1)},icon:e.Core.createErSvgElement("json-options")}),vt.push({name:"More...",action:()=>{this.showViewOptionsEdit(this.FormName,c)},icon:e.Core.createErSvgElement("more")}),vt.push("separator"),vt.push({name:"ShowCheckBox",subMenu:[{name:"True",disabled:((Ve=(ke=i.context)==null?void 0:ke.viewConfig)==null?void 0:Ve.SHOW_SELECTION)==="1",action:()=>{this.uploadGridViewProps(c,"SHOW_SELECTION","1").then(()=>{i.context.viewConfig.SHOW_SELECTION="1",this.setGridOptions(c,"multiSelectMode","1")})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:((pt=(at=i.context)==null?void 0:at.viewConfig)==null?void 0:pt.SHOW_SELECTION)!=="1",action:()=>{this.uploadGridViewProps(c,"SHOW_SELECTION","0").then(()=>{i.context.viewConfig.SHOW_SELECTION="0"})},icon:e.Core.createErSvgElement("disabled")}],icon:e.Core.createErSvgElement("checkbox-1")}),vt.push({name:"MultiSelectMode",subMenu:[{name:"SingleRow",disabled:((Ct=(ht=i.context)==null?void 0:ht.viewConfig)==null?void 0:Ct.MULTI_SELECT_MODE)==="1",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","1").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="1",this.setGridOptions(c,"RowSelection","single",!0),this.getGrid(c).gridOptions.enableRangeSelection=!1})}},{name:"MultiRow",disabled:((Qe=(_t=i.context)==null?void 0:_t.viewConfig)==null?void 0:Qe.MULTI_SELECT_MODE)==="2",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","2").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="2",this.setGridOptions(c,"RowSelection","multiple",!0),this.getGrid(c).gridOptions.enableRangeSelection=!1})}},{name:"MultiCell",disabled:((gt=(U=i.context)==null?void 0:U.viewConfig)==null?void 0:gt.MULTI_SELECT_MODE)==="3",action:()=>{this.uploadGridViewProps(c,"MULTI_SELECT_MODE","3").then(()=>{i.context.viewConfig.MULTI_SELECT_MODE="3",this.setGridOptions(c,"RowSelection","multiple",!0),this.getGrid(c).gridOptions.enableRangeSelection=!0})}}]}),vt.push({name:"AutoSelectMode",subMenu:[{name:"None",disabled:((ct=(rt=i.context)==null?void 0:rt.viewConfig)==null?void 0:ct.AUTO_SELECT_MODE)==="0",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","0").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="0",this.setGridOptions(c,"autoSelectMode","0",!0)})}},{name:"NewRow",disabled:((Ye=(Ze=i.context)==null?void 0:Ze.viewConfig)==null?void 0:Ye.AUTO_SELECT_MODE)==="1",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","1").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="1",this.setGridOptions(c,"autoSelectMode","1",!0)})}},{name:"EditRow",disabled:((mt=(st=i.context)==null?void 0:st.viewConfig)==null?void 0:mt.AUTO_SELECT_MODE)==="2",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","2").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="2",this.setGridOptions(c,"autoSelectMode","2",!0)})}},{name:"NewRow|EditRow",disabled:((Rt=(At=i.context)==null?void 0:At.viewConfig)==null?void 0:Rt.AUTO_SELECT_MODE)==="3",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","3").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="3",this.setGridOptions(c,"autoSelectMode","3",!0)})}},{name:"ClickRow",disabled:((St=(Qt=i.context)==null?void 0:Qt.viewConfig)==null?void 0:St.AUTO_SELECT_MODE)==="4",action:()=>{this.uploadGridViewProps(c,"AUTO_SELECT_MODE","4").then(()=>{i.context.viewConfig.AUTO_SELECT_MODE="4",this.setGridOptions(c,"autoSelectMode","4",!0)})}}]}),vt.push({name:"AllowEdit",subMenu:[{name:"True",disabled:i.context.editable,action:()=>{this.uploadGridViewProps(c,"ALLOW_EDIT","1").then(()=>{i.context.viewConfig.ALLOW_EDIT="1",i.context.editable=!0})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!i.context.editable,action:()=>{this.uploadGridViewProps(c,"ALLOW_EDIT","0").then(()=>{i.context.viewConfig.ALLOW_EDIT="0",i.api.stopEditing(),i.context.editable=!1})},icon:e.Core.createErSvgElement("disabled")}]}),vt.push({name:"AllowDragRow",subMenu:[{name:"True",disabled:i.context.allowDragRow,action:()=>{this.uploadGridViewProps(c,"ALLOW_DRAG","1").then(()=>{i.context.viewConfig.ALLOW_DRAG="1",i.context.allowDragRow=!0})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!i.context.allowDragRow,action:()=>{this.uploadGridViewProps(c,"ALLOW_DRAG","0").then(()=>{i.context.viewConfig.ALLOW_DRAG="0",i.context.allowDragRow=!0})},icon:e.Core.createErSvgElement("disabled")}]}),vt.push({name:"AllowImport",subMenu:[{name:"True",disabled:this.getGridToolbarVisible(c,"import"),action:()=>{this.uploadGridViewProps(c,"ALLOW_IMPORT","1").then(()=>{this.setGridToolbarVisible(c,{import:!0})})},icon:e.Core.createErSvgElement("ok")},{name:"False",disabled:!this.getGridToolbarVisible(c,"import"),action:()=>{this.uploadGridViewProps(c,"ALLOW_IMPORT","0").then(()=>{this.setGridToolbarVisible(c,{import:!0})})},icon:e.Core.createErSvgElement("disabled")}]}),d.push({name:"Form Properties",action:()=>{this.showFormOptionsEdit(this.FormName)},icon:e.Core.createErSvgElement("form-config")}),d.push({name:"View Properties",subMenu:vt});const Yt=[{name:"FieldName->"+r.column.colDef.field,action:()=>{e.Core.copyText(r.column.colDef.field)}},{name:"ColumnType->"+r.column.colDef.context.dataType,action:()=>{e.Core.copyText(r.column.colDef.context.dataType)}},{name:"ColumnEdit->"+(typeof r.column.colDef.cellEditor=="string"?r.column.colDef.cellEditor:(nr=r.column.colDef.cellEditor)==null?void 0:nr.name),action:()=>{var xt;e.Core.copyText(typeof r.column.colDef.cellEditor=="string"?r.column.colDef.cellEditor:(xt=r.column.colDef.cellEditor)==null?void 0:xt.name)}},{name:"ColumnWidth->"+r.column.actualWidth,action:()=>{e.Core.copyText(r.column.actualWidth)}}];if(((tr=(Tt=r.column.colDef.context)==null?void 0:Tt.columnConfig)==null?void 0:tr.ORIGIN_CODE)!=="0"&&((q=(ae=(L=r.column.colDef.context)==null?void 0:L.columnConfig)==null?void 0:ae.SVC_NAME)==null?void 0:q.trim().length)>0){const xt=((ne=(ee=r.column.colDef.context)==null?void 0:ee.columnConfig)==null?void 0:ne.ORIGIN_CODE)==="2"?"DataSource":((be=(se=r.column.colDef.context)==null?void 0:se.columnConfig)==null?void 0:be.ORIGIN_CODE)==="4"?"CodeSets":((De=(Ue=r.column.colDef.context)==null?void 0:Ue.columnConfig)==null?void 0:De.ORIGIN_CODE)==="5"?"SI->Code":((Pe=(Ae=r.column.colDef.context)==null?void 0:Ae.columnConfig)==null?void 0:Pe.ORIGIN_CODE)==="6"?"EP->Code":((k=(tt=r.column.colDef.context)==null?void 0:tt.columnConfig)==null?void 0:k.ORIGIN_CODE)==="7"?"PM->Code":"BasicCode";Yt.push({name:"DropDownSource->"+xt+"."+((we=(Ce=(ie=r.column.colDef.context)==null?void 0:ie.columnConfig)==null?void 0:Ce.SVC_NAME)==null?void 0:we.trim()),action:()=>{var rr,ar,Zt;e.Core.copyText((Zt=(ar=(rr=r.column.colDef.context)==null?void 0:rr.columnConfig)==null?void 0:ar.SVC_NAME)==null?void 0:Zt.trim())}});const Dt=((ft=(Xe=this._dropDownBindSource[c])==null?void 0:Xe[r.column.colDef.colId])==null?void 0:ft.displayFormat)??"{0}|{1}";Yt.push({name:"DisplayFormat",subMenu:[{name:"Value|Text",disabled:Dt==="{0}|{1}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{0}|{1}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{0}|{1}"})}},{name:"Text",disabled:Dt==="{1}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{1}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{1}"})}},{name:"Value",disabled:Dt==="{0}",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"DISPLAY_FORMAT","{0}").then(()=>{r.column.colDef.context.columnConfig.DISPLAY_FORMAT="{0}"})}}]})}Yt.push("separator"),Yt.push({name:"AllowEdit",subMenu:[{name:"True",disabled:((de=(V=r.column.colDef.context)==null?void 0:V.columnConfig)==null?void 0:de.ALLOW_EDIT)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_EDIT","1").then(()=>{r.column.colDef.context.columnConfig.ALLOW_EDIT="1",this.setGridColumnEditable(c,!0,r.column.colDef.colId)})}},{name:"False",disabled:((Oe=(w=r.column.colDef.context)==null?void 0:w.columnConfig)==null?void 0:Oe.ALLOW_EDIT)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_EDIT","0").then(()=>{r.column.colDef.context.columnConfig.ALLOW_EDIT="0",this.setGridColumnEditable(c,!1,r.column.colDef.colId)})}}]}),((Be=(We=r.column.colDef.context)==null?void 0:We.columnConfig)==null?void 0:Be.ALLOW_EDIT)==="1"&&((je=(ye=r.column.colDef.context)==null?void 0:ye.columnConfig)==null?void 0:je.READ_ONLY)==="0"&&Yt.push({name:"MultiRowEdit",subMenu:[{name:"True",disabled:((He=(ot=r.column.colDef.context)==null?void 0:ot.columnConfig)==null?void 0:He.MULTI_ROW_EDIT)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"MULTI_ROW_EDIT","1").then(()=>{r.column.colDef.context.columnConfig.MULTI_ROW_EDIT="1"})}},{name:"False",disabled:((dt=(nt=r.column.colDef.context)==null?void 0:nt.columnConfig)==null?void 0:dt.MULTI_ROW_EDIT)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"MULTI_ROW_EDIT","0").then(()=>{r.column.colDef.context.columnConfig.MULTI_ROW_EDIT="0"})}}]}),Yt.push({name:"ReadOnly",subMenu:[{name:"True",disabled:((yt=(Et=r.column.colDef.context)==null?void 0:Et.columnConfig)==null?void 0:yt.READ_ONLY)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"READ_ONLY","1").then(()=>{r.column.colDef.context.columnConfig.READ_ONLY="1"})}},{name:"False",disabled:((kt=(bt=r.column.colDef.context)==null?void 0:bt.columnConfig)==null?void 0:kt.READ_ONLY)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"READ_ONLY","0").then(()=>{r.column.colDef.context.columnConfig.READ_ONLY="0"})}}]}),Yt.push({name:"RequireInput",subMenu:[{name:"True",disabled:((g=(Lt=r.column.colDef.context)==null?void 0:Lt.columnConfig)==null?void 0:g.ITEM_MUST_FLAG)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ITEM_MUST_FLAG","1").then(()=>{r.column.colDef.context.columnConfig.ITEM_MUST_FLAG="1",r.api.refreshHeader()})}},{name:"False",disabled:((Wt=(qt=r.column.colDef.context)==null?void 0:qt.columnConfig)==null?void 0:Wt.ITEM_MUST_FLAG)!=="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ITEM_MUST_FLAG","0").then(()=>{r.column.colDef.context.columnConfig.ITEM_MUST_FLAG="0",r.api.refreshHeader()})}}]}),Yt.push({name:"AllowShowHide",subMenu:[{name:"True",disabled:((Ga=(Ca=r.column.colDef.context)==null?void 0:Ca.columnConfig)==null?void 0:Ga.ALLOW_SHOWHIDE)==="1",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_SHOWHIDE","1").then(()=>{r.column.colDef.context.columnConfig.ALLOW_SHOWHIDE="1",this.setGridColumnOptions(c,xt=>{xt.colId===r.column.colDef.colId&&(xt.lockVisible=!1)})})}},{name:"False",disabled:(($a=(za=r.column.colDef.context)==null?void 0:za.columnConfig)==null?void 0:$a.ALLOW_SHOWHIDE)==="0",action:()=>{this.uploadGridColumnProps(c,r.column.colDef.colId,"ALLOW_SHOWHIDE","0").then(()=>{r.column.colDef.context.columnConfig.ALLOW_SHOWHIDE="0",this.setGridColumnOptions(c,xt=>{xt.colId===r.column.colDef.colId&&(xt.lockVisible=!0)})})}}]}),Yt.push({name:"Extend Options",action:()=>{var xt,Dt,rr;this.showExtOptionsEdit("tsi00gridcolumnext",this._formName,c,((xt=r.column.colDef.context)==null?void 0:xt.columnConfig.ROW_GUID)+","+((Dt=r.column.colDef.context)==null?void 0:Dt.columnConfig.ITEM_CODE),"",(rr=r.column.colDef.context)==null?void 0:rr.columnConfig.COMPANY_CODE,!1)},icon:e.Core.createErSvgElement("json-options")}),d.push({name:"Column Properties",subMenu:Yt})}return d}setGridMainMenuItems(r,i){var n,c,d,p;return(c=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&c.configId&&((p=(d=r==null?void 0:r.gridOptions)==null?void 0:d.context)==null||p.configId,r.gridOptions.getMainMenuItems=m=>this.getGridMenuItems(m)),this}setGridRowStyle(r,i){var n,c;return(c=(n=r==null?void 0:r.gridOptions)==null?void 0:n.context)!=null&&c.configId&&(r.gridOptions.getRowStyle=d=>this.getRowStyle(d,i)),this}getRowStyle(r,i){var d,p,m;const n={fontWeight:"normal"},c=(d=r==null?void 0:r.context)==null?void 0:d.configId;if((p=r.node)!=null&&p.rowPinned)return{fontWeight:"bold"};if(r.node.footer&&r.node.level<0&&(i==null?void 0:i.showDefaultFooter)!==!0)return{display:"none"};if(this._gridOptions[c].styleConfigInfo.rowStyle.length>0&&r.data)for(let _=0;_<this._gridOptions[c].styleConfigInfo.rowStyle.length;_++){const E=this._gridOptions[c].styleConfigInfo.rowStyle[_];if((((m=E.condition)==null?void 0:m.trim().length)===0||E.condition.trim().replaceAll(" ","")==="1=1"||t.checkExpressionValid(r.data,e.Core.getSystemFormatString(E.condition)))&&(E.type==="Foreground"||E.type==="W_Fore"?n.color=t.toHexColor(E.fillColor):(E.type==="Background"||E.type==="W_Back")&&(n.background=t.toHexColor(E.fillColor)),E.fontStyle&&E.fontStyle.trim().length>0))switch(E.fontStyle){case"Bold":n.fontWeight="bold";break;case"Italic":n.fontStyle="italic";break;case"Strikeout":n.textDecoration="line-through";break;case"Underline":n.textDecoration="underline";break}}return n}setGridColumnEditable(r,i,...n){var d,p;const c=this.getGrid(r);if((d=c==null?void 0:c.gridOptions)!=null&&d.api){const m=(p=c.gridOptions.api.columnModel)==null?void 0:p.gridColumns;n.length===1&&(n=n[0].split(",")),(m==null?void 0:m.length)>0&&(c.gridOptions.api.stopEditing(),m.forEach(_=>{_.colId!==o.GridCheckColumnFieldName&&((n==null?void 0:n.length)===0||n.includes(_.colId))&&(_.context=_.context||{},_.context.editable=i)}))}return this}getGridCellRenderText(r,i,n,c){var m,_,E,v;let d="";const p=this.getGridColumnDef(r,i);return p!=null&&p.context&&(p.context.cellEditType==="dateEditor"?d=t.getDateTimeFormatString(n,c||((m=p.context.columnConfig)==null?void 0:m.FORMAT_STRING)):p.context.cellEditType==="numberEditor"?d=t.formatNumberValue(n,c||((_=p.context.columnConfig)==null?void 0:_.FORMAT_STRING)):p.refData&&((E=p.context)==null?void 0:E.cellEditType)==="checkGridLookUpEdit"&&p.context.valueField!==p.context.textField?e.Core.toString(n).trim().split(",").forEach(B=>{const Q=p.refData[B]||B;d=d.length===0?Q:d+","+Q}):((v=p.context)==null?void 0:v.cellEditType)==="gridLookUpEdit"?d=p.refData[n]||n:d=t.toString(n)),d}getDropDownSelectedData(r,i,n){let c=[];if(this._dropDownBindSource[r]&&this._dropDownBindSource[r][i]){const d=this._dropDownBindSource[r][i];if(d.dataSource&&d.dataSource.length>0){const p=d.dataValueField,m=d.dataSource;if(n||(n=this.getControlValue(r,i)),n===!0&&(n="1"),(m==null?void 0:m.length)>0&&n&&t.toString(n).trim().length>0){const _=t.toString(n).trim().split(",");for(let E=0;E<m.length;E++)if(m[E])if(_.length>1){if(_.includes(t.toString(m[E][p]))&&c.push(m[E]),c.length===_.length||E===m.length-1)break}else t.toString(m[E][p])===t.toString(n)&&(c=m[E])}}}return c}getDropDownSelectedText(r,i,n){var d,p,m;let c="";if(this._dropDownBindSource[r]&&this._dropDownBindSource[r][i]){const _=this._dropDownBindSource[r][i];if(((d=_==null?void 0:_.dataSource)==null?void 0:d.length)>0&&((p=_==null?void 0:_.dataValueField)==null?void 0:p.trim().length)>0&&((m=_==null?void 0:_.dataTextField)==null?void 0:m.trim().length)>0){const E=_.dataValueField.trim(),v=_.dataTextField.trim(),A=_.dataSource;n==null&&(n=this.getControlValue(r,i)),n===!0&&(n="1");let B=[];if(n&&typeof n=="string"?B=n.split(","):n instanceof Array&&(B=n),(A==null?void 0:A.length)>0&&B.length>0){c=[];for(let Q=0;Q<A.length;Q++)if(A[Q])if(B.length>1){if(B.includes(t.toString(A[Q][E]))&&c.push(A[Q][v]),c.length===B.length||Q===A.length-1){c=c.join(",");break}}else t.toString(A[Q][E])===t.toString(n)&&(c=A[Q][v])}}}return c}async uploadGridColumnSeq(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p=[];if((r==null?void 0:r.trim().length)>0&&i){r=r.trim();let m=0;i.columnApi.columnModel.gridColumns.forEach(_=>{var E,v;if(_.colId&&_.colId!==e.SysInfo.GridCheckColumnFieldName&&_.colDef.cellRenderer!=="agGroupCellRenderer"){const A=(v=(E=_.colDef)==null?void 0:E.context)==null?void 0:v.columnConfig;A&&A.ROW_GUID&&(A.IS_VISIBLE=_.visible===!1?"0":"1",A.COL_WIDTH_WEB=_.width,A.GROUP_SORT_TYPE="0",A.C_SEQ_ID=`${++m}`.padStart(3,"0"),A.COL_FIX_TYPE=_.pinned==="left"?"L":_.pinned==="right"?"R":"N",_.rowGroupActive&&(A.GROUP_SORT_TYPE="1"),p.push(A))}})}if(p.length>0){const m=this.buildEiBlock(p,"TSI00GRIDCOLUMN_VISIBLEINDEX"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm("是否确定同步列顺序?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})}else d.SysInfo.Flag=-603,d.SysInfo.Msg="No EiInfo data available",n(d)})}async uploadGridColumnProps(r,i,n,c){return new Promise((d,p)=>{const m=this.getSingleItemConfigInfo(r,i,this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r]);let _=new ut.EiInfo;const E=t.buildEiBlock([{COMPANY_CODE:m.COMPANY_CODE,FORM_NAME:m.FORM_NAME,FUNCTION_ID:m.FUNCTION_ID,ITEM_CODE:m.ITEM_CODE,PROPERTY_NAME:n,PROPERTY_VALUE:c}],"TSI00GRIDCOLUMN_PROPERTY");t.messageConfirm("是否确定更改配置?").then(v=>{if(v){const A=new ut.EiInfo;A.addBlock(E),t.callService(e.SysInfo.saveDevConfigService,A).then(B=>{_=B,d(_)})}else _.SysInfo.Flag=999,_.SysInfo.Msg="Cancel operation",d(_)})})}async uploadGridColumnPropsEx(r){return new Promise((i,n)=>{let c=new ut.EiInfo;const d=t.buildEiBlock(r,"TSI00GRIDCOLUMN_PROPERTY");t.messageConfirm("是否确定更改配置?").then(p=>{if(p){const m=new ut.EiInfo;m.addBlock(d),t.callService(e.SysInfo.saveDevConfigService,m).then(_=>{c=_,i(c)})}else c.SysInfo.Flag=999,c.SysInfo.Msg="Cancel operation",i(c)})})}async uploadGridViewProps(r,i,n){return new Promise((c,d)=>{const p=this.getSingleViewConfigInfo(r);let m=new ut.EiInfo;const _=t.buildEiBlock([{COMPANY_CODE:this.DefaultConfigCompanyCode,FORM_NAME:p.FORM_NAME,FUNCTION_ID:p.FUNCTION_ID,PROPERTY_NAME:i,PROPERTY_VALUE:n}],"TSI00GRIDVIEW_PROPERTY");t.messageConfirm("是否确定更改配置?").then(E=>{if(E){const v=new ut.EiInfo;v.addBlock(_),t.callService(e.SysInfo.saveDevConfigService,v).then(A=>{m=A,c(m)})}else m.SysInfo.Flag=999,m.SysInfo.Msg="Cancel operation",c(m)})})}async uploadGridViewPropsEx(r){return new Promise((i,n)=>{let c=new ut.EiInfo;const d=t.buildEiBlock(r,"TSI00GRIDVIEW_PROPERTY");t.messageConfirm("是否确定更改配置?").then(p=>{if(p){const m=new ut.EiInfo;m.addBlock(d),t.callService(e.SysInfo.saveDevConfigService,m).then(_=>{c=_,i(c)})}else c.SysInfo.Flag=999,c.SysInfo.Msg="Cancel operation",i(c)})})}async uploadGridColumnWidth(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p=[];if(i.forEach(m=>{var _,E;if(m.colDef.colId!==e.SysInfo.GridCheckColumnFieldName){const v=(E=(_=m.colDef)==null?void 0:_.context)==null?void 0:E.columnConfig;v&&v.ROW_GUID&&(v.COL_WIDTH_WEB=m.actualWidth,p.push(v))}}),p.length>0){const m=this.buildEiBlock(p,"TSI00GRIDCOLUMN_WIDTH_WEB"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm("是否确定同步列宽?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})}else d.SysInfo.Flag=-603,d.SysInfo.Msg="No EiInfo data available",n(d)})}async uploadGridColumnCustomConfig(r,i,n=!0){return new Promise(async(c,d)=>{if((r==null?void 0:r.trim().length)>0&&i){r=r.trim();let p=new ut.EiInfo;const m=[];let _=0;if(i.columnApi.columnModel.gridColumns.forEach(E=>{var v,A;if(E.colId&&E.colId!==e.SysInfo.GridCheckColumnFieldName&&((A=(v=E.colDef)==null?void 0:v.context)!=null&&A.columnConfig)&&E.colDef.cellRenderer!=="agGroupCellRenderer"){const B={...E.colDef.context.columnConfig};B&&B.ROW_GUID&&(delete B.extendOptions,B.IS_VISIBLE=E.visible===!1?"0":"1",B.TYPE_CODE=e.SysInfo.Culture,B.COL_WIDTH=E.actualWidth,B.GROUP_SORT_TYPE="0",B.C_SEQ_ID=`${++_}`.padStart(3,"0"),B.COL_FIX_TYPE=E.pinned==="left"?"L":E.pinned==="right"?"R":"N",B.COL_CAPTION=E.colDef.headerName,E.rowGroupActive&&(B.GROUP_SORT_TYPE="1"),m.push(B))}}),m.length>0){const E=this.buildEiBlock(m,"TSI00GRIDCOLUMN_CUS_UPLOAD"),v=new ut.EiInfo;v.addBlock(E);const A={COMPANY_CODE:this.DefaultConfigCompanyCode,COMPANY_CNAME:this.DefaultConfigCompanyName,FORM_NAME:this._formName,FUNCTION_ID:r,DEVICE_ID:e.SysInfo.Culture},B=i.columnApi.getColumnState().filter(J=>J.sort!==null).sort((J,re)=>(J.sortIndex??0)-(re.sortIndex??0));let Q="";B.length>0&&(B.forEach(J=>{const re=J.sort==="desc"?J.colId+" desc":J.colId;Q+=re+","}),Q=Q.substring(0,Q.length-1)),A.EXT_OPTIONS=JSON.stringify({SORT_FIELD_NAME:Q});const N=t.buildEiBlock([A],"TSI00GRIDVIEWCUS_ADD");v.addBlock(N);let W=!0;n&&(W=await t.messageConfirm(this.$t("ERX.ErGrid.SaveUserConfig")||"是否确定同步个人配置?")),W?t.callService(e.SysInfo.saveDevConfigService,v).then(J=>{p=J,c(p)}):n&&(p.setStatus(999),p.setMsg("Cancel operation"),c(p))}else p.setStatus(-603),p.setMsg("No EiInfo data available"),c(p)}})}async deleteGridColumnCustomConfig(r,i){return new Promise((n,c)=>{let d=new ut.EiInfo;const p={};p.COMPANY_CODE=this._currentConfigCompanyCode["TSI00GRIDCOLUMN"+r],p.FORM_NAME=this._formName,p.FUNCTION_ID=r,p.TYPE_CODE="zh_Hans",i&&i.trim().length>0&&(p.REC_CREATOR=e.SysInfo.UserId);const m=this.buildEiBlock([p],"TSI00GRIDCOLUMN_CUS_DELETE"),_=new ut.EiInfo;_.addBlock(m),t.messageConfirm(i?"是否确定重置个人配置?":"是否确定重置所有个人配置?").then(E=>{E?t.callService(e.SysInfo.saveDevConfigService,_).then(v=>{d=v,n(d)}):(d.SysInfo.Flag=999,d.SysInfo.Msg="Cancel operation",n(d))})})}checkRequiredInput(r,i=!1){return new Promise(async(n,c)=>{let d=!0,p=[];r&&(r instanceof Array?p=r:p=r.split(",")),p.length===0&&(p=this.getAllConfigIdArray());for(let m=0;m<p.length;m++){if(p[m].trim().length===0)continue;if(this.getSingleViewConfigInfo(p[m]).FUNCTION_TYPE==="F"){const E=this.getLayoutBindForm(p[m]);E&&await E.validate().then(()=>{d=d&&!0}).catch(()=>{d=!1})}else d=d&&this.checkGridInput(p[m],"ChangedRows",!1,!1)}!d&&i===!0&&this.messageWarning(this.$t("ERX.InputInvalidMessage")||"输入验证未通过!"),n(d)})}checkGridInput(r,i,n=!1,c=!0){var m,_,E;let d=!0,p=[];r&&(r instanceof Array?p=r:typeof r=="string"?p=r.split(","):p=[r]);for(let v=0;v<p.length;v++){const A=this.getGrid(p[v]);if((m=A==null?void 0:A.gridOptions)!=null&&m.api){(!i||i.trim().length===0)&&(i="ChangedRows");const B=A.gridOptions.api,Q=(E=(_=A.gridOptions)==null?void 0:_.context)==null?void 0:E.columnsConfig,N=[];if(Q==null||Q.forEach(W=>{W.UNBOUND_TYPE==="0"&&W.ITEM_MUST_FLAG==="1"&&N.push(W)}),N.length>0)if(B.setFilterModel(null),i==="CheckedRows"){const W=B.getSelectedNodes();for(let J=0;J<W.length;J++)if(d=this.checkGridRowInput(B,W[J],N,n,c),!d)return d}else if(i==="AllRows"){const W=B.getModel().getRowCount();for(let J=0;J<W;J++){const re=B.getModel().getRow(J);if(re!=null&&re.data&&(d=this.checkGridRowInput(B,re,N,n,c),!d))return d}}else{const W=this.getGridCreatedRows(r),J=this.getGridModifyRows(r),re=[...W,...J];for(let Se=0;Se<re.length;Se++){const ue=B.getModel().getRowNode(re[Se].uid);if(ue!=null&&ue.data&&(d=this.checkGridRowInput(B,ue,N,n,c),!d))return d}}}}return d}checkGridRowInput(r,i,n,c=!1,d=!0){var m,_,E,v;if(r&&(i!=null&&i.data))for(let A=0;A<n.length;A++){const B=n[A].ITEM_CODE,Q=n[A].FIELD_NAME,N=n[A].CONDITION_TABLE;let W={};t.toString(n[A].EXT_OPTIONS).trim().length>0&&(W=JSON.parse(t.toString(n[A].EXT_OPTIONS)));const J=W.requireCondition||n[A].MUST_INPUT_CONDITION,re=r.getColumnDef(B);if(re&&(!re.visible||!c))if(J.trim().length===0){if(i.rowIndex&&(i==null?void 0:i.data[Q])===void 0||(i==null?void 0:i.data[Q])===null||t.toString(i==null?void 0:i.data[Q]).trim().length===0||((m=re.context)==null?void 0:m.dataType)==="number"&&(i==null?void 0:i.data[Q])===0)return d&&(r.ensureNodeVisible(i,"top"),r.ensureColumnVisible(re.colId,"auto"),r.startEditingCell({rowIndex:i.rowIndex||0,colKey:re.colId}),t.messageWarning(e.Core.$t("ERX.InputEmptyMessage"))),r.getCellEditorInstances({columns:[re],rowNodes:[i]}).forEach(ue=>{ue.editorType,ue.setBorder?ue.setBorder("2px solid red"):ue.setInvalid&&ue.setInvalid()}),!1}else{let Se=i==null?void 0:i.data;if(N.trim().length>0&&((_=this._formDataSet)!=null&&_.contains(N.trim()))&&(Se=(E=this._formDataSet)==null?void 0:E.getCurrentDataObject(N.trim())),t.checkExpressionValid(Se,e.Core.getSystemFormatString(J))&&((i==null?void 0:i.data[Q])===void 0||(i==null?void 0:i.data[Q])===null||t.toString(i==null?void 0:i.data[Q]).trim().length===0||((v=re.context)==null?void 0:v.dataType)==="number"&&(i==null?void 0:i.data[Q])===0))return d&&(r.ensureNodeVisible(i,"top"),r.ensureColumnVisible(re.colId,"auto"),r.startEditingCell({rowIndex:i.rowIndex||0,colKey:re.colId}),t.messageWarning(e.Core.$t("ERX.InputEmptyMessage"))),!1}}return!0}checkGridRow(r,i,n=!0){const c=this.getGrid(r);return c&&i&&(typeof i=="string"&&i.trim().length>0?i=[i]:i.uid&&(i=[t.toString(i.uid)]),i instanceof Array&&i.length>0&&i.forEach(d=>{const p=c.gridOptions.api.getRowNode(d.uid?d.uid:d);p&&p.setSelected(n===!0)})),this}checkGridCurrentRow(r){if(r){const i=this.getGridCurrentRow(r);i&&this.checkGridRow(r,i)}}checkAllGridRow(r,i=!0){const n=this.getGrid(r);if(n){const c=this.getGridColumn(n,o.GridCheckColumnFieldName);if(c&&c.visible){const d=(p,m)=>{p.setSelected(!0)};i?n.gridOptions.api.forEachNodeAfterFilterAndSort(d):n.gridOptions.api.forEachLeafNode(d)}}}unCheckAllGridRow(r,i=!0){const n=this.getGrid(r);if(n){const c=this.getGridColumn(n,o.GridCheckColumnFieldName);if(c&&c.visible){const d=(p,m)=>{p.setSelected(!1)};i?n.gridOptions.api.forEachNodeAfterFilterAndSort(d):n.gridOptions.api.forEachLeafNode(d)}}}isGridRowChecked(r,i){var c;const n=this.getGrid(r);if(n&&i){const d=this.getGridColumn(n,o.GridCheckColumnFieldName);if(d&&d.visible)return(c=n.gridOptions.api.getRowNode(i instanceof T?i.uid:i))==null?void 0:c.isSelected()}}isGridCurrentRowChecked(r){const i=this.getGridCurrentRow(r);if(i)return this.isGridRowChecked(r,i)}setLocalStorage(r,i){return t.setLocalStorage(r,i)}getLocalStorage(r,i=!0){return t.getLocalStorage(r,i)}getCallFormParas(r,i=!0){return t.getCallFormParas(r,i)}callForm(r,i,n=!0){return t.callForm(r,i,n)}copyText(r){t.copyText(r)}readClipboardText(){return t.readClipboardText()}getTextWidth(r){return t.getTextWidth(r)}getGuid(){return t.guid()}round(r,i){return t.round(r,i)}loading(r,i,n){t.loading(r,i,n)}stringFormat(r,...i){return t.stringFormat(r,...i)}isNullOrEmpty(r){return t.isNullOrEmpty(r)}checkNullOrEmpty(r,i){const n=this.isNullOrEmpty(r);return n&&i&&i.trim().length>0&&this.messageWarning(i.trim()),n}callService(r,i,n,c){var d;return c=c||{},c.messageError=c.messageError??!1,c.messageError!=="modal"&&c.messageError!==!1&&(c.messageError=((d=this.getFormSysInfo("ERRORMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true"?"modal":!0),t.callService(r,i,n,c)}async querySql(r,...i){return t.querySql(this._serverPartition,r,...i)}messageConfirm(r,i,n){return t.messageConfirm(r,i,n)}messageSuccess(r,...i){var d;let n=e.Core.$t("ERX.OperateSuccess")||"操作成功!",c=((d=this.getFormSysInfo("SUCCESSMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageInfo(n,c)}messageInfo(r,...i){var d;let n="",c=((d=this.getFormSysInfo("INFOMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageInfo(n,c)}messageWarning(r,...i){var d;let n="",c=((d=this.getFormSysInfo("WARNINGMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageWarning(n,c)}messageError(r,...i){var d;let n="",c=((d=this.getFormSysInfo("ERRORMESSAGEDISPLAYMODAL"))==null?void 0:d.toLowerCase())==="true";r&&(typeof r=="string"?(r.startsWith("ERX.")&&(n=this.$t(r,i)),n=t.stringFormat(r,i)):(r.message.startsWith("ERX.")?n=this.$t(r.message,i):n=t.stringFormat(r.message,i),r.modal!==void 0&&(c=r.modal))),t.messageError(n,c)}buildEiBlock(r,i){return t.buildEiBlock(r,i)}getCurrentDataObject(r){var n;let i;if(r&&r.trim().length>0){const c=this.getGrid(r);if(c)i=this.getGridCurrentRow(c);else{const d=this.getBindingTableName(r.trim());d&&d.trim().length>0&&(i=(n=this._formDataSet)==null?void 0:n.getCurrentDataObject(d))}}return i}stopGridEditing(r,i){return new Promise((n,c)=>{let d;r instanceof Array?d=r:typeof r=="string"?d=r.split(","):d=[r],(d==null?void 0:d.length)>0&&d.forEach(p=>{var m;(m=this.getGridApi(p))==null||m.stopEditing()}),setTimeout(()=>{try{const p=i();n(p)}catch(p){c(p)}},250)})}async deleteGridRows(r,i=!1,n){const c=this.getGrid(r);return c?t.deleteGridRows(c,i,n):!1}setGridFocusedCell(r,i=0,n,c){const d=this.getGrid(r);d&&t.setGridFocusedCell(d,i,n,c)}setGridRowData(r,i,n,c=!1){if(i&&n){n instanceof e.Model&&(n=n.toJSON());const d=this.getGrid(r);if(d){const p=d.gridOptions.api;if(i instanceof e.Model&&(i=i.uid),typeof i=="string"&&i.trim().length>0){const m=p.getModel().getRowNode(i.trim());m&&m.data&&Object.keys(n).forEach(_=>{if(!["isNew","uid","dirty","dirtyFields","_events","_schemaFields","_preview_row_data","_children_data"].includes(_)&&typeof n[_]!="function"&&m.data[_]!==void 0&&(String(n[_]).trim().length===0||c===!1)){const E=p.getColumnDef(_);E?E.cellEditor==="agCheckboxCellEditor"?m.setDataValue(_,n[_]===!0||n[_]==="1"):m.setDataValue(_,n[_]):m.data[_]=n[_]}})}}}return this}setGridCurrentRowData(r,i,n=!1){const c=this.getGridCurrentRow(r);return c&&this.setGridRowData(r,c,i,n),this}setGridRowState(r,i,n){var c,d,p;if(r&&i){const m=this.getGrid(r);if(m){const _=m.gridOptions.api;if(i instanceof e.Model&&(i=i.uid),typeof i=="string"&&i.trim().length>0){const E=_.getModel().getRowNode(i.trim());if(E&&((c=E.data)!=null&&c.uid)){const v=(p=(d=m.gridOptions)==null?void 0:d.context)==null?void 0:p.bindingSource;v&&v.setRowState(E.data,n)}}}}return this}getGridBindingTable(r){var c,d;let i;const n=this.getGrid(r);return n&&(i=(d=(c=n.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource),i}getGridStructureAsBlock(r,i=!1,n){var p,m,_,E;n=(n==null?void 0:n.trim())||"result";const c=new ut.EiBlock(n),d=this.getGridBindingTable(r);if((p=d==null?void 0:d.options)!=null&&p.schema){const v=B=>{const Q=new ut.EiColumn(B.name);return Q.type=B.type==="number"?"N":"C",Q.name=B.name,Q.descName=B.caption,Q},A=[];i?(_=(m=r==null?void 0:r.gridOptions)==null?void 0:m.columnApi.getAllGridColumns())==null||_.forEach(B=>{var Q,N,W,J,re,Se,ue;if((W=(Q=d==null?void 0:d.options)==null?void 0:Q.schema)!=null&&W[(N=B.colDef)==null?void 0:N.field]){const me=v((re=d==null?void 0:d.options)==null?void 0:re.schema[(J=B.colDef)==null?void 0:J.field]);me.descName=(ue=(Se=B.colDef)==null?void 0:Se.headerName)==null?void 0:ue.replaceAll("<br>","").replaceAll("</br>","").replaceAll("<br/>",""),c.addColumn(me),A.push({name:me.name,type:me.type})}}):Object.keys((E=d==null?void 0:d.options)==null?void 0:E.schema).forEach(B=>{var N,W;const Q=v((W=(N=d==null?void 0:d.options)==null?void 0:N.schema)==null?void 0:W[B]);c.addColumn(Q),A.push({name:Q.name,type:Q.type})})}return c.setAttr({offset:0,limit:-1,orderBy:""}),c}getGridSelectRows(r,i=!1,n=!1){const c=this.getGrid(r);return this.getGridRows(c,"select",i,n)}getGridSelectRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"select",i,n,c,d)}getGridCurrentRow(r,i=!1,n=!1){let c;const d=this.getGridRows(r,"current",i,n);return d.length>0&&(c=d[0]),c}getGridCurrentRowAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"current",i,n,c,d)}getGridCheckedRows(r,i=!1,n=!1){return this.getGridRows(r,"checked",i,n)}getGridCheckedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"checked",i,n,c,d)}getGridCheckedAfterFilterRows(r,i=!1,n=!1){return this.getGridRows(r,"checkedAfterFilter",i,n)}getGridCheckedAfterFilterRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"checkedAfterFilter",i,n,c,d)}getGridDeletedRows(r,i=!1,n=!1){return this.getGridRows(r,"delete",i,n)}getGridDeletedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"delete",i,n,c,d)}getGridModifyRows(r,i=!1,n=!1){return this.getGridRows(r,"modify",i,n)}getGridModifyRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"modify",i,n,c,d)}getGridCreatedRows(r,i=!1,n=!1){return this.getGridRows(r,"add",i,n)}getGridCreatedRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"add",i,n,c,d)}getGridAllRows(r,i=!1,n=!1){return this.getGridRows(r,"all",i,n)}getGridAllRowsAsBlock(r,i,n=!1,c,d){return this.getGridRowsAsBlock(r,"all",i,n,c,d)}getGridChangedRowsAsEiInfo(r,i,n,c=!1,d){i==null&&(i=new ut.EiInfo);let p;return r instanceof Array?p=r:typeof r=="string"?p=r.split(","):p=[r],p&&p.length>0&&p.forEach(m=>{const _=this.getGrid(m);_&&(i=t.getGridChangedRowsAsEiInfo(_,p.length===1?n:"",i,c,d))}),i}getGridRows(r,i,n=!1,c=!1){const d=this.getGrid(r);return t.getGridRows(d,i,n,c)}getGridRowsAsBlock(r,i,n,c=!1,d,p){const m=this.getGrid(r);return t.getGridRowsAsBlock(m,i,n,c,d,p)}initialGridToolbar(r,i,n){return r=(r||"").trim(),this._gridToolbarOptions[r]=this._gridToolbarOptions[r]||{},this._gridToolbarOptions[r]={...this._gridToolbarOptions[r],...n},r.length>0&&i&&Object.keys(i).forEach(c=>{const d=i[c];this._gridToolbarOptions[r][c]=this._gridToolbarOptions[r][c]||{},d.action!==void 0&&(this._gridToolbarOptions[r][c].action=d.action),d.preventDefault!==void 0&&(this._gridToolbarOptions[r][c].preventDefault=d.preventDefault),d.messageConfirm!==void 0&&(this._gridToolbarOptions[r][c].messageConfirm=d.messageConfirm),d.visible!==void 0&&(this._gridToolbarOptions[r][c].visible=d.visible),d.showIco!==void 0&&(this._gridToolbarOptions[r][c].showIco=l.ref(d.showIco)),d.showText!==void 0&&(this._gridToolbarOptions[r][c].showText=l.ref(d.showText)),t.toString(d.caption,!0).length>0&&(this._gridToolbarOptions[r][c].caption=t.toString(d.caption,!0)),d.ico&&(this._gridToolbarOptions[r][c].ico=d.ico)}),this}setGridToolbarVisible(r,i){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r]=this._gridToolbarOptions[r]||{},Object.keys(i).forEach(n=>{this._gridToolbarOptions[r][n]=this._gridToolbarOptions[r][n]||{},this._gridToolbarOptions[r][n].visible=l.ref(i[n])})),this}setGridToolbarAction(r,i,n,c,d){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r][i].action=n,c!==void 0&&(this._gridToolbarOptions[r][i].preventDefault=c),d!==void 0&&(this._gridToolbarOptions[r][i].messageConfirm=d)),this}setGridAuthButtonAction(r,i){return r=(r||"").trim(),r.length>0&&(this._gridToolbarOptions[r].authButtonAction={action:i}),this}getGridToolbarVisible(r,i){var n,c,d,p;if((r==null?void 0:r.trim().length)>0&&this._gridToolbarOptions[r]&&((n=this._gridToolbarOptions[r][i])==null?void 0:n.visible)!==void 0)return((c=this._gridToolbarOptions[r][i])==null?void 0:c.visible.value)!==void 0?(d=this._gridToolbarOptions[r][i])==null?void 0:d.visible.value:(p=this._gridToolbarOptions[r][i])==null?void 0:p.visible}sleep(r){return t.sleep(r)}setGlobalStyleProperty(r,i,n){t.setGlobalStyleProperty(r,i,n)}getGlobalStyleProperty(r){return t.getGlobalStyleProperty(r)}removeGlobalStyleProperty(r){return t.removeGlobalStyleProperty(r)}mergeGridDataRow(r,i,n=!1){return t.mergeGridDataRow(r,i,n)}mergeDataToDataTable(r,i,n=!0){return t.mergeDataToDataTable(r,i,n)}mergeDataToGrid(r,i,n=!0){let c=0;const d=this.getGrid(i);return d?(c=t.mergeDataToGrid(r,d,n),this.autoBestFit(d)):console.warn("ER: Attempting to bind data to a non-existent grid"),c}mergeEiBlockToGrid(r,i,n=!0){const c=this.getGrid(i);return this.mergeDataToGrid(r==null?void 0:r.getMappedRows(),c,n)}mergeEiInfoToGrid(r,...i){this.isNullOrEmpty(i)?i=Object.keys(this._gridOptions):i.length===1&&i[0]&&typeof i[0]=="string"&&(i=i[0].split(",")),new ut.EiInfo,i.forEach(n=>{var p,m,_,E;const c=this.getGrid(n),d=(E=(_=(m=(p=c==null?void 0:c.gridOptions)==null?void 0:p.context)==null?void 0:m.bindingSource)==null?void 0:_.tableName)==null?void 0:E.trim();(d==null?void 0:d.trim().length)>0&&r.getBlock(d.trim())?this.mergeEiBlockToGrid(r.getBlock(d.trim()),c):i.length===1&&this.mergeEiBlockToGrid(r.getBlockByIndex(0),c)})}clearGridData(...r){r&&r.length>0&&r.forEach(i=>{const n=this.getGrid(i);n&&t.clearGridData(n)})}clearLayoutData(...r){if(this.isNullOrEmpty(r)?r=Object.keys(this._formBindingRelation):r.length===1&&r[0]&&typeof r[0]=="string"&&(r=r[0].split(",")),r&&r.length>0){const i=[];r.forEach(n=>{if(n.trim().length>0)if(this._formBindingRelation[n.trim()]&&this._formBindingRelation[n.trim()].length>0){const c=this._formBindingRelation[n.trim()];this.getRelationConfigIdsByTableName(c).forEach(p=>{var m,_;if(this._gridOptions[p]===void 0){if((m=this._formDataSet)!=null&&m.dataTables[this._formBindingRelation[p]]){const E=(_=this._formDataSet)==null?void 0:_.dataTables[c];i.includes(c)||(E.clear(),i.push(c))}this.setControlEmptyValue(p)}})}else this.setControlEmptyValue(n.trim())})}}clearLayoutOrGridData(...r){if(this.isNullOrEmpty(r)?r=Object.keys(this._formBindingRelation):r.length===1&&r[0]&&typeof r[0]=="string"&&(r=r[0].split(",")),r&&r.length>0){const i=[];r.forEach(n=>{if(n.trim().length>0)if(this._formBindingRelation[n.trim()]&&this._formBindingRelation[n.trim()].length>0){const c=this._formBindingRelation[n.trim()];this.getRelationConfigIdsByTableName(c).forEach(p=>{var m,_;if((m=this._formDataSet)!=null&&m.dataTables[this._formBindingRelation[p]]){const E=(_=this._formDataSet)==null?void 0:_.dataTables[c];i.includes(c)||(E.clear(),i.push(c))}this._gridOptions[p]})}else this.setControlEmptyValue(n.trim())})}}getRelationConfigIdsByTableName(r){const i=[];return(r==null?void 0:r.trim().length)>0&&this._formBindingRelation&&Object.keys(this._formBindingRelation).forEach(n=>{this._formBindingRelation[n]===r.trim()&&i.push(n)}),i}setGridServerPagingQuery(r,i,n,c=!0){var d,p,m,_;if(r){const E=this.getGrid(r);E&&((p=(d=E.gridOptions.context)==null?void 0:d.pageOptions)==null?void 0:p.pagination)==="server"&&((_=(m=E.gridOptions.context)==null?void 0:m.pageOptions)==null?void 0:_.pageSize)>0&&(E.gridOptions.context.pageOptions.pageFilter=i,E.gridOptions.context.pageOptions.pageQuery=n,c&&this.excuteGridServerPaging(E,1))}}setGridServerPagingService(r,i,n,c=!0){r&&(n==null?void 0:n.trim().length)>0&&this.setGridServerPagingQuery(r,i,d=>new Promise(async(p,m)=>{var B,Q;const _=new ut.EiInfo;Object.keys(i.getBlocks()).forEach(N=>{_.addBlock(i.getBlock(N))});const E={flag:-1,msg:"",data:void 0,total:0},A=(Q=(B=this.getGrid(r).gridOptions.context)==null?void 0:B.pageOptions)==null?void 0:Q.pageSize;_.addBlock(e.Core.buildEiBlock([{PAGE_NUM:d,PAGE_SIZE:A}],"PAGEINFO")),await this.callService(n.trim(),_,void 0,{messageError:!0}).then(N=>{N.sys.status>=0&&(E.flag=0,E.data=N.getBlock(0),E.total=N.getBlock(0).length,N.contains("PAGEINFO")&&(E.total=N.getBlock("PAGEINFO").data[0].TOTAL_RECORD))}),p(E)}),c)}setGridServerPagingDataSource(r,i,n,c,d=!0){r&&(n==null?void 0:n.trim().length)>0&&(c==null?void 0:c.trim().length)>0&&this.setGridServerPagingQuery(r,i,p=>new Promise(async(m,_)=>{var Q,N;const E=new ut.EiInfo;Object.keys(i.getBlocks()).forEach(W=>{E.addBlock(i.getBlock(W))});const v={flag:-1,msg:"",data:void 0,total:0},B=(N=(Q=this.getGrid(r).gridOptions.context)==null?void 0:Q.pageOptions)==null?void 0:N.pageSize;E.addBlock(e.Core.buildEiBlock([{FUNCTION_ID:n}],"DATA_SOURCE")),E.addBlock(e.Core.buildEiBlock([{PAGE_NUM:p,PAGE_SIZE:B}],"PAGEINFO")),await this.callService(c.trim(),E).then(W=>{W.sys.status>=0&&(v.flag=0,v.data=W.getBlock(0),v.total=W.getBlock(0).length,W.contains("PAGEINFO")&&(v.total=W.getBlock("PAGEINFO").data[0].TOTAL_RECORD))}),m(v)}),d)}async excuteGridServerPaging(r,i){var c,d,p,m;const n=this.getGrid(r);if(n&&((p=(d=(c=n.gridOptions)==null?void 0:c.context)==null?void 0:d.pageOptions)!=null&&p.pageQuery)){const _=await n.gridOptions.context.pageOptions.pageQuery(i>0?i-1:0);if((_==null?void 0:_.flag)>=0&&_.data){this.mergeDataToGrid(_.data,r);const E=(m=n.gridOptions)==null?void 0:m.api.getStatusPanel("PaginationPanel");E&&E.setPagination({currentPage:i,totalCount:_.total})}return _}}}e.FormHelper=y;class O{constructor(r,i){j(this,"_formHelper");this._formHelper=r}}e.BillFormHelper=O;class D{constructor(r,i,n,c,d){j(this,"MasterDetailView",!0);j(this,"FormConfigQueryService","");j(this,"FormCaption","");j(this,"CustomFilterString","");j(this,"CustomFilterJson");j(this,"BordStyle");j(this,"app");j(this,"div");j(this,"DefaultValues",{values:{},readonly:{}});j(this,"Context");j(this,"WindowOpened",l.ref(!1));j(this,"DataModelId","");j(this,"ShowCheckBoxColumn");j(this,"SelectMode");j(this,"ShowQueryButton",!0);j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"QueryButtonCaption","");j(this,"OkButtonCaption","");j(this,"CancelButtonCaption","");j(this,"CloseDialogWhenOkClick",!0);j(this,"ShowQueryNoDetailInfoMsg",!0);j(this,"ButtonPreventDefault",{ok:!1,cancel:!1,query:!1,mainViewFocusChanged:!1});j(this,"UnMountWhenCloseDialog",!1);j(this,"AutoQuery",!1);j(this,"AutoRefresh",!1);j(this,"KeyFieldName","");j(this,"DescFieldName","");j(this,"ChooseKeyValues","");j(this,"ReceiveJsonData");j(this,"LayoutGroupFilterId","LayoutGroupFilter");j(this,"MainViewConfigId","gridView1");j(this,"DetailViewConfigId","gridView2");j(this,"LayoutFilterOptions",{});j(this,"MainViewOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"DetailViewOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"MainInfoQueryMethod");j(this,"DetailInfoQueryMethod");j(this,"_partition");j(this,"_queryPartition");j(this,"_formName","");j(this,"_layoutConfigIds","");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dialogReturnInfo");j(this,"_mainTableame","");j(this,"_detailTableame","");j(this,"_queryService","");j(this,"_serviceFilter","");j(this,"_keyFieldValue",{});j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_component");j(this,"_resolveDialogResult");j(this,"queryMainGridInfo",(r=!0)=>{const i=this.ErFormHelper.getGridCurrentRow(this.MainViewConfigId,!0);if(i&&this.KeyFieldName.trim().length>0&&this.KeyFieldName.trim().split(",").forEach(c=>{c.trim().length>0&&i[c.trim().toUpperCase()]&&(this._keyFieldValue[c.trim().toUpperCase()]=i[c.trim().toUpperCase()])}),this.MainInfoQueryMethod&&this.MainInfoQueryMethod instanceof Function)this.MainInfoQueryMethod(this),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue);else if(this.FormConfigQueryService.trim().length>0)this._formHelper.queryDataByButton("btnQuery",this.LayoutGroupFilterId,this.CustomFilterString,this.CustomFilterJson).then(n=>{var c,d,p;if(e.Core.toNumber((c=n==null?void 0:n.SysInfo)==null?void 0:c.Flag)===-603){this._formHelper.messageWarning(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}else if(e.Core.toNumber((d=n==null?void 0:n.SysInfo)==null?void 0:d.Flag)<0){this._formHelper.messageError(((p=n==null?void 0:n.SysInfo)==null?void 0:p.Msg)||"");return}else{n.getBlock(this._mainTableame)?this._formHelper.mergeDataToLayoutOrGrid(n.getBlock(this._mainTableame),!0,this.MainViewConfigId):this._formHelper.mergeDataToLayoutOrGrid(n.getBlockByIndex(0),!0,this.MainViewConfigId);const m=this._formHelper.getGridDataCount(this.MainViewConfigId);m>0?(r&&this._formHelper.messageInfo(e.Core.$t("ERX.QueryResultWithRecords",[m.toString()])||e.Core.stringFormat("查询完成,共查询到[{0}]条数据",m)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue)):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}});else if(this._queryService.trim().length>0){let n="";this.CustomFilterString&&this.CustomFilterString.trim().length>0?this._serviceFilter.trim().length>0?n=this._serviceFilter+" and "+this.CustomFilterString:n=this.CustomFilterString.trim():this._serviceFilter.trim().length>0&&(n=this._serviceFilter),this._formHelper.queryDataByDataSource(this._queryService,{filterConfigId:this.LayoutGroupFilterId,queryType:this.CustomFilterJson,customFilter:n}).then(c=>{var d,p,m;if(e.Core.toNumber((d=c==null?void 0:c.SysInfo)==null?void 0:d.Flag)===-603){this._formHelper.messageWarning(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}else if(e.Core.toNumber((p=c==null?void 0:c.SysInfo)==null?void 0:p.Flag)<0){this._formHelper.messageError(((m=c==null?void 0:c.SysInfo)==null?void 0:m.Msg)||"");return}else{this._formHelper.mergeDataToLayoutOrGrid(c.getBlockByIndex(0),!0,this.MainViewConfigId);const _=this._formHelper.getGridDataCount(this.MainViewConfigId);_>0?(r&&this._formHelper.messageInfo(e.Core.$t("ERX.QueryResultWithRecords",[_.toString()])||e.Core.stringFormat("查询完成,共查询到[{0}]条数据",_)),this._formHelper.setGridIndicator(this.MainViewConfigId,this._keyFieldValue)):(this._formHelper.clearGridData(this.DetailViewConfigId),r&&this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryResultWithNoRecords")||"查询完成,没有符合条件的记录"))}})}else{this._formHelper.messageInfo(this._formHelper.$t("ERX.QueryServiceNoConfigured")||"未配置查询服务");return}});j(this,"autoCheckRows",()=>{if(this.KeyFieldName.trim().length>0&&this.ChooseKeyValues&&this.ChooseKeyValues.trim().length>0){const r=this.ChooseKeyValues.trim().split(","),i=this.ErFormHelper.getGrid(this.MainViewConfigId);i&&this.ErFormHelper.getGridAllRows(i).forEach(c=>{r.findIndex(p=>p===c[this.KeyFieldName])>=0&&this.ErFormHelper.checkGridRow(i,c)})}});this._initializeFlag=0,this._partition=r,this._formName=i,n&&(this._layoutConfigIds=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new e.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,i){return new Promise((n,c)=>{this._partition=r&&r.trim()||this._partition,this._serviceName=i&&i.trim()||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigIds,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B;if(d.flag===1)if(((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0){const Q=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORM)==null?void 0:B.getMappedRows()[0];this._formOptions.value.title=this._formOptions.value.title??Q.FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??t.toNumber(Q.FORM_WIDTH),this._formOptions.value.height=this._formOptions.value.height??t.toNumber(Q.FORM_HEIGHT),this.BordStyle=this.BordStyle??(Q.FORM_STYLE==="3"?"Fixed":"Sizable");const N=this._formHelper.getSingleViewConfigInfo(this.MainViewConfigId);N&&(this._mainTableame=N.TABLE_NAME,this._queryService=N.SVC_NAME,this._serviceFilter=N.FILTER_STRING,this.KeyFieldName.trim().length===0&&(this.KeyFieldName=N.KEY_FIELDS)),this._formHelper.containsConfig(this.DetailViewConfigId)||(this.DetailViewConfigId=""),this.ShowCheckBoxColumn!==void 0&&(N.SHOW_SELECTION=this.ShowCheckBoxColumn?"1":"0",N.MULTI_SELECT_MODE=this.ShowCheckBoxColumn?"2":"1"),this._initializeFlag=1}else t.messageError("Failed to retrieve form ["+this._formName+"]'s configuration information");else t.messageError("ErPopQueryHelper initialize faild, error msg is ["+d.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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i,n){return new Promise((c,d)=>{i&&this.setEvent("ok",i),n&&this.setEvent("cancel",n),this.app?this.WindowOpened.value=!0:this.Initialize().then(async p=>{var E,v;if(this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>ep),(E=this._component)!=null&&E.default&&(this._component=this._component.default))),this.doEvent("initial",this),this.FormConfigQueryService.trim().length===0){const A=this._formHelper.getFormButtonConfigInfo("btnQuery");this.FormConfigQueryService=((v=A==null?void 0:A.SVC_NAME)==null?void 0:v.trim())||""}this.MainViewOptions.masterDetail=this.MasterDetailView,this._initializeFlag=1;const m=l.createApp(this._component,{popQueryHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});m.component("ag-grid-vue",Pt.AgGridVue),m.component("v-splitter",Ia.Splitpanes),m.component("v-splitter-pane",Ia.Pane),this.app=m;const _=document.createElement("div");document.body.appendChild(_),this.div=_,m.mount(_),this.WindowOpened.value=!0}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}}e.PopQueryHelper=D;class I{constructor(r,i,n,c,d){j(this,"LayoutCaption",{});j(this,"EditType","Add");j(this,"Context",{});j(this,"WindowOpened",l.ref(!1));j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"CancelButtonPreventDefault",!1);j(this,"OkButtonService","");j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"ExtendJsonData");j(this,"BeforeCallService");j(this,"app");j(this,"div");j(this,"_partition");j(this,"_savePartition");j(this,"_formName","");j(this,"_tableName","");j(this,"_layoutConfigId","");j(this,"_layoutGroupIdArray",[]);j(this,"_layoutGroupInfo",{});j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dataSet");j(this,"_dataTable");j(this,"_mainLayoutId","");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_readOnlys");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_component");j(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=i,n&&(this._layoutConfigId=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new y(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,i){return new Promise((n,c)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,this._layoutConfigId,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me,ge;if(d.flag===1){if(((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0){const le=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORM)==null?void 0:B.getMappedRows()[0];if(this._formOptions.value.title=this._formOptions.value.title??le.FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??t.toNumber(le.FORM_WIDTH),this._formOptions.value.height=this._formOptions.value.height??t.toNumber(le.FORM_HEIGHT),this.BordStyle=this.BordStyle??(le.FORM_STYLE==="3"?"Fixed":"Sizable"),((J=(W=(N=(Q=this._formHelper)==null?void 0:Q.ConfigInfo)==null?void 0:N.TSI00FORMBUTTON)==null?void 0:W.getMappedRows())==null?void 0:J.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.getMappedRows().every(Y=>Y.BUTTON_NAME==="btnOk"?(this.OkButtonService=Y.SVC_NAME,!1):!0),((me=(ue=(Se=(re=this._formHelper)==null?void 0:re.ConfigInfo)==null?void 0:Se.TSI00GRIDVIEW)==null?void 0:ue.getMappedRows())==null?void 0:me.length)>0)for(let Y=0;Y<((ce=(Te=(Z=this._formHelper)==null?void 0:Z.ConfigInfo)==null?void 0:Te.TSI00GRIDVIEW)==null?void 0:ce.getMappedRows().length);Y++){const Fe=(ge=(Me=(ze=this._formHelper)==null?void 0:ze.ConfigInfo)==null?void 0:Me.TSI00GRIDVIEW)==null?void 0:ge.getMappedRows()[Y];Y==0&&(this._mainLayoutId=Fe.FUNCTION_ID,this._tableName=this._formHelper.setBindingTableName(this._mainLayoutId),this._dataSet=this._formHelper.FormDataSet,this._dataTable=this._formHelper.getBindingTable(this._mainLayoutId)),this._layoutGroupIdArray.push(Fe.FUNCTION_ID),this._layoutGroupInfo[Fe.FUNCTION_ID]=Fe}this._initializeFlag=1}}else{const le="ErPopFreeHelper initialize faild, error msg is ["+d.msg+"]";t.messageError(le)}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,i){return r&&r instanceof T&&(r=r.toJSON()),r&&Object.keys(r).length>0&&(this._receiveData=r,this._readOnlys=i),this._receiveData}setEvent(r,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setValue(r,i=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,void 0,i),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,i,n){return new Promise((c,d)=>{const p=m=>{if(this.EditType==="Add"){const _=this._formHelper.getLayoutConfigDefaultValues(this._layoutGroupIdArray);this._receiveData={..._,...this._receiveData}}this.WindowOpened.value=!0};i&&this.setEvent("ok",i),n&&this.setEvent("cancel",n),this.app?p():this.Initialize().then(async m=>{var v;this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>Y5),(v=this._component)!=null&&v.default&&(this._component=this._component.default))),this.doEvent("initial",this),this._initializeFlag=1;const _=l.createApp(this._component,{popFreeHelperProp:this,formWidth:Number(this.getFormOption("width")??this.getFormOption("formWidth")??-1),formHeight:Number(this.getFormOption("height")??this.getFormOption("formHeight")??-1)});_.component("ag-grid-vue",Pt.AgGridVue),this.app=_;const E=document.createElement("div");document.body.appendChild(E),this.div=E,_.mount(E),p()}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.doEvent("close",this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo={...this._dialogReturnInfo,...r}}}e.PopFreeHelper=I;class M{constructor(r,i,n,c,d){j(this,"LayoutOptions",{});j(this,"GridOptions",l.reactive({groupDisplayType:"groupRows"}));j(this,"LayoutCaption");j(this,"EditType","Add");j(this,"Context",{});j(this,"WindowOpened",l.ref(!1));j(this,"ShowSaveButton",!0);j(this,"ShowCloseButton",!0);j(this,"SaveButtonCaption","");j(this,"CloseButtonCaption","");j(this,"CloseDialogWhenSaveClick",!1);j(this,"PreventDefaultEvent",{});j(this,"OkButtonService","");j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"ExtendJsonData");j(this,"BeforeCallService");j(this,"app");j(this,"div");j(this,"_partition");j(this,"_savePartition");j(this,"_formName","");j(this,"_mainTableName","");j(this,"_detailTableName","");j(this,"_layoutConfigId","LayoutGroupMain");j(this,"_gridConfigId","gridView1");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",0);j(this,"_formHelper");j(this,"_dataSet");j(this,"_mainDataTable");j(this,"_detailDataTable");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_readOnlys");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_resolveDialogResult");this._initializeFlag=0,this._partition=r,this._formName=i,this._layoutConfigId=(n==null?void 0:n.layoutConfigId)||this._layoutConfigId,this._gridConfigId=(n==null?void 0:n.gridConfigId)||this._gridConfigId,c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new y(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 l.reactive(((r=this._dataSet)==null?void 0:r.getCurrentDataObject(this._mainTableName))||new e.Model)}get DialogReturnInfo(){return this._dialogReturnInfo}get ReadOnlys(){return this._readOnlys}async Initialize(r,i){return new Promise((n,c)=>{this._partition=(r==null?void 0:r.trim())||this._partition,this._serviceName=(i==null?void 0:i.trim())||this._serviceName,this._formHelper.Initialize(this._partition,this._formName,`${this._layoutConfigId},${this._gridConfigId}`,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_,E,v,A,B,Q;if(d.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),((E=(_=(m=(p=this._formHelper)==null?void 0:p.ConfigInfo)==null?void 0:m.TSI00FORM)==null?void 0:_.getMappedRows())==null?void 0:E.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM.data[0].FORM_STYLE==="3"?"Fixed":"Sizable"),((Q=(B=(A=(v=this._formHelper)==null?void 0:v.ConfigInfo)==null?void 0:A.TSI00FORMBUTTON)==null?void 0:B.getMappedRows())==null?void 0:Q.length)>0&&this._formHelper.ConfigInfo.TSI00FORMBUTTON.getMappedRows().every(N=>N.BUTTON_NAME==="btnOk"?(this.OkButtonService=N.SVC_NAME,!1):!0),this._initializeFlag=1);else{const N="ErPopFormHelper initialize faild, error msg is ["+d.msg+"]";t.messageError(N)}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,i){this._receiveData=r,this._readOnlys=i}setEvent(r,i,n=!1){this._events[r]=i,this.PreventDefaultEvent[r]=n}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setValue(r,i=!0){return this.InitializeFlag>=0&&this.DataModel&&r&&this.DataModel.setData(r,i),this}getValue(r){return this.DataModel?this.DataModel.get(r):void 0}show(r,i,n){return new Promise((c,d)=>{const p=()=>{var m,_,E;if(this.EditType==="Add"){const v=this._formHelper.getLayoutConfigDefaultValues(this._layoutConfigId);this._receiveData={...v,...this._receiveData}}(m=this.DataModel)==null||m.reset(),(_=this.DataModel)==null||_.setData(this._receiveData),this.DataModel.dirty=!1,this.DataModel.dirtyFields={},(E=this._dataSet)==null||E.acceptChanges(),this.WindowOpened.value=!0};i&&this.setEvent("save",i),n&&this.setEvent("close",n),this.app?p():this.Initialize().then(m=>{this._initializeFlag=1,this.doEvent("initial",this);const _=l.createApp(r,{popFormHelperProp:this,formWidth:this.getFormOption("width"),formHeight:this.getFormOption("height")});_.component("ag-grid-vue",Pt.AgGridVue),this.app=_;const E=document.createElement("div");document.body.appendChild(E),this.div=E,_.mount(E),p()}),this._resolveDialogResult={resolve:c,reject:d}})}CloseDialog(){this._resolveDialogResult.resolve(this._dialogReturnInfo),this.WindowOpened.value=!1}setDialogReturnInfo(r){this._dialogReturnInfo=r}}e.PopFormHelper=M;class G{constructor(r,i,n,c){j(this,"Context",{});j(this,"BordStyle");j(this,"AutoRefresh",!1);j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"CancelButtonPreventDefault",!1);j(this,"UnMountWhenCloseDialog",!1);j(this,"BeforeOkButtonClick");j(this,"_app");j(this,"_dialogReturnInfo");j(this,"_receiveData");j(this,"_events",{});j(this,"_windowOpened",l.ref(!1));j(this,"_options",l.reactive({title:"标题",width:360,height:630}));j(this,"_component");j(this,"_resolveDialogResult");j(this,"_primaryField");j(this,"_parentField");j(this,"_displayField");this._primaryField=r,this._parentField=i,this._displayField=n,this.setOptions(c||{})}get FormId(){return t.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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}setOptions(r){this._options={...this._options,...r}}getOptions(r){return r?this._options[r]:this._options}receiveData(r){this._receiveData=r}show(r,i,n){return new Promise(async(c,d)=>{var p;if(i&&this.setEvent("ok",i),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(()=>rp),(p=this._component)!=null&&p.default&&(this._component=this._component.default)));const m=l.createApp(this._component,{popTreeHelperProp:this});m.component("ag-grid-vue",Pt.AgGridVue),this._app=m;const _=document.createElement("div");document.body.appendChild(_),m.mount(_),this._windowOpened.value=!0}this._resolveDialogResult={resolve:c,reject:d}})}close(){this._windowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}}e.PopTreeHelper=G;class te{constructor(r){j(this,"Content","");j(this,"Context",{});j(this,"BordStyle");j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"UnMountWhenCloseDialog",!1);j(this,"BeforeOkButtonClick");j(this,"_app");j(this,"_windowOpened",l.ref(!1));j(this,"_options",l.reactive({title:"标题"}));j(this,"_resolveDialogResult");j(this,"_dialogReturnInfo");j(this,"_events",{});j(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,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i,n=!0){return new Promise(async(c,d)=>{var p,m;if(this._app)this._windowOpened.value=!0;else{this._component||(this._component=r,this._component||(this._component=await Promise.resolve().then(()=>q5),(p=this._component)!=null&&p.default&&(this._component=this._component.default)));const _=l.createApp(this._component,{popRichEditorProps:this,options:this._options,content:i});_.use(et),((m=this._options)==null?void 0:m.extension)==="dropdown"&&_.component("ag-grid-vue",Pt.AgGridVue),this._app=_;const E=document.createElement("div");document.body.appendChild(E),_.mount(E),this._windowOpened.value=!0}this._resolveDialogResult={resolve:c,reject:d}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve(this._dialogReturnInfo)}}e.PopRichEditor=te;class b{constructor(r,i,n){j(this,"_app");j(this,"_component");j(this,"_windowOpened",l.ref(!1));j(this,"_partition","");j(this,"_formName","");j(this,"_gridConfigId","");j(this,"_erGrid","");j(this,"_resolveDialogResult");var c,d;this._erGrid=n,this._partition=r,this._formName=i,this._gridConfigId=(d=(c=n==null?void 0:n.gridOptions)==null?void 0:c.context)==null?void 0:d.configId}get WindowOpened(){return this._windowOpened}get Partition(){return this._partition}get FormName(){return this._formName}get GridConfigId(){return this._gridConfigId}get ErGrid(){return this._erGrid}show(){return new Promise(async(r,i)=>{var n;if(this._app)this._windowOpened.value=!0;else if((n=this._component)!=null&&n.default&&this._gridConfigId){const c=l.createApp(this._component.default,{popGridGroupHelperProps:this});c.component("ag-grid-vue",Pt.AgGridVue),c.component("v-splitter",Ia.Splitpanes),c.component("v-splitter-pane",Ia.Pane),this._app=c;const d=document.createElement("div");document.body.appendChild(d),c.mount(d),this._windowOpened.value=!0}else i({result:"import component error!"});this._resolveDialogResult={resolve:r,reject:i}})}close(){this._windowOpened.value=!1,this._resolveDialogResult.resolve({result:"success"})}}e.PopGridGroupHelper=b;class P{constructor(r,i,n,c,d){j(this,"FormCaption");j(this,"Context");j(this,"WindowOpened",l.ref(!1));j(this,"ShowOkButton",!0);j(this,"ShowCancelButton",!0);j(this,"OkButtonCaption","确定");j(this,"CancelButtonCaption","取消");j(this,"CloseDialogWhenOkClick",!0);j(this,"OkButtonPreventDefault",!1);j(this,"UnMountWhenCloseDialog",!1);j(this,"BordStyle");j(this,"app");j(this,"_partition");j(this,"_formName","");j(this,"_configIds","");j(this,"_sysConfiParas");j(this,"_serviceName","JAER01/getFormConfig");j(this,"_initializeFlag",l.ref(0));j(this,"_formHelper");j(this,"_dataSet");j(this,"_dialogReturnInfo");j(this,"_events",{});j(this,"_formOptions",l.ref({}));j(this,"_resolveDialogResult");this._initializeFlag.value=0,this._partition=r,this._formName=i,n&&(this._configIds=n),c&&c.trim().length>0&&(this._serviceName=c),this._sysConfiParas=d,this._formHelper=new e.FormHelper(this._partition,this._formName,this._serviceName)}get Partiton(){return this._partition?this._partition:""}get FormId(){return this._formHelper.FormId}get FormName(){return this._formName}get InitializeFlag(){return this._initializeFlag.value}get FormHelper(){return this._formHelper}get DialogReturnInfo(){return this._dialogReturnInfo}get DataSet(){return this._dataSet}async Initialize(r,i){return new Promise((n,c)=>{r&&r.trim().length>0&&(this._partition=r),i&&i.trim().length>0&&(this._serviceName=i),this._formHelper.Initialize(this._partition,this._formName,this._configIds,this._serviceName,this._sysConfiParas).then(d=>{var p,m,_;d.flag===1?(this._dataSet=this._formHelper.FormDataSet,((_=(m=(p=this._formHelper.ConfigInfo)==null?void 0:p.TSI00FORM)==null?void 0:m.getMappedRows())==null?void 0:_.length)>0&&(this._formOptions.value.title=this._formOptions.value.title??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_FUNC_DESC,this._formOptions.value.width=this._formOptions.value.width??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_WIDTH,this._formOptions.value.height=this._formOptions.value.height??this._formHelper.ConfigInfo.TSI00FORM.getMappedRows()[0].FORM_HEIGHT,this.BordStyle=this.BordStyle??(this._formHelper.ConfigInfo.TSI00FORM.data[0].FORM_STYLE==="3"?"Fixed":"Sizable"),this._initializeFlag.value=1)):t.messageError("ErPopWindowHelper initialize faild, error msg is ["+d.msg+"]"),n(this._initializeFlag.value)})})}setFormOptions(r){r&&(this._formOptions.value={...this._formOptions.value,...r})}getFormOption(r){return this._formOptions.value[r]}setEvent(r,i){this._events[r]=i}getEvent(r){return this._events[r]}doEvent(r,i){const n=this._events[r];if(n)return n(i)}show(r,i){return new Promise(async(n,c)=>{r&&this.setEvent("ok",r),i&&this.setEvent("cancel",i),this.InitializeFlag<=0&&await this.Initialize(),this.WindowOpened.value=!0,this._resolveDialogResult={resolve:n,reject:c}})}OpenDialog(r,i){return this.show(r,i)}CloseDialog(){this.WindowOpened.value=!1}setDialogReturnInfo(r){this._resolveDialogResult.resolve(this._dialogReturnInfo),this._dialogReturnInfo=r}}e.PopWindowHelper=P;class Ee{static showErPopQuery(r,i,n,c){return i.show(r,n,c)}static showErPopFree(r,i,n,c){return i.show(r,n,c)}static showErPopApprovalSteps(r,i,n){i.showPopApprovalSteps(r,n.partition,n.instanceId,n.companyCode,n.bizBillNo,n.tableName,n.bizData)}}e.PopUtils=Ee;class fe{constructor(){j(this,"_app");j(this,"_partition","");j(this,"_instanceId","");j(this,"_companyCode","");j(this,"_bizBillNo","");j(this,"_tableName","");j(this,"_sysInfoFlag",0);j(this,"_sysInfoMsg","");j(this,"_popWindowOpened",l.ref(!1));j(this,"_isEmpty",l.ref(!0));j(this,"_haveSteps",l.ref(!1));j(this,"_activeSteps",l.ref(0));j(this,"_workStepsInfo",l.ref([]));j(this,"_approveInfo",l.ref([]));j(this,"_approveResultMap",{S:"报批",C:"撤销",Y:"通过",N:"否决",R:"退回"});this.reset()}get Partition(){return this._partition}get InstanceId(){return this._instanceId}get CompanyCode(){return this._companyCode}get BizBillNo(){return this._bizBillNo}get TableName(){return this._tableName}get SysInfoFlag(){return this._sysInfoFlag}get SysInfoMsg(){return this._sysInfoMsg}get HaveSteps(){return this._haveSteps.value}get ActiveSteps(){return this._activeSteps.value}get WorkStepsInfo(){return this._workStepsInfo.value}get ApproveInfo(){return this._approveInfo.value}get IsEmpty(){return this._isEmpty.value}get PopWindowOpened(){return this._popWindowOpened.value}async getApprovalInfo(r,i,n,c,d,p){return new Promise(async(m,_)=>{let E=[],v=[],A=0;this._partition=r,this._instanceId=i,this._companyCode=n,this._bizBillNo=c,this._tableName=d,this._sysInfoFlag=0,this._sysInfoMsg="",p===void 0&&(p={}),p.WF_REC_ID=i,p.BIZ_BILL_NO=c,p.COMPANY_CODE=n,p.TABLE_NAME=d;const B=new ut.EiInfo,Q=t.buildEiBlock([p]);B.addBlock(Q),await t.callService("si00wf_inq",B).then(N=>{var W,J,re,Se,ue;if(e.Core.toNumber((W=N==null?void 0:N.SysInfo)==null?void 0:W.Flag)!==0)this._sysInfoFlag=((J=N==null?void 0:N.SysInfo)==null?void 0:J.Flag)||-1,this._sysInfoMsg=((re=N==null?void 0:N.SysInfo)==null?void 0:re.Msg)||"",t.messageError("获取审批信息出错,业务单据号["+c+"],流程实例["+i+"],错误信息["+this._sysInfoMsg+"]");else if(((Se=N.getBlock("WORKFLOW"))==null?void 0:Se.getMappedRows().length)>0){let me=!1;E=N.getBlock("WORKFLOW").getMappedRows(),E.forEach(Z=>{if(t.toString(Z.EXEC_PERSON).length>0)A++;else if(N.getBlock("EXCUTEUSERINFO")&&!me){let Te=N.getBlock("EXCUTEUSERINFO").getMappedRows().length;Te>5&&(Te=5);let ce="";for(let ze=0;ze<Te;ze++){let Me=t.toString(N.getBlock("EXCUTEUSERINFO").getMappedRows()[ze].USER_NAME);Me=Me.substring(Me.indexOf(":")+1),ce.length===0?ce=Me:ce+=","+Me}Z.EXEC_PERSON=ce,me=!0}else Z.EXEC_PERSON="";if(t.toString(Z.EXEC_DATETIME).length>=14&&Z.EXEC_DATETIME.substring(0,4)!=="1901"){const Te=Z.EXEC_DATETIME;Z.EXEC_DATETIME=Te.substring(0,4)+"-"+Te.substring(4,6)+"-"+Te.substring(6,8)+" "+Te.substring(8,10)+":"+Te.substring(10,12)+":"+Te.substring(12,14)}else Z.EXEC_DATETIME="";Z.title=Z.NODE_NAME,Z.description=Z.EXEC_PERSON+" "+Z.EXEC_DATETIME}),this._haveSteps.value=!0,this._workStepsInfo.value=E,this._activeSteps.value=A}else this._haveSteps.value=!1,this._workStepsInfo.value=[],this._activeSteps.value=-1;((ue=N.getBlock("TSI00APPROVEINFO"))==null?void 0:ue.getMappedRows().length)>0?(N.getBlock("TSI00APPROVEINFO").getMappedRows().forEach(me=>{if(me.APPROVE_RESULT_DESC=this._approveResultMap[me.APPROVE_RESULT]||me.APPROVE_RESULT,me.APPROVE_TIME&&me.APPROVE_TIME.trim().length>=14){const Z=me.APPROVE_TIME;me.APPROVE_TIME=Z.substring(0,4)+"-"+Z.substring(4,6)+"-"+Z.substring(6,8)+" "+Z.substring(8,10)+":"+Z.substring(10,12)+":"+Z.substring(12,14)}}),this._approveInfo.value=v):this._approveInfo.value=[],this._isEmpty.value=!this._haveSteps.value&&v.length===0,m(this)})})}reset(){this._partition="",this._instanceId="",this._companyCode="",this._bizBillNo="",this._tableName="",this._sysInfoFlag=0,this._sysInfoMsg="",this._isEmpty.value=!0,this._haveSteps.value=!1,this._activeSteps.value=0,this._workStepsInfo.value=[],this._approveInfo.value=[]}showPopApprovalSteps(r,i,n,c,d,p,m){this.getApprovalInfo(i,n,c,d,p,m).then(_=>{if(this._app)this._popWindowOpened.value=!0;else{const E=l.createApp(r,{approvalStepsHelperProp:this,formWidth:-1,formHeight:-1});E.component("ag-grid-vue",Pt.AgGridVue),E.component("v-splitter",Ia.Splitpanes),E.component("v-splitter-pane",Ia.Pane),this._app=E;const v=document.createElement("div");document.body.appendChild(v),E.mount(v),this._popWindowOpened.value=!0}})}}e.ApprovalStepsHelper=fe;class H{constructor(r){j(this,"UnMountWhenCloseDialog",!0);j(this,"_app");j(this,"_options",{});j(this,"_popWindowOpened",l.ref(!1));this._options=r||{},this.UnMountWhenCloseDialog=!0}get Options(){return this._options}get PopWindowOpened(){return this._popWindowOpened}setOptions(r){this._options={...this._options,...r}}showPopAttachment(r){if(this._app)this._options.refreshKey=e.Core.guid(),this._popWindowOpened.value=!0;else{const i=l.createApp(r,{attachmentHelperProps:this,formWidth:-1,formHeight:-1});this._app=i;const n=document.createElement("div");document.body.appendChild(n),i.mount(n),this._popWindowOpened.value=!0}}}e.AttachmentHelper=H})(F.ER||(F.ER={}));const $7={style:{display:"inline-block"}},W7=l.defineComponent({name:"ErFormToolbar",components:{"a-button":et.Button,"a-tooltip":et.Tooltip,"a-config-providver":et.ConfigProvider}}),Do=l.defineComponent({...W7,props:{height:{type:String,default:"22px",require:!1},showPageButton:{type:Boolean,default:!0,require:!1},showPrintButton:{type:Boolean,default:!1,require:!1},showRefreshButton:{type:Boolean,default:!0,require:!1},showAddButton:{type:Boolean,default:!0,require:!1},showAddCopyButton:{type:Boolean,default:!0,require:!1},showDeleteButton:{type:Boolean,default:!0,require:!1},showSaveButton:{type:Boolean,default:!0,require:!1}},emits:["toolbarClick"],setup(e,{emit:a}){var T;const t=e,o=a,s=l.ref([]),f=l.ref([{name:"ToolbarFirst",caption:F.ER.Core.$t("ERX.ErFormToolbar.First")||"第一页",icon:l.h(it.StepBackwardOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarPre",caption:F.ER.Core.$t("ERX.ErFormToolbar.Pre")||"上一页",icon:l.h(it.CaretLeftOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarNext",caption:F.ER.Core.$t("ERX.ErFormToolbar.Next")||"下一页",icon:l.h(it.CaretRightOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarLast",caption:F.ER.Core.$t("ERX.ErFormToolbar.Last")||"最后一页",icon:l.h(it.StepForwardOutlined),type:"primary",ontSize:"18px"},{name:"ToolbarPrint",caption:F.ER.Core.$t("ERX.ErFormToolbar.Print")||"打印",icon:l.h(it.PrinterOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarRefresh",caption:F.ER.Core.$t("ERX.ErFormToolbar.Refresh")||"刷新",icon:l.h(it.SyncOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarAdd",caption:F.ER.Core.$t("ERX.ErFormToolbar.Add")||"新增",icon:l.h(it.PlusOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarAddCopy",caption:F.ER.Core.$t("ERX.ErFormToolbar.AddCopy")||"复制新增",icon:l.h(it.CopyOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarDelete",caption:F.ER.Core.$t("ERX.ErFormToolbar.Delete")||"删除",icon:l.h(it.CloseOutlined),type:"primary",fontSize:"18px"},{name:"ToolbarSave",caption:F.ER.Core.$t("ERX.ErFormToolbar.Save")||"保存",icon:l.h(it.CheckOutlined),type:"primary",fontSize:"18px"}]),u=l.ref(yr()),h=l.ref(zt());window.$wujie&&((T=window.$wujie.bus)==null||T.$on("changeThemeEmit",S=>{h.value=zt()}));const C=S=>{o("toolbarClick",{sender:S})};return l.onMounted(()=>{t.showPageButton||s.value.push("ToolbarFirst","ToolbarPre","ToolbarNext","ToolbarLast"),t.showPrintButton||s.value.push("ToolbarPrint"),t.showRefreshButton||s.value.push("ToolbarRefresh"),t.showAddButton||s.value.push("ToolbarAdd"),t.showAddCopyButton||s.value.push("ToolbarAddCopy"),t.showDeleteButton||s.value.push("ToolbarDelete"),t.showSaveButton||s.value.push("ToolbarSave")}),(S,x)=>{const y=l.resolveComponent("a-button"),O=l.resolveComponent("a-tooltip"),D=l.resolveComponent("a-config-providver");return l.openBlock(),l.createElementBlock("div",$7,[l.createVNode(D,{theme:h.value,locale:u.value,componentSize:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(f.value,I=>(l.openBlock(),l.createBlock(O,{key:I.name+"tooltip",title:I.caption},{default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createBlock(y,{key:I.name,id:I.name,icon:I.icon,type:I.type,onClick:M=>C(I),style:{padding:"1px 5px !important",margin:"1px","font-size":"13px"}},null,8,["id","icon","type","onClick"])),[[l.vShow,s.value.length>0?!(s.value.findIndex(M=>M===I.name)>=0):!0]])]),_:2},1032,["title"]))),128))]),_:1},8,["theme","locale"])])}}});function Bs(){var s;const e=l.getCurrentInstance();let a=e==null?void 0:e.appContext.config.globalProperties.$t;const t=e==null?void 0:e.appContext.config.globalProperties.hasOwnProperty("$t"),o=(s=ni==null?void 0:ni.global)==null?void 0:s.hasOwnProperty("t");if(!t&&o&&(a=ni.global.t),!t&&!o){const f=require("../../locales/erLocale/locale.zh_Hans.ts"),u=Object.keys(f)[0];a=h=>h.split(".").reduce((S,x)=>S?S[x]:void 0,f[u].default)}return{$t:a}}let On;const Y7=new Uint8Array(16);function X7(){if(!On&&(On=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!On))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return On(Y7)}const Ir=[];for(let e=0;e<256;++e)Ir.push((e+256).toString(16).slice(1));function Q7(e,a=0){return Ir[e[a+0]]+Ir[e[a+1]]+Ir[e[a+2]]+Ir[e[a+3]]+"-"+Ir[e[a+4]]+Ir[e[a+5]]+"-"+Ir[e[a+6]]+Ir[e[a+7]]+"-"+Ir[e[a+8]]+Ir[e[a+9]]+"-"+Ir[e[a+10]]+Ir[e[a+11]]+Ir[e[a+12]]+Ir[e[a+13]]+Ir[e[a+14]]+Ir[e[a+15]]}const Hs={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function q7(e,a,t){if(Hs.randomUUID&&!e)return Hs.randomUUID();e=e||{};const o=e.random||(e.rng||X7)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,Q7(o)}const j7=l.defineComponent({name:"ErPanel",components:{CaretUpOutlined:it.CaretUpOutlined,CaretDownOutlined:it.CaretDownOutlined,"a-button":et.Button},props:{showHeader:{type:Boolean,default:!0},showBorder:{type:Boolean,default:!0},flex:{type:Number||String,default:1},title:{type:String,default:""},height:{type:String,default:"auto",require:!1},padding:{type:String,default:"5px",require:!1},innerPadding:{type:String,default:"5px",require:!1},openHeaderShow:{type:Boolean,default:!1,require:!1},id:{type:String,default:`ef_panel_${q7()}`,require:!1},menuFormInstance:{type:Object,default:void 0,require:!1},buttonRegionId:{type:String,default:"",require:!1},isCollapsed:{type:Boolean,default:!1,require:!1}},emits:["queryClick","openHeaderChange","authButtonClick"],setup(e,{emit:a}){const{$t:t}=Bs(),o=l.ref([]),s=l.ref(!(e.isCollapsed&&e.openHeaderShow)),f=()=>{a("queryClick")},u=l.computed(()=>`${e.id}_query`),h=l.ref(e.isCollapsed&&e.openHeaderShow?"flex: none":typeof e.flex=="number"?`flex: ${e.flex}; overflow: hidden`:`flex: ${e.flex}; overflow: auto`),C=l.ref(e.isCollapsed&&e.openHeaderShow?"height: auto":`height: ${e.height}`),T=()=>{s.value=!s.value,h.value=s.value?`flex: ${e.flex}; overflow: hidden`:"flex: none",C.value=s.value?`height: ${e.height}`:"height: auto",a("openHeaderChange",s.value)},S=x=>{a("authButtonClick",x)};return l.onBeforeMount(()=>{var x,y,O,D,I;if((y=(x=e.menuFormInstance)==null?void 0:x.attrs)!=null&&y.__buttonsEi){const M=e.buttonRegionId||e.id;o.value=((I=(D=(O=e.menuFormInstance)==null?void 0:O.attrs)==null?void 0:D.__buttonsEi.getBlock(M))==null?void 0:I.getMappedRows())||[]}}),{tI18n:t,openHeader:s,flexStyle:h,heightStyle:C,searchButtonId:u,query:f,openHeaderChange:T,onAuthButtonClick:S,layoutAuthButtons:o}}}),K7=["id"],J7={key:0,class:"card-header"},Z7={class:"header-title"},eh={class:"header-right"},th={class:"customBtn"},rh={class:"openHeader"},ah={class:"body-content"};function ih(e,a,t,o,s,f){const u=l.resolveComponent("a-button"),h=l.resolveComponent("CaretDownOutlined"),C=l.resolveComponent("CaretUpOutlined");return l.openBlock(),l.createElementBlock("div",{class:"erpanel-root",id:e.id,style:l.normalizeStyle(`padding: ${e.padding}; ${e.flexStyle}; ${e.heightStyle};`)},[l.createElementVNode("div",{class:l.normalizeClass(["form-container erpanel-card",{"erpanel-border":e.showBorder}])},[e.showHeader?(l.openBlock(),l.createElementBlock("div",J7,[l.createElementVNode("div",Z7,l.toDisplayString(e.title?e.title:e.tI18n("ERX.Title")),1),l.createElementVNode("div",eh,[l.createElementVNode("div",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.layoutAuthButtons,T=>(l.openBlock(),l.createBlock(u,{style:{height:"21px",padding:"1px 5px !important",margin:"1px","font-size":"13px"},key:T.button_ename,name:T.button_ename,type:"primary",onClick:S=>e.onAuthButtonClick({buttonInfo:T,buttonName:T.button_ename,buttonCaption:T.button_cname})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T.button_cname),1)]),_:2},1032,["name","onClick"]))),128))]),l.createElementVNode("div",th,[l.renderSlot(e.$slots,"customButtonSlot")]),l.withDirectives(l.createElementVNode("div",rh,[e.openHeader?(l.openBlock(),l.createBlock(h,{key:0,style:{"font-size":"13px"},onClick:e.openHeaderChange},null,8,["onClick"])):(l.openBlock(),l.createBlock(C,{key:1,style:{"font-size":"13px"},onClick:e.openHeaderChange},null,8,["onClick"]))],512),[[l.vShow,e.openHeaderShow]])])])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["card-body",e.showHeader?"haveHeaderHeight":"noHeaderHeight"]),style:l.normalizeStyle(`padding: ${e.innerPadding};`)},[l.withDirectives(l.createElementVNode("div",ah,[l.renderSlot(e.$slots,"contentSlot")],512),[[l.vShow,e.openHeader]])],6)],2)],12,K7)}const Dr=sr(j7,[["render",ih]]),nh=l.defineComponent({props:{sameApp:{type:Boolean,required:!0},formName:{type:String,default:""},sameAppformName:{type:String,default:""},parentFormRef:{type:Object,default:null},modalZIndex:{type:Number,default:1e3},title:{type:String,default:""},width:{type:[String,Number],default:"50%"},height:{type:[String,Number],default:"50%"},message:{type:Object,default:()=>({})},destroy:{type:Function,default:()=>{}},debounce:{type:Boolean,default:!1},debounceWait:{type:Number,default:200},defaultWidth:{type:[String,Number],default:"50%"},defaultHeight:{type:[String,Number],default:"50%"},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},actions:{type:Array,default:["maximize","close"]}},components:{},emits:["clickClose","formResize","open"],setup(e,{emit:a}){const t=l.ref(),o=l.ref(),s=l.ref(),f=l.ref({x:0,y:0});l.ref({x:0,y:0});const u=l.ref(!1),h=l.ref({startX:0,startY:0,width:0,height:0,left:0,top:0}),C=l.ref(!1),T=l.ref(""),S=l.ref(!1),x=l.ref(""),y=l.ref(null);l.ref(!1);const O=l.ref(null),D=l.ref(""),I=l.computed(()=>{var r,i;return e.sameApp?{}:{prefix:(i=(r=window.$wujie)==null?void 0:r.props)==null?void 0:i.prefix,toSubPage:e.message,toXrEfForm:{showCloseEfDialogFormButton:!0}}}),M=l.computed(()=>{var r,i,n,c;return e.sameAppformName?`${(i=(r=he.value)==null?void 0:r[0])==null?void 0:i.DESCRIPTION}[${e.sameAppformName}]`:`${(c=(n=he.value)==null?void 0:n[0])==null?void 0:c.DESCRIPTION}[${e.formName}]`}),G=()=>{t.value&&a("formResize")},te=e.debounce?new ResizeObserver(qs.debounce(G,e.debounceWait)):new ResizeObserver(G),b=new IntersectionObserver(r=>{r[0].intersectionRatio>0&&e.parentFormRef&&S.value&&setTimeout(()=>{window.removeEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0)},1)}),P=()=>{e.parentFormRef&&b.observe(e.parentFormRef.value.$el)},Ee=()=>{e.parentFormRef&&b.unobserve(e.parentFormRef.value.$el)},fe=r=>{},H=async()=>{S.value=!0,l.nextTick(()=>{a("open"),te.observe(t.value)}),e.sameApp?e.sameAppformName&&z(e.sameAppformName):(P(),e.parentFormRef&&window.removeEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0)),l.nextTick(()=>{var r,i,n;e.draggable&&((r=s.value)==null||r.addEventListener("mousedown",ve)),e.resizable&&((i=t.value)==null||i.addEventListener("mousedown",$e),(n=t.value)==null||n.addEventListener("mousemove",Ke))})},oe=()=>{var r,i,n;(r=s.value)==null||r.removeEventListener("mousedown",ve),(i=t.value)==null||i.removeEventListener("mousedown",$e),(n=t.value)==null||n.removeEventListener("mousemove",Ke),document==null||document.removeEventListener("mousemove",Ke),document==null||document.removeEventListener("mouseup",X)},R=()=>{Ee(),t.value&&te.unobserve(t.value),e.sameApp?(oe(),S.value=!1):(e.parentFormRef&&window.addEventListener("keydown",e.parentFormRef.value.handleKeyDown,!0),e.destroy(()=>{oe(),S.value=!1},()=>{}))},K=()=>{a("clickClose"),R()},he=l.ref(),z=async r=>l.ref("").value,Ie=l.ref({zIndex:e.modalZIndex+1,width:"",height:"",top:"",left:""}),Ne=l.ref(e.width==="100%"&&e.height==="100%"),xe=()=>{if(Ne.value=!Ne.value,Ne.value)Ie.value.left="0",Ie.value.top="0",Ie.value.width="100%",Ie.value.height="100%";else{if(e.width==="100%"&&e.height==="100%"){const r=e.defaultWidth?e.defaultWidth==="100%"?"50%":e.defaultWidth:"50%",i=e.defaultHeight?e.defaultHeight==="100%"?"50%":e.defaultHeight:"50%";return Le(r,i),!1}Le()}},Le=(r,i)=>{let n="",c="",d="",p="";const m=r||e.width,_=i||e.height;if(typeof m=="string"){if(m.includes("%")){const E=+m.split("%")[0];n=E+"vw",p=`calc(50vw - ${E/2}vw)`}else if(m.includes("px")){const E=+m.split("px")[0];n=E+"px",p=`calc(50vw - ${E/2}px)`}}else typeof m=="number"&&(n=m+"px",p=`calc(50vw - ${m/2}px)`);if(typeof _=="string"){if(_.includes("%")){const E=+_.split("%")[0];c=E+"vh",d=`calc(50vh - ${E/2}vh)`}else if(_.includes("px")){const E=+_.split("px")[0];c=E+"px",d=`calc(50vh - ${E/2}px)`}}else typeof _=="number"&&(c=_+"px",d=`calc(50vh - ${_/2}px)`);Ie.value.left=p,Ie.value.top=d,Ie.value.width=n,Ie.value.height=c};Le();const ve=r=>{u.value=!0,f.value.x=r.clientX-t.value.offsetLeft,f.value.y=r.clientY-t.value.offsetTop,document.addEventListener("mousemove",Ge),document.addEventListener("mouseup",_e)},Ge=r=>{if(!u.value||C.value)return;const i=r.clientX-f.value.x,n=r.clientY-f.value.y;t.value.style.left=i+"px",t.value.style.top=n+"px",y.value&&(y.value.style.pointerEvents="none")},_e=r=>{u.value=!1,y.value&&(y.value.style.pointerEvents="auto")},$e=r=>{let i=pe(r);i!==""&&(C.value=!0,T.value=i,h.value.startX=r.clientX,h.value.startY=r.clientY,h.value.width=t.value.offsetWidth,h.value.height=t.value.offsetHeight,h.value.left=t.value.offsetLeft,h.value.top=t.value.offsetTop),C.value&&(document.body.style.userSelect="none"),document.addEventListener("mousemove",Ke),document.addEventListener("mouseup",X)},Ke=r=>{const i=pe(r);let n;if(i===""?n="default":n=i+"-resize",!!t.value&&(t.value.style.cursor=n,C.value)){if(y.value&&(y.value.style.pointerEvents="none"),T.value.indexOf("e")!==-1){const c=r.clientX-h.value.startX;t.value.style.width=h.value.width+c+"px",t.value.style.left=h.value.left+"px"}if(T.value.indexOf("w")!==-1){const c=r.clientX-h.value.startX;t.value.style.left=h.value.left+c+"px",t.value.style.width=h.value.width-c+"px"}if(T.value.indexOf("n")!==-1){const c=r.clientY-h.value.startY;t.value.style.top=h.value.top+c+"px",t.value.style.height=h.value.height-c+"px"}if(T.value.indexOf("s")!==-1){const c=r.clientY-h.value.startY;t.value.style.height=h.value.height+c+"px",t.value.style.top=h.value.top+"px"}}},X=()=>{y.value&&(y.value.style.pointerEvents="auto"),C.value=!1,C.value||(document.body.style.userSelect="auto")},pe=r=>{var n,c,d;let i="";return r.target.className.indexOf?(r.target.className.indexOf("top")>=0?i+="n":((n=r.target.className)==null?void 0:n.indexOf("bottom"))>=0&&(i+="s"),((c=r.target.className)==null?void 0:c.indexOf("left"))>=0?i+="w":((d=r.target.className)==null?void 0:d.indexOf("right"))>=0&&(i+="e"),i):""};return l.onMounted(()=>{}),l.onBeforeUnmount(()=>{Ee()}),l.onUnmounted(()=>{}),{beforeUnmount:fe,getDialogTitle:M,wujieProps:I,wujieAppName:D,wujieContainer:O,iframeRef:y,erDialogBaseStyle:Ie,dialogVisible:S,open:H,close:R,wujieAppUrl:x,clickCloseIcon:K,dialogHeaderRef:s,dialogContRef:t,dialogRef:o,isMaximine:Ne,changeMaxMin:xe,setEfDialogFormStyle:Le}}}),oh={class:"xr-er-dialog__content"},lh={style:{height:"100%",overflow:"auto"}},sh={key:0,class:"xr-er-dialog__footer"},ch={key:1,class:"er-dialog-form__content"};function dh(e,a,t,o,s,f){return l.withDirectives((l.openBlock(),l.createElementBlock("div",{ref:"dialogContRef",style:l.normalizeStyle(e.erDialogBaseStyle),class:l.normalizeClass(e.sameApp?"xr-er-dialog":"er-dialog-form")},[l.createElementVNode("div",{class:l.normalizeClass(e.sameApp?"xr-er-dialog__body":"er-dialog-form_body")},[l.createElementVNode("div",{ref:"dialogHeaderRef",class:l.normalizeClass(e.sameApp?"xr-er-dialog__header":"er-dialog-form__header"),style:l.normalizeStyle({cursor:e.draggable?"move":"pointer"})},[l.createElementVNode("div",null,[e.sameApp?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(l.toDisplayString(e.title?e.title:e.getDialogTitle)+" ",1),l.renderSlot(e.$slots,"title")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.title?e.title:e.getDialogTitle),1)],64))]),l.createElementVNode("div",null,[e.actions.includes("maximize")?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(["iconfont header-icon-button",e.isMaximine?"icon-compress":"icon-expend"]),onClick:a[0]||(a[0]=(...u)=>e.changeMaxMin&&e.changeMaxMin(...u))},null,2)):l.createCommentVNode("",!0),e.actions.includes("close")?(l.openBlock(),l.createElementBlock("span",{key:1,class:"iconfont header-icon-button icon-close",onClick:a[1]||(a[1]=(...u)=>e.clickCloseIcon&&e.clickCloseIcon(...u))})):l.createCommentVNode("",!0)])],6),e.sameApp?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",oh,[l.createElementVNode("div",lh,[l.renderSlot(e.$slots,"content")])]),e.$slots.footer?(l.openBlock(),l.createElementBlock("div",sh,[l.renderSlot(e.$slots,"footer")])):l.createCommentVNode("",!0)],64)):(l.openBlock(),l.createElementBlock("div",ch))],2),a[2]||(a[2]=l.createStaticVNode('<div class="resize-bar top"></div><div class="resize-bar right"></div><div class="resize-bar bottom"></div><div class="resize-bar left"></div><div class="resize-point top-right"></div><div class="resize-point top-left"></div><div class="resize-point bottom-right"></div><div class="resize-point bottom-left"></div>',8))],6)),[[l.vShow,e.dialogVisible]])}const fh=sr(nh,[["render",dh]]),uh=l.defineComponent({components:{dialogBase:fh},props:{debounce:{type:Boolean,default:!1},debounceWait:{type:Number,default:200},visible:{type:Boolean,required:!0},title:{type:String,default:""},width:{type:[String,Number],default:"50%"},height:{type:[String,Number],default:"50%"},modal:{type:Boolean,default:!0},defaultFooter:{type:Boolean,default:!1},destroyOnClose:{type:Boolean,default:!0},showConfirm:{type:Boolean,default:!0},showCancel:{type:Boolean,default:!0},parentFormRef:{type:Object,default:null},resizable:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},actions:{type:Array,default:["maximize","close"]},id:{type:String,default:""},customClass:{type:String,default:""},formName:{type:String,default:""}},emits:["update:visible","clickCloseIcon","confirm","cancel","dialogResize","open"],setup(e,{emit:a}){const{$t:t}=Bs(),o=l.ref(!0),s=l.ref(900),f=l.ref(null),u=l.ref(null),h=l.ref(e.width),C=l.ref(e.height),T=()=>{const te=document.querySelectorAll(".xr-er-dialog__wrapper"),b=document.querySelectorAll(".er-dialog-form__wrapper");if(te.length||b.length){const P=[];return[...te,...b].forEach(Ee=>{P.push(Ee.style.zIndex)}),Math.max(...P)+1}else return s.value},S=new IntersectionObserver(te=>{te[0].intersectionRatio>0&&e.parentFormRef&&e.visible&&setTimeout(()=>{window.removeEventListener("keydown",e.parentFormRef.handleKeyDown,!0)},1)}),x=()=>{e.parentFormRef&&S.observe(e.parentFormRef.$el)},y=()=>{e.parentFormRef&&S.unobserve(e.parentFormRef.$el)};l.watch(()=>e.visible,(te,b)=>{var P,Ee;if(e.visible)s.value=T(),x(),e.parentFormRef&&window.removeEventListener("keydown",e.parentFormRef.handleKeyDown,!0),e.destroyOnClose?(o.value=!0,s.value=T()):f.value.setEfDialogFormStyle(),l.nextTick(()=>{var fe;(fe=f.value)==null||fe.open()});else if(e.parentFormRef&&window.addEventListener("keydown",e.parentFormRef.handleKeyDown,!0),(P=f.value)==null||P.close(),e.destroyOnClose)o.value=!1;else if((Ee=f.value)==null||Ee.setEfDialogFormStyle(),f.value){const fe=f.value.$el.style.width,H=f.value.$el.style.height;h.value=fe.includes("vw")?fe.replace("vw","%"):fe,C.value=H.includes("vh")?H.replace("vh","%"):H}else h.value=e.width},{immediate:!0});const O=()=>{a("open")},D=()=>{a("update:visible",!1),a("clickCloseIcon")},I=()=>{a("confirm")},M=()=>{a("cancel")},G=()=>{a("dialogResize")};return l.onMounted(()=>{}),l.onBeforeUnmount(()=>{y()}),l.onUnmounted(()=>{}),{tI18n:t,dialogHeight:C,dialogWidth:h,isRender:o,dialogBaseRef:f,xrEfDialogRef:u,onClickClose:D,dialogZIndex:s,confirmClick:I,cancelClick:M,dialogResize:G,onOpen:O}}}),hh=["id"];function ph(e,a,t,o,s,f){const u=l.resolveComponent("dialog-base");return e.isRender?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.withDirectives(l.createElementVNode("div",{class:"xr-er-dialog__modal",style:l.normalizeStyle({"z-index":e.dialogZIndex})},null,4),[[l.vShow,e.visible&&e.modal]]),l.withDirectives(l.createElementVNode("div",{ref:"xrEfDialogRef",class:l.normalizeClass(["xr-er-dialog__wrapper",e.customClass]),id:e.id,style:l.normalizeStyle({"z-index":e.dialogZIndex})},[l.createVNode(u,{ref:"dialogBaseRef",sameApp:!0,modalZIndex:e.dialogZIndex,title:e.title?e.title:"",sameAppformName:e.formName,width:e.dialogWidth,height:e.dialogHeight,defaultWidth:e.width,defaultHeight:e.height,debounce:e.debounce,debounceWait:e.debounceWait,xrEfDialogDefaultFooter:e.defaultFooter,resizable:e.resizable,draggable:e.draggable,actions:e.actions,onClickClose:e.onClickClose,onFormResize:e.dialogResize,onOpen:e.onOpen},l.createSlots({title:l.withCtx(()=>[l.renderSlot(e.$slots,"title",{},void 0,!0)]),content:l.withCtx(()=>[l.renderSlot(e.$slots,"default",{},void 0,!0)]),_:2},[e.$slots["footer-left"]||e.$slots["footer-right"]||e.defaultFooter?{name:"footer",fn:l.withCtx(()=>[l.renderSlot(e.$slots,"footer-left",{},void 0,!0),e.defaultFooter?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[e.showConfirm?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:a[0]||(a[0]=(...h)=>e.confirmClick&&e.confirmClick(...h))},l.toDisplayString(e.tI18n("ERX.confirm")),1)):l.createCommentVNode("",!0),e.showCancel?(l.openBlock(),l.createElementBlock("button",{key:1,class:"xr-er-button",onClick:a[1]||(a[1]=(...h)=>e.cancelClick&&e.cancelClick(...h))},l.toDisplayString(e.tI18n("ERX.cancel")),1)):l.createCommentVNode("",!0)],64)):l.createCommentVNode("",!0),l.renderSlot(e.$slots,"footer-right",{},void 0,!0)]),key:"0"}:void 0]),1032,["modalZIndex","title","sameAppformName","width","height","defaultWidth","defaultHeight","debounce","debounceWait","xrEfDialogDefaultFooter","resizable","draggable","actions","onClickClose","onFormResize","onOpen"])],14,hh),[[l.vShow,e.visible]])],64)):l.createCommentVNode("",!0)}const Oa=sr(uh,[["render",ph],["__scopeId","data-v-9d9eb986"]]),mh=l.defineComponent({name:"ToolbarPanel",props:["params"],components:{"a-config-providver":et.ConfigProvider,"a-tooltip":et.Tooltip,"a-button":et.Button},setup(e){const a=l.ref(yr()),t=l.ref(zt()),o=l.ref("icon"),s=C=>{o.value=C},f=()=>{var D,I,M,G,te,b,P,Ee,fe,H,oe,R,K,he;let C=["save"],T=(D=e.params)==null?void 0:D.configId;const S=(G=(I=e.params)==null?void 0:I.formHelper)==null?void 0:G.getSingleViewConfigInfo((M=e.params)==null?void 0:M.configId);if(((te=S.EXT_OPTIONS)==null?void 0:te.trim().length)>0){const z=JSON.parse(S.EXT_OPTIONS);((b=z.buttonRegionId)==null?void 0:b.trim().length)>0&&(T=z.buttonRegionId),z.defaultAuthButtons instanceof Array?C=z.defaultAuthButtons:z.defaultAuthButtons instanceof String&&(C=z.defaultAuthButtons.split(","))}const x=(fe=(P=e.params)==null?void 0:P.formHelper)==null?void 0:fe.GridToolbarOptions[(Ee=e.params)==null?void 0:Ee.configId],y=(x==null?void 0:x.defaultButtons)||[{name:"refresh",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Refresh")||"刷新",icon:l.h(it.SyncOutlined),type:"primary",isAuthButton:C.includes("refresh")},{name:"addrow",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.AddRow")||"新增行",icon:l.h(it.PlusOutlined),type:"primary",isAuthButton:C.includes("addrow")},{name:"copyrow",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.CopyRow")||"复制行",icon:l.h(it.CopyOutlined),type:"primary",isAuthButton:C.includes("copyrow")},{name:"delete",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Delete")||"删除行",icon:l.h(it.CloseOutlined),type:"primary",isAuthButton:C.includes("delete")},{name:"save",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Save")||"保存",icon:l.h(it.CheckOutlined),type:"primary",isAuthButton:C.includes("save")},{name:"cancel",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Cancel")||"撤销",icon:l.h(it.UndoOutlined),type:"primary",isAuthButton:C.includes("cancel")},{name:"excel",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Export")||"导出",icon:l.h(it.FileExcelOutlined),type:"primary",isAuthButton:C.includes("excel")},{name:"import",caption:F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.Import")||"导入",icon:l.h(it.UploadOutlined),type:"primary",isAuthButton:C.includes("import")}],O=((oe=(H=e.params)==null?void 0:H.formHelper)==null?void 0:oe.FormAuthButtons[T])??[];return O&&O.length>0&&O.forEach(z=>{var Ie,Ne,xe;(xe=(Ie=e.params)==null?void 0:Ie.formHelper)==null||xe.setGridToolbarVisible((Ne=e.params)==null?void 0:Ne.configId,{[z.button_ename]:!0}),y.push({name:z.button_ename,caption:z.button_cname,type:"primary",showText:!0,isAuthButton:!0})}),C.forEach(z=>{var Ne,xe,Le;const Ie=O.find(ve=>ve.name===z);(Le=(Ne=e.params)==null?void 0:Ne.formHelper)==null||Le.setGridToolbarVisible((xe=e.params)==null?void 0:xe.configId,{[z]:Ie})}),((K=(R=e.params)==null?void 0:R.customButtons)==null?void 0:K.length)>0&&((he=e.params)==null||he.customButtons.forEach(z=>{var Ie,Ne,xe,Le,ve,Ge;if(((Ie=z.name)==null?void 0:Ie.trim().length)>0&&((Ne=z.caption)==null?void 0:Ne.trim().length)>0){const _e={};_e[(xe=z.name)==null?void 0:xe.trim()]=z.visible,(Ge=(Le=e.params)==null?void 0:Le.formHelper)==null||Ge.setGridToolbarVisible((ve=e.params)==null?void 0:ve.configId,_e),y.push({...z,icon:l.h(it.MoreOutlined),type:"primary",showText:z.showText!==!1,isAuthButton:!1})}})),y},u=(C,T)=>{var x,y,O;const S=(O=(x=e.params)==null?void 0:x.formHelper)==null?void 0:O.GridToolbarOptions[(y=e.params)==null?void 0:y.configId];if(S&&S[C]&&S[C][T]!==void 0)return l.isRef(S[C][T])?S[C][T].value:S[C][T]},h=async C=>{var T,S,x;if(C.isAuthButton){const y=u("authButtonAction","action");y&&y({...C,params:e.params})}else{let y=!1,O=C.action,D=!1;const I={};e.params[C.name]?(O=e.params[C.name].action,y=e.params[C.name].preventDefault,D=e.params[C.name].messageConfirm):O||(O=u(C.name,"action"),y=u(C.name,"preventDefault"),D=u(C.name,"messageConfirm")),(x=(T=e.params)==null?void 0:T.formHelper)==null||x.stopGridEditing((S=e.params)==null?void 0:S.configId,async()=>{var M,G,te,b,P,Ee,fe,H,oe,R,K,he,z,Ie,Ne,xe,Le,ve,Ge,_e,$e,Ke,X,pe,r,i,n,c,d,p,m,_,E,v,A,B,Q,N,W,J,re,Se;if(y!==!0)switch(C.name){case"refresh":case"cancel":{if((te=(M=e.params)==null?void 0:M.formHelper)!=null&&te.hasDataChange((G=e.params)==null?void 0:G.configId)){if(D!==!1&&!await((P=(b=e.params)==null?void 0:b.formHelper)==null?void 0:P.messageConfirm(`${F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.MessageConfirm")||"确认"}${C.caption}?`)))return;(H=(Ee=e.params)==null?void 0:Ee.formHelper)==null||H.cancelGridChange((fe=e.params)==null?void 0:fe.configId)}break}case"addrow":{const ue=(K=(oe=e.params)==null?void 0:oe.formHelper)==null?void 0:K.addRowToGrid((R=e.params)==null?void 0:R.configId);ue&&(I.models=[ue]);break}case"copyrow":{I.models=(Ie=(he=e.params)==null?void 0:he.formHelper)==null?void 0:Ie.addCopyRowToGrid((z=e.params)==null?void 0:z.configId);break}case"delete":{if(((Le=(Ne=e.params)==null?void 0:Ne.formHelper)==null?void 0:Le.getGridSelectRows((xe=e.params)==null?void 0:xe.configId)).length>0){if(D!==!1&&!await((Ge=(ve=e.params)==null?void 0:ve.formHelper)==null?void 0:Ge.messageConfirm(`${F.ER.Core.$t("ERX.ErGridStatusBar.ToolbarPanel.MessageConfirm")||"确认"}${C.caption}?`)))return;I.models=(Ke=(_e=e.params)==null?void 0:_e.formHelper)==null?void 0:Ke.deleteGridRows(($e=e.params)==null?void 0:$e.configId)}break}case"excel":{const ue=(X=e.params)==null?void 0:X.formHelper.FormName,me=(pe=e.params)==null?void 0:pe.formHelper.FormCaption,Z=(i=e.params)==null?void 0:i.formHelper.getGrid((r=e.params)==null?void 0:r.configId),Te={fileName:`${(n=e.params)==null?void 0:n.formHelper.FormName}-${F.ER.Core.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")}`,exportData:(d=(c=Z==null?void 0:Z.gridOptions)==null?void 0:c.context)==null?void 0:d.bindingSource,header:{titleType:"both"}},ce=(m=e.params)==null?void 0:m.formHelper.getGridOptions((p=e.params)==null?void 0:p.configId,"excel");(ce==null?void 0:ce.fileName.trim().length)>0?Te.fileName=ce==null?void 0:ce.fileName.trim():Te.fileName=(E=(_=e.params)==null?void 0:_.formHelper)==null?void 0:E.getFormSysInfo("GRIDEXPORTFILENAME"),Te.fileName=(Te.fileName||"{formName}-{dateNow}").replace("{formName}",ue).replace("{formCaption}",me).replace("{dateNow}",F.ER.Core.getDateTimeFormatString(new Date,"yyyy-MM-dd HH-mm-ss")),(v=ce==null?void 0:ce.header)!=null&&v.titleType&&(Te.header.titleType=(A=ce==null?void 0:ce.header)==null?void 0:A.titleType);const ze=Me=>{e.params.api.exportDataAsExcel({fileName:Te.fileName,sheetName:(Me==null?void 0:Me.sheetName)||"Sheet1",author:F.ER.SysInfo.UserId,skipPinnedBottom:!0,onlySelected:Me==null?void 0:Me.selectedRows,skipRowGroups:Me==null?void 0:Me.skipGroupRows,skipColumnGroupHeaders:Me==null?void 0:Me.skipBandRows,processHeaderCallback:ge=>{var le,Y;return((Y=(le=ge.column.colDef)==null?void 0:le.headerName)==null?void 0:Y.replace(/<\/?\s*br\s*\/?>/gi,"").replace(/\s+/g,"").trim())||""},shouldRowBeSkipped:ge=>!!(Me!=null&&Me.skipSummaryRows&&ge.node.footer===!0&&ge.node.group===!0&&ge.node.level>=0||Me!=null&&Me.skipFooterRows&&ge.node.footer===!0&&ge.node.group===!0&&ge.node.level<0),processCellCallback:ge=>{var le,Y,Fe,ke,Ve,at;return ge.node.group&&ge.node.footer!==!0?(le=ge.column.colDef)!=null&&le.rowGroup&&ge.node.key?((Y=ge.column.colDef.refData)==null?void 0:Y[ge.node.key])||ge.node.key:ge.formatValue(ge.value):ge.value&&Wr.isPlainObject(ge.value)&&ge.formatValue instanceof Function?ge.formatValue(ge.value):((ke=(Fe=ge.column.colDef)==null?void 0:Fe.context)==null?void 0:ke.dataType)==="number"&&(Me==null?void 0:Me.numberAsText)!==!0?ge.value:((at=(Ve=ge.column.colDef)==null?void 0:Ve.context)==null?void 0:at.dataType)==="boolean"?ge.value?"1":"0":ge.formatValue(ge.value)}})};if(e.params.api.getDisplayedRowCount()===0)ze();else{const Me=[{label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsNumberAsText")||"数值以文本格式导出",value:"numberAsText"}];((B=F.ER.Core.getGridRows(Z,"checkedAfterFilter"))==null?void 0:B.length)>0&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSelectedRows")||"仅导出选择行",value:"selectedRows"}),((N=(Q=Z.gridOptions.context)==null?void 0:Q.options)==null?void 0:N.viewType)==="BandView"&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipBandRows")||"跳过合并列头行",value:"skipBandRows"}),Z.gridOptions.columnApi.getRowGroupColumns().length>0&&(Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipGroupRows")||"跳过分组行",value:"skipGroupRows"}),Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipSummaryRows")||"跳过小计行",value:"skipSummaryRows"})),((J=(W=Z.gridOptions.context)==null?void 0:W.viewConfig)==null?void 0:J.SHOW_FOOTER)==="1"&&Me.push({label:F.ER.Core.$t("ERX.ErGrid.ExportOptionsSkipFooterRows")||"跳过合计行",value:"skipFooterRows"}),F.ER.Core.openSelectOptionsModal({title:F.ER.Core.$t("ERX.ErGrid.ExportOptions")||"导出选项",checkboxOptions:Me,default:{checkboxOptions:["skipSummaryRows"]}},ge=>{ze({selectedRows:ge.checkboxes.some(le=>le==="selectedRows"),numberAsText:ge.checkboxes.some(le=>le==="numberAsText"),skipBandRows:ge.checkboxes.some(le=>le==="skipBandRows"),skipGroupRows:ge.checkboxes.some(le=>le==="skipGroupRows"),skipSummaryRows:ge.checkboxes.some(le=>le==="skipSummaryRows"),skipFooterRows:ge.checkboxes.some(le=>le==="skipFooterRows")})})}break}case"import":{const ue=(Se=e.params)==null?void 0:Se.formHelper.getGrid((re=e.params)==null?void 0:re.configId);F.ER.Core.importExcelFile(ue,void 0,me=>{I.models=me});break}}O&&typeof O=="function"&&O(I)})}};return{ER:F.ER,antdTheme:t,antdLocale:a,getDefaultButtons:f,getToolbarOption:u,toolbarClick:h,toolbarStyle:o,setToolbarStyle:s}}}),gh={style:{display:"inline-block"}};function Eh(e,a,t,o,s,f){const u=l.resolveComponent("a-button"),h=l.resolveComponent("a-tooltip"),C=l.resolveComponent("a-config-providver");return l.openBlock(),l.createElementBlock("div",gh,[l.createVNode(C,{theme:e.antdTheme,locale:e.antdLocale,componentSize:"small"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.getDefaultButtons(),T=>(l.openBlock(),l.createBlock(h,{key:T.name+"tooltip",title:T.caption},{default:l.withCtx(()=>{var S;return[e.getToolbarOption(T.name,"visible")?(l.openBlock(),l.createBlock(u,{key:T.name,id:T.name,icon:((S=e.params)==null?void 0:S.showIco)!==!1?T.icon:void 0,type:T.type||"primary",onClick:x=>e.toolbarClick(T),style:{height:"20px",padding:"0px 5px",margin:"1px","font-size":"13px"}},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(T.showText||e.toolbarStyle==="text"||e.toolbarStyle==="both"?T.caption:""),1)]),_:2},1032,["id","icon","type","onClick"])):l.createCommentVNode("",!0)]}),_:2},1032,["title"]))),128))]),_:1},8,["theme","locale"])])}const Ch=sr(mh,[["render",Eh]]),_h=l.defineComponent({name:"PaginationPanel",props:["params"],setup(e){var b,P,Ee;const a=l.ref(((b=e.params.pageOptions)==null?void 0:b.pageSize)||100),t=l.ref(((Ee=(P=e.params.pageOptions)==null?void 0:P.pageSizes)==null?void 0:Ee.length)>0?e.params.pageOptions.pageSizes:[10,50,100,200,500,1e3]),o=l.ref(0),s=l.ref(1),f=l.ref(1),u=e.params.api,h=l.ref(!0),C=l.ref(!0),T=l.ref(!0),S=l.ref(!0),x=()=>{h.value=f.value===1,C.value=f.value===1,T.value=f.value===s.value,S.value=f.value===s.value},y=fe=>{var H,oe;if(((H=e.params.pageOptions)==null?void 0:H.pagination)==="server")o.value=(fe==null?void 0:fe.totalCount)||0,a.value=(fe==null?void 0:fe.pageSize)||a.value,s.value=Math.ceil(o.value/a.value)||1,(fe==null?void 0:fe.currentPage)<=0?f.value=1:(fe==null?void 0:fe.currentPage)>s.value?f.value=s.value:f.value=fe==null?void 0:fe.currentPage;else{let R=0;const K=(oe=e.params.formHelper)==null?void 0:oe.getBindingTable(e.params.configId);K&&(R=K.rowCount||0),o.value=R,s.value=u.paginationGetTotalPages()||1,f.value=u.paginationGetCurrentPage()+1,a.value=u.paginationGetPageSize()}x()},O=()=>{var fe,H,oe,R,K;f.value>1&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToFirstPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,1))},D=()=>{var fe,H,oe,R,K;f.value<s.value&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToLastPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,s.value))},I=()=>{var fe,H,oe,R,K;f.value>1&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToPreviousPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value-1))},M=()=>{var fe,H,oe,R,K;f.value<s.value&&(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToNextPage():((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value+1))},G=()=>{var fe,H,oe,R,K;((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client"?u.paginationGoToPage(f.value-1):((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"&&e.params.formHelper.excuteGridServerPaging(e.params.configId,f.value)},te=()=>{var fe,H,oe,R,K,he,z;if(((fe=e.params.pageOptions)==null?void 0:fe.pagination)===!0||((oe=(H=e.params.pageOptions)==null?void 0:H.pagination)==null?void 0:oe.toLowerCase())==="client")u.paginationSetPageSize(a.value);else if(((K=(R=e.params.pageOptions)==null?void 0:R.pagination)==null?void 0:K.toLowerCase())==="server"){const Ie=e.params.formHelper.getGrid(e.params.configId);(z=(he=Ie==null?void 0:Ie.gridOptions)==null?void 0:he.context)!=null&&z.pageOptions&&(Ie.gridOptions.context.pageOptions.pageSize=a.value,e.params.formHelper.excuteGridServerPaging(e.params.configId,1))}};return{gridApi:u,ER:F.ER,pageSize:a,pageSizes:t,totalPages:s,currentPage:f,totalCount:o,onPageSizeChanged:te,onPageChanged:G,toFirst:O,toLast:D,toPre:I,toNext:M,setPagination:y,firstDisabled:h,preDisabled:C,nextDisabled:T,lastDisabled:S}}}),Th={class:"ag-statusBar-pagination-panel"},Sh=["disabled"],xh=["disabled"],yh=["value"],vh=["disabled"],Fh=["disabled"],Oh={class:"ag-pagesize-box"},Ih=["value"],Dh={class:"ag-totalPages-box"},Ah={id:"totalPages"};function wh(e,a,t,o,s,f){return l.openBlock(),l.createElementBlock("div",Th,[l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.firstDisabled?"ag-disabled":""]),role:"button",disabled:e.firstDisabled,onClick:a[0]||(a[0]=(...u)=>e.toFirst&&e.toFirst(...u))},a[8]||(a[8]=[l.createElementVNode("span",{class:"ag-icon ag-icon-first"},null,-1)]),10,Sh),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.preDisabled?"ag-disabled":""]),role:"button",disabled:e.preDisabled,onClick:a[1]||(a[1]=(...u)=>e.toPre&&e.toPre(...u))},a[9]||(a[9]=[l.createElementVNode("span",{class:"ag-icon ag-icon-previous"},null,-1)]),10,xh),l.withDirectives(l.createElementVNode("select",{onChange:a[2]||(a[2]=u=>e.onPageChanged()),"onUpdate:modelValue":a[3]||(a[3]=u=>e.currentPage=u),class:"ag-grid-page-select"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.totalPages,u=>(l.openBlock(),l.createElementBlock("option",{value:u},l.toDisplayString(u),9,yh))),256))],544),[[l.vModelSelect,e.currentPage]]),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.nextDisabled?"ag-disabled":""]),role:"button",disabled:e.nextDisabled,onClick:a[4]||(a[4]=(...u)=>e.toNext&&e.toNext(...u))},a[10]||(a[10]=[l.createElementVNode("span",{class:"ag-icon ag-icon-next"},null,-1)]),10,vh),l.createElementVNode("div",{class:l.normalizeClass(["ag-button ag-paging-button",e.lastDisabled?"ag-disabled":""]),role:"button",disabled:e.lastDisabled,onClick:a[5]||(a[5]=(...u)=>e.toLast&&e.toLast(...u))},a[11]||(a[11]=[l.createElementVNode("span",{class:"ag-icon ag-icon-last"},null,-1)]),10,Fh),l.createElementVNode("div",Oh,[l.withDirectives(l.createElementVNode("select",{onChange:a[6]||(a[6]=u=>e.onPageSizeChanged()),id:"page-size","onUpdate:modelValue":a[7]||(a[7]=u=>e.pageSize=u),class:"ag-grid-pageSize-select"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.pageSizes,u=>(l.openBlock(),l.createElementBlock("option",{key:u,value:u},l.toDisplayString(u),9,Ih))),128))],544),[[l.vModelSelect,e.pageSize]]),l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.RowsPerPage")||"行每页"),1)]),l.createElementVNode("div",Dh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.Total")||"共"),1),l.createElementVNode("span",Ah,l.toDisplayString(e.totalCount),1),l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.ErGridStatusBar.PaginationPanel.Rows")||"行"),1)])])}const Mh=sr(_h,[["render",wh],["__scopeId","data-v-e4676776"]]),kh=l.defineComponent({name:"AggregationPanel",props:["params"],setup(e){const a=l.reactive({}),t=()=>{var x;const o=(x=e.params.api)!=null&&x.rangeService?e.params.api.rangeService.getCellRanges():void 0;let s=new Gt(0),f=0,u=0,h=2,C=null,T=null;const S={};o&&o.length>0&&o.forEach(y=>{let O=e.params.api.rangeService.getRangeStartRow(y);const D=e.params.api.rangeService.getRangeEndRow(y);for(;!(!O||e.params.api.rangeService.rowPositionUtils.before(D,O)||!y.columns);)y.columns.forEach(M=>{if(O===null)return;var G=e.params.api.rangeService.cellPositionUtils.createId({rowPinned:O.rowPinned,column:M,rowIndex:O.rowIndex});if(S[G])return;S[G]=!0;var te=e.params.api.rowRenderer.getRowNode(O);if(!te)return;let b=e.params.api.valueService.getValue(M,te);F.ER.Core.isNullOrEmpty(b)||(f++,!(typeof b=="object"&&"value"in b&&(b=b.value,b===""))&&(typeof b=="string"&&(b=Number(b)),typeof b=="number"&&!isNaN(b)&&(new Gt(b).decimalPlaces()>h&&(h=new Gt(b).decimalPlaces()),s=s.add(b),(T===null||b>T)&&(T=b),(C===null||b<C)&&(C=b),u++)))}),O=e.params.api.rangeService.cellNavigationService.getRowBelow(O)}),u>1?(a.average={value:F.ER.Core.formatNumberValue(s.dividedBy(u).toDecimalPlaces(h).toNumber(),"#,##0.######"),show:!0},a.sum={value:F.ER.Core.formatNumberValue(s.toNumber(),"#,##0.######"),show:!0},a.min={value:F.ER.Core.formatNumberValue(C,"#,##0.######"),show:!0},a.max={value:F.ER.Core.formatNumberValue(T,"#,##0.######"),show:!0}):(delete a.average,delete a.sum,delete a.min,delete a.max),f>1?a.count={value:f,show:!0}:delete a.count};return{ER:F.ER,aggData:a,setAggData:t}}}),bh={class:"ag-status-panel ag-status-panel-aggregations"},Rh={key:0,class:"ag-status-name-value"},Nh={class:"ag-status-name-value-value"},Lh={key:1,class:"ag-status-name-value"},Ph={class:"ag-status-name-value-value"},Bh={key:2,class:"ag-status-name-value"},Hh={class:"ag-status-name-value-value"},Vh={key:3,class:"ag-status-name-value"},Uh={class:"ag-status-name-value-value"},Gh={key:4,class:"ag-status-name-value"},zh={class:"ag-status-name-value-value"};function $h(e,a,t,o,s,f){var u,h,C,T,S,x,y,O,D,I;return l.openBlock(),l.createElementBlock("div",bh,[(u=e.aggData.average)!=null&&u.show?(l.openBlock(),l.createElementBlock("div",Rh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Average")||"平均值")+":",1),l.createElementVNode("span",Nh,l.toDisplayString((h=e.aggData.average)==null?void 0:h.value),1)])):l.createCommentVNode("",!0),(C=e.aggData.count)!=null&&C.show?(l.openBlock(),l.createElementBlock("div",Lh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Count")||"计数")+":",1),l.createElementVNode("span",Ph,l.toDisplayString((T=e.aggData.count)==null?void 0:T.value),1)])):l.createCommentVNode("",!0),(S=e.aggData.max)!=null&&S.show?(l.openBlock(),l.createElementBlock("div",Bh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Max")||"最大值")+":",1),l.createElementVNode("span",Hh,l.toDisplayString((x=e.aggData.max)==null?void 0:x.value),1)])):l.createCommentVNode("",!0),(y=e.aggData.min)!=null&&y.show?(l.openBlock(),l.createElementBlock("div",Vh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Min")||"最小值")+":",1),l.createElementVNode("span",Uh,l.toDisplayString((O=e.aggData.min)==null?void 0:O.value),1)])):l.createCommentVNode("",!0),(D=e.aggData.sum)!=null&&D.show?(l.openBlock(),l.createElementBlock("div",Gh,[l.createElementVNode("span",null,l.toDisplayString(e.ER.Core.$t("ERX.Sum")||"总和")+":",1),l.createElementVNode("span",zh,l.toDisplayString((I=e.aggData.sum)==null?void 0:I.value),1)])):l.createCommentVNode("",!0)])}const Wh=sr(kh,[["render",$h],["__scopeId","data-v-73cdb637"]]),Yh=l.defineComponent({name:"InformationPanel",props:["params"],components:{"a-tooltip":et.Tooltip},setup(e){const a=l.reactive({}),t=l.ref(null),o=l.ref(null),s=h=>{const C=e.params.api.getFilterModel(),T=e.params.columnApi.getColumnState().filter(S=>S.sort!==null).sort((S,x)=>(S.sortIndex??0)-(x.sortIndex??0));t.value=Object.keys(C).map(S=>`${e.params.columnApi.getColumn(S).getColDef().headerName}`).join(`
81
81
  `),o.value=T.map(S=>`${e.params.columnApi.getColumn(S.colId).getColDef().headerName}`).join(`
82
82
  `),a.showFilterFlag=Object.keys(C).length>0,a.showSortFlag=T.length>0},f=()=>{e.params.api.setFilterModel(null),a.showFilterFlag=!1},u=()=>{const h=e.params.columnApi.getColumnState().filter(C=>C.sort!==null);e.params.columnApi.applyColumnState({state:h.map(C=>({colId:C.colId,sort:null}))}),a.showFilterFlag=!1};return{ER:F.ER,setInformation:s,information:a,filterCloseClick:f,sortCloseClick:u,sortColumnString:o,filterColumnString:t}}}),Xh={class:"ag-status-panel-information"},Qh={key:0},qh={style:{"white-space":"pre-line"}},jh={key:1,style:{"padding-left":"5px"}},Kh={style:{"white-space":"pre-line"}};function Jh(e,a,t,o,s,f){const u=l.resolveComponent("a-tooltip");return l.openBlock(),l.createElementBlock("div",Xh,[e.information.showFilterFlag?(l.openBlock(),l.createElementBlock("span",Qh,[l.createElementVNode("i",{class:"iconfont icon-close",style:{"font-size":"12px",color:"red"},onClick:a[0]||(a[0]=(...h)=>e.filterCloseClick&&e.filterCloseClick(...h))}),l.createVNode(u,null,{title:l.withCtx(()=>[l.createElementVNode("span",qh,l.toDisplayString(e.filterColumnString),1)]),default:l.withCtx(()=>[a[2]||(a[2]=l.createElementVNode("span",{style:{"font-size":"12px"}},"已筛选",-1))]),_:1})])):l.createCommentVNode("",!0),e.information.showSortFlag?(l.openBlock(),l.createElementBlock("span",jh,[l.createElementVNode("i",{class:"iconfont icon-close",style:{"font-size":"12px",color:"red"},onClick:a[1]||(a[1]=(...h)=>e.sortCloseClick&&e.sortCloseClick(...h))}),l.createVNode(u,null,{title:l.withCtx(()=>[l.createElementVNode("span",Kh,l.toDisplayString(e.sortColumnString),1)]),default:l.withCtx(()=>[a[3]||(a[3]=l.createElementVNode("span",{style:{"font-size":"12px"}},"已排序",-1))]),_:1})])):l.createCommentVNode("",!0)])}const Zh=sr(Yh,[["render",Jh],["__scopeId","data-v-e727ce9e"]]),e5=l.defineComponent({name:"PreviewDetail",props:["params"],setup:e=>(l.onMounted(()=>{}),{props:e})}),t5={style:{"user-select":"text"}},r5=["id"],a5={style:{display:"flex","flex-direction":"row"}},i5={style:{"font-weight":"bold"}},n5={style:{display:"block","white-space":"pre-wrap"}};function o5(e,a,t,o,s,f){var u;return l.openBlock(),l.createElementBlock("div",t5,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList((u=e.props.params.data)==null?void 0:u._preview_row_data,(h,C)=>(l.openBlock(),l.createElementBlock("div",{id:e.props.params.data.uid},[l.createElementVNode("div",a5,[l.createElementVNode("div",i5,l.toDisplayString(h.label)+":",1),l.createElementVNode("div",n5,l.toDisplayString(h.value),1)])],8,r5))),256))])}const Vs=sr(e5,[["render",o5]]),l5={key:0,class:"er-grid-find-panel-input"},s5=l.defineComponent({name:"ErGrid",components:{PaginationPanel:Mh,AggregationPanel:Wh,InformationPanel:Zh,ToolbarPanel:Ch,PreviewDetail:Vs,"a-input":et.Input,"a-config-providver":et.ConfigProvider}}),ur=l.defineComponent({...s5,props:{erFormHelperProp:{type:Object,default:null},configId:{type:String,default:""},toolbarOptions:{type:Object,default:()=>{}},pageOptions:{type:Object,default:()=>{}},options:{type:Object,default:()=>{}},detailConfigId:{type:String,default:""},detailToolbarOptions:{type:Object,default:()=>{}},detailPageOptions:{type:Object,default:()=>{}},detailOptions:{type:Object,default:()=>{}}},emits:["erGridReady","click","doubleClick","focusChanged"],setup(e,{emit:a}){const t=e,o=l.ref(yr()),s=l.ref(zt()),f=a,u=l.useAttrs(),h=l.ref(null),C=l.ref(!1),T=l.ref(void 0),S=l.ref(void 0),x=l.ref(void 0),y=l.ref(void 0),O=l.ref(""),D=l.ref(!1);let I=null;const M=l.computed(()=>{var K,he;const R=[{statusPanel:"ToolbarPanel",statusPanelParams:{...t.toolbarOptions,formHelper:t.erFormHelperProp,configId:t.configId},key:"ToolbarPanel",align:"left"}];return((K=t.options)==null?void 0:K.agAggregationComponent)!==!1&&R.push({statusPanel:"AggregationPanel",statusPanelParams:{formHelper:t.erFormHelperProp,configId:t.configId},key:"AggregationPanel",align:"center"}),R.push({statusPanel:"InformationPanel",statusPanelParams:{formHelper:t.erFormHelperProp,configId:t.configId},key:"InformationPanel",align:"right"}),(he=t.pageOptions)!=null&&he.pagination?R.push({statusPanel:"PaginationPanel",statusPanelParams:{pageOptions:t.pageOptions,formHelper:t.erFormHelperProp,configId:t.configId},key:"PaginationPanel",align:"right"}):R.push({statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}),{statusPanels:R}}),G=R=>{var K,he;(he=(K=h.value.gridOptions)==null?void 0:K.api)==null||he.setQuickFilter(O.value)},te=R=>{var K,he;if(R!=null&&R.api&&(((K=t.pageOptions)==null?void 0:K.pagination)===!0||((he=t.pageOptions)==null?void 0:he.pagination)==="client")){const z=R.api.getStatusPanel("PaginationPanel");z&&z.setPagination()}},b=R=>{if(R!=null&&R.api){const K=R.api.getStatusPanel("AggregationPanel");K&&K.setAggData()}},P=async R=>{var he,z,Ie,Ne,xe,Le,ve,Ge,_e,$e,Ke;if(R.api.setPopupParent(document.querySelector("body")),t.erFormHelperProp&&t.erFormHelperProp instanceof F.ER.FormHelper&&((he=t.configId)==null?void 0:he.trim().length)>0){await t.erFormHelperProp.loadGrid(F.ER.Core.toString(t.configId,!0),h.value,{...t.options,detailConfigId:t.detailConfigId},t.toolbarOptions,t.pageOptions);const X=(z=R.api)==null?void 0:z.getStatusPanel("ToolbarPanel");X&&X.setToolbarStyle(((Ie=t.toolbarOptions)==null?void 0:Ie.style)??((Ne=t.options)==null?void 0:Ne.toolbarStyle)??"both");const pe=t.erFormHelperProp.getSingleViewConfigInfo(t.configId);(xe=t.erFormHelperProp)==null||xe.setGridToolbarVisible(t.configId,{refresh:t.erFormHelperProp.getGridToolbarVisible(t.configId,"refresh")??pe.SHOW_REFRESH==="1",addrow:t.erFormHelperProp.getGridToolbarVisible(t.configId,"addrow")??pe.SHOW_ADD==="1",copyrow:t.erFormHelperProp.getGridToolbarVisible(t.configId,"copyrow")??pe.SHOW_ADDCOPY==="1",delete:t.erFormHelperProp.getGridToolbarVisible(t.configId,"delete")??pe.SHOW_DELETE==="1",cancel:t.erFormHelperProp.getGridToolbarVisible(t.configId,"cancel")??!1,save:t.erFormHelperProp.getGridToolbarVisible(t.configId,"save")??!1,excel:t.erFormHelperProp.getGridToolbarVisible(t.configId,"excel")??pe.SHOW_EXPORT==="1",import:t.erFormHelperProp.getGridToolbarVisible(t.configId,"import")??pe.ALLOW_IMPORT==="1"}),I=t.erFormHelperProp.getBindingTable(t.configId),(ve=(Le=h.value.gridOptions)==null?void 0:Le.api)==null||ve.addEventListener("cellFocused",r=>{var d,p,m,_,E;const i=r.api.getModel().getRow(r.rowIndex),n=((d=r==null?void 0:r.context)==null?void 0:d.focusRowId)||"",c=((p=r==null?void 0:r.context)==null?void 0:p.focusColId)||"";if(i!=null&&i.id&&(i.id!==n||r.column.colId!==c)){if(i.data&&i.data.uid!==n){const A=(m=r==null?void 0:r.context)==null?void 0:m.bindingSource;A&&n&&(i.data=l.reactive(i.data),A.setCurrent(i.data,t.configId))}const v=()=>{var B,Q,N,W,J,re;const A={...r,rowChanged:i.id!==n,columnChanged:r.column.colId!==c,data:i.data,field:(B=r.column.colDef)==null?void 0:B.field,configId:t.configId,erFormHelper:t.erFormHelperProp};A.colDefEditable=((W=(N=(Q=r.column)==null?void 0:Q.colDef)==null?void 0:N.context)==null?void 0:W.ALLOW_EDIT)==="1"&&((re=(J=r.column)==null?void 0:J.colDef)==null?void 0:re.context.READ_ONLY)!=="1"||!1,f("focusChanged",A),r.context.focusRowId=i.id,r.context.focusColId=r.column.colId};((E=(_=h.value)==null?void 0:_.gridOptions)==null?void 0:E.rowSelection)==="single"?setTimeout(v,250):v()}}),h.value.gridOptions.api.addEventListener("rowDataUpdated",r=>{var i,n,c,d,p,m,_,E,v,A,B,Q,N,W,J;if(r.context.bindingSource.rowCount===0)(i=r==null?void 0:r.api)==null||i.clearFocusedCell(),(n=r==null?void 0:r.api)==null||n.clearRangeSelection(),r.context.focusRowId="",r.context.focusColId="",((c=t.options)==null?void 0:c.suppressDefaultFocusedCell)!==!0&&f("focusChanged",{rowChanged:!0,columnChanged:!0,data:void 0,configId:t.configId,erFormHelper:t.erFormHelperProp}),((p=(d=r==null?void 0:r.context)==null?void 0:d.viewConfig)==null?void 0:p.SHOW_FOOTER)==="1"&&r.api.setPinnedBottomRowData([{pinndeRowType:"ErGridSummaryFooter"}]);else{r.context.filterCountsMap={};let re;const Se=r.api.getFilterModel(),ue=r.columnApi.getColumnState().filter(me=>me.sort!==null);if(Object.keys(Se).length>0||ue.length>0?h.value.gridOptions.context.calculateRowSpan&&h.value.gridOptions.context.calculateRowSpan instanceof Function?re=h.value.gridOptions.context.calculateRowSpan(!1):r.api.forEachNodeAfterFilterAndSort(me=>{var Z;(Z=me.data)!=null&&Z.uid&&!re&&(re=me.data)}):re=h.value.gridOptions.context.bindingSource.Current,re?(setTimeout(()=>{r.api.redrawRows()},250),h.value.gridOptions.context.bindingSource.setCurrent(re)):((m=r==null?void 0:r.api)==null||m.clearFocusedCell(),(_=r==null?void 0:r.api)==null||_.clearRangeSelection(),r.context.focusRowId="",r.context.focusColId="",((E=t.options)==null?void 0:E.suppressDefaultFocusedCell)!==!0&&f("focusChanged",{rowChanged:!0,columnChanged:!0,data:void 0,configId:t.configId,erFormHelper:t.erFormHelperProp})),(v=r==null?void 0:r.context)!=null&&v.bindingSource&&((B=(A=r==null?void 0:r.context)==null?void 0:A.viewConfig)==null?void 0:B.SHOW_FOOTER)==="1"){const me=r.api.getModel();setTimeout(()=>{var Z;r.api.setPinnedBottomRowData([{...(Z=me==null?void 0:me.rootNode)==null?void 0:Z.aggData,pinndeRowType:"ErGridSummaryFooter"}])},250)}if((Q=r==null?void 0:r.context)!=null&&Q.showPreview&&((N=r.context)!=null&&N.previewFieldMap)&&!t.detailConfigId){const me=Object.keys(r.context.previewFieldMap);me.length>0&&r.api.forEachNode(Z=>{const Te=[];me.forEach(ce=>{var ze;(ze=Z.data)!=null&&ze[ce]&&Te.push({label:r.context.previewFieldMap[ce],value:Z.data[ce]})}),Te.length>0&&(Z.data._preview_row_data=Te,Z.setExpanded(!0))})}((J=(W=r==null?void 0:r.context)==null?void 0:W.viewConfig)==null?void 0:J.AUTO_EXPAND_GROUP)==="1"&&R.api.expandAll()}})}else R.api.setColumnDefs([]),R.api.setRowData([]);((Ge=t.options)==null?void 0:Ge.sideBarClosed)!==!1&&R.api.closeToolPanel();const K=(_e=h.value.gridOptions.context)==null?void 0:_e.options;($e=t.options)!=null&&$e.masterDetail&&((Ke=t.detailConfigId)==null?void 0:Ke.trim().length)>0&&(y.value=(K==null?void 0:K.detailRowHeight)??300,x.value=K==null?void 0:K.detailRowAutoHeight),f("erGridReady",{...R,configId:t.configId,erFormHelper:t.erFormHelperProp})},Ee=R=>{f("click",{...R,configId:t.configId,erFormHelper:t.erFormHelperProp})},fe=R=>{f("doubleClick",{...R,configId:t.configId,erFormHelper:t.erFormHelperProp})},H=R=>{var K;return(K=t.erFormHelperProp)==null?void 0:K.getGridOptions(t.configId,R,!0)};return(()=>{var R,K,he,z,Ie;if(t.erFormHelperProp&&t.erFormHelperProp instanceof F.ER.FormHelper&&((R=t.configId)==null?void 0:R.trim().length)>0){const Ne=t.erFormHelperProp.getSingleViewConfigInfo(t.configId);if(D.value=((K=t.toolbarOptions)==null?void 0:K.showToolbar)??Ne.ENABLE_PAGEBAR!=="0",t.options&&Object.keys(t.options).forEach(xe=>{var Le;(Le=t.erFormHelperProp)==null||Le.setGridOptions(t.configId,xe,t.options[xe])}),(he=t.options)!=null&&he.masterDetail&&((z=t.detailConfigId)==null?void 0:z.trim().length)>0){C.value=!0;const xe=t.erFormHelperProp.getSingleViewConfigInfo(t.detailConfigId),Le=(Ie=t.erFormHelperProp)==null?void 0:Ie.getDetailGridRenderOptions(t.detailConfigId,t.detailOptions,t.detailToolbarOptions,t.detailPageOptions);S.value=ve=>({detailGridOptions:Le,getDetailRowData:async Ge=>{var _e,$e,Ke;if(Ge.data._children_data)Ge.successCallback(Ge.data._children_data);else{const X={};if(($e=(_e=t.erFormHelperProp)==null?void 0:_e.FormDataSet.relations[xe.RELATION_NAME.trim()])==null||$e.forEach(pe=>{X[pe.ChildColumn]=Ge.data[pe.ParentColumn]}),Object.keys(X).length===0)t.erFormHelperProp.messageError("The master-detail relation information was not found!"),Ge.data._children_data=[],Ge.successCallback(Ge.data._children_data);else{((Ke=t.detailOptions.service)==null?void 0:Ke.trim().length)>0?X.QUERY_TYPE=xe.TABLE_NAME:X.TABLE_NAME=xe.TABLE_NAME;const pe=F.ER.Core.buildEiInfo(X,"DETAIL_TABLE"),r=await t.erFormHelperProp.callService(t.detailOptions.service||"si00_dyn_inq",pe);if(r.getStatus()<0){Ge.successCallback([]),t.erFormHelperProp.messageError(r.getMsg());return}let i=[];r.getBlock(xe.TABLE_NAME)?i=r.getBlock(xe.TABLE_NAME).getMappedRows():i=r.getBlockByIndex(0).getMappedRows();const c=t.erFormHelperProp.getBindingTable(t.detailConfigId).merge(i,!1);Ge.data._children_data=c,Ge.successCallback(Ge.data._children_data)}}}})}else Ne.SHOW_PREVIEW==="1"&&Ne.PREVIEW_FIELD_NAME.trim().length>0&&!t.detailConfigId&&(C.value=!0,T.value=Vs,x.value=!0)}})(),l.onMounted(()=>{var K;const R=(K=t.erFormHelperProp)==null?void 0:K.getSystemGlobalOptions();R!=null&&R.GridFilterIconColor&&t.erFormHelperProp.setGlobalStyleProperty("--er-grid-ag-icon-filter-color",R.GridFilterIconColor),R!=null&&R.GridSorterIconColor&&t.erFormHelperProp.setGlobalStyleProperty("--er-grid-ag-icon-sorter-color",R.GridSorterIconColor),R!=null&&R.GridSorterIconFontSize&&t.erFormHelperProp.setGlobalStyleProperty("--er-grid-ag-icon-sorter-font-size",R.GridSorterIconFontSize),R!=null&&R.GridFilterIconFontSize&&t.erFormHelperProp.setGlobalStyleProperty("--er-grid-ag-icon-filter-font-size",R.GridFilterIconFontSize),R!=null&&R.GridMenuIconFontSize&&t.erFormHelperProp.setGlobalStyleProperty("--er-grid-ag-icon-menu-font-size",R.GridMenuIconFontSize)}),l.onUnmounted(()=>{I==null||I.removeBindingInfo(t.erFormHelperProp,t.configId);const R=t.erFormHelperProp._gridInstanceInfo;R&&delete R[t.configId]}),l.watch(()=>t.erFormHelperProp.getGridOptions(t.configId,"RowSelection",!0),(R,K)=>{R==="single"&&t.erFormHelperProp.unCheckAllGridRow(t.configId),l.nextTick(()=>{var he,z;(z=(he=h.value.gridOptions)==null?void 0:he.api)==null||z.refreshHeader()})}),(R,K)=>{var Ne,xe,Le,ve,Ge,_e,$e;const he=l.resolveComponent("a-input"),z=l.resolveComponent("a-config-providver"),Ie=l.resolveComponent("ag-grid-vue");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(H("enable")===!1?"er-grid-disabled":void 0),style:{height:"100%",width:"100%"}},[l.createVNode(z,{theme:s.value,locale:o.value,componentSize:"small"},{default:l.withCtx(()=>[H("ShowQuickFilter")==="1"?(l.openBlock(),l.createElementBlock("div",l5,[l.createVNode(he,{value:O.value,"onUpdate:value":K[0]||(K[0]=Ke=>O.value=Ke),valueModifiers:{lazy:!0},"allow-clear":!0,onChange:G,placeholder:l.unref(F.ER).Core.$t("ERX.ErGrid.QuickFilterPlaceHoder")},null,8,["value","placeholder"])])):l.createCommentVNode("",!0)]),_:1},8,["theme","locale"]),(l.openBlock(),l.createBlock(Ie,l.mergeProps({ref_key:"agGridVueRef",ref:h},l.unref(u),{class:"ag-theme-balham er-grid",id:((Ne=t.erFormHelperProp)==null?void 0:Ne.FormId)+e.configId,key:((xe=t.erFormHelperProp)==null?void 0:xe.FormId)+e.configId,rowGroupPanelShow:H("ShowGroupPanel")?"always":void 0,enableAdvancedFilter:H("ShowFilterPanel"),rowSelection:H("RowSelection"),style:{height:H("ShowQuickFilter")==="1"?"calc(100% - 28px)":"100%",width:"100%",minHeight:H("miniHeight")},localeText:l.unref(Ci)(),statusBar:D.value?M.value:void 0,pagination:((Le=t.pageOptions)==null?void 0:Le.pagination)===!0||((ve=t.pageOptions)==null?void 0:ve.pagination)==="client",paginationPageSize:((Ge=t.pageOptions)==null?void 0:Ge.pagination)===!0||((_e=t.pageOptions)==null?void 0:_e.pagination)==="client"?(($e=t.pageOptions)==null?void 0:$e.pageSize)||100:void 0,paginateChildRows:!0,paginationAutoPageSize:!1,enableRangeSelection:!0,stopEditingWhenCellsLoseFocus:!0,enableRtl:l.unref(Ta)(),masterDetail:C.value,detailRowAutoHeight:x.value,detailRowHeight:y.value,detailCellRenderer:T.value,detailCellRendererParams:S.value,onRangeSelectionChanged:b,onPaginationChanged:te,onGridReady:P,onCellClicked:Ee,onCellDoubleClicked:fe}),null,16,["id","rowGroupPanelShow","enableAdvancedFilter","rowSelection","style","localeText","statusBar","pagination","paginationPageSize","enableRtl","masterDetail","detailRowAutoHeight","detailRowHeight","detailCellRenderer","detailCellRendererParams"]))],2)}}}),c5=l.defineComponent({name:"NodeRenderer",props:["params"],setup:e=>{const a=l.ref(null);return l.onMounted(()=>{e.params.getNodeIconComponent&&(a.value=e.params.getNodeIconComponent(e.params))}),{props:e,nodeIconComponent:a}}});function d5(e,a,t,o,s,f){return l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(e.nodeIconComponent))),l.createTextVNode(" "+l.toDisplayString(e.props.params.value),1)])}const Ao=sr(c5,[["render",d5]]),f5={style:{"padding-left":"3px","vertical-align":"middle"}},u5={key:0,class:"dropDownFooter"},h5=l.defineComponent({name:"ErSelect",components:{ImagePreview:Mn,NodeRenderer:Ao,"a-button":et.Button,"a-select":et.Select,"a-select-option":et.SelectOption,"a-input-group":et.InputGroup,"a-tooltip":et.Tooltip,"a-tag":et.Tag}}),ba=l.defineComponent({...h5,props:{modelValue:{type:[String,Number,Array],default:void 0},dataSource:{type:Object,default:()=>[]},columns:{type:Object,default:()=>[]},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},treeDropdown:{type:Boolean,default:!1},componentSize:{type:String,default:"small"},options:{type:Object,default:()=>{}}},emits:["dropdownOpen","update:modelValue","change","focus","blur"],setup(e,{expose:a,emit:t}){var v,A,B,Q,N,W,J,re,Se,ue,me,Z,Te,ce,ze,Me;const o=e,s=t,f=l.useAttrs(),u=l.ref(null),h=l.ref([]),C=l.ref(!1),T={},S=l.ref(null),x=l.ref(o.multiple?"multiple":"single"),y=[],O=l.ref(""),D=((v=o.dataSource)==null?void 0:v.length)>10,I=((A=o.options)==null?void 0:A.valueField)||((B=o.options)==null?void 0:B.dataValueField)||((Q=o.options)==null?void 0:Q.valueMember)||"CODE",M=((N=o.options)==null?void 0:N.textField)||((W=o.options)==null?void 0:W.dataTextField)||((J=o.options)==null?void 0:J.displayMember)||"CODE_DESC_1_CONTENT",G=((re=o.options)==null?void 0:re.parentField)||((ue=(Se=o.options)==null?void 0:Se.dropdownOptions)==null?void 0:ue.parentField)||"PARENT_NODE",te=[];let b=((me=o.options)==null?void 0:me.displayRows)||0,P=500,Ee=500,fe=!0,H,oe;const R=l.computed({get(){return C.value=!1,o.multiple?o.modelValue||[]:F.ER.Core.toString(o.modelValue)},set(ge){if(s("update:modelValue",ge),o.modelValue!==ge){const le={};le.preventDefault=()=>{},le.newValue=ge,le.oldValue=o.modelValue,s("change",le)}}}),K={headerName:"Organisation Hierarchy",field:"treeNodeLabel",minWidth:100,hide:!0,cellStyle:{display:"flex",alignItems:"center"},cellRendererParams:{suppressCount:!0,checkbox:o.multiple,innerRenderer:((Z=o.options)==null?void 0:Z.nodeRenderer)||Ao,getNodeIconComponent:((Te=o.options)==null?void 0:Te.getNodeIconComponent)||(((ce=o.options)==null?void 0:ce.defaultNodeIcon)!==!1?ge=>ge.node.allChildrenCount?ge.node.expanded?l.h(it.FolderOpenOutlined,{style:{color:"#f8b932"}}):l.h(it.FolderOutlined,{style:{color:"#f8b932"}}):l.h(it.FileOutlined):void 0)},tooltipField:M},he=ge=>ge.orgHierarchy,z=ge=>ge.data.uid,Ie=ge=>{var le;return(le=o.options)!=null&&le.getNodeStyle?o.options.getNodeStyle instanceof Function?o.options.getNodeStyle(ge):o.options.getNodeStyle:{border:"none",background:"none"}},Ne=ge=>{var le;if((le=o.options)!=null&&le.getNodeHeight){if(typeof o.options.getNodeHeight=="number")return o.options.getNodeHeight;if(o.options.getNodeHeight instanceof Function)return o.options.getNodeHeight(ge)}else return o.componentSize==="large"?30:o.componentSize==="middle"?28:25},xe=ge=>{var le,Y,Fe,ke,Ve,at,pt;if(ge.key==="Escape")C.value=!1;else if(((le=ge.key)!=null&&le.startsWith("Arrow")||ge.key==="Enter")&&C.value===!0){const ht=H.getSelectedNodes();if((ht==null?void 0:ht.length)>0&&((Y=ht[0])!=null&&Y.displayed))H.setFocusedCell((Fe=ht[0])==null?void 0:Fe.rowIndex,M);else if(((ke=o.dataSource)==null?void 0:ke.length)>0){const Ct=H.getFirstDisplayedRow();Ct>=0&&H.setFocusedCell(Ct,M)}}(Ve=o.options)!=null&&Ve.inputKeyDown&&((at=o.options)==null?void 0:at.inputKeyDown)instanceof Function&&((pt=o.options)==null||pt.inputKeyDown(ge))},Le=async ge=>{var le,Y,Fe,ke,Ve,at,pt;if(ge){if(!o.multiple&&(o.readonly||o.disabled))C.value=!1;else if((o.readonly||o.disabled)&&o.multiple&&o.modelValue instanceof Array&&((le=o.modelValue)==null?void 0:le.length)<=1)C.value=!1;else if(!o.readonly&&!o.disabled){if((Y=o.options)!=null&&Y.beforeDropdownOpen&&((Fe=o.options)==null?void 0:Fe.beforeDropdownOpen)instanceof Function){const{options:ht,...Ct}=o;await((ke=o.options)==null?void 0:ke.beforeDropdownOpen({...o.options,...Ct}))}(Ve=o.options)!=null&&Ve.dropdownVisibleChange&&((at=o.options)==null?void 0:at.dropdownVisibleChange)instanceof Function&&((pt=o.options)==null||pt.dropdownVisibleChange(ge)),C.value=!0}Ge()}},ve=()=>{if(H&&(H.deselectAll(),R.value))if(o.multiple){let ge=[];if(typeof R.value=="string"?ge=[R.value]:R.value instanceof Array&&(ge=R.value),ge.length>0){let le;H.forEachLeafNode(Y=>{if(ge.includes(Y.data[I])){let Fe=Y.parent;for(;Fe;)H.setRowNodeExpanded(Fe,!0),Fe=Fe.parent;le=le||Y,Y.setSelected(!0)}}),le&&H.ensureNodeVisible(le)}}else H.forEachLeafNode(ge=>{if(ge.data[I]===R.value){let le=ge.parent;for(;le;)H.setRowNodeExpanded(le,!0),le=le.parent;return ge.setSelected(!0),H.ensureNodeVisible(ge),!0}})},Ge=()=>{var ge,le,Y,Fe,ke,Ve,at,pt,ht,Ct,_t,Qe,U,gt,rt,ct,Ze,Ye,st,mt,At,Rt,Qt,St,nr,Tt,tr,L,ae,q,ee,ne,se,be,Ue,De,Ae,Pe;if(H){if(o.multiple){const we=H.getColumnDef(F.ER.SysInfo.GridCheckColumnFieldName);we&&oe.setColumnVisible(we.colId,!o.readonly)}let tt=[];const k=((Y=(le=(ge=o.options)==null?void 0:ge.itemConfig)==null?void 0:le.FATHER_FIELD)==null?void 0:Y.trim())||"",ie=((Ve=(ke=(Fe=o.options)==null?void 0:Fe.itemConfig)==null?void 0:ke.FORM_FILTER)==null?void 0:Ve.trim())||"",Ce=((ht=(pt=(at=o.options)==null?void 0:at.itemConfig)==null?void 0:pt.LAYOUT_ID)==null?void 0:ht.trim())||((Qe=(_t=(Ct=o.options)==null?void 0:Ct.itemConfig)==null?void 0:_t.FUNCTION_ID)==null?void 0:Qe.trim());if(o.readonly&&((U=o.dataSource)==null?void 0:U.length)>0&&o.modelValue&&o.modelValue instanceof Array&&((gt=o.modelValue)==null?void 0:gt.length)>0)tt=o.dataSource.filter(Xe=>o.modelValue.includes(Xe[I])),fe=!0;else if(k.length>0&&ie.length>0){const we=(ct=(rt=o.options)==null?void 0:rt.erFormHelper)==null?void 0:ct.getGrid(Ce);let Xe;if(we?Xe=(Ye=(Ze=o.options)==null?void 0:Ze.erFormHelper)==null?void 0:Ye.getGridCurrentRow(we,!0):Xe=(mt=(st=o.options)==null?void 0:st.erFormHelper)==null?void 0:mt.getLayoutBindModel(Ce),Xe){const ft=Xe[k]||"";let V=o.dataSource;F.ER.Core.toString(ft).trim().length>0&&(V=(Rt=(At=o.options)==null?void 0:At.erFormHelper)==null?void 0:Rt.filterDropDownCascaderDataSource(o.dataSource,ie,ft)),tt=V,fe=!0}}else(nr=(Qt=o.options)==null?void 0:Qt.erFormHelper)!=null&&nr.DropDownRefreshKey[(St=o.options)==null?void 0:St.configId]&&((L=(Tt=o.options)==null?void 0:Tt.erFormHelper)!=null&&L.DropDownBindSource[(tr=o.options)==null?void 0:tr.configId])&&((ae=o.options)!=null&&ae.itemCode)?tt=((be=(se=(q=o.options)==null?void 0:q.erFormHelper)==null?void 0:se.DropDownBindSource[(ee=o.options)==null?void 0:ee.configId][(ne=o.options)==null?void 0:ne.itemCode])==null?void 0:be.dataSource)||[]:o.dataSource&&(tt=o.dataSource);tt.length===0?b=3:tt.length<15?b=tt.length+1:b=15,b<5&&((De=(Ue=o.options)==null?void 0:Ue.groupFields)!=null&&De.length||D)&&(b=5),Ee=b*(o.componentSize==="large"?30:o.componentSize==="middle"?28:25)+10,((Ae=o.columns)==null?void 0:Ae.length)>1?(P=0,y.forEach(we=>{P+=we.width}),S.value=P+20,O.value={padding:"0px",height:Ee+"px",minWidth:P}):((Pe=o.columns)==null?void 0:Pe.length)===1?(S.value=!0,O.value={padding:"0px",height:Ee+"px"}):(P=300,S.value=P+15,O.value={padding:"0px",height:Ee+"px",minWidth:P}),fe&&(H.setQuickFilter(),H.setFilterModel(null),o.treeDropdown?_e(tt):H.setRowData(tt),fe=!1),l.nextTick(()=>{u.value.focus(),s("dropdownOpen",{gridApi:H,columnApi:oe,dropDownColumns:y})})}},_e=ge=>{te.length=0,ge=ge||[];const le={};ge.forEach(Fe=>{le[Fe[I]]={...Fe}});const Y=(Fe,ke)=>{const Ve=[];for(;ke;)Ve.unshift(ke[I]),ke=Fe[ke[G]];return Ve};ge.forEach(Fe=>{const ke={...Fe,treeNodeLabel:_(Fe),orgHierarchy:Y(le,Fe),uid:F.ER.Core.guid()};te.push(ke)}),H.setRowData(te)},$e=ge=>{},Ke=ge=>{C.value=!1},X=ge=>{o.readonly!==!0&&l.nextTick(()=>{H==null||H.setQuickFilter(ge)})},pe=ge=>{s("focus",ge)},r=ge=>{C.value=!1,s("blur",ge)},i=ge=>{const le=H.getSelectedNodes(),Y=[];le.forEach(Fe=>{var ke,Ve;(((Ve=(ke=o.options)==null?void 0:ke.dropdownOptions)==null?void 0:Ve.leafNodeSelect)===!1||!Fe.allChildrenCount)&&Y.push(Fe.data[I])}),R.value=Y,C.value=!1},n=ge=>{C.value=!1},c=ge=>{var le,Y,Fe,ke,Ve,at;if((ge==null?void 0:ge.length)>0&&((le=T[ge])!=null&&le.trim().startsWith("IconFont:")||(Y=T[ge])!=null&&Y.startsWith("ImgUrl:"))){if((Fe=T[ge])!=null&&Fe.trim().startsWith("IconFont:"))return F.ER.Core.createErSvgVNode((ke=T[ge])==null?void 0:ke.trim().replace("IconFont:",""));if((Ve=T[ge])!=null&&Ve.startsWith("ImgUrl:"))return F.ER.Core.createRemoteImgVNode((at=T[ge])==null?void 0:at.trim().replace("ImgUrl:",""))}},d=(ge,le)=>{const Y=document.createElement("div");Y.style.display="flex";let Fe;ge.startsWith("IconFont:")?(ge=ge.replace("IconFont:",""),Fe=F.ER.Core.createErSvgElement(ge)):ge.startsWith("ImgUrl:")&&(ge=ge.replace("ImgUrl:",""),Fe=F.ER.Core.createRemoteImgElement(ge)),Fe&&(Fe.style.paddingTop="1px",Y.appendChild(Fe));const ke=document.createElement("span");return ke.innerHTML=le,ke.style.paddingLeft="3px",Y.appendChild(ke),Y},p=ge=>{var Fe,ke,Ve,at,pt,ht,Ct,_t,Qe,U,gt;H=ge.api,oe=ge.columnApi,H.addEventListener("selectionChanged",rt=>{if(!(o.treeDropdown&&o.multiple)){if(!o.multiple){const ct=H.getSelectedRows();ct.length===1&&(R.value=ct[0][I])}}}),H.addEventListener("cellClicked",rt=>{if(rt.data&&!o.treeDropdown&&!o.multiple){const ct=H.getSelectedRows();ct.length===1&&(R.value=ct[0][I]),C.value=!1}}),H.addEventListener("cellDoubleClicked",rt=>{var ct,Ze;rt.data&&o.treeDropdown&&!o.multiple&&(rt.node.allChildrenCount&&((Ze=(ct=o.options)==null?void 0:ct.dropdownOptions)==null?void 0:Ze.leafNodeSelect)!==!1||(R.value=rt.data[I],C.value=!1))}),H.addEventListener("cellKeyDown",rt=>{var ct,Ze;((ct=rt.event)==null?void 0:ct.key)==="Escape"?C.value=!1:((Ze=rt.event)==null?void 0:Ze.key)==="Enter"&&rt!=null&&rt.data&&(R.value=rt.data[I],C.value=!1)}),H.addEventListener("rowDataUpdated",rt=>{setTimeout(()=>{ve()},500)});let le=[];if(((Fe=o.columns)==null?void 0:Fe.length)>0?le=o.columns:((Ve=(ke=o.options)==null?void 0:ke.columns)==null?void 0:Ve.length)>0&&(le=(at=o.options)==null?void 0:at.columns),le.length===0){const rt={colId:I,field:I,tooltipField:I,headerName:F.ER.Core.$t("ERX.CodeColumn")||"代码",width:100,minWidth:100,maxWidth:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:(pt=o.options)==null?void 0:pt.floatingFilter};(ht=o.options)!=null&&ht.imageCombo&&(rt.cellRenderer=ct=>{var Ye,st,mt;const Ze=F.ER.Core.toString(ct.value).replace(/</g,"&lt;");return((Ye=ct.value)==null?void 0:Ye.length)>0&&((st=T[ct.value])!=null&&st.trim().startsWith("IconFont:")||(mt=T[ct.value])!=null&&mt.startsWith("ImgUrl:"))?d(T[ct.value],Ze):Ze}),y.push(rt),y.push({colId:M,field:M,tooltipField:M,headerName:F.ER.Core.$t("ERX.DescriptionColumn")||"描述",width:200,sortable:!0,resizable:!0,filter:"agTextColumnFilter",suppressMenu:!0,floatingFilter:((Ct=o.options)==null?void 0:Ct.floatingFilter)===!0})}else le.forEach((rt,ct)=>{var Ye,st,mt,At,Rt,Qt,St,nr;const Ze={...rt,tooltipField:rt.field,headerName:rt.headerName||rt.title,width:rt.width||150,sortable:rt.sortable!==void 0?rt.sortable:!0,resizable:rt.resizable!==void 0?rt.resizable:!0,filter:rt.filter||"agTextColumnFilter",suppressMenu:rt.suppressMenu!==void 0?rt.suppressMenu:!0,enableRowGroup:rt.enableRowGroup!==void 0?rt.enableRowGroup:!0,rowGroup:(st=(Ye=o.options)==null?void 0:Ye.groupFields)==null?void 0:st.includes(rt.field),hide:((At=(mt=o.options)==null?void 0:mt.groupFields)==null?void 0:At.includes(rt.field))??!1,floatingFilter:((Rt=o.options)==null?void 0:Rt.floatingFilter)===!0||((Qt=o.options)==null?void 0:Qt.floatingFilter)!==!1&&le.length>2&&((St=o.dataSource)==null?void 0:St.length)>30,cellStyle:{display:"flex",alignItems:"center"}};(Ze.field.endsWith("@IMG")||Ze.field.endsWith("@IMAGE"))&&(Ze.field=Ze.field.replace("@IMG","").replace("@IMAGE",""),Ze.sortable=!1,Ze.filter=!1,Ze.autoHeight=!0,Ze.wrapText=!0,Ze.suppressMenu=!0,Ze.floatingFilter=!1,Ze.cellRenderer=Mn,Ze.cellRendererParams=Tt=>(Tt.src=Tt.data[Tt.colDef.field],Tt.width=Ze.width||150,Tt.height=100,Tt)),ct===0&&((nr=o.options)!=null&&nr.imageCombo)&&(Ze.cellRenderer=Tt=>{const tr=F.ER.Core.toString(Tt.value).replace(/</g,"&lt;"),L=Tt.data[I]||tr,ae=T[L]||"";return ae.startsWith("IconFont:")||ae.startsWith("ImgUrl:")?d(ae,tr):tr}),y.push(Ze)});let Y=0;y.forEach(rt=>{var Ze,Ye,st,mt,At;const ct=((st=(Ye=(Ze=o.options)==null?void 0:Ze.dropdownOptions)==null?void 0:Ye.wrapText)==null?void 0:st[rt.field])??((At=(mt=o.options)==null?void 0:mt.dropdownOptions)==null?void 0:At.wrapText);rt.autoHeight=rt.autoHeight||ct,rt.wrapText=rt.wrapText||ct,rt.hide=rt.hide||o.treeDropdown,Y+=rt.width}),!o.treeDropdown&&o.multiple&&(y.unshift({colId:F.ER.SysInfo.GridCheckColumnFieldName,pinned:Ta()?"right":"left",headerCheckboxSelection:rt=>o.readonly!==!0,checkboxSelection:rt=>o.readonly!==!0&&!rt.node.group&&!rt.node.footer,headerCheckboxSelectionFilteredOnly:((_t=o.options)==null?void 0:_t.headerCheckboxSelectionFilteredOnly)??!0,headerName:"",width:50,suppressMenu:!0,resizable:!0,sortable:!1,lockPosition:Ta()?"right":"left"}),Y+=50),H.selectionService.rowSelection=o.multiple?"multiple":"single",H.setColumnDefs(y),o.treeDropdown&&(K.width=Y,H.setAutoGroupColumnDef(K)),(Qe=o.options)!=null&&Qe.gridReady&&typeof((U=o.options)==null?void 0:U.gridReady)=="function"&&((gt=o.options)==null||gt.gridReady({gridApi:H,columnApi:oe})),Ge()},m=ge=>{var Y,Fe,ke;const le=[];return ge.api.getDisplayedRowCount()>0&&(le.push("copy","copyWithHeaders"),((Fe=(Y=ge.columnApi)==null?void 0:Y.getRowGroupColumns())==null?void 0:Fe.length)>0&&le.push("separator","expandAll","contractAll")),(ke=ge.api)!=null&&ke.isColumnFilterPresent()&&(le.push("separator"),le.push({name:F.ER.Core.$t("ERX.ErGrid.ClearAllColumnFilter")||"清除所有列过滤条件",action:()=>{var Ve;(Ve=ge.api)==null||Ve.setFilterModel(null)}})),le};l.watch(()=>{var ge,le,Y,Fe;return(Fe=(ge=o.options)==null?void 0:ge.erFormHelper)==null?void 0:Fe.DropDownRefreshKey[(le=o.options)==null?void 0:le.configId][(Y=o.options)==null?void 0:Y.itemCode]},(ge,le)=>{h.value=E(),fe=!0}),l.watch(()=>o.dataSource,(ge,le)=>{h.value=E(),fe=!0});const _=ge=>{var Y;let le="{1}";return(Y=o.options)!=null&&Y.displayFormat&&(o.options.displayFormat instanceof Function?le=o.options.displayFormat(ge)||"{1}":typeof o.options.displayFormat=="string"&&(le=o.options.displayFormat||"{1}")),le.replaceAll("{0}",ge[I]).replaceAll("{1}",ge[M])},E=()=>{var Y,Fe,ke,Ve,at,pt,ht,Ct,_t,Qe,U,gt,rt;const ge=[];let le=o.dataSource;return(Y=o.options)!=null&&Y.configId&&((Fe=o.options)!=null&&Fe.itemCode)&&((at=(ke=o.options)==null?void 0:ke.erFormHelper)!=null&&at.DropDownBindSource[(Ve=o.options)==null?void 0:Ve.configId])&&((_t=(pt=o.options)==null?void 0:pt.erFormHelper)!=null&&_t.DropDownBindSource[(ht=o.options)==null?void 0:ht.configId][(Ct=o.options)==null?void 0:Ct.itemCode])&&(le=(rt=(Qe=o.options)==null?void 0:Qe.erFormHelper)==null?void 0:rt.DropDownBindSource[(U=o.options)==null?void 0:U.configId][(gt=o.options)==null?void 0:gt.itemCode].dataSource),le=le||o.dataSource,(le==null?void 0:le.length)>0&&Object.keys(le[0]).length>0&&le.forEach(ct=>{var Ye,st,mt;const Ze={...ct};Ze.value=ct[I],Ze.label=_(ct),ge.push(Ze),(Ye=o.options)!=null&&Ye.imageCombo&&((st=ct.IMAGE_URL)==null?void 0:st.trim().length)>0&&(T[ct[I]]=(mt=ct.IMAGE_URL)==null?void 0:mt.trim())}),ge};return l.onMounted(()=>{h.value=E(),o.readonly&&(C.value=!1)}),a({gridApi:H,antSelect:u.value,configId:(ze=o.options)==null?void 0:ze.configId,itemCode:(Me=o.options)==null?void 0:Me.itemCode}),(ge,le)=>{var pt,ht,Ct;const Y=l.resolveComponent("a-select-option"),Fe=l.resolveComponent("ag-grid-vue"),ke=l.resolveComponent("a-button"),Ve=l.resolveComponent("a-tag"),at=l.resolveComponent("a-select");return l.openBlock(),l.createBlock(at,l.mergeProps({value:R.value,"onUpdate:value":le[0]||(le[0]=_t=>R.value=_t),ref_key:"selectRef",ref:u},l.unref(f),{options:(pt=o.options)!=null&&pt.imageCombo?void 0:h.value,open:C.value,"dropdown-match-select-width":S.value,defaultActiveFirstOption:!1,"show-search":!o.readonly&&!o.disabled,mode:o.multiple?"multiple":void 0,disabled:o.disabled,maxTagCount:((ht=o.options)==null?void 0:ht.maxTagCount)||5,menuItemSelectedIcon:l.h(l.unref(it.CheckCircleOutlined)),onClick:$e,onInputKeyDown:xe,onDropdownVisibleChange:Le,onChange:Ke,onSearch:X,onFocus:pe,onBlur:r}),l.createSlots({dropdownRender:l.withCtx(()=>{var _t,Qe,U,gt,rt,ct,Ze;return[l.createElementVNode("div",{style:l.normalizeStyle(O.value)},[l.createVNode(Fe,{id:((_t=l.unref(f))==null?void 0:_t.id)+"_pop_grid",class:"ag-theme-balham",style:l.normalizeStyle({height:"100%",width:"100%",fontSize:o.componentSize==="large"?"16px":o.componentSize==="middle"?"14px":"12px"}),groupDisplayType:((U=(Qe=o.options)==null?void 0:Qe.groupFields)==null?void 0:U.length)>0&&!o.treeDropdown?"groupRows":void 0,groupDefaultExpanded:o.treeDropdown?void 0:-1,enableRtl:l.unref(Ta)(),localeText:l.unref(Ci)(),"header-height":o.treeDropdown||y.length===1?0:void 0,treeData:o.treeDropdown,getRowId:o.treeDropdown?z:void 0,getRowStyle:o.treeDropdown?Ie:void 0,getRowHeight:Ne,getDataPath:o.treeDropdown?he:void 0,"row-selection":x.value,groupSelectsChildren:o.treeDropdown&&o.multiple&&((rt=(gt=o.options)==null?void 0:gt.dropdownOptions)==null?void 0:rt.leafNodeSelect)!==!1,suppressRowClickSelection:o.multiple||o.treeDropdown,stopEditingWhenCellsLoseFocus:!0,enableBrowserTooltips:!1,statusBar:D?{statusPanels:[{statusPanel:"agTotalAndFilteredRowCountComponent",align:"right"}]}:void 0,getContextMenuItems:m,groupRowRenderer:(ct=o.options)==null?void 0:ct.groupRowRenderer,groupRowRendererParams:(Ze=o.options)==null?void 0:Ze.groupRowRendererParams,onGridReady:p,onBlur:r},null,8,["id","style","groupDisplayType","groupDefaultExpanded","enableRtl","localeText","header-height","treeData","getRowId","getRowStyle","getDataPath","row-selection","groupSelectsChildren","suppressRowClickSelection","statusBar","groupRowRenderer","groupRowRendererParams"])],4),o.multiple?(l.openBlock(),l.createElementBlock("div",u5,[o.readonly?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(ke,{key:0,type:"primary",class:l.normalizeClass(`${o.componentSize}-button`),icon:l.h(l.unref(it.CheckCircleOutlined)),onClick:i},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Confirm")||"确定"),1)]),_:1},8,["class","icon"])),l.createVNode(ke,{type:"primary",class:l.normalizeClass(`${o.componentSize}-button`),icon:l.h(l.unref(it.CloseCircleOutlined)),onClick:n},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["class","icon"])])):l.createCommentVNode("",!0)]}),default:l.withCtx(()=>{var _t;return[(_t=o.options)!=null&&_t.imageCombo?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(h.value,Qe=>(l.openBlock(),l.createBlock(Y,{"v-bind":{title:""},value:Qe.value,label:Qe.label},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(c(Qe.value)),{style:{"vertical-align":"middle"}})),l.createElementVNode("span",f5,l.toDisplayString(Qe.label),1)]),_:2},1032,["value","label"]))),256)):l.createCommentVNode("",!0)]}),_:2},[o.readonly?{name:"tagRender",fn:l.withCtx(({label:_t,closable:Qe,onClose:U})=>[l.createVNode(Ve,{closable:!1},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(_t)+" ",1)]),_:2},1024)]),key:"0"}:void 0,(Ct=o.options)!=null&&Ct.suffixIcon?{name:"suffixIcon",fn:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(o.options.suffixIcon)))]),key:"1"}:void 0]),1040,["value","options","open","dropdown-match-select-width","show-search","mode","disabled","maxTagCount","menuItemSelectedIcon"])}}}),p5=l.defineComponent({name:"ErCheckboxGroup",components:{"a-config-providver":et.ConfigProvider,"a-checkbox":et.Checkbox,"a-checkbox-group":et.CheckboxGroup}}),wo=l.defineComponent({...p5,props:{modelValue:{type:Array,default:[]},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataSource:{type:Object,default:()=>[]},valueField:{type:String,default:"CODE"},textField:{type:String,default:"CODE_DESC_1_CONTENT"},options:{type:Object,default:()=>{}}},emits:["update:modelValue","change"],setup(e,{emit:a}){var S;const t=e,o=l.ref([]),s=a,f=l.ref(zt());window.$wujie&&((S=window.$wujie.bus)==null||S.$on("changeThemeEmit",x=>{f.value=zt()}));const u=x=>{s("change",x)},h=l.computed({get(){return t.modelValue||[]},set(x){if(s("update:modelValue",x),t.modelValue!==x){const y={};y.preventDefault=()=>{},y.newValue=x,y.oldValue=t.modelValue,s("change",y)}}});l.watch(()=>{var x,y,O,D;return(D=(x=t.options)==null?void 0:x.erFormHelper)==null?void 0:D.DropDownRefreshKey[(y=t.options)==null?void 0:y.configId][(O=t.options)==null?void 0:O.itemCode]},(x,y)=>{o.value=T()}),l.watch(()=>t.dataSource,(x,y)=>{o.value=T()});const C=x=>{var O;let y="{1}";return(O=t.options)!=null&&O.displayFormat&&(t.options.displayFormat instanceof Function?y=t.options.displayFormat(x)||"{1}":typeof t.options.displayFormat=="string"&&(y=t.options.displayFormat||"{1}")),y.replaceAll("{0}",x[t.valueField]).replaceAll("{1}",x[t.textField])},T=()=>{var O,D,I,M,G,te,b,P,Ee,fe,H,oe,R;const x=[];let y=t.dataSource;return(O=t.options)!=null&&O.configId&&((D=t.options)!=null&&D.itemCode)&&((G=(I=t.options)==null?void 0:I.erFormHelper)!=null&&G.DropDownBindSource[(M=t.options)==null?void 0:M.configId])&&((Ee=(te=t.options)==null?void 0:te.erFormHelper)!=null&&Ee.DropDownBindSource[(b=t.options)==null?void 0:b.configId][(P=t.options)==null?void 0:P.itemCode])&&(y=(R=(fe=t.options)==null?void 0:fe.erFormHelper)==null?void 0:R.DropDownBindSource[(H=t.options)==null?void 0:H.configId][(oe=t.options)==null?void 0:oe.itemCode].dataSource),y=y||t.dataSource,(y==null?void 0:y.length)>0&&Object.keys(y[0]).length>0&&y.forEach(K=>{const he={...K};he.value=K[t.valueField],he.label=C(K),x.push(he)}),x};return l.onMounted(()=>{o.value=T()}),(x,y)=>{const O=l.resolveComponent("a-checkbox"),D=l.resolveComponent("a-checkbox-group"),I=l.resolveComponent("a-config-providver");return l.openBlock(),l.createBlock(I,{theme:f.value,locale:l.unref(yr)()},{default:l.withCtx(()=>[l.createVNode(D,{class:"er-checkbox-container",value:h.value,"onUpdate:value":y[0]||(y[0]=M=>h.value=M),onChange:u},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,M=>(l.openBlock(),l.createElementBlock("div",{key:M.value,class:"er-checkbox-wrapper"},[l.createVNode(O,{value:M.value,disabled:t.disabled},{default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["er-checkbox-content",{"is-checked":h.value.includes(M.value)}])},l.toDisplayString(M.label),3)]),_:2},1032,["value","disabled"])]))),128))]),_:1},8,["value"])]),_:1},8,["theme","locale"])}}}),m5=l.defineComponent({name:"ErRadioGroup",components:{"a-config-providver":et.ConfigProvider,"a-radio":et.Radio,"a-radio-group":et.RadioGroup}}),Mo=l.defineComponent({...m5,props:{modelValue:{type:[String,Number],default:""},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dataSource:{type:Object,default:()=>[]},valueField:{type:String,default:"CODE"},textField:{type:String,default:"CODE_DESC_1_CONTENT"},options:{type:Object,default:()=>{}}},emits:["update:modelValue","change"],setup(e,{emit:a}){var S;const t=e,o=l.ref([]),s=a,f=l.ref(zt());window.$wujie&&((S=window.$wujie.bus)==null||S.$on("changeThemeEmit",x=>{f.value=zt()}));const u=x=>{s("change",x)},h=l.computed({get(){return t.modelValue},set(x){if(s("update:modelValue",x),t.modelValue!==x){const y={};y.preventDefault=()=>{},y.newValue=x,y.oldValue=t.modelValue,s("change",y)}}});l.watch(()=>{var x,y,O,D;return(D=(x=t.options)==null?void 0:x.erFormHelper)==null?void 0:D.DropDownRefreshKey[(y=t.options)==null?void 0:y.configId][(O=t.options)==null?void 0:O.itemCode]},(x,y)=>{o.value=T()}),l.watch(()=>t.dataSource,(x,y)=>{o.value=T()});const C=x=>{var O;let y="{1}";return(O=t.options)!=null&&O.displayFormat&&(t.options.displayFormat instanceof Function?y=t.options.displayFormat(x)||"{1}":typeof t.options.displayFormat=="string"&&(y=t.options.displayFormat||"{1}")),y.replaceAll("{0}",x[t.valueField]).replaceAll("{1}",x[t.textField])},T=()=>{var O,D,I,M,G,te,b,P,Ee,fe,H,oe,R;const x=[];let y=t.dataSource;return(O=t.options)!=null&&O.configId&&((D=t.options)!=null&&D.itemCode)&&((G=(I=t.options)==null?void 0:I.erFormHelper)!=null&&G.DropDownBindSource[(M=t.options)==null?void 0:M.configId])&&((Ee=(te=t.options)==null?void 0:te.erFormHelper)!=null&&Ee.DropDownBindSource[(b=t.options)==null?void 0:b.configId][(P=t.options)==null?void 0:P.itemCode])&&(y=(R=(fe=t.options)==null?void 0:fe.erFormHelper)==null?void 0:R.DropDownBindSource[(H=t.options)==null?void 0:H.configId][(oe=t.options)==null?void 0:oe.itemCode].dataSource),y=y||t.dataSource,(y==null?void 0:y.length)>0&&Object.keys(y[0]).length>0&&y.forEach(K=>{const he={...K};he.value=K[t.valueField],he.label=C(K),x.push(he)}),x};return l.onMounted(()=>{o.value=T()}),(x,y)=>{const O=l.resolveComponent("a-radio"),D=l.resolveComponent("a-radio-group"),I=l.resolveComponent("a-config-providver");return l.openBlock(),l.createBlock(I,{theme:f.value,locale:l.unref(yr)()},{default:l.withCtx(()=>[l.createVNode(D,{class:"er-radio-container",value:h.value,"onUpdate:value":y[0]||(y[0]=M=>h.value=M),onChange:u},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,M=>(l.openBlock(),l.createElementBlock("div",{key:M.value,class:"er-radio-wrapper"},[l.createVNode(O,{value:M.value,disabled:t.disabled},{default:l.withCtx(()=>[l.createElementVNode("div",{class:l.normalizeClass(["er-radio-content",{"is-checked":h.value===M.value}])},l.toDisplayString(M.label),3)]),_:2},1032,["value","disabled"])]))),128))]),_:1},8,["value"])]),_:1},8,["theme","locale"])}}}),g5={style:{display:"flex","flex-direction":"column"}},E5={class:"erMemoEditorFooter"},C5=l.defineComponent({name:"ErMemoEditor",components:{"a-button":et.Button,"a-input":et.Input,"a-textarea":et.Textarea,"a-popover":et.Popover,"a-config-providver":et.ConfigProvider}}),ko=l.defineComponent({...C5,props:{modelValue:{type:[String,Number,Array],default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},options:{type:Object,default:()=>{}}},emits:["update:modelValue","change","focus","blur","pressEnter"],setup(e,{emit:a}){var b;const t=e,o=a,s=l.useAttrs(),f=l.ref(null),u=l.ref(!1),h=l.ref(""),C=l.ref(250),T=l.ref(null),S=l.ref(zt());window.$wujie&&((b=window.$wujie.bus)==null||b.$on("changeThemeEmit",P=>{S.value=zt()}));const x=l.computed({get(){return t.modelValue},set(P){if(o("update:modelValue",P),t.modelValue!==P){const Ee={};Ee.preventDefault=()=>{},Ee.newValue=P,Ee.oldValue=t.modelValue,o("change",Ee)}}}),y=P=>{P&&(C.value=f.value.$el.clientWidth,T.value={width:f.value.$el.clientWidth+"px"},h.value=x.value,f.value.$el.focus())},O=P=>{u.value=!1,o("change",P)},D=P=>{x.value!==h.value&&(x.value=h.value,o("change",P)),u.value=!1},I=()=>{u.value=!1},M=P=>{o("pressEnter",P)},G=P=>{o("focus",P)},te=P=>{o("blur",P)};return l.onMounted(()=>{}),(P,Ee)=>{const fe=l.resolveComponent("a-textarea"),H=l.resolveComponent("a-button"),oe=l.resolveComponent("a-input"),R=l.resolveComponent("a-popover"),K=l.resolveComponent("a-config-providver");return l.openBlock(),l.createBlock(K,{theme:S.value,locale:l.unref(yr)()},{default:l.withCtx(()=>[l.createVNode(R,{open:u.value,"onUpdate:open":Ee[2]||(Ee[2]=he=>u.value=he),trigger:"click","overlay-style":T.value,onOpenChange:y,overlayClassName:"erMemoEditorContainer"},{content:l.withCtx(()=>{var he,z,Ie,Ne;return[l.createElementVNode("div",g5,[(l.openBlock(),l.createBlock(fe,l.mergeProps({value:h.value,"onUpdate:value":Ee[0]||(Ee[0]=xe=>h.value=xe)},l.unref(s),{readonly:t.readonly,disabled:t.disabled,rows:((he=l.unref(s))==null?void 0:he.rows)||8,id:((z=l.unref(s))==null?void 0:z.id)+"-PopoverTextarea",name:((Ie=l.unref(s))==null?void 0:Ie.id)+"-PopoverTextarea",key:((Ne=l.unref(s))==null?void 0:Ne.id)+"-PopoverTextarea"}),null,16,["value","readonly","disabled","rows","id","name"])),l.createElementVNode("div",E5,[t.readonly!==!0&&t.disabled!==!0?(l.openBlock(),l.createBlock(H,{key:0,type:"primary",class:"xr-er-button",icon:l.h(l.unref(it.CheckCircleOutlined)),onClick:D},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Confirm")||"确认"),1)]),_:1},8,["icon"])):l.createCommentVNode("",!0),l.createVNode(H,{type:"primary",class:"xr-er-button",icon:l.h(l.unref(it.CloseCircleOutlined)),onClick:I},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)]),_:1},8,["icon"])])])]}),default:l.withCtx(()=>[l.createVNode(oe,l.mergeProps({value:x.value,"onUpdate:value":Ee[1]||(Ee[1]=he=>x.value=he)},l.unref(s),{readOnly:t.readonly,disabled:t.disabled,ref_key:"inputRef",ref:f,onChange:O,onPressEnter:M,onFocus:G,onBlur:te}),null,16,["value","readOnly","disabled"])]),_:1},8,["open","overlay-style"])]),_:1},8,["theme","locale"])}}}),_5=["draggable","onDragstart","onDragenter","onDrop"],T5=["onClick","onDblclick","innerHTML"],S5=["onClick","onDblclick","innerHTML"],x5=["onClick","onDblclick","innerHTML"],y5=["onClick","onDblclick"],v5=["onClick","onDblclick","innerHTML"],F5=["onClick","onDblclick","innerHTML"],O5=["onClick","onDblclick","innerHTML"],I5=["onClick","onDblclick","innerHTML"],D5=["onClick","onDblclick","innerHTML"],A5=["onClick","onDblclick","innerHTML"],w5=["onClick","onDblclick","innerHTML"],M5=["onClick","onDblclick","innerHTML"],k5=["onClick","onDblclick"],b5=["onClick","onDblclick","innerHTML"],R5=["onClick","onDblclick","innerHTML"],N5=["onClick","onDblclick","innerHTML"],L5=["id","label-col"],P5=["id"],B5=["id","name"],H5=["onClick","onDblclick","innerHTML"],V5={key:0,style:{position:"relative",display:"flex","flex-direction":"row-reverse","margin-top":"-5px"}};Ut.locale("zh-cn");const U5=l.defineComponent({name:"ErLayout",components:{codemirror:qi.Codemirror,"a-tag":et.Tag,"a-menu":et.Menu,"a-input":et.Input,"a-input-number":et.InputNumber,"a-input-group":et.InputGroup,"a-radio-group":et.RadioGroup,"a-select":et.Select,"a-tooltip":et.Tooltip,"a-time-picker":et.TimePicker,"a-date-picker":et.DatePicker,"a-textarea":et.Textarea,"a-dropdown":et.Dropdown,"a-checkbox":et.Checkbox,"a-switch":et.Switch,"a-button":et.Button,"a-divider":et.Divider,"a-form":et.Form,"a-form-item":et.FormItem,"a-config-providver":et.ConfigProvider,"er-panel":Dr},directives:{customRef:e=>{console.log(e)}}}),Qi=l.defineComponent({...U5,props:{layoutName:{type:String,default:F.ER.Core.guid(),require:!0},erFormHelperProp:{type:Object,default:null,require:!0},configId:{type:String,default:"",require:!0},configCaption:{type:String,default:"",require:!1},options:{type:Object,default:()=>{},require:!1},showGroupBorder:{type:Boolean,default:void 0,require:!1},allowCollapse:{type:Boolean,default:void 0,require:!1},isCollapsed:{type:Boolean,default:!1,require:!1},displayRows:{type:Number,default:-603,require:!1},showQueryButton:{type:[Boolean,String],default:void 0,require:!1},showFormToolbar:{type:Boolean,default:void 0,require:!1},showPageButton:{type:Boolean,default:!0,require:!1},showPrintButton:{type:Boolean,default:!0,require:!1},showRefreshButton:{type:Boolean,default:!0,require:!1},showAddButton:{type:Boolean,default:!0,require:!1},showAddCopyButton:{type:Boolean,default:!0,require:!1},showDeleteButton:{type:Boolean,default:!0,require:!1},showSaveButton:{type:Boolean,default:!0,require:!1},autoBind:{type:Boolean,default:!1,require:!1},bindModel:{type:Object,default:void 0,require:!1},labelAlignTop:{type:Boolean,default:!1,require:!1}},emits:["layoutReady","configUpdate","QueryClick","DisplayAllClick","resetClick","loaded","toolbarClick","toolbarFirstClick","toolbarPreClick","toolbarNextClick","toolbarLastClick","toolbarPrintClick","toolbarRefreshClick","toolbarAddClick","toolbarAddCopyClick","toolbarDeleteClick","toolbarSaveClick","codeMirrorReady","authButtonClick","groupButtonClick","itemClick","itemDbclick","itemButtonClick","dropdownOpen","valueChanged","pressEnter","focus","blur"],setup(e,{emit:a}){const t=e,o=a,s=l.ref(!1),f=l.ref(null),u=l.ref(""),h=l.ref(!1),C=l.ref("swap"),T=l.reactive({}),S=l.ref(!1),x=l.ref([]),y=l.ref(null),O=[],D=[],I=l.ref(""),M=l.ref(!1),G=l.ref(0),te=l.ref(!1),b=l.ref("small"),P=l.ref(new F.ER.Model),Ee=l.ref([]),fe=l.ref(-603),H=l.ref(!1),oe=l.ref(""),R=l.reactive({}),K=[],he=[],z=l.ref(t.options||{}),Ie=l.reactive({}),Ne=l.ref([]);let xe=5,Le=5,ve=4,Ge="F",_e=0,$e=!1,Ke={},X=[],pe=-1,r="1fr",i={},n=!0,c=!1,d;const p=new F.ER.PopTreeHelper("CURRENT_NODE_CODE","PARENT_NODE_CODE","CURRENT_NODE_DESC",{title:"DataSet Config List",nodeRenderer:Ti}),m=l.ref(yr()),_=l.ref(zt()),E=et.Form.useForm(P,R),v=(k,ie)=>{var we,Xe,ft,V;let Ce;if(k!=null&&k.ITEM_CODE){const de=((we=z.value[k.ITEM_CODE])==null?void 0:we.showTooltip)??((Xe=z.value)==null?void 0:Xe.showTooltip);if(de!=="0"&&de!=="false"&&de!==!1){const w=((ft=k.COL_CAPTION)==null?void 0:ft.trim())||((V=k.COL_CAPTION_DEFAULT)==null?void 0:V.trim());(w==null?void 0:w.trim().length)>0&&(ie==null?void 0:ie.length)>0?Ce=`${w.replace(/<br\s*\/?>/gi,"")}: ${ie}`:(w==null?void 0:w.trim().length)>0&&k.HEAD_TEXTVISIBLE==="1"&&(Ce=w.replace(/<br\s*\/?>/gi,""))}}return Ce},A=k=>{o("codeMirrorReady",k)},B=(k,ie)=>{const Ce=X.findIndex(Xe=>Xe.ROW_GUID===k),we=X.findIndex(Xe=>Xe.ROW_GUID===ie);if(Ce>=0&&we>=0&&Ce!==we){const Xe=X[Ce];X[Ce]=X[we],X[we]=Xe}},Q=(k,ie)=>{const Ce=X.findIndex(Xe=>Xe.ROW_GUID===k),we=X.findIndex(Xe=>Xe.ROW_GUID===ie);Ce>=0&&we>=0&&Ce!==we&&(Ce<we,X.splice(we,0,X.splice(Ce,1)[0]))},N=()=>{document.querySelectorAll(".layout-item-drag-enter").forEach(k=>{k.classList.remove("layout-item-drag-enter")})},W=()=>{document.querySelectorAll(".layout-item-drag-move").forEach(k=>{k.classList.remove("layout-item-drag-move")})},J=(k,ie)=>{var Ce;if(s.value){if(X.length>0&&X[X.length-1].ITEM_CODE==="erQueryButton"&&X.pop(),W(),ie.ITEM_CODE){(Ce=t.erFormHelperProp.getLayoutLabelSpan(t.configId,ie.ITEM_CODE))==null||Ce.addClass("layout-item-drag-move");const we=document.getElementsByName(t.erFormHelperProp.FormId+t.configId+ie.ITEM_CODE+"_empty");we.length>0&&we.forEach(Xe=>{Xe.classList.add("layout-item-drag-move")})}k.dataTransfer.effectAllowed="move",i=ie}},re=(k,ie)=>{var Ce;if(s.value&&(N(),ie.ITEM_CODE)){(Ce=t.erFormHelperProp.getLayoutLabelSpan(t.configId,ie.ITEM_CODE))==null||Ce.addClass("layout-item-drag-enter");const we=document.getElementsByName(t.erFormHelperProp.FormId+t.configId+ie.ITEM_CODE+"_empty");we.length>0&&we.forEach(Xe=>{Xe.classList.add("layout-item-drag-enter")})}},Se=(k,ie)=>{s.value&&(N(),W(),i.ROW_GUID!==ie.ROW_GUID&&(C.value==="insert"?Q(i.ROW_GUID,ie.ROW_GUID):B(i.ROW_GUID,ie.ROW_GUID),Ee.value=L(X),x.value=[],h.value=!0,l.nextTick(()=>{ne()})))},ue=k=>{k.opened&&(f.value=k.layoutItem,u.value=F.ER.Core.toString(window.getSelection()))},me=async k=>{const ie=F.ER.Core.buildEiInfo([{QUERY_TYPE:"TSI00MODULE",MODULE_TYPE:k}]),Ce=await t.erFormHelperProp.callService(F.ER.SysInfo.queryDevConfigService,ie);return Ce.getStatus()<0?(F.ER.Core.messageError(Ce.getMsg()),[]):Ce.getBlockByIndex(0).getMappedRows().map(we=>({CODE:we.MODULE_ENAME,CODE_DESC_1_CONTENT:we.MODULE_CNAME}))},Z=async(k,ie=!1)=>{let Ce={},we="";const Xe=await me("15");d=new F.ER.PopFreeHelper(t.erFormHelperProp.ServerPartition,k,"LayoutGroupMain",t.erFormHelperProp.InitialService),d.setSavePartition(t.erFormHelperProp.ServerPartition),d.EditType="Modify",d.OkButtonService=F.ER.SysInfo.saveDevConfigService,d.OkButtonCaption=F.ER.Core.$t("ERX.Save")||"Save",d.CancelButtonCaption=F.ER.Core.$t("ERX.Close")||"Close",d.CloseDialogWhenOkClick=ie,Ce=(()=>{let w={};switch(k){case"SI00FormEdit":w={QUERY_TYPE:"tsi00form",FORM_NAME:t.erFormHelperProp.FormName};break;case"SI00LayoutEdit":w={QUERY_TYPE:"tsi00gridview",FORM_NAME:t.erFormHelperProp.FormName,FUNCTION_ID:t.configId};break}return w})();const V=F.ER.Core.buildEiInfo(Ce),de=await t.erFormHelperProp.callService(F.ER.SysInfo.queryDevConfigService,V);if(de.getStatus()<0){F.ER.Core.messageError(de.getMsg());return}else if(de.getBlockByIndex(0).getMappedRows().length===0){F.ER.Core.messageError("Data not found!");return}else Ce=de.getBlockByIndex(0).getMappedRows()[0];d.ReceiveData(Ce),d.setEvent("initial",()=>{d.FormHelper.reloadDropDownDataSource("LayoutGroupMain","MODULE_NAME",Xe)}),d.setEvent("open",()=>{(we==null?void 0:we.trim().length)>0&&d.FormHelper.setControlReadOnly("LayoutGroupMain",!0,we)}),d.setEvent("close",w=>{w.isModified&&l.nextTick(()=>{ne()})}),d.setEvent("itemButtonClick",async w=>{if(w.itemCode==="DATASET_NAME")if(w.type==="clear")d.FormHelper.setControlEmptyValue("LayoutGroupMain","DATASET_NAME,TABLE_NAME");else{p.BordStyle="Fixed";const Oe=async()=>{const We=await t.erFormHelperProp.callService(F.ER.SysInfo.queryDevConfigService,F.ER.Core.buildEiInfo({OPERATE_TYPE:"tsi00datasettree"}));return We.getStatus()<0?(F.ER.Core.messageError(We.getMsg()),[]):We.getBlockByIndex(0).getMappedRows()};p.receiveData(Oe),p.BeforeOkButtonClick=We=>(We==null?void 0:We.NODE_TYPE)!=="DataTable"?!1:We,p.show(null,We=>{We!=null&&We.data&&(d.FormHelper.setControlValue("LayoutGroupMain","DATASET_NAME",We.data.DATASET_NAME),d.FormHelper.setControlValue("LayoutGroupMain","TABLE_NAME",We.data.DATATABLE_NAME))})}}),d.show(null)},Te=l.computed(()=>{const k=[];return t.erFormHelperProp.DevelopPermisson==="1"&&!s.value&&k.push({key:"devMode",label:"Open Developer Mode",icon:()=>l.h(it.UnlockOutlined)}),k}),ce=l.computed(()=>{var ie,Ce;const k=[];return u.value.length>0&&k.push({key:"copySelection",label:"Copy Selection",icon:()=>l.h(it.ScissorOutlined)}),P.value[f.value.FIELD_NAME]&&(k.push({key:"copyContentText",label:"Copy Text",icon:()=>l.h(it.CopyOutlined)}),["antMultiSelect","erMultiSelect","erSelect","erRadioGroup","erCheckboxGroup"].includes(f.value.WIDGET_TYPE)&&((Ce=(ie=f.value)==null?void 0:ie.Props)==null?void 0:Ce.displayFormat)!=="{0}"&&k.push({key:"copyContentValue",label:"Copy Value",icon:()=>l.h(it.FieldBinaryOutlined)})),k.push({key:"copyLabel",label:"Copy Label",icon:()=>l.h(it.TagOutlined)}),s.value&&(k.push({key:"separator1",label:"separator",type:"divider"}),k.push({key:"controlsPerRow",label:"Number Of Layout Columns",icon:()=>l.h(it.InsertRowBelowOutlined),children:ze()}),k.push({key:"ç",label:"Component Move Type",icon:()=>l.h(it.BuildOutlined),children:[{key:"componentMoveType-swap",label:"Swap Component Positions",icon:()=>l.h(it.SwapOutlined),disabled:C.value==="swap"},{key:"componentMoveType-insert",label:"Insert Before Component",icon:()=>l.h(it.RetweetOutlined),disabled:C.value==="insert"}]}),k.push({key:"bestFit",label:"Layout Best Fit",icon:()=>l.h(it.ColumnWidthOutlined),children:[{key:"bestFit-1",label:"True",disabled:M.value},{key:"bestFit-0",label:"False",disabled:!M.value}]}),k.push({key:"labelOnTop",label:"Labels Above Components",icon:()=>l.h(it.ToTopOutlined),children:[{key:"labelOnTop-1",label:"True",disabled:H.value},{key:"labelOnTop-0",label:"False",disabled:!H.value}]}),k.push({key:"formConfig",label:"Form Configuration",icon:()=>l.h(it.CreditCardOutlined)}),k.push({key:"layoutConfig",label:"Layout Configuration",icon:()=>l.h(it.GlobalOutlined),children:Me()}),k.push({key:"controlConfig",label:"Component Configuration",icon:()=>l.h(it.SettingOutlined),children:ge(f.value)}),h.value&&(k.push({key:"separator2",label:"separator",type:"divider"}),k.push({key:"cancelChanges",label:"Cancel Changes",icon:()=>l.h(it.ReloadOutlined)}),k.push({key:"saveLayout",label:"Save Changes",icon:()=>l.h(it.SaveOutlined)})),k.push({key:"separator3",label:"separator",type:"divider"}),k.push({key:"devMode",label:"Close Developer Mode",icon:()=>l.h(it.LockOutlined)})),k}),ze=()=>{const k=[];return["1","2","3","4","5","6","8","10","12","14","16","18","20"].forEach(ie=>{k.push({key:`controlsPerRow-${ie}`,label:ie,disabled:F.ER.Core.toNumber(ie)===ve})}),k},Me=()=>{const k=[];return k.push({key:"displayFormName",label:"Form->"+Ke.FORM_NAME}),k.push({key:"displayLayoutName",label:"Name->"+Ke.FUNCTION_ID}),k.push({key:"displayLayoutCaption",label:"Caption->"+Ke.FUNCNAME}),k.push({key:"displayAutoBind",label:`AutoBind->${t.autoBind?"True":"False"}`}),t.autoBind&&(k.push({key:"displayLayoutBindingDataSet",label:"DataSet->"+Ke.DATASET_NAME}),k.push({key:"displayLayoutBindingDataTabel",label:"Table->"+Ke.TABLE_NAME})),k.push({key:"layoutExtOptions",label:"Extended Options"}),k.push({key:"layoutConfig",label:"More..."}),k},ge=k=>{const ie=[];return ie.push({key:"displayItemCode",label:"Name->"+k.ITEM_CODE}),ie.push({key:"displayItemLabel",label:"Label->"+(k.COL_CAPTION||k.COL_CAPTION_DEFAULT)}),ie.push({key:"displayItemComponent",label:"Component->"+k.WIDGET_TYPE}),["erSelect","erMultiSelect","antRadioGroup","antMultiSelect","erRadioGroup","erCheckboxGroup"].includes(k.WIDGET_TYPE)&&ie.push({key:"displayItemDataSource",label:"DropdownSource->"+ke(k)}),ie.push({key:"separator21",label:"separator",type:"divider"}),ie.push({key:"controlGridSize",label:"Component's Column Span",children:Y(k)}),["antTextarea","antRadioGroup","antMultiSelect","erRadioGroup","erCheckboxGroup"].includes(k.WIDGET_TYPE)&&ie.push({key:"controlRowSize",label:"Component's Row Span",children:le(k)}),ie.push({key:"controlEmptySize",label:"Empty Space After Component",children:Fe(k)}),ie.push({key:"layoutItemExtOptions",label:"Extended Options"}),ie},le=k=>{const ie=[];return["1","2","3","4","5","6","7","8","10","11","12","13","14","15","16","17","18","19","20"].forEach(Ce=>{ie.push({key:`controlRowSize-${Ce}`,label:Ce,disabled:F.ER.Core.toNumber(Ce)===k.ROWHIGH})}),ie},Y=k=>{const ie=[];for(let Ce=1;Ce<=ve;Ce++)ie.push({key:`controlGridSize-${Ce}`,label:Ce,disabled:Ce===k.COL_WIDTH});return ie},Fe=k=>{const ie=[];for(let Ce=0;Ce<ve;Ce++)ie.push({key:`controlEmptySize-${Ce}`,label:Ce,disabled:Ce===k.EMPTY_ITEM_NUM});return ie},ke=k=>{const ie={1:"BasicCode",2:"DataSource",3:"SQL",4:"CodeSets",5:"SI-BasicCode",6:"EP-BasicCode",7:"PM-BasicCode"};return k.ORIGIN_CODE&&ie[k.ORIGIN_CODE]?`${ie[k.ORIGIN_CODE]}.${k.SVC_NAME}`:""},Ve=async()=>{const k=[];for(let ie=0;ie<X.length;ie++)k.push({ROW_GUID:X[ie].ROW_GUID,COMPANY_CODE:X[ie].COMPANY_CODE,FORM_NAME:X[ie].FORM_NAME,FUNCTION_ID:X[ie].FUNCTION_ID,DISPLAY_WIDTH:Ke.DISPLAY_WIDTH,BESTFIT:Ke.BESTFIT,SHOW_COLUMN_HEADER:Ke.SHOW_COLUMN_HEADER,ITEM_CODE:X[ie].ITEM_CODE,COL_CAPTION:X[ie].COL_CAPTION,COL_WIDTH:X[ie].COL_WIDTH,ROWHIGH:X[ie].ROWHIGH,EMPTY_ITEM_NUM:X[ie].EMPTY_ITEM_NUM});if(k.length>0){const ie=F.ER.Core.buildEiInfo(k,"TSI00GRIDCOLUMN_UPDATE_SEQ");if(!await F.ER.Core.messageConfirm(t.erFormHelperProp.$t("ERX.ErLayout.SaveLayoutConfirmMessage")||"Confirm Save Layout?"))return;setTimeout(async()=>{const Ce=await t.erFormHelperProp.callService(F.ER.SysInfo.saveDevConfigService,ie,{show:!0});Ce.getStatus()>=0?(F.ER.Core.messageInfo(t.erFormHelperProp.$t("ERX.ErLayout.SaveLayoutSuccessMessage")||"Save Layout Successfully!"),h.value=!1,o("configUpdate")):F.ER.Core.messageError(Ce.getMsg())},250)}},at=k=>{k.key==="devMode"&&setTimeout(()=>{s.value=!s.value},250)},pt=(k,ie)=>{var Ce,we,Xe,ft,V,de,w,Oe,We,Be;if(ie.key==="copySelection")F.ER.Core.copyText(u.value);else if(ie.key==="copyLabel")F.ER.Core.copyText(k.COL_CAPTION||k.COL_CAPTION_DEFAULT);else if(ie.key==="copyContentText")F.ER.Core.copyText(t.erFormHelperProp.getControlText(t.configId,k.ITEM_CODE));else if(ie.key==="copyContentValue")F.ER.Core.copyText(t.erFormHelperProp.getControlValue(t.configId,k.ITEM_CODE));else if(ie.key!=="paste")if(ie.key==="devMode")setTimeout(()=>{s.value=!s.value},250);else if(ie.key==="formConfig")t.erFormHelperProp.showFormOptionsEdit(t.erFormHelperProp.FormName);else if(ie.key==="layoutConfig")Z("SI00LayoutEdit",!1);else if(ie.key==="layoutExtOptions")t.erFormHelperProp.showExtOptionsEdit("tsi00gridviewext",Ke.FORM_NAME,Ke.FUNCTION_ID,k.ITEM_CODE,"","",!1);else if((Ce=ie.key)!=null&&Ce.startsWith("controlsPerRow"))ve=F.ER.Core.toNumber(ie.key.replace("controlsPerRow-",""))||4,Ke.DISPLAY_WIDTH=ve,Ee.value=L(X),h.value=!0;else if((we=ie.key)!=null&&we.startsWith("display")){const ye=(ft=(Xe=ie==null?void 0:ie.item)==null?void 0:Xe.originItemValue)==null?void 0:ft.label;if((ye==null?void 0:ye.length)>0){const je=ye.split("->");F.ER.Core.copyText(je.length>1?je[1]:je[0])}}else if((V=ie.key)!=null&&V.startsWith("componentMoveType"))C.value=ie.key.replace("componentMoveType-","");else if((de=ie.key)!=null&&de.startsWith("bestFit"))Ke.BESTFIT=ie.key.replace("bestFit-",""),M.value=ie.key.replace("bestFit-","")==="1",h.value=!0;else if((w=ie.key)!=null&&w.startsWith("labelOnTop"))Ke.SHOW_COLUMN_HEADER=ie.key.replace("labelOnTop-",""),H.value=ie.key.replace("labelOnTop-","")==="1",h.value=!0;else if((Oe=ie.key)!=null&&Oe.startsWith("controlGridSize")){for(let ye=0;ye<X.length;ye++)if(X[ye].ITEM_CODE===k.ITEM_CODE){X[ye].COL_WIDTH=F.ER.Core.toNumber(ie.key.replace("controlGridSize-",""));break}Ee.value=L(X),h.value=!0}else if((We=ie.key)!=null&&We.startsWith("controlEmptySize")){for(let ye=0;ye<X.length;ye++)if(X[ye].ITEM_CODE===k.ITEM_CODE){X[ye].EMPTY_ITEM_NUM=F.ER.Core.toNumber(ie.key.replace("controlEmptySize-",""));break}Ee.value=L(X),h.value=!0}else if(ie.key==="layoutItemExtOptions")t.erFormHelperProp.showExtOptionsEdit("tsi00gridcolumnext",k.FORM_NAME,k.FUNCTION_ID,k.ROW_GUID+","+k.ITEM_CODE,"",k.COMPANY_CODE,!1);else if((Be=ie.key)!=null&&Be.startsWith("controlRowSize")){for(let ye=0;ye<X.length;ye++)if(X[ye].ITEM_CODE===k.ITEM_CODE){X[ye].ROWHIGH=F.ER.Core.toNumber(ie.key.replace("controlRowSize-",""));break}Ee.value=L(X),h.value=!0}else ie.key==="cancelChanges"?(ae(),l.nextTick(()=>{ne()}),h.value=!1):ie.key==="saveLayout"&&Ve()},ht=k=>{},Ct=k=>{},_t=(k,ie)=>{var Ce,we;if(k&&ie){const Xe=ee(k),ft=((we=(Ce=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ce[k])==null?void 0:we.displayFormat)||"{1}";if((Xe==null?void 0:Xe.length)>0){if(ie instanceof Array&&ie.length>0)return ie.map(V=>{const de=Xe.find(w=>w.value===V);return de?ft.replaceAll("{0}",de.value).replaceAll("{1}",de.label):V}).join(",");{const V=Xe.find(de=>de.value===ie);return V?ft.replaceAll("{0}",V.value).replaceAll("{1}",V.label):ie}}}return""},Qe=k=>{let ie="layout-item-label";return k.ITEM_MUST_FLAG==="1"&&k.MUST_INPUT_CONDITION.trim().length>0?ie+=" layout-item-require-condition":k.ITEM_MUST_FLAG==="1"&&(ie+=" layout-item-require"),ie},U=(k,ie)=>{const Ce=t.erFormHelperProp.getLayoutItemOption(t.configId,k,ie);return ie==="hasFeedback"?Ce!==void 0?Ce:n:ie==="placeholder"&&F.ER.Core.toString(Ce).trim().length===0?void 0:Ce},gt=()=>{var ie;const k=t.erFormHelperProp.getLayoutCaption(t.configId);if((k==null?void 0:k.trim().length)>0)return k;if(((ie=t.configCaption)==null?void 0:ie.length)>0)return t.configCaption;{const Ce=t.erFormHelperProp.getSingleViewConfigInfo(t.configId);return Ce==null?void 0:Ce.FUNCNAME}},rt=l.computed(()=>{var Ce,we,Xe,ft;const k=F.ER.Core.toNumber((Ce=z.value)==null?void 0:Ce.height);let ie="repeat(auto-fill , minmax(28px))";return H.value?(we=z.value)!=null&&we.fixedGridGap?ie="repeat(auto-fill , minmax(50px, 50px))":ie="repeat(auto-fill , minmax(50px))":(Xe=z.value)!=null&&Xe.fixedGridGap?ie="repeat(auto-fill , minmax(28px, 28px))":ie="repeat(auto-fill , minmax(28px))",{display:"grid",direction:(ft=t.erFormHelperProp)!=null&&ft.IsRtl?"rtl":"ltr",position:"relative",gridTemplateColumns:`repeat(${ve}, minmax(${r}, 1fr))`,gridTemplateRows:ie,overflowY:"auto",height:k>0?`${k}px`:fe.value>0&&!S.value?`${fe.value*33+5}px`:"auto",justifyContent:"normal",gridAutoColumns:"1fr",gridGap:`${xe}px ${xe}px`,border:s.value?"1px dotted red":void 0,padding:`${Le}px`}}),ct=k=>{k&&x.value.push(k)};let Ze;const Ye=k=>{clearTimeout(Ze),(k==null?void 0:k.detail)!==2&&(Ze=setTimeout(()=>{o("itemClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},300))},st=k=>{clearTimeout(Ze),o("itemDbclick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},mt=k=>{var ie,Ce,we;if(k.formId=(ie=t.erFormHelperProp)==null?void 0:ie.FormId,k.configId=t.configId,k.erFormHelper=t.erFormHelperProp,k.data=P.value,o("toolbarClick",k),(Ce=k.sender)!=null&&Ce.name)switch((we=k.sender)==null?void 0:we.name){case"ToolbarFirst":o("toolbarFirstClick",k);break;case"ToolbarPre":o("toolbarPreClick",k);break;case"ToolbarNext":o("toolbarNextClick",k);break;case"ToolbarLast":o("toolbarLastClick",k);break;case"ToolbarPrint":o("toolbarPrintClick",k);break;case"ToolbarRefresh":o("toolbarRefreshClick",k);break;case"ToolbarAdd":o("toolbarAddClick",k);break;case"ToolbarAddCopy":o("toolbarAddCopyClick",k);break;case"ToolbarDelete":o("toolbarDeleteClick",k);break;case"ToolbarSave":o("toolbarSaveClick",k);break}},At=k=>{o("QueryClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},Rt=k=>{t.erFormHelperProp.setAllControlDefalutValue(t.configId,!1),o("resetClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},Qt=k=>{o("authButtonClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},St=async k=>{var Ce,we,Xe,ft,V,de,w,Oe,We,Be,ye,je,ot,He,nt;let ie=!1;if(k.preventDefault=()=>{ie=!0},k.type==="select"&&((we=(Ce=k.itemConfig)==null?void 0:Ce.AUTOFILL_COLS)==null?void 0:we.trim().length)>0&&((ft=(Xe=k.itemConfig)==null?void 0:Xe.POP_FORM)!=null&&ft.trim().startsWith("MenuForm:")||(de=(V=k.itemConfig)==null?void 0:V.POP_FORM)!=null&&de.trim().startsWith("PopFormINQ:"))){const dt=(w=k.itemConfig)==null?void 0:w.AUTOFILL_COLS;Ie[k.itemCode]=!0;let Et="",yt=!0;(We=(Oe=k.itemConfig)==null?void 0:Oe.POP_FORM)!=null&&We.trim().startsWith("MenuForm:")?Et=(ye=(Be=k.itemConfig)==null?void 0:Be.POP_FORM)==null?void 0:ye.trim().substring(9):(ot=(je=k.itemConfig)==null?void 0:je.POP_FORM)!=null&&ot.trim().startsWith("PopFormINQ:")&&(Et=(nt=(He=k.itemConfig)==null?void 0:He.POP_FORM)==null?void 0:nt.trim().substring(11),yt=!1);const bt=kt=>{dt.length>0&&dt.split(";").forEach(g=>{if(g.trim().length>0){const qt=g.trim().split("="),Wt=qt[0].toUpperCase().trim();let Ca=qt[0].toUpperCase().trim();qt.length>1&&(Ca=qt[1].toUpperCase().trim()),k.data.set(Ca,kt[Wt])}})};if(!yt){const kt=new F.ER.PopQueryHelper(t.erFormHelperProp.ServerPartition,Et,"",t.erFormHelperProp.InitialService);kt.SelectMode="single",await kt.show(null,Lt=>{Lt.checkedItem&&bt(Lt.checkedItem)}),Ie[k.itemCode]=!1}}else k.itemCode==="erQueryButton"?At(k):o("itemButtonClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId,loading:dt=>{Ie[k.itemCode]=dt}});!ie&&k.type==="clear"&&k.data&&k.field&&k.data.set(k.field,"")},nr=k=>{var Ce;S.value=!S.value,k.displayAll=S.value;const ie=F.ER.Core.jQuery("#"+((Ce=t.erFormHelperProp)==null?void 0:Ce.FormId)+t.configId+"show-more span");ie&&ie.text(k.displayAll?"隐藏更多":"显示更多"),o("DisplayAllClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId})},Tt=k=>{o("groupButtonClick",{...k,erFormHelper:t.erFormHelperProp,data:P.value,configId:t.configId,expanded:k})},tr=k=>{var Ce,we;const ie={item_code:k.ITEM_CODE};if(k.WIDGET_TYPE==="antInputNumber")ie.spinners=!1,ie.step=0,ie.format="",ie.decimals=void 0,ie.restrictDecimals=!0,k.DATA_ACCU>0&&k.DATA_ACCU<=k.MAX_LENGTH&&(ie.decimals=k.DATA_ACCU),ie.max=F.ER.Core.getMaxNumber(k.MAX_LENGTH,k.DATA_ACCU),ie.min=-1*F.ER.Core.getMaxNumber(k.MAX_LENGTH,k.DATA_ACCU),k.MAX_VAL!==-1&&k.MAX_VAL<ie.max&&(ie.max=k.MAX_VAL),k.MIN_VAL!==-1&&k.MIN_VAL>ie.min&&(ie.min=k.MIN_VAL),k.FORMAT_TYPE==="Numeric"&&k.FORMAT_STRING.trim().length>0&&(ie.format=k.FORMAT_STRING.trim().replace("{0}","0")),ie.formatter=(Xe,ft)=>{if(!ft.userTyping)return F.ER.Core.formatNumberValue(Xe,ie.format)},ie.parser=Xe=>F.ER.Core.formatNumberValue(Xe,k.FORMAT_STRING.trim(),"toNumber"),ie.placeholder=F.ER.Core.toString(ie.format);else if(["antInputGroup","antInput","antTextarea","erMemoEditor"].includes(k.WIDGET_TYPE))k.FORMAT_STRING.trim().length>0&&(k.FORMAT_TYPE==="Custom"||k.FORMAT_TYPE==="RegEx")&&F.ER.Core.isValidRegex(k.FORMAT_STRING.trim())&&(ie.rules={pattern:new RegExp(k.FORMAT_STRING.trim()),message:k.FORMAT_STRING.trim()}),k.MAX_LENGTH>0&&(ie.maxlength=k.MAX_LENGTH);else if(k.WIDGET_TYPE==="antDateTimePicker"){if(k.FORMAT_STRING.trim().length>0){const Xe=k.FORMAT_STRING.trim().replaceAll("yy","YY").replaceAll("dd","DD");ie.format=[Xe,Xe.replaceAll("-","")]}else ie.format=["YYYY-MM-DD HH:mm:ss","YYYYMMDDHHmmss"];k.FORMAT_STRING.trim().includes("HH:mm:ss")?ie.showTime={format:"HH:mm:ss"}:k.FORMAT_STRING.trim().includes("HH:mm")?ie.showTime={format:"HH:mm"}:k.FORMAT_STRING.trim().includes("HH")?ie.showTime={format:"HH"}:ie.showTime=void 0}else if(k.WIDGET_TYPE==="antDatePicker")if(k.FORMAT_STRING.trim().length>0){const Xe=k.FORMAT_STRING.trim().replaceAll("yy","YY").replaceAll("dd","DD");ie.format=[Xe,Xe.replaceAll("-","")]}else ie.format=["YYYY-MM-DD","YYYYMMDD"];else k.WIDGET_TYPE==="antTimePicker"?k.FORMAT_STRING.trim()==="HH:mm"||k.FORMAT_STRING.trim()==="HH"?ie.format=k.FORMAT_STRING.trim():ie.format="HH:mm:ss":(k.WIDGET_TYPE==="antMultiSelect"||k.WIDGET_TYPE==="erMultiSelect"||k.WIDGET_TYPE==="erCheckboxGroup")&&K.push(k.FIELD_NAME);return["antMultiSelect","erMultiSelect","antTextarea","antRadioGroup","scriptEditor","erCheckboxGroup","erRadioGroup"].includes(k.WIDGET_TYPE)?ie.rows=k.ROWHIGH||1:["erMemoEditor"].includes(k.WIDGET_TYPE)?ie.rows=k.ROWHIGH<=1?8:k.ROWHIGH:(ie.rows=1,k.ROWHIGH=1),k.WIDGET_TYPE==="erSelect"&&(ie.displayFormat=(we=(Ce=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ce[k.ITEM_CODE])==null?void 0:we.displayFormat),he.push({itemCode:k.ITEM_CODE,widgetType:k.WIDGET_TYPE,field:k.FIELD_NAME}),ie},L=k=>{var Xe,ft,V,de,w,Oe,We,Be,ye,je,ot,He,nt,dt,Et,yt,bt,kt,Lt,g,qt,Wt,Ca,Ga,za,$a;const ie=[],Ce=["addonAfter","addonBefore","controls","prefix","step","size","upIcon","keyboard","allowClear","suffix","showCount","bordered","clearIcon","clearText","dateInputReadOnly","inputReadOnly","disabledDate","disabledTime","validator","hasFeedback"],we={};if(z.value&&Object.keys(z.value).forEach(vt=>{Ce.includes(vt)&&(we[vt]=z.value[vt])}),k&&k.length>0){if(Ge==="F"&&(t.showQueryButton??((Xe=z.value)==null?void 0:Xe.showQueryButton))==="inside"&&k[k.length-1].ITEM_CODE!=="erQueryButton"){const Dt={...k[0],COLUMN_EDIT:"N",COL_WIDTH:ve,ITEM_CODE:"erQueryButton",COL_CAPTION:F.ER.Core.$t("ERX.ErLayout.Query")||"查询",WIDGET_TYPE:"button"};k.push(Dt)}const vt=[];let Yt=0;const xt=Ge!=="F"?t.erFormHelperProp.getBindingTable(t.configId):void 0;for(let Dt=0;Dt<100&&Yt!==k.length;Dt++){let rr=1,ar=0;for(let Zt=0;Zt<ve;Zt++)if(!(vt.indexOf(Dt.toString()+","+Zt.toString())>=0)){if(k[Yt]){const Kt=k[Yt],Re={...k[Yt]};((ft=Re.EXT_OPTIONS)==null?void 0:ft.trim().length)>0&&(Re.extendOptions=JSON.parse(Re.EXT_OPTIONS)),Re.MUST_INPUT_CONDITION=((V=Re.extendOptions)==null?void 0:V.requireCondition)||((de=Re.MUST_INPUT_CONDITION)==null?void 0:de.trim()),Yt++,(!t.autoBind||F.ER.Core.toString(Re.FIELD_NAME,!0).length===0)&&(Re.FIELD_NAME=Re.ITEM_CODE);let zr=Ge+Re.COLUMN_EDIT;if(xt){const lt=(Oe=(w=xt.options)==null?void 0:w.schema)==null?void 0:Oe[Re.FIELD_NAME];(lt==null?void 0:lt.type)==="boolean"?zr="F4":Re.COLUMN_EDIT==="0"?(lt==null?void 0:lt.type)==="datetime"?zr="F5":(lt==null?void 0:lt.type)==="number"?zr="F2":zr="F0":zr="G"+Re.COLUMN_EDIT}Re.WIDGET_TYPE=(We=t.erFormHelperProp)==null?void 0:We.getControlName(zr,Re.FORMAT_STRING.trim(),Re);let Zr=((Be=Re.COL_CAPTION)==null?void 0:Be.trim())||((ye=Re.COL_CAPTION_DEFAULT)==null?void 0:ye.trim());(je=z.value)!=null&&je.bilingual&&((ot=Re.COL_CAPTION_DEFAULT)!=null&&ot.trim())&&((He=Re.COL_CAPTION)!=null&&He.trim())&&((nt=Re.COL_CAPTION_DEFAULT)==null?void 0:nt.trim())!==((dt=Re.COL_CAPTION)==null?void 0:dt.trim())&&(Zr=((Et=Re.COL_CAPTION_DEFAULT)==null?void 0:Et.trim())+"<br>"+((yt=Re.COL_CAPTION)==null?void 0:yt.trim())),Zr.split(/<br\s*\/?>/gi).forEach(lt=>{if(Re.HEAD_TEXTVISIBLE!=="0"&&Re.WIDGET_TYPE!=="label"){let Ot=F.ER.Core.getTextWidth(`${(Re.ITEM_MUST_FLAG==="1"?"*":"")+lt}`,b.value==="large"?"17px Arial":b.value==="middle"?"15px Arial":"13px Arial")+12;Re.TOOL_TIP.trim().length>0&&(Ot=Ot+20),_e<Ot&&(_e=Ot)}}),$e=$e||/<br\s*\/?>/i.test(Zr),F.ER.Core.toNumber((kt=(bt=z.value)==null?void 0:bt[Re.ITEM_CODE])==null?void 0:kt.labelWidth)>0&&(Re.labelWidth=F.ER.Core.toNumber(z.value[Re.ITEM_CODE].labelWidth));let Pr=1,da=1;if(Number(Re.ROWHIGH)>1&&["3","8","B","D","E","M"].includes(Re.COLUMN_EDIT)?da=Number(Re.ROWHIGH)||1:Re.ROWHIGH=1,rr<da&&(rr=da),Ge==="F"&&+(Re.COL_WIDTH>1)?Pr=Number(Re.COL_WIDTH):Re.COL_WIDTH=1,Zt+Pr>ve&&(Pr=ve-Zt),Pr>1){const lt=Pr-1;Pr=1;for(let Ot=0;Ot<lt;Ot++){const Vt=Dt.toString()+","+(Zt+Ot).toString();if(vt.indexOf(Vt)>=0)break;vt.push(Vt),Pr++}}for(let lt=0;lt<Pr;lt++)for(let Ot=0;Ot<da;Ot++){const Vt=(Dt+Ot).toString()+","+(Zt+lt).toString();vt.indexOf(Vt)>=0||vt.push(Vt)}Re.ROW_START=Dt+1,Re.ROW_END=Dt+1+da,Re.COL_START=Zt+1,Re.COL_END=Zt+1+Pr,Re.Props=tr(Re),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,Re.Props),z.value[Re.ITEM_CODE]={...(Lt=z.value)==null?void 0:Lt[Re.ITEM_CODE],...Re.extendOptions};const wt={...we,...(g=z.value)==null?void 0:g[Re.ITEM_CODE]};t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,wt),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{field:Re.FIELD_NAME}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{controlType:Re.WIDGET_TYPE}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{visible:Re.IS_VISIBLE}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{placeholder:Re.TOOL_TIP}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{labelText:Zr}),t.autoBind?(t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{readOnly:!0}),Re.COLUMN_EDIT==="1"&&t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{buttonEnable:!1})):(t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{readOnly:Re.READ_ONLY==="1"}),Re.COLUMN_EDIT==="1"&&t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{buttonEnable:Re.ALLOW_EDIT==="1"})),Kt.Props=Re.Props,t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{rows:(qt=Kt.Props)==null?void 0:qt.rows});const ea=F.ER.Core.toHexColor(Re.HEAD_TEXTCOLOR),qe=F.ER.Core.toHexColor(Re.HEAD_BACKCOLOR),cr=F.ER.Core.toHexColor(Re.CELL_TEXTCOLOR),pr=F.ER.Core.toHexColor(Re.CELL_BACKCOLOR);if(((Wt=Kt.UNBOUND_EXPRESSION)==null?void 0:Wt.trim().length)===0)Re.LabelForeColor=ea,Re.LabelBackColor=qe,Re.TextForeColor=cr,Re.TextBackColor=pr,t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{TextForeColor:Re.TextForeColor}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{TextBackColor:Re.TextBackColor}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{LabelForeColor:Re.LabelForeColor}),t.erFormHelperProp.setLayoutItemOption(t.configId,Re.ITEM_CODE,{LabelBackColor:Re.LabelBackColor});else{const lt={};F.ER.Core.colorIsTransparentOrEmpty(ea)||(lt.labelForeColor=ea),F.ER.Core.colorIsTransparentOrEmpty(qe)||(lt.labelBackgroundColor=qe),F.ER.Core.colorIsTransparentOrEmpty(cr)||(lt.textForeColor=cr),F.ER.Core.colorIsTransparentOrEmpty(pr)||(lt.textBackgroundColor=pr),Object.keys(lt).length>0&&(lt.condition=(Ca=Kt.UNBOUND_EXPRESSION)==null?void 0:Ca.trim(),t.erFormHelperProp.setLayoutConditionStyleConfigInfo(t.configId,Re.ITEM_CODE,lt))}["erSelect","erMultiSelect","antSelect","antMultiSelect","antInput"].includes(Re.WIDGET_TYPE)&&(((Ga=Re.TextBackColor)==null?void 0:Ga.trim().length)>0||((za=Re.TextForeColor)==null?void 0:za.trim().length)>0)&&O.push({itemCode:Re.ITEM_CODE,color:Re.TextForeColor,backgroundColor:Re.TextBackColor}),["antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker","antInput","antInputNumber"].includes(Re.WIDGET_TYPE)&&(($a=Re.TextForeColor)==null?void 0:$a.trim().length)>0&&D.push({itemCode:Re.ITEM_CODE,color:Re.TextForeColor,backgroundColor:Re.WIDGET_TYPE==="antInputNumber"&&U(Re.ITEM_CODE,"hasFeedback")!==!0?Re.TextBackColor:void 0});const or=[];Re.ITEM_MUST_FLAG==="1"&&or.push({message:"",trigger:"change",customType:"required",widgetType:Re.WIDGET_TYPE,validator:async(lt,Ot)=>{const Vt=Re.MUST_INPUT_CONDITION.trim();if(Ot=lt.widgetType==="antInputNumber"?F.ER.Core.toNumber(Ot):Ot,F.ER.Core.isNullOrEmpty(Ot))if(Vt.length>0&&P.value.uid){let lr;return Re.CONDITION_TABLE.trim().length>0&&Re.CONDITION_TABLE.trim().toUpperCase()!==I?await l.nextTick(()=>{var Ar,Xt,$s;lr=((Xt=(Ar=t.erFormHelperProp.FormDataSet)==null?void 0:Ar.getCurrentDataObject(Re.CONDITION_TABLE.trim()))==null?void 0:Xt.toJSON())||(($s=t.erFormHelperProp.getLayoutBindModel(Re.CONDITION_TABLE.trim()))==null?void 0:$s.toJSON())}):lr=P.value.toJSON(),F.ER.Core.checkExpressionValid(lr,Vt)?(t.erFormHelperProp.setLayoutItemOption(t.configId,Re.FIELD_NAME,{validatorMsg:"["+U(Re.ITEM_CODE,"labelText")+"]为条件必填项"}),Promise.reject(new Error("required with condition"))):Promise.resolve()}else return t.erFormHelperProp.setLayoutItemOption(t.configId,Re.FIELD_NAME,{validatorMsg:"["+U(Re.ITEM_CODE,"labelText")+"]为必填项"}),Promise.reject(new Error("required"));return t.erFormHelperProp.setLayoutItemOption(t.configId,Re.FIELD_NAME,{validatorMsg:void 0}),Promise.resolve()}}),wt!=null&&wt.validator&&(wt==null?void 0:wt.validator)instanceof Function?or.push({message:"",trigger:"change",itemCode:Re.FIELD_NAME,formatter:U(Re.FIELD_NAME,"formatter"),parser:U(Re.FIELD_NAME,"parser"),validator:(lt,Ot)=>wt.validator(lt,Ot)?(t.erFormHelperProp.setLayoutItemOption(t.configId,lt.itemCode,{validatorMsg:void 0,formatter:lt.formatterr,parser:lt.parser}),Promise.resolve()):(t.erFormHelperProp.setLayoutItemOption(t.configId,lt.itemCode,{formatter:void 0}),Promise.reject(new Error("Invalid value")))}):Re.WIDGET_TYPE==="antInputNumber"?(Re.decimals=-1,Re.DATA_ACCU>=0&&Re.DATA_ACCU<=Re.MAX_LENGTH&&(Re.decimals=Re.DATA_ACCU),Re.max=F.ER.Core.getMaxNumber(Re.MAX_LENGTH,Re.DATA_ACCU),Re.min=-1*F.ER.Core.getMaxNumber(Re.MAX_LENGTH,Re.DATA_ACCU),Re.MAX_VAL!==-1&&Re.MAX_VAL<Re.max&&(Re.max=Re.MAX_VAL),Re.MIN_VAL!==-1&&Re.MIN_VAL>Re.min&&(Re.min=Re.MIN_VAL),or.push({message:"",trigger:"change",customType:"custom",max:Re.max,min:Re.min,itemCode:Re.FIELD_NAME,decimals:Re.decimals,formatter:U(Re.FIELD_NAME,"formatter"),parser:U(Re.FIELD_NAME,"parser"),validator:(lt,Ot)=>{if(Ot>lt.max||Ot<lt.min)return lt.message=F.ER.Core.$t("ERX.InputValueOutOfRange")+`[${lt.min} ~ ${lt.max}]`,Promise.reject(new Error("Invalid value"));if(lt.decimals>=0&&F.ER.Core.toString(Ot).length>0){let Vt=0;const lr=F.ER.Core.toString(Ot).split(".");if(lr.length>1&&(Vt=lr[1].length),Vt>lt.decimals)return lt.message=F.ER.Core.$t("ERX.InputValueOutOfPrecision")+`[${lt.decimals}]`,Promise.reject(new Error("Invalid value"))}return lt.message="",Promise.resolve()}})):["antInputGroup","antInput","antTextarea","erMemoEditor"].includes(Re.WIDGET_TYPE)&&(Re.FORMAT_STRING.trim().length>0&&(Re.FORMAT_TYPE==="Custom"||Re.FORMAT_TYPE==="RegEx")||Re.MAX_LENGTH>0)&&or.push({message:"",trigger:"change",pattern:Re.FORMAT_TYPE==="Custom"||Re.FORMAT_TYPE==="RegEx"?Re.FORMAT_STRING:"",maxLength:Re.MAX_LENGTH,itemCode:Re.FIELD_NAME,validator:(lt,Ot)=>{var lr;const Vt=F.ER.Core.toString(Ot).trim();if(Vt.length>0){if(lt.maxLength>0&&lt.maxLength<q(Vt))return lt.message=F.ER.Core.$t("ERX.InputValueOutOfLength")+`[${lt.maxLength}]`,Promise.reject(new Error("Invalid value"));if(((lr=lt.pattern)==null?void 0:lr.length)>0&&F.ER.Core.isValidRegex(lt.pattern)&&!new RegExp(lt.pattern).test(Vt))return lt.message=F.ER.Core.$t("ERX.InputValueNotMatchRegex")+`[${lt.pattern}]`,Promise.reject(new Error("Invalid value"))}return lt.message="",Promise.resolve()}}),or.length>0&&(R[Re.FIELD_NAME]=or),ie.push(Re);let Jt=Re.EMPTY_ITEM_NUM;if((Jt<0||Ge!=="F")&&(Jt=0),ar=ar+Pr,ar>=ve)break;if(Jt>0&&(Jt+ar>ve&&(Jt=ve-ar),Jt>0)){const lt={...Re};lt.FIELD_NAME="EMPTY"+Dt.toString(),lt.COL_CAPTION="",lt.WIDGET_TYPE="NA",lt.COLUMN_EDIT="NA",lt.ITEM_MUST_FLAG="0",lt.ROW_START=Dt+1,lt.ROW_END=Dt+1+da,lt.COL_START=Zt+1+1,lt.COL_END=Zt+1+1+Jt,lt.LabelForeColor="",lt.LabelBackColor="",lt.TextForeColor="",lt.TextBackColor="",ie.push(lt);for(let Ot=0;Ot<Jt;Ot++){const Vt=Dt.toString()+","+(Zt+1+Ot).toString();vt.indexOf(Vt)>=0||vt.push(Vt)}if(ar=ar+Jt,ar>=ve)break}}else{const Kt={};Kt.ITEM_CODE="EMPTY"+Dt.toString(),Kt.COL_CAPTION="",Kt.WIDGET_TYPE="NA",Kt.COLUMN_EDIT="NA",Kt.ITEM_MUST_FLAG="0",Kt.ROW_START=Dt+1,Kt.ROW_END=Dt+1+1,Kt.COL_START=Zt+1,Kt.COL_END=Zt+1+1,Kt.LabelForeColor="",Kt.LabelBackColor="",Kt.TextForeColor="",Kt.TextBackColor="",ie.push(Kt),ar=ar+1}if(ar>=ve)break}pe=pe<0?rr:pe+rr}}return ie},ae=()=>{var k,ie,Ce,we,Xe,ft,V,de,w,Oe,We,Be,ye,je,ot,He;if(t.erFormHelperProp){const nt=t.erFormHelperProp.getConfigInfo(t.configId.trim());if(((k=nt==null?void 0:nt.TSI00GRIDVIEW)==null?void 0:k.length)>0){Ke={...nt.TSI00GRIDVIEW[0]},Ge=((ie=Ke.FUNCTION_TYPE)==null?void 0:ie.trim())||"F";let dt={},Et={};const yt=t.erFormHelperProp.getFormSysInfo("LayoutDefaultOptions");(yt==null?void 0:yt.trim().length)>0&&(dt=JSON.parse(yt)),((Ce=Ke.EXT_OPTIONS)==null?void 0:Ce.trim().length)>0&&(Et=JSON.parse(Ke.EXT_OPTIONS));const bt=Et.buttonRegionId||((we=Et.blockName)==null?void 0:we.trim())||t.configId;Ne.value=t.erFormHelperProp.FormAuthButtons[bt]||[],z.value={...dt,...Et,...z.value},z.value.componentSize?b.value=z.value.componentSize==="large"?"large":z.value.componentSize==="middle"?"middle":"small":F.ER.Core.toNumber(Ke.FONTSIZE)>=16?b.value="large":F.ER.Core.toNumber(Ke.FONTSIZE)>=14?b.value="middle":b.value="small",n=z.value.hasFeedback!=="false",I.value=Ke.TABLE_NAME,t.configCaption===void 0||t.configCaption.length===0?oe.value=Ke.FUNCNAME:oe.value=t.configCaption,fe.value=Ke.ROWHIGH||-1,M.value=Ge==="F"&&Ke.BESTFIT==="1",F.ER.Core.toNumber(Ke.FORM_WIDTH)>0&&(r=Ke.FORM_WIDTH+"px"),Ge!=="F"?(ve=F.ER.Core.toNumber(Ke.EDIT_COLS_COUNT),ve=ve>0?ve:3):(ve=F.ER.Core.toNumber(Ke.DISPLAY_WIDTH),ve=ve>0?ve:4),xe=F.ER.Core.toNumber((Xe=z.value)==null?void 0:Xe.gridGap),xe=xe>0?xe:F.ER.Core.toNumber(t.erFormHelperProp.getFormSysInfo("LAYOUTPADDING")),xe=xe>0?xe:5;const kt=Ge!=="F"?t.erFormHelperProp.getBindingTable(t.configId):void 0;kt?X=(V=(ft=nt.TSI00GRIDCOLUMN)==null?void 0:ft.filter(Lt=>{var g,qt;return Lt.IS_VISIBLE==="1"&&Lt.FIELD_NAME&&((qt=(g=kt.options)==null?void 0:g.schema)==null?void 0:qt[Lt.FIELD_NAME])}))==null?void 0:V.map(Lt=>({...Lt})):X=(w=(de=nt.TSI00GRIDCOLUMN)==null?void 0:de.filter(Lt=>Lt.IS_VISIBLE==="1"))==null?void 0:w.map(Lt=>({...Lt})),Ee.value=L(X),t.erFormHelperProp.setLayoutConfigRelationInfo(t.configId.trim(),t.layoutName.trim()),F.ER.Core.toNumber((Oe=z.value)==null?void 0:Oe.labelWidth)>0?G.value=F.ER.Core.toNumber((We=z.value)==null?void 0:We.labelWidth):F.ER.Core.toNumber((Be=z.value)==null?void 0:Be.maxLabelWidth)>0&&F.ER.Core.toNumber((ye=z.value)==null?void 0:ye.maxLabelWidth)<_e?G.value=F.ER.Core.toNumber((je=z.value)==null?void 0:je.maxLabelWidth):G.value=_e,te.value=$e?!0:((ot=z.value)==null?void 0:ot.labelWrap)??F.ER.Core.toNumber((He=z.value)==null?void 0:He.maxLabelWidth)<_e,t.displayRows>0&&t.displayRows<pe?fe.value=t.displayRows:fe.value=-1,Ge==="F"&&(H.value=t.labelAlignTop===!0?!0:nt.TSI00GRIDVIEW[0].SHOW_COLUMN_HEADER==="1"),t.autoBind&&t.erFormHelperProp.setBindingTableName(t.configId.trim())}}};ae();const q=k=>{let ie=0;for(let Ce=0;Ce<k.length;Ce++){const we=k.codePointAt(Ce)||0;we>=128512&&we<=128591?ie+=4:we>=19968&&we<=40959||we>=65280&&we<=65519||we>=12288&&we<=12351||we>=8192&&we<=8303||we>=9632&&we<=9727||we>=11904&&we<=12031||we>=12544&&we<=12591?ie+=2:ie+=1}return ie},ee=k=>{var ie,Ce;return(Ce=(ie=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:ie[k])==null?void 0:Ce.dataSource},ne=async()=>{O.forEach(k=>{var ie,Ce,we,Xe;((ie=k.color)==null?void 0:ie.trim().length)>0&&((Ce=t.erFormHelperProp)==null||Ce.setLayoutItemContentForeColor(t.configId,k.itemCode,k.color)),((we=k.backgroundColor)==null?void 0:we.trim().length)>0&&((Xe=t.erFormHelperProp)==null||Xe.setLayoutItemContentBackColor(t.configId,k.itemCode,k.backgroundColor))}),D.forEach(k=>{var ie,Ce,we,Xe;((ie=k.color)==null?void 0:ie.trim().length)>0&&((Ce=t.erFormHelperProp)==null||Ce.setLayoutItemContentForeColor(t.configId,k.itemCode,k.color)),((we=k.backgroundColor)==null?void 0:we.trim().length)>0&&((Xe=t.erFormHelperProp)==null||Xe.setLayoutItemContentBackColor(t.configId,k.itemCode,k.backgroundColor))})},se=k=>{var ie;if(k.field&&k.itemCode){const Ce=U(k.itemCode,"readOnly");if(U(k.itemCode,"allowEdit")===!1||Ce===!0&&k.widgetType!=="antInputGroup"){P.value[k.field]=P.value.getBackup()[k.field];return}P.value.dirtyFields[k.field]=!0,P.value.dirty=!0;let Xe=F.ER.Core.toString(P.value[k.field]);if(t.autoBind&&I.value.trim().length>0){const V=t.erFormHelperProp.getBindingTable(t.configId);V!=null&&V.Current&&V.Current.set(k.field,P.value[k.field],t.configId)}let ft=t.erFormHelperProp.getLayoutItemOption(t.configId,k.itemCode,"format");["erSelect","erMultiSelect","antMultiSelect","antRadioGroup","erRadioGroup","erCheckboxGroup"].includes(k.widgetType)?(Xe=t.erFormHelperProp.getDropDownSelectedText(t.configId,k.itemCode,P.value[k.field]),t.erFormHelperProp.setDropDownAutoFillFieldForLayout(t.configId,k.field,P.value[k.field]),t.erFormHelperProp.DropDownCascader[t.configId+k.itemCode]&&t.erFormHelperProp.DropDownCascader[t.configId+k.itemCode].forEach(V=>{var de,w,Oe,We,Be;if(V.FUNCTION_TYPE&&V.FUNCTION_ID&&V.ITEM_CODE&&V.FUNCTION_TYPE==="F"){let ye="";const je=t.erFormHelperProp.getSingleItemConfigInfo(V.FUNCTION_ID,V.ITEM_CODE);if(((de=je==null?void 0:je.DEFAULT_VALUE)==null?void 0:de.trim().toLowerCase())==="$first_row$"||((w=je==null?void 0:je.DEFAULT_VALUE)==null?void 0:w.trim().toLowerCase())==="{first_row}"||V.COLUMN_EDIT==="3"||V.COLUMN_EDIT==="B"){const ot=t.erFormHelperProp.getItemDropDownDataSource(V.FUNCTION_ID,V.ITEM_CODE),He=t.erFormHelperProp.filterDropDownCascaderDataSource(ot,V.FORM_FILTER,P.value[k.field]);if((V.COLUMN_EDIT==="3"||V.COLUMN_EDIT==="B")&&t.erFormHelperProp.reloadDropDownDataSource(V.FUNCTION_ID,V.ITEM_CODE,He),(((Oe=je.DEFAULT_VALUE)==null?void 0:Oe.trim().toLowerCase())==="$first_row$"||((We=je.DEFAULT_VALUE)==null?void 0:We.trim().toLowerCase())==="{first_row}")&&(He==null?void 0:He.length)>0){const nt=(Be=t.erFormHelperProp.DropDownBindSource[V.FUNCTION_ID])==null?void 0:Be[V.ITEM_CODE];nt.dataValueField&&(ye=He[0][nt.dataValueField])}}t.erFormHelperProp.setControlValue(V.FUNCTION_ID,V.ITEM_CODE,ye)}})):["antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(k.widgetType)?(ft instanceof Array&&(ft=ft[0]),Xe=(ie=F.ER.Core.toDateTime(P.value[k.field],"Dayjs"))==null?void 0:ie.format(ft||"YYYY-MM-DD")):k.widgetType==="antInputNumber"?Xe=F.ER.Core.formatNumberValue(P.value[k.field],ft):k.widgetType==="antInputGroup"&&F.ER.Core.toString(P.value[k.field]).length===0&&o("itemButtonClick",{...k,itemValue:"",value:"",type:"clear",data:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp,loading:V=>{}}),t.erFormHelperProp.setLayoutConditionStyle(t.configId),o("valueChanged",{...k,value:P.value[k.field],text:Xe,data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})}},be=k=>{o("pressEnter",{...k,value:P.value[k.field],data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})},Ue=k=>{o("focus",{...k,value:P.value[k.field],data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})},De=k=>{T[k.itemCode]=!1,o("blur",{...k,value:P.value[k.field],data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})},Ae=k=>{const ie=U(k.itemCode,"readOnly"),Ce=U(k.itemCode,"allowEdit");ie===!0||Ce===!1||o("dropdownOpen",{...k,value:P.value[k.field],data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})},Pe=k=>{if(k){const ie=U(k.itemCode,"readOnly"),Ce=U(k.itemCode,"allowEdit");if(ie===!0||Ce===!1)return;T[k.itemCode]=U(k.itemCode,"readOnly")!==!0,k.opened&&o("dropdownOpen",{...k,value:P.value[k.field],data:P.value,model:P.value,configId:t.configId,erFormHelper:t.erFormHelperProp})}};l.onMounted(()=>{var we;n=t.erFormHelperProp.getFormSysInfo("LayoutItemHasFeedback").toLowerCase()!=="false",t.erFormHelperProp.setLayoutBindForm(t.configId,E);const ie=t.erFormHelperProp.getLayoutBindModel(t.configId),Ce=t.erFormHelperProp.getBindingTable(t.configId);P.value=ie,(we=P.value)==null||we.setBackup(),t.autoBind&&!Ce&&console.warn("ER: AutoBind is true, but the binding table is not found."),t.configId&&t.autoBind&&Ce?Ce.setBindingInfo(t.erFormHelperProp,t.configId,"Layout"):(he.forEach(Xe=>{P.value[Xe.field]===void 0&&(["erMultiSelect","antMultiSelect","erCheckboxGroup"].includes(Xe.widgetType)?P.value[Xe.field]=[]:["antInputNumber"].includes(Xe.widgetType)?P.value[Xe.field]=0:["antCheckbox","antSwitch"].includes(Xe.widgetType)?P.value[Xe.field]=!1:["antDatePicker","antDateTimePicker","antMonthPicker","antYearPicker"].includes(Xe.widgetType)?P.value[Xe.field]=null:P.value[Xe.field]="")}),P.value.uid=F.ER.Core.guid(),t.erFormHelperProp.setAllControlDefalutValue(t.configId),l.nextTick(()=>{E.validate(),E.clearValidate()})),ne().then(()=>{var Xe;o("loaded",{api:{setFieldValue:(ft,V)=>{P.value[ft]!==void 0&&(P.value[ft]=V)},getModel:()=>P.value},erFormHelper:t.erFormHelperProp,formId:(Xe=t.erFormHelperProp)==null?void 0:Xe.FormId,configId:t.configId,validator:E,widgetRefList:x.value})})}),l.onUnmounted(()=>{t.configId&&t.autoBind&&t.erFormHelperProp.getBindingTable(t.configId).removeBindingInfo(t.erFormHelperProp,t.configId)});const tt=l.computed(()=>k=>ee(k));return l.watch(()=>t.erFormHelperProp.LayoutBindModelUid[t.configId],async(k,ie)=>{var Ce;if(t.autoBind&&I.value.trim().length>0){const we=t.erFormHelperProp.getLayoutBindModel(t.configId);P.value=we}t.erFormHelperProp.setLayoutConditionStyle(t.configId),K.forEach(we=>{F.ER.Core.toString(P.value[we],!0).length===0?P.value[we]=[]:P.value[we]=F.ER.Core.toString(P.value[we],!0).split(",")}),(Ce=P.value)==null||Ce.setBackup(),l.nextTick(()=>{E.validate(),E.clearValidate(),!c&&P.value.uid?(t.erFormHelperProp.setAllControlReadOnly(t.configId,"default"),c=!0):c&&P.value.uid.length===0&&(t.erFormHelperProp.setAllControlReadOnly(t.configId,!0),c=!1)})}),(k,ie)=>{const Ce=l.resolveComponent("a-button"),we=l.resolveComponent("a-input"),Xe=l.resolveComponent("a-input-group"),ft=l.resolveComponent("a-tooltip"),V=l.resolveComponent("a-form-item"),de=l.resolveComponent("a-radio-group"),w=l.resolveComponent("a-tag"),Oe=l.resolveComponent("a-select"),We=l.resolveComponent("a-textarea"),Be=l.resolveComponent("a-checkbox"),ye=l.resolveComponent("a-switch"),je=l.resolveComponent("a-input-number"),ot=l.resolveComponent("a-date-picker"),He=l.resolveComponent("a-time-picker"),nt=l.resolveComponent("a-divider"),dt=l.resolveComponent("a-menu"),Et=l.resolveComponent("a-dropdown"),yt=l.resolveComponent("a-form"),bt=l.resolveComponent("a-config-providver");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(bt,{theme:_.value,locale:m.value,componentSize:b.value},{default:l.withCtx(()=>[l.createVNode(Dr,{id:t.erFormHelperProp.FormId+e.configId+"_panel",name:t.erFormHelperProp.FormId+e.configId+"_panel",title:gt(),style:l.normalizeStyle(z.value.style),"open-header-show":t.allowCollapse??z.value.allowCollapse,"show-header":t.showGroupBorder??z.value.showGroupBorder,isCollapsed:t.isCollapsed??z.value.isCollapsed,onOpenHeaderChange:Tt},l.createSlots({customButtonSlot:l.withCtx(()=>[t.showFormToolbar??z.value.showFormToolbar?(l.openBlock(),l.createBlock(Do,{key:0,"show-page-button":t.showPageButton,"show-print-button":t.showPrintButton,"show-refresh-button":t.showRefreshButton,"show-add-button":t.showAddButton,"show-add-copy-button":t.showAddCopyButton,"show-delete-button":t.showDeleteButton,"show-save-button":t.showSaveButton,onToolbarClick:mt},null,8,["show-page-button","show-print-button","show-refresh-button","show-add-button","show-add-copy-button","show-delete-button","show-save-button"])):l.createCommentVNode("",!0),fe.value>0?(l.openBlock(),l.createBlock(Ce,{key:1,id:t.erFormHelperProp.FormId+e.configId+"show-more",name:t.erFormHelperProp.FormId+e.configId+"show-more",type:"primary",style:{"font-size":"13px"},onClick:nr},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.ErLayout.Expand")||"显示更多"),1)]),_:1},8,["id","name"])):l.createCommentVNode("",!0),l.unref(Ke).SHOW_SELECTION==="1"&&t.autoBind!==!0?(l.openBlock(),l.createBlock(Ce,{key:2,id:t.erFormHelperProp.FormId+e.configId+"reset",name:t.erFormHelperProp.FormId+e.configId+"reset",type:"primary",style:{"font-size":"13px"},icon:l.h(l.unref(it.UndoOutlined)),onClick:Rt},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Reset")||"重置"),1)]),_:1},8,["id","name","icon"])):l.createCommentVNode("",!0),(t.showQueryButton??z.value.showQueryButton)&&(t.showQueryButton??z.value.showQueryButton)!=="inside"?(l.openBlock(),l.createBlock(Ce,{key:3,id:t.erFormHelperProp.FormId+e.configId+"query",name:t.erFormHelperProp.FormId+e.configId+"query",type:"primary",style:{"font-size":"13px"},icon:l.h(l.unref(it.SearchOutlined)),onClick:At},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(F.ER).Core.$t("ERX.ErLayout.Query")||"查询"),1)]),_:1},8,["id","name","icon"])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ne.value,kt=>(l.openBlock(),l.createBlock(Ce,{style:{padding:"1px 5px !important",margin:"1px","font-size":"13px"},key:kt.button_ename,name:kt.button_ename,type:"primary",onClick:Lt=>Qt({buttonInfo:kt,buttonName:kt.button_ename,buttonCaption:kt.button_cname})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(kt.button_cname),1)]),_:2},1032,["name","onClick"]))),128)),l.renderSlot(k.$slots,"borderSlot")]),_:2},[Ee.value.length>0?{name:"contentSlot",fn:l.withCtx(()=>{var kt,Lt;return[(l.openBlock(),l.createBlock(yt,{ref_key:"formRef",ref:y,model:P.value,hideRequiredMark:!0,key:((kt=t.erFormHelperProp)==null?void 0:kt.FormId)+e.configId+"_content",id:((Lt=t.erFormHelperProp)==null?void 0:Lt.FormId)+e.configId+"_content",colon:!1,"label-wrap":te.value,layout:H.value?"vertical":"horizontal","label-col":M.value?void 0:{style:{width:`${G.value}px`}},class:l.normalizeClass(`${b.value}-form-label`),style:l.normalizeStyle(rt.value)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(Ee.value,(g,qt)=>(l.openBlock(),l.createElementBlock("div",{draggable:s.value&&g.WIDGET_TYPE!=="NA",onDragstart:Wt=>J(Wt,Ee.value[qt]),onDragover:ie[0]||(ie[0]=l.withModifiers(()=>{},["prevent"])),onDragenter:Wt=>re(Wt,Ee.value[qt]),onDrop:Wt=>Se(Wt,Ee.value[qt]),key:qt,style:l.normalizeStyle({gridColumnStart:g.COL_START,gridColumnEnd:g.COL_END,gridRowStart:g.ROW_START,gridRowEnd:g.ROW_END,border:s.value?"1px dotted red":void 0})},[l.createVNode(Et,{trigger:["contextmenu"],disabled:!s.value,onOpenChange:Wt=>{ue({opened:Wt,layoutItem:Ee.value[qt]})}},{overlay:l.withCtx(()=>[t.erFormHelperProp.DevelopPermisson==="1"?(l.openBlock(),l.createBlock(dt,{key:0,items:ce.value,onClick:Wt=>pt(Ee.value[qt],Wt)},null,8,["items","onClick"])):l.createCommentVNode("",!0)]),default:l.withCtx(()=>{var Wt,Ca,Ga,za,$a,vt,Yt,xt,Dt,rr,ar,Zt,Kt,Re,zr,Zr,ca,Pr,da,wt,ea;return[g.WIDGET_TYPE==="antInputGroup"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:0,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((Wt=t.erFormHelperProp)==null?void 0:Wt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[l.createVNode(Xe,{style:{width:"100%"},compact:""},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(we,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputGroup"}),onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputGroup"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputGroup"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputGroup"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"buttonEnable")&&U(g.ITEM_CODE,"allowClear")!==!1,disabled:U(g.ITEM_CODE,"allowEdit")===!1,readOnly:U(g.ITEM_CODE,"readOnly")===!0,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,style:l.normalizeStyle({width:"calc(100% - 24px)",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")+"!important"})},null,8,["value","onUpdate:value","onChange","onPressEnter","onFocus","onBlur","name","id","allow-clear","disabled","readOnly","placeholder","style"])),l.createVNode(Ce,{disabled:!U(g.ITEM_CODE,"buttonEnable"),loading:Ie[g.ITEM_CODE]===!0,style:{height:"24px !important",width:"25px","box-shadow":"none !important"},onClick:qe=>St({itemCode:g.ITEM_CODE,itemValue:P.value[g.ITEM_CODE],field:g.FIELD_NAME,value:P.value[g.ITEM_CODE],type:"select",data:P.value,itemConfig:g})},{icon:l.withCtx(()=>[l.createVNode(l.unref(it.EllipsisOutlined))]),_:2},1032,["disabled","loading","onClick"])]),_:2},1024)]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME])},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,T5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erSelect"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:1,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((Ca=t.erFormHelperProp)==null?void 0:Ca.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>{var qe,cr,pr,or,Jt,lt,Ot,Vt,lr,Ar;return[(l.openBlock(),l.createBlock(ba,{"component-size":b.value,modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":Xt=>P.value[g.FIELD_NAME]=Xt,onChange:Xt=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onFocus:Xt=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onBlur:Xt=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onDropdownOpen:Xt=>{Ae({...Xt,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"})},name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,readonly:U(g.ITEM_CODE,"readOnly")==!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,"data-source":(cr=(qe=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:qe[g.ITEM_CODE])==null?void 0:cr.dataSource,columns:(or=(pr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:pr[g.ITEM_CODE])==null?void 0:or.columns,options:{floatingFilter:z.value.floatingFilter,beforeDropdownOpen:z.value.beforeDropdownOpen,...z.value[g.ITEM_CODE],valueField:(lt=(Jt=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Jt[g.ITEM_CODE])==null?void 0:lt.dataValueField,textField:(Vt=(Ot=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ot[g.ITEM_CODE])==null?void 0:Vt.dataTextField,displayFormat:(Ar=(lr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:lr[g.ITEM_CODE])==null?void 0:Ar.displayFormat,imageCombo:g.COLUMN_EDIT==="P",configId:t.configId.trim(),itemCode:g.ITEM_CODE,itemConfig:g,erFormHelper:t.erFormHelperProp},style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor")})},null,8,["component-size","modelValue","onUpdate:modelValue","onChange","onFocus","onBlur","onDropdownOpen","name","id","allow-clear","readonly","disabled","placeholder","data-source","columns","options","style"]))]}),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,S5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erTreeSelect"||g.WIDGET_TYPE==="erMultiTreeSelect"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:2,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((Ga=t.erFormHelperProp)==null?void 0:Ga.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>{var qe,cr,pr,or,Jt,lt,Ot,Vt,lr,Ar;return[(l.openBlock(),l.createBlock(ba,{"component-size":b.value,modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":Xt=>P.value[g.FIELD_NAME]=Xt,onChange:Xt=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onFocus:Xt=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onBlur:Xt=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onDropdownOpen:Xt=>{Ae({...Xt,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"})},name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,readonly:U(g.ITEM_CODE,"readOnly")==!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,"tree-dropdown":!0,multiple:g.WIDGET_TYPE==="erMultiTreeSelect","data-source":(cr=(qe=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:qe[g.ITEM_CODE])==null?void 0:cr.dataSource,columns:(or=(pr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:pr[g.ITEM_CODE])==null?void 0:or.columns,options:{floatingFilter:z.value.floatingFilter,beforeDropdownOpen:z.value.beforeDropdownOpen,...z.value[g.ITEM_CODE],valueField:(lt=(Jt=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Jt[g.ITEM_CODE])==null?void 0:lt.dataValueField,textField:(Vt=(Ot=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ot[g.ITEM_CODE])==null?void 0:Vt.dataTextField,displayFormat:(Ar=(lr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:lr[g.ITEM_CODE])==null?void 0:Ar.displayFormat,imageCombo:g.COLUMN_EDIT==="P",configId:t.configId.trim(),itemCode:g.ITEM_CODE,itemConfig:g,erFormHelper:t.erFormHelperProp},style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor")})},null,8,["component-size","modelValue","onUpdate:modelValue","onChange","onFocus","onBlur","onDropdownOpen","name","id","allow-clear","readonly","disabled","placeholder","multiple","data-source","columns","options","style"]))]}),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,x5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erMultiSelect"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:3,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((za=t.erFormHelperProp)==null?void 0:za.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>{var qe,cr,pr,or,Jt,lt,Ot,Vt,lr,Ar;return[(l.openBlock(),l.createBlock(ba,{"component-size":b.value,modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":Xt=>P.value[g.FIELD_NAME]=Xt,onChange:Xt=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onFocus:Xt=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onBlur:Xt=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"}),onDropdownOpen:Xt=>{Ae({...Xt,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erSelect"})},name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,readonly:U(g.ITEM_CODE,"readOnly")==!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,multiple:!0,"data-source":(cr=(qe=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:qe[g.ITEM_CODE])==null?void 0:cr.dataSource,columns:(or=(pr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:pr[g.ITEM_CODE])==null?void 0:or.columns,options:{floatingFilter:z.value.floatingFilter,beforeDropdownOpen:z.value.beforeDropdownOpen,...z.value[g.ITEM_CODE],valueField:(lt=(Jt=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Jt[g.ITEM_CODE])==null?void 0:lt.dataValueField,textField:(Vt=(Ot=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ot[g.ITEM_CODE])==null?void 0:Vt.dataTextField,displayFormat:(Ar=(lr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:lr[g.ITEM_CODE])==null?void 0:Ar.displayFormat,configId:t.configId.trim(),itemCode:g.ITEM_CODE,itemConfig:g,erFormHelper:t.erFormHelperProp},style:l.normalizeStyle({width:"100%",minHeight:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":void 0,color:U(g.ITEM_CODE,"TextForeColor")})},null,8,["component-size","modelValue","onUpdate:modelValue","onChange","onFocus","onBlur","onDropdownOpen","name","id","allow-clear","readonly","disabled","placeholder","data-source","columns","options","style"]))]}),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME})},l.toDisplayString(U(g.ITEM_CODE,"labelText")),47,y5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antRadioGroup"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:4,id:(($a=t.erFormHelperProp)==null?void 0:$a.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(de,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antRadioGroup"}),disabled:U(g.ITEM_CODE,"allowEdit")===!1||U(g.ITEM_CODE,"readOnly")==!0,name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,options:ee(g.ITEM_CODE),class:l.normalizeClass(`${b.value}-radio-group`),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","disabled","name","id","options","class","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,v5)]),key:"0"}:void 0]),1040,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antMultiSelect"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:5,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((vt=t.erFormHelperProp)==null?void 0:vt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(Oe,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,mode:"multiple",onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antMultiSelect"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antMultiSelect"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antMultiSelect"}),onDropdownVisibleChange:qe=>{Pe({opened:qe,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antMultiSelect"})},"show-search":!1,maxTagCount:U(g.ITEM_CODE,"maxTagCount")||5,name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,options:tt.value(g.ITEM_CODE),dropdownStyle:{pointerEvents:U(g.ITEM_CODE,"readOnly")?"none":"auto"},style:l.normalizeStyle({width:"100%",minHeight:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":void 0,color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},l.createSlots({_:2},[U(g.ITEM_CODE,"readOnly")?{name:"tagRender",fn:l.withCtx(({label:qe})=>[l.createVNode(w,{closable:!1},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(qe)+"  ",1)]),_:2},1024)]),key:"0"}:void 0]),1032,["value","onUpdate:value","onChange","onFocus","onBlur","onDropdownVisibleChange","maxTagCount","name","id","allow-clear","disabled","placeholder","options","dropdownStyle","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,F5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erCheckboxGroup"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:6,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((Yt=t.erFormHelperProp)==null?void 0:Yt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>{var qe,cr,pr,or,Jt,lt,Ot,Vt,lr,Ar;return[(l.openBlock(),l.createBlock(wo,{modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":Xt=>P.value[g.FIELD_NAME]=Xt,onChange:Xt=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erCheckboxGroup"}),onFocus:Xt=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erCheckboxGroup"}),onBlur:Xt=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erCheckboxGroup"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,disabled:U(g.ITEM_CODE,"allowEdit")===!1||U(g.ITEM_CODE,"readOnly")==!0,dataSource:ee(g.ITEM_CODE),valueField:(cr=(qe=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:qe[g.ITEM_CODE])==null?void 0:cr.dataValueField,textField:(or=(pr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:pr[g.ITEM_CODE])==null?void 0:or.dataTextField,options:{floatingFilter:z.value.floatingFilter,...z.value[g.ITEM_CODE],valueField:(lt=(Jt=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Jt[g.ITEM_CODE])==null?void 0:lt.dataValueField,textField:(Vt=(Ot=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ot[g.ITEM_CODE])==null?void 0:Vt.dataTextField,displayFormat:(Ar=(lr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:lr[g.ITEM_CODE])==null?void 0:Ar.displayFormat,configId:t.configId.trim(),itemCode:g.ITEM_CODE,itemConfig:g,erFormHelper:t.erFormHelperProp},style:l.normalizeStyle({width:"100%",minHeight:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":void 0,color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["modelValue","onUpdate:modelValue","onChange","onFocus","onBlur","name","id","disabled","dataSource","valueField","textField","options","style"]))]}),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,O5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erRadioGroup"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:7,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((xt=t.erFormHelperProp)==null?void 0:xt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>{var qe,cr,pr,or,Jt,lt,Ot,Vt,lr,Ar;return[(l.openBlock(),l.createBlock(Mo,{modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":Xt=>P.value[g.FIELD_NAME]=Xt,onChange:Xt=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erRadioGroup"}),onFocus:Xt=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erRadioGroup"}),onBlur:Xt=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erRadioGroup"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,disabled:U(g.ITEM_CODE,"allowEdit")===!1||U(g.ITEM_CODE,"readOnly")==!0,dataSource:ee(g.ITEM_CODE),valueField:(cr=(qe=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:qe[g.ITEM_CODE])==null?void 0:cr.dataValueField,textField:(or=(pr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:pr[g.ITEM_CODE])==null?void 0:or.dataTextField,options:{floatingFilter:z.value.floatingFilter,...z.value[g.ITEM_CODE],valueField:(lt=(Jt=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Jt[g.ITEM_CODE])==null?void 0:lt.dataValueField,textField:(Vt=(Ot=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:Ot[g.ITEM_CODE])==null?void 0:Vt.dataTextField,displayFormat:(Ar=(lr=t.erFormHelperProp.DropDownBindSource[t.configId.trim()])==null?void 0:lr[g.ITEM_CODE])==null?void 0:Ar.displayFormat,configId:t.configId.trim(),itemCode:g.ITEM_CODE,itemConfig:g,erFormHelper:t.erFormHelperProp},style:l.normalizeStyle({width:"100%",minHeight:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":void 0,color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["modelValue","onUpdate:modelValue","onChange","onFocus","onBlur","name","id","disabled","dataSource","valueField","textField","options","style"]))]}),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,_t(g.ITEM_CODE,P.value[g.FIELD_NAME]))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,I5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antTextarea"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:8,id:((Dt=t.erFormHelperProp)==null?void 0:Dt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(We,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antTextarea"}),onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antTextarea"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antTextarea"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antTextarea"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,readonly:U(g.ITEM_CODE,"readOnly")===!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,mask:U(g.ITEM_CODE,"mask"),rows:U(g.ITEM_CODE,"rows"),"show-count":U(g.ITEM_CODE,"showCount"),spellcheck:U(g.ITEM_CODE,"spellCheck")===!0,style:l.normalizeStyle({width:"100%",height:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":void 0,color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","onPressEnter","onFocus","onBlur","name","id","readonly","disabled","placeholder","allow-clear","mask","rows","show-count","spellcheck","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME])},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,D5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="erMemoEditor"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:9,id:((rr=t.erFormHelperProp)==null?void 0:rr.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(ko,{modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":qe=>P.value[g.FIELD_NAME]=qe,onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erMemoEditor"}),onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erMemoEditor"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erMemoEditor"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"erMemoEditor"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,readonly:U(g.ITEM_CODE,"readOnly")===!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,mask:U(g.ITEM_CODE,"mask"),spellcheck:U(g.ITEM_CODE,"spellCheck")===!0,rows:U(g.ITEM_CODE,"rows"),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["modelValue","onUpdate:modelValue","onChange","onPressEnter","onFocus","onBlur","name","id","readonly","disabled","placeholder","mask","spellcheck","rows","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME])},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,A5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="scriptEditor"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:10,id:((ar=t.erFormHelperProp)==null?void 0:ar.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.unref(qi.Codemirror),{modelValue:P.value[g.FIELD_NAME],"onUpdate:modelValue":qe=>P.value[g.FIELD_NAME]=qe,onReady:qe=>A({...qe,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"scriptEditor"}),onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"scriptEditor"}),onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"scriptEditor"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"scriptEditor"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"scriptEditor"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"indent-with-tab":!0,tabSize:2,extensions:[l.unref(Dn.sql)()],readonly:U(g.ITEM_CODE,"readOnly")===!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,mask:U(g.ITEM_CODE,"mask"),maxlength:U(g.ITEM_CODE,"maxlength"),"show-count":U(g.ITEM_CODE,"showCount"),spellcheck:U(g.ITEM_CODE,"spellCheck"),style:l.normalizeStyle({width:"100%",height:U(g.ITEM_CODE,"rows")>1?(U(g.ITEM_CODE,"rows")*24+5).toString()+"px":"24px",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["modelValue","onUpdate:modelValue","onReady","onChange","onPressEnter","onFocus","onBlur","name","id","extensions","readonly","disabled","placeholder","mask","maxlength","show-count","spellcheck","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,w5)]),key:"0"}:void 0]),1040,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antCheckbox"?l.withDirectives((l.openBlock(),l.createBlock(V,{key:11,id:((Zt=t.erFormHelperProp)==null?void 0:Zt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder")},l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(Be,{checked:P.value[g.FIELD_NAME],"onUpdate:checked":qe=>P.value[g.FIELD_NAME]=qe,onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antCheckbox"}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,disabled:U(g.ITEM_CODE,"readOnly")===!0||U(g.ITEM_CODE,"allowEdit")===!1},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(g.HEAD_TEXTVISIBLE!=="1"?g.COL_CAPTION:""),1)]),_:2},1032,["checked","onUpdate:checked","onChange","name","id","disabled"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME]?"true":"false")},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,M5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1032,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antSwitch"?l.withDirectives((l.openBlock(),l.createBlock(V,{key:12,id:((Kt=t.erFormHelperProp)==null?void 0:Kt.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder")},l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(ye,{checked:P.value[g.FIELD_NAME],"onUpdate:checked":qe=>P.value[g.FIELD_NAME]=qe,onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antSwitch"}),class:l.normalizeClass(`${b.value}-switch`),checkedValue:!0,unCheckedValue:!1,"checked-children":l.unref(F.ER).Core.$t("ERX.SwitchOn"),"un-checked-children":l.unref(F.ER).Core.$t("ERX.SwitchOff"),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,disabled:U(g.ITEM_CODE,"readOnly")===!0||U(g.ITEM_CODE,"allowEdit")===!1},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(g.HEAD_TEXTVISIBLE!=="1"?g.COL_CAPTION:""),1)]),_:2},1032,["checked","onUpdate:checked","onChange","class","checked-children","un-checked-children","name","id","disabled"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME]?"true":"false")},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME})},l.toDisplayString(U(g.ITEM_CODE,"labelText")),47,k5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1032,["id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antButton"?l.withDirectives((l.openBlock(),l.createBlock(V,{key:13},{default:l.withCtx(()=>[l.createElementVNode("div",{style:l.normalizeStyle({display:"flex",justifyContent:g.ITEM_CODE==="erQueryButton"?"flex-end":"center"})},[(l.openBlock(),l.createBlock(Ce,{name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,icon:g.ITEM_CODE==="erQueryButton"?l.h(l.unref(it.SearchOutlined)):void 0,type:g.ITEM_CODE==="erQueryButton"?"primary":"default",disabled:U(g.ITEM_CODE,"readOnly")===!0||U(g.ITEM_CODE,"allowEdit")===!1,style:l.normalizeStyle(g.ITEM_CODE==="erQueryButton"?{width:"auto"}:{width:"100%",height:"24px !important",boxShadow:"none !important",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")}),onClick:qe=>St({itemCode:g.ITEM_CODE,type:"normal",data:P.value,itemConfig:g})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(U(g.ITEM_CODE,"labelText")),1)]),_:2},1032,["name","id","icon","type","disabled","style","onClick"]))],4)]),_:2},1536)),[[l.vShow,U(g.ITEM_CODE,"visible")&&(g.ITEM_CODE!=="erQueryButton"||s.value===!1)]]):g.WIDGET_TYPE==="antInputNumber"?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:14,id:((Re=t.erFormHelperProp)==null?void 0:Re.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(je,{type:"text",autocomplete:"off",value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputNumber"}),onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputNumber"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputNumber"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInputNumber"}),onInput:qe=>{ht({...qe,itemCode:g.ITEM_CODE,field:g.FIELD_NAME})},onStep:(qe,cr)=>{Ct({...cr,itemCode:g.ITEM_CODE,field:g.FIELD_NAME})},class:"er-layout-field",name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,readonly:U(g.ITEM_CODE,"readOnly")===!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,controls:U(g.ITEM_CODE,"controls"),step:U(g.ITEM_CODE,"step")||1,addonAfter:U(g.ITEM_CODE,"addonAfter"),addonBefore:U(g.ITEM_CODE,"addonBefore"),prefix:U(g.ITEM_CODE,"prefix"),placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,formatter:U(g.ITEM_CODE,"formatter"),parser:U(g.ITEM_CODE,"parser"),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","onPressEnter","onFocus","onBlur","onInput","onStep","name","id","readonly","disabled","controls","step","addonAfter","addonBefore","prefix","placeholder","formatter","parser","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,l.unref(F.ER).Core.formatNumberValue(P.value[g.FIELD_NAME],g.FORMAT_STRING))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,b5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["id","label-col","has-feedback","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):["antDateTimePicker","antDatePicker","antMonthPicker","antYearPicker"].includes(g.WIDGET_TYPE)?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:15,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((zr=t.erFormHelperProp)==null?void 0:zr.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(ot,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),picker:g.WIDGET_TYPE==="antMonthPicker"?"month":g.WIDGET_TYPE==="antYearPicker"?"year":void 0,name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,inputReadOnly:U(g.ITEM_CODE,"readOnly")===!0||U(g.ITEM_CODE,"inputReadOnly")===!0||U(g.ITEM_CODE,"dateInputReadOnly")===!0,open:U(g.ITEM_CODE,"readOnly")===!0?!1:void 0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,"disabled-date":U(g.ITEM_CODE,"disabledDate"),"disabled-time":U(g.ITEM_CODE,"disabledTime"),placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,"show-time":U(g.ITEM_CODE,"showTime"),format:U(g.ITEM_CODE,"format"),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","onFocus","onBlur","picker","name","id","allow-clear","inputReadOnly","open","disabled","disabled-date","disabled-time","placeholder","show-time","format","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,l.unref(F.ER).Core.getDateTimeFormatString(P.value[g.FIELD_NAME],U(g.ITEM_CODE,"format")))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,R5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):["antTimePicker"].includes(g.WIDGET_TYPE)?l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:16,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((Zr=t.erFormHelperProp)==null?void 0:Zr.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(He,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>se({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:g.WIDGET_TYPE}),name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,inputReadOnly:U(g.ITEM_CODE,"readOnly")===!0||U(g.ITEM_CODE,"inputReadOnly")===!0||U(g.ITEM_CODE,"dateInputReadOnly")===!0,open:U(g.ITEM_CODE,"readOnly")===!0?!1:void 0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,format:U(g.ITEM_CODE,"format"),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","onFocus","onBlur","name","id","allow-clear","inputReadOnly","open","disabled","placeholder","format","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,l.unref(F.ER).Core.getDateTimeFormatString(P.value[g.FIELD_NAME],U(g.ITEM_CODE,"format")))},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,N5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="label"?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:17,id:((ca=t.erFormHelperProp)==null?void 0:ca.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,style:l.normalizeStyle({textAlign:g.HALIGNMENT==="Near"?"left":g.HALIGNMENT==="Far"?"right":"center",color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")})},l.toDisplayString(g.HEAD_TEXTVISIBLE==="1"?U(g.ITEM_CODE,"labelText"):s.value?U(g.ITEM_CODE,"labelText")+"(dev mode)":""),13,L5)),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="antDivider"?l.withDirectives((l.openBlock(),l.createElementBlock("div",{key:18,id:((Pr=t.erFormHelperProp)==null?void 0:Pr.FormId)+e.configId+g.ITEM_CODE+"_span"},[l.createVNode(nt,{orientation:g.HALIGNMENT==="Near"?"left":g.HALIGNMENT==="Far"?"right":"center",style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"LabelForeColor"),borderColor:U(g.ITEM_CODE,"LabelBackColor")})},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(g.HEAD_TEXTVISIBLE==="1"?U(g.ITEM_CODE,"labelText"):""),1)]),_:2},1032,["orientation","style"])],8,P5)),[[l.vShow,U(g.ITEM_CODE,"visible")]]):g.WIDGET_TYPE==="NA"?(l.openBlock(),l.createElementBlock("div",{key:19,id:((da=t.erFormHelperProp)==null?void 0:da.FormId)+e.configId+g.ITEM_CODE+g.FIELD_NAME,name:((wt=t.erFormHelperProp)==null?void 0:wt.FormId)+e.configId+g.ITEM_CODE+"_empty",style:{height:"24px"}},ie[2]||(ie[2]=[l.createElementVNode("span",null,null,-1)]),8,B5)):l.withDirectives((l.openBlock(),l.createBlock(V,l.mergeProps({key:20,"has-feedback":U(g.ITEM_CODE,"hasFeedback")!==!1,id:((ea=t.erFormHelperProp)==null?void 0:ea.FormId)+e.configId+g.ITEM_CODE+"_span","label-col":g.labelWidth?{style:{width:`${g.labelWidth}px`}}:void 0,tooltip:U(g.ITEM_CODE,"placeholder"),ref_for:!0},l.unref(E).validateInfos[g.ITEM_CODE]),l.createSlots({default:l.withCtx(()=>[(l.openBlock(),l.createBlock(we,{value:P.value[g.FIELD_NAME],"onUpdate:value":qe=>P.value[g.FIELD_NAME]=qe,valueModifiers:{lazy:!0},onChange:qe=>{se({e:qe,itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInput"})},onPressEnter:qe=>be({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInput"}),onFocus:qe=>Ue({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInput"}),onBlur:qe=>De({itemCode:g.ITEM_CODE,field:g.FIELD_NAME,widgetType:"antInput"}),onInput:qe=>{ht({itemCode:g.ITEM_CODE,field:g.FIELD_NAME})},class:"er-layout-field",name:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,id:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,key:t.erFormHelperProp.FormId+g.FUNCTION_ID+g.ITEM_CODE,ref_for:!0,ref:ct,readOnly:U(g.ITEM_CODE,"readOnly")===!0,disabled:U(g.ITEM_CODE,"allowEdit")===!1,addonAfter:U(g.ITEM_CODE,"addonAfter"),addonBefore:U(g.ITEM_CODE,"addonBefore"),"allow-clear":U(g.ITEM_CODE,"readOnly")!==!0&&U(g.ITEM_CODE,"allowClear")!==!1,prefix:U(g.ITEM_CODE,"prefix"),suffix:U(g.ITEM_CODE,"suffix"),placeholder:g.HEAD_TEXTVISIBLE==="0"?U(g.ITEM_CODE,"placeholder"):void 0,spellcheck:U(g.ITEM_CODE,"spellcheck"),style:l.normalizeStyle({width:"100%",color:U(g.ITEM_CODE,"TextForeColor"),backgroundColor:U(g.ITEM_CODE,"TextBackColor")})},null,8,["value","onUpdate:value","onChange","onPressEnter","onFocus","onBlur","onInput","name","id","readOnly","disabled","addonAfter","addonBefore","allow-clear","prefix","suffix","placeholder","spellcheck","style"]))]),_:2},[g.HEAD_TEXTVISIBLE==="1"?{name:"label",fn:l.withCtx(()=>[l.createVNode(ft,{title:v(g,P.value[g.FIELD_NAME])},{default:l.withCtx(()=>[l.createElementVNode("span",{class:l.normalizeClass(Qe(g)),style:l.normalizeStyle({color:U(g.ITEM_CODE,"LabelForeColor"),backgroundColor:U(g.ITEM_CODE,"LabelBackColor")}),onClick:qe=>Ye({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),onDblclick:qe=>st({configId:g.FUNCTION_ID,itemCode:g.ITEM_CODE,itemCaption:U(g.ITEM_CODE,"labelText"),field:g.FIELD_NAME}),innerHTML:U(g.ITEM_CODE,"labelText")},null,46,H5)]),_:2},1032,["title"])]),key:"0"}:void 0]),1040,["has-feedback","id","label-col","tooltip"])),[[l.vShow,U(g.ITEM_CODE,"visible")]])]}),_:2},1032,["disabled","onOpenChange"])],44,_5))),128))]),_:1},8,["model","id","label-wrap","layout","label-col","class","style"])),t.erFormHelperProp.DevelopPermisson==="1"&&l.unref(Ge)==="F"&&!s.value?(l.openBlock(),l.createElementBlock("div",V5,[l.createVNode(Et,null,{overlay:l.withCtx(()=>[l.createVNode(dt,{items:Te.value,onClick:ie[1]||(ie[1]=g=>at(g))},null,8,["items"])]),default:l.withCtx(()=>[l.createVNode(l.unref(it.EllipsisOutlined))]),_:1})])):l.createCommentVNode("",!0)]}),key:"0"}:void 0]),1032,["id","name","title","style","open-header-show","show-header","isCollapsed"])]),_:3},8,["theme","locale","componentSize"])])}}}),G5={key:0,class:"er-tree-find-panel-input"},z5=l.defineComponent({name:"ErTree",components:{"a-input":et.Input,"a-config-providver":et.ConfigProvider}}),In=l.defineComponent({...z5,props:{dataSource:{type:Object,default:()=>[],require:!1},primaryField:{type:String,default:"",require:!0},parentField:{type:String,default:"",require:!0},displayField:{type:String,default:"",require:!0},nodeRenderer:{type:Object,require:!1},getNodeStyle:{type:Object,require:!1},getNodeHeight:{type:Object,require:!1},getNodeIconComponent:{type:Function,require:!1},getContextMenu:{type:Function,require:!1},options:{type:Object,default:()=>{}}},emits:["erTreeReady","click","doubleClick","focusChanged"],setup(e,{emit:a}){var H;const t=e,o=l.ref(yr()),s=l.ref(zt()),f=a,u=l.useAttrs(),h=l.ref(null),C=l.ref(""),T=l.ref([{field:t.displayField,hide:!0}]),S=l.ref({headerName:"Organisation Hierarchy",field:t.displayField,minWidth:300,hide:!0,cellStyle:{display:"flex",alignItems:"center"},cellRendererParams:{suppressCount:!0,innerRenderer:t.nodeRenderer||Ao,getNodeIconComponent:t.getNodeIconComponent||(((H=t.options)==null?void 0:H.defaultNodeIcon)!==!1?oe=>oe.node.allChildrenCount?oe.node.expanded?l.h(it.FolderOpenOutlined,{style:{color:"#f8b932"}}):l.h(it.FolderOutlined,{style:{color:"#f8b932"}}):l.h(it.FileOutlined):void 0)},tooltipField:t.displayField});let x="",y="",O=[];const D=oe=>{var R,K;(K=(R=h.value.gridOptions)==null?void 0:R.api)==null||K.setQuickFilter(C.value)},I=oe=>oe.data.uid,M=oe=>t.getNodeStyle?t.getNodeStyle instanceof Function?t.getNodeStyle(oe):t.getNodeHeight:{border:"none",background:"none"},G=oe=>{if(t.getNodeHeight){if(typeof t.getNodeHeight=="number")return t.getNodeHeight;if(t.getNodeHeight instanceof Function)return t.getNodeHeight(oe)}else return 25},te=oe=>oe.orgHierarchy,b=oe=>{var K,he;const R=[];if(oe.api.getDisplayedRowCount()>0&&(((K=t.options)==null?void 0:K.suppressDefaultContextMenu)!==!0&&((he=t.options)==null?void 0:he.preventDefaultContextMenu)!==!0&&R.push("copy","separator","expandAll","contractAll"),t.getContextMenu)){const z=t.getContextMenu(oe);z&&(R.length>0&&R.push("separator"),R.push(...z))}return R},P=async oe=>{oe.api.setPopupParent(document.querySelector("body")),oe.api.addEventListener("cellFocused",R=>{var he,z,Ie,Ne;const K=R.api.getModel().getRow(R.rowIndex);if(K){const xe={...R,rowChanged:((he=K==null?void 0:K.data)==null?void 0:he.uid)!==x,columnChanged:R.column.colId!==y,data:K.data,field:(z=R.column.colDef)==null?void 0:z.field};x=(Ie=K==null?void 0:K.data)==null?void 0:Ie.uid,y=(Ne=R.column)==null?void 0:Ne.colId,f("focusChanged",xe)}}),oe.api.addEventListener("rowDataUpdated",R=>{var K;(K=R==null?void 0:R.api)==null||K.clearRangeSelection(),O.length===0?f("focusChanged",{rowChanged:!0,columnChanged:!0,data:void 0}):(F.ER.Core.setGridFocusedCell(h.value,0),f("focusChanged",{rowChanged:!0,columnChanged:!0,data:O[0]}))}),oe.api.addEventListener("rowGroupOpened",R=>{R.api.redrawRows({rowNodes:[R.node]})}),oe.api.setTreeData=(R,K)=>{R=R||[],O=[];const he={};let z="";R.forEach(Ne=>{he[Ne[t.primaryField]]={...Ne}});const Ie=(Ne,xe)=>{const Le=[];for(;xe;)Le.unshift(xe[t.primaryField]),xe=Ne[xe[t.parentField]];return Le};return R.forEach(Ne=>{const xe={...Ne,orgHierarchy:Ie(he,Ne),uid:F.ER.Core.guid()};K&&Ne[t.primaryField]===K&&(z=xe.uid),O.push(xe)}),oe.api.setRowData(O),z&&oe.api.setRowNodeSelected(z),O},oe.api.setRowNodeSelected=async R=>{if(oe.api&&(R==null?void 0:R.trim().length)>0){let K=null;oe.api.forEachNode(he=>{if(he.data.uid===R){K=he,he.setSelected(!0),oe.api.setFocusedCell(he.rowIndex,t.displayField);let z=he.parent;for(;z;)oe.api.setRowNodeExpanded(z,!0),z=z.parent}}),K&&await setTimeout(()=>{oe.api.ensureNodeVisible(K)},250)}},oe.api.setRowData([]),h.value.gridOptions.api.addEventListener("rowDataUpdated",R=>{var K;(K=R==null?void 0:R.api)==null||K.clearRangeSelection()}),f("erTreeReady",oe)},Ee=oe=>{f("click",oe)},fe=oe=>{f("doubleClick",oe)};return l.onMounted(()=>{}),(oe,R)=>{var Ie,Ne;const K=l.resolveComponent("a-input"),he=l.resolveComponent("a-config-providver"),z=l.resolveComponent("ag-grid-vue");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(((Ie=t.options)==null?void 0:Ie.disabled)===!0?"er-tree-disabled":void 0),style:{height:"100%",width:"100%"}},[l.createVNode(he,{theme:s.value,locale:o.value,componentSize:"small"},{default:l.withCtx(()=>{var xe;return[(xe=t.options)!=null&&xe.showFindPanel?(l.openBlock(),l.createElementBlock("div",G5,[l.createVNode(K,{value:C.value,"onUpdate:value":R[0]||(R[0]=Le=>C.value=Le),valueModifiers:{lazy:!0},"allow-clear":!0,onChange:D,placeholder:l.unref(F.ER).Core.$t("ERX.ErGrid.QuickFilterPlaceHoder")},null,8,["value","placeholder"])])):l.createCommentVNode("",!0)]}),_:1},8,["theme","locale"]),l.createVNode(z,l.mergeProps({ref_key:"agGridVueRef",ref:h},l.unref(u),{class:"ag-theme-balham er-devtree-grid",localeText:l.unref(Ci)(),enableRtl:l.unref(Ta)(),rowSelection:"single",style:{height:"100%",width:"100%"},columnDefs:T.value,defaultColDef:{flex:1},autoGroupColumnDef:S.value,headerHeight:0,treeData:!0,tooltipInteraction:!0,animateRows:((Ne=e.options)==null?void 0:Ne.animateRows)!==!1,getRowId:I,getRowStyle:M,getRowHeight:G,getDataPath:te,getContextMenuItems:b,onGridReady:P,onCellClicked:Ee,onCellDoubleClicked:fe}),null,16,["localeText","enableRtl","columnDefs","autoGroupColumnDef","animateRows"])],2)}}}),$5={key:0},W5=l.defineComponent({name:"er-pop-free",components:{ErDialog:Oa}}),bo=l.defineComponent({...W5,props:{popFreeHelperProp:{type:F.ER.PopFreeHelper,default:null,require:!0},formWidth:{type:Number,default:-1,require:!1},formHeight:{type:Number,default:-1,require:!1}},emits:["OkClick","CancelClick","Closed"],setup(e,{emit:a}){const t=e,o=a,s=t.popFreeHelperProp.FormHelper;let f,u;const h=l.ref(null),C=l.ref(!1),T={},S={};let x=[];const y=()=>{t.popFreeHelperProp.Context=t.popFreeHelperProp.Context||{},t.popFreeHelperProp.Context.configUpdate=!0},O=H=>{const oe=t.popFreeHelperProp.getEvent("itemValueChanged");oe&&oe instanceof Function&&(H.erFormHelper=t.popFreeHelperProp.FormHelper,l.nextTick(()=>{oe(H)}))},D=H=>{const oe=t.popFreeHelperProp.getEvent("itemButtonClick");oe&&oe instanceof Function&&oe(H)},I=H=>{const oe=t.popFreeHelperProp.getEvent("pressEnter");oe&&oe instanceof Function&&oe(H)},M=H=>{const oe=t.popFreeHelperProp.getEvent("focus");oe&&oe instanceof Function&&oe(H)},G=H=>{const oe=t.popFreeHelperProp.getEvent("blur");oe&&oe instanceof Function&&oe(H)},te=H=>{const oe=t.popFreeHelperProp.FormHelper.getBindingTable(x[0]);oe==null||oe.clear().add(t.popFreeHelperProp.ReceiveData()),setTimeout(()=>{x.forEach(R=>{s.setAllControlReadOnly(R,t.popFreeHelperProp.EditType!=="Query"?"default":!0),t.popFreeHelperProp.ReadOnlys&&t.popFreeHelperProp.EditType!=="Query"&&t.popFreeHelperProp.FormHelper.setControlReadOnlyEx(R,t.popFreeHelperProp.ReadOnlys)}),t.popFreeHelperProp.doEvent("open")},360)},b=async H=>{var he,z,Ie,Ne,xe,Le,ve,Ge,_e,$e,Ke,X,pe,r,i,n,c,d;const oe={sender:h,dialogResult:"ok",dialogColseType:"buttonClick",dataModel:(he=t.popFreeHelperProp)==null?void 0:he.DataModel,formHelper:t.popFreeHelperProp};if(!((z=t.popFreeHelperProp)!=null&&z.OkButtonPreventDefault)){if(((Ie=t.popFreeHelperProp)==null?void 0:Ie.OkButtonService.trim().length)>0&&((Ne=t.popFreeHelperProp)==null?void 0:Ne.EditType)==="Modify"&&!t.popFreeHelperProp.DataTable.hasChanges()){s.messageInfo(s.$t("ERX.NoChangeMessage")||"数据未做任何修改,不需要保存操作!");return}if(!await s.checkRequiredInput(x))return;if(((xe=t.popFreeHelperProp)==null?void 0:xe.OkButtonService.trim().length)>0){var R=new ut.EiInfo,K=s.convertModelAsBlock(t.popFreeHelperProp.DataModel,t.popFreeHelperProp.ExtendJsonData);if(((Le=t.popFreeHelperProp)==null?void 0:Le.EditType)==="Modify"?(ve=t.popFreeHelperProp)!=null&&ve.TableName&&((Ge=t.popFreeHelperProp)==null?void 0:Ge.TableName.trim().length)>0?K.rename(((_e=t.popFreeHelperProp)==null?void 0:_e.TableName.trim())+"_MODIFY"):f&&f.TABLE_NAME&&f.TABLE_NAME.trim().length>0&&K.rename(f.TABLE_NAME.trim()+"_MODIFY"):((Ke=($e=t.popFreeHelperProp)==null?void 0:$e.TableName)==null?void 0:Ke.trim().length)>0?K.rename(((X=t.popFreeHelperProp)==null?void 0:X.TableName.trim())+"_ADD"):((pe=f.TABLE_NAME)==null?void 0:pe.trim().length)>0&&K.rename(f.TABLE_NAME.trim()+"_ADD"),R.addBlock(K),(r=t.popFreeHelperProp)!=null&&r.BeforeCallService&&(R=t.popFreeHelperProp.BeforeCallService(R)),!await s.messageConfirm(""))return;const p=await s.callService((i=t.popFreeHelperProp)==null?void 0:i.OkButtonService.trim(),R);if(p.getStatus()<0){s.messageError(p.getMsg());return}else u=!0,s.messageInfo(F.ER.Core.$t("ERX.OperateSuccess")||"操作成功!")}}oe.dataModel=(n=t.popFreeHelperProp)==null?void 0:n.DataModel,oe.isModified=((c=oe.dataModel)==null?void 0:c.dirty)||u,(d=t.popFreeHelperProp)==null||d.setDialogReturnInfo(oe),t.popFreeHelperProp.doEvent("ok",oe),o("OkClick",oe),t.popFreeHelperProp.CloseDialogWhenOkClick&&t.popFreeHelperProp.CloseDialog()},P=()=>{var oe,R,K;const H={sender:h,dialogResult:"cancel",dialogColseType:"buttonClick",dataModel:(oe=t.popFreeHelperProp)==null?void 0:oe.DataModel,formHelper:t.popFreeHelperProp};(R=t.popFreeHelperProp)==null||R.setDialogReturnInfo(H),t.popFreeHelperProp.doEvent("cancel",H),o("CancelClick",H),(K=t.popFreeHelperProp)!=null&&K.CancelButtonPreventDefault||t.popFreeHelperProp.CloseDialog()},Ee=()=>{var oe,R;const H={sender:h,dialogResult:"none",dialogColseType:"iconClick",dataModel:(oe=t.popFreeHelperProp)==null?void 0:oe.DataModel,formHelper:t.popFreeHelperProp};(R=t.popFreeHelperProp)==null||R.setDialogReturnInfo(H),t.popFreeHelperProp.CloseDialog(),o("Closed",H)};return(()=>{if(x=Object.keys(t.popFreeHelperProp.LayoutGroupInfo),(x==null?void 0:x.length)>0){f=t.popFreeHelperProp.LayoutGroupInfo[x[0]];for(let H=0;H<x.length;H++){const oe=t.popFreeHelperProp.LayoutGroupInfo[x[H]];f.DATASET_NAME!==oe.DATASET_NAME||f.TABLE_NAME!==oe.TABLE_NAME?(t.popFreeHelperProp.FormHelper.messageError("Different binding datatables!"),T[x[H]]=0):(T[x[H]]=1,S[x[H]]=oe.CAPTION)}}C.value=x.length>1})(),l.onMounted(()=>{t.popFreeHelperProp.doEvent("initial")}),(H,oe)=>(l.openBlock(),l.createBlock(Oa,{ref_key:"dialogRef",ref:h,visible:t.popFreeHelperProp.WindowOpened.value,"onUpdate:visible":oe[0]||(oe[0]=R=>t.popFreeHelperProp.WindowOpened.value=R),title:t.popFreeHelperProp.getFormOption("title"),height:t.formHeight>0?t.formHeight+"px":void 0,width:t.formWidth>0?t.formWidth+"px":void 0,"default-footer":!0,"show-confirm":!1,"show-cancel":!1,"destroy-on-close":t.popFreeHelperProp.UnMountWhenCloseDialog,resizable:t.popFreeHelperProp.BordStyle==="Sizable",actions:t.popFreeHelperProp.BordStyle==="Fixed"?["close"]:void 0,onOpen:te,onCancel:P,onConfirm:b,onClickCloseIcon:Ee},{"footer-left":l.withCtx(()=>[t.popFreeHelperProp.EditType!=="Query"&&t.popFreeHelperProp.ShowOkButton?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:b},l.toDisplayString(t.popFreeHelperProp.OkButtonCaption||l.unref(F.ER).Core.$t("ERX.Confirm")||"确定"),1)):l.createCommentVNode("",!0),t.popFreeHelperProp.ShowCancelButton?(l.openBlock(),l.createElementBlock("button",{key:1,class:"xr-er-button",onClick:P},l.toDisplayString(t.popFreeHelperProp.CancelButtonCaption||l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.unref(s).InitializeFlag>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(l.unref(x),(R,K)=>(l.openBlock(),l.createElementBlock("div",null,[T[R]?(l.openBlock(),l.createElementBlock("div",$5,[l.createVNode(Qi,{"config-id":R,"config-caption":S[R],"er-form-helper-prop":l.unref(s),"auto-bind":!0,"allow-collapse":C.value,"show-group-border":t.popFreeHelperProp.getFormOption("showGroupBorder")||l.unref(x).length>1,options:t.popFreeHelperProp.getFormOption("options"),onConfigUpdate:y,onValueChanged:O,onItemButtonClick:D,onPressEnter:I,onFocus:M,onBlur:G},null,8,["config-id","config-caption","er-form-helper-prop","allow-collapse","show-group-border","options"])])):l.createCommentVNode("",!0)]))),256)):l.createCommentVNode("",!0)]),_:1},8,["visible","title","height","width","destroy-on-close","resizable","actions"]))}}),Y5=Object.freeze(Object.defineProperty({__proto__:null,default:bo},Symbol.toStringTag,{value:"Module"})),X5={style:{display:"flex",height:"100%",width:"100%","flex-direction":"column",padding:"5px"}},Q5=l.defineComponent({name:"er-pop-rich-editor",components:{ErDialog:Oa,ErSelect:ba,Input:et.Input,InputPassword:et.InputPassword,InputNumber:et.InputNumber,Textarea:et.Textarea}}),Ro=l.defineComponent({...Q5,props:{popRichEditorProps:{type:F.ER.PopRichEditor,default:null,require:!0},options:{type:Object,default:{},require:!1},content:{type:String,default:"",require:!1}},setup(e){const a=e,t=l.ref(null),o=l.ref(a.content),s=l.ref(null),f=x=>{a.popRichEditorProps.doEvent("open")},u=async x=>{var D,I;if(C()===!1)return;o.value&&((I=(D=a.options)==null?void 0:D.extension)==null?void 0:I.toLowerCase())==="json"&&(a.popRichEditorProps.Content=JSON.stringify(JSON.parse(o.value)));const O=a.popRichEditorProps.getEvent("ok");O&&await O()===!1||a.popRichEditorProps.CloseDialogWhenOkClick&&a.popRichEditorProps.close()},h=()=>{C()},C=()=>{var x,y,O,D,I,M;try{o.value&&(((y=(x=a.options)==null?void 0:x.extension)==null?void 0:y.toLowerCase())==="sql"?o.value=Ho.format(o.value):(((D=(O=a.options)==null?void 0:O.extension)==null?void 0:D.toLowerCase())==="json"||((M=(I=a.options)==null?void 0:I.extension)==null?void 0:M.toLowerCase())==="javascript")&&(o.value=JSON.stringify(JSON.parse(o.value),null,2)))}catch(G){return F.ER.Core.messageError(G.message),!1}return!0},T=()=>{a.popRichEditorProps.close()};return(()=>{var x,y,O,D,I,M;((y=(x=a.options)==null?void 0:x.extension)==null?void 0:y.toLowerCase())==="sql"?t.value=[Dn.sql()]:((D=(O=a.options)==null?void 0:O.extension)==null?void 0:D.toLowerCase())==="json"?t.value=[Js.json()]:((M=(I=a.options)==null?void 0:I.extension)==null?void 0:M.toLowerCase())==="javascript"&&(t.value=[Ks.javascript()])})(),l.onMounted(()=>{o.value=a.content,C()}),(x,y)=>{var G,te;const O=l.resolveComponent("a-input"),D=l.resolveComponent("a-input-password"),I=l.resolveComponent("a-input-number"),M=l.resolveComponent("a-textarea");return l.openBlock(),l.createBlock(Oa,{ref_key:"dialogRef",ref:s,visible:a.popRichEditorProps.WindowOpened.value,"onUpdate:visible":y[6]||(y[6]=b=>a.popRichEditorProps.WindowOpened.value=b),title:a.options.title,height:a.options.height||(["text","password","number","dropdown"].includes((G=a.options.extension)==null?void 0:G.toLowerCase())?120:630),width:a.options.width||(["text","password","number","dropdown"].includes((te=a.options.extension)==null?void 0:te.toLowerCase())?310:360),"default-footer":!0,"show-confirm":!1,"show-cancel":!1,resizable:a.popRichEditorProps.BordStyle==="Sizable",actions:a.popRichEditorProps.BordStyle==="Fixed"?["close"]:void 0,onOpen:f,onClickCloseIcon:T},{"footer-left":l.withCtx(()=>{var b,P,Ee;return[((b=a.options.extension)==null?void 0:b.toLowerCase())==="sql"||((P=a.options.extension)==null?void 0:P.toLowerCase())==="javascript"||((Ee=a.options.extension)==null?void 0:Ee.toLowerCase())==="json"?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:h},l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Format")||"格式化"),1)):l.createCommentVNode("",!0),l.createElementVNode("button",{class:"xr-er-button",onClick:u},l.toDisplayString(a.popRichEditorProps.OkButtonCaption||l.unref(F.ER).Core.$t("ERX.Confirm")||"确认"),1),l.createElementVNode("button",{class:"xr-er-button",onClick:T},l.toDisplayString(a.popRichEditorProps.CancelButtonCaption||l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)]}),default:l.withCtx(()=>{var b,P,Ee,fe,H,oe,R,K,he,z,Ie,Ne;return[l.createElementVNode("div",X5,[((b=a.options.extension)==null?void 0:b.toLowerCase())==="sql"||((P=a.options.extension)==null?void 0:P.toLowerCase())==="javascript"||((Ee=a.options.extension)==null?void 0:Ee.toLowerCase())==="json"?(l.openBlock(),l.createBlock(l.unref(qi.Codemirror),{key:0,modelValue:o.value,"onUpdate:modelValue":y[0]||(y[0]=xe=>o.value=xe),"indent-with-tab":!0,tabSize:2,extensions:t.value,style:{width:"100%",height:"100%"}},null,8,["modelValue","extensions"])):((fe=a.options.extension)==null?void 0:fe.toLowerCase())==="text"?(l.openBlock(),l.createBlock(O,{key:1,value:o.value,"onUpdate:value":y[1]||(y[1]=xe=>o.value=xe),style:{width:"100%"},"allow-clear":!0},null,8,["value"])):((H=a.options.extension)==null?void 0:H.toLowerCase())==="password"?(l.openBlock(),l.createBlock(D,{key:2,value:o.value,"onUpdate:value":y[2]||(y[2]=xe=>o.value=xe),style:{width:"100%"}},null,8,["value"])):((oe=a.options.extension)==null?void 0:oe.toLowerCase())==="number"?(l.openBlock(),l.createBlock(I,{key:3,value:o.value,"onUpdate:value":y[3]||(y[3]=xe=>o.value=xe),style:{width:"100%"},"allow-clear":!0},null,8,["value"])):((R=a.options.extension)==null?void 0:R.toLowerCase())==="dropdown"?(l.openBlock(),l.createBlock(ba,{key:4,modelValue:o.value,"onUpdate:modelValue":y[4]||(y[4]=xe=>o.value=xe),"allow-clear":((K=a.options)==null?void 0:K.allowClear)??!0,readonly:((he=a.options)==null?void 0:he.readOnly)??!1,"data-source":((z=a.options)==null?void 0:z.dropdownDataSource)??[],columns:((Ie=a.options)==null?void 0:Ie.dropdownColumns)??[],options:((Ne=a.options)==null?void 0:Ne.dropdownOptions)??{},style:{width:"100%"}},null,8,["modelValue","allow-clear","readonly","data-source","columns","options"])):(l.openBlock(),l.createBlock(M,{key:5,value:o.value,"onUpdate:value":y[5]||(y[5]=xe=>o.value=xe),rows:a.options.rows||5,style:{width:"100%",height:"100%"},"allow-clear":!0},null,8,["value","rows"]))])]}),_:1},8,["visible","title","height","width","resizable","actions"])}}}),q5=Object.freeze(Object.defineProperty({__proto__:null,default:Ro},Symbol.toStringTag,{value:"Module"})),j5={style:{display:"flex",height:"100%","flex-direction":"column"}},K5={key:0},J5={style:{flex:"1"}},Z5=l.defineComponent({name:"ErPopQuery",components:{"er-dialog":Oa,"er-panel":Dr,"a-button":et.Button}}),No=l.defineComponent({...Z5,props:{popQueryHelperProp:{type:F.ER.PopQueryHelper,default:null,require:!0},formWidth:{type:Number,default:-1,require:!1},formHeight:{type:Number,default:-1,require:!1}},emits:["OkClick","CancelClick","Closed"],setup(e,{emit:a}){const t=e,o=a;let s;const f=l.ref(0),u=l.ref(!1),h=l.ref(100);let C=100;const T=l.ref(t.popQueryHelperProp.LayoutGroupFilterId),S=l.ref(t.popQueryHelperProp.MainViewConfigId),x=l.ref(t.popQueryHelperProp.DetailViewConfigId),y=l.ref(0),O=l.ref(1),D=l.ref(0),I=l.ref(F.ER.Core.$t("ERX.List")||"列表信息"),M=l.ref(F.ER.Core.$t("ERX.Details")||"明细信息");let G="明细信息",te;const b=l.ref(void 0),P=()=>{u.value=!u.value},Ee=()=>{h.value===100?h.value=C:(C=h.value,h.value=100)},fe=Le=>{const ve=t.popQueryHelperProp.getEvent("filterItemValueChanged");ve&&typeof ve=="function"&&(Le.erFormHelper=t.popQueryHelperProp.ErFormHelper,ve(Le))},H=Le=>{const ve=t.popQueryHelperProp.getEvent("filterItemButtonClick");ve&&typeof ve=="function"&&(Le.erFormHelper=t.popQueryHelperProp.ErFormHelper,ve(Le))},oe=async Le=>{if(Le&&Le.rowChanged&&D.value===1&&s.FormDataSet.hasRelation(G)&&!t.popQueryHelperProp.MasterDetailView){if(!t.popQueryHelperProp.ButtonPreventDefault.mainViewFocusChanged)if(Le.data){const r=Le.data;var ve="",Ge={};s.FormDataSet.relations[G].forEach(d=>{ve.trim().length>0&&(ve+=" and "),ve=ve+d.ChildColumn+" = '"+r[d.ParentColumn]+"'",Ge[d.ChildColumn]=r[d.ParentColumn]}),Ge.QUERY_TYPE=te;const i=F.ER.Core.buildEiBlock([Ge],"Table0");var _e=new ut.EiInfo;const n=s.getFormButtonConfigInfo("btnQuery");if(n.SVC_NAME&&n.SVC_NAME.trim().length>0){var $e=new ut.EiInfo;$e.addBlock(i),_e=await s.callService(n.SVC_NAME.trim(),$e)}else{var Ke=`select * from ${te} where ${ve}`;_e=await s.querySql("",Ke)}var X=_e.getBlock(te);X||(X=_e.getBlockByIndex(0)),s.mergeEiBlockToGrid(X,t.popQueryHelperProp.DetailViewConfigId),s.getGridDataCount(t.popQueryHelperProp.DetailViewConfigId)===0&&t.popQueryHelperProp.ShowQueryNoDetailInfoMsg===!0&&s.messageWarning("未查到明细数据!")}else s.clearGridData(t.popQueryHelperProp.DetailViewConfigId);const pe=t.popQueryHelperProp.getEvent("mainViewFocusChanged");pe==null||pe.call(pe,Le)}},R=Le=>{var ve,Ge;t.popQueryHelperProp.AutoRefresh&&(t.popQueryHelperProp.ErFormHelper.setAllControlDefalutValue(T.value),t.popQueryHelperProp.ErFormHelper.setControlValueEx(T.value,(ve=t.popQueryHelperProp.DefaultValues)==null?void 0:ve.values),t.popQueryHelperProp.ErFormHelper.setControlReadOnlyEx(T.value,(Ge=t.popQueryHelperProp.DefaultValues)==null?void 0:Ge.readonly),t.popQueryHelperProp.ErFormHelper.clearGridData(S.value,x.value),t.popQueryHelperProp.ShowCheckBoxColumn===!1&&t.popQueryHelperProp.ErFormHelper.showOrHideGridCheckColumn(S.value,"hide")),setTimeout(()=>{var _e;((_e=t.popQueryHelperProp.ReceiveJsonData)==null?void 0:_e.length)>0?t.popQueryHelperProp.ErFormHelper.mergeDataToGrid(t.popQueryHelperProp.ReceiveJsonData,S.value):t.popQueryHelperProp.AutoQuery&&K()},250),t.popQueryHelperProp.doEvent("open")},K=async()=>{if(t.popQueryHelperProp.doEvent("beforeQuery")===!1)return;await s.checkRequiredInput(t.popQueryHelperProp.LayoutGroupFilterId)&&t.popQueryHelperProp.queryMainGridInfo()},he=()=>{var Ke,X;let Le={sender:void 0,formHelper:t.popQueryHelperProp,context:t.popQueryHelperProp.Context,modelId:t.popQueryHelperProp.DataModelId,dialogResult:"ok"};if(!t.popQueryHelperProp.ButtonPreventDefault.ok){const pe=s.getGridSelectRows(S.value);if(pe.length===0){s.messageWarning(F.ER.Core.$t("ERX.SelectRowsMessage")||"请选择记录!");return}else if(t.popQueryHelperProp.SelectMode==="single"&&pe.length>1){s.messageWarning(F.ER.Core.$t("ERX.SelectSingleRowMessage")||"只能选择一条记录!");return}var ve="",Ge=s.getFormButtonConfigInfo("btnOk");Object.keys(Ge).length>0&&(ve=Ge.GROUP_KEY_VALUE.trim());var _e=s.getGridSelectRowsAsBlock(S.value);if(_e.getMappedRows().length>1&&ve.length>0){const c=ve.split(",");for(let d=1;d<_e.getMappedRows().length;d++)for(let p=0;p<c.length;p++)if(_e.getColumn(c[p])&&_e.getMappedRows()[d][c[p]]!==_e.getMappedRows()[0][c[p]]){const m=s.getGridColumn(S.value,c[p]).title;s.messageWarning("所选记录中["+m+"]->["+((Ke=_e.getMappedRows()[d][c[p]])==null?void 0:Ke.toString())+"]与["+((X=_e.getMappedRows()[0][c[p]])==null?void 0:X.toString())+"]不相同!");return}}let r="",i="";(t.popQueryHelperProp.KeyFieldName.trim().length>0&&pe[0][t.popQueryHelperProp.KeyFieldName]||t.popQueryHelperProp.DescFieldName.trim().length>0&&pe[0][t.popQueryHelperProp.DescFieldName])&&pe.forEach(c=>{t.popQueryHelperProp.KeyFieldName.trim().length>0&&pe[0][t.popQueryHelperProp.KeyFieldName]&&(r.trim().length===0?r=c[t.popQueryHelperProp.KeyFieldName]:r=r+","+c[t.popQueryHelperProp.KeyFieldName]),t.popQueryHelperProp.DescFieldName.trim().length>0&&pe[0][t.popQueryHelperProp.DescFieldName]&&(i.trim().length===0?i=c[t.popQueryHelperProp.DescFieldName]:i=i+","+c[t.popQueryHelperProp.DescFieldName])}),Le={sender:void 0,formHelper:t.popQueryHelperProp,context:t.popQueryHelperProp.Context,modelId:t.popQueryHelperProp.DataModelId,dialogResult:"ok",dialogColseType:"buttonClick",checkedItem:pe[0],checkedItemArray:pe,checkedCodes:r,checkedDescs:i},t.popQueryHelperProp.setDialogReturnInfo(Le);const n=F.ER.SysGlobalVariables.getVariable(s.FormName,"ParentFormName");if(F.ER.Core.toString(n).length>0){const c=s.getGridSelectRows(S.value,!0);c&&F.ER.SysGlobalVariables.setVariable(n,"ReturnRow",c)}}const $e=t.popQueryHelperProp.getEvent("ok");$e==null||$e.call($e,Le),o("OkClick",Le),t.popQueryHelperProp.CloseDialogWhenOkClick&&t.popQueryHelperProp.CloseDialog()},z=()=>{const Le={formHelper:t.popQueryHelperProp,context:t.popQueryHelperProp.Context,modelId:t.popQueryHelperProp.DataModelId,dialogResult:"cancel",dialogColseType:"buttonClick"},ve=t.popQueryHelperProp.getEvent("cancel");ve&&ve instanceof Function?(ve(Le),o("CancelClick",Le)):t.popQueryHelperProp.ButtonPreventDefault.cancel||(t.popQueryHelperProp.setDialogReturnInfo(Le),o("CancelClick",Le),t.popQueryHelperProp.CloseDialog())},Ie=()=>{const Le={formHelper:t.popQueryHelperProp,context:t.popQueryHelperProp.Context,modelId:t.popQueryHelperProp.DataModelId,dialogResult:"cancel",dialogColseType:"iconClick"};t.popQueryHelperProp.setDialogReturnInfo(Le),t.popQueryHelperProp.doEvent("close",Le),t.popQueryHelperProp.CloseDialog(),o("Closed",Le)},Ne=()=>{if(t.popQueryHelperProp){s=t.popQueryHelperProp.ErFormHelper,s.containsConfig(t.popQueryHelperProp.LayoutGroupFilterId)&&(y.value=1);const Le=s.getSingleViewConfigInfo(t.popQueryHelperProp.MainViewConfigId);Le&&Object.keys(Le).length>0?(O.value=1,Le.FUNCNAME.trim().length>0&&(I.value=Le.FUNCNAME.trim())):O.value=0;const ve=s.getSingleViewConfigInfo(t.popQueryHelperProp.DetailViewConfigId);ve&&Object.keys(ve).length>0?(te=ve.TABLE_NAME,ve.FUNCNAME.trim().length>0&&(M.value=ve.FUNCNAME.trim()),ve.RELATION_NAME.trim().length>0&&(G=ve.RELATION_NAME.trim()),D.value=1,h.value=t.popQueryHelperProp.MasterDetailView?100:50,C=h.value):D.value=0,f.value=1}},xe=Le=>{he()};return Ne(),l.onMounted(()=>{t.popQueryHelperProp.AutoRefresh||l.nextTick(()=>{var Le,ve;t.popQueryHelperProp.ErFormHelper.setAllControlDefalutValue(T.value),t.popQueryHelperProp.ErFormHelper.setControlValueEx(T.value,(Le=t.popQueryHelperProp.DefaultValues)==null?void 0:Le.values),t.popQueryHelperProp.ErFormHelper.setControlReadOnlyEx(T.value,(ve=t.popQueryHelperProp.DefaultValues)==null?void 0:ve.readonly)})}),(Le,ve)=>{const Ge=l.resolveComponent("a-button");return l.openBlock(),l.createBlock(Oa,{ref:"modalRef",visible:t.popQueryHelperProp.WindowOpened.value,"onUpdate:visible":ve[1]||(ve[1]=_e=>t.popQueryHelperProp.WindowOpened.value=_e),title:t.popQueryHelperProp.getFormOption("title"),height:t.formHeight>0?t.formHeight+"px":void 0,width:t.formWidth>0?t.formWidth+"px":void 0,"default-footer":!0,"show-confirm":!1,"show-cancel":!1,"destroy-on-close":t.popQueryHelperProp.UnMountWhenCloseDialog,resizable:t.popQueryHelperProp.BordStyle==="Sizable",actions:t.popQueryHelperProp.BordStyle==="Fixed"?["close"]:void 0,onOpen:R,onCancel:z,onConfirm:he,onClickCloseIcon:Ie},{"footer-left":l.withCtx(()=>[t.popQueryHelperProp.ShowQueryButton&&!t.popQueryHelperProp.ReceiveJsonData?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:K},l.toDisplayString(t.popQueryHelperProp.QueryButtonCaption||l.unref(F.ER).Core.$t("ERX.Query")||"查询"),1)):l.createCommentVNode("",!0),t.popQueryHelperProp.ShowOkButton?(l.openBlock(),l.createElementBlock("button",{key:1,class:"xr-er-button",onClick:he},l.toDisplayString(t.popQueryHelperProp.OkButtonCaption||l.unref(F.ER).Core.$t("ERX.Confirm")||"确认"),1)):l.createCommentVNode("",!0),t.popQueryHelperProp.ShowCancelButton?(l.openBlock(),l.createElementBlock("button",{key:2,class:"xr-er-button",onClick:z},l.toDisplayString(t.popQueryHelperProp.CancelButtonCaption||l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>{var _e;return[l.createElementVNode("div",j5,[f.value===1?(l.openBlock(),l.createElementBlock("div",K5,[y.value===1?(l.openBlock(),l.createBlock(Qi,{key:0,"er-form-helper-prop":l.unref(s),"config-id":T.value,"allow-collapse":!0,options:(_e=t.popQueryHelperProp)==null?void 0:_e.LayoutFilterOptions,onButtonClick:H,onItemButtonClick:H,onValueChanged:fe},null,8,["er-form-helper-prop","config-id","options"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",J5,[l.createVNode(l.unref(Ia.Splitpanes),{horizontal:!u.value,onResize:ve[0]||(ve[0]=$e=>h.value=$e[0].size)},{default:l.withCtx(()=>[l.createVNode(l.unref(Ia.Pane),{size:h.value},{default:l.withCtx(()=>[f.value===1?(l.openBlock(),l.createBlock(Dr,{key:0,title:I.value,"open-header-show":!1,style:{height:"100%"}},{customButtonSlot:l.withCtx(()=>[h.value<100?(l.openBlock(),l.createBlock(Ge,{key:0,type:"primary",style:{height:"20px",padding:"0px 5px",margin:"1px","font-size":"12px"},onClick:P},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(u.value?l.unref(F.ER).Core.$t("ERX.Vertical")||"上下显示":l.unref(F.ER).Core.$t("ERX.Horizontal")||"左右显示"),1)]),_:1})):l.createCommentVNode("",!0),D.value&&!t.popQueryHelperProp.MasterDetailView?(l.openBlock(),l.createBlock(Ge,{key:1,type:"primary",style:{height:"20px",padding:"0px 5px",margin:"1px","font-size":"12px"},onClick:Ee},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.value===100?l.unref(F.ER).Core.$t("ERX.ShowDetails")||"显示明细":l.unref(F.ER).Core.$t("ERX.HideDetails")||"隐藏明细"),1)]),_:1})):l.createCommentVNode("",!0)]),contentSlot:l.withCtx(()=>{var $e;return[l.createVNode(ur,{"config-id":S.value,"detail-config-id":x.value,"detail-options":{service:t.popQueryHelperProp.FormConfigQueryService},"er-form-helper-prop":l.unref(s),"page-options":b.value,options:($e=t.popQueryHelperProp)==null?void 0:$e.MainViewOptions,onFocusChanged:oe,onDoubleClick:xe},null,8,["config-id","detail-config-id","detail-options","er-form-helper-prop","page-options","options"])]}),_:1},8,["title"])):l.createCommentVNode("",!0)]),_:1},8,["size"]),D.value&&!t.popQueryHelperProp.MasterDetailView?(l.openBlock(),l.createBlock(l.unref(Ia.Pane),{key:0,size:100-h.value},{default:l.withCtx(()=>[l.createVNode(Dr,{title:M.value,"open-header-show":!1,style:{height:"100%"}},{contentSlot:l.withCtx(()=>{var $e;return[l.createVNode(ur,{"config-id":x.value,"er-form-helper-prop":l.unref(s),options:($e=t.popQueryHelperProp)==null?void 0:$e.DetailViewOptions},null,8,["config-id","er-form-helper-prop","options"])]}),_:1},8,["title"])]),_:1},8,["size"])):l.createCommentVNode("",!0)]),_:1},8,["horizontal"])])])]}),_:1},8,["visible","title","height","width","destroy-on-close","resizable","actions"])}}}),ep=Object.freeze(Object.defineProperty({__proto__:null,default:No},Symbol.toStringTag,{value:"Module"})),tp=l.defineComponent({name:"ErPopTree",components:{ErDialog:Oa,ErPanel:Dr}}),Lo=l.defineComponent({...tp,props:{popTreeHelperProp:{type:F.ER.PopTreeHelper,default:null,require:!0}},emits:["OkClick","CancelClick","Closed"],setup(e,{emit:a}){var M;const t=e,o=a,s=l.ref(zt());window.$wujie&&((M=window.$wujie.bus)==null||M.$on("changeThemeEmit",G=>{s.value=zt()}));const f=l.ref(null);let u,h=[],C;const T=async G=>{u=G.api,u.addEventListener("selectionChanged",te=>{const b=te.api.getSelectedRows();(b==null?void 0:b.length)>0?C=b[0]:C=void 0}),t.popTreeHelperProp.TreeOrgialData instanceof Function?(h=await t.popTreeHelperProp.TreeOrgialData(),u.setTreeData(h)):t.popTreeHelperProp.TreeOrgialData instanceof Array&&(h=t.popTreeHelperProp.TreeOrgialData,u.setTreeData(h))},S=G=>{const{orgHierarchy:te,...b}=G.node.data,P=[];return P.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Refresh")||"Refresh",action:async()=>{t.popTreeHelperProp.TreeOrgialData instanceof Function&&(h=await t.popTreeHelperProp.TreeOrgialData(),u.setTreeData(h,C==null?void 0:C[t.popTreeHelperProp.PrimaryField]))},icon:F.ER.Core.createErIconElement("refresh"),disabled:!1}),P.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ExpandAll")||"Expand All",action:()=>{u.expandAll()},icon:F.ER.Core.createErIconElement("expand-all"),disabled:!1}),P.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.CollapseAll")||"Collapse All",action:()=>{u.collapseAll()},icon:F.ER.Core.createErIconElement("collapse-all"),disabled:!1}),P},x=async()=>{t.popTreeHelperProp.AutoRefresh&&u&&t.popTreeHelperProp.TreeOrgialData instanceof Function&&(h=await t.popTreeHelperProp.TreeOrgialData(),u.setTreeData(h))},y=async()=>{const G=t.popTreeHelperProp.getOptions("doubleClick");if(G&&G instanceof Function){const te=u.getSelectedNodes(),b={api:u,node:te[0],data:h};await G(b)&&I()}else O()},O=()=>{const G=u.getSelectedNodes();if(G.length===0)return!1;let te=G[0].data;if(t.popTreeHelperProp.BeforeOkButtonClick&&(te=t.popTreeHelperProp.BeforeOkButtonClick(te),!te))return!1;const b={sender:f,formHelper:t.popTreeHelperProp,context:t.popTreeHelperProp.Context,data:te,dialogResult:"ok",dialogColseType:"buttonClick",checkedItem:te,checkedItemArray:[te]};return t.popTreeHelperProp.setDialogReturnInfo(b),t.popTreeHelperProp.doEvent("ok",b),t.popTreeHelperProp.close(),o("OkClick",b),!0},D=()=>{const G={sender:f,formHelper:t.popTreeHelperProp,context:t.popTreeHelperProp.Context,dialogResult:"cancel",dialogColseType:"buttonClick"},te=t.popTreeHelperProp.getEvent("cancel");te&&te instanceof Function?(te(G),o("CancelClick",G)):t.popTreeHelperProp.CancelButtonPreventDefault||(t.popTreeHelperProp.setDialogReturnInfo(G),o("CancelClick",G),t.popTreeHelperProp.close()),t.popTreeHelperProp.close(),o("CancelClick",G)},I=()=>{var te;const G={sender:f,dialogResult:"cancel",dialogColseType:"iconClick",formHelper:t.popTreeHelperProp,context:t.popTreeHelperProp.Context};t.popTreeHelperProp.doEvent("close",G),t.popTreeHelperProp.close(),(te=t.popTreeHelperProp)==null||te.setDialogReturnInfo(G),o("Closed",G)};return l.onMounted(()=>{}),(G,te)=>(l.openBlock(),l.createBlock(Oa,{ref_key:"dialogRef",ref:f,visible:t.popTreeHelperProp.WindowOpened.value,"onUpdate:visible":te[0]||(te[0]=b=>t.popTreeHelperProp.WindowOpened.value=b),title:t.popTreeHelperProp.getOptions("title"),height:t.popTreeHelperProp.getOptions("height")+"px",width:t.popTreeHelperProp.getOptions("width")+"px","default-footer":t.popTreeHelperProp.ShowCancelButton||t.popTreeHelperProp.ShowOkButton,resizable:t.popTreeHelperProp.BordStyle==="Sizable",actions:t.popTreeHelperProp.BordStyle==="Fixed"?["close"]:void 0,"destroy-on-close":t.popTreeHelperProp.UnMountWhenCloseDialog,"show-confirm":!1,"show-cancel":!1,onOpen:x,onCancel:D,onConfirm:O,onClickCloseIcon:I},{"footer-left":l.withCtx(()=>[t.popTreeHelperProp.ShowOkButton?(l.openBlock(),l.createElementBlock("button",{key:0,class:"xr-er-button",onClick:O},l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Confirm")||"确定"),1)):l.createCommentVNode("",!0),t.popTreeHelperProp.ShowCancelButton?(l.openBlock(),l.createElementBlock("button",{key:1,class:"xr-er-button",onClick:D},l.toDisplayString(l.unref(F.ER).Core.$t("ERX.Cancel")||"取消"),1)):l.createCommentVNode("",!0)]),default:l.withCtx(()=>[l.createVNode(Dr,{"show-header":!1,style:{height:"100%"}},{contentSlot:l.withCtx(()=>[l.createVNode(In,{primaryField:t.popTreeHelperProp.PrimaryField,parentField:t.popTreeHelperProp.ParentField,displayField:t.popTreeHelperProp.DisplayField,groupDefaultExpanded:t.popTreeHelperProp.getOptions("groupDefaultExpanded"),nodeRenderer:t.popTreeHelperProp.getOptions("nodeRenderer"),getContextMenu:S,getNodeIconComponent:t.popTreeHelperProp.getOptions("getNodeIconComponent"),options:t.popTreeHelperProp.getOptions(),onErTreeReady:T,onDoubleClick:y},null,8,["primaryField","parentField","displayField","groupDefaultExpanded","nodeRenderer","getNodeIconComponent","options"])]),_:1})]),_:1},8,["visible","title","height","width","default-footer","resizable","actions","destroy-on-close"]))}}),rp=Object.freeze(Object.defineProperty({__proto__:null,default:Lo},Symbol.toStringTag,{value:"Module"})),ap={id:"4511508",name:"BS-ER",font_family:"iconfont",css_prefix_text:"icon-",description:"",glyphs:JSON.parse('[{"icon_id":"8019715","name":"style-edit","font_class":"style-edit","unicode":"e6d8","unicode_decimal":59096},{"icon_id":"42561371","name":"style","font_class":"style","unicode":"e61f","unicode_decimal":58911},{"icon_id":"43003013","name":"prefix","font_class":"prefix","unicode":"e79f","unicode_decimal":59295},{"icon_id":"44063238","name":"filter-sort","font_class":"filter-sort","unicode":"e9ed","unicode_decimal":59885},{"icon_id":"6151117","name":"lock","font_class":"lock","unicode":"e7b9","unicode_decimal":59321},{"icon_id":"6783246","name":"private","font_class":"private","unicode":"e783","unicode_decimal":59267},{"icon_id":"6925466","name":"default","font_class":"default","unicode":"e627","unicode_decimal":58919},{"icon_id":"7213104","name":"share","font_class":"share","unicode":"e674","unicode_decimal":58996},{"icon_id":"10071665","name":"unlock","font_class":"unlock","unicode":"e61c","unicode_decimal":58908},{"icon_id":"25572430","name":"public","font_class":"public","unicode":"e82d","unicode_decimal":59437},{"icon_id":"6404480","name":"un-search","font_class":"un-search","unicode":"e68d","unicode_decimal":59021},{"icon_id":"11520426","name":"filter","font_class":"filter","unicode":"e75e","unicode_decimal":59230},{"icon_id":"40625731","name":"group-sum","font_class":"group-sum","unicode":"e6ab","unicode_decimal":59051},{"icon_id":"42800349","name":"group","font_class":"group","unicode":"e812","unicode_decimal":59410},{"icon_id":"42902813","name":"un-filter","font_class":"un-filter","unicode":"e737","unicode_decimal":59191},{"icon_id":"1069446","name":"edit-title","font_class":"edit-title","unicode":"e695","unicode_decimal":59029},{"icon_id":"1069447","name":"title","font_class":"title","unicode":"e696","unicode_decimal":59030},{"icon_id":"1172709","name":"send-msg","font_class":"send-msg","unicode":"e643","unicode_decimal":58947},{"icon_id":"6712617","name":"interface","font_class":"interface","unicode":"e6c5","unicode_decimal":59077},{"icon_id":"18671025","name":"receive-msg","font_class":"receive-msg","unicode":"e7ac","unicode_decimal":59308},{"icon_id":"23887325","name":"interface-1","font_class":"interface-1","unicode":"e61d","unicode_decimal":58909},{"icon_id":"32911894","name":"receive-msg-1","font_class":"receive-msg-1","unicode":"ed45","unicode_decimal":60741},{"icon_id":"5515125","name":"halign","font_class":"halign","unicode":"e624","unicode_decimal":58916},{"icon_id":"12550438","name":"halign-left","font_class":"halign-left","unicode":"e62d","unicode_decimal":58925},{"icon_id":"12550440","name":"halign-center","font_class":"halign-center","unicode":"e62e","unicode_decimal":58926},{"icon_id":"12550442","name":"halign-right","font_class":"halign-right","unicode":"e62f","unicode_decimal":58927},{"icon_id":"11348936","name":"checkbox-1","font_class":"checkbox-1","unicode":"e619","unicode_decimal":58905},{"icon_id":"12695947","name":"column-width","font_class":"column-width","unicode":"e6f0","unicode_decimal":59120},{"icon_id":"28940242","name":"column-drag","font_class":"column-drag","unicode":"e644","unicode_decimal":58948},{"icon_id":"34581442","name":"disabled-users","font_class":"disabled-users","unicode":"e61b","unicode_decimal":58907},{"icon_id":"42601729","name":"all-column-width","font_class":"all-column-width","unicode":"e80b","unicode_decimal":59403},{"icon_id":"28661076","name":"table","font_class":"table","unicode":"e666","unicode_decimal":58982},{"icon_id":"1262","name":"add-user","font_class":"add-user","unicode":"e618","unicode_decimal":58904},{"icon_id":"639275","name":"delete-user","font_class":"delete-user","unicode":"e922","unicode_decimal":59682},{"icon_id":"10352243","name":"delete-column","font_class":"delete-column","unicode":"eb1c","unicode_decimal":60188},{"icon_id":"40395011","name":"add-column","font_class":"add-column","unicode":"147d4","unicode_decimal":83924},{"icon_id":"40395012","name":"insert-column","font_class":"insert-column","unicode":"147d5","unicode_decimal":83925},{"icon_id":"26419913","name":"filter-flag","font_class":"filter-flag","unicode":"1001a","unicode_decimal":65562},{"icon_id":"35000888","name":"sort-flag","font_class":"sort-flag","unicode":"e617","unicode_decimal":58903},{"icon_id":"4767096","name":"close","font_class":"close","unicode":"e7fd","unicode_decimal":59389},{"icon_id":"9230691","name":"compress","font_class":"compress","unicode":"e914","unicode_decimal":59668},{"icon_id":"9230692","name":"expend","font_class":"expend","unicode":"e915","unicode_decimal":59669},{"icon_id":"40253061","name":"show-detail","font_class":"show-detail","unicode":"e63c","unicode_decimal":58940},{"icon_id":"12600753","name":"json-options","font_class":"json-options","unicode":"e63b","unicode_decimal":58939},{"icon_id":"9872704","name":"connection","font_class":"connection","unicode":"e614","unicode_decimal":58900},{"icon_id":"2915849","name":"ebank-acceptance","font_class":"ebank-acceptance","unicode":"e62c","unicode_decimal":58924},{"icon_id":"3100413","name":"cash","font_class":"cash","unicode":"e6c4","unicode_decimal":59076},{"icon_id":"17199680","name":"business-acceptance","font_class":"business-acceptance","unicode":"e66f","unicode_decimal":58991},{"icon_id":"34650845","name":"bank-acceptance","font_class":"bank-acceptance","unicode":"e6bb","unicode_decimal":59067},{"icon_id":"40115656","name":"wire-transfer","font_class":"wire-transfer","unicode":"e869","unicode_decimal":59497},{"icon_id":"4942647","name":"disabled","font_class":"disabled","unicode":"e615","unicode_decimal":58901},{"icon_id":"12609225","name":"remove","font_class":"remove","unicode":"e612","unicode_decimal":58898},{"icon_id":"1446460","name":"copy","font_class":"copy","unicode":"e623","unicode_decimal":58915},{"icon_id":"7834103","name":"relation","font_class":"relation","unicode":"e671","unicode_decimal":58993},{"icon_id":"14006191","name":"relation-1","font_class":"relation-1","unicode":"e616","unicode_decimal":58902},{"icon_id":"25191282","name":"relation-2","font_class":"relation-2","unicode":"ea5c","unicode_decimal":59996},{"icon_id":"38564037","name":"relation-3","font_class":"relation-3","unicode":"e694","unicode_decimal":59028},{"icon_id":"929835","name":"star-red","font_class":"star-red","unicode":"e82c","unicode_decimal":59436},{"icon_id":"14342021","name":"star-red-border","font_class":"star-red-border","unicode":"e7c5","unicode_decimal":59333},{"icon_id":"8059414","name":"star-yellow","font_class":"star-yellow","unicode":"edf9","unicode_decimal":60921},{"icon_id":"8450597","name":"star-blue","font_class":"star-blue","unicode":"e61a","unicode_decimal":58906},{"icon_id":"6652504","name":"error","font_class":"error","unicode":"e6c6","unicode_decimal":59078},{"icon_id":"24935337","name":"information","font_class":"information","unicode":"e6b6","unicode_decimal":59062},{"icon_id":"26294289","name":"warning","font_class":"warning","unicode":"e6b9","unicode_decimal":59065},{"icon_id":"12550639","name":"add-relation","font_class":"add-relation","unicode":"e61e","unicode_decimal":58910},{"icon_id":"2276189","name":"start-task","font_class":"start-task","unicode":"e65b","unicode_decimal":58971},{"icon_id":"2276191","name":"delivery-1","font_class":"delivery-1","unicode":"e65c","unicode_decimal":58972},{"icon_id":"2276197","name":"delivery","font_class":"delivery","unicode":"e65d","unicode_decimal":58973},{"icon_id":"3406698","name":"reject-2","font_class":"reject-2","unicode":"e659","unicode_decimal":58969},{"icon_id":"7309037","name":"ok","font_class":"ok","unicode":"e622","unicode_decimal":58914},{"icon_id":"7586703","name":"product","font_class":"product","unicode":"e609","unicode_decimal":58889},{"icon_id":"7761643","name":"reject-1","font_class":"reject-1","unicode":"e60b","unicode_decimal":58891},{"icon_id":"8561472","name":"reject","font_class":"reject","unicode":"e712","unicode_decimal":59154},{"icon_id":"9534585","name":"approved-1","font_class":"approved-1","unicode":"e60c","unicode_decimal":58892},{"icon_id":"10086886","name":"approved","font_class":"approved","unicode":"e603","unicode_decimal":58883},{"icon_id":"10792645","name":"for-audit","font_class":"for-audit","unicode":"e6ee","unicode_decimal":59118},{"icon_id":"12712602","name":"submit-2","font_class":"submit-2","unicode":"e693","unicode_decimal":59027},{"icon_id":"13301840","name":"powerpoint-1","font_class":"powerpoint-1","unicode":"e60d","unicode_decimal":58893},{"icon_id":"13303936","name":"powerpoint","font_class":"powerpoint","unicode":"e67f","unicode_decimal":59007},{"icon_id":"15590801","name":"fingerprint","font_class":"fingerprint","unicode":"e711","unicode_decimal":59153},{"icon_id":"22612624","name":"statistics","font_class":"statistics","unicode":"e9e6","unicode_decimal":59878},{"icon_id":"23808358","name":"wait","font_class":"wait","unicode":"e82b","unicode_decimal":59435},{"icon_id":"35919699","name":"submit-1","font_class":"submit-1","unicode":"e60e","unicode_decimal":58894},{"icon_id":"40610339","name":"submit","font_class":"submit","unicode":"e611","unicode_decimal":58897},{"icon_id":"36856914","name":"red-light","font_class":"red-light","unicode":"e665","unicode_decimal":58981},{"icon_id":"36856913","name":"green-light","font_class":"green-light","unicode":"e660","unicode_decimal":58976},{"icon_id":"36856915","name":"yellow-light","font_class":"yellow-light","unicode":"e664","unicode_decimal":58980},{"icon_id":"3976401","name":"dev-system","font_class":"dev-system","unicode":"e620","unicode_decimal":58912},{"icon_id":"37704955","name":"real-system","font_class":"real-system","unicode":"e65e","unicode_decimal":58974},{"icon_id":"38343732","name":"pre-system","font_class":"pre-system","unicode":"e733","unicode_decimal":59187},{"icon_id":"25175371","name":"page-config","font_class":"page-config","unicode":"e64c","unicode_decimal":58956},{"icon_id":"4936974","name":"windows","font_class":"windows","unicode":"e880","unicode_decimal":59520},{"icon_id":"13206396","name":"code-set-ex","font_class":"code-set-ex","unicode":"e790","unicode_decimal":59280},{"icon_id":"21486288","name":"datasource-sql","font_class":"datasource-sql","unicode":"e62b","unicode_decimal":58923},{"icon_id":"27074139","name":"dataset","font_class":"dataset","unicode":"e602","unicode_decimal":58882},{"icon_id":"27441696","name":"code-set1","font_class":"code-set1","unicode":"e613","unicode_decimal":58899},{"icon_id":"37031406","name":"sequence-ex","font_class":"sequence-ex","unicode":"e606","unicode_decimal":58886},{"icon_id":"17417143","name":"reset","font_class":"reset","unicode":"e610","unicode_decimal":58896},{"icon_id":"25062396","name":"add-child-node","font_class":"add-child-node","unicode":"e607","unicode_decimal":58887},{"icon_id":"25062398","name":"add-node","font_class":"add-node","unicode":"e608","unicode_decimal":58888},{"icon_id":"36065661","name":"grid-band","font_class":"grid-band","unicode":"e629","unicode_decimal":58921},{"icon_id":"16758677","name":"collapse-all","font_class":"collapse-all","unicode":"f76d","unicode_decimal":63341},{"icon_id":"20358234","name":"expand-all","font_class":"expand-all","unicode":"eca5","unicode_decimal":60581},{"icon_id":"31513367","name":"apply-to","font_class":"apply-to","unicode":"e63f","unicode_decimal":58943},{"icon_id":"1731225","name":"modify","font_class":"modify","unicode":"e604","unicode_decimal":58884},{"icon_id":"2217118","name":"from-database","font_class":"from-database","unicode":"e642","unicode_decimal":58946},{"icon_id":"3421685","name":"layout","font_class":"layout","unicode":"e600","unicode_decimal":58880},{"icon_id":"4933554","name":"preview","font_class":"preview","unicode":"e638","unicode_decimal":58936},{"icon_id":"6371837","name":"delete","font_class":"delete","unicode":"e662","unicode_decimal":58978},{"icon_id":"7213038","name":"add-copy","font_class":"add-copy","unicode":"e663","unicode_decimal":58979},{"icon_id":"7215705","name":"add","font_class":"add","unicode":"e6e6","unicode_decimal":59110},{"icon_id":"8106275","name":"refresh","font_class":"refresh","unicode":"e6a2","unicode_decimal":59042},{"icon_id":"9491216","name":"add-tree","font_class":"add-tree","unicode":"e628","unicode_decimal":58920},{"icon_id":"11732308","name":"add-folder","font_class":"add-folder","unicode":"e83d","unicode_decimal":59453},{"icon_id":"11777905","name":"add-dataset","font_class":"add-dataset","unicode":"e6ad","unicode_decimal":59053},{"icon_id":"15266448","name":"code-set","font_class":"code-set","unicode":"e60a","unicode_decimal":58890},{"icon_id":"15605163","name":"add-page","font_class":"add-page","unicode":"e844","unicode_decimal":59460},{"icon_id":"16512112","name":"sequence","font_class":"sequence","unicode":"e673","unicode_decimal":58995},{"icon_id":"19300916","name":"add-sql","font_class":"add-sql","unicode":"e63a","unicode_decimal":58938},{"icon_id":"21027379","name":"search","font_class":"search","unicode":"e601","unicode_decimal":58881},{"icon_id":"24462791","name":"add-table","font_class":"add-table","unicode":"e79e","unicode_decimal":59294},{"icon_id":"26375267","name":"json-file","font_class":"json-file","unicode":"e621","unicode_decimal":58913},{"icon_id":"29975978","name":"import-json","font_class":"import-json","unicode":"e661","unicode_decimal":58977},{"icon_id":"37532663","name":"from-dataset","font_class":"from-dataset","unicode":"e605","unicode_decimal":58885},{"icon_id":"38825828","name":"copy-text","font_class":"copy-text","unicode":"e60f","unicode_decimal":58895},{"icon_id":"41872205","name":"add-grid","font_class":"add-grid","unicode":"e686","unicode_decimal":59014},{"icon_id":"702613","name":"google-translate","font_class":"google-translate","unicode":"e8b2","unicode_decimal":59570},{"icon_id":"39939291","name":"add-layout","font_class":"add-layout","unicode":"e67b","unicode_decimal":59003},{"icon_id":"39939292","name":"arrow-down","font_class":"arrow-down","unicode":"e67c","unicode_decimal":59004}]')},ip={style:{display:"grid","grid-template-columns":"1fr","grid-template-rows":"auto auto",gap:"5px"}},np={style:{display:"flex","flex-direction":"row-reverse"}},op={style:{padding:"5px 3px 5px 0px",height:"100%"}},lp={class:"content symbol"},sp={class:"icon_lists dib-box"},cp={class:"dib"},dp={class:"icon svg-icon","aria-hidden":"true"},fp=["xlink:href"],up={class:"name"},hp={class:"name"},pp={class:"code-name"},mp={style:{height:"100%",display:"flex","flex-direction":"column",overflow:"auto"}},gp={style:{flex:"1"}},Ep=l.defineComponent({name:"ErMenuDevPlat",components:{"a-badge":et.Badge,"a-popover":et.Popover,"a-tag":et.Tag,"a-tabs":et.Tabs,"a-input":et.Input,"a-tab-pane":et.TabPane,"a-tree":et.Tree,"a-config-providver":et.ConfigProvider,"er-grid":ur}}),Us=l.defineComponent({...Ep,props:{options:{type:Object,default:void 0,require:!1}},setup(e,{expose:a}){var ft;const t=e,o=l.ref(null),s=l.ref(null),f=l.ref(null),u=l.ref(0),h=l.ref(500),C=l.ref(!0),T=l.ref(!1),S=l.ref(!1),x=l.ref(!1),y=l.ref(!1),O=l.ref(!1),D=l.ref(!1),I=l.ref(!1),M=l.ref("GridColumns"),G=l.ref("gridView1_GridView"),te=l.ref(null),b=l.ref("Excute Result"),P=l.ref(!1),Ee=l.ref(""),fe=l.ref("");let H=null,oe=null,R=!0,K=[],he=-1;const z=l.ref(yr()),Ie=l.ref(zt());window.$wujie&&((ft=window.$wujie.bus)==null||ft.$on("changeThemeEmit",V=>{Ie.value=zt()}));const Ne=window.lang??{list:[]},xe=l.ref([]),Le=l.ref({}),ve=l.ref(""),Ge=l.ref("zh_Hans"),_e=l.ref(!0),$e=l.ref("");let Ke="",X="",pe="";const r="JAER01/queryDevConfig",i="JAER01/saveDevConfig",n=new F.ER.FormHelper,c=l.ref(0);let d=[],p,m,_,E="JAER01/query",v,A,B,Q,N,W,J,re,Se,ue,me;const Z=new F.ER.PopTreeHelper("CURRENT_NODE_CODE","PARENT_NODE_CODE","CURRENT_NODE_DESC",{title:"DataSet Config List",nodeRenderer:Ti}),Te=new F.ER.PopTreeHelper("CURRENT_NODE_CODE","PARENT_NODE_CODE","CURRENT_NODE_DESC",{title:"Form Config List",nodeRenderer:Ti});let ce;const ze=()=>{let V=F.ER.Core.getLangList();return Ne.list.length>0&&(V=V.filter(de=>Ne.list.includes(de.key))),V.map(de=>({CODE:de.key,CODE_DESC_1_CONTENT:de.value}))},Me=()=>{K=[],he=-1,R=!0},ge=()=>{le({name:"Find"})},le=async V=>{if((V==null?void 0:V.name)==="Close")R=!0,P.value=!1;else if(Ee.value.trim().length>0){if(R&&(he=-1,K=d.filter(de=>(de.MODULE_TYPE===p.MODULE_TYPE||p.CURRENT_NODE_CODE==="DEVTREE_ROOT")&&de.CURRENT_NODE_DESC.indexOf(Ee.value.trim())>-1)),(K==null?void 0:K.length)>0){if(n.hasDataChange()&&!await F.ER.Core.messageConfirm("The data has been changed, unsaved data will be lost if you continue?"))return;{const de=K[++he];fe.value=`${he+1}/${K.length}`,ce==null||ce.setRowNodeSelected(de.uid),_=de,St(_),he===K.length-1&&(he=-1),setTimeout(()=>{var w;(w=F.ER.Core.jQuery(f.value))==null||w.focus()},500)}}else fe.value="No match found";R=!1}},Y=async V=>{var de;ce=V.api,(de=V.api)==null||de.addEventListener("selectionChanged",async w=>{if(w.source==="api")return;const Oe=w.api.getSelectedNodes();(Oe==null?void 0:Oe.length)>0?n.hasDataChange()&&!await F.ER.Core.messageConfirm("The data has been changed, unsaved data will be lost if you continue?")?(Oe[0].setSelected(!1),m==null||m.setSelected(!0),w.api.setFocusedCell(m.rowIndex,"CURRENT_NODE_DESC")):(m=Oe[0],_=Oe[0].data,St(_)):Qt()})},Fe=V=>{const{orgHierarchy:de,...w}=V.node.data,Oe=[];return Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Search")||"Search",action:()=>{P.value=!0,p=V.node.data,R=!0,fe.value="",setTimeout(()=>{var We;(We=F.ER.Core.jQuery(f.value))==null||We.focus()},250)},icon:F.ER.Core.createErSvgElement("search"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ExpandAll")||"Expand All",action:()=>{ce.expandAll()},icon:F.ER.Core.createErSvgElement("expand-all"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.CollapseAll")||"Collapse All",action:()=>{ce.collapseAll();const We=ce==null?void 0:ce.getModel().getRow(0);We&&(ce==null||ce.setRowNodeExpanded(We,!0))},icon:F.ER.Core.createErSvgElement("collapse-all"),disabled:!1}),Oe.push("separator"),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Refresh")||"Refresh",action:()=>{Pe()},icon:F.ER.Core.createErSvgElement("refresh"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.CopyText")||"Copy Text",action:()=>{var We,Be;n.copyText((Be=(We=V.node)==null?void 0:We.data)==null?void 0:Be.CURRENT_NODE_DESC)},icon:F.ER.Core.createErSvgElement("copy-text"),disabled:!1}),w.NODE_TYPE.endsWith("_ROOT")||Oe.push("separator"),w.NODE_TYPE!=="DEVTREE_ROOT"&&(w.NODE_TYPE.endsWith("_ROOT")||w.NODE_TYPE.endsWith("_MODULE"))&&Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddModule")||"Add Module",action:()=>{Tt("SI00ModuleEdit","Add",V.node,"addModule",!0)},icon:F.ER.Core.createErSvgElement("add-folder"),disabled:!1}),w.NODE_TYPE==="SI0112_MODULE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddDataSource")||"Add DataSource",action:()=>{Tt("SI00DataSourceEdit","Add",V.node,"addDataSource",!0)},icon:F.ER.Core.createErSvgElement("add-sql"),disabled:!1}):w.NODE_TYPE==="SI0114_MODULE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddDataSet")||"Add DataSet",action:()=>{Tt("SI00DataSetEdit","Add",V.node,"addDataSet",!0)},icon:F.ER.Core.createErSvgElement("add-dataset"),disabled:!1}):w.NODE_TYPE==="SI0114_DATASET"?(Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddDataTable")||"Add DataTable",action:()=>{Tt("SI00DataTableEdit","Add",V.node,"addDataTable",!0)},icon:F.ER.Core.createErSvgElement("add-table"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddDataRelation")||"Add DataRelations",action:async()=>{nr(w.DATASET_NAME),re.Context.IsChanged&&St(_)},icon:F.ER.Core.createErSvgElement("add-relation"),disabled:!1})):w.NODE_TYPE==="SI0114_DATATABLE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ReferenceFromDatabase")||"Reference From Database",action:()=>{const We=F.ER.Core.getLocalStorage("ERX.ErMenuDevPlat.DataBaseOwner."+Ae())||"";N.setQueryPartition(Ae()),N.AutoRefresh=!0,N.AutoQuery=!0,N.DefaultValues={values:{TABLE_NAME:w.TABLE_NAME,DATABASE_OWNER:We}},N.ShowCheckBoxColumn=!0,N.setEvent("beforeQuery",()=>{const Be=N.ErFormHelper.getControlValue(N.LayoutGroupFilterId,"DATABASE_OWNER");Be&&F.ER.Core.setLocalStorage("ERX.ErMenuDevPlat.DataBaseOwner."+Ae(),Be)}),N.setEvent("ok",Be=>{var He,nt;const ye=n.getGridAllRows("gridView7");let je=(ye==null?void 0:ye.length)||0;const ot=[];(He=Be.checkedItemArray)==null||He.forEach(dt=>{var Et;ye.some(yt=>yt.COL_NAME===dt.COLUMN_NAME)||ot.push({DATASET_NAME:w.DATASET_NAME,TABLE_NAME:w.TABLE_NAME,ROW_GUID:F.ER.Core.guid(),COL_NAME:(Et=dt.COLUMN_NAME)==null?void 0:Et.toUpperCase(),COL_CAPTION:dt.COMMENTS,DATA_TYPE:["NUMBER","BIGINT","DECIMAL","DOUBLE","INTEGER","SMALLINT","REAL","DECFLOAT","2"].includes(dt.DATA_TYPE)?"2":["3","4"].includes(dt.DATA_TYPE)?dt.DATA_TYPE:["日期","时间","时刻","Date","Time"].some(yt=>dt.COMMENTS.includes(yt)&&(F.ER.Core.toNumber(dt.DATA_LENGTH)===8||F.ER.Core.toNumber(dt.DATA_LENGTH)===14||F.ER.Core.toNumber(dt.DATA_LENGTH)===20))?"3":"1",MAX_LENGTH:F.ER.Core.toNumber(dt.DATA_LENGTH)||-1,DEFAULT_VALUE:"",C_SEQ_ID:String(++je).padStart(3,"0")})}),ot.length>0&&(n.importRowsToGrid("gridView7",ot),(nt=n.getGridApi("gridView7"))==null||nt.expandAll())}),N.show(null)},icon:F.ER.Core.createErSvgElement("from-database"),disabled:!1}):w.NODE_TYPE==="SI0115_MODULE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddForm")||"Add Form",action:()=>{Tt("SI00FormEdit","Add",V.node,"addForm",!0)},icon:F.ER.Core.createErSvgElement("add-page"),disabled:!1}):w.NODE_TYPE==="SI0116_MODULE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddBasicCode")||"Add Basic Code",action:()=>{Tt("SI00CodeClassEdit","Add",V.node,"addCodeClass",!0)},icon:F.ER.Core.createErSvgElement("code-set"),disabled:!1}):w.NODE_TYPE==="SI0117_MODULE"?Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddSequence")||"Add Sequence",action:()=>{Tt("SI00SequenceEdit","Add",V.node,"addSequence",!0)},icon:F.ER.Core.createErSvgElement("sequence"),disabled:!1}):w.NODE_TYPE==="SI0115_FORM"?(Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.CopyForm")||"Copy Form",action:()=>{Tt("SI00FormEdit","Add",V.node,"copyForm",!0)},icon:F.ER.Core.createErSvgElement("add-copy"),disabled:!1}),Oe.push("separator"),Oe.push({name:"Add",subMenu:[{name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddLayout")||"Layout",action:()=>{Tt("SI00LayoutEdit","Add",V.node,"addLayout",!0)},icon:F.ER.Core.createErSvgElement("add-layout"),disabled:!1},{name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddGridView")||"GridView",action:()=>{Tt("SI00GridViewEdit","Add",V.node,"addGridView",!0)},icon:F.ER.Core.createErSvgElement("add-grid"),disabled:!1},{name:F.ER.Core.$t("ERX.ErMenuDevPlat.AddTreeList")||"TreeList",action:()=>{Tt("SI00TreeListEdit","Add",V.node,"addTreeList",!0)},icon:F.ER.Core.createErSvgElement("add-tree"),disabled:!1}],icon:F.ER.Core.createErSvgElement("add"),disabled:!1})):w.NODE_TYPE==="SI0115_VIEW"&&Oe.push({name:(w==null?void 0:w.FUNC_TYPE)==="F"?F.ER.Core.$t("ERX.ErMenuDevPlat.CopyLayout")||"Copy Layout":(w==null?void 0:w.FUNC_TYPE)==="T"?F.ER.Core.$t("ERX.ErMenuDevPlat.CopyTree")||"Copy Tree":F.ER.Core.$t("ERX.ErMenuDevPlat.CopyGrid")||"Copy Grid",action:()=>{Tt((w==null?void 0:w.FUNC_TYPE)==="F"?"SI00LayoutEdit":(w==null?void 0:w.FUNC_TYPE)==="T"?"SI00TreeListEdit":(w==null?void 0:w.FUNC_TYPE)==="P"?"SI00PivotViewEdit":"SI00GridViewEdit","Add",V.node,"copyView",!0)},icon:F.ER.Core.createErSvgElement("add-copy"),disabled:!1}),w.NODE_TYPE.endsWith("_ROOT")||(Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Modify")||"Modify",action:()=>{var We;(We=w==null?void 0:w.NODE_TYPE)!=null&&We.endsWith("_MODULE")?Tt("SI00ModuleEdit","Modify",V.node,"editModule",!0):(w==null?void 0:w.NODE_TYPE)==="SI0114_DATASET"?Tt("SI00DataSetEdit","Modify",V.node,"editDataSet",!1):(w==null?void 0:w.NODE_TYPE)==="SI0114_DATATABLE"?Tt("SI00DataTableEdit","Modify",V.node,"editDataTable",!1):(w==null?void 0:w.NODE_TYPE)==="SI0112_DATASOURCE"?Tt("SI00DataSourceEdit","Modify",V.node,"editDataSource",!1):(w==null?void 0:w.NODE_TYPE)==="SI0115_FORM"?Tt("SI00FormEdit","Modify",V.node,"editForm",!1):(w==null?void 0:w.NODE_TYPE)==="SI0115_VIEW"&&(w==null?void 0:w.FUNC_TYPE)==="G"?Tt("SI00GridViewEdit","Modify",V.node,"editGridView",!1):(w==null?void 0:w.NODE_TYPE)==="SI0115_VIEW"&&(w==null?void 0:w.FUNC_TYPE)==="P"?Tt("SI00PivotViewEdit","Modify",V.node,"editPivotView",!1):(w==null?void 0:w.NODE_TYPE)==="SI0115_VIEW"&&(w==null?void 0:w.FUNC_TYPE)==="T"?Tt("SI00TreeListEdit","Modify",V.node,"editTreeList",!1):(w==null?void 0:w.NODE_TYPE)==="SI0115_VIEW"&&(w==null?void 0:w.FUNC_TYPE)==="F"?Tt("SI00LayoutEdit","Modify",V.node,"editLayout",!1):(w==null?void 0:w.NODE_TYPE)==="SI0116_BASICCODE"?Tt("SI00CodeClassEdit","Modify",V.node,"editBasicCode",!1):(w==null?void 0:w.NODE_TYPE)==="SI0117_SEQUENCE"&&Tt("SI00SequenceEdit","Modify",V.node,"editSequence",!1)},icon:F.ER.Core.createErSvgElement("modify"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Delete")||"Delete",action:()=>{let We,Be;We=async()=>{var ye;if((ye=w==null?void 0:w.NODE_TYPE)!=null&&ye.endsWith("_MODULE")?Be=F.ER.Core.buildEiInfo([w],"TSI00MODULE_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0112_DATASOURCE"?Be=F.ER.Core.buildEiInfo([{FUNC_ID:w.FUNCTION_ID}],"TSI00DATASOURCE_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0114_DATASET"?Be=F.ER.Core.buildEiInfo([{TYPE:"DataSet",MODULE_NAME:w.MODULE_ENAME,DATASET_NAME:w.DATASET_NAME}],"TSI00DATASET_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0114_DATATABLE"?(Be=F.ER.Core.buildEiInfo([{TYPE:"DataTable",MODULE_NAME:w.DATASET_NAME,DATASET_NAME:w.TABLE_NAME}],"TSI00DATASET_DELETE"),n.clearGridData("gridView7")):(w==null?void 0:w.NODE_TYPE)=="SI0115_FORM"?Be=F.ER.Core.buildEiInfo([{FORM_NAME:w.FORM_NAME}],"TSI00FORM_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0115_VIEW"?Be=F.ER.Core.buildEiInfo([{FORM_NAME:w.FORM_NAME,FUNCTION_ID:w.FUNCTION_ID}],"TSI00GRIDVIEW_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0116_BASICCODE"?Be=F.ER.Core.buildEiInfo([{CODE_CLASS:w.FUNCTION_ID}],"TSI00CODE01_DELETE"):(w==null?void 0:w.NODE_TYPE)=="SI0117_SEQUENCE"&&(Be=F.ER.Core.buildEiInfo([{SEQ_CODE:w.FUNCTION_ID}],"TSI00SEQ01_DELETE")),Be){const je=await F.ER.Core.callService(i,Be);if(je.getStatus()<0){F.ER.Core.messageError(je.getMsg());return}else{const ot=[];for(let He=d.length-1;He>=0;He--)V.node.data.orgHierarchy.every(nt=>new Set(d[He].orgHierarchy).has(nt))&&(ot.push(d[He]),d.splice(He,1));ce.applyTransaction({remove:ot}),setTimeout(()=>{const He=ce.getFocusedCell();He.rowIndex>=0&&ce.ensureIndexVisible(He.rowIndex)},250)}}},We&&n.messageConfirm("Are you sure to delete?",We)},icon:F.ER.Core.createErSvgElement("delete"),disabled:!1})),(w.NODE_TYPE==="SI0115_FORM"||w.NODE_TYPE==="SI0115_VIEW")&&Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ExtendOptions")||"Edit Extended Options",action:()=>{w.NODE_TYPE==="SI0115_FORM"?n.showExtOptionsEdit("tsi00formext",w.FORM_NAME,"","",Ae(),"",!1):w.NODE_TYPE==="SI0115_VIEW"&&n.showExtOptionsEdit("tsi00gridviewext",w.FORM_NAME,w.FUNCTION_ID,"",Ae(),"",!1)},icon:F.ER.Core.createErSvgElement("json-options"),disabled:!1}),w.NODE_TYPE==="SI0117_SEQUENCE"&&(Oe.push("separator"),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ResetSequence")||"Reset Sequence",action:()=>{n.messageConfirm("Are you sure you want to reset the sequence?",async()=>{const We=F.ER.Core.buildEiInfo({...w,SEQ_CODE:w.FUNCTION_ID},"TSI00SEQ01_RESET"),Be=await F.ER.Core.callService(i,We);if(Be.SysInfo&&Be.SysInfo.Flag<0){F.ER.Core.messageError(Be.SysInfo.Msg);return}St(_)})},icon:F.ER.Core.createErSvgElement("reset"),disabled:!1})),["SI0114_DATATABLE","SI0115_VIEW","DEVTREE_ROOT"].includes(w.NODE_TYPE)||(w.NODE_TYPE.endsWith("_ROOT")||(Oe.push("separator"),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ApplyToPartition")||"Apply To Partition",action:()=>{n.messageInfo("wait for implement...")},icon:F.ER.Core.createErSvgElement("apply-to"),disabled:!1})),Oe.push("separator"),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Export")||"Export",action:()=>{ae({...w,children:V.node.childrenAfterFilter})},icon:F.ER.Core.createErSvgElement("json-file"),disabled:!1}),(w.NODE_TYPE.endsWith("_ROOT")||w.NODE_TYPE.endsWith("_MODULE"))&&Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Import")||"Import",action:()=>{tr(w)},icon:F.ER.Core.createErSvgElement("import-json"),disabled:!1})),w.NODE_TYPE==="SI0115_VIEW"&&(Oe.push("separator"),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ReferenceFromDataSet")||"Reference From DataSet",action:()=>{W.setQueryPartition(Ae()),W.AutoRefresh=!0,W.AutoQuery=!0,W.DefaultValues={values:{DATASET_NAME:w.DATASET_NAME,TABLE_NAME:w.TABLE_NAME}},W.ShowCheckBoxColumn=!0,W.setEvent("ok",We=>{var ot;const Be=n.getGridAllRows(G.value);let ye=(Be==null?void 0:Be.length)||0;const je=[];(ot=We.checkedItemArray)==null||ot.forEach(He=>{Be.some(nt=>nt.ITEM_CODE===He.COL_NAME)||je.push(Rt({COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,ROW_GUID:F.ER.Core.guid(),FORM_NAME:w.FORM_NAME,FUNCTION_ID:w.FUNCTION_ID,ITEM_CODE:He.COL_NAME,COL_CAPTION:He.COL_CAPTION,FIELD_NAME:He.COL_NAME,MAX_LENGTH:He.MAX_LENGTH,DATA_ACCU:He.PRECISION||-1,DATA_TYPE:He.DATA_TYPE,C_SEQ_ID:String(ye++).padStart(3,"0")},w.FUNC_TYPE))}),je.length>0&&n.importRowsToGrid(G.value,je)}),W.show(null)},icon:F.ER.Core.createErSvgElement("from-dataset"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ReferenceFromDatabase")||"Reference From Database",action:()=>{const We=F.ER.Core.getLocalStorage("ERX.ErMenuDevPlat.DataBaseOwner."+Ae())||"";N.setQueryPartition(Ae()),N.AutoRefresh=!0,N.AutoQuery=!0,N.DefaultValues={values:{TABLE_NAME:w.TABLE_NAME,DATABASE_OWNER:We}},N.ShowCheckBoxColumn=!0,N.setEvent("beforeQuery",()=>{const Be=N.ErFormHelper.getControlValue(N.LayoutGroupFilterId,"DATABASE_OWNER");Be&&F.ER.Core.setLocalStorage("ERX.ErMenuDevPlat.DataBaseOwner."+Ae(),Be)}),N.setEvent("ok",Be=>{var He;const ye=n.getGridAllRows(G.value);let je=(ye==null?void 0:ye.length)||0;const ot=[];(He=Be.checkedItemArray)==null||He.forEach(nt=>{var dt;ye.some(Et=>Et.ITEM_CODE===nt.COL_NAME)||ot.push(Rt({COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,ROW_GUID:F.ER.Core.guid(),FORM_NAME:w.FORM_NAME,FUNCTION_ID:w.FUNCTION_ID,ITEM_CODE:(dt=nt.COLUMN_NAME)==null?void 0:dt.toUpperCase(),COL_CAPTION:nt.COMMENTS,FIELD_NAME:nt.COLUMN_NAME,MAX_LENGTH:F.ER.Core.toNumber(nt.DATA_LENGTH),DATA_ACCU:F.ER.Core.toNumber(nt.PRECISION||-1),DATA_TYPE:nt.DATA_TYPE,C_SEQ_ID:String(je++).padStart(3,"0")},w.FUNC_TYPE))}),ot.length>0&&n.importRowsToGrid(G.value,ot)}),N.show(null)},icon:F.ER.Core.createErSvgElement("from-database"),disabled:!1}),Oe.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.Preview")||"Preview",action:()=>{if((w==null?void 0:w.FUNC_TYPE)==="F"){B=new F.ER.PopFreeHelper(Ae(),w.FORM_NAME,w.FUNCTION_ID,pe);const We=()=>{var Be;(Be=B.Context)!=null&&Be.configUpdate&&St(_)};B.setEvent("close",We),B.ShowOkButton=!1,B.ShowCancelButton=!1,B.show(null,We,We)}else((w==null?void 0:w.FUNC_TYPE)==="G"||(w==null?void 0:w.FUNC_TYPE)==="P")&&(Q=new F.ER.PopQueryHelper(Ae(),w.FORM_NAME,w.FUNCTION_ID,pe),Q.MainViewConfigId=w.FUNCTION_ID,Q.DetailViewConfigId="",Q.setEvent("close",()=>{St(_)}),Q.ShowOkButton=!1,Q.ShowCancelButton=!1,Q.ShowQueryButton=!1,Q.show(null))},icon:F.ER.Core.createErSvgElement("preview"),disabled:!1})),Oe},ke=V=>{H=V.api,oe=V.columnApi},Ve=()=>{$e.value.trim().length>0&&($e.value=Ho.format($e.value))},at=async()=>{var V;if($e.value.trim().length>0){let de=$e.value;const w=F.ER.Core.toString(window.getSelection());w.length>0&&$e.value.includes(w)&&(de=w);const Oe=await F.ER.Core.querySql(Ae(),E,de);if(Oe.getStatus()<0){F.ER.Core.messageError(Oe.getMsg());return}const We=Oe.getBlockByIndex(0);F.ER.Core.setGridData(H,We,!0,{showRowNo:!0}),oe.autoSizeAllColumns(),b.value=`Excute Result -> [${((V=We.getMappedRows())==null?void 0:V.length)||0} records matched]`}},pt=async V=>{const de=xe.value.find(w=>w.CODE===ve.value);ht(de),await Pe(),K=[],he=-1,Ee.value="",P.value=!1,O.value=!1,y.value=!1,D.value=!1,I.value=!1,S.value=!1,T.value=!1,x.value=!1,b.value="Excute Result",C.value=!0,n.clearGridData("gridView0")},ht=V=>{Le.value={...Le.value,suffixIcon:F.ER.Core.createErSvgVNode(V.PARTITION_TYPE==="R"?"red-light":V.PARTITION_TYPE==="P"?"yellow-light":"green-light")}},Ct=V=>{_&&St(_)},_t=(V,de,w)=>({name:"Translate",icon:F.ER.Core.createErIconElement(l.h(it.TranslationOutlined)),action:()=>{if(Ge.value==="zh_Hans")return;const Oe=new F.ER.TranslateHelper({ocpApimSubscriptionKey:n.getFormSysInfo("AzureTranslateKey")}),We=n.getGridCheckedRows(V.context.configId),Be=[],ye=[];We.forEach(je=>{var ot;((ot=je[de])==null?void 0:ot.trim().length)>0&&F.ER.Core.toString(je[w]).trim().length===0&&(Be.push(je[de].trim()),ye.push(je))}),Oe.translate(Be,{from:"zh-Hans",to:Ge.value}).then(je=>{if(je.flag)for(let ot=0;ot<ye.length;ot++)n.setGridRowData(V.context.configId,ye[ot].uid,{[w]:je.result[ot][Ge.value]})})}}),Qe=V=>({name:"Apply To",icon:F.ER.Core.createErSvgElement("apply-to"),action:async()=>{var w,Oe,We;let de=(We=(Oe=(w=V.context)==null?void 0:w.viewConfig)==null?void 0:Oe.TABLE_NAME)==null?void 0:We.trim();if(de.length>0){const Be=async()=>{const ye=await F.ER.Core.callService(r,F.ER.Core.buildEiInfo({OPERATE_TYPE:"tsi00formtree"}),{show:!0,delay:1e3});if(ye.getStatus()<0){F.ER.Core.messageError(ye.getMsg());return}let je=ye.getBlockByIndex(0).getMappedRows();return["TSI00FORMCODECLASS","TSI00FORMRESOURCE"].includes(de)&&(je=je.filter(ot=>ot.NODE_TYPE!=="VIEW")),je};Te.BordStyle="Fixed",Te.receiveData(Be),Te.BeforeOkButtonClick=ye=>!["TSI00FORMCODECLASS","TSI00FORMRESOURCE"].includes(de)&&(ye==null?void 0:ye.NODE_TYPE)!=="VIEW"||["TSI00FORMCODECLASS","TSI00FORMRESOURCE"].includes(de)&&(ye==null?void 0:ye.NODE_TYPE)!=="FORM"?!1:ye,Te.show(null,async ye=>{if(ye!=null&&ye.data){const je=n.getGridCheckedRows(V.context.configId,!0),ot=je==null?void 0:je.map(dt=>({...dt,ORIGIN_FORM_NAME:dt.FORM_NAME,FORM_NAME:ye.data.FORM_NAME,FUNCTION_ID:ye.data.FUNCTION_ID,ROW_GUID:F.ER.Core.guid()}));["TSI00FORMCODECLASS","TSI00FORMRESOURCE"].includes(de)?de=de+"_COPY":de=de+"_ADD";const He=F.ER.Core.buildEiInfo(ot,de),nt=await F.ER.Core.callService(i,He,{show:!0,delay:1e3});if(nt.SysInfo&&nt.SysInfo.Flag<0){F.ER.Core.messageError(nt.SysInfo.Msg);return}}})}}}),U=V=>{V.configId==="gridView1_Layout"&&V.api.addEventListener("cellValueChanged",de=>{var w,Oe,We,Be,ye,je,ot,He,nt,dt;if(de.column.colId==="OPERATOR"){const Et={},yt=F.ER.Core.toString(de.value);yt.length>0&&yt!="None"?(((Oe=(w=de.data)==null?void 0:w.PARA_NAME)==null?void 0:Oe.trim().length)==0&&(Et.PARA_NAME=de.data.FIELD_NAME),(((Be=(We=de.data)==null?void 0:We.PARA_GROUP)==null?void 0:Be.trim().length)==0||((ye=de.data)==null?void 0:ye.PARA_GROUP)==="0")&&(Et.PARA_GROUP="1")):(Et.PARA_NAME="",Et.PARA_GROUP="0"),((je=de.data)==null?void 0:je.COLUMN_EDIT)=="5"&&(((He=(ot=de.data)==null?void 0:ot.DATE_TIME_FORMAT)==null?void 0:He.trim().length)==0&&(yt===">"||yt===">=")?Et.DATE_TIME_FORMAT="yyyyMMdd000000":((dt=(nt=de.data)==null?void 0:nt.DATE_TIME_FORMAT)==null?void 0:dt.trim().length)==0&&(yt==="<"||yt==="<=")?Et.DATE_TIME_FORMAT="yyyyMMdd235959":yt==="None"&&(Et.DATE_TIME_FORMAT="")),V.erFormHelper.setGridRowData(V.configId,de.node.data.uid,Et)}})},gt=V=>{var w,Oe;const de=[];if((w=V.context)!=null&&w.configId){const We=n.getGridCheckedRows(V.context.configId);(We==null?void 0:We.length)>0&&(de.push(Qe(V)),Ge.value!=="zh_Hans"&&(de.push("separator"),de.push(_t(V,"COL_CAPTION","COL_CAPTION_RES")))),n.DevelopPermisson==="1"&&de.push({name:`Batch Edit Propertis [${V.node.data.ITEM_CODE}]`,icon:F.ER.Core.createErSvgElement("product"),action:async()=>{const Be=ye=>{ye.setQueryPartition(Ae()),ye.AutoRefresh=!0,ye.AutoQuery=!0,ye.CloseDialogWhenOkClick=!1,ye.DefaultValues={values:{ITEM_CODE:V.node.data.ITEM_CODE,MODULE_NAME:_==null?void 0:_.MODULE_ENAME,CULTURE:Ge.value}},ye.ShowCheckBoxColumn=!0,ye.setEvent("ok",async je=>{const ot=ye.ErFormHelper.getGridCheckedRows(ye.MainViewConfigId);if(ot.length>0){const He=[];if(ot.forEach(nt=>{nt.dirty&&He.push(nt.toJSON())}),He.length>0){const nt=F.ER.Core.buildEiInfo(He,"TSI00GRIDCOLUMN_MODIFY"),dt=await F.ER.Core.callService(i,nt);dt.getStatus()<0?F.ER.Core.messageError(dt.getMsg()):(ye.queryMainGridInfo(!1),F.ER.Core.messageInfo("Batch Edit Properties Success"),St(_))}else F.ER.Core.messageInfo("No properties changed in checked rows")}}),ye.show(null)};V.context.configId==="gridView1_GridView"?Be(Se):V.context.configId==="gridView1_Layout"?Be(ue):V.context.configId==="gridView1_TreeList"&&Be(me)}}),((Oe=V.context)==null?void 0:Oe.configId)==="gridView1_GridView"&&de.push({name:"Add Prefix To Field",icon:F.ER.Core.createErSvgElement("prefix"),action:async()=>{const Be=new F.ER.PopRichEditor({extension:"text",width:300,height:120,title:"Prefix Table Name"});Be.CancelButtonCaption=F.ER.Core.$t("ERX.Close")||"关闭",Be.setEvent("ok",async()=>{var ye;((ye=Be.Content)==null?void 0:ye.trim().length)>0&&V.api.forEachLeafNode(je=>{var ot,He,nt;je.isSelected()&&((He=(ot=je.data)==null?void 0:ot.PARA_NAME)==null?void 0:He.trim().length)===0&&je.setDataValue("PARA_NAME",((nt=Be.Content)==null?void 0:nt.trim())+"."+je.data.FIELD_NAME)})}),Be.show(null,"")}}),V.node.data.isNew||(de.push("separator"),de.push({name:F.ER.Core.$t("ERX.ErMenuDevPlat.ExtendOptions")||"Edit Extended Options",action:()=>{n.showExtOptionsEdit("tsi00gridcolumnext",V.node.data.FORM_NAME,V.node.data.FUNCTION_ID,V.node.data.ROW_GUID+","+V.node.data.ITEM_CODE,Ae(),V.node.data.COMPANY_CODE,!1)},icon:F.ER.Core.createErSvgElement("json-options"),disabled:!1}))}return de},rt=V=>{var w;const de=[];if((w=V.context)!=null&&w.configId){const Oe=n.getGridCheckedRows(V.context.configId);(Oe==null?void 0:Oe.length)>0&&de.push(Qe(V))}return de},ct=V=>{const de=[];return _.FORM_NAME&&_.FUNCTION_ID&&(de.push({name:"Add Band",icon:F.ER.Core.createErSvgElement("add-node"),action:async()=>{Tt("SI00GridBandEdit","Add",V.node,"addBand",!0)}}),V.node&&de.push({name:"Add SubBand",icon:F.ER.Core.createErSvgElement("add-child-node"),action:async()=>{Tt("SI00GridBandEdit","Add",V.node,"addSubBand",!0)}})),de},Ze=V=>{var w;const de=[];if((w=V.context)!=null&&w.configId){const Oe=n.getGridCheckedRows(V.context.configId);(Oe==null?void 0:Oe.length)>0&&de.push(Qe(V))}return de},Ye=V=>{var w;const de=[];if((w=V.context)!=null&&w.configId){const Oe=n.getGridCheckedRows(V.context.configId);Ge.value!=="zh_Hans"&&(Oe==null?void 0:Oe.length)>0&&de.push(_t(V,"CODE_DESC_1_CONTENT","CODE_DESC_1_CONTENT_RES"))}return de},st=V=>{var w,Oe;const de=[];return(w=V.context)!=null&&w.configId&&((Oe=V.node)!=null&&Oe.childrenAfterFilter)&&de.push({name:"Edit Relation",icon:F.ER.Core.createErSvgElement("relation"),action:async We=>{const Be=V.node.childrenAfterFilter[0].data.DATASET_NAME,ye=V.node.childrenAfterFilter[0].data.RELATION_NAME;Be&&ye&&(nr(Be,ye),await re.show(null),re.Context.IsChanged&&St(_))}},{name:"Delete Relation",icon:F.ER.Core.createErSvgElement("remove"),action:async We=>{const Be=V.node.childrenAfterFilter[0].data.DATASET_NAME,ye=V.node.childrenAfterFilter[0].data.RELATION_NAME;Be&&ye&&n.messageConfirm("Are you sure to delete?",async()=>{const je=F.ER.Core.buildEiInfo({DATASET_NAME:Be,RELATION_NAME:ye},"TSI00DATARELATION_DELETE"),ot=await F.ER.Core.callService(i,je);if(ot.getStatus()<0){F.ER.Core.messageError(ot.getMsg());return}St(_)})}}),de},mt=V=>{var w;const de=[];if((w=V.context)!=null&&w.configId){const Oe=n.getGridCheckedRows(V.context.configId);(Oe==null?void 0:Oe.length)>0&&de.push(Qe(V))}return de},At=V=>{var w;const de=[];if((w=V.context)!=null&&w.configId){const Oe=n.getGridCheckedRows(V.context.configId);(Oe==null?void 0:Oe.length)>0&&(de.push(Qe(V)),Ge.value!=="zh_Hans"&&(de.push("separator"),de.push(_t(V,"ITEM_VALUE","ITEM_VALUE_RES"))))}return de},Rt=(V,de)=>{var w,Oe,We,Be,ye,je,ot;return((w=V.FIELD_NAME)==null?void 0:w.trim().length)===0||(de==="F"&&(V.COLUMN_EDIT=["NUMBER","BIGINT","DECIMAL","DOUBLE","INTEGER","SMALLINT","REAL","DECFLOAT","2"].includes(V.DATA_TYPE)?"9":V.DATA_TYPE==="3"||((Oe=V.COL_CAPTION)!=null&&Oe.includes("日期")||(We=V.COL_CAPTION)!=null&&We.includes("时间")||(Be=V.COL_CAPTION)!=null&&Be.includes("时刻"))&&(F.ER.Core.toNumber(V.MAX_LENGTH)===8||F.ER.Core.toNumber(V.MAX_LENGTH)===14||F.ER.Core.toNumber(V.MAX_LENGTH)===20)?"5":"0"),V.DATA_TYPE==="2"?(V.FORMAT_TYPE="Numeric",["金额","税额","发生额","款"].some(He=>{var nt;return(nt=V.COL_CAPTION)==null?void 0:nt.includes(He)})?V.FORMAT_STRING="#,##0.00":V.FORMAT_STRING="#,##0",["数量","件数","重量","毛重","净重"].some(He=>{var nt;return(nt=V.COL_CAPTION)==null?void 0:nt.includes(He)})&&(V.FORMAT_STRING="#,##0.###")):V.DATA_TYPE==="3"&&(V.FORMAT_TYPE="DateTime",(ye=V.COL_CAPTION)!=null&&ye.includes("日期")?V.FORMAT_STRING="yyyy-MM-dd":((je=V.COL_CAPTION)!=null&&je.includes("时间")||(ot=V.COL_CAPTION)!=null&&ot.includes("时刻"))&&(V.FORMAT_STRING="yyyy-MM-dd HH:mm:ss"))),V},Qt=()=>{O.value=!1,y.value=!1,D.value=!1,I.value=!1,S.value=!1,T.value=!1,x.value=!1,b.value="Excute Result",C.value=!0,n.clearGridData("gridView0")},St=V=>{var Oe,We;let{orgHierarchy:de,...w}=V;(Oe=w.NODE_TYPE)!=null&&Oe.endsWith("_ROOT")||(We=w.NODE_TYPE)!=null&&We.endsWith("_MODULE")?(O.value=!1,y.value=!1,D.value=!1,I.value=!1,S.value=!1,T.value=!1,x.value=!1,b.value="Excute Result",C.value=!0,w={...w,CULTURE:Ge.value,QUERY_TYPE:"tsi00trace",FUNCTION_ID:"DevOps"}):w.NODE_TYPE==="SI0112_DATASOURCE"?(y.value=!1,C.value=!1,O.value=!1,D.value=!1,I.value=!1,T.value=!1,x.value=!1,S.value=!0,w={...w,CULTURE:Ge.value,QUERY_TYPE:"si0112_details",COMPANY_CODE:"BS"}):w.NODE_TYPE==="SI0114_DATASET"||w.NODE_TYPE==="SI0114_DATATABLE"?(y.value=!1,C.value=!1,O.value=!1,D.value=!1,I.value=!1,S.value=!1,x.value=!1,b.value="Excute Result",T.value=!0,ee("gridView7",w),w={...w,CULTURE:Ge.value,QUERY_TYPE:"si0114_details",COMPANY_CODE:"BS"}):w.NODE_TYPE==="SI0115_FORM"?(n.reloadDropDownDataSource("gridView3","BUTTON_NAME",()=>{const Be=n.getItemDropDownDataSource("gridView3","BUTTON_NAME");return Be==null?void 0:Be.filter(ye=>w.FUNC_TYPE==="M"?ye.CODE.startsWith("F"):ye.CODE.startsWith("btn"))}),y.value=!1,C.value=!1,O.value=!1,D.value=!1,I.value=!1,T.value=!1,S.value=!1,x.value=!0,ee("gridView3,gridView4,gridView19",w),w={...w,CULTURE:Ge.value,QUERY_TYPE:"si0115_form",COMPANY_CODE:"BS"}):w.NODE_TYPE==="SI0115_VIEW"?(C.value=!1,T.value=!1,D.value=!1,I.value=!1,S.value=!1,x.value=!1,b.value="Excute Result",y.value=!0,w.FUNC_TYPE==="T"?(M.value="TreeColumns",G.value="gridView1_TreeList",O.value=!1):w.FUNC_TYPE==="F"?(M.value="LayoutItems",G.value="gridView1_Layout",O.value=!1):(M.value="GridColumns",G.value="gridView1_GridView",O.value=!0,ee("gridView2",w)),ee(`${G.value},gridView11`,w),w={...w,CULTURE:Ge.value,QUERY_TYPE:"si0115_view",COMPANY_CODE:"BS"}):w.NODE_TYPE==="SI0116_BASICCODE"?(y.value=!1,C.value=!1,O.value=!1,T.value=!1,I.value=!1,S.value=!1,x.value=!1,b.value="Excute Result",D.value=!0,ee("gridView12",w),w={...w,CULTURE:Ge.value,QUERY_TYPE:"tsi00code01_detail",COMPANY_CODE:"BS"}):w.NODE_TYPE==="SI0117_SEQUENCE"&&(y.value=!1,C.value=!1,O.value=!1,T.value=!1,D.value=!1,S.value=!1,x.value=!1,b.value="Excute Result",I.value=!0,w={...w,CULTURE:Ge.value,QUERY_TYPE:"tsi00seq_detail",COMPANY_CODE:"BS"}),w!=null&&w.QUERY_TYPE&&l.nextTick(()=>{Ce(w)})},nr=(V,de)=>{const w=async(Oe,We)=>{const Be=F.ER.Core.buildEiInfo([{QUERY_TYPE:"tsi00datatable",DATASET_NAME:Oe,TABLE_NAME:We}]);return(await F.ER.Core.callService(r,Be,void 0,{messageError:!0})).getBlock("TSI00DATATABLE")};re.setEvent("load",async Oe=>{const We=re.ErFormHelper.getGridApi(re.GridConfigId);re.ErFormHelper.setLayoutItemValidateRules(re.LayoutConfigId,"RESERVE7",[{validator:(Be,ye)=>{const je=re.ErFormHelper.getControlValue(re.LayoutConfigId,"RESERVE1");return ye&&je===ye?(Be.message="Child table cannot be the same as the parent table!",Promise.reject()):Promise.resolve()}}]),We==null||We.addEventListener("cellValueChanged",async Be=>{var ye,je,ot;if(Be.data&&(((ye=Be.colDef)==null?void 0:ye.field)==="RESERVE1"||((je=Be.colDef)==null?void 0:je.field)==="RESERVE7")){const He=F.ER.Core.buildEiInfo([{QUERY_TYPE:"tsi00datatable",DATASET_NAME:re.ErFormHelper.getControlValue(re.LayoutConfigId,"DATASET_NAME"),TABLE_NAME:Be.value}]),nt=await F.ER.Core.callService(r,He,void 0,{messageError:!0});if(nt.SysInfo&&nt.SysInfo.Flag>=0){const dt=nt.getBlock("TSI00DATATABLE");dt.getMappedRows().length>0&&re.ErFormHelper.reloadDropDownDataSource(re.GridConfigId,((ot=Be.colDef)==null?void 0:ot.field)==="RESERVE1"?"RESERVE2":"RESERVE8",dt.getMappedRows())}}})}),re.setEvent("query",async Oe=>{const We=F.ER.Core.buildEiInfo([{QUERY_TYPE:"tsi00datarelation",DATASET_NAME:V,RELATION_NAME:de||re.ErFormHelper.getControlValue(re.LayoutConfigId,"RELATION_NAME")}]),Be=await F.ER.Core.callService(r,We,void 0,{messageError:!0});if(Be.SysInfo&&Be.SysInfo.Flag>=0){const ye=Be.getBlock("TSI00DATARELATION");if(ye.getMappedRows().length>0){const He=[{...ye.getMappedRows()[0]}];re.ErFormHelper.mergeDataToLayoutOrGrid(He,!0,re.LayoutConfigId),re.ErFormHelper.mergeDataToLayoutOrGrid(ye,!0,re.GridConfigId)}const je=["RESERVE1","RESERVE7"],ot=re.ErFormHelper.getControlValue(re.LayoutConfigId,"DATASET_NAME");je.forEach(async He=>{const nt=re.ErFormHelper.getControlValue(re.LayoutConfigId,He),dt=await w(ot,nt);dt&&re.ErFormHelper.reloadDropDownDataSource(re.GridConfigId,He==="RESERVE1"?"RESERVE2":"RESERVE8",dt.getMappedRows())})}}),re.setEvent("open",async Oe=>{const We=F.ER.Core.buildEiInfo([{QUERY_TYPE:"tsi00dataset",DATASET_NAME:V,TABLE_NAME:"*"}]),Be=await F.ER.Core.callService(r,We,void 0,{messageError:!0});if(Be.SysInfo&&Be.SysInfo.Flag>=0){const ye=Be.getBlock("TSI00DATASET");ye.getMappedRows().length>0&&(re.ErFormHelper.reloadDropDownDataSource(re.LayoutConfigId,"RESERVE1",ye.getMappedRows()),re.ErFormHelper.reloadDropDownDataSource(re.LayoutConfigId,"RESERVE7",ye.getMappedRows()))}if(de&&(de==null?void 0:de.trim().length)>0)re.EditType="Modify",re.ErFormHelper.setControlReadOnly(re.LayoutConfigId,!0,"RESERVE1,RESERVE7"),re.doEvent("query");else{re.EditType="Add",re.ErFormHelper.clearLayoutOrGridData(re.LayoutConfigId,re.GridConfigId);const ye=re.ErFormHelper.addModelToLayout(re.LayoutConfigId);ye.DATASET_NAME=V}}),re.setEvent("save",async Oe=>{const We=re.ErFormHelper.getGridAllRowsAsBlock(re.GridConfigId);if(We.getMappedRows().length===0){F.ER.Core.messageError("No relation detail info!");return}const Be=We.getMappedRows();for(let ot=0;ot<Be.length;ot++)Be[ot].DATASET_NAME=V,Be[ot].RELATION_NAME=re.ErFormHelper.getControlValue(re.LayoutConfigId,"RELATION_NAME"),Be[ot].RESERVE1=re.ErFormHelper.getControlValue(re.LayoutConfigId,"RESERVE1"),Be[ot].RESERVE7=re.ErFormHelper.getControlValue(re.LayoutConfigId,"RESERVE7"),Be[ot].C_SEQ_ID=String(ot+1).padStart(3,"0");const ye=new F.ER.EIInfo;We.rename(re.EditType==="Modify"?"TSI00DATARELATION_MODIFY":"TSI00DATARELATION_ADD"),ye.addBlock(We),(await F.ER.Core.callService(i,ye,void 0,{messageError:!0})).getStatus()>=0&&(re.EditType="Modify",re.ErFormHelper.setControlReadOnly(re.LayoutConfigId,!0,"RESERVE1,RESERVE7"),re.doEvent("query"))}),re.setEvent("itemValueChanged",async Oe=>{if(Oe.itemCode==="RESERVE1"||Oe.itemCode==="RESERVE7"){const We=re.ErFormHelper.getControlValue(re.LayoutConfigId,Oe.itemCode),Be=await w(V,We);Be&&re.ErFormHelper.reloadDropDownDataSource(re.GridConfigId,Oe.itemCode==="RESERVE1"?"RESERVE2":"RESERVE8",Be.getMappedRows());const ye=re.ErFormHelper.getGridApi(re.GridConfigId);ye==null||ye.forEachLeafNode(je=>{je.data.set(Oe.itemCode,Oe.value);const ot=Oe.itemCode==="RESERVE1"?"RESERVE2":"RESERVE8",He=je.data[ot];Be.getMappedRows().some(nt=>nt.COL_NAME===He)||je.setDataValue(ot,"")})}})},Tt=async(V,de,w,Oe,We=!1)=>{let Be={},ye="";const je=await tt(w==null?void 0:w.data.MODULE_TYPE);if(A=new F.ER.PopFreeHelper(Ke,V,"LayoutGroupMain",pe),A.setSavePartition(Ae()),A.EditType=de,A.OkButtonService=i,A.OkButtonCaption=F.ER.Core.$t("ERX.Save")||"Save",A.CancelButtonCaption=F.ER.Core.$t("ERX.Close")||"Close",A.CloseDialogWhenOkClick=We,Be=(()=>{var nt,dt;let He={};switch(V){case"SI00ModuleEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00module",MODULE_TYPE:w.data.MODULE_TYPE,MODULE_ENAME:w.data.MODULE_ENAME}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_TYPE:w==null?void 0:w.data.MODULE_TYPE,PARENT_CODE:w==null?void 0:w.data.MODULE_ENAME,MODULE_ENAME:(dt=(nt=w==null?void 0:w.data)==null?void 0:nt.NODE_TYPE)!=null&&dt.endsWith("_MODULE")?w==null?void 0:w.data.MODULE_ENAME:""},ye="MODULE_ENAME";break;case"SI00DataSetEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00dataset",DATASET_NAME:w.data.DATASET_NAME}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_NAME:w==null?void 0:w.data.MODULE_ENAME,TYPE:"DataSet",DATASET_NAME:"DataSet_"+(w==null?void 0:w.data.MODULE_ENAME.substring(0,2))},ye="DATASET_NAME";break;case"SI00DataTableEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00dataset",DATASET_NAME:w.data.DATASET_NAME,TABLE_NAME:w.data.TABLE_NAME}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_NAME:w==null?void 0:w.data.DATASET_NAME,TYPE:"DataTable"},ye="DATASET_NAME";break;case"SI00DataSourceEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00datasource",FUNC_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_NAME:w==null?void 0:w.data.MODULE_ENAME,ROW_GUID:F.ER.Core.guid()},ye="FUNC_ID";break;case"SI00FormEdit":He=de==="Modify"||Oe==="copyForm"?{QUERY_TYPE:"tsi00form",FORM_NAME:w.data.FORM_NAME}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_NAME:w==null?void 0:w.data.MODULE_ENAME,ROW_GUID:F.ER.Core.guid()};break;case"SI00GridViewEdit":case"SI00PivotViewEdit":case"SI00LayoutEdit":case"SI00TreeListEdit":He=de==="Modify"||Oe==="copyView"?{QUERY_TYPE:"tsi00gridview",FORM_NAME:w.data.FORM_NAME,FUNCTION_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,FORM_NAME:w==null?void 0:w.data.FORM_NAME,FUNCTION_TYPE:V==="SI00GridViewEdit"?"G":V==="SI00PivotViewEdit"?"P":V==="SI00TreeListEdit"?"T":"F"};break;case"SI00GridBandEdit":const Et=n.getGridDataCount("treeList1");He=de==="Modify"?{QUERY_TYPE:"tsi00gridband",FORM_NAME:w.data.FORM_NAME,FUNCTION_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,FORM_NAME:_.FORM_NAME,FUNCTION_ID:_.FUNCTION_ID,COL_WIDTH:120,C_SEQ_ID:(Et+1).toString().padStart(3,"0")},Oe==="addSubBand"&&(He.FATHER_NODE_CODE=w.data.CURRENT_NODE_CODE);break;case"SI00CodeClassEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00code01",FUNCTION_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,CODE_SOURCE:w==null?void 0:w.data.MODULE_ENAME},ye="CODE_CLASS";break;case"SI00SequenceEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00seq01_pivot",FUNCTION_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_NAME:w==null?void 0:w.data.MODULE_ENAME},ye="SEQ_CODE";break;case"SI00DataAuthEdit":He=de==="Modify"?{QUERY_TYPE:"tsi00recordauth01",FUNCTION_ID:w.data.FUNCTION_ID}:{COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,MODULE_ENAME:w==null?void 0:w.data.MODULE_ENAME},ye="ITEM_CODE";break}return He})(),de==="Modify"||Oe==="copyForm"||Oe==="copyView"){const He=F.ER.Core.buildEiInfo(Be);He.setContext({culture:Ge.value});const nt=await F.ER.Core.callService(r,He);if(nt.getStatus()<0){F.ER.Core.messageError(nt.getMsg());return}const dt=["SI00GridViewEdit","SI00PivotViewEdit","SI00TreeListEdit","SI00LayoutEdit"].includes(V)?nt.getBlock("TSI00GRIDVIEW"):nt.getBlockByIndex(0);if(!dt||dt.getMappedRows().length===0){F.ER.Core.messageError("Data not found!");return}Be=dt.getMappedRows()[0]}Oe==="copyForm"?(Be.ROW_GUID=F.ER.Core.guid(),A.ExtendJsonData={FORM_NAME_COPYFROM:w.data.FORM_NAME},A.ReceiveData(Be,{FUNC_TYPE:!0})):Oe==="copyView"?(Be.ROW_GUID=F.ER.Core.guid(),A.ExtendJsonData={FORM_NAME_COPYFROM:w.data.FORM_NAME,FUNCTION_ID_COPYFROM:w.data.FUNCTION_ID},A.ReceiveData(Be,{FUNC_TYPE:!0})):A.ReceiveData(Be),A.BeforeCallService=He=>{var nt,dt;return _=_||(w==null?void 0:w.data)||{},V==="SI00SequenceEdit"?(He.renBlock("TSI00SEQ01_MODIFY",de==="Modify"?"TSI00SEQ01_MODIFY_PIVOT":"TSI00SEQ01_ADD_PIVOT"),console.log(He,"BeforeCallService inInfo")):V==="SI00FormEdit"&&de==="Modify"&&He.getBlockByIndex(0).getCell(0,"FORM_NAME")!==((nt=w==null?void 0:w.data)==null?void 0:nt.FORM_NAME)&&(He.getBlockByIndex(0).addColumn("FORM_NAME_AS_NEW"),He.getBlockByIndex(0).setCell(0,"FORM_NAME_AS_NEW",He.getBlockByIndex(0).getCell(0,"FORM_NAME")),He.getBlockByIndex(0).setCell(0,"FORM_NAME",w.data.FORM_NAME),_.CURRENT_NODE_CODE=`SI0115_${He.getBlockByIndex(0).getCell(0,"FORM_NAME_AS_NEW")}`),["SI00GridViewEdit","SI00LayoutEdit","SI00TreeListEdit"].includes(V)&&de==="Modify"&&He.getBlockByIndex(0).getCell(0,"FUNCTION_ID")!==((dt=w==null?void 0:w.data)==null?void 0:dt.FUNCTION_ID)&&(He.getBlockByIndex(0).addColumn("FUNCTION_ID_AS_NEW"),He.getBlockByIndex(0).setCell(0,"FUNCTION_ID_AS_NEW",He.getBlockByIndex(0).getCell(0,"FUNCTION_ID")),He.getBlockByIndex(0).setCell(0,"FUNCTION_ID",w.data.FUNCTION_ID),_.CURRENT_NODE_CODE=`SI0115_${_.FORM_NAME+He.getBlockByIndex(0).getCell(0,"FUNCTION_ID_AS_NEW")}`),He},A.setEvent("initial",()=>{A.FormHelper.reloadDropDownDataSource("LayoutGroupMain","MODULE_NAME",je)}),A.setEvent("open",()=>{var He,nt,dt,Et,yt;V==="SI00DataSetEdit"&&A.FormHelper.setLayoutItemValidateRules("LayoutGroupMain","MODULE_NAME",[{customType:"custom",message:"Invalid Module Name",trigger:"change",validator:(bt,kt)=>{if(kt.trim().length===0)return bt.message="Module Name is required!",Promise.reject();{const Lt=A.FormHelper.getControlValue("LayoutGroupMain","DATASET_NAME");if(Lt.startsWith("DataSet_")&&!kt.startsWith(Lt.substring(8,10)))return bt.message=`Module Name must start with '${Lt.substring(8,10)}'!`,Promise.reject()}return Promise.resolve()}}],!0),(ye==null?void 0:ye.trim().length)>0&&A.FormHelper.setControlReadOnly("LayoutGroupMain",de==="Modify",ye),de==="Add"&&(V==="SI00DataSetEdit"?A.FormHelper.setLayoutItemValidateRules("LayoutGroupMain","DATASET_NAME",[{customType:"regex",message:`Combinations Starting With 'DataSet_${w==null?void 0:w.data.MODULE_ENAME.substring(0,2)}', And Combination Of Three Uppercase Letters Or Digits`,pattern:"^DataSet_[A-Z]{2}[A-Z0-9]{3}$"}],!0):V==="SI00DataSourceEdit"?A.FormHelper.setLayoutItemValidateRules("LayoutGroupMain","FUNC_ID",[{customType:"regex",message:"Combinations Starting With First Module Name, And Combination Of Five Uppercase Letters Or Numbers.",pattern:`^${(He=w==null?void 0:w.data)==null?void 0:He.MODULE_ENAME.substring(0,2)}[A-Z0-9]{5}$`}],!0):V==="SI00FormEdit"?A.FormHelper.setLayoutItemValidateRules("LayoutGroupMain","FORM_NAME",[{customType:"regex",message:"Combinations Starting With Uppercase Letters,Containing Letters, Numbers And Underscores.",pattern:"^[A-Z][A-Za-z0-9_]*$"}],!0):V==="SI00ModuleEdit"&&A.FormHelper.setLayoutItemValidateRules("LayoutGroupMain","MODULE_ENAME",[{customType:"regex",message:(dt=(nt=w==null?void 0:w.data)==null?void 0:nt.NODE_TYPE)!=null&&dt.endsWith("_ROOT")?"Two Uppercase Letters":`Combinations Starting With '${w==null?void 0:w.data.MODULE_ENAME}'', And Combination Of Two Letters, Numbers And Underscores`,pattern:(yt=(Et=w==null?void 0:w.data)==null?void 0:Et.NODE_TYPE)!=null&&yt.endsWith("_ROOT")?"^[A-Z]{2}$":`^${w==null?void 0:w.data.MODULE_ENAME}[a-zA-Z0-9]{2,10}$`}],!0))}),A.setEvent("ok",He=>{He.isModified&&(V==="SI00ModuleEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0115_${He.dataModel.MODULE_ENAME}`,CURRENT_NODE_DESC:He.dataModel.MODULE_CNAME,MODULE_ENAME:He.dataModel.MODULE_ENAME,MODULE_CNAME:He.dataModel.MODULE_CNAME,NODE_TYPE:w==null?void 0:w.data.NODE_TYPE.replace("_ROOT","_MODULE")}):V==="SI00DataSetEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0114_${He.dataModel.DATASET_NAME}`,CURRENT_NODE_DESC:He.dataModel.DATASET_NAME,MODULE_ENAME:He.dataModel.MODULE_NAME,MODULE_CNAME:"",DATASET_NAME:He.dataModel.DATASET_NAME,NODE_TYPE:"SI0114_DATASET"}):V==="SI00DataTableEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0114_${He.dataModel.MODULE_NAME+He.dataModel.DATASET_NAME}`,CURRENT_NODE_DESC:He.dataModel.CDESC,MODULE_ENAME:He.dataModel.MODULE_NAME,TABLE_NAME:He.dataModel.DATASET_NAME,DATATABLE_NAME:He.dataModel.DATASET_NAME,MODULE_CNAME:"",NODE_TYPE:"SI0114_DATATABLE"}):V==="SI00DataSourceEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0112_${He.dataModel.FUNC_ID}`,CURRENT_NODE_DESC:`${He.dataModel.FUNC_ID}(${He.dataModel.FUNCNAME})`,MODULE_ENAME:He.dataModel.MODULE_NAME,FUNCTION_ID:He.dataModel.FUNC_ID,NODE_TYPE:"SI0112_DATASOURCE"}):V==="SI00FormEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0115_${He.dataModel.FORM_NAME}`,CURRENT_NODE_DESC:`${He.dataModel.FORM_NAME}`,MODULE_ENAME:He.dataModel.MODULE_NAME,FORM_NAME:He.dataModel.FORM_NAME,NODE_TYPE:"SI0115_FORM"}):V==="SI00GridViewEdit"||V==="SI00PivotViewEdit"||V==="SI00LayoutEdit"||V==="SI00TreeListEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0115_${He.dataModel.FORM_NAME+He.dataModel.FUNCTION_ID}`,CURRENT_NODE_DESC:`${He.dataModel.FUNCTION_ID}`,FORM_NAME:He.dataModel.FORM_NAME,FUNCTION_ID:He.dataModel.FUNCTION_ID,FUNC_TYPE:V==="SI00GridViewEdit"?"G":V==="SI00PivotViewEdit"?"P":V==="SI00TreeListEdit"?"T":"F",NODE_TYPE:"SI0115_VIEW",DATASET_NAME:He.dataModel.DATASET_NAME,TABLE_NAME:He.dataModel.TABLE_NAME}):V==="SI00CodeClassEdit"?de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0116_${He.dataModel.CODE_CLASS}`,CURRENT_NODE_DESC:`${He.dataModel.CODE_CLASS}(${He.dataModel.CODE_NAME})`,FUNCTION_ID:He.dataModel.CODE_CLASS,NODE_TYPE:"SI0116_BASICCODE"}):V==="SI00SequenceEdit"&&de==="Add"&&(_={PARENT_NODE_CODE:w==null?void 0:w.data.CURRENT_NODE_CODE,CURRENT_NODE_CODE:`SI0117_${He.dataModel.SEQ_CODE}`,CURRENT_NODE_DESC:`${He.dataModel.SEQ_CODE}(${He.dataModel.SEQ_DESC})`,FUNCTION_ID:He.dataModel.SEQ_CODE,NODE_TYPE:"SI0117_SEQUENCE"}),Pe())}),A.setEvent("itemButtonClick",async He=>{if(He.itemCode==="DATASET_NAME")if(He.type==="clear")A.FormHelper.setControlEmptyValue("LayoutGroupMain","DATASET_NAME,TABLE_NAME");else{Z.BordStyle="Fixed";const nt=async()=>{const dt=await F.ER.Core.callService(r,F.ER.Core.buildEiInfo({QUERY_TYPE:"tsi00datasettree"}));return dt.getStatus()<0?(F.ER.Core.messageError(dt.getMsg()),[]):dt.getBlockByIndex(0).getMappedRows()};Z.receiveData(nt),Z.BeforeOkButtonClick=dt=>(dt==null?void 0:dt.NODE_TYPE)!=="DataTable"?!1:dt,Z.show(null,dt=>{dt!=null&&dt.data&&(A.FormHelper.setControlValue("LayoutGroupMain","DATASET_NAME",dt.data.DATASET_NAME),A.FormHelper.setControlValue("LayoutGroupMain","TABLE_NAME",dt.data.DATATABLE_NAME))})}}),A.show(null)},tr=async V=>{const de={};switch(V.NODE_TYPE){case"SI0114_ROOT":case"SI0114_MODULE":{de.popFormName="SI00DataSetInfo",de.checkBlockName="TSI00DATASET_IMP",de.successInfo="Import dataset configuration success!";break}case"SI0112_ROOT":case"SI0112_MODULE":{de.popFormName="SI00DataSourceInfo",de.checkBlockName="TSI00DATASOURCE_IMP",de.successInfo="Import datasource configuration success!";break}case"SI0115_ROOT":case"SI0115_MODULE":{de.popFormName="SI00FormInfo",de.checkBlockName="TSI00FORM_IMP",de.successInfo="Import form configuration success!";break}case"SI0116_ROOT":case"SI0116_MODULE":{de.popFormName="SI00CodeClassInfo",de.checkBlockName="TSI00CODE01_IMP",de.successInfo="Import code configuration success!";break}case"SI0117_ROOT":case"SI0117_MODULE":{de.popFormName="SI00SequenceInfo",de.checkBlockName="TSI00SEQ01_IMP",de.successInfo="Import sequence configuration success!";break}}de.checkBlockName&&F.ER.Core.readFiles(w=>{for(let Oe=0;Oe<w.length;Oe++){const We=new FileReader;We.onload=async Be=>{var ot,He;const ye=new F.ER.EIInfo;J=new F.ER.PopQueryHelper(Ke,de.popFormName,"gridView1",pe),J.ShowCheckBoxColumn=!0,J.ReceiveJsonData=(ot=ye.blocks[de.checkBlockName])==null?void 0:ot.data,de.popFormName==="SI00DataSetInfo"&&(J.ReceiveJsonData=J.ReceiveJsonData.filter(nt=>nt.TYPE==="DataSet"));const je=await J.show(null);if(je.dialogResult==="ok"&&je.checkedItemArray){if(!await F.ER.Core.messageConfirm(F.ER.Core.$t("ERX.ImportOverwriteMessage")))return;const nt=new F.ER.EIInfo;switch(de.popFormName){case"SI00DataSetInfo":{const Et=[],yt=[],bt=[];je.checkedItemArray.forEach(kt=>{const Lt=ye.blocks.TSI00DATASET_IMP.data.filter(Wt=>Wt.MODULE_NAME===kt.DATASET_NAME||Wt.DATASET_NAME===kt.DATASET_NAME);Et.push(...Lt);const g=ye.blocks.TSI00DATATABLE_IMP.data.filter(Wt=>Wt.DATASET_NAME===kt.DATASET_NAME);yt.push(...g);const qt=ye.blocks.TSI00DATARELATION_IMP.data.filter(Wt=>Wt.DATASET_NAME===kt.DATASET_NAME);bt.push(...qt)}),nt.addBlock(F.ER.Core.buildEiBlock(Et,"TSI00DATASET_IMP")),nt.addBlock(F.ER.Core.buildEiBlock(yt,"TSI00DATATABLE_IMP")),nt.addBlock(F.ER.Core.buildEiBlock(bt,"TSI00DATARELATION_IMP"));break}case"SI00DataSourceInfo":{const Et=[];je.checkedItemArray.forEach(yt=>{const bt=ye.blocks.TSI00DATASOURCE_IMP.data.filter(kt=>kt.FUNC_ID===yt.FUNC_ID);Et.push(...bt)}),nt.addBlock(F.ER.Core.buildEiBlock(Et,"TSI00DATASOURCE_IMP"));break}case"SI00FormInfo":{["TSI00FORM","TSI00GRIDVIEW","TSI00GRIDCOLUMN","TSI00GRIDCOLUMNURL","TSI00GRIDSTYLE","TSI00GRIDFORMAT","TSI00GRIDBAND","TSI00FORMBUTTON","TSI00FORMCODECLASS","TSI00FORMCODESETS","TSI00GRIDCONDITION","TSI00FORMRESOURCE","TSI00GRIDVIEW_RES","TSI00GRIDCOLUMN_RES","TSI00GRIDBAND_RES","TSI00FORMCODESETS_RES","TSI00FORMRESOURCE_RES"].forEach(yt=>{var kt;const bt=[];(kt=je.checkedItemArray)==null||kt.forEach(Lt=>{var g;if(ye.blocks[yt+"_IMP"]){const qt=(g=ye.blocks[yt+"_IMP"])==null?void 0:g.data.filter(Wt=>Wt.FORM_NAME===Lt.FORM_NAME);qt&&bt.push(...qt)}}),bt&&nt.addBlock(F.ER.Core.buildEiBlock(bt,yt+"_IMP"))});break}case"SI00CodeClassInfo":{["TSI00CODE01","TSI00CODE02","TSI00CODE01_RES","TSI00CODE02_RES"].forEach(yt=>{var kt;const bt=[];(kt=je.checkedItemArray)==null||kt.forEach(Lt=>{var g;if(ye.blocks[yt+"_IMP"]){const qt=(g=ye.blocks[yt+"_IMP"])==null?void 0:g.data.filter(Wt=>Wt.CODE_CLASS===Lt.CODE_CLASS);qt&&bt.push(...qt)}}),bt&&nt.addBlock(F.ER.Core.buildEiBlock(bt,yt+"_IMP"))});break}case"SI00SequenceInfo":{["TSI00SEQ01","TSI00SEQ02"].forEach(yt=>{var kt;const bt=[];(kt=je.checkedItemArray)==null||kt.forEach(Lt=>{var g;if(ye.blocks[yt+"_IMP"]){const qt=(g=ye.blocks[yt+"_IMP"])==null?void 0:g.data.filter(Wt=>Wt.SEQ_CODE===Lt.SEQ_CODE);qt&&bt.push(...qt)}}),bt&&nt.addBlock(F.ER.Core.buildEiBlock(bt,yt+"_IMP"))});break}}ye.blocks.TSI00MODULE_IMP&&nt.addBlock(ye.blocks.TSI00MODULE_IMP),V.NODE_TYPE.endsWith("MODULE")&&((He=nt.getBlock(de.checkBlockName))==null||He.getMappedRows().forEach(Et=>{de.checkBlockName!=="TSI00DATASET_IMP"&&(Et.MODULE_NAME=V.MODULE_ENAME)}));const dt=await F.ER.Core.callService(i,nt);dt.SysInfo&&dt.SysInfo.Flag<0?F.ER.Core.messageError(dt.getMsg()):F.ER.Core.messageSuccess(de.successInfo)}},We.readAsText(w[Oe])}})},L=V=>{const de={};switch(V.NODE_TYPE){case"SI0114_ROOT":case"SI0114_MODULE":case"SI0114_DATASET":{de.QUERY_TYPE="dataset_export",de.CONFIG_TYPE="DataSet",de.MODULE_NAME=V.MODULE_ENAME,de.DATASET_NAME=V.DATASET_NAME,de.FUNCTION_ID=V.DATASET_NAME;break}case"SI0112_ROOT":case"SI0112_MODULE":case"SI0112_DATASOURCE":{de.QUERY_TYPE="datasource_export",de.CONFIG_TYPE="DataSource",de.MODULE_NAME=V.MODULE_ENAME,de.FUNCTION_ID=V.FUNCTION_ID;break}case"SI0115_ROOT":case"SI0115_MODULE":case"SI0115_FORM":{de.QUERY_TYPE="form_export",de.CONFIG_TYPE="Form",de.MODULE_NAME=V.MODULE_ENAME,de.FORM_NAME=V.FORM_NAME,de.FUNCTION_ID=V.FORM_NAME;break}case"SI0116_ROOT":case"SI0116_MODULE":case"SI0116_BASICCODE":{de.QUERY_TYPE="basiccode_export",de.CONFIG_TYPE="BasicCode",de.MODULE_NAME=V.MODULE_ENAME,de.FUNCTION_ID=V.FUNCTION_ID;break}case"SI0117_ROOT":case"SI0117_MODULE":case"SI0117_SEQUENCE":{de.QUERY_TYPE="sequence_export",de.CONFIG_TYPE="Sequence",de.MODULE_NAME=V.MODULE_ENAME,de.FUNCTION_ID=V.FUNCTION_ID;break}case"SI0110_ROOT":case"SI0110_MODULE":case"SI0110_DATAAUTH":{de.QUERY_TYPE="dataauth_export",de.CONFIG_TYPE="DataAuth",de.MODULE_NAME=V.MODULE_ENAME,de.FUNCTION_ID=V.FUNCTION_ID;break}}return de},ae=async V=>{var de,w,Oe;if((de=V.NODE_TYPE)!=null&&de.endsWith("_ROOT")){if(!await n.messageConfirm("Are you sure to export all configuration data?"))return;(w=V.children)==null||w.forEach(We=>{q(L(We.data))})}else if((Oe=V.NODE_TYPE)!=null&&Oe.startsWith("SI01")){if(!await n.messageConfirm("Are you sure to export configuration data?"))return;q(L(V))}},q=async V=>{var de,w,Oe,We;if(V.QUERY_TYPE){const Be=F.ER.Core.buildEiInfo([V]),ye=await F.ER.Core.callService(r,Be);(de=ye.SysInfo)!=null&&de.Flag&&((w=ye.SysInfo)==null?void 0:w.Flag)<0?F.ER.Core.messageError(ye.getMsg()):((Oe=ye.getBlockByIndex(0).getMappedRows())==null?void 0:Oe.length)>0&&F.ER.Core.saveAsJsonFile(ye,`ER_${V.CONFIG_TYPE}_${V.MODULE_NAME}_${((We=V.FUNCTION_ID)==null?void 0:We.trim())||"All"}_${F.ER.Core.getDateTimeFormatString("Now")}`)}},ee=async(V,de)=>{const w=V.split(",");await F.ER.Core.sleep(250),w.forEach(Oe=>{n.initialGridToolbar(Oe,{addrow:{visible:!(Oe==="gridView7"&&de.NODE_TYPE!=="SI0114_DATATABLE"),action:()=>{if(_)switch(Oe){case"gridView1_Layout":case"gridView1_GridView":case"gridView1_TreeList":case"gridView2":case"gridView11":n.addRowToGrid(Oe,{setDefaultValue:!0,data:{FORM_NAME:_.FORM_NAME,FUNCTION_ID:_.FUNCTION_ID,COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName,ROW_GUID:F.ER.Core.guid()}});break;case"gridView12":n.addRowToGrid(Oe,{setDefaultValue:!0,data:{FORM_NAME:_.FORM_NAME,CODE_CLASS:_.FUNCTION_ID,COMPANY_CODE:n.DefaultConfigCompanyCode,COMPANY_CNAME:n.DefaultConfigCompanyName}});break;case"gridView3":case"gridView4":case"gridView19":n.addRowToGrid(Oe,{setDefaultValue:!0,data:{FORM_NAME:_.FORM_NAME,ROW_GUID:F.ER.Core.guid()}});break;case"gridView7":n.addRowToGrid("gridView7",{setDefaultValue:!0,data:{DATASET_NAME:_.DATASET_NAME,TABLE_NAME:_.TABLE_NAME,MAX_LENGTH:-1,ROW_GUID:F.ER.Core.guid()}});break}},preventDefault:!0},copyrow:{visible:!(Oe==="gridView7"&&de.NODE_TYPE!=="SI0114_DATATABLE")},delete:{visible:!(Oe==="gridView7"&&de.NODE_TYPE!=="SI0114_DATATABLE")},save:{visible:!(Oe==="gridView7"&&de.NODE_TYPE!=="SI0114_DATATABLE"),action:async()=>{we()}},cancel:{visible:!(Oe==="gridView7"&&de.NODE_TYPE!=="SI0114_DATATABLE")}})})},ne=V=>{var de,w,Oe,We,Be;if(V.rowChanged){if(V.data){if(n.setGridColumnEditable("gridView4",V.data.isNew,"CODE_CLASS"),(v==null?void 0:v.length)>0){const ye=v.filter(je=>je.CODE_CLASS===V.data.CODE_CLASS);ye?n.mergeDataToGrid(ye,"gridView5"):n.clearGridData("gridView5")}}else n.clearGridData("gridView5");n.initialGridToolbar("gridView5",{addrow:{visible:((de=V.data)==null?void 0:de.isNew)===!1,action:()=>{V.data&&n.addRowToGrid("gridView5",{setDefaultValue:!0,data:{FORM_NAME:V.data.FORM_NAME,CODE_CLASS:V.data.CODE_CLASS,ROW_GUID:F.ER.Core.guid()}})},preventDefault:!0},copyrow:{visible:((w=V.data)==null?void 0:w.isNew)===!1},delete:{visible:((Oe=V.data)==null?void 0:Oe.isNew)===!1},save:{visible:((We=V.data)==null?void 0:We.isNew)===!1,action:()=>{we()}},cancel:{visible:((Be=V.data)==null?void 0:Be.isNew)===!1}})}},se=V=>{V.rowChanged&&V.data&&n.setGridColumnEditable("gridView12",V.data.isNew,"CODE")},be=V=>{V.rowChanged&&V.data&&n.setGridColumnEditable("gridView19",V.data.isNew,"ITEM_CODE")},Ue=V=>{let de=1;V.api.forEachLeafNode(w=>{w.setDataValue("C_SEQ_ID",String(de).padStart(3,"0")),de++})},De=V=>{let de=1;V.api.forEachLeafNode(w=>{w.setDataValue("C_SEQ_ID",String(de).padStart(3,"0")),de++})},Ae=()=>{var de,w;const V=xe.value.find(Oe=>Oe.CODE===ve.value);return(de=V==null?void 0:V.PARTITION_SERVER)!=null&&de.trim().startsWith("http")?(w=V==null?void 0:V.PARTITION_SERVER)==null?void 0:w.trim():V==null?void 0:V.PARTITION_CODE},Pe=async()=>{const V=F.ER.Core.buildEiInfo([{QUERY_TYPE:"alldevtree",ALLOW_DATAAUTH:"0",ALLOW_DATASOURCE:"1",ALLOW_DATASET:"1",ALLOW_FORMCONFIG:"1",ALLOW_BASICCODE:"1",ALLOW_SEQUENCE:"1",ALLOW_SYSPARAS:"0",ALLOW_TELE:"0"}]),de=await F.ER.Core.callService(r,V,{show:!0,delay:1e3},{messageError:!0});de.getStatus()>=0?(d=ce==null?void 0:ce.setTreeData(de.getBlockByIndex(0).getMappedRows(),_==null?void 0:_.CURRENT_NODE_CODE),F.ER.Core.setLocalStorage("devTreeDefaultServer",ve.value)):d=ce==null?void 0:ce.setTreeData([])},tt=async V=>{const de=F.ER.Core.buildEiInfo([{QUERY_TYPE:"TSI00MODULE",MODULE_TYPE:V}]),w=await F.ER.Core.callService(r,de);return w.SysInfo&&w.SysInfo.Flag<0?(F.ER.Core.messageError(w.getMsg()),[]):w.getBlockByIndex(0).getMappedRows().map(Oe=>({CODE:Oe.MODULE_ENAME,CODE_DESC_1_CONTENT:Oe.MODULE_CNAME}))},k=async()=>{const V=await n.Initialize(Ke,X,"",pe);V.flag>0?(c.value=1,N=new F.ER.PopQueryHelper(Ke,"SI00SysTabCols","LayoutGroupFilter,gridView1",pe),W=new F.ER.PopQueryHelper(Ke,"SI00DataTableCols","LayoutGroupFilter,gridView1",pe),re=new F.ER.PopFormHelper(Ke,"SI00DataRelationEdit",void 0,pe),Se=new F.ER.PopQueryHelper(Ke,"SI00ColumnMultiEdit","LayoutGroupFilter,gridView_GridView",pe),Se.MainViewConfigId="gridView_GridView",ue=new F.ER.PopQueryHelper(Ke,"SI00ColumnMultiEdit","LayoutGroupFilter,gridView_Layout",pe),ue.MainViewConfigId="gridView_Layout",me=new F.ER.PopQueryHelper(Ke,"SI00ColumnMultiEdit","LayoutGroupFilter,gridView_TreeList",pe),me.MainViewConfigId="gridView_TreeList",await l.nextTick(()=>{ie()})):n.messageError("ErFormHelper initialize faild, error msg is ["+V.msg+"]!")},ie=async()=>{var V;if((V=t.options)!=null&&V.isDevPlat)Pe();else if(c.value===1&&xe.value.length>0){await F.ER.Core.sleep(630);const de=F.ER.Core.getLocalStorage("devTreeDefaultServer");de&&xe.value.find(w=>w.CODE===de)?ve.value=de:ve.value=xe.value[0].CODE,ht(ve.value),Pe()}},Ce=async V=>{var Oe,We,Be;n.FormDataSet.clear();const de=F.ER.Core.buildEiInfo([V]),w=await F.ER.Core.callService(r,de);if(w.getStatus()<0){F.ER.Core.messageError(w.getMsg());return}switch(V==null?void 0:V.QUERY_TYPE){case"tsi00trace":{n.mergeDataToGrid(w,"gridView0");break}case"si0114_details":{n.mergeEiInfoToGrid(w,"gridView7,gridView8,gridView9"),(Oe=n.getGridApi("gridView7"))==null||Oe.expandAll(),(We=n.getGridApi("gridView8"))==null||We.expandAll();break}case"si0115_view":{n.mergeEiInfoToGrid(w,V.FUNC_TYPE==="G"||V.FUNC_TYPE==="P"?`${G.value},gridView2,treeList1,gridView11`:`${G.value},gridView11`),n.reloadDropDownDataSource(G.value,"FIELD_NAME",w.getBlock("BINDING_FIELDS"));break}case"tsi00code01_detail":n.mergeDataToLayoutOrGrid(w,!0,"LayoutGroupCodeClass,gridView12");case"tsi00seq_detail":n.mergeEiInfoToGrid(w,"gridView13,gridView14");case"si0112_details":if(w.getBlock("TSI00GRIDVIEW_DATASOURCE")&&n.mergeEiBlockToGrid(w.getBlock("TSI00GRIDVIEW_DATASOURCE"),"gridView10"),w.getBlock("TSI00DATASOURCE")){const ye=w.getBlock("TSI00DATASOURCE").getMappedRows();if((ye==null?void 0:ye.length)>0){let je=F.ER.Core.toString(ye[0].SQL_CONTENT);F.ER.Core.toString(ye[0].GROUP_KEY_VALUE).trim().length>0&&(je+=`
83
83
  group by `+F.ER.Core.toString(ye[0].GROUP_KEY_VALUE).trim()),F.ER.Core.toString(ye[0].PRI_KEY_SQL).trim().length>0&&(je+=`