@gct-paas/core-web 0.1.6-dev.18 → 0.1.6-dev.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{JsBarcode-BHGaO9dz.js → JsBarcode-nqhcZPvn.js} +2 -2
- package/dist/{_plugin-vue_export-helper-CVA7dXVu.js → _plugin-vue_export-helper-CyelNe0I.js} +2 -2
- package/dist/{chunk-BNkb119g.js → chunk-C9ZKDnvz.js} +1 -1
- package/dist/components-DtFY5KCF.js +2 -0
- package/dist/{cropper-CYj8Bfd1.js → cropper-BuY_n52N.js} +2 -2
- package/dist/{de_DE-CqvjMewI.js → de_DE-B3kLT_zG.js} +2 -2
- package/dist/{defineProperty-YzDFxjHJ.js → defineProperty-DiReHMuo.js} +1 -1
- package/dist/{diagram-config-item-C0dNHnv8.js → diagram-config-item-DYCiDqAy.js} +2 -2
- package/dist/{diagram-config-item-reverse-CPqmFsFd.js → diagram-config-item-reverse-BKf_yXvB.js} +2 -2
- package/dist/{diagram-config-item-virtual-CqPkYosK.js → diagram-config-item-virtual-Dw36zOeJ.js} +2 -2
- package/dist/{en_US-Cy3_1Rt6.js → en_US-tZ7NgN80.js} +2 -2
- package/dist/{es_ES-C6ghJagB.js → es_ES-DY2QXYwT.js} +2 -2
- package/dist/{fr_FR-B_boR4BS.js → fr_FR-DbN-1gO0.js} +2 -2
- package/dist/{hooks-BqvX2KLt.js → hooks-BuOffqGU.js} +2 -2
- package/dist/{icon-next-picker-CMsbLe7r.js → icon-next-picker-BmnIn29K.js} +1 -1
- package/dist/index.min.css +1 -1
- package/dist/{ja_JP-DhLuasFw.js → ja_JP-BRcXbHEH.js} +2 -2
- package/dist/loader.esm.min.js +2 -2
- package/dist/{monaco-editor-Cl_E7g__.js → monaco-editor-CHnBEX6V.js} +2 -2
- package/dist/{objectSpread2-B962Mxf_.js → objectSpread2-BHKS0stT.js} +1 -1
- package/dist/{overlayscrollbars-vue-BfwUd3EM.js → overlayscrollbars-vue-Cc8URtSg.js} +1 -1
- package/dist/{pt_PT-BdlIINyT.js → pt_PT-DjiZFPmH.js} +2 -2
- package/dist/{relationship-diagram-config-GxEGtkql.js → relationship-diagram-config-BwVOMUAb.js} +2 -2
- package/dist/{rich-editor-D7vzpB9U.js → rich-editor-DfsJmv_B.js} +2 -2
- package/dist/{ru_RU-Bw0Fk9MV.js → ru_RU-Dw9N99Ox.js} +2 -2
- package/dist/template-D-UpvSne.js +2 -0
- package/dist/{tr_TR-CUUs9qjY.js → tr_TR-DCCv6rhK.js} +2 -2
- package/dist/{useMonacoEditor-BDC4VLbE.js → useMonacoEditor-C3S2BSui.js} +2 -2
- package/dist/{vi_VN--jG2lM6p.js → vi_VN-BNMXRAom.js} +2 -2
- package/dist/{zh_CN-Br1qCqWn.js → zh_CN-ywcxTWfr.js} +2 -2
- package/dist/{zh_TW-BMGkBv3z.js → zh_TW-DL4FRJVy.js} +2 -2
- package/es/components/design-view-layout/design-view-layout.mjs +3 -2
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +11 -1
- package/es/components/ui/basic-grid/basic-grid.vue.d.ts +81 -0
- package/es/components/ui/basic-grid/basic-grid.vue.mjs +7 -0
- package/es/components/ui/basic-grid/basic-grid.vue_vue_type_script_setup_true_name_basic-grid_lang.mjs +134 -0
- package/es/components/ui/basic-grid/basic-grid.vue_vue_type_style_index_0_scoped_e9d09c1d_lang.css +90 -0
- package/es/components/ui/basic-grid/index.d.ts +3 -0
- package/es/components/ui/basic-grid/index.mjs +1 -0
- package/es/components/ui/basic-grid/types.d.ts +6 -0
- package/es/components/ui/embed-grid/embed-grid.vue.d.ts +62 -0
- package/es/components/ui/embed-grid/embed-grid.vue.mjs +7 -0
- package/es/components/ui/embed-grid/embed-grid.vue_vue_type_script_setup_true_name_embed-grid_lang.mjs +73 -0
- package/es/components/ui/embed-grid/index.d.ts +3 -0
- package/es/components/ui/embed-grid/index.mjs +1 -0
- package/es/components/ui/embed-grid/types.d.ts +5 -0
- package/es/components/ui/form-alert/form-alert.vue.d.ts +10 -0
- package/es/components/ui/form-alert/form-alert.vue.mjs +7 -0
- package/es/components/ui/form-alert/form-alert.vue_vue_type_script_setup_true_name_form-alert_lang.mjs +31 -0
- package/es/components/ui/form-alert/form-alert.vue_vue_type_style_index_0_scoped_a6bdad9c_lang.css +64 -0
- package/es/components/ui/grid-btns/grid-btns.vue.d.ts +2 -0
- package/es/components/ui/grid-btns/grid-btns.vue.mjs +7 -0
- package/es/components/ui/grid-btns/grid-btns.vue_vue_type_script_setup_true_name_grid-btns_lang.mjs +15 -0
- package/es/components/ui/grid-btns/grid-btns.vue_vue_type_style_index_0_scoped_e3385a9e_lang.css +70 -0
- package/es/components/ui/grid-pagination/grid-pagination.vue.d.ts +12 -0
- package/es/components/ui/grid-pagination/grid-pagination.vue.mjs +7 -0
- package/es/components/ui/grid-pagination/grid-pagination.vue_vue_type_script_setup_true_name_grid-pagination_lang.mjs +57 -0
- package/es/components/ui/grid-pagination/grid-pagination.vue_vue_type_style_index_0_scoped_4905eabf_lang.css +68 -0
- package/es/components/ui/grid-pagination/index.d.ts +3 -0
- package/es/components/ui/grid-pagination/index.mjs +1 -0
- package/es/components/ui/grid-pagination/types.d.ts +24 -0
- package/es/components/ui/highlight/highlight.vue.d.ts +6 -0
- package/es/components/ui/highlight/highlight.vue.mjs +7 -0
- package/es/components/ui/highlight/highlight.vue_vue_type_script_setup_true_name_highlight_lang.mjs +30 -0
- package/es/components/ui/highlight/highlight.vue_vue_type_style_index_0_scoped_e17c6606_lang.css +6 -0
- package/es/components/ui/icon-tooltip/icon-tooltip.vue.d.ts +10 -0
- package/es/components/ui/icon-tooltip/icon-tooltip.vue.mjs +7 -0
- package/es/components/ui/icon-tooltip/icon-tooltip.vue_vue_type_script_setup_true_name_icon-tooltip_lang.mjs +27 -0
- package/es/components/ui/icon-tooltip/icon-tooltip.vue_vue_type_style_index_0_scoped_a35580e4_lang.css +68 -0
- package/es/components/ui/index.d.ts +10 -0
- package/es/components/ui/index.mjs +12 -0
- package/es/components/ui/modal-wrapper/modal-wrapper.vue.d.ts +26 -0
- package/es/components/ui/modal-wrapper/modal-wrapper.vue.mjs +7 -0
- package/es/components/ui/modal-wrapper/modal-wrapper.vue_vue_type_script_setup_true_name_modal-wrapper_lang.mjs +78 -0
- package/es/components/ui/modal-wrapper/modal-wrapper.vue_vue_type_style_index_0_scoped_6b8a9609_lang.css +28 -0
- package/es/components/ui/notice/index.d.ts +8 -0
- package/es/components/ui/notice/index.mjs +31 -0
- package/es/index.mjs +11 -2
- package/es/modules/gct-table/editor/gct-table-date/gct-table-date.mjs +1 -1
- package/es/modules/gct-table/editor/gct-table-text/gct-table-text.mjs +1 -1
- package/package.json +9 -7
- package/dist/components-DjUk_DX6.js +0 -2
- package/dist/template-CbCwf9Cr.js +0 -2
- /package/es/modules/gct-table/editor/{gct-table-text/gct-table-text.css → gct-table-date/gct-table-date.css} +0 -0
package/dist/loader.esm.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @gct-paas/core-web v0.1.6-dev.
|
|
2
|
-
import{i as e}from"./chunk-BNkb119g.js";import{t}from"./defineProperty-YzDFxjHJ.js";import{a,i as l,r as o,t as i}from"./diagram-config-item-virtual-CqPkYosK.js";import{$ as s,A as n,B as r,C as d,D as u,F as c,G as p,H as v,I as m,J as h,K as y,L as f,M as g,N as b,O as _,P as E,Q as w,S as T,T as C,U as R,V as S,X as x,Y as O,Z as k,_ as D,_t as I,a as L,at as M,b as A,bt as N,c as U,ct as P,d as V,dt as F,et as j,f as B,ft as K,g as G,gt as $,h as z,ht as H,i as q,it as Y,j as X,k as W,l as Z,lt as J,m as Q,mt as ee,n as te,nt as ae,o as le,ot as oe,p as ie,pt as se,q as ne,r as re,rt as de,s as ue,st as ce,t as pe,tt as ve,u as me,ut as he,v as ye,vt as fe,w as ge,x as be,y as _e,yt as Ee,z as we}from"./components-DjUk_DX6.js";import{C as Te,E as Ce,M as Re,P as Se,S as xe,_ as Oe,a as ke,b as De,c as Ie,d as Le,f as Me,g as Ae,h as Ne,i as Ue,l as Pe,m as Ve,n as Fe,o as je,p as Be,r as Ke,s as Ge,t as $e,u as ze,x as He,y as qe}from"./_plugin-vue_export-helper-CVA7dXVu.js";import{n as Ye,r as Xe,t as We}from"./useMonacoEditor-BDC4VLbE.js";import{r as Ze,t as Je}from"./relationship-diagram-config-GxEGtkql.js";import{i as Qe,o as et,r as tt,s as at}from"./hooks-BqvX2KLt.js";import{t as lt}from"./diagram-config-item-C0dNHnv8.js";import{t as ot}from"./diagram-config-item-reverse-CPqmFsFd.js";import{BasicAction as it,CategoryModuleEnum as st,EditorRegisterConst as nt,ExpressionModeEnum as rt,FIELD_TYPE as dt,FormContainerType as ut,FormDesignEnum as ct,PrintModeEnums as pt,PrintResourceEnum as vt,PrintTypeEnum as mt,SEARCH_SERVICE as ht,SizeEnum as yt,TreeHelper as ft,cacheFnReturn as gt,cssLoader as bt,dataURLtoBlob as _t,fileUrlParser as Et,getInterfaceApi as wt,modelLoader as Tt,presetColor as Ct,t as Rt,transformUrl as St,useCopyToClipboard as xt,useModal as Ot,useNamespace as kt,useUUid as Dt,uuid2 as It}from"@gct-paas/core";import{Fragment as Lt,computed as Mt,createBlock as At,createCommentVNode as Nt,createElementBlock as Ut,createElementVNode as Pt,createSlots as Vt,createTextVNode as Ft,createVNode as jt,defineAsyncComponent as Bt,defineComponent as Kt,getCurrentInstance as Gt,h as $t,inject as zt,isVNode as Ht,mergeProps as qt,nextTick as Yt,normalizeClass as Xt,normalizeStyle as Wt,onBeforeMount as Zt,onBeforeUnmount as Jt,onMounted as Qt,onUnmounted as ea,openBlock as ta,provide as aa,reactive as la,ref as oa,render as ia,renderList as sa,renderSlot as na,resolveComponent as ra,resolveDynamicComponent as da,toDisplayString as ua,toRaw as ca,toRef as pa,toRefs as va,unref as ma,vShow as ha,watch as ya,watchEffect as fa,withCtx as ga,withDirectives as ba,withKeys as _a,withModifiers as Ea}from"vue";import{clone as wa,cloneDeep as Ta,debounce as Ca,defaults as Ra,groupBy as Sa,has as xa,isBoolean as Oa,isEmpty as ka,isFunction as Da,isNil as Ia,isString as La,merge as Ma,omit as Aa,pick as Na,pickBy as Ua,throttle as Pa}from"lodash-es";import Va,{Checkbox as Fa,CheckboxGroup as ja,Collapse as Ba,DatePicker as Ka,Form as Ga,Image as $a,Input as za,Modal as Ha,Radio as qa,RadioButton as Ya,RadioGroup as Xa,Select as Wa,Space as Za,Spin as Ja,Tooltip as Qa,TreeSelect as el,Upload as tl,message as al}from"ant-design-vue";import ll from"dayjs";import{coreComponentsCreateAppVue as ol}from"@gct-paas/core-components";import il from"vuedraggable";import*as sl from"@ant-design/icons-vue";import{CloseOutlined as nl,DeleteOutlined as rl,EditOutlined as dl,ExclamationCircleOutlined as ul,EyeOutlined as cl,LeftOutlined as pl,PlusOutlined as vl,ReloadOutlined as ml,RightOutlined as hl}from"@ant-design/icons-vue";import{VxeColumn as yl,VxeTable as fl}from"vxe-table";import{DotEndpoint as gl,FlowchartConnector as bl}from"@jsplumb/browser-ui";var _l=/* @__PURE__ */function(e){return e.PREFIX="EDITOR___",e}({}),El=/* @__PURE__ */function(e){return e.LENGTH_UNIT="length-unit",e.COLOR="color",e.SPAN="span",e.TEXT="text",e.NUMBER="number",e.INFO="info",e.MSG="msg",e.SELECT="select",e.SELECT_GROUP="select-group",e.RADIO="radio",e.PICKER="picker",e.MULTIPLE_CHOICE="multiple-choice",e.I18N="i18n",e.TEXTAREA="textarea",e.DATE_RANGE="date-range",e.SWITCH="switch",e.CHECK_SWITCH="check-switch",e.ICON_SELECT="icon-select",e.CHECKBOX="checkbox",e.DATE="date",e.MODEL_SELECT="model-select",e.ACTION="action",e.TABLE="table",e.SELECT_TABLE="select-table",e.EMPTY="empty",e.FORM_MODEL_FIELD_SELECT="form-model-field-select",e.PIXEL_CONFIG="pixel-config",e.FIELD_INFO="field-info",e.DATE_FORMAT_SELECT="date-format-select",e.FORMULA="formula",e}({}),wl="formController",Tl=class{constructor(){t(this,"loaded",!1),t(this,"count",0),t(this,"isNew",!0),t(this,"loading",!1),t(this,"destroyed",!1),t(this,"data",{})}},Cl=class{constructor(){t(this,"disabled",!1),t(this,"readonly",!1),t(this,"visible",!0),t(this,"keepalive",!1),t(this,"destroyed",!1)}},Rl=class extends Cl{},Sl=class extends Cl{},xl=class extends Cl{constructor(...e){super(...e),t(this,"activePane","")}},Ol=class extends Cl{},kl=class extends Cl{constructor(...e){super(...e),t(this,"label",""),t(this,"value",null),t(this,"options",[])}},Dl=class extends Cl{constructor(...e){super(...e),t(this,"expand",!0)}},Il=class extends kl{},Ll=class extends Cl{};function Ml(e,t,a,l){return{install(o){e&&t&&_gct.register.editor.register(_l.PREFIX+e,t),a&&o.component(l??a.name,a)}}}function Al(e,t){const a=e.split(".");try{return a.reduce((e,t)=>e[t],t)}catch(l){console.warn(l)}}function Nl(e,t,a){const l=t.split("."),o=l.length-1;l.reduce((t,a,l)=>(l===o?t[a]=e:t[a]||(t[a]={}),t[a]),a)}var Ul=class{constructor(e){t(this,"model",void 0),t(this,"evt",new a),t(this,"state",la(new Tl)),t(this,"item",{}),t(this,"provider",{}),t(this,"context",{}),t(this,"params",{}),t(this,"fields",[]),t(this,"modelMap",{}),this.model=e,this.init()}init(){this.model.children&&this.initFormItems(this.model.children),this.initEvent(),this.calcState()}initEvent(){}calcState(){}initFormItems(e){e.forEach(e=>{let t=null;if("item"!==e.type&&"hidden"!==e.type||(this.fields.push(e.name),this.modelMap[e.name]=e),"item"===e.type&&(t=_gct.register.formItem.create(`${e.type}___${e.editor.type}___${e.name}`),t||(t=_gct.register.formItem.create(`${e.type}___${e.editor.type}`))),t||(t=_gct.register.formItem.create(e.type)),t){if(this.provider[e.name]=t,"item"===e.type){const a=e;this.item[a.name]=t.createController(this,a)}else if("hidden"===e.type){const a=e;this.item[a.name]=t.createController(this,a)}else if("container"===e.type||e.isContainer||e.container){const a=e;this.item[e.name]=t.createController(this,a),a.children&&this.initFormItems(a.children)}}else console.error(`未找到表单项提供者:${e.type}`,e)})}calcHidden(){Object.keys(this.item).forEach(e=>{const t=this.item[e];if(t.model.hidden){const e=t.model.hidden(this,t,this.state.data);null!=e&&(t.state.visible=!e)}})}getData(){const e={};return this.fields.forEach(t=>{const a=this.item[t];!a||!0!==a.state.visible&&"hidden"!==a.model.type&&-1===t.indexOf(".")||Nl(a.value,a.key,e)}),e}resetData(){this.fields.forEach(e=>{const t=this.item[e];t&&t.reset()})}async load(){try{if(!this.model.loadRequest)return{};this.state.loading=!0;const e=await this.model.loadRequest({id:this.context.id});return this.fields.forEach(t=>{const a=this.item[t];a&&(a.value=e[a.key]),a.defaultValue()}),this.state.loaded=!0,e}finally{this.state.loading=!1}}destroy(){this.state.destroyed=!0,this.evt.reset(),this.fields.forEach(e=>{const t=this.item[e];t&&t.destroy()})}validate(){return Promise.resolve(!0)}validateItem(e){return Promise.resolve(!0)}loaded(){this.calcHidden(),this.fields.forEach(e=>{const t=this.item[e];t?t.defaultValue():console.warn(`表单项控制器未找到:${e}`)}),this.calcState()}mounted(){}},Pl=class extends Ul{initEvent(){super.initEvent(),this.evt.on("change",(e,t,a)=>{if(this.model.watch){const l=this.model.watch[e];l&&l(this,t,a)}const l=this.item[e];l&&l.model.watch&&l.model.watch(this,l,t,a),l&&l.model.change&&l.model.change(this,l,this.state.data),t!=a&&this.calcHidden()})}save(){const e=this.getData();return!0===this.state.isNew&&this.model.newRequest?this.model.newRequest(e):this.model.updateRequest?this.model.updateRequest({id:this.context.id},e):Promise.resolve(e)}};function Vl(e){const t=e();return t.state=la(t.state),ea(()=>t.destroy()),t}var Fl=class{constructor(e){t(this,"model",void 0),t(this,"options",[]),this.model=e,this.init()}init(){if(this.model.codeList)"static"===this.model.codeList.mode&&this.model.codeList.items&&(this.options=this.model.codeList.items);else if(this.model.codeTag){const e=_gct.dictionary.getConfig(this.model.codeTag);e&&"static"===e.mode&&(this.options=_gct.dictionary.get(this.model.codeTag))}}},jl=class{get key(){return this.model.name}get data(){return this.form.state.data}constructor(e,a){t(this,"form",void 0),t(this,"model",void 0),t(this,"state",this.crateItemState()),this.form=e,this.model=a,this.init()}init(){}destroy(){this.state.destroyed=!0}defaultValue(){const e=this.form.state.data;null==Al(this.key,e)&&null!=this.model.defaultValue&&Nl(this.model.defaultValue,this.key,e)}crateItemState(){return new Cl}};function Bl(e){const t=e();return t.state=la(t.state),t}var Kl=class extends jl{constructor(...e){super(...e),t(this,"type","collapse-pane")}crateItemState(){return new Rl}},Gl=class extends jl{constructor(...e){super(...e),t(this,"type","collapse")}crateItemState(){return new Sl}},$l=class extends jl{constructor(...e){super(...e),t(this,"type","tab")}crateItemState(){return new xl}},zl=class extends jl{constructor(...e){super(...e),t(this,"type","tab-pane")}crateItemState(){return new Ol}},Hl=class extends jl{constructor(...e){super(...e),t(this,"type","group")}crateItemState(){return new Dl}},ql=class extends jl{get key(){return this.model.field??this.model.name}get value(){return Al(this.key,this.form.state.data)}set value(e){const t=this.form.state.data,a=Ta(Al(this.key,t));Nl(e,this.key,t),this.form.evt.emit("change",this.key,e,a),this.state.value=e}get editorValue(){return this.model.fields?this.model.fields.map(e=>this.form.item[e].value):this.value}set editorValue(e){this.model.fields?this.model.fields.forEach((t,a)=>{this.form.item[t].value=null==e?void 0:e[a]}):this.value=e}init(){if(super.init(),"hidden"!==this.model.type){const{editor:e}=this.model;this.state.readonly=e.readonly,null!=e.disabled&&(this.state.disabled=e.disabled)}if(this.model.dictionary){const{mode:e}=this.model.dictionary;"static"===e&&(this.state.options=this.model.dictionary.items||[])}}blur(){null!=this.state.value&&""!==this.state.value||null==this.model.defaultValue||(this.value=this.model.defaultValue,this.form.evt.emit("blur",this.key,this.value))}reset(){void 0!==this.model.defaultValue?this.value=this.model.defaultValue:this.value=void 0}crateItemState(){return new kl}},Yl=class extends ql{constructor(...e){super(...e),t(this,"type","item")}async loadDictionary(e,t){if(this.state.options.length>0&&!0!==t)return this.state.options;this.state.options=[],this.state.loading=!0;try{return this.model.dictionary?this.state.options=await _gct.dictionary.asyncGetByConfig(this.model.dictionary,e):this.model.dictionaryTag&&(this.state.options=await _gct.dictionary.asyncGet(this.model.dictionaryTag,e)),this.state.options}finally{this.state.loading=!1}}clearDictionary(){this.state.options=[]}crateItemState(){return new Il}},Xl=class extends jl{constructor(...e){super(...e),t(this,"type","hidden")}},Wl=class extends jl{constructor(...e){super(...e),t(this,"type","line")}crateItemState(){return new Ll}};function Zl(){return zt("formController")}function Jl(e){let t=null;if(e){const a=Zl().item[e];a&&(t=Mt({get:()=>a.value,set(e){"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||(a.value=e)}}))}else{let e=Gt().proxy;const a=e.$props,l=e.$emit;t=Mt({get:()=>a.value,set:e=>{"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||l("update:value",e)}}),e=null}return t}function Ql(e,t){let a=Gt().proxy;const l=a.$props,o=a.$emit,i=e?e.length:0,s=t?t.length:0;return a=null,Mt({get:()=>{if(!l.value)return"";let a=l.value;return i>0&&a.startsWith(e)&&(a=a.substring(i)),s>0&&a.endsWith(t)&&(a=a.substring(0,a.length-s)),a},set:a=>{if(l.value===a)return;if(""==a)return void o("update:value","");let n=a;i>0&&(n=e+n),s>0&&(n+=t),o("update:value",n)}})}function eo(){let e=Gt().proxy;const t=e.$props,a=e.$emit,l=oa(t.value);return ya(()=>t.value,e=>{l.value!==e&&(l.value=e)}),ya(l,(e,t)=>{t!==e&&a("update:value",e)}),e=null,l}function to(){return{context:{type:Object,default:()=>({})},value:{type:Object},model:{type:Object,required:!0},c:{type:Object,required:!0},itemModel:{type:Object},data:{type:Object},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},keepalive:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},size:{type:String},count:{type:Number,default:0},isEmptyText:{type:Boolean,default:!1}}}var ao=class{constructor(){t(this,"editors",/* @__PURE__ */new Map),t(this,"providers",/* @__PURE__ */new Map)}register(e,t){this.editors.set(e,t)}unregister(e){this.editors.delete(e)}get(e){if(this.providers.has(e))return this.providers.get(e);const t=this.editors.get(e);if(t){const a=t();return this.providers.set(e,a),a}return null}},lo=class{constructor(){t(this,"items",/* @__PURE__ */new Map)}register(e,t){this.items.set(e,t)}unregister(e){this.items.delete(e)}create(e){const t=this.items.get(e);return t?t():null}},oo=/* @__PURE__ */Kt({name:"GctFormItem",props:{c:{type:Object,required:!0},formModel:{type:Object,required:!0},model:{type:Object,required:!0},count:{type:Number,default:0},context:{type:Object,default:()=>({})}},setup(e){const t=kt("form-item"),a={};e.formModel.labelWidth&&(a[t.cssVarName("form-item-label-width")]=e.formModel.labelWidth),e.model.labelWidth&&(a[t.cssVarName("form-item-label-width")]=e.model.labelWidth),e.model.labelAlign&&(a[t.cssVarName("form-item-label-align")]=e.model.labelAlign),e.model.editorAlign&&(a[t.cssVarName("form-item-editor-align")]=e.model.editorAlign),e.model.width&&(a[t.cssVarName("form-item-width")]=e.model.width),e.model.margin&&(a.margin=e.model.margin),e.model.padding&&(a.padding=e.model.padding);const l=Mt(()=>{var t;return!!(null===(t=e.model.rules)||void 0===t?void 0:t.find(e=>e.required))});return{ns:t,style:a,required:l,renderLabelTooltip:()=>e.model.labelTooltip?jt(ra("a-tooltip"),{class:t.e("label-tooltip"),overlayClassName:t.e("label-tooltip-overlay"),overlayStyle:{width:e.model.labelTipWidth},placement:"top",title:e.model.labelTooltip},{default:()=>[jt("span",{class:"iconfont icon-assist ml5px text-[#bfbfbf]"},null)]}):null}},render(){const e=_gct.register.editor.get(nt.PREFIX+this.model.editor.type);if(!e)return console.error(`未找到表单项${this.model.name}的编辑器${this.model.editor.type}的适配器实例:`,this.model),null;const t=this.model.labelPosition||"left";let a=null;e?e.render?a=e.render(this.c.editorValue,this.c.data,this.model):e.component?a=$t("string"==typeof e.component?ra(e.component):e.component,{key:this.model.name,c:this.c,value:this.c.editorValue,itemModel:this.model,model:this.model.editor,data:this.c.data,disabled:this.c.state.disabled,readonly:this.c.state.readonly,keepalive:this.c.state.keepalive,visible:this.c.state.visible,size:this.formModel.size,count:this.count,isEmptyText:this.formModel.isEmptyText,context:this.context,class:[this.ns.e("editor"),this.ns.e(t),this.formModel.size?this.ns.m(this.formModel.size):null,this.model.editor.class],style:this.model.editor.style,"onUpdate:value":e=>{this.c.editorValue=e},onBlur:()=>{this.c.blur()}}):console.error(`未找到编辑器绘制组件:${this.model.name} - ${this.model.editor.type},请实现 component 或 render 方法`):console.error(`未找到编辑器适配器:${this.model.name} - ${this.model.editor.type}`),this.model.label&&"top"===t&&(a=[jt("div",{class:[this.ns.e("label"),this.ns.em("label",t)]},[this.model.label,this.renderLabelTooltip()]),a]);const l={default:()=>a};var o;return"left"===t&&this.model.label&&(l.label=()=>[jt("span",null,[this.model.label]),this.renderLabelTooltip()]),!1!==this.c.state.visible?jt(ra("a-form-item"),{key:this.c.model.name,count:this.count,colon:!0!==this.formModel.noColon&&!0!==this.model.noColon,name:this.model.name.split("."),label:void 0,class:[this.ns.b(),this.ns.is("readonly",!0===this.model.editor.readonly),this.ns.is("required",this.required),this.ns.is("hidden-label",!this.model.label),this.ns.m("label-"+t),this.ns.is("hidden-error",!0===this.model.hiddenError||!0===this.formModel.hiddenError)],style:this.style,rules:!0===this.c.state.visible?this.model.rules:[],layout:"horizontal"},"function"==typeof(o=l)||"[object Object]"===Object.prototype.toString.call(o)&&!Ht(o)?l:{default:()=>[l]}):void 0}}),io=/* @__PURE__ */Kt({name:"GctForm",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=kt("form");aa(wl,e.c);const a=oa(),l=e.c;Object.keys(l.item).forEach(e=>{const t=l.item[e];t.state=la(t.state)});const o=t=>jt(ra("gct-form-item"),{class:t.class,style:t.style,count:l.state.count,c:l.item[t.name],formModel:e.model,model:t,context:e.context},null),i=t=>{const a=l.provider[t.name];return a?a?$t("string"==typeof a.component?ra(a.component):a.component,{key:t.name,model:t,count:l.state.count,c:l.item[t.name],data:l.state.data,class:t.class,style:t.style,context:e.context},{default:()=>s(t.children||[])}):void console.error(`未找到表单容器适配器:${t.name} - ${t.type}`):(console.error(`未找到表单项适配器实例:${t.name}`,t),null)},s=e=>{if(!e)return[];const t=[];return e.forEach(e=>{if("hidden"===e.type)return null;let a=null;const l=e;a="container"===l.type||l.isContainer||l.container?i(l):o(e),a&&t.push(a)}),t},n={};return e.model.labelWidth&&(n[t.cssVarName("form-item-label-width")]=e.model.labelWidth),{ns:t,formRef:a,staticStyle:n,renderItem:o,renderContainer:i,renderChildren:s}},render(){let e;return jt(ra("a-form"),{ref:"formRef",layout:this.model.layout,model:this.c.state.data,count:this.c.state.count,class:[this.ns.b(),this.ns.is("info",!0===this.model.info),this.model.size?this.ns.m(this.model.size):null],autocomplete:"off",style:this.staticStyle},"function"==typeof(t=e=this.model.children.map(e=>this.renderContainer(e)))||"[object Object]"===Object.prototype.toString.call(t)&&!Ht(t)?e:{default:()=>[e]});var t}}),so=class{constructor(){t(this,"component","gct-form-item")}createController(e,t){return Bl(()=>new Yl(e,t))}},no=class{constructor(){t(this,"component","gct-form-hidden-item")}createController(e,t){return Bl(()=>new Xl(e,t))}},ro=class{constructor(){t(this,"component","gct-form-collapse-pane")}createController(e,t){return Bl(()=>new Kl(e,t))}};function uo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var co=/* @__PURE__ */Kt({name:"GctFormCollapsePane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=kt("form-collapse-pane"),a={};return e.model.width&&(a[t.cssVarName("form-collapse-pane-width")]=e.model.width),e.model.height&&(a[t.cssVarName("form-collapse-pane-height")]=e.model.height),{ns:t,style:a,renderContainer:function(t){return"flex"===e.model.layout?jt(ra("flex-container"),{layout:e.model.flex},uo(t)?t:{default:()=>[t]}):"grid"===e.model.layout?jt(ra("grid-container"),{layout:e.model.grid},uo(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[],l=a[a.length-1];return l&&(l.props=qt(l.props||{},{class:this.ns.e("last-child")})),jt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),po=class{constructor(e,a,l,o){t(this,"type","collapse-pane"),t(this,"isContainer",!0),t(this,"title",void 0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"collapsible",void 0),this.name=e,this.title=a,l&&Object.assign(this,l),o&&(this.children=o)}},vo={install(e){_gct.register.formItem.register("collapse-pane",()=>new ro),e.component(co.name,co)}},mo=class{constructor(){t(this,"component","gct-form-collapse")}createController(e,t){return Bl(()=>new Gl(e,t))}},ho=/* @__PURE__ */Kt({name:"GctFormCollapse",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){var t;const a=kt("form-collapse"),l=oa([0]),o={};e.model.width&&(o[a.cssVarName("form-collapse-width")]=e.model.width),e.model.height&&(o[a.cssVarName("form-collapse-height")]=e.model.height);const i=oa([]);return i.value=(null===(t=e.model.children)||void 0===t?void 0:t.map(e=>e.name))||[],{ns:a,keys:l,style:o,activeKeys:i,expandIconPosition:Mt(()=>"left"===e.model.expandIconPosition?"left":"right")}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return jt(Ba,{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.ns.m("icon-"+(this.model.expandIconStyle||"up-down"))],style:this.style,accordion:this.model.accordion,expandIconPosition:this.expandIconPosition,activeKey:this.activeKeys,"onUpdate:activeKey":e=>this.activeKeys=e},{default:()=>{var e;return[null===(e=this.model.children)||void 0===e?void 0:e.map((e,t)=>{if(!1===a[t].props.c.state.visible)return;const l=!1!==e.collapsible?void 0:"disabled";return jt(Ba.Panel,{key:e.name,header:e.title,collapsible:l},{default:()=>[a[t]]})})]}})}}),yo=class{constructor(e,a,l){t(this,"type","collapse"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"accordion",void 0),t(this,"expandIconPosition",void 0),t(this,"expandIconStyle",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},fo={install(e){_gct.register.formItem.register("collapse",()=>new mo),e.component(ho.name,ho)}},go=class{constructor(){t(this,"component","gct-form-group")}createController(e,t){return Bl(()=>new Hl(e,t))}},bo=/* @__PURE__ */Kt({name:"GctFormGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e,{slots:t}){const a=kt("form-group"),l=oa([0]);function o(){return"flex"===e.model.layout?jt(ra("flex-container"),{layout:e.model.flex},{default:()=>{var e;return null===(e=t.default)||void 0===e?void 0:e.call(t)}}):"grid"===e.model.layout?jt(ra("grid-container"),{layout:e.model.grid},{default:()=>{var e;return null===(e=t.default)||void 0===e?void 0:e.call(t)}}):void console.error("不支持的layout类型"+e.model.layout)}const i={};return e.model.width&&(i[a.cssVarName("form-group-width")]=e.model.width),e.model.height&&(i[a.cssVarName("form-group-height")]=e.model.height),()=>{if(!0!==e.c.state.keepalive&&!1===e.c.state.visible)return null;if(e.model.isCollapse){let t;return jt(ra("a-collapse"),{activeKey:l.value,"onUpdate:activeKey":e=>l.value=e,class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible)],style:i,ghost:!0},{default:()=>{return[jt(ra("a-collapse-panel"),{key:"0",header:e.model.title},(a=t=o(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!Ht(a)?t:{default:()=>[t]}))];var a}})}return jt("div",{class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible),e.model.class],style:i},[!1===e.model.showHeader?jt("div",{class:a.e("title")},[e.model.title]):null,jt("div",{class:a.e("content")},[o()])])}}}),_o=class{constructor(e,a,l){t(this,"type","group"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"title",void 0),t(this,"showHeader",void 0),t(this,"isCollapse",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},Eo={install(e){_gct.register.formItem.register("container",()=>new go),e.component(bo.name,bo)}},wo=class{constructor(){t(this,"component","gct-form-line")}createController(e,t){return Bl(()=>new Wl(e,t))}},To=/* @__PURE__ */Kt({name:"GctFormLine",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup:e=>({ns:kt("form-line"),style:Mt(()=>{const{paddingTop:t,paddingBottom:a}=e.model;return{paddingTop:t,paddingBottom:a}})}),render(){return jt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[jt("div",{class:this.ns.e("line")},null)])}}),Co=class{constructor(e,a={}){t(this,"type","line"),t(this,"layout","grid"),t(this,"name",""),t(this,"isContainer",!0),this.name=e,Object.assign(this,a)}},Ro={install(e){_gct.register.formItem.register("line",()=>new wo),e.component(To.name,To)}},So=class{constructor(){t(this,"component","gct-form-tab")}createController(e,t){return Bl(()=>new $l(e,t))}},xo=/* @__PURE__ */Kt({name:"GctFormTab",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=kt("form-tab"),a=Zl(),l={};return e.model.width&&(l[t.cssVarName("form-tab-width")]=e.model.width),e.model.height&&(l[t.cssVarName("form-tab-height")]=e.model.height),ya(e.c.state,()=>{a.evt.emit("changeState",e.c.model.name,e.c)}),Qt(()=>{var t;const a=(null===(t=e.model.children)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name)||"";e.c.state.activePane=a}),{ns:t,style:l}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return jt(ra("a-tabs"),{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.ns.m(this.model.navPosition||"left")],style:this.style,activeKey:this.c.state.activePane,"onUpdate:activeKey":e=>this.c.state.activePane=e},{default:()=>{var e;return[null===(e=this.model.children)||void 0===e?void 0:e.map((e,t)=>jt(ra("a-tab-pane"),{key:e.name,tab:e.title},{default:()=>[a[t]]}))]}})}}),Oo=class{constructor(e,a,l){t(this,"type","tab"),t(this,"isContainer",!0),t(this,"children",[]),t(this,"layout","grid"),t(this,"navPosition","center"),t(this,"name",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},ko={install(e){_gct.register.formItem.register("tab",()=>new So),e.component(xo.name,xo)}},Do=class{constructor(){t(this,"component","gct-form-tab-pane")}createController(e,t){return Bl(()=>new zl(e,t))}};function Io(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Lo=/* @__PURE__ */Kt({name:"GctFormTabPane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=kt("form-tab-pane"),a={};return e.model.width&&(a[t.cssVarName("form-tab-pane-width")]=e.model.width),e.model.height&&(a[t.cssVarName("form-tab-pane-height")]=e.model.height),{ns:t,style:a,renderContainer:function(t){return"flex"===e.model.layout?jt(ra("flex-container"),{layout:e.model.flex},Io(t)?t:{default:()=>[t]}):"grid"===e.model.layout?jt(ra("grid-container"),{layout:e.model.grid},Io(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return jt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),Mo=class{constructor(e,a,l,o){t(this,"type","tab-pane"),t(this,"isContainer",!0),t(this,"title",void 0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),this.name=e,this.title=a,l&&Object.assign(this,l),o&&(this.children=o)}},Ao={install(e){_gct.register.formItem.register("tab-pane",()=>new Do),e.component(Lo.name,Lo)}},No=class{constructor(){t(this,"component","gct-form-title-group")}createController(e,t){return Bl(()=>new Hl(e,t))}};function Uo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Po=/* @__PURE__ */Kt({name:"GctFormTitleGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0}},setup(e){const t=kt("form-title-group"),a=oa([0]),l={};return e.model.width&&(l[t.cssVarName("form-title-group-width")]=e.model.width),e.model.height&&(l[t.cssVarName("form-title-group-height")]=e.model.height),{ns:t,keys:a,style:l,renderContainer:function(t){return"flex"===e.model.layout?jt(ra("flex-container"),{layout:e.model.flex},Uo(t)?t:{default:()=>[t]}):"grid"===e.model.layout?jt(ra("grid-container"),{layout:e.model.grid},Uo(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return jt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.model.class],style:this.style},[jt("div",{class:this.ns.e("title")},[this.model.title]),jt("div",{class:this.ns.e("content")},[this.renderContainer(a)])])}}),Vo=class{constructor(e,a,l){t(this,"type","group"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"title",void 0),t(this,"showHeader",void 0),t(this,"isCollapse",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},Fo={install(e){_gct.register.formItem.register(ut.FORM_TITLE_GROUP,()=>new No),e.component(Po.name,Po)}},jo=class{constructor(e,a){t(this,"type","hidden"),t(this,"name",void 0),t(this,"field",void 0),t(this,"defaultValue",void 0),t(this,"editor",void 0),this.name=e,a&&Object.assign(this,a)}},Bo=class{constructor(e,a,l,o){t(this,"type","item"),t(this,"name",void 0),t(this,"editor",void 0),t(this,"label",void 0),t(this,"rules",void 0),this.name=e,a&&(this.label=a),l&&Object.assign(this,l),this.editor=o}},Ko={install(e){_gct.register.formItem.register("item",()=>new so),_gct.register.formItem.register("hidden",()=>new no),e.use(vo),e.use(fo),e.use(Eo),e.use(Ro),e.use(ko),e.use(Ao),e.use(Fo),e.component(io.name,io),e.component(oo.name,oo)}},Go=/* @__PURE__ */Kt({name:"FlexItem",props:{layout:Object},setup:e=>({ns:kt("flex-item"),getStyle:()=>{const t={};if(e.layout){const{order:a,alignSelf:l,flexBasis:o,flexGrow:i,flexShrink:s}=e.layout;null!=a&&(t.order=a),null!=l&&(t["align-self"]=l),null!=o&&(t["flex-basis"]=o),null!=i&&(t["flex-grow"]=i),null!=s&&(t["flex-shrink"]=s)}return t}}),render(){var e,t;return jt("div",{class:this.ns.b(),style:this.getStyle()},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)])}}),$o=/* @__PURE__ */Kt({name:"FlexContainer",props:{layout:Object},setup:e=>({ns:kt("flex-container"),getStyle:()=>{const t={};if(e.layout){const{alignContent:a,alignItems:l,flexDirection:o,flexWrap:i,justifyContent:s}=e.layout;null!=a&&(t.alignContent=a),null!=l&&(t.alignItems=l),null!=o&&(t.flexDirection=o),null!=i&&(t.flexWrap=i),null!=s&&(t.justifyContent=s)}return t},getItemStyle:e=>{const t={};if(e){const{width:a,height:l}=e;null!=a&&(t.width=a),null!=l&&(t.height=l)}return t}}),render(){var e,t;let a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return a.length>0&&(a=a[0].children||[]),jt("div",{class:this.ns.b(),style:this.getStyle()},[a.map(e=>{if(!e)return null;const t=e.props.model.flexItem;return jt(Go,{layout:t,style:this.getItemStyle(e.props.model)},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!Ht(a)?e:{default:()=>[e]});var a})])}});function zo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Ho=/* @__PURE__ */Kt({name:"GridContainer",props:{layout:Object},setup(e,{slots:t}){const a=kt("grid-container");return()=>{var l;let o;const i=e.layout||{};let s=(null===(l=t.default)||void 0===l?void 0:l.call(t))||[];return s.length>0&&(s=s[0].children||[]),jt(ra("a-row"),{class:a.b(),wrap:!0,gutter:i.gutter},zo(o=s.map(e=>{if(!e)return null;const t=e.props.model.gridItem;return jt(ra("a-col"),{span:t?t.span??24:24,offset:t?t.offset??0:0},zo(e)?e:{default:()=>[e]})}))?o:{default:()=>[o]})}}}),qo=/* @__PURE__ */Kt({name:"GctFormAction",props:{c:{type:Object,required:!0},data:{type:Object,required:!0},model:{type:Object,required:!0},size:{type:String}},setup(e){const t=kt("gct-form-action"),a=Zl();return{ns:t,onClick:function(t){t.stopPropagation(),e.model.click&&e.model.click(t,a,e.c,e.data)}}},render(){return jt(ra("a-button"),qt({class:this.ns.b(),onClick:this.onClick,size:this.size,type:"link"},this.model.props||{}),{default:()=>[this.model.label]})}}),Yo=class{constructor(){t(this,"component","gct-form-action")}},Xo=Ml(El.ACTION,()=>new Yo,qo);function Wo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Zo=/* @__PURE__ */Kt({name:"GctFormDateFormatSelect",props:to(),setup(e){var t;const a=kt("form-date-format-select"),l=Mt(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.fieldTypeKey)||"type"]}),o=Mt(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.mappingTypeKey)||"mapping_type"]}),i=Jl((null===(t=e.model)||void 0===t?void 0:t.separatorKey)||"separator"),s=[{label:"-",value:"-"},{label:"/",value:"/"},{label:"·",value:"."}],n=Jl(),r=Mt(()=>l.value===dt.DATE_TIME||o.value===dt.DATE_TIME?[{label:`yyyy${i.value}MM${i.value}dd HH`,value:`YYYY${i.value}MM${i.value}DD HH`},{label:`yyyy${i.value}MM${i.value}dd HH:mm`,value:`YYYY${i.value}MM${i.value}DD HH:mm`},{label:`yyyy${i.value}MM${i.value}dd HH:mm:ss`,value:`YYYY${i.value}MM${i.value}DD HH:mm:ss`}]:l.value===dt.DATE||o.value===dt.DATE?[{label:"yyyy",value:"YYYY"},{label:`yyyy${i.value}MM`,value:`YYYY${i.value}MM`},{label:`yyyy${i.value}MM${i.value}dd`,value:`YYYY${i.value}MM${i.value}DD`}]:[]);return ya(i,()=>{l.value!==dt.DATE_TIME&&o.value!==dt.DATE_TIME?l.value!==dt.DATE&&o.value!==dt.DATE?n.value="":n.value=`YYYY${i.value}MM${i.value}DD`:n.value=`YYYY${i.value}MM${i.value}DD HH:mm:ss`}),()=>{var t,l;let o,d;return jt("div",{class:a.b()},[jt("span",{class:a.e("first")},[jt(ra("a-select"),qt({value:i.value,"onUpdate:value":e=>i.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||Rt("sys.chooseText")},(null===(t=e.model)||void 0===t?void 0:t.props)||{}),Wo(o=s.map(e=>jt(ra("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?o:{default:()=>[o]})]),jt("span",{class:a.e("second")},[jt(ra("a-select"),qt({value:n.value,"onUpdate:value":e=>n.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||Rt("sys.chooseText")},(null===(l=e.model)||void 0===l?void 0:l.props)||{}),Wo(d=r.value.map(e=>jt(ra("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?d:{default:()=>[d]})])])}}}),Jo=class{constructor(){t(this,"component","gct-form-date-format-select")}},Qo=Ml(El.DATE_FORMAT_SELECT,()=>new Jo,Zo),ei=/* @__PURE__ */Kt({name:"GctFormLengthUnit",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup:()=>({ns:kt("form-length-unit"),val:Jl()}),render(){return jt(ra("length-unit-editor"),qt({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("readonly",this.model.readonly)]}),null)}}),ti=class{constructor(){t(this,"component","gct-form-length-unit")}},ai=Ml(El.LENGTH_UNIT,()=>new ti,ei),li=/* @__PURE__ */Kt({name:"GctFormColor",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup(e){const t=kt("form-color"),a=Jl();return console.debug("GctFormColor props",e),()=>jt(ra("color-editor"),qt({value:a.value,"onUpdate:value":e=>a.value=e},e.model.props||{},{class:[t.b(),t.is("readonly",e.model.readonly)]}),null)}}),oi=class{constructor(){t(this,"component","gct-form-color")}},ii=Ml(El.COLOR,()=>new oi,li),si=class{constructor(){t(this,"component","gct-form-date")}},ni=/* @__PURE__ */Kt({name:"GctFormDate",props:{model:{type:Object,required:!0},value:{type:String,default:""},isDate:{type:Boolean,default:!0},isTime:{type:Boolean,default:!1}},emits:["update:value"],setup(e){const t=kt("gct-form-date"),a=new Fl(e.model),l=Jl(),o=oa(l.value?ll(l.value):null),i=oa(l.value?ll(l.value):null);return{ns:t,c:a,dateVal:o,timeVal:i,onChange:()=>{let e="";o.value&&(e=o.value.format("YYYY-MM-DD")),i.value?e+=` ${i.value.format("HH:mm:ss")}`:e+=" 00:00:00",l.value=e}}},render(){return jt("div",{class:[this.ns.b()]},[this.isDate?jt(ra("a-date-picker"),qt({picker:"date",value:this.dateVal,"onUpdate:value":e=>this.dateVal=e,format:"YYYY-MM-DD"},this.model.props||{},{placeholder:"请选择日期",onChange:this.onChange}),null):null,this.isTime?jt(ra("a-time-picker"),{value:this.timeVal,"onUpdate:value":e=>this.timeVal=e,placeholder:"请选择时间",onChange:this.onChange},null):null])}}),ri=Ml(El.DATE,()=>new si,ni),di=/* @__PURE__ */Kt({name:"GctFormFormula",props:{c:{type:Object,required:!0},itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup(e){const t=kt("form-formula"),a=Zl(),l=oa(),o=Jl(),i=Jl("expressionEcho"),s=async()=>{const t=await Ee({expr:o.value.expr,exprEcho:null==i?void 0:i.value,returnType:o.value.mappingType||"string",mode:rt.DATA_SET_FORMULA,identifiers:{},...e.model.config||{}});t&&(o.value={expr:t.expr,mappingType:t.returnType},i&&(i.value=t.exprEcho),a.validateItem(e.itemModel.name))};return()=>jt("div",{class:t.b(),onClick:s},[jt(ra("a-input"),{ref:l,class:t.e("input"),readonly:!0,value:(null==i?void 0:i.value)||o.value,placeholder:Rt("sys.inputText")},null)])}}),ui=class{constructor(){t(this,"component","gct-form-formula")}},ci=Ml(El.FORMULA,()=>new ui,di),pi=class{constructor(){t(this,"component","gct-form-check-switch")}},vi=/* @__PURE__ */Kt({name:"GctFormCheckSwitch",props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:Boolean,default:!1},size:{type:String}},emits:["update:value"],setup:()=>({ns:kt("gct-form-check-switch"),val:Jl()}),render(){return this.model.isSwitch?jt("div",{class:[this.ns.b(),this.ns.m("switch"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]},[jt(ra("a-switch"),qt({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)]):jt(ra("a-checkbox"),qt({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{},{class:[this.ns.b(),this.ns.m("checkbox"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]}),{default:()=>[this.model.label]})}}),mi=Ml(El.CHECK_SWITCH,()=>new pi,vi);function hi(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var yi=/* @__PURE__ */Kt({name:"GctFormSelectGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e,{emit:t}){const a=kt("form-select-group"),l=zt("formController"),o=oa(""),i=oa(null),s=oa(!1),n=oa(/* @__PURE__ */new Set),r=Mt({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}});function d(e,t){return e.className.indexOf(t)>-1?e:e.parentElement?d(e.parentElement,t):null}function u(e){var t;d(e.target,"ant-select-dropdown")||null===(t=i.value)||void 0===t||t.blur()}window.addEventListener("wheel",u);const c=oa(),p=Mt({get:()=>!e.c.state.options.find(t=>t.value===e.value)&&r.value?r.value:e.value||void 0,set:e=>{if(!e)return t("update:value",void 0),void(r.value="");"string"==typeof e&&(e=e.trim()),t("update:value",e);let a=null;v.value.find(t=>(t.options&&(a=t.options.find(t=>t.value==e)),!!a)),a&&(r.value=a.label)}}),v=Mt(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:[]),m=async()=>e.c.loadDictionary();return null!=p.value&&m(),ea(()=>{window.removeEventListener("wheel",u)}),{ns:a,selectRef:i,searchValue:o,open:s,rootRef:c,val:p,options:v,loadOptions:m,toggleGroupCollapse:t=>{e.model.groupCollapsible&&(n.value.has(t)?n.value.delete(t):n.value.add(t))},isGroupCollapsed:t=>!0!==e.model.groupCollapsible||!n.value.has(t)}},render(){let e;return jt("div",{ref:"rootRef",class:this.ns.b()},[jt(ra("a-select"),{ref:"selectRef",open:this.open,value:this.val,"onUpdate:value":e=>this.val=e,allowClear:!0,disabled:this.c.state.disabled,size:this.size,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,"show-search":!0,"filter-option":()=>!0,searchValue:this.searchValue,onSearch:e=>this.searchValue=null==e?void 0:e.trim(),onFocus:()=>this.open=!0,onBlur:()=>this.open=!1,onChange:()=>this.open=!1},hi(e=this.options.map(e=>{let t;const a=null!=e.label?e.label:" ",l=String(e.value),o=this.isGroupCollapsed(l),i=(o&&e.options||[]).filter(e=>!this.searchValue||e.label.toLowerCase().indexOf(this.searchValue.toLowerCase())>=0);return 0===i.length?null:jt(ra("a-select-opt-group"),{key:e.value,label:jt("div",{class:[this.ns.b("group-header"),this.model.groupCollapsible?this.ns.b("group-header--clickable"):""],onClick:()=>this.toggleGroupCollapse(l)},[this.model.groupCollapsible&&jt("span",{class:[this.ns.be("group-header","arrow"),o?this.ns.bem("group-header","arrow","collapsed"):""]},[jt("i",{class:["iconfont",1!=o?"icon-right":"icon-Down"]},null)]),jt("span",{class:this.ns.be("group-header","title")},[a])])},hi(t=i.map(e=>jt(ra("a-select-option"),{class:this.ns.b("item-option"),key:e.value,value:e.value},{default:()=>[e.icon?jt("span",{class:this.ns.be("item-option","item-icon")},[jt("i",{class:`iconfont ${e.icon}`},null)]):"",jt("span",{class:this.ns.be("item-option","item-label")},[e.label])]})))?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}}),fi=class{constructor(){t(this,"component","gct-form-select-group")}},gi=Ml(El.SELECT_GROUP,()=>new fi,yi),bi=class{constructor(){t(this,"component","gct-form-i18n")}},_i=/* @__PURE__ */Kt({name:"GctFormI18n",props:to(),emits:["update:value","blur"],setup(e,{emit:t}){var a;const l=kt("form-i18n"),o=Zl(),i=oa({}),s=oa(!1),n=o.item[(null===(a=e.model)||void 0===a?void 0:a.cfgKey)||"i18nConfig"];n||console.warn("i18nConfig not found in form item, please ensure that the model has a valid cfgKey or i18nConfig is defined in the form.");const r=Mt(()=>{var t,a;return(null===(t=e.data)||void 0===t?void 0:t[(null===(a=e.model)||void 0===a?void 0:a.fieldKey)||"fieldKey"])||null});r.value&&async function(){var t;const a=await Tt.loadField((null===(t=e.data)||void 0===t?void 0:t.modelKey)||e.context.modelKey,r.value);a&&(i.value=a)}();const d=Mt({get:()=>e.value?e.value:!0===s.value?"":i.value.name,set:a=>{"string"==typeof a&&(a=a.trim()),s.value=!0,"object"!=typeof a&&e.value==a||(a||(u.value=""),t("update:value",a))}}),u=Mt({get:()=>n?{i18nKey:n.value}:"",set:e=>{if(n)try{n.value=JSON.parse(e).i18nKey}catch(t){console.error(t)}}});return{ns:l,val:d,i18nConfigValue:u,onBlur:function(){s.value=!1}}},render(){var e;return jt(ra("i18n-select-input"),qt({class:[this.ns.b(),this.ns.m(this.size)],i18nText:this.val,"onUpdate:i18nText":e=>this.val=e,i18nConfig:this.i18nConfigValue,"onUpdate:i18nConfig":e=>this.i18nConfigValue=e,placeholderText:this.model.placeholder||Rt("sys.inputText"),attr:"i18nKey",btnHeight:"small"===this.size?"26px":void 0,inputExtraProps:{showCount:!0,maxlength:this.model.max||32,disabled:this.c.state.disabled},onBlur:e=>{this.onBlur(),this.$emit("blur",e)},size:this.size},(null===(e=this.model)||void 0===e?void 0:e.props)||{}),null)}}),Ei=Ml(El.I18N,()=>new bi,_i),wi=/* @__PURE__ */Kt({name:"GctFormIconSelect",props:{value:{type:Object},model:{type:Object,required:!0}},emits:["update:value"],setup(e,{emit:t}){var a,l,o;const i=kt("gct-form-icon-select"),s=oa(e.value),n=oa((null===(a=s.value)||void 0===a?void 0:a.icon)||e.model.defaultIcon),r=oa((null===(l=s.value)||void 0===l?void 0:l.color)||e.model.defaultColor),d=oa((null===(o=s.value)||void 0===o?void 0:o.background)||e.model.defaultBackground);return ya(()=>e.value,e=>{s.value=e,e&&(n.value=e.icon,r.value=e.color)}),ya([n,r,d],()=>{s.value={icon:n.value,color:r.value},t("update:value",s.value)}),{ns:i,icon:n,color:r,background:d,nextPickerStyle:Mt(()=>{if(e.model.size)return{"--box-size":e.model.size+"px"}})}},render(){return jt("div",{class:this.ns.b()},[jt(ra("icon-next-picker"),{value:this.icon,"onUpdate:value":e=>this.icon=e,color:this.color,"onUpdate:color":e=>this.color=e,background:"#f5f5f5",disabled:this.model.disabled,showColor:!1!==this.model.showColor,style:this.nextPickerStyle},null),this.model.label?jt("span",{class:this.ns.e("title")},[this.model.label]):null])}}),Ti=class{constructor(){t(this,"component","gct-form-icon-select")}},Ci=Ml(El.ICON_SELECT,()=>new Ti,wi),Ri=class{constructor(){t(this,"component","gct-form-number")}},Si=/* @__PURE__ */Kt({name:"GctFormNumber",props:{model:{type:Object,required:!0},value:{type:String,default:""}},emits:["update:value"],setup:()=>({ns:kt("gct-form-number"),val:Jl()}),render(){return jt(ra("a-input-number"),qt({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.model.class],prefix:this.model.prefix,suffix:this.model.suffix,addonBefore:this.model.addonBefore,addonAfter:this.model.addonAfter,placeholder:this.model.placeholder,max:this.model.max,min:this.model.min,precision:this.model.precision}),null)}}),xi=Ml(El.NUMBER,()=>new Ri,Si),Oi=class{constructor(){t(this,"component","gct-form-picker")}},ki=/* @__PURE__ */Kt({name:"GctFormPicker",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(e,{emit:t}){const a=kt("gct-form-picker"),l=Zl(),o=Mt({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}}),i=Mt({get:()=>!e.c.state.options.find(t=>t.value===e.value)&&o.value?o.value:e.value,set:a=>{if("string"==typeof a&&(a=a.trim()),"object"!=typeof a&&e.value==a)return;const o=e.c.state.options.find(e=>e.value===a);o&&o.data&&e.model.fieldMap&&e.model.fieldMap.map(e=>{const[t,a]=e.split(":");a&&(l.item[a].editorValue=o.data[t])}),t("update:value",a)}});return null!=i.value&&e.c.loadDictionary(),{ns:a,val:i,nameVal:o,loadOptions:()=>e.c.loadDictionary(),onChange:(e,t)=>{o.value=t.label}}},render(){return jt(ra("a-select"),qt({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:this.ns.b(),disabled:this.c.state.disabled,loading:this.c.state.loading,options:this.c.state.options,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,onChange:this.onChange,"show-search":!0,"filter-option":(e,t)=>!!t.label&&t.label.toLowerCase().indexOf(e.toLowerCase())>=0}),null)}}),Di=Ml(El.PICKER,()=>new Oi,ki),Ii=/* @__PURE__ */Kt({name:"GctFormPixelConfig",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup(){const e=kt("form-pixel-config"),t=Jl("label_mode"),a=Jl(),l=[{label:"百分比",value:"percent"},{label:"固定",value:"fixed"}],o=Mt(()=>"fixed"===t.value?"px":"%");function i(e){t.value=e,a.value="fixed"===e?100:30}return()=>jt(ra("a-input-group"),{compact:!0,class:e.b()},{default:()=>[jt(ra("a-select"),{class:e.e("select"),value:t.value,"onUpdate:value":e=>t.value=e,options:l,onChange:i},null),jt(ra("a-input-number"),{class:e.e("input"),value:a.value,"onUpdate:value":e=>a.value=e,min:0,placeholder:"请输入",size:"small",max:"fixed"===t.value?500:100,addonAfter:o.value},null)]})}}),Li=class{constructor(){t(this,"component","gct-form-pixel-config")}},Mi=Ml(El.PIXEL_CONFIG,()=>new Li,Ii),Ai=class{constructor(){t(this,"component","gct-form-select")}},Ni=/* @__PURE__ */Kt({name:"GctFormSelect",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=kt("gct-form-select"),a=oa();Te(a,()=>{var e;l.value=!1,null===(e=a.value)||void 0===e||e.blur()});const l=oa(!1);function o(e,t){var a;return(null===(a=e.className)||void 0===a?void 0:a.indexOf(t))>-1?e:e.parentElement?o(e.parentElement,t):null}function i(e){var t;o(e.target,"ant-select-dropdown")||null===(t=a.value)||void 0===t||t.blur()}window.addEventListener("wheel",i);const s=oa(),n=new Fl(e.model),r=Jl(),d=Mt({get:()=>null!=r.value?r.value:void 0,set(e){r.value=e}}),u=Mt(()=>{var t,a;return(null===(t=e.c)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.options)&&(null===(a=e.c)||void 0===a||null===(a=a.state)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.length)>0?e.c.state.options:n.options});return ea(()=>{window.removeEventListener("wheel",i)}),{ns:t,selectRef:a,open:l,rootRef:s,editorC:n,val2:d,options:u,onCloseDropdown:function(){l.value=!1,a.value&&a.value.blur()},onOpenDropdown:function(){l.value=!0},onChangeDropdown:function(){l.value=!l.value}}},render(){return jt("div",{ref:"rootRef",class:this.ns.b()},[this.model.beforeText?jt("div",{class:this.ns.e("before-text")},[this.model.beforeText]):null,jt("div",{class:this.ns.e("content")},[jt(ra("a-select"),qt({ref:"selectRef",open:this.open,value:this.val2,"onUpdate:value":e=>this.val2=e,options:this.options,allowClear:!0,disabled:this.c.state.disabled,size:this.size,placeholder:this.model.placeholder,onChange:this.onCloseDropdown,onClick:this.onChangeDropdown},this.model.props||{}),null)]),this.model.afterText?jt("div",{class:this.ns.e("after-text")},[this.model.afterText]):null])}}),Ui=Ml(El.SELECT,()=>new Ai,Ni),Pi=class{constructor(){t(this,"component","gct-form-span")}},Vi=/* @__PURE__ */Kt({name:"GctFormSpan",props:{c:{type:Object,required:!0},itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEmptyText:{type:Boolean,default:!1}},setup(e){const t=kt("form-span"),{model:a,itemModel:l,c:o}=va(e);return o.value.loadDictionary(),{ns:t,val:Mt(()=>{if(a.value.format&&"function"==typeof a.value.format)return a.value.format(o.value.data,l.value,o.value);if(null==e.value||""===e.value)return e.value;if(l.value.dictionary){const t=(l.value.dictionary.items||[]).find(t=>t.value==e.value);if(t)return t.label}if(o.value.state.options.length>0){const t=o.value.state.options.find(t=>t.value==e.value);if(t)return t.label}return e.value}),handleClipboardKey:function(){const{isSuccessRef:t}=xt(e.value);t.value&&al.success(Rt("sys.copySuccess"))}}},render(){let e=this.val;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),jt("div",{class:this.ns.b()},[jt("span",{class:this.ns.e("info")},[e]),this.model.copy&&jt("span",{class:this.ns.e("copy")},[jt("i",{class:"iconfont icon-fuzhi primary-gct",onClick:this.handleClipboardKey},null)])])}}),Fi=Ml(El.SPAN,()=>new Pi,Vi),ji=class{constructor(){t(this,"component","gct-form-switch")}},Bi=/* @__PURE__ */Kt({name:"GctFormSwitch",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup:()=>({ns:kt("gct-form-switch"),val:Jl()}),render(){return jt("div",{class:this.ns.b()},[jt(ra("a-switch"),qt({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)])}}),Ki=Ml(El.SWITCH,()=>new ji,Bi),Gi=class{constructor(){t(this,"component","gct-form-text")}},$i=/* @__PURE__ */Kt({name:"GctFormText",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=kt("gct-form-text"),a=Ql(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);function l(){"string"==typeof a.value&&(a.value=a.value.trim())}return()=>jt(ra("a-input"),qt({value:a.value,"onUpdate:value":e=>a.value=e,size:e.size},e.model.props||{},{class:t.b(),prefix:e.model.prefix,suffix:e.model.suffix,addonBefore:e.model.addonBefore,addonAfter:e.model.addonAfter,placeholder:e.model.placeholder,"show-count":null!=e.model.max,maxlength:e.model.max,onBlur:l}),null)}}),zi=Ml(El.TEXT,()=>new Gi,$i),Hi=/* @__PURE__ */Kt({name:"GctFormEmpty",setup(){const e=kt("gct-form-empty");return()=>jt("span",{class:e.b()},null)}}),qi=class{constructor(){t(this,"component","gct-form-empty")}},Yi=Ml(El.EMPTY,()=>new qi,Hi),Xi=class{constructor(){t(this,"component","gct-form-textarea")}},Wi=/* @__PURE__ */Kt({name:"GctFormTextarea",props:{model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(){const e=kt("gct-form-textarea"),t=Jl();return{ns:e,val:t,handleBlur:()=>{"string"==typeof t.value&&(t.value=t.value.trim())}}},render(){return jt(ra("a-textarea"),qt({value:this.val,"onUpdate:value":e=>this.val=e,class:this.ns.b(),"auto-size":this.model.autoSize,"show-count":null!=this.model.max,maxlength:this.model.max,placeholder:this.model.placeholder,onBlur:this.handleBlur},this.model.props||{}),null)}}),Zi=Ml(El.TEXTAREA,()=>new Xi,Wi);function Ji(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Qi=/* @__PURE__ */Kt({name:"GctFormRadio",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup:()=>({ns:kt("gct-form-radio"),val:Jl()}),render(){let e;const t={...this.model.props||{},allowClear:!0,disabled:this.c.state.disabled};if(this.model.buttonMode){let e;return jt(Xa,qt({class:[this.ns.b(),this.ns.m("button")],value:this.val,"onUpdate:value":e=>this.val=e,size:"small","button-style":"solid"},t),Ji(e=this.c.state.options.map(e=>jt(Ya,{key:e.value,value:e.value},{default:()=>[e.label]})))?e:{default:()=>[e]})}return jt(Xa,qt({class:[this.ns.b(),this.ns.m("radio")],value:this.val,"onUpdate:value":e=>this.val=e,size:this.size},t),Ji(e=this.c.state.options.map(e=>{var t;return jt(qa,{class:[this.ns.e("item"),this.ns.em("item","pos-"+((null===(t=this.model.icon)||void 0===t?void 0:t.pos)||"left"))],key:e.value,value:e.value,disabled:e.disabled},{default:()=>{var t,a,l;return[e.icon?jt("span",{class:this.ns.e("item-icon"),style:{width:null===(t=this.model.icon)||void 0===t?void 0:t.width,height:null===(a=this.model.icon)||void 0===a?void 0:a.height,fontSize:null===(l=this.model.icon)||void 0===l?void 0:l.fontSize}},["string"==typeof e.icon&&e.icon.endsWith(".svg")?jt(ra("assets-svg-icon"),{src:e.icon},null):e.icon]):null,jt("span",{class:this.ns.e("item-label")},[e.label])]}})}))?e:{default:()=>[e]})}}),es=class{constructor(){t(this,"component","gct-form-radio")}},ts=Ml(El.RADIO,()=>new es,Qi),as=/* @__PURE__ */Kt({name:"GctFormInfo",props:{value:{type:String,default:""},model:{type:Object,required:!0},size:{type:String},isEmptyText:{type:Boolean,default:!1}},emits:["update:value"],setup:()=>({ns:kt("gct-form-info"),val:Jl()}),render(){let e=this.val||this.model.content;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),jt("div",{class:[this.ns.b(),this.size?this.ns.m(this.size):null]},[this.model.icon?jt("span",{class:this.ns.e("icon")},[jt("i",{class:`iconfont ${this.model.icon}`},null)]):null,jt("span",{class:this.ns.e("content"),title:e},[e])])}}),ls=class{constructor(){t(this,"component","gct-form-info")}},os=Ml(El.INFO,()=>new ls,as),is=il,ss=/* @__PURE__ */Kt({name:"GctFormCheckbox",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e,{emit:t}){const a=kt("gct-form-checkbox"),l=Jl(),o=Mt(()=>e.model.isDrag?(l.value||[]).filter(e=>e.checked).map(e=>e.value):l.value),i=Mt(()=>{var t;return e.model.isDrag&&l.value&&(null===(t=l.value)||void 0===t?void 0:t.length)?l.value.map(t=>{var a;return{...t,label:(null===(a=e.c.state.options.find(e=>e.value===t.value))||void 0===a?void 0:a.label)||""}}):e.c.state.options});return{ns:a,checked:o,onChange:a=>{i.value.forEach(t=>{e.model.minLength&&a.length<=e.model.minLength&&a.includes(t.value)?t.disabled=!0:t.disabled=!1,t.checked=a.includes(t.value)}),e.model.isDrag?t("update:value",i.value):t("update:value",a)},onDragEnd:e=>{const{newIndex:a,oldIndex:l}=e;i.value.splice(a,0,i.value.splice(l,1)[0]),t("update:value",i.value)},slots:{item:({element:e})=>jt("div",{class:"drag-checkbox-item ks-row-middle"},[jt("i",{class:"icon-drag iconfont mr4px cursor-move text-[#C3C3C3] primary-gct-hover"},null),jt(Fa,{value:e.value,disabled:e.disabled},{default:()=>[e.label]})])},options:i}},render(){const e={...this.model.props||{},class:[this.ns.b(),this.ns.m("checkbox"),"column"===this.model.layout&&"isColumn",this.size?this.ns.m(this.size):null],disabled:this.c.state.disabled};return[ba(jt(ja,qt({value:this.checked,"onUpdate:value":e=>this.checked=e},e,{onChange:this.onChange}),{default:()=>[jt(is,{modelValue:this.options,"onUpdate:modelValue":e=>this.options=e,handle:".cursor-move",animation:"200","chosen-class":"drawing-chosen","drag-class":"drawing-drag","item-key":"value",class:"drag-wrap",onEnd:this.onDragEnd},this.slots)]}),[[ha,this.model.isDrag]]),ba(jt(ja,qt({value:this.checked,"onUpdate:value":e=>this.checked=e,options:this.options},e,{onChange:this.onChange}),null),[[ha,!this.model.isDrag]])]}}),ns=class{constructor(){t(this,"component","gct-form-checkbox")}},rs=Ml(El.CHECKBOX,()=>new ns,ss);function ds(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var us=[{value:"entity",label:"sys.pageDesigner.entity"},{value:"data",label:"sys.pageDesigner.data"},{value:"view",label:"sys.pageDesigner.view"},{value:"form",label:"sys.pageDesigner.form",project:["eDHR","MEDPRO"]},{value:"system",label:"sys.pageDesigner.system"}],cs=/* @__PURE__ */Kt({name:"GctFormModelSelect",props:{model:{type:Object,required:!0},value:{type:String}},setup(e){const t=kt("form-model-select"),a=Jl(),l=Jl("category"),o=Jl("categorySelect"),i=Jl("modelName"),s=Jl("formId"),n=oa([]),r=oa({}),d=async()=>{return"system"===o.value?(n.value=await _api.apaas.report.getListSystemModels()||[],{[Rt("sys.pageDesigner.system")]:n.value}):(n.value=await _api.apaas.modelComprehensive.getModelSummary({type:(null===(t=e.model.props)||void 0===t?void 0:t.modelTypes)||"NDO,BASE,TREE,TRANSACTION,SIGN",category:l.value,report:!0})||[],Sa(n.value,"group"));var t},{onFieldChange:u}=Ga.useInjectFormItemContext();Qt(async()=>{a.value=a.value?a.value:void 0,l.value=l.value||"entity",o.value=o.value||l.value,r.value=await d()});const c=async e=>{l.value=e,a.value=null,s.value=void 0,r.value=await d()},p=e=>{const t=n.value.find(t=>t.key===e);t&&(i.value=t.name),"system"===o.value&&(l.value=t.modelCategory),u(),"system"!==o.value&&(r.value=Sa(n.value,"group"))};return()=>{let l,i;return jt("div",{class:t.b()},[jt(ra("a-input-group"),{compact:!0},{default:()=>[jt(ra("a-select"),{value:o.value,"onUpdate:value":e=>o.value=e,class:t.e("class"),placeholder:"请选择",onSelect:c,disabled:e.model.disabled},ds(l=us.filter(t=>{var a;return(null===(a=e.model.props)||void 0===a?void 0:a.exclude)?!e.model.props.exclude.includes(t.value)&&(!t.project||t.project&&_gct.store.appInfo.suiteKey&&t.project.includes(_gct.store.appInfo.suiteKey)):!t.project||_gct.store.appInfo.suiteKey&&t.project.includes(_gct.store.appInfo.suiteKey)}).map(e=>{let t;return jt(ra("a-select-option"),{key:e.value,value:e.value},ds(t=Rt(e.label))?t:{default:()=>[t]})}))?l:{default:()=>[l]}),jt(ra("a-select"),{value:a.value,"onUpdate:value":e=>a.value=e,class:t.e("model"),onSelect:p,"show-search":!0,placeholder:"请选择",disabled:e.model.disabled,filterOption:(e,t)=>(t.label||t.name).toLowerCase().indexOf(e.toLowerCase())>=0},ds(i=Object.keys(r.value).map(e=>{const t=r.value[e].map(e=>jt(ra("a-select-option"),{key:e.key,value:e.key,label:e.name},{default:()=>[e.name]}));return jt(ra("a-select-opt-group"),{key:e,label:e},ds(t)?t:{default:()=>[t]})}))?i:{default:()=>[i]})]})])}}}),ps=class{constructor(){t(this,"component","gct-form-model-select")}},vs=Ml(El.MODEL_SELECT,()=>new ps,cs),ms=/* @__PURE__ */Kt({name:"GctFormMultipleChoice",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:Array,default:null}},emits:["update:value"],setup(e,{emit:t}){const a=kt("form-multiple-choice"),l=oa(),o=Mt({get:()=>e.value??[],set:e=>{t("update:value",e)}});return null!=o.value&&e.c.loadDictionary(),{ns:a,rootRef:l,val:o,loadOptions:()=>e.c.loadDictionary({},e.model.force)}},render(){return jt("div",{ref:"rootRef",class:this.ns.b()},[jt(ra("a-select"),qt({value:this.val,"onUpdate:value":e=>this.val=e,mode:"multiple","max-tag-count":5,disabled:this.c.state.disabled,loading:this.c.state.loading,options:this.c.state.options,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,getPopupContainer:()=>this.rootRef},this.model.props||{}),null)])}}),hs=class{constructor(){t(this,"component","GctFormMultipleChoice")}},ys=Ml(El.MULTIPLE_CHOICE,()=>new hs,ms),fs=/* @__PURE__ */Kt({name:"GctFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=kt("form-table"),a=Jl();return()=>jt("div",{class:t.b()},[jt(ra("gct-table"),qt({data:a.value,model:e.model.tableModel,count:a.value.length.toString()},e.model.props||{}),null)])}}),gs=class{constructor(){t(this,"component","gct-form-table")}},bs=Ml(El.TABLE,()=>new gs,fs),_s=/* @__PURE__ */Kt({name:"GctSelectFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=kt("select-form-table"),a=oa(),l=oa(""),o=Jl(),i=Mt(()=>({type:e.model.multiple?"checkbox":"radio",fixed:!0,selectedRowKeys:e.model.isKeys?o.value:o.value.map(t=>t[e.model.tableModel.key||"id"]),onChange:(t,a)=>{e.model.isKeys?o.value=t:o.value=a},getCheckboxProps:e=>({disabled:"Disabled User"===e.name,name:e.name})}));function s(){l.value?(l.value=l.value.trim(),l.value&&a.value&&a.value.reload({query:l.value})):a.value&&a.value.reload()}return()=>jt("div",{class:t.b()},[jt("div",{class:t.e("search")},[jt(ra("a-input-search"),{placeholder:"搜索数据集名称",value:l.value,"onUpdate:value":e=>l.value=e,onSearch:s},null)]),jt("div",{class:t.e("table")},[jt(ra("gct-table"),qt({ref:a,"row-selection":i.value,data:o.value,model:e.model.tableModel,count:o.value.length.toString()},e.model.props||{}),null)])])}}),Es=class{constructor(){t(this,"component","gct-select-form-table")}},ws=Ml(El.SELECT_TABLE,()=>new Es,_s),Ts=class{constructor(){t(this,"component","gct-form-date-range")}},Cs=/* @__PURE__ */Kt({name:"GctFormDateRange",props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},data:{type:Object,required:!0},value:{type:Object,default:()=>[]}},emits:["update:value"],setup(e){var t;const a=kt("gct-form-date-range"),l=e.model.format||"YYYY-MM-DD HH:mm:ss",o=eo(),i=e.model.props||{},[s,n]=e.itemModel.fields||[],r=null===(t=e.itemModel)||void 0===t?void 0:t.default;return r&&r.length>0&&(o.value=r.map(e=>e?ll(e):null)),ya(o,()=>{if(o.value){const[t,a]=o.value;t&&(e.data[s]=t.format(l)),a&&(e.data[n]=a.format(l))}}),{ns:a,val:o,editorProps:i}},render(){return jt(ra("a-range-picker"),qt(this.editorProps,{value:this.val,"onUpdate:value":e=>this.val=e,class:this.ns.b(),"show-time":!0,placeholder:this.model.placeholder}),null)}}),Rs=Ml(El.DATE_RANGE,()=>new Ts,Cs),Ss={install(e){e.use(ai).use(ii).use(Qo).use(ri).use(ci).use(mi).use(Ei).use(gi).use(Ci).use(xi).use(Di).use(Mi).use(Ui).use(Fi).use(Ki).use(zi).use(Zi).use(ts).use(os).use(rs).use(ri).use(vs).use(ys).use(bs).use(ws).use(Xo).use(Yi).use(Rs)}},xs=/* @__PURE__ */Kt({name:"GctEditForm",props:{embed:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},params:{type:Object,default:()=>({})},controller:{type:Object},model:{type:Object,required:!0},data:{type:Object},count:{type:Number,default:0},adaptModal:{type:Boolean,default:!0}},emits:["update:data","change"],setup(e,{emit:t,expose:a}){const l=kt("gct-edit-form");console.debug("GctEditForm props:",e);const o=e.controller||Vl(()=>new Pl(e.model)),i=oa(),s=async e=>{try{await i.value.formRef.validateFields([e])}catch(t){return console.error(t),!1}return!0};o.validate=async()=>{try{await i.value.formRef.validate()}catch(e){return console.error(e),!1}return!0},o.validateItem=s;const{context:n,params:r}=va(e);return ya(n,()=>{Object.assign(o.context,e.context),o.state.isNew=!o.context.id},{immediate:!0,deep:!0}),ya(r,()=>{Object.assign(o.params,e.params)},{deep:!0}),ya(()=>e.count,()=>{o.state.count+=1}),ya(()=>e.data,()=>{Object.assign(o.state.data,e.data)},{deep:!0}),!1!==e.adaptModal&&Ot(async()=>{try{await i.value.formRef.validate();const e=await o.save();if(e)return{ok:!0,data:[Ta(e)]}}catch(e){console.error(e)}return{ok:!1}}),e.data?(Object.assign(o.state.data,e.data),o.loaded()):!0!==o.state.isNew?o.load().then(()=>{o.loaded()}):o.loaded(),e.embed&&o.evt.on("change",()=>{const e=o.getData();t("update:data",e),t("change",e)}),o.evt.on("blur",e=>{s(e)}),a({c:o}),()=>{let t=null;return(o.state.isNew||0==o.state.isNew&&o.state.loaded)&&(t=jt(ra("gct-form"),{class:"h-full",ref:i,c:o,model:e.model,context:e.context},null)),jt("div",{class:l.b()},[t])}}}),Os=class{constructor(){t(this,"data",{})}},ks=class{constructor(e){t(this,"model",void 0),t(this,"state",new Os),this.model=e}getData(){var e;const t={};return null===(e=this.model)||void 0===e||null===(e=e.fields)||void 0===e||e.forEach(e=>{null!=this.state.data[e]&&(t[e]=this.state.data[e])}),t}resetData(){Object.keys(this.state.data).forEach(e=>{const t=this.state.data[e];t&&("object"==typeof t?Array.isArray(t)?this.state.data[e]=[]:this.state.data[e]={}:this.state.data[e]=null)})}},Ds=/* @__PURE__ */Kt({name:"AppFormItem",props:{model:{type:Object,required:!0}},setup:()=>({ns:kt("app-form-item")}),render(){return jt(ra("a-form-item"),{label:this.model.label,class:this.ns.b()},{default:()=>{var e,t;return[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)]}})}});function Is(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var Ls=/* @__PURE__ */Kt({name:"AppForm",props:{model:{type:Object,required:!0}},setup(e){const t=kt("app-form"),a=function(e){const t=new ks(e);return t.state=la(t.state),t}(e.model),l=e=>{if("hidden"===e.editor.type)return null;const t=_gct.register.editor.get(_l.PREFIX+e.editor.type);console.log("item--------------",a,e,t);let l=null;return t?t.render?l=t.render(a.state.data[e.name],a.state.data,e):t.component?l=$t("string"==typeof t.component?ra(t.component):t.component,{c:a,value:a.state.data[e.name],itemModel:e,model:e.editor,data:a.state.data,"onUpdate:value":t=>{console.log("onUpdate:value",t,a.state.data),a.state.data[e.name]=t,console.log("c.state.data----------",a.state.data)}}):console.error(`未找到编辑器绘制组件:${e.name} - ${e.editor.type},请实现 component 或 render 方法`):console.error(`未找到编辑器适配器:${e.name} - ${e.editor.type}`),jt(Ds,{model:e},Is(l)?l:{default:()=>[l]})},o=e=>e?e.flatMap(e=>{const t=e;return t.children?o(t.children):l(e)}):null;return{ns:t,c:a,renderItem:l,renderContainer:e=>{if("flex"===e.layout){let t;return jt($o,{layout:e.flex},Is(t=o(e.children))?t:{default:()=>[t]})}if("grid"===e.layout){let t;return jt(Ho,{layout:e.grid},Is(t=o(e.children))?t:{default:()=>[t]})}console.error("不支持的layout类型"+e.layout)},renderChildren:o}},render(){let e;return jt(ra("a-form"),{model:this.c.state.data,class:this.ns.b()},Is(e=this.model.children.map(e=>this.renderContainer(e)))?e:{default:()=>[e]})}}),Ms=/* @__PURE__ */Kt({name:"GctSearchForm",props:{model:{type:Object,required:!0},isFixed:{type:Boolean,default:!1}},emits:["search","reset"],setup(e,{emit:t}){const a=kt("gct-search-form"),l=oa(null),o=Mt(()=>{var e;return null===(e=l.value)||void 0===e?void 0:e.c}),i=()=>o.value.getData();return{ns:a,formRef:l,getData:i,resetData:()=>{o.value.resetData(),t("reset",{})},onSearch:()=>{t("search",i())}}},render(){return jt("div",{class:this.ns.b()},[jt("div",{class:this.ns.b("wrapper")},[jt(Ls,{ref:"formRef",model:this.model},null)]),jt("div",{class:[this.ns.b("actions"),this.ns.is("fixed",this.isFixed)]},[jt(ra("a-button"),{class:this.ns.e("reset"),onClick:this.resetData},{default:()=>[Ft("重置")]}),jt(ra("a-button"),{class:this.ns.e("query"),type:"primary",onClick:this.onSearch},{default:()=>[Ft("查询")]})])])}}),As={install(e){e.use(Ss),e.component($o.name,$o),e.component(Go.name,Go),e.component(Ho.name,Ho),e.component(xs.name,xs),e.component(Ms.name,Ms),e.use(Ko)}},Ns=class{constructor(){t(this,"formData",{}),t(this,"items",[]),t(this,"page",1),t(this,"total",0),t(this,"size",20)}},Us=class{constructor(){t(this,"keepalive",!0),t(this,"visible",!0)}},Ps=class extends Us{constructor(...e){super(...e),t(this,"error",!1),t(this,"errMessage",""),t(this,"readonly",!1),t(this,"disabled",!1)}},Vs=class{constructor(){t(this,"hover",!1),t(this,"active",!1),t(this,"deleted",!1)}},Fs=class{get value(){return this.row.data[this.model.dataIndex]}set value(e){const t=this.row.data[this.model.dataIndex];this.row.data[this.model.dataIndex]=e,this.row.change(this.model.name,e,t)}constructor(e,a){t(this,"row",void 0),t(this,"model",void 0),t(this,"state",this.createState()),this.row=e,this.model=a}createState(){return new Us}async init(){}async destroy(){}},js=class extends Fs{},Bs=class extends Fs{createState(){return new Ps}active(){return this.row.active()}unActive(){return this.row.unActive()}},Ks=class{constructor(){t(this,"promise",null),t(this,"resolve",null),t(this,"count",0)}get isLock(){return this.count>0}startPromise(){this.promise=new Promise(e=>{this.resolve=e})}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)return this.count=0,void console.warn("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){if(this.promise)return this.promise}};function Gs(e,t,a){return{install(l){e&&t&&_gct.register.tableEditor.register(nt.PREFIX+e,t),a&&l.component(a.name||a.__name,a)}}}var $s=class{get key(){return this.data[this.model.key]}constructor(e,a,l){t(this,"table",void 0),t(this,"model",void 0),t(this,"data",void 0),t(this,"item",{}),t(this,"fields",[]),t(this,"state",this.createState()),t(this,"activeCount",new Ks),this.table=e,this.model=a,this.data=l}async init(){const e=this.model.columns.map(e=>{let t=null;switch(e.type){case"edit":t=new Bs(this,e);break;case"actions":t=new js(this,e);break;default:t=new Fs(this,e)}return this.fields.push(e.name),t.state=la(t.state),this.item[e.name]=t,t});await Promise.all(e)}change(e,t,a){this.table.change(this,e,t,a)}async destroy(){const e=Object.keys(this.item).map(e=>this.item[e].destroy());this.item={},await Promise.all(e)}active(){this.activeCount.isLock?this.activeCount.lock():(this.activeCount.lock(),this.state.active=!0,this.activeCount.await().then(()=>{this.state.active=!1}))}unActive(){this.activeCount.unlock()}createState(){return new Vs}},zs=class{constructor(e){t(this,"model",void 0),t(this,"evt",new a),t(this,"state",this.createState()),t(this,"row",{}),t(this,"editorProviders",{}),this.model=e,this.init()}init(){this.initTableItems(this.model.columns)}initTableItems(e){e&&e.forEach(e=>{if("edit"===e.type){const t=_gct.register.tableEditor.get(nt.PREFIX+e.editor.type);t&&(this.editorProviders[e.name]=t)}})}async setData(e){await this.destroyControllers(),await this.initControllers(e),this.state.items=e||[]}getData(){return this.state.items}createState(){return new Ns}async initControllers(e){const t=e.map(e=>{const t=e[this.model.key];if(this.row[t])return;const a=new $s(this,this.model,e);return a.state=la(a.state),a.data=la(a.data),this.row[t]=a,Object.keys(e).forEach(a=>{this.state.formData[`${a}___${t}`]=e[a]}),a.init()});await Promise.all(t)}async destroyControllers(){const e=this.state.items.map(e=>e[this.model.key]),t=Object.keys(this.row).filter(t=>!e.includes(t)).map(e=>{const t=this.row[e];delete this.row[e];{const e=Object.keys(t.data),a=t.data[this.model.key];e.forEach(e=>{const t=`${e}___${a}`;delete this.state.formData[t]})}return t.destroy()});await Promise.all(t)}async load(e={}){if(Ra(e,{page:this.state.page,size:this.state.size}),this.model.fetch){const t=await this.model.fetch(e,this);this.state.items=t,this.destroyControllers(),this.initControllers(this.state.items)}}async reload(e){await this.load(e)}async search(e){await this.reload(e)}async refresh(e){await this.load(e)}destroy(){this.evt.reset()}change(e,t,a,l){const o=this.state.items.find(t=>t[this.model.key]===e.key);o&&(Object.assign(o,e.data),this.state.formData[`${t}___${o[this.model.key]}`]=a,this.evt.emit("change",o,t,a,l))}updatePagination(e){Ia(e.total)||(this.state.total=e.total),Ia(e.size)||(this.state.size=e.size),Ia(e.page)||(this.state.page=e.page)}};function Hs(e){const t=e();return t.state=la(t.state),ea(()=>t.destroy()),t}function qs(e,{pagination:t=!0,triggerByWindowSize:a=!0}={}){const l=oa(0);let o=[],i=null,s=null;const n=()=>{var a,s;if(!e)return;i&&(clearTimeout(i),i=null);const r=ma(e).$el??ma(e),d=r.getBoundingClientRect().height??0,u=Math.max((null===(a=r.querySelector(".ant-table-thead"))||void 0===a?void 0:a.getBoundingClientRect().height)??0,48),c=t?Math.max((null===(s=r.querySelector(".ant-table-pagination"))||void 0===s?void 0:s.getBoundingClientRect().height)??0,24)+16:0;l.value=d-u-c,o.push(l.value),o.length>=3&&o[o.length-3]===o[o.length-1]&&o[o.length-2]===o[o.length-1]?o=[]:i=setTimeout(()=>{n()},100)};return a&&window.addEventListener("resize",n),ya(e,async t=>{await Yt(),t&&(n(),(()=>{s&&(s.disconnect(),s=null);const t=ma(e).$el??ma(e);t&&"undefined"!=typeof ResizeObserver&&(s=new ResizeObserver(()=>{i&&clearTimeout(i),i=setTimeout(()=>{n()},100)}),s.observe(t))})())},{immediate:!0}),ea(()=>{window.removeEventListener("resize",n),s&&(s.disconnect(),s=null),i&&(clearTimeout(i),i=null)}),{scrollHeight:l,calcScrollHeight:n}}var Ys=class{constructor(){t(this,"editors",/* @__PURE__ */new Map),t(this,"providers",/* @__PURE__ */new Map)}register(e,t){this.editors.set(e,t)}unregister(e){this.editors.delete(e)}get(e){if(this.providers.has(e))return this.providers.get(e);const t=this.editors.get(e);if(t){const a=t();return this.providers.set(e,a),a}return null}},Xs=class{constructor(){t(this,"component","gct-table-span")}},Ws=/* @__PURE__ */Kt({name:"GctTableSpan",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup:()=>({ns:kt("table-span")}),render(){return jt("div",{class:this.ns.b()},[this.model.icon?jt("span",{class:this.ns.e("icon")},[jt("i",{class:`iconfont ${"string"==typeof this.model.icon?this.model.icon:this.model.icon(this.c.row.data)}`},null)]):null,jt("span",{class:this.ns.e("text")},[this.value])])}}),Zs=Gs(El.SPAN,()=>new Xs,Ws),Js=class{constructor(){t(this,"component","gct-table-text")}},Qs=/* @__PURE__ */Kt({name:"GctTableText",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEdit:{type:Boolean,default:!1}},emits:["update:value"],setup(e){const t=kt("table-text"),a=Ql(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);return{ns:t,val:a,handleBlur:()=>{"string"==typeof a.value&&(a.value=a.value.trim())}}},render(){return!1===this.isEdit?jt("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):jt(ra("a-input"),qt({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("error",this.c.state.error)],prefix:this.model.prefix,suffix:this.model.suffix,addonBefore:this.model.addonBefore,addonAfter:this.model.addonAfter,placeholder:this.model.placeholder,"show-count":null!=this.model.max,maxlength:this.model.max,autocomplete:"off",onBlur:this.handleBlur}),null)}}),en=Gs(El.TEXT,()=>new Js,Qs),tn=class{constructor(){t(this,"component","gct-table-date")}},an=/* @__PURE__ */Kt({name:"GctTableDate",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEdit:{type:Boolean,default:!1}},emits:["update:value"],setup:()=>({ns:kt("table-date"),val:Jl()}),render(){return!1===this.isEdit?jt("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):jt(ra("a-date-picker"),qt({picker:"date",value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("error",this.c.state.error)],placeholder:this.model.placeholder}),null)}}),ln=Gs(El.DATE,()=>new tn,an),on={install(e){e.use(Zs).use(en).use(ln)}};function sn(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Ht(e)}var nn=/* @__PURE__ */Kt({name:"GctTable",props:{count:{type:Number,default:0},model:{type:Object,required:!0},data:{type:Array,default:()=>[]}},emits:["rowChange"],setup(e,{emit:t}){const a=kt("gct-table"),l=oa({}),o=oa(),i=oa(),s=oa();let n=null,r=null;const d=Hs(()=>new zs(e.model));d.evt.on("change",async(e,a,l,o)=>{t("rowChange",Ta(e),a,l,o)}),!0===d.model.local&&ya(()=>e.count,()=>{d.setData(Ta(e.data))}),!0!==d.model.local&&!1!==d.model.autoLoad&&d.load();const u=e=>{if(!e||e===o.value)return null;return e.getAttribute("data-row-key")||u(e.parentElement)},c=e=>{const t=u(e.target);if(t){const e=d.row[t];n&&(n.state.hover=!1),e.state.hover=!0,n=e}},p=e=>{!u(e.target)&&n&&(n.state.hover=!1,n=null)},v=e=>{const t=u(e.target);if(t){const e=d.row[t];r&&r.unActive(),e.active(),r=e}else r&&(r.unActive(),r=null)},m=()=>{r&&(r.unActive(),r=null)};Qt(()=>{o.value&&(o.value.addEventListener("mouseover",c,{capture:!0}),o.value.addEventListener("mouseout",c,{capture:!0}),o.value.addEventListener("mouseleave",p,{capture:!0}),o.value.addEventListener("click",v,{capture:!0})),window.addEventListener("click",m,{capture:!0})}),ea(()=>{o.value&&(o.value.removeEventListener("mouseover",c,{capture:!0}),o.value.removeEventListener("mouseout",c,{capture:!0}),o.value.removeEventListener("mouseleave",p,{capture:!0}),o.value.removeEventListener("click",v,{capture:!0})),window.removeEventListener("click",m,{capture:!0})});const h=Mt(()=>{var t;if(Ia(e.model.pagination))return!1;const a=wa(e.model.pagination);Ra(a,{pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showTotal:!0});const l=!0===a.showTotal?e=>Rt("sys.component.table.total",{total:e}):a.showTotal||void 0,o=null===(t=a.pageSizeOptions)||void 0===t?void 0:t.map(e=>`${e}`);return{class:"pagination-total-left",total:d.state.total,current:d.state.page,pageSize:d.state.size,pageSizeOptions:o,showSizeChanger:a.showSizeChanger,showTotal:l}}),{scrollHeight:y}=qs(o,{pagination:!!h.value});return{ns:a,c:d,loadingState:l,elRef:o,formRef:i,tableRef:s,scrollHeight:y,pagination:h,isEdit:Mt(()=>d.model.columns.some(e=>"edit"===e.type)),handleTableChange:(e,t,a)=>{d.updatePagination({page:e.current,size:e.pageSize}),d.reload()},mouseOver:c,mouseOut:e=>{!u(e.target)&&n&&(n.state.hover=!1,n=null)},onValidate:(e,t,a)=>{const l=e.split("___");if(2===l.length){const[e,o]=l,i=d.row[o];if(i){const l=i.item[e];l&&(l.state.error=!t,a&&a.length>0?l.state.errMessage=a[0]:l.state.errMessage="")}}},validate:()=>i.value.validate(),reload:e=>d.load(e)}},render(){return jt("div",{ref:"elRef",class:this.ns.b(),onMouseover:this.mouseOver,onMouseout:this.mouseOut},[jt(ra("a-form"),{ref:"formRef",model:this.c.state.formData,onValidate:this.onValidate},{default:()=>[jt(ra("a-table"),qt({ref:"tableRef",class:["flex-1",this.ns.is("pagination",!!this.pagination),this.ns.is("not-edit",!this.isEdit)],scroll:{y:this.scrollHeight},columns:this.model.columns,"data-source":this.c.state.items,"row-key":e=>e[this.c.model.key],pagination:this.pagination,onChange:this.handleTableChange},this.$attrs),{headerCell:({title:e,column:t})=>{const a=t;if("edit"===a.type&&a.rules&&a.rules.length>0){const t=a.rules.some(e=>!0===e.required);return jt("span",{title:e,class:[this.ns.e("table-header"),this.ns.is("required",t)]},[jt("span",{class:this.ns.e("table-item")},[e])])}return e},bodyCell:({column:e,text:t,record:a})=>{t=null==t&&1==this.model.isEmptyText?_gct.store.getEmptyDisplay:Oa(t)?t.toString():t;const i=e;if(i.customRender)return i.customRender({record:a});if("edit"===e.type){const t=a[this.c.model.key],l=this.c.row[t];if(l){let a;const o=this.c.editorProviders[e.name],i=ra(o.component),s=l.item[e.name],n=!0===l.state.hover||!0===s.state.error||!0===l.state.active||"all"===this.c.model.rowEditMode;return jt(ra("a-form-item"),{name:`${e.name}___${t}`,class:[this.ns.b("table-item"),this.ns.bm("table-item","edit")],rules:s.model.rules||[]},sn(a=$t(i,{key:s.model.name,c:s,model:s.model.editor,readonly:s.state.readonly,disabled:s.state.disabled,value:s.value,itemModel:s.model,data:l.data,keepalive:s.state.keepalive,visible:s.state.visible,isEdit:n,"onUpdate:value":e=>{s.value=e}}))?a:{default:()=>[a]})}}if("actions"===e.type){const t=e;return jt("div",{class:this.ns.b("table-actions")},[t.actions.filter(e=>!e.hidden||!e.hidden(a)).map(e=>{if("divider"===e.mode)return jt(ra("a-divider"),{type:"vertical"},null);const i=`${e.type}___${e.tag}___${a[this.c.model.key]}`,s=jt(ra("a-button"),qt({class:this.ns.b("table-action-item"),type:e.type,size:"small",loading:!0===this.loadingState[i],onClick:async s=>{if(!e.confirm)if(s.stopPropagation(),e.action)if(l(e.action)||o(e.action)){this.loadingState[i]=!0;try{await e.action(a)}catch(n){console.log(n)}finally{this.loadingState[i]=!1}}else e.action(a);else t.action(e.tag,a)}},e.props),{default:()=>[e.text]});return e.confirm?jt(ra("a-popconfirm"),qt({onConfirm:async()=>{if(e.action)if(l(e.action)||o(e.action)){this.loadingState[i]=!0;try{await e.action(a)}catch(s){console.log(s)}finally{this.loadingState[i]=!1}}else e.action(a);else t.action(e.tag,a)}},e.confirm),sn(s)?s:{default:()=>[s]}):s})])}return"link"===e.type?jt("a",{class:this.ns.e("table-link"),onClick:e=>{e.stopPropagation(),i.click&&i.click(a)}},[t]):t}})]})])}}),rn={install(e){e.component(nn.name,nn)}},dn={install(e){e.use(rn)}},un={install(e){e.use(on),e.use(dn)}},cn=/* @__PURE__ */$e(/* @__PURE__ */Kt({__name:"category-modal",props:{data:{default:()=>({})},module:{}},setup(e){const t=kt("category-modal"),a=la({...e.data}),l=oa();return Ot(async()=>(await l.value.validate(),{ok:!0,data:[Ua(a,e=>void 0!==e)]})),(e,o)=>{const i=ra("a-input"),s=ra("a-form-item"),n=ra("a-form");return ta(),Ut("div",{class:Xt(ma(t).b())},[jt(n,{ref_key:"formRef",ref:l,model:a,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off"},{default:ga(()=>[jt(s,{label:`${ma(Rt)("sys.category")}${ma(Rt)("sys.name")}`,name:"name",rules:[{required:!0}]},{default:ga(()=>[jt(i,{value:a.name,"onUpdate:value":o[0]||(o[0]=e=>a.name=e),"show-count":"",maxlength:100},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])],2)}}}),[["__scopeId","data-v-b560615c"]]),pn=Rt,vn=gt(function(e){const t=/* @__PURE__ */new Map,a=oa(),l=[ct.EDHR,st.INSPECTION,st.RELEASE,ct.ONLINE_FORM].includes(e.module);async function o(t){const a=!!t.data.id,l=await _gct.openUtil.modal(cn,{data:t.data,module:e.module},{title:a?`${pn("sys.edit")}${pn("sys.category")}`:pn("sys.new")+pn("sys.category"),width:640,height:360,okText:pn("sys.okText"),showFooter:!0});if(null==l?void 0:l.ok)return null==l?void 0:l.data[0]}async function i(){const o=l?await wt.getCategoryList({moduleType:e.module})||[]:await _api.apaas.category.getListComplete({module:e.module})||[];a.value=o,t.clear(),Ue(o,({item:e})=>{t.set(e.id,e)},{childrenFields:["child"]})}return{categoryTreeData:a,createCategory:async function(t={}){const a=await o({data:t});return a&&(a.module=e.module,await _api.apaas.category.post(a),await i()),a?{parentId:null==a?void 0:a.parentId}:{}},load:i,editCategory:async function(t){const a={name:t.name||t.title,id:t.key||t.id},l=await o({data:a});l&&(await _api.apaas.category.putId({id:a.id??""},{...l,module:e.module}),await i())},deleteCategoryAPI:async function(e,t,a){return new Promise(l=>{Ha.confirm({title:pn("sys.sureToDeleteCategoryWithName",{name:`${e.name||e.title}`}),icon:jt(ul),content:a||"",okText:pn("sys.okText"),cancelText:pn("sys.cancel"),async onOk(){try{t?await t({id:e.key||e.id}):await _api.apaas.category.delete({ids:e.key||e.id}),al.success(pn("sys.delSuccess")),await i(),l(!0)}catch(a){console.error(a),l(!1)}},onCancel(){l(!1)}})})},getCategoryById:function(e){return t.get(e)},dragCategory:async function(e){await _api.apaas.category.postDrag(e),await i()},isFormDesign:l}}),mn=["title"],hn=/* @__PURE__ */Kt({__name:"category-sider",props:{module:{},value:{},siderTitle:{},readonly:{type:Boolean},isTree:{type:Boolean},needFolderIcon:{type:Boolean},customDelFunc:{},customDelTips:{},hasTitle:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},ignoreCase:{},hasPerBtns:{default:()=>[it.Insert,it.Update,it.Delete]}},emits:["update:value","changeCategory","changeValue"],setup(e,{expose:t,emit:a}){const l="edit",o="delete",i=Rt,s=kt("category-sider"),n=e,r=a,d=Mt({get:()=>n.value?[n.value]:void 0,set(e){r("update:value",null==e?void 0:e[0])}}),u=oa([]),c=oa(),p=oa(),{load:v,createCategory:m,editCategory:h,deleteCategoryAPI:y,dragCategory:f,categoryTreeData:g,isFormDesign:b}=vn({module:n.module}),_=oa(""),E=(e,t)=>{_.value=e?t:""},w=(e,{node:t})=>{var a;0!==e.length&&((null===(a=t.dataRef)||void 0===a||null===(a=a.children)||void 0===a?void 0:a.length)&&!b||(t.categoryId&&!u.value.includes(t.categoryId)&&u.value.push(t.categoryId),r("changeValue",t.dataRef)))},T=Mt(()=>ke(g.value||[],(e,t)=>{const a=e,l={key:a.id,title:a.name,sortNum:a.sortNum,showFolder:a.children&&n.isTree||n.needFolderIcon,sysBuiltin:a.sysBuiltin};return(a.children||a.child)&&n.isTree&&(l.children=t(a.children||a.child)),l}));Qt(async()=>{var e;await v(),n.value||(r("update:value",null===(e=T.value[0])||void 0===e?void 0:e.key),T.value[0]&&r("changeValue",T.value[0]))}),ya(p,()=>{var e;null===(e=p.value)||void 0===e||e.expandAll()},{immediate:!0});const C=async({dragNode:e,after:t})=>{var a;let l=1;t.nextNode?l=Number(t.nextNode.sortNum??0)+1:t.prevNode&&(l=Number(t.prevNode.sortNum??1)),await f({id:e.key,targetParentId:null===(a=t.parent)||void 0===a?void 0:a.key,targetSortNum:l})},R=async()=>{const e=await m();E(!1,""),e.parentId&&u.value.push(e.parentId),d.value=T.value.length?[T.value[0].key]:[],r("changeValue",T.value[0])};return t({getCategoryData:()=>T.value}),(t,a)=>{const v=ra("a-button"),m=ra("a-input"),f=ra("ellipsis-outlined"),g=ra("a-menu-item"),b=ra("a-menu"),S=ra("a-dropdown");return ta(),Ut("div",{class:Xt([ma(s).b()])},[e.hasTitle||!e.readonly?(ta(),Ut("div",{key:0,class:Xt([ma(s).e("title-container")])},[Pt("span",{class:Xt([ma(s).e("title")])},ua(e.siderTitle),3),!e.readonly&&e.hasPerBtns.includes(ma(it).Insert)?(ta(),At(v,{key:0,type:"link",class:Xt([ma(s).e("add")]),onClick:R},{default:ga(()=>[a[3]||(a[3]=Pt("i",{class:"iconfont icon-chuangjian"},null,-1)),Ft(" "+ua(ma(i)("sys.newCategory")),1)]),_:1},8,["class"])):Nt("",!0)],2)):Nt("",!0),Pt("div",{class:Xt([ma(s).e("search-container")])},[jt(m,{value:c.value,"onUpdate:value":a[0]||(a[0]=e=>c.value=e),class:Xt([ma(s).e("search-input")]),placeholder:ma(Rt)("sys.onlineForm.searchCategory"),"allow-clear":""},{prefix:ga(()=>[...a[4]||(a[4]=[Pt("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","class","placeholder"])],2),Pt("div",{class:Xt([ma(s).e("tree-container")])},[T.value.length?(ta(),At(ma(Z),{key:0,ref_key:"treeExRef",ref:p,"selected-keys":d.value,"onUpdate:selectedKeys":a[1]||(a[1]=e=>d.value=e),"expanded-keys":u.value,"onUpdate:expandedKeys":a[2]||(a[2]=e=>u.value=e),class:Xt([ma(s).e("tree"),e.draggable&&"draggable-tree"]),draggable:e.draggable,data:T.value,"last-selection-locked":"",filter:c.value?c.value.trim():"","ignore-case":e.ignoreCase,onDrop:C,onSelect:w},{title:ga(({node:t})=>[Pt("div",{class:Xt([ma(s).b("tree-node"),ma(s).is("highlight",_.value===t.key)])},[Pt("span",{class:Xt([ma(s).be("tree-node","title")]),title:t.title},ua(t.title),11,mn),e.readonly||!e.hasPerBtns.includes(ma(it).Update)&&!e.hasPerBtns.includes(ma(it).Delete)?Nt("",!0):(ta(),At(S,{key:0,class:Xt([ma(s).be("tree-node","more")]),onVisibleChange:e=>{return a=e,l=t.key,void E(a,l);var a,l}},{overlay:ga(()=>[jt(b,{style:{width:"102px"},onClick:e=>((e,t)=>{(async(e,t)=>{switch(t){case l:await h(e),E(!1,e.key);break;case o:{const t=d.value[0],a=await y(e,n.customDelFunc,n.customDelTips);E(!1,e.key),a&&t===e.key&&(d.value=T.value.length?[T.value[0].key]:[],r("changeValue",T.value[0]));break}}})(e,String(t.key))})(t,e)},{default:ga(()=>[e.hasPerBtns.includes(ma(it).Update)?(ta(),At(g,{key:l},{default:ga(()=>[Ft(ua(ma(i)("sys.component.dataConnection.rename")),1)]),_:1})):Nt("",!0),e.hasPerBtns.includes(ma(it).Delete)?(ta(),At(g,{key:o},{default:ga(()=>[Ft(ua(ma(i)("sys.delText")),1)]),_:1})):Nt("",!0)]),_:1},8,["onClick"])]),default:ga(()=>[jt(f)]),_:2},1032,["class","onVisibleChange"]))],2)]),_:1},8,["selected-keys","expanded-keys","class","draggable","data","filter","ignore-case"])):Nt("",!0)],2)],2)}}}),yn=/* @__PURE__ */$e(hn,[["__scopeId","data-v-2ad0d132"]]),fn=Bt(()=>import("./monaco-editor-Cl_E7g__.js")),gn=/* @__PURE__ */$e(/* @__PURE__ */Kt({name:"ColorEditor",__name:"color-editor",props:{value:{}},emits:["update:value"],setup(e,{emit:t}){const a=t,l=(e,t)=>{a("update:value",t)};return(t,a)=>{const o=ra("color-picker");return ta(),At(o,{preset:ma(Ct),color:e.value,"onUpdate:color":l},{icon:ga(()=>[Pt("div",{class:"color-picker-icon",style:Wt({backgroundColor:e.value})},null,4)]),_:1},8,["preset","color"])}}}),[["__scopeId","data-v-7b102f87"]]),bn={FIRST:"first",BEFORE:"before",AFTER:"after",LAST:"last"},_n=/* @__PURE__ */Kt({name:"GctDndItem",props:{config:{type:Object,required:!0},index:{type:Number,required:!0},data:{type:Object,required:!0},last:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=kt("dnd-item"),o=oa(null),i=oa(!1),s=zt("vue3-dnd-drop-line-state"),n=oa(-1),[r,d,u]=Ae({type:a.group,item:()=>({index:e.index,id:e.data.id,data:e.data,group:a.group,mode:a.mode??"move",tagMap:a.tagMap??{},types:[]}),collect:e=>({canDrag:e.canDrag(),isDragging:e.isDragging()}),canDrag:()=>!1!==a.isDrag&&(!a.canDrag||a.canDrag(e.data)),end:async(e,t)=>{const l=t.getDropResult();if(l&&l.asyncDrop){const t=await l.asyncDrop();!0===t.success&&t.data&&(a.end&&a.end(e,t),a.add&&a.add(t.data),console.debug("drop success"))}}});if(!0!==e.config.isDrop){const[e,t]=Ne({accept:a.group,canDrop:()=>!1});t(o)}else{const[t,l]=Ne({accept:a.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:(t,a)=>!0!==r.value.isDragging&&t.id!==e.data.id&&a.isOver({shallow:!0}),hover(t,l){if(!1!==l.canDrop())if(l.isOver({shallow:!0})){const t=o.value.getBoundingClientRect(),n=l.getClientOffset(),r=a.offset??0;let d=0;if("vertical"===a.direction){const{top:e,height:a}=t,{y:l}=n;if(d=l-e-a/2,Math.abs(d)<r)return;i.value=d<0}else if("horizontal"===a.direction){const{left:e,width:a}=t,{x:l}=n;if(d=l-e-a/2,Math.abs(d)<r)return;i.value=d<0}s.activeKey=e.data.id,s.isBeforeHover=i.value}else s.activeKey=""},drop:(l,o)=>{if(s.activeKey="",!0===t.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let t=l.data;return a.drop&&(t=await a.drop(l),!t)?{group:a.group,cfg:Ta(e.config),success:!1}:(c(i.value?bn.BEFORE:bn.AFTER,t),{group:a.group,success:!0,cfg:Ta(e.config),data:t})}}}});l(o)}function c(e,a){t("drop",e,a)}return a.handle||!1===a.isDrag||d(o),u(o),{ns:l,rootRef:o,posState:n,collect:r,onDrop:c,drag:d}},render(){var e,t;const a={index:this.index,data:this.data,drag:this.drag};return jt("div",{ref:"rootRef",class:[this.ns.b(),this.ns.is("dragging",this.collect.isDragging),this.ns.is("not-drag",!1===this.collect.canDrag)]},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t,a)])}}),En=/* @__PURE__ */Kt({name:"GctDndDropLine",props:{config:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=kt("dnd-drop-line"),o=oa(null),[i,s]=Ne({accept:e.config.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:e=>!1!==a.isDrop&&(!a.canDrop||a.canDrop(e)),drop:(l,o)=>{if(!0===i.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let o=l.data;return a.drop&&(o=await a.drop(l),!o)?{group:a.group,cfg:Ta(e.config),success:!1}:(t("drop",o),{group:a.group,success:!0,cfg:Ta(e.config),data:o})}}}});return!1!==a.isDrop&&s(o),{ns:l,rootRef:o,collect:i}},render(){return jt("div",{ref:"rootRef",class:[this.collect.handlerId,this.ns.b(),this.ns.is("over",this.collect.isOver&&this.collect.canDrop),this.ns.is("shallow-over",this.collect.isShallowOver&&this.collect.canDrop),this.ns.is("not-drop",!1===this.collect.canDrop&&this.collect.isShallowOver),this.ns.is("active",this.active)]},[jt("div",{class:this.ns.e("line")},null)])}}),wn=/* @__PURE__ */Kt({name:"GctDndContainer",props:{config:{type:Object,default:()=>({group:"GctDnd",insertPos:bn.LAST})},items:{type:Array,default:()=>[]}},emits:["update:items"],setup(e,{emit:t}){const{config:a}=e,l=kt("dnd-container"),o=oa(null),i=la({activeKey:"",isBeforeHover:!1});aa("vue3-dnd-drop-line-state",i);const s=pa(e.items),[n,r]=Ne({accept:a.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:e=>!1!==a.isDrop&&(!a.canDrop||a.canDrop(e)),drop:(l,o)=>{if(!0===n.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let o=l.data;return a.drop&&(o=await a.drop(l),!o)?{group:a.group,success:!1,cfg:Ta(e.config)}:(-1===s.value.findIndex(e=>e.id===l.data.id)&&d(e.config.insertPos,o),t("update:items",s.value),{group:a.group,success:!0,cfg:Ta(e.config),data:o})}}}});function d(e,a,l=-1){if(a){if(e===bn.FIRST)s.value.unshift(a);else if(e===bn.LAST)s.value.push(a);else{if(-1===l)return void console.error("insertIndex is required");const t=s.value.findIndex(e=>e.id===a.id);if(t===l)return;-1!==t&&l<t&&s.value.splice(t,1),e===bn.AFTER?s.value.splice(l+1,0,a):s.value.splice(l,0,a),-1!==t&&l>t&&s.value.splice(t,1)}t("update:items",s.value)}else console.error("data is required")}return!1!==a.isDrop&&r(o),ya(n,()=>{!0!==n.value.isOver&&(i.activeKey="")}),{ns:l,rootRef:o,dropLineState:i,collect:n,onDrop:d}},render(){var e,t,a,l;const o=this.items[this.items.length-1];return jt("div",{ref:"rootRef",class:[this.collect.handlerId,this.ns.b(),this.ns.is("over",this.collect.isOver&&this.collect.canDrop),this.ns.is("not-drop",!1===this.collect.canDrop&&this.collect.isOver),this.ns.is("shallow-over",this.collect.isShallowOver&&this.collect.canDrop)]},[null===(e=(t=this.$slots).before)||void 0===e?void 0:e.call(t),this.items.map((e,t)=>{const a=this.items[t-1],l=[];return!1!==this.config.isDrop&&l.push(jt(En,{key:e.id+"___line",config:this.config,active:!0===this.dropLineState.isBeforeHover&&this.dropLineState.activeKey===e.id||a&&this.dropLineState.activeKey===a.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(bn.BEFORE,e,t)},null)),l.push(jt(_n,{key:e.id,config:this.config,index:t,data:e,last:t===this.items.length-1,onDrop:(e,a)=>this.onDrop(e,a,t)},{default:this.$slots.default})),l}),o?jt(En,{key:o.id+"___last-line",config:this.config,active:this.dropLineState.activeKey===o.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(bn.AFTER,e,this.items.length-1)},null):null,null===(a=(l=this.$slots).after)||void 0===a?void 0:a.call(l)])}}),Tn={aspectRatio:1,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,autoCrop:!0,background:!0,highlight:!0,center:!0,responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,scalable:!0,modal:!0,guides:!0,movable:!0,rotatable:!0},Cn={src:{type:String,required:!0},alt:{type:String},circled:{type:Boolean,default:!1},realTimePreview:{type:Boolean,default:!0},height:{type:[String,Number],default:"360px"},width:{type:[String,Number],default:"360px"},crossorigin:{type:String,default:void 0},imageStyle:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},Rn=Kt({name:"CropperImage",props:Cn,emits:["cropend","ready","cropendError"],setup(t,{attrs:a,emit:l}){const o=oa(),i=oa(),s=oa(!1),n=kt("cropper-image"),r=Re(p,80),d=Mt(()=>({height:t.height,width:t.width,maxWidth:"100%",...t.imageStyle})),u=Mt(()=>[n.b(),a.class,{[n.m("circled")]:t.circled}]),c=Mt(()=>({height:`${t.height}`.replace(/px/,"")+"px",width:`${t.width}`.replace(/px/,"")+"px"}));function p(){t.realTimePreview&&v()}function v(){if(!i.value)return;let e=i.value.getData();(t.circled?function(){const e=i.value.getCroppedCanvas(),t=document.createElement("canvas"),a=t.getContext("2d"),l=e.width,o=e.height;return t.width=l,t.height=o,a.imageSmoothingEnabled=!0,a.drawImage(e,0,0,l,o),a.globalCompositeOperation="destination-in",a.beginPath(),a.arc(l/2,o/2,Math.min(l,o)/2,0,2*Math.PI,!0),a.fill(),t}():i.value.getCroppedCanvas()).toBlob(t=>{if(!t)return;let a=new FileReader;a.readAsDataURL(t),a.onloadend=t=>{var a;l("cropend",{imgBase64:(null===(a=t.target)||void 0===a?void 0:a.result)??"",imgInfo:e})},a.onerror=()=>{l("cropendError")}},"image/png")}return Qt(async function(){const a=ma(o);if(!a)return;const[{default:n}]=await Promise.all([import("./cropper-CYj8Bfd1.js").then(t=>/* @__PURE__ */e(t.default,1)),Promise.resolve({ })]);i.value=new n(a,{...Tn,ready:()=>{s.value=!0,p(),l("ready",i.value)},crop(){r()},zoom(){r()},cropmove(){r()},...t.options})}),ea(()=>{var e;null===(e=i.value)||void 0===e||e.destroy()}),{getClass:u,imgElRef:o,getWrapperStyle:c,getImageStyle:d,isReady:s,croppered:v}}}),Sn=["src","alt","crossorigin"],xn=/* @__PURE__ */$e(Rn,[["render",function(e,t,a,l,o,i){return ta(),Ut("div",{class:Xt(e.getClass),style:Wt(e.getWrapperStyle)},[ba(Pt("img",{ref:"imgElRef",src:e.src,alt:e.alt,crossorigin:e.crossorigin,style:Wt(e.getImageStyle)},null,12,Sn),[[ha,e.isReady]])],6)}]]),On={key:1,class:"empty"},kn={class:"flex flex-col justify-center items-center"},Dn=["title"],In=/* @__PURE__ */Kt({__name:"CopperFreeModal",props:{title:{type:String,default:"图片上传"},circled:{type:Boolean,default:!0},uploadApi:{type:Function},src:{type:String},aspectRatio:{type:Number},accept:{type:Array,default:["jpg","jpeg","png","bmp"]},beforeUpload:{type:Function},uploadText:{type:String}},emits:["uploadSuccess","register"],setup(e,{emit:t}){const a=e,l=t,o=oa(a.src||""),i=oa(a.src||""),s=oa(""),n=oa();let r=1,d=1,u="";const c=Mt(()=>a.accept.map(e=>`image/${e}`).join(",")),p=kt("cropper-free"),[v,{closeModal:m,setModalProps:h}]=X(e=>{(null==e?void 0:e.file)&&y(e.file)});async function y(e){if(a.beforeUpload&&await a.beforeUpload(e),e.size/1024/1024>4)return al.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!c.value.includes(e.type))return al.warning(`【${e.name}】${Rt("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),o.value="",s.value="",t.onload=function(t){var a;o.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",u=e.name},!1}function f({imgBase64:e}){s.value=e}function g(e){n.value=e}function b(e,t){var a,l;"scaleX"===e&&(r=t=-1===r?1:-1),"scaleY"===e&&(d=t=-1===d?1:-1),null===(a=n.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function _(){const e=a.uploadApi;if(e&&Da(e)){const t=_t(s.value);try{h({confirmLoading:!0});const a=await e({name:"file",file:t,filename:u});l("uploadSuccess",{source:s.value,data:a.data}),m()}finally{h({confirmLoading:!1})}}}function E(){o.value="",setTimeout(()=>{o.value=i.value||""})}return ya(()=>a.src,e=>{o.value=e||"",i.value=e||""}),(t,a)=>{const l=ra("PlusOutlined"),i=ra("a-button");return ta(),At(ma(W),qt(t.$attrs,{title:e.title,width:"640px","min-height":"510","can-fullscreen":!1,"ok-text":ma(Rt)("sys.okText"),onRegister:ma(v),onOk:_,onCancel:E}),{default:ga(()=>[Pt("div",{class:Xt(ma(p).b())},[Pt("div",{class:Xt(ma(p).b("left"))},[Pt("div",{class:Xt(ma(p).b("cropper"))},[o.value?(ta(),At(xn,{key:0,src:o.value,height:"304px",width:"538px",options:{aspectRatio:e.aspectRatio??200/120},onCropend:f,onReady:g},null,8,["src","options"])):(ta(),Ut("div",On,[jt(ma(tl),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":y},{default:ga(()=>[Pt("div",kn,[jt(l),a[14]||(a[14]=Pt("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Pt("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),o.value?(ta(),Ut("div",{key:0,class:Xt(ma(p).b("toolbar"))},[jt(ma(tl),{"file-list":[],accept:c.value,"before-upload":y},{default:ga(()=>[e.uploadText?(ta(),At(i,{key:0,type:"link",size:"small",style:{padding:"0"}},{default:ga(()=>[Ft(ua(e.uploadText),1)]),_:1})):(ta(),Ut("a",{key:1,title:ma(Rt)("sys.reUpload"),placement:"bottom"},ua(ma(Rt)("sys.reUpload")),9,Dn))]),_:1},8,["accept"]),jt(ma(Za),null,{default:ga(()=>[jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Ea(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>b("zoom",.1))},{icon:ga(()=>[...a[16]||(a[16]=[Pt("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Ea(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>b("zoom",-.1))},{icon:ga(()=>[...a[17]||(a[17]=[Pt("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Ea(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>b("rotate",-45))},{icon:ga(()=>[...a[18]||(a[18]=[Pt("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Ea(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>b("rotate",45))},{icon:ga(()=>[...a[19]||(a[19]=[Pt("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Ea(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>b("scaleX"))},{icon:ga(()=>[...a[20]||(a[20]=[Pt("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Ea(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>b("scaleY"))},{icon:ga(()=>[...a[21]||(a[21]=[Pt("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:ga(()=>[jt(i,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Ea(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>b("reset"))},{icon:ga(()=>[jt(ma(ml))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Nt("",!0)],2)],2)]),_:1},16,["title","ok-text","onRegister"])}}}),Ln=/* @__PURE__ */$e(In,[["__scopeId","data-v-da6428d3"]]),Mn={key:1,class:"empty"},An={class:"flex flex-col justify-center items-center"},Nn=["title"],Un={class:"flex-col"},Pn={class:"flex-col"},Vn={class:"flex-col text-center"},Fn=/* @__PURE__ */Kt({__name:"CopperModal",props:{circled:{type:Boolean,default:!0},uploadApi:{type:Function},src:{type:String},sourceUrlValue:{type:String}},emits:["uploadSuccess","register"],setup(e,{emit:t}){const a=e,l=t,o=oa(a.src||""),i=oa(""),s=oa();let n=1,r=1,d="";const u=kt("cropper-am"),[c,{closeModal:p,setModalProps:v}]=X();function m(e){if(e.size/1024/1024>4)return al.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!["image/jpg","image/jpeg","image/png","image/bmp"].includes(e.type))return al.warning(`【${e.name}】${Rt("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),o.value="",i.value="",t.onload=function(t){var a;o.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",d=e.name},!1}function h({imgBase64:e}){i.value=e}function y(e){s.value=e}function f(e,t){var a,l;"scaleX"===e&&(n=t=-1===n?1:-1),"scaleY"===e&&(r=t=-1===r?1:-1),null===(a=s.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function g(){const e=a.uploadApi;if(e&&Da(e)){const t=_t(i.value);try{v({confirmLoading:!0});const a=await e({name:"file",file:t,filename:d});l("uploadSuccess",{source:i.value,data:a.data.data}),p()}finally{v({confirmLoading:!1})}}}return(t,a)=>{const l=ra("PlusOutlined"),s=ra("a-button"),n=ra("Avatar");return ta(),At(ma(W),qt(t.$attrs,{title:ma(Rt)("sys.component.cropper.modalTitle"),width:"600px","min-height":"570","can-fullscreen":!1,"ok-text":ma(Rt)("sys.okText"),onRegister:ma(c),onOk:g}),{default:ga(()=>[Pt("div",{class:Xt(ma(u).b())},[Pt("div",{class:Xt(ma(u).b("left"))},[Pt("div",{class:Xt(ma(u).b("cropper"))},[o.value?(ta(),At(xn,{key:0,src:o.value,height:"360px",width:"360px",circled:e.circled,onCropend:h,onReady:y},null,8,["src","circled"])):Nt("",!0),e.sourceUrlValue||"/404.png"!==o.value?Nt("",!0):(ta(),Ut("div",Mn,[jt(ma(tl),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":m},{default:ga(()=>[Pt("div",An,[jt(l),a[14]||(a[14]=Pt("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Pt("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),e.sourceUrlValue||"/404.png"!==o.value?(ta(),Ut("div",{key:0,class:Xt(ma(u).b("toolbar"))},[jt(ma(tl),{"file-list":[],accept:"image/*","before-upload":m},{default:ga(()=>[Pt("a",{title:ma(Rt)("sys.reUpload"),placement:"bottom"},ua(ma(Rt)("sys.reUpload")),9,Nn)]),_:1}),jt(ma(Za),null,{default:ga(()=>[jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Ea(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>f("zoom",.1))},{icon:ga(()=>[...a[16]||(a[16]=[Pt("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Ea(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>f("zoom",-.1))},{icon:ga(()=>[...a[17]||(a[17]=[Pt("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Ea(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>f("rotate",-45))},{icon:ga(()=>[...a[18]||(a[18]=[Pt("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Ea(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>f("rotate",45))},{icon:ga(()=>[...a[19]||(a[19]=[Pt("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Ea(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>f("scaleX"))},{icon:ga(()=>[...a[20]||(a[20]=[Pt("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Ea(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>f("scaleY"))},{icon:ga(()=>[...a[21]||(a[21]=[Pt("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),jt(ma(Qa),{title:ma(Rt)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:ga(()=>[jt(s,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Ea(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>f("reset"))},{icon:ga(()=>[jt(ma(ml))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Nt("",!0)],2),Pt("div",{class:Xt([ma(u).b("right"),"text-center"])},[a[22]||(a[22]=Ft(" 预览 ",-1)),Pt("div",{class:Xt(ma(u).b("group"))},[Pt("div",Un,[jt(n,{src:i.value,size:102},null,8,["src"])]),Pt("div",Pn,[jt(n,{src:i.value,size:78},null,8,["src"])]),Pt("div",Vn,[jt(n,{src:i.value,size:28},null,8,["src"])])],2)],2)],2),a[23]||(a[23]=Pt("div",{class:"absolute z-10 top-0 left-2/3 w-0 h-full",style:{"border-left":"1px solid #e0e3ea"}},null,-1))]),_:1},16,["title","ok-text","onRegister"])}}}),jn=/* @__PURE__ */$e(Fn,[["__scopeId","data-v-f1134678"]]),Bn=["src"],Kn=/* @__PURE__ */Kt({__name:"CropperAvatar",props:{width:{type:[String,Number],default:"200px"},value:{type:String},showBtn:{type:Boolean,default:!0},btnProps:{type:Object},btnText:{type:String,default:""},uploadApi:{type:Function}},emits:["update:value","change"],setup(e,{expose:t,emit:a}){const l=e,o=a,i=oa("/extras-assets/images/default_avatar.png"),s=oa(St(l.value)||""),r=oa(l.value||""),d=kt("cropper-avatar"),[u,{openModal:c,closeModal:p}]=n(),v=Mt(()=>[d.b()]),m=Mt(()=>`${l.width}`.replace(/px/,"")+"px"),h=Mt(()=>parseInt(`${l.width}`.replace(/px/,""))/2+"px"),y=Mt(()=>({width:ma(m)})),f=Mt(()=>({width:ma(m),height:ma(m)}));function g({source:e,data:t}){s.value=St(t),r.value=t,o("change",{source:e,data:t})}fa(()=>{s.value=St(l.value)||"",r.value=l.value||""}),ya(()=>r.value,e=>{o("update:value",e)});const b=()=>{c()};return t({openModal:c.bind(null,!0),closeModal:p}),(t,a)=>{const l=ra("a-button");return ta(),Ut("div",{class:Xt(v.value),style:Wt(y.value)},[Pt("div",{class:Xt(ma(d).b("image-wrapper")),style:Wt(f.value),onClick:b},[Pt("div",{class:Xt(ma(d).b("image-mask")),style:Wt(f.value)},[jt(ma(dl),{style:Wt({width:h.value,height:h.value}),"two-tone-color":"#d6d6d6"},null,8,["style"])],6),Pt("img",{src:e.value?s.value:i.value,alt:"avatar"},null,8,Bn)],6),e.showBtn?(ta(),At(l,qt({key:0,class:ma(d).b("upload-btn")},e.btnProps,{onClick:ma(c)}),{default:ga(()=>[Ft(ua(e.btnText?e.btnText:ma(Rt)("sys.component.cropper.selectImage")),1)]),_:1},16,["class","onClick"])):Nt("",!0),jt(jn,{"upload-api":e.uploadApi,src:s.value,"source-url-value":r.value,onRegister:ma(u),onUploadSuccess:g},null,8,["upload-api","src","source-url-value","onRegister"])],6)}}}),Gn=/* @__PURE__ */$e(Kn,[["__scopeId","data-v-ef939ff0"]]),$n=/* @__PURE__ */Kt({__name:"picture-preview",props:{functional:{type:Boolean},imageList:{type:Array,default:()=>[]}},setup(e){const t=e,a=kt("image-preview"),l=Mt(()=>t.imageList.map(e=>La(e)?{src:e,placeholder:!1}:e));return(t,o)=>{const i=ra("PreviewGroup");return ta(),Ut("div",{class:Xt(ma(a).b())},[jt(i,null,{default:ga(()=>[!e.imageList||t.$slots.default?na(t.$slots,"default",{key:0}):(ta(!0),Ut(Lt,{key:1},sa(l.value,e=>(ta(),At(ma($a),qt({key:e.src,ref_for:!0},e),Vt({_:2},[e.placeholder?{name:"placeholder",fn:ga(()=>[jt(ma($a),qt({ref_for:!0},e,{src:e.placeholder,preview:!1}),null,16,["src"])]),key:"0"}:void 0]),1040))),128))]),_:3})],2)}}}),zn=$n,Hn=/* @__PURE__ */function(e){return e[e.LOADING=0]="LOADING",e[e.DONE=1]="DONE",e[e.FAIL=2]="FAIL",e}(Hn||{}),qn={show:{type:Boolean,default:!1},imageList:{type:Array,default:null},index:{type:Number,default:0},scaleStep:{type:Number},defaultWidth:{type:Number},maskClosable:{type:Boolean},rememberState:{type:Boolean}},Yn="img-preview",Xn=/* @__PURE__ */Kt({name:"ImagePreview",props:qn,emits:["img-load","img-error"],setup(e,{expose:t,emit:a}){const l=/* @__PURE__ */new Map,o=la({currentUrl:"",imgScale:1,imgRotate:0,imgTop:0,imgLeft:0,status:Hn.LOADING,currentIndex:0,moveX:0,moveY:0,show:e.show}),i=oa(null),s=oa(null);function n(){o.imgScale=1,o.imgRotate=0,o.imgTop=0,o.imgLeft=0}const r=Mt(()=>{const t=(null==e?void 0:e.scaleStep)??0;return t>0&&t<100?t/100:o.imgScale/10});function d(e){(e=e||window.event).delta=e.wheelDelta||-e.detail,e.preventDefault(),e.delta>0&&u(r.value),e.delta<0&&u(-r.value)}function u(e){o.imgScale<=.2&&e<0||(o.imgScale+=.1*e,o.imgScale<0&&(o.imgScale=.02))}function c(e){o.imgRotate+=e}function p(){const e=ma(s);e&&(e.onmousemove=null)}function v(t){o.status=Hn.LOADING;const i=new Image;i.src=t,i.onload=i=>{if(o.currentUrl!==t){const s=i.composedPath();if(e.rememberState){l.set(o.currentUrl,{scale:o.imgScale,top:o.imgTop,left:o.imgLeft,rotate:o.imgRotate});const a=l.get(t);a?(o.imgScale=a.scale,o.imgTop=a.top,o.imgRotate=a.rotate,o.imgLeft=a.left):(n(),e.defaultWidth&&(o.imgScale=e.defaultWidth/s[0].naturalWidth))}else e.defaultWidth&&(o.imgScale=e.defaultWidth/s[0].naturalWidth);s&&a("img-load",{index:o.currentIndex,dom:s[0],url:t})}o.currentUrl=t,o.status=Hn.DONE},i.onerror=e=>{const l=e.composedPath();l&&a("img-error",{index:o.currentIndex,dom:l[0],url:t}),o.status=Hn.FAIL}}function m(e){e&&e.stopPropagation(),h()}function h(){o.show=!1,document.body.removeEventListener("DOMMouseScroll",d),document.ondragstart=null}function y(){n()}function f(t){const{currentIndex:a}=o,{imageList:l}=e;"left"===t&&(o.currentIndex-=1,a<=0&&(o.currentIndex=l.length-1)),"right"===t&&(o.currentIndex+=1,a>=l.length-1&&(o.currentIndex=0)),v(l[o.currentIndex])}function g(e){e=e||window.event,o.moveX=e.clientX,o.moveY=e.clientY;const t=ma(s);t&&(t.onmousemove=b)}function b(e){(e=e||window.event).preventDefault();const t=e.clientX-o.moveX,a=e.clientY-o.moveY;o.imgLeft+=t,o.imgTop+=a,o.moveX=e.clientX,o.moveY=e.clientY}t({resume:y,close:h,prev:f.bind(null,"left"),next:f.bind(null,"right"),setScale:e=>{e>0&&e<=10&&(o.imgScale=e)},setRotate:e=>{o.imgRotate=e}});const _=Mt(()=>{const{imgScale:t,imgRotate:a,imgTop:l,imgLeft:i}=o;return{transform:`scale(${t}) rotate(${a}deg)`,marginTop:`${l}px`,marginLeft:`${i}px`,maxWidth:e.defaultWidth?"unset":"100%"}}),E=Mt(()=>{const{imageList:t}=e;return t.length>1});fa(()=>{e.show&&function(){!function(){const e=ma(i);e&&(e.onmousewheel=d,document.body.addEventListener("DOMMouseScroll",d),document.ondragstart=function(){return!1})}();const{index:t,imageList:a}=e;if(!a||!a.length)throw new Error("imageList is undefined");o.currentIndex=t,v(a[t])}(),e.imageList&&n()});const w=t=>{e.maskClosable&&t.target&&t.target.classList.contains(`${Yn}-content`)&&m(t)},T=()=>{if(!ma(E))return null;const{currentIndex:t}=o,{imageList:a}=e;return jt("div",{class:`${Yn}__index`},[t+1,Ft(" / "),a.length])},C=e=>ma(E)?jt("div",{class:[`${Yn}__arrow`,e],onClick:()=>f(e)},[jt("left"===e?pl:hl,null,null)]):null;return()=>o.show&&jt("div",{class:Yn,ref:i,onMouseup:p,onClick:w},[jt("div",{class:`${Yn}-content`},[jt("img",{style:ma(_),class:[`${Yn}-image`,o.status===Hn.DONE?"":"hidden"],ref:s,src:o.currentUrl,onMousedown:g},null),jt("div",{class:`${Yn}__close`,onClick:m},[jt(nl,{class:`${Yn}__close-icon`},null)]),T(),jt("div",{class:`${Yn}__controller`},[jt("div",{class:`${Yn}__controller-item`,onClick:()=>u(-r.value)},[jt("img",{src:"/extras-assets/svg/preview/unscale.svg"},null)]),jt("div",{class:`${Yn}__controller-item`,onClick:()=>u(r.value)},[jt("img",{src:"/extras-assets/svg/preview/scale.svg"},null)]),jt("div",{class:`${Yn}__controller-item`,onClick:y},[jt("img",{src:"/extras-assets/svg/preview/resume.svg"},null)]),jt("div",{class:`${Yn}__controller-item`,onClick:()=>c(-90)},[jt("img",{src:"/extras-assets/svg/preview/unrotate.svg"},null)]),jt("div",{class:`${Yn}__controller-item`,onClick:()=>c(90)},[jt("img",{src:"/extras-assets/svg/preview/p-rotate.svg"},null)])]),C("left"),C("right")])])}}),Wn=Xn,Zn=null;function Jn(e){var t;const a={},l=document.createElement("div");return Object.assign(a,{show:!0,index:0,scaleStep:100},e),Zn=jt(Wn,a),ia(Zn,l),document.body.appendChild(l),null===(t=Zn.component)||void 0===t?void 0:t.exposed}var Qn=["src"],er={key:0,class:"iconfont icon-tupian-shili"},tr={class:"prompt"},ar={key:0,class:"auxiliary"},lr="cropper-photo",or=/* @__PURE__ */Kt({__name:"CropperFree",props:{value:{type:String},uploadApi:{type:Function},aspectRatio:{type:Number},auxiliary:{type:String},icon:{type:String},isDrag:{type:Boolean,default:!1},accept:{type:Array},beforeUpload:{type:Function},modalTitle:{type:String},uploadText:{type:String},disabled:{type:Boolean,default:!1}},emits:["update:value","change"],setup(e,{expose:t,emit:a}){const l=e,o=a,i=oa(l.value||""),s=Mt(()=>i.value?Et(i.value):"");let r={};const[d,{openModal:u,closeModal:c}]=n(),p=Mt(()=>l.disabled),v=Mt(()=>{var e,t,a;return(null===(e=l.accept)||void 0===e?void 0:e.length)?[...new Set((null===(t=l.accept)||void 0===t?void 0:t.some(e=>"jpg"===e||"jpeg"===e))?null===(a=l.accept)||void 0===a?void 0:a.concat(["jpg","jpeg"]):l.accept)].map(e=>"image/"+e):["image/jpg","image/jpeg","image/png"]});function m({source:e,data:t}){i.value=t,o("change",{source:e,data:t})}function h(){r=Jn({imageList:[s.value]})}function y(){i.value=""}fa(()=>{i.value=l.value||""}),ya(()=>i.value,e=>{o("update:value",e)}),Jt(()=>{r&&r.close&&r.close()}),Qt(()=>{const e=document.getElementById("dropzone");null==e||e.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),null==e||e.addEventListener("drop",e=>{var t;e.stopPropagation(),e.preventDefault();const a=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if(a){if(!v.value.includes(a.type))return void al.warning(Rt("sys.component.cropper.acceptTip"));u(!0,{file:a})}})});const f=()=>{u()};return t({openModal:u.bind(null,!0),closeModal:c}),(t,a)=>{var l;const o=ra("Icon");return ta(),Ut("div",{id:"dropzone",class:Xt([lr,p.value&&"not-allow"])},[s.value?(ta(),Ut(Lt,{key:0},[Pt("div",{class:Xt(`${lr}__wrapper`)},[Pt("img",{src:s.value},null,8,Qn)],2),Pt("div",{class:Xt(`${lr}__mask`)},[jt(ma(cl),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:h}),jt(ma(dl),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:a[0]||(a[0]=()=>ma(u)())}),jt(ma(rl),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:y})],2)],64)):(ta(),Ut("div",{key:1,class:Xt(`${lr}__trigger`),onClick:f},[e.icon?(ta(),Ut("i",er)):(ta(),At(o,{key:1,icon:"ant-design:plus-outlined",size:36})),e.isDrag?(ta(),Ut(Lt,{key:2},[Pt("p",tr,ua(ma(Rt)("sys.pageDesigner.clickOrDragToUpload")),1),e.accept?(ta(),Ut("p",ar,ua(`支持${null===(l=e.accept)||void 0===l?void 0:l.join("、")}图片格式,大小100KB以内`),1)):Nt("",!0)],64)):Nt("",!0),e.auxiliary?Nt("",!0):(ta(),Ut(Lt,{key:3},[Ft(ua(ma(Rt)("sys.clickToDoSth",{sth:ma(Rt)("sys.add")})),1)],64))],2)),jt(Ln,{"upload-api":e.uploadApi,"aspect-ratio":e.aspectRatio,src:s.value,accept:e.accept,"before-upload":e.beforeUpload,title:e.modalTitle,"upload-text":e.uploadText,onRegister:ma(d),onUploadSuccess:m},null,8,["upload-api","aspect-ratio","src","accept","before-upload","title","upload-text","onRegister"])],2)}}}),ir=/* @__PURE__ */$e(or,[["__scopeId","data-v-840e141f"]]),sr={key:0,class:"px-2"},nr={key:1,class:"font-bold mb-3"},rr={key:2,class:"gct-print-tmpl-modal-wrap ks-col"},dr={class:"print-tmpl-vxe-table-wrapper"},ur={class:"print-tmpl-vxe-table-area"},cr={class:"ks-row"},pr={class:"gct-text-overflow"},vr={key:0,class:"gct-custom-tag ml4px"},mr={class:"ks-row"},hr=["title"],yr={class:"pt-12px"},fr={key:3,class:"gct-print-tmpl-modal-right btw-visible flex flex-col h-full px-2 py-3"},gr={class:"print-tmpl-vxe-table-wrapper"},br={class:"print-tmpl-vxe-table-area"},_r={class:"tmpl-path"},Er=["src"],wr=["src"],Tr={class:"pt-12px"},Cr=/* @__PURE__ */Kt({__name:"print-tmpl-modal",props:{selected:{},modal:{},moduleType:{},printMode:{},className:{},isRdo:{type:Boolean,default:!1},multiple:{type:Boolean},categoryTitle:{default:void 0},queryParams:{},btwForceVisible:{type:Boolean,default:!1},ignoreCase:{},modelKey:{}},setup(e){const t=e,a=kt("print-tmpl-modal"),l=oa([]),o=oa(),i=oa(),s=oa({pageNo:1,pageSize:20}),n=oa({pageNo:1,pageSize:20}),r=oa("design"),d=oa(0),u=oa(!1),c=oa(0),p=oa(!1),v=Mt(()=>t.printMode===pt.Server||t.btwForceVisible),m=Mt(()=>t.moduleType),h=oa(Mt(()=>{var e,a;return Array.isArray(t.selected)?null===(e=t.selected)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.categoryId:null===(a=t.selected)||void 0===a?void 0:a.categoryId}).value||""),y=oa({categoryId:h.value,name:""}),f=oa({name:""}),g=oa(""),b=/(?<!\\)\\(?!\\)/g,_=Mt(()=>({current:s.value.pageNo,pageSize:s.value.pageSize,total:d.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>Rt("sys.component.table.total",{total:e})})),E=Mt(()=>({current:n.value.pageNo,pageSize:n.value.pageSize,total:c.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>Rt("sys.component.table.total",{total:e})})),w=oa([]),T=oa([]),C={[mt.LABEL]:Rt("sys.pageDesigner.label"),[mt.RECEIPT]:Rt("sys.pageDesigner.document"),[ct.EDHR]:"DHR",[ct.ONLINE_FORM]:Rt("sys.pageDesigner.fieldCmp.online_form")};Qt(()=>{Yt(()=>{t.selected&&(Array.isArray(t.selected)?(R(t.selected),l.value=[...t.selected]):(R([t.selected]),l.value=[{...t.selected}]))})});const R=e=>{const t=o.value;t&&t.setCheckboxRow(e,!0)},S=e=>e.children||!t.isRdo?e.name:e.version,x=Mt(()=>[ct.EDHR,ct.ONLINE_FORM].includes(t.moduleType)),O=Mt(()=>C[t.moduleType]),k=Mt(()=>t.categoryTitle||!Ia(t.categoryTitle)?t.categoryTitle:Rt("sys.categoryOfSth",{sth:O.value})),D=e=>{y.value.categoryId=null==e?void 0:e.key},I=e=>{l.value=[{...e.row}]},L=({checked:e,row:t})=>{var a,o;e?null===(a=l.value)||void 0===a||a.push(t):l.value=null===(o=l.value)||void 0===o?void 0:o.filter(e=>e.id!==t.id)};function M(e,t){s.value.pageNo=e,s.value.pageSize=t,U()}function A(e,t){n.value.pageNo=e,n.value.pageSize=t,P()}const N=()=>{};Ot(()=>Promise.resolve({ok:!0,params:{selected:l.value}}));const U=async()=>{var e,a,l;y.value.name=y.value.name.trim();const i=_api.apaas.printDesigner.getRdoPageList;u.value=!0;const n=await i({...y.value,...s.value,...t.queryParams||{},moduleType:t.moduleType,modelKey:t.modelKey})||{};u.value=!1,w.value=h.value&&(null===(e=n.data)||void 0===e?void 0:e.map(e=>{let a;var l;return t.isRdo?a={...e,children:null===(l=e.children)||void 0===l?void 0:l.map(t=>({...t,id:t.baseId+":"+t.id,categoryId:e.categoryId}))}:(delete e.children,a={...e,id:e.baseId+":"+e.id,categoryId:y.value.categoryId}),a}))||[],d.value=n.totalCount,await Yt();const r=F(w.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});console.log(o.value,"tableRef.value"),r&&(null===(a=o.value)||void 0===a||a.setRadioRow(r)),t.isRdo&&(null===(l=o.value)||void 0===l||l.setAllTreeExpand(!0))},P=async()=>{f.value.name=f.value.name.trim(),p.value=!0,_api.apaas.label.getBtwPageList({...f.value,...n.value}).then(async e=>{var a,l;null==e||null===(a=e.data)||void 0===a||a.forEach(e=>{if(null==e?void 0:e.fullPath){var t;const a=null===(t=e.fullPath)||void 0===t?void 0:t.split("/");a.pop(),a.shift(),e.tmplPath=a}}),T.value=e.data||[],c.value=e.totalCount,await Yt();const o=F(T.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});o&&(null===(l=i.value)||void 0===l||l.setRadioRow(o))}).finally(()=>{p.value=!1})},V=e=>{const t=e.target.value;(!t||t.length<g.value.length)&&P(),g.value=t},F=e=>function e(t,a){let l=[];for(const i of t){var o;i.level=a,l.push(i),(null===(o=i.children)||void 0===o?void 0:o.length)&&(l=[...l,...e(i.children,a+1)])}return l}(JSON.parse(JSON.stringify(e)),1);return ya(()=>y.value.categoryId,e=>{e?U():(w.value=[],d.value=0)},{immediate:!0}),ya(()=>r.value,()=>{"btw"===r.value?(T.value=[],n.value.pageNo=1,P()):(w.value=[],s.value.pageNo=1,U())}),ya(()=>l.value,()=>{var e;!(null==t?void 0:t.multiple)&&(null===(e=t.modal)||void 0===e?void 0:e.state)&&(t.modal.state.okDisabled=!l.value.length)},{immediate:!0}),(t,l)=>{const s=ra("a-tab-pane"),n=ra("a-tabs"),d=ra("a-input"),c=ra("a-form-item"),g=ra("a-form"),C=ra("a-tooltip"),R=ra("a-pagination");return ta(),Ut("div",{class:Xt(["gct-print-tmpl-modal ks-column",v.value?"px-2 pt-4":"p-4"])},[v.value?(ta(),Ut("div",sr,[jt(n,{"active-key":r.value,"onUpdate:activeKey":l[0]||(l[0]=e=>r.value=e)},{default:ga(()=>[jt(s,{key:"design",tab:k.value},null,8,["tab"]),jt(s,{key:"btw",tab:".btw 标签模板 "})]),_:1},8,["active-key"])])):(ta(),Ut("div",nr,ua(k.value),1)),!v.value||v.value&&"design"===r.value?(ta(),Ut("div",rr,[Pt("div",{class:Xt(["gct-print-tmpl-modal-left",v.value?"btw-visible":""])},[jt(ma(yn),{value:h.value,"onUpdate:value":l[1]||(l[1]=e=>h.value=e),class:Xt([ma(a).e("sider")]),"sider-title":"",module:m.value,"need-folder-icon":!x.value,readonly:"","has-title":!1,draggable:!1,"is-tree":x.value,"ignore-case":e.ignoreCase,onChangeValue:D,onChangeCategory:N},null,8,["value","class","module","need-folder-icon","is-tree","ignore-case"])],2),Pt("div",{class:Xt(["gct-print-tmpl-modal-right flex flex-col h-full px-16px py-12px",v.value?"btw-visible":""])},[jt(g,{model:y.value},{default:ga(()=>[jt(c,{label:""},{default:ga(()=>[jt(d,{value:y.value.name,"onUpdate:value":l[2]||(l[2]=e=>y.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:ma(Rt)("sys.searchNameOfSth",{sth:O.value}),clearable:"",onKeyup:l[3]||(l[3]=_a(e=>U(),["enter"])),onChange:l[4]||(l[4]=()=>{!y.value.name&&U()})},{prefix:ga(()=>[...l[7]||(l[7]=[Pt("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Pt("div",dr,[Pt("div",ur,[jt(ma(fl),{ref_key:"tableRef",ref:o,class:Xt(["select-none",{vxetable:!0,default:!0}]),data:w.value,height:"100%","min-height":"88",loading:u.value,"loading-config":{text:" "},"column-config":{resizable:!0},"tree-config":{},"row-config":{isHover:!0,keyField:"id"},"checkbox-config":e.multiple?{highlight:!0,trigger:"row",reserve:!0,checkStrictly:!0}:{},"radio-config":e.multiple?{}:{highlight:!0,trigger:"row",reserve:!0},onCheckboxChange:L,onRadioChange:I},{default:ga(()=>[e.multiple?(ta(),At(ma(yl),{key:0,type:"checkbox",width:"40"})):(ta(),At(ma(yl),{key:1,type:"radio",width:"40",resizable:!1})),jt(ma(yl),{field:"name",title:ma(Rt)("sys.name"),"show-overflow":"","tree-node":e.isRdo},{default:ga(t=>{var a;return[Pt("div",cr,[jt(C,null,{title:ga(()=>[Ft(ua(S((null==t?void 0:t.row)||{})),1)]),default:ga(()=>[Pt("div",pr,ua(S((null==t?void 0:t.row)||{})),1)]),_:2},1024),(null==t||null===(a=t.row)||void 0===a?void 0:a.default)&&e.isRdo?(ta(),Ut("div",vr,ua(ma(Rt)("sys.default")),1)):Nt("",!0)])]}),_:1},8,["title","tree-node"]),jt(ma(yl),{field:"description",title:ma(Rt)("sys.description"),"show-overflow":""},{default:ga(e=>{var t,a;return[Pt("div",mr,[Pt("span",{class:"gct-text-overflow",title:null==e||null===(t=e.row)||void 0===t?void 0:t.description},ua(null==e||null===(a=e.row)||void 0===a?void 0:a.description),9,hr)])]}),_:1},8,["title"]),jt(ma(yl),{field:"modifyUserName",title:ma(Rt)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),jt(ma(yl),{field:"modifyTime",title:ma(Rt)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Pt("div",yr,[jt(R,qt(_.value,{class:"pagination-total-left",onChange:M}),null,16)])])],2)])):Nt("",!0),v.value&&"btw"===r.value?(ta(),Ut("div",fr,[jt(g,{model:f.value},{default:ga(()=>[jt(c,{label:""},{default:ga(()=>[jt(d,{value:f.value.name,"onUpdate:value":l[5]||(l[5]=e=>f.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:ma(Rt)("sys.searchNameOfSth",{sth:"标签"}),clearable:"",onKeyup:l[6]||(l[6]=_a(e=>P(),["enter"])),onChange:V},{prefix:ga(()=>[...l[8]||(l[8]=[Pt("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Pt("div",gr,[Pt("div",br,[jt(ma(fl),{ref_key:"btwTableRef",ref:i,class:Xt(["select-none",{vxetable:!0,default:!0}]),data:T.value,height:"100%","min-height":"88",loading:p.value,"loading-config":{text:" "},"column-config":{resizable:!0},"tree-config":{},"row-config":{isHover:!0,keyField:"id"},"checkbox-config":e.multiple?{highlight:!0,trigger:"row",reserve:!0,checkStrictly:!0}:{},"radio-config":e.multiple?{}:{highlight:!0,trigger:"row",reserve:!0},onCheckboxChange:L,onRadioChange:I},{default:ga(()=>[e.multiple?(ta(),At(ma(yl),{key:0,type:"checkbox",width:"40"})):(ta(),At(ma(yl),{key:1,type:"radio",width:"40",resizable:!1})),jt(ma(yl),{field:"name",title:"标签模板名称","min-width":"120","show-overflow":""}),jt(ma(yl),{field:"modelName",title:"关联模型",width:"120","show-overflow":""}),jt(ma(yl),{field:"tmplPath",title:"BarTender "+ma(Rt)("sys.labelTmplPath"),"min-width":"220","show-overflow":""},{default:ga(e=>{var t,a;return[Pt("span",_r,[Pt("img",{width:"16",height:"16",src:ma("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon_printer'%3e%3cg%20id='Group%20427319057'%3e%3cpath%20id='Rectangle%204856'%20d='M4.32373%203.3C4.32373%203.13431%204.45805%203%204.62373%203L15.3709%203C15.5366%203%2015.6709%203.13431%2015.6709%203.3V7L4.32373%207V3.3Z'%20fill='%2388898D'/%3e%3crect%20id='Rectangle%204857'%20x='5.5'%20y='1.5'%20width='9'%20height='5'%20fill='%23DDDFE1'/%3e%3cg%20id='Mask%20group'%3e%3cmask%20id='mask0_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='1'%20y='6'%20width='18'%20height='11'%3e%3cpath%20id='Union'%20d='M19%2015.5C19%2016.0523%2018.5523%2016.5%2018%2016.5H2C1.44772%2016.5%201%2016.0523%201%2015.5V10.3117C1%209.77409%201.08671%209.23999%201.25678%208.72997L1.77246%207.18359C1.90865%206.77542%202.29039%206.50002%202.7207%206.5H17.2793C17.7096%206.50002%2018.0914%206.77542%2018.2275%207.18359L18.7432%208.72997C18.9133%209.23999%2019%209.77409%2019%2010.3117V15.5Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2169_716)'%3e%3cpath%20id='Union_2'%20d='M19%2015.5C19%2016.0523%2018.5523%2016.5%2018%2016.5H2C1.44772%2016.5%201%2016.0523%201%2015.5V10.3117C1%209.77409%201.08671%209.23999%201.25678%208.72997L1.77246%207.18359C1.90865%206.77542%202.29039%206.50002%202.7207%206.5H17.2793C17.7096%206.50002%2018.0914%206.77542%2018.2275%207.18359L18.7432%208.72997C18.9133%209.23999%2019%209.77409%2019%2010.3117V15.5Z'%20fill='url(%23paint0_linear_2169_716)'/%3e%3cpath%20id='Union_3'%20d='M16.1686%2016.517C16.1686%2017.0693%2015.8702%2017.517%2015.502%2017.517L4.49089%2017.5C4.1227%2017.5%203.82422%2017.0523%203.82422%2016.5V10.0491C3.82422%209.68413%203.86418%209.32026%203.94338%208.964L4.33919%207.18359C4.42999%206.77542%204.68448%206.50002%204.97135%206.5L15.0215%206.51697C15.3084%206.51699%2015.5629%206.79239%2015.6537%207.20056L16.0495%208.98097C16.1287%209.33723%2016.1686%209.70109%2016.1686%2010.0661V16.517Z'%20fill='url(%23paint1_linear_2169_716)'/%3e%3cg%20id='Mask%20group_2'%3e%3cmask%20id='mask1_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='3'%20y='6'%20width='14'%20height='6'%3e%3cpath%20id='Rectangle%204861'%20d='M3.82422%206L16.1686%206.01697V11.017L3.82422%2011V6Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask1_2169_716)'%3e%3cpath%20id='Union_4'%20d='M16.1686%2015.517C16.1686%2016.0692%2015.8702%2016.517%2015.502%2016.517L4.49089%2016.5C4.1227%2016.5%203.82422%2016.0523%203.82422%2015.5V9.91205C3.82422%209.6378%203.84678%209.36403%203.89168%209.09348L4.37308%206.19266C4.46387%205.78449%204.71836%205.50909%205.00524%205.50906L14.9876%205.52603C15.2745%205.52605%2015.529%205.80145%2015.6198%206.20962L16.1012%209.11045C16.1461%209.38099%2016.1686%209.65477%2016.1686%209.92901V15.517Z'%20fill='url(%23paint2_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3cpath%20id='Rectangle%204859'%20d='M1%209.5H3.5V16.5H1.5C1.22386%2016.5%201%2016.2761%201%2016V9.5Z'%20fill='url(%23paint3_linear_2169_716)'/%3e%3cpath%20id='Union_5'%20d='M4%206.5L3.55442%209.17345C3.5182%209.39078%203.5%209.61073%203.5%209.83105V10.5H1V6.5H4Z'%20fill='url(%23paint4_linear_2169_716)'/%3e%3cpath%20id='Rectangle%204860'%20d='M16.5%209.5H19V16.5H16.5V9.5Z'%20fill='url(%23paint5_linear_2169_716)'/%3e%3cpath%20id='Rectangle%204859_2'%20opacity='0.3'%20d='M5.34473%207.39502L14.6389%207.35339L14.5%206.50001H5.50001L5.34473%207.39502Z'%20fill='url(%23paint6_linear_2169_716)'/%3e%3cpath%20id='Union_6'%20d='M16%206.5L16.4456%209.17345C16.4818%209.39078%2016.5%209.61073%2016.5%209.83105V10.5H19V6.5H16Z'%20fill='url(%23paint7_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3cpath%20id='Rectangle%204858'%20d='M14.4224%2013.8896C15.3187%2013.8911%2016.0443%2014.6183%2016.0444%2015.5146V16.6426L15.9194%2016.6416L4.06689%2016.625H3.94189V15.502C3.942%2014.6038%204.67071%2013.8759%205.56885%2013.877L14.4224%2013.8896Z'%20fill='%2336363A'%20stroke='url(%23paint8_linear_2169_716)'%20stroke-width='0.25'/%3e%3cpath%20id='Rectangle%204855'%20d='M4.06689%2015.5014C4.06689%2014.9486%204.51548%2014.5006%205.06833%2014.5014L14.9211%2014.5155C15.4729%2014.5163%2015.9197%2014.9638%2015.9197%2015.5155V18.0163C15.9197%2018.2927%2015.6954%2018.5166%2015.419%2018.5163L4.56618%2018.5007C4.29032%2018.5003%204.06689%2018.2766%204.06689%2018.0007V15.5014Z'%20fill='url(%23paint9_linear_2169_716)'/%3e%3c/g%3e%3cg%20id='Mask%20group_3'%3e%3cmask%20id='mask2_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='5'%20y='7'%20width='3'%20height='2'%3e%3cpath%20id='Rectangle%204862'%20d='M5.62474%207.67027C5.63945%207.57239%205.72354%207.5%205.82251%207.5L7.3%207.5C7.41046%207.5%207.5%207.58954%207.5%207.7V8.3C7.5%208.41046%207.41046%208.5%207.3%208.5H5.73231C5.61001%208.5%205.51635%208.39121%205.53454%208.27027L5.62474%207.67027Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask2_2169_716)'%3e%3cpath%20id='Rectangle%204864'%20d='M5.62474%207.67027C5.63945%207.57239%205.72354%207.5%205.82251%207.5L7.3%207.5C7.41046%207.5%207.5%207.58954%207.5%207.7V8.3C7.5%208.41046%207.41046%208.5%207.3%208.5H5.73231C5.61001%208.5%205.51635%208.39121%205.53454%208.27027L5.62474%207.67027Z'%20fill='%23D9D9D9'/%3e%3cpath%20id='Rectangle%204863'%20d='M6.53881%207.5H7.5V8.5H6.48926L6.53881%207.5Z'%20fill='url(%23paint10_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2169_716'%20x1='10'%20y1='6.5'%20x2='10'%20y2='8.14483'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2382828A'/%3e%3cstop%20offset='1'%20stop-color='%233F3F42'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2169_716'%20x1='10'%20y1='9.5'%20x2='10'%20y2='13'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E1E5EA'/%3e%3cstop%20offset='1'%20stop-color='%23999EA1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2169_716'%20x1='10'%20y1='9.49998'%20x2='10'%20y2='11'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236B727A'/%3e%3cstop%20offset='1'%20stop-color='%237C7D7E'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2169_716'%20x1='2.25'%20y1='9.5'%20x2='2.25'%20y2='16.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23D4DCE2'/%3e%3cstop%20offset='1'%20stop-color='%23959696'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2169_716'%20x1='2.5'%20y1='9.5'%20x2='2.5'%20y2='10.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239DA6B2'/%3e%3cstop%20offset='1'%20stop-color='%23C9D1D9'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_2169_716'%20x1='17.75'%20y1='9.5'%20x2='17.75'%20y2='16.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23D4DCE2'/%3e%3cstop%20offset='1'%20stop-color='%23959696'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_2169_716'%20x1='10'%20y1='7.35339'%20x2='10'%20y2='6.20902'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23CDD2D5'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23CDD2D5'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_2169_716'%20x1='17.5'%20y1='9.5'%20x2='17.5'%20y2='10.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239DA6B2'/%3e%3cstop%20offset='1'%20stop-color='%23C9D1D9'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_2169_716'%20x1='9.9933'%20y1='14'%20x2='9.9933'%20y2='16.517'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'%20stop-opacity='0.6'/%3e%3cstop%20offset='1'%20stop-color='white'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_2169_716'%20x1='9.99999'%20y1='14.5'%20x2='9.99999'%20y2='15.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23383839'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%2361656C'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_2169_716'%20x1='6.99463'%20y1='7.5'%20x2='6.99463'%20y2='8.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23B9C0C4'/%3e%3cstop%20offset='1'%20stop-color='%2392999D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")},null,8,Er),Pt("span",null,ua(null==e||null===(t=e.row)||void 0===t?void 0:t.printName),1),(ta(!0),Ut(Lt,null,sa((null==e||null===(a=e.row)||void 0===a?void 0:a.tmplPath)||[],(t,a)=>{var o,i;return ta(),Ut(Lt,{key:a},[l[9]||(l[9]=Ft(" /",-1)),Pt("img",{width:"16",height:"16",class:"ml-3px mr-2px",src:ma("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon_folder'%3e%3cg%20id='Group%20427318809'%3e%3cpath%20id='Subtract'%20d='M5.97207%202.19995C6.30242%202.19995%206.61145%202.3631%206.79779%202.63588L7.5%203.66382H16C16.5523%203.66382%2017%204.11153%2017%204.66382V16.95C17%2017.3642%2016.6642%2017.7%2016.25%2017.7H2C1.44772%2017.7%201%2017.2522%201%2016.7V3.19995C1%202.64767%201.44772%202.19995%202%202.19995H5.97207Z'%20fill='url(%23paint0_linear_2167_599)'/%3e%3cg%20id='Vector'%3e%3cpath%20d='M3%2017.7H2.25C2.66421%2017.7%203%2017.3642%203%2016.95V17.7Z'%20fill='%23FDB418'/%3e%3cpath%20d='M3%206.44995C3%205.89767%203.44771%205.44995%204%205.44995H18.25C18.6642%205.44995%2019%205.78574%2019%206.19995L19%2016.95C19%2017.3642%2018.6642%2017.7%2018.25%2017.7H3L3%206.44995Z'%20fill='url(%23paint1_linear_2167_599)'/%3e%3cpath%20d='M4%205.85034H18.25C18.4433%205.85034%2018.5996%206.00665%2018.5996%206.19995V16.95C18.5996%2017.1432%2018.4433%2017.2996%2018.25%2017.2996H3.40039V6.44995C3.40039%206.11858%203.66863%205.85034%204%205.85034Z'%20stroke='url(%23paint2_linear_2167_599)'%20stroke-opacity='0.85'%20stroke-width='0.8'/%3e%3c/g%3e%3cg%20id='Vector_2'%3e%3cpath%20d='M3%2017.7H2.25C2.66421%2017.7%203%2017.3642%203%2016.95V17.7Z'%20fill='url(%23paint3_linear_2167_599)'/%3e%3cpath%20d='M3%206.44995C3%205.89767%203.44771%205.44995%204%205.44995H18.25C18.6642%205.44995%2019%205.78574%2019%206.19995L19%2016.95C19%2017.3642%2018.6642%2017.7%2018.25%2017.7H3L3%206.44995Z'%20fill='url(%23paint4_linear_2167_599)'/%3e%3c/g%3e%3cpath%20id='Rectangle%204807'%20opacity='0.9'%20d='M14.25%208.99994H16.75V9.59994H14.25V8.99994Z'%20fill='%23EE9B01'/%3e%3cpath%20id='Rectangle%204808'%20opacity='0.9'%20d='M14.25%207.80008H16.75V8.40008H14.25V7.80008Z'%20fill='%23EE9B01'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2167_599'%20x1='5.5'%20y1='3.69995'%20x2='9'%20y2='12.2'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23EE9B00'/%3e%3cstop%20offset='1'%20stop-color='%23EEA300'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2167_599'%20x1='6.5'%20y1='7.69995'%20x2='14'%20y2='17.2'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFBF35'/%3e%3cstop%20offset='1'%20stop-color='%23FFD560'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2167_599'%20x1='2.5'%20y1='6.19995'%20x2='6'%20y2='11.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='white'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2167_599'%20x1='14'%20y1='15.7'%20x2='14'%20y2='16.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFCF54'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23F9B700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2167_599'%20x1='14'%20y1='15.7'%20x2='14'%20y2='16.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFCF54'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23F9B700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")},null,8,wr),Pt("span",null,ua(null==t?void 0:t.replace(b,"/")),1),0===a?(ta(),Ut("span",{key:0,class:Xt(["btw-label-tag","common"===(null==e||null===(o=e.row)||void 0===o?void 0:o.pathType)?"common":"local"])},ua("common"===(null==e||null===(i=e.row)||void 0===i?void 0:i.pathType)?ma(Rt)("sys.shared"):ma(Rt)("sys.local")),3)):Nt("",!0)],64)}),128))])]}),_:1},8,["title"]),jt(ma(yl),{field:"macAddress",title:ma(Rt)("sys.macAddress"),width:"175","show-overflow":""},null,8,["title"]),jt(ma(yl),{field:"createUserName",title:ma(Rt)("sys.creator"),width:"120","show-overflow":""},null,8,["title"]),jt(ma(yl),{field:"createTime",title:ma(Rt)("sys.createTime"),width:"185"},null,8,["title"]),jt(ma(yl),{field:"modifyUserName",title:ma(Rt)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),jt(ma(yl),{field:"modifyTime",title:ma(Rt)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Pt("div",Tr,[jt(R,qt(E.value,{class:"pagination-total-left",onChange:A}),null,16)])])])):Nt("",!0)],2)}}}),Rr=/* @__PURE__ */$e(Cr,[["__scopeId","data-v-d94551a9"]]),Sr=class{constructor(){t(this,"type",et.DEFAULT),t(this,"ns",kt("diagram-config-default-link")),t(this,"sourceHandle","handle-select"),t(this,"deleteMessage","sys.pageDesigner.dataLinkage.confirm.title")}reverse(e,t){let a=null;if(a=t.reverse?e.node.get(t.target,0,!0):e.node.get(t.source,0,!0),a){if(!0!==t.reverse?e.node.cache.reverseClear(a,Qe.FORWARD):e.node.cache.reverseClear(a,Qe.REVERSE),e.node.update(Object.assign(a,{value:null,label:null,noSelectField:!0!==t.reverse})),t.reverse){if(e.node.cache.reverseReset(a,Qe.FORWARD))return}else if(e.node.cache.reverseReset(a,Qe.REVERSE))return;t.reverse||e.node.create({type:at.REVERSE,reverse:!0},{type:et.VIRTUAL,reverse:!0,dashed:!0})}}options(e,t){let a=t.reverse?["Left",[1,.5,0,0,0,14]]:["Right",[0,.5,0,0,0,14]];t.return?a=t.startLine%2==1?["Right","Right"]:["Left","Left"]:t.startLine%2==0&&(a=t.reverse?["Right",[0,.5,0,0,0,14]]:["Left",[1,.5,0,0,0,14]]);let l="right";return l=t.startLine%2==1?t.return||t.reverse?"left":"right":t.return||t.reverse?"right":"left",{hoverClass:this.ns.e("line-hover"),paintStyle:{strokeWidth:1,stroke:"#3168EC",dashstyle:"0"},endpointStyle:{fill:"#3168EC"},anchors:a,connector:{type:bl.type,options:{stub:[0,25],cornerRadius:10}},endpoints:[{type:gl.type,options:{radius:3}},{type:Ze.type,options:{direction:l}}],overlays:[{type:"Custom",options:{id:"change",location:.5,create:()=>{const e=document.createElement("div");return e.classList.add(this.ns.b("custom-overlay-line")),!0===t.return?e.classList.add(this.ns.be("custom-overlay-line","special-line")):e.classList.add(this.ns.be("custom-overlay-line","not-special-line")),e}}},{type:"Custom",options:{id:"delete",location:.5,create:()=>{const a=document.createElement("div");if(a.classList.add(this.ns.b("custom-overlay")),!0===t.return?a.classList.add(this.ns.be("custom-overlay","special-line")):a.classList.add(this.ns.be("custom-overlay","not-special-line")),t.type!==et.VIRTUAL||!0===t.reverse){const l=document.createElement("i");l.className="iconfont icon-caiqie1 delete-action",l.onclick=a=>{a.stopPropagation(),Ha.confirm({title:Rt(this.deleteMessage),content:Rt("sys.pageDesigner.dataLinkage.confirm.content"),onOk:()=>{if(!0!==t.reverse){const a=e.node.get(t.source,0,!0);a&&(e.node.cache.clear(a),e.node.update(Object.assign(a,{value:null,label:null})))}else{const a=e.node.get(t.target,0,!0);a&&(e.node.cache.reverseClear(a),e.node.update(Object.assign(a,{value:null,label:null,noSelectField:!1})))}}})},a.appendChild(l)}if(!0===e.config.oneDirection&&0===t.i||!1===e.config.oneDirection&&(null==e.config.reverseCount||t.i>=e.config.reverseCount)){const l=document.createElement("i");l.className="iconfont icon-qiehuan1 reverse-action",l.onclick=a=>{a.stopPropagation(),this.reverse(e,t)},a.appendChild(l)}return a}}}]}}click(e,t){(!0===e.config.oneDirection&&0===t.i||!1===e.config.oneDirection&&(null==e.config.reverseCount||t.i>=e.config.reverseCount))&&this.reverse(e,t)}},xr=class{constructor(){t(this,"type",at.DEFAULT),t(this,"component","DiagramConfigItem")}},Or=class{constructor(){t(this,"type",at.REVERSE),t(this,"component","DiagramConfigItemReverse")}},kr=class extends Sr{options(e,t){const a=super.options(e,t);return a.paintStyle={strokeWidth:1,stroke:"#C3C3C3",dashstyle:"4 4"},a.endpointStyle={fill:"#C3C3C3"},a}},Dr=class{constructor(){t(this,"type",at.VIRTUAL),t(this,"component","DiagramConfigItemVirtual")}},Ir={install(e){tt.registerLink(et.DEFAULT,new Sr),tt.registerLink(et.VIRTUAL,new kr),tt.registerNode(at.DEFAULT,new xr),tt.registerNode(at.VIRTUAL,new Dr),tt.registerNode(at.REVERSE,new Or),e.component(Je.name,Bt(()=>import("./relationship-diagram-config-GxEGtkql.js").then(e=>e.n))),e.component(lt.name,Bt(()=>import("./diagram-config-item-C0dNHnv8.js").then(e=>e.n))),e.component(i.name,Bt(()=>import("./diagram-config-item-virtual-CqPkYosK.js").then(e=>e.n))),e.component(ot.name,Bt(()=>import("./diagram-config-item-reverse-CPqmFsFd.js").then(e=>e.n)))}},Lr={class:"header-action"},Mr={class:"title"},Ar={class:"switch-area"},Nr={class:"check-title"},Ur=/* @__PURE__ */Kt({__name:"header-action",props:{checked:{type:Boolean},title:{}},emits:["update:checked"],setup(e,{emit:t}){const a=e,l=t,o=Mt({get:()=>a.checked,set(e){l("update:checked",e)}});return(t,a)=>{const l=ra("a-switch");return ta(),Ut("div",Lr,[Pt("span",Mr,ua(e.title),1),Pt("div",Ar,[Pt("span",Nr,ua(o.value?ma(Rt)("sys.appDesigner.fieldEnable"):ma(Rt)("sys.appDesigner.fieldUnEnable")),1),jt(l,{checked:o.value,"onUpdate:checked":a[0]||(a[0]=e=>o.value=e)},null,8,["checked"])])])}}}),Pr=/* @__PURE__ */$e(Ur,[["__scopeId","data-v-4e281013"]]),Vr=/* @__PURE__ */function(e){return e.USER_GROUP="USER_GROUP",e.MEMBER="MEMBER",e.ROLE="ROLE",e.MODEL="MODEL",e}({}),Fr=/* @__PURE__ */function(e){return e.Create="create",e.Edit="edit",e.Delete="delete",e}({}),jr=/* @__PURE__ */function(e){return e.ORG="ORG",e.USER="USER",e.ROLE="ROLE",e.ENTITY_MODEL_DATA="ENTITY_MODEL_DATA",e.BUILT_CONDITION_MODEL="BUILT_CONDITION_MODEL",e.PERMISSION_SCOPE="PERMISSION_SCOPE",e}({}),Br=[{label:Rt("sys.appDesigner.physicalBusinessModel"),value:jr.ENTITY_MODEL_DATA},{label:Rt("sys.appDesigner.builtinConditionalModel"),value:jr.BUILT_CONDITION_MODEL},{label:Rt("sys.appDesigner.permissionScope"),value:jr.PERMISSION_SCOPE}],Kr=/* @__PURE__ */function(e){return e.TAB_DATA_RULES="tab_data_rules",e.TAB_FIELD_ROLE="tab_field_role",e.TAB_BUILT_PREM="tab_built_prem",e.TAB_PERM_SCOPE="tab_perm_scope",e}({}),Gr=/* @__PURE__ */function(e){return e.AND="AND",e.OR="OR",e}({}),$r={[Gr.AND]:Rt("sys.webRender.and"),[Gr.OR]:Rt("sys.webRender.or")},zr={[Gr.AND]:Rt("sys.webRender.allCondition"),[Gr.OR]:Rt("sys.webRender.anyCondition")},Hr=e=>{if(!e||Array.isArray(e)&&0===e.length)return 0;const t=new Array(e.length).fill(0);return e.forEach((e,a)=>{t[a]+=1,Array.isArray(e.children)&&(t[a]+=e.children.length?Hr(e.children):1)}),Math.max(...t)},qr=(e,t)=>{for(let a=0;a<t.length;a++){if(e===t[a].id)return t[a];if(t[a].children){const l=qr(e,t[a].children);if(l)return l}}return null},Yr=(e,t)=>{const{dragNode:a,node:l}=e,o=a.dataRef,i=l.dataRef,s=e.node.pos.split("-"),n=Number(s[s.length-1]),r=e.dropPosition-n,d=i.fullPath.split("/").length-1,u=qr(o.id,t),c=Hr(null==u?void 0:u.children),p={id:o.id};if(0===r){if(console.log("拖拽到目录里"),d+c>4)return{type:"error",msg:Rt("sys.webRender.dragError")};Object.assign(p,{targetParentId:i.id,targetSortNum:0})}else if(0!==r){if(console.log("拖拽到目录平级"),d+c>5)return{type:"error",msg:Rt("sys.webRender.dragError")};Object.assign(p,{targetParentId:i.parentId,targetSortNum:i.sortNum+1})}return p},Xr=oa([]),Wr=oa([]);function Zr(e){const{getUuidGenerate:t}=Dt(oa([]),oa(""),{needPrefix:!0,isString:!1,prefix:"t_"}),a=t([]),l=e=>e.map(e=>{const t=la(Object.assign({},{key:e.key,pid:e.pid,level:e.level,class:e.class},"group"===e.type?{operatorType:e.operatorType,type:e.type,children:la([])}:{firstRow:e.firstRow,leftValue:e.leftValue,operatorValue:e.operatorValue,rightValue:e.rightValue}));var a;return Array.isArray(e.children)&&(null===(a=t.children)||void 0===a||a.push(...l(e.children))),t}),o=(e,t)=>e.forEach((a,l)=>{if(Array.isArray(a.children))a.type="group",a.class="tree-group",ka(a.operatorType)&&(a.operatorType=Gr.AND),o(a.children,a.children.length);else{const o=e.filter(e=>!e.children);0===l||l===o.length-1?(a.class=`${0===l?"first-node":""} ${l===o.length-1?"last-node":""}`,a.firstRow=0===l):a.class="",a.dataLen=t}}),i=({pid:e,insertId:t,data:a,isGroup:l=!1,prevId:o=""})=>{if("init"===e){const e={key:"root",pid:"",level:1,class:void 0,operatorType:void 0,type:void 0,children:la([])};return void a.push(e)}return a.forEach(a=>{if(a.key===e){const e=la(Object.assign({},{key:t,pid:a.key,level:Number(a.level)+1,class:""},l?{operatorType:void 0,type:void 0,children:la([])}:{firstRow:void 0,leftValue:void 0,operatorValue:void 0,rightValue:void 0}));if(o){const t=a.children.findIndex(e=>e.key===o);a.children.splice(t+1,0,e)}else a.children.push(e);return void a.children.forEach(e=>{var t;e.dataLen=null===(t=a.children)||void 0===t?void 0:t.length})}a.children&&i({pid:e,insertId:t,data:a.children,isGroup:l,prevId:o})})},s=(e,t)=>t.forEach((a,l)=>{a.key!==e?a.children&&s(e,a.children):t.splice(l,1)}),n=(e,t,l=!1)=>{const s=a.next();i({pid:l?"init":t,insertId:s,data:e,isGroup:!0}),i({pid:l?t:s,insertId:l?s:a.next(),data:e}),o(e)},r=(e,t)=>{for(let a=0;a<t.length;a++){if(e===t[a].key)return t[a];if(t[a].children){const l=r(e,t[a].children);if(l)return l}}return null},d=(e=[],t)=>[].concat(...e.map(e=>(e.pathStr=`${t}|${e.children?e.operatorType:"content"}`,[].concat({key:e.key,pid:e.pid,operatorType:e.children?e.operatorType:"content",pathStr:e.pathStr,leftValue:e.leftValue,operatorValue:e.operatorValue,rightValue:e.rightValue},d(e.children||[],e.pathStr))))),u=(e=[],t,a)=>[].concat(...e.map(e=>{let l="";return!e.children&&e.leftValue&&e.leftValue.key&&e.operatorValue&&e.key&&(l=`${e.leftValue.field_search_key||e.leftValue.key}.${e.operatorValue}:${e.key}`,"filterConfig"===a?l=`${e.leftValue.modelKey}#${e.leftValue.key}.${e.operatorValue}:${e.key}`:"businessFlow"===a&&(l=`${e.leftValue.nodeKey}.${e.leftValue.modelKey}.${e.operatorValue}:${e.key}`)),[].concat(e.children?[]:e.leftValue&&e.leftValue.key&&e.operatorValue&&e.key?{name:l,type:t.operatorType,operatorType:e.children?e.operatorType:"content"}:[],[u(e.children||[],e,a)])})),c=e=>{const t=[];return e.forEach(e=>{Array.isArray(e)&&0!==e.length?t.push(c(e)):Array.isArray(e)||"content"!==e.operatorType||t.push(e)}),t},p=e=>{const t=[];return e.forEach((a,l)=>{0===l&&t.push(`#before${a.type}#`),Array.isArray(a)&&0!==a.length?t.push(...p(a)):Array.isArray(a)||t.push(a.name),l===e.length-1&&t.push("#after#")}),t};return{setTree:t=>{t?(console.log("转换成页面想要的tree结构",JSON.parse(t)),e?Wr.value=l(JSON.parse(t)):Xr.value=l(JSON.parse(t))):n(e?Wr.value:Xr.value,"root",!0)},showDataRulesTree:Wr,editDataRulesTree:Xr,addNewGroup:e=>{n(Xr.value,e)},addNewRow:(e,t)=>{i({pid:e,insertId:a.next(),data:Xr.value,isGroup:!1,prevId:t}),o(Xr.value)},deleteGroup:e=>{s(e,Xr.value),o(Xr.value)},deleteRow:e=>{s(e,Xr.value),o(Xr.value)},updateNodeItem:(e,t,a,l)=>{const o=r(e,Xr.value);if(o)if("rightValue"===t?((null==l?void 0:l.isRest)&&(o.rightValue=la(l.defaultValues.map(e=>({[l.key]:e})))),"valueType"===(null==l?void 0:l.key)&&(o[t][l.index]={}),o[t][null==l?void 0:l.index][null==l?void 0:l.key]=a):o[t]="object"==typeof a?la(a):a,"leftValue"===t)o.operatorValue=void 0,o.rightValue=void 0;else if("operatorValue"===t){var i;o.rightValue=la(null==l||null===(i=l.defaultValues)||void 0===i?void 0:i.map(e=>({[l.key]:e})))}},getDataRules:(t,a)=>{const l=d(e?Wr.value:Xr.value,"");let o;const i={},s=[],n={};if(l.forEach(e=>{if("content"===e.operatorType){if(ka(e.leftValue)||ka(e.operatorValue)||ka(e.rightValue))return void(o=Rt("sys.webRender.saveTip"));let l="";if(l="businessFlow"===t?`${e.leftValue.nodeKey}.${e.leftValue.modelKey}.${e.operatorValue}:${e.key}`:"filterConfig"===t?`${e.leftValue.modelKey}#${e.leftValue.key}.${e.operatorValue}:${e.key}`:`${e.leftValue.field_search_key||e.leftValue.key}.${e.operatorValue}:${e.key}`,[ht.ISNOTNULL,ht.ISNULL].includes(e.operatorValue))Object.assign(i,{[l]:null});else{if(e.rightValue.some(e=>ka(e.result)))return void(o=Rt("sys.webRender.saveTip"));const t=[],r=e.rightValue.map(o=>{if(t.push(o.valueType),"SYS"===o.valueType&&s.push(l),[dt.USER_MULTI,dt.ORG_MULTI,dt.USER,dt.ORG].includes(e.leftValue.type)&&"FIXED"===o.valueType){var i,n;const t=(null==o||null===(i=o.result)||void 0===i||null===(i=i.orgs)||void 0===i?void 0:i.map(e=>`ORG:${e}`))??[],a=(null==o||null===(n=o.result)||void 0===n||null===(n=n.users)||void 0===n?void 0:n.map(e=>`USER:${e}`))??[];var r;return[dt.USER,dt.ORG].includes(e.leftValue.type)&&[ht.EQ,ht.NE].includes(e.operatorValue)?null===(r=[...t,...a])||void 0===r?void 0:r[0]:[...t,...a]}return"FIELD"===(null==o?void 0:o.valueType)?a?`__F__:${a}.${null==o?void 0:o.result}`:`__F__:${null==o?void 0:o.result.replace("$",".")}`:null==o?void 0:o.result});Object.assign(n,{[l]:1===t.length?ca(t[0]):ca(t)}),Object.assign(i,{[l]:1===r.length?ca(r[0]):ca(r)})}}}),o)return{error:o};const r=p(c(u((e?Wr.value:Xr.value)[0].children,(e?Wr.value:Xr.value)[0],t))),v=r.toString().replace(/#beforeAND#,/g,"AND(").replace(/#beforeOR#,/g,"OR(").replace(/,#after#/g,")");return console.warn("getDataRules query",i),console.warn("getDataRules varKeys",s),console.warn("getDataRules explist",r),console.warn("getDataRules expStr",v),{query:i,varKeys:s,exp:v,treeStr:JSON.stringify(e?Wr.value:Xr.value),typeMap:n}},resetTree:()=>{e?Wr.value=[]:Xr.value=[]},getAllExpandedKeys:()=>{const t=d(e?Wr.value:Xr.value,"");return{allExpandedKeys:t.map(e=>e.key),selectFiledKeys:t.map(e=>{var t;return null===(t=e.leftValue)||void 0===t?void 0:t.id}).filter(e=>e)}}}}var Jr={class:"tree-root-node"},Qr=/* @__PURE__ */Kt({__name:"tree-root-node",props:{data:{},level:{},id:{},operatorType:{},readonly:{type:Boolean}},setup(e){const t=zt("isDataFilterEditor"),a=[{label:Rt($r[Gr.AND]),value:Gr.AND},{label:Rt($r[Gr.OR]),value:Gr.OR}],l=e,{addNewGroup:o,deleteGroup:i,updateNodeItem:s,addNewRow:n}=Zr(l.readonly),r=Mt({get:()=>l.operatorType,set(e){s(l.id,"operatorType",e)}}),d=Mt(()=>1===l.level),u=()=>{o(l.id)},c=()=>{i(l.id)},p=Mt(()=>l.data.key),v=Mt(()=>{var e;return null===(e=l.data)||void 0===e||null===(e=e.children)||void 0===e?void 0:e.filter(e=>!e.children).length}),m=()=>{n(p.value)};return(l,o)=>{const i=ra("a-select"),s=ra("a-form-item-rest"),n=ra("a-button");return ta(),Ut(Lt,null,[Pt("div",Jr,[jt(s,null,{default:ga(()=>[jt(i,{value:r.value,"onUpdate:value":o[0]||(o[0]=e=>r.value=e),class:"tree-root-node-select",disabled:e.readonly,style:{width:"60px"},options:a,placeholder:ma(Rt)("sys.chooseText")},null,8,["value","disabled","placeholder"])]),_:1}),e.readonly?Nt("",!0):(ta(),At(n,{key:0,type:"primary",style:{"margin-left":"24px"},ghost:"",onClick:u},{icon:ga(()=>[jt(ma(vl))]),default:ga(()=>[Ft(" "+ua(ma(Rt)("sys.appDesigner.createGroup")),1)]),_:1})),e.readonly||d.value?Nt("",!0):(ta(),At(n,{key:1,type:"primary",ghost:"",danger:"",style:{"margin-left":"16px"},onClick:c},{icon:ga(()=>[...o[1]||(o[1]=[Pt("i",{class:"iconfont icon-shanchu1",style:{"margin-right":"4px"}},null,-1)])]),default:ga(()=>[Ft(" "+ua(ma(Rt)("sys.component.userCmp.deleteGroup")),1)]),_:1}))]),ma(t)&&!v.value?(ta(),Ut("div",{key:0,class:"tree-root-node-add-row mt4px",onClick:m}," +"+ua(ma(Rt)("sys.appDesigner.addCondition")),1)):Nt("",!0)],64)}}}),ed=/* @__PURE__ */$e(Qr,[["__scopeId","data-v-74e5fbf3"]]),td=/* @__PURE__ */Kt({__name:"select-userdep-cmp",props:{supportModalType:{},pickerCompParams:{},value:{}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,{openPickerByUser:o,openPicker:i,openPickerByDept:s,getUserByIds:n,getDeptOptions:r}=T({type:d.APP,fieldKey:a.pickerCompParams.fieldKey,modelKey:a.pickerCompParams.modelKey}),u=oa([]),c=Mt(()=>{var e,t;if(a.value)return[].concat((null===(e=a.value)||void 0===e?void 0:e.orgs)??[],(null===(t=a.value)||void 0===t?void 0:t.users)??[])});ya([()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.orgs},()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.users}],async([e,t])=>{let a=[],l=[];if(Array.isArray(t)&&0!==t.length){const e=await n({ids:ca(t).join(",")});a=null==e?void 0:e.map(e=>({label:Rt(e.__LABEL__),value:e.id}))}if(Array.isArray(e)&&0!==e.length){const e=await r();l=null==e?void 0:e.map(e=>({label:Rt(e.name),value:e.id}))}u.value=[...a,...l]},{deep:!0,immediate:!0});const p=(e,t)=>{var o,i;const s=((null===(o=a.value)||void 0===o?void 0:o.orgs)??[]).filter(t=>t!==e),n=((null===(i=a.value)||void 0===i?void 0:i.users)??[]).filter(t=>t!==e),r={};0===s.length&&0===n.length||(r.orgs=s,r.users=n),l("change",r,0)},v=()=>{var e,t;if("user&org"===a.supportModalType)i({userIds:(null===(e=a.value)||void 0===e?void 0:e.users)??[],deptIds:(null===(t=a.value)||void 0===t?void 0:t.orgs)??[],callback:async e=>{const{deptIds:t,userIds:a}=e,o={};0===t.length&&0===a.length||(o.orgs=t,o.users=a),l("change",o,0)}});else if("user"===a.supportModalType){var n;o({userIds:(null===(n=a.value)||void 0===n?void 0:n.users)??[],multiple:a.pickerCompParams.multiple,callback(e,t){const a={};0!==e.length&&(a.users=e),l("change",a,0)}})}else if("org"===a.supportModalType){var r;s({deptIds:(null===(r=a.value)||void 0===r?void 0:r.orgs)??[],multiple:a.pickerCompParams.multiple,callback:async e=>{const t={};0!==e.length&&(t.orgs=e),l("change",t,0)}})}};return(e,t)=>{const a=ra("a-select");return ta(),At(a,{open:!1,value:c.value,"max-tag-count":"responsive","max-tag-text-length":2,options:u.value,onClick:v,onDeselect:p},null,8,["value","options"])}}}),ad=td,ld=/* @__PURE__ */Kt({__name:"request-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},emits:["update:pageNo","update:value"],setup(e,{emit:t}){const a=t,l=e,o=oa([]),i=oa(""),s=oa("name_"),n=Mt(()=>l.value||[]);function r(e){return{label:e.__LABEL__??e.text??e.name_??e.name??"",value:e.id_??e.value??e.key??e.id??""}}const d=(e,t)=>!!t&&(t.label?t.label.toLowerCase().includes(e.toLowerCase()):null!=t.value&&String(t.value).toLowerCase().includes(e.toLowerCase())),u=Mt(()=>{var e;return null===(e=Object.keys(l.apiParams))||void 0===e?void 0:e.includes("pageNo")}),c=Mt(()=>({showSearch:!0,filterOption:!u.value&&d,maxTagTextLength:2,maxTagCount:"responsive"}));async function p(e){if("function"!=typeof l.api)return[];const t=await l.api({...e??{}});return(Array.isArray(t)?t:(null==t?void 0:t.data)??[]).map(r)}function v(e){if(!(null==e?void 0:e.trim()))return l.apiParams??{};const t=`${s.value}.ilike`;return{...l.apiParams,query:{[t]:e.trim()},exp:`OR(${t})`}}async function m(e){var t;const s=e.target;if(s.scrollTop+s.offsetHeight!==s.scrollHeight)return;const{pageNo:n=1,pageSize:r=10}=l.apiParams??{};if(Number(n)*Number(r)>(null===(t=o.value)||void 0===t?void 0:t.length))return;a("update:pageNo"),await Yt();const d=await p(v(i.value??"")??{}),u=new Set(o.value.map(e=>e.value)),c=d.filter(e=>!u.has(e.value));c.length&&(o.value=[...o.value,...c])}const h=Ca(async e=>{u.value&&(i.value=e.trim(),a("update:pageNo",1),o.value=await p(v(i.value)))},200),y=async e=>{a("update:value",e),e&&0!==e.length||!u.value||(a("update:pageNo",1),o.value=await p(l.apiParams??{}))},f=async()=>{u.value&&(n.value&&0!==n.value.length||!i.value||(a("update:pageNo",1),o.value=await p(l.apiParams??{})),i.value="")};return Zt(async()=>{!async function(){const{bindModelKey:e}=l.apiParams??{};e&&(s.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField||"name_")}(),o.value=await p(l.apiParams??{})}),(e,t)=>{const a=ra("a-select");return ta(),At(a,qt({value:n.value,options:o.value},c.value,{onPopupScroll:m,onSearch:ma(h),onChange:y,onFocus:f}),null,16,["value","options","onSearch"])}}}),od=ld,id=/* @__PURE__ */Kt({__name:"request-tree-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},setup(e){const t=e,a=oa([]);return Zt(async()=>{if("function"==typeof t.api){const l=await t.api({...t.apiParams??{}}),o=Array.isArray(l)?l:l.data??[];if((null==(e=t.apiParams)?void 0:e.fieldType)===dt.PRINTER){const e=function(e){return e.flatMap(e=>{var t,a;const l=null===(t=e.printChildNode)||void 0===t?void 0:t.find(e=>"是"===e.defaultPrint);return[{...e,label:e.name,value:e.printKey,parentId:e.parentId||"ROOT",dftPrintInfo:e.type===vt.CLIENT_PRINT&&l?{...l,value:l.printKey,label:l.name}:void 0},...(null===(a=e.printChildNode)||void 0===a?void 0:a.map(t=>({...t,label:t.name,value:t.printKey,parentId:e.printKey})))??[]]})}(o??[]);a.value=ft.list_to_tree(Ta(e.map(e=>({...e,id:e.printKey}))),e=>({...e,title:e.label??e.name??"",disabled:"ROOT"===e.parentId&&e.type===vt.INTERNET_PRINT}))}else{const e=o.map(e=>(void 0===e.__NON_LEAF__&&(e.__NON_LEAF__=o.some(t=>t.parent_id_===e.id_)),{label:e.__LABEL__,value:e.id_,full_path_:e.full_path_,_item:e,id:e.id_,pId:e.parent_id_,isLeaf:!e.__NON_LEAF__}));a.value=e.map(t=>{const a=t.full_path_.split("/").map(t=>{const a=e.find(e=>e.value===t);return a?a.label:null}).filter(e=>e).join("/");return{...t,label:a,title:a}})}}var e}),(e,t)=>{const l=ra("a-tree-select");return ta(),At(l,{class:"gct-request-tree-select","dropdown-class-name":"gct-request-tree-select-dropdown","tree-data":a.value,"tree-data-simple-mode":"","allow-clear":"","show-checked-strategy":ma(el).SHOW_ALL,"tree-node-label-prop":"label","filter-tree-node":!1,"max-tag-count":"responsive","max-tag-text-length":3},null,8,["tree-data","show-checked-strategy"])}}}),sd=id,nd=/* @__PURE__ */Kt({__name:"ndo-select-cmp",props:{value:{},apiParams:{},filterType:{}},setup(e){const t=e,a=oa([]),l=oa([]),o=oa([]),i=oa(""),s=oa(!1),n=oa(!1),r=oa(),d=oa({initial:{pageNo:1,totalPage:1,hasMore:!0},search:{pageNo:1,totalPage:1,hasMore:!0}}),u=Mt(()=>""!==i.value),c=Mt(()=>1===(u.value?d.value.search:d.value.initial).pageNo);ya(()=>t.value,async e=>{e&&0!==e.length&&0!==e.filter(e=>!Ia(e)).filter(e=>![...l.value,...o.value,...a.value].some(t=>t.value===e)).length&&await async function(e){try{const a=await _api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({bsKey:"listByIds",...t.apiParams??{},modelCategory:"entity"},{ids:e.join(",")});if(null==a?void 0:a.data){_.value&&!r.value&&await f();const e=((null==a?void 0:a.data)??[]).map(e=>({label:e.name_||e[r.value],value:e.id_,type:"data"}));_.value?(o.value=b(o.value,e),l.value=b(l.value,e)):(o.value=[...e,...o.value],l.value=[...e,...l.value])}}catch(a){console.error("获取回显数据失败:",a)}}(e)},{immediate:!0});const p=Mt(()=>u.value?a.value:l.value),v=Mt(()=>{if(h.value)return[];const e=p.value.filter(e=>"status"!==e.type).map(e=>({label:e.label,value:e.value})),t=[];return p.value.length>0&&(s.value||n.value?t.push({label:s.value?Rt("sys.loadingText"):Rt("sys.edhr.loadingMore"),value:"loading_status",disabled:!0,type:"status"}):m.value||_.value||t.push({label:Rt("sys.noMoreData"),value:"no_more_status",disabled:!0,type:"status"})),[...e,...t]}),m=Mt(()=>(u.value?d.value.search:d.value.initial).hasMore),h=Mt(()=>!s.value&&0===p.value.length),y=Mt(()=>({dropdownMatchSelectWidth:180,dropdownClassName:"gct-project-select-dropdown vxe-table--ignore-clear",allowClear:!0,showSearch:!0,defaultActiveFirstOption:!1,filterOption:!!_.value&&g,mode:"multiple",maxTagCount:"responsive",maxTagTextLength:2,notFoundContent:h.value&&!_.value?Rt("sys.edhr.noSearchResult"):void 0}));Zt(async()=>{await E(!0),_.value&&f()});const f=async()=>{const{modelKey:e}=t.apiParams??{};r.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField},g=(e,t)=>{if(!t)return!1;const a=e.toLowerCase();return t.label?String(t.label).toLowerCase().includes(a):null!=t.value&&String(t.value).toLowerCase().includes(a)},b=(e,t)=>{const a=/* @__PURE__ */new Map;return[...e,...t].forEach(e=>{a.has(e.value)||a.set(e.value,e)}),Array.from(a.values())},_=Mt(()=>"permissionScope"===t.filterType),E=async(e=!0)=>{if(s.value)return;s.value=!0;const a=d.value.initial;try{e&&(a.pageNo=1);const i=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listByPage"},{pageNo:a.pageNo,pageSize:20},{addDisplayLabel:_.value?1:void 0});if(null==i?void 0:i.data){const t=((null==i?void 0:i.data)??[]).map(e=>({label:e.name_||e.__LABEL__,value:e.id_,type:"data"}));a.totalPage=i.totalPage||1,a.hasMore=a.pageNo<a.totalPage,l.value=b(e?o.value:l.value,t)}}catch(i){console.error("加载数据失败:",i),a.hasMore=!1}finally{s.value=!1}},w=async(e,l=!0)=>{if(s.value)return;s.value=!0;const o=d.value.search;try{l&&(o.pageNo=1);const i=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listByPage"},{pageNo:o.pageNo,pageSize:20,query:{name_:_.value?void 0:e}},{addDisplayLabel:_.value?1:void 0});if(null==i?void 0:i.data){const e=((null==i?void 0:i.data)??[]).map(e=>({label:e.name_,value:e.id_,type:"data"}));o.totalPage=i.totalPage||1,o.hasMore=o.pageNo<o.totalPage,a.value=l?e:[...a.value,...e]}else a.value=[]}catch(i){console.error("加载搜索数据失败:",i),a.value=[],o.hasMore=!1}finally{s.value=!1}},T=Pa(e=>{if(s.value||n.value||!m.value)return;const t=e.target;t.scrollHeight-t.scrollTop-t.clientHeight<=30&&C()},200),C=async()=>{n.value=!0;try{(u.value?d.value.search:d.value.initial).pageNo+=1,u.value?await w(i.value,!1):await E(!1)}catch(e){console.error("加载更多数据失败:",e)}finally{n.value=!1}},R=Ca(e=>{i.value=e.trim(),i.value&&w(i.value,!0)},500),S=e=>{_.value||R(e)},x=()=>{i.value=""};return(t,a)=>{const l=ra("a-tooltip"),o=ra("a-select");return ta(),At(o,qt({value:e.value,options:v.value,loading:s.value&&c.value},y.value,{onSearch:S,onClear:x,onPopupScroll:ma(T)}),{maxTagPlaceholder:ga(e=>{return[jt(l,{title:(t=e,t.map(e=>e&&e.label?e.label:String(e)).join(", "))},{default:ga(()=>[Pt("span",null,"+"+ua(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},16,["value","options","loading","onPopupScroll"])}}}),rd=nd,dd=/* @__PURE__ */Kt({__name:"select-more",emits:["next"],setup(e,{emit:t}){const a=oa(null),l=t,o=Ce(a,([{isIntersecting:e}],t)=>{e&&l("next")});return ea(()=>{o.stop()}),(e,t)=>{const l=ra("a-spin");return ta(),Ut("div",{ref_key:"target",ref:a},[jt(l,{size:"small"})],512)}}});function ud({bindModelKey:e,modelCategory:t}){const a=oa([]);let l=(null==="name_"?void 0:"name_".split(","))||[];async function o({id_:a}={}){var l;const[o,i]=(null==a?void 0:a.split(":"))??["",""];console.log("_cId",i);const s=await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListVersionByRefIdsWithParent",modelKey:e,modelCategory:t},{foreignFields:[]},{refIds:a,includeDeleted:1})||{},n=null==s||null===(l=s.data)||void 0===l?void 0:l[0],r=n.__LABEL__||n.name_;let d=[];try{var u;d=null===(u=(await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListVersionById",modelKey:e,modelCategory:t},{foreignFields:[]},{id:o})||{}).data)||void 0===u?void 0:u.map(e=>{const t=e.__LABEL__||e.version_;return{value:`${o}:${e.id_}`,title:$t("div",[$t("span",{class:"version"},t),e.default_?$t("span",{class:"version gct-custom-tag ml8px"},Rt("sys.default")):null]),_info:{...e},full_path:$t("div",[$t("span",`${r}:${t}`)])}})}catch(c){console.error("getChildrens 获取子节点失败:",c)}return{value:o,title:r,full_path:$t("div",[$t("span",`${r}`),$t("span",{class:"gct-custom-tag ml8px"},Rt("sys.default"))]),children:d}}return async function(){if(e){var t;const a=await _api.apaas.modelMeta.getInfo({id:e})||{};l=(null===(t=a.displayField?`${a.displayField},name_`:"name_")||void 0===t?void 0:t.split(","))||[]}}(),{getChildrens:async(e=[])=>{try{if(!Array.isArray(e)||0===e.length)return;for(const s of e){var t,l;if(!s)continue;const[e,n]=s.split(":");if(console.log("_cId",n),null===(t=a.value)||void 0===t?void 0:t.some(t=>t.value===e))continue;const r=await o({id_:s});var i;(null===(l=a.value)||void 0===l?void 0:l.some(t=>t.value===e))||r&&(null===(i=a.value)||void 0===i||i.unshift(r))}}catch(s){console.error("getChildrens 批量加载失败:",s)}},getAsyncOptions:async function o(i){var s;i.pageNo||(i.pageNo=1);const{optionsData:n,complete:r}=await async function(a={}){let o=!0,i=[];const s=a.keyword?(n=a.keyword,(null==l?void 0:l.reduce((e,t)=>(e[t.split(".").length>1?t:t+".like"]=n,e),{}))||{}):{};var n;const r=`OR(${l.map(e=>`${e}.like`).join(",")})`,d=await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListByPage",modelKey:e,modelCategory:t},{},{exp:r,query:s,pageSize:30,pageNo:a.pageNo})||{};return o=!d.totalPage||d.totalPage<=d.pageNo,i=((null==d?void 0:d.data)||[]).map(e=>{var t,a;const l=e.__LABEL__||e.name_;return{value:e.id_,title:l,_info:null===(t=e.__CHILDREN__)||void 0===t?void 0:t.find(e=>e.default_),full_path:$t("div",[$t("span",`${l}`),$t("span",{class:"gct-custom-tag ml8px"},Rt("sys.default"))]),children:null===(a=e.__CHILDREN__)||void 0===a?void 0:a.map(t=>{const a=t.__LABEL__||t.version_;return{value:`${e.id_}:${t.id_}`,title:$t("div",[$t("span",{class:"version"},a),t.default_?$t("span",{class:"version gct-custom-tag ml8px"},Rt("sys.default")):null]),_info:{...t},full_path:$t("div",[$t("span",`${l}:${a}`)])}})}}),{complete:o,optionsData:i}}(i);if(null===(s=a.value)||void 0===s?void 0:s.length)if(i.pageNo>1){var d;null===(d=a.value)||void 0===d||d.pop()}else a.value=[];var u;n.forEach(e=>{var t;null===(t=a.value)||void 0===t||t.push(e)}),r||null===(u=a.value)||void 0===u||u.push({selectable:!1,title:()=>$t(dd,{onNextOnce:()=>{i.pageNo+=1,o(i)}})})},treeData:a}}var cd=/* @__PURE__ */Kt({__name:"rdo-select-cmp",props:{value:{},apiParams:{},parentToDefault:{type:Boolean,default:!0}},setup(e){const t=e,a=oa(),{getChildrens:l,getAsyncOptions:o,treeData:i}=ud({bindModelKey:t.apiParams.modelKey,modelCategory:"entity"});async function s(e={}){await o({modelCategory:"entity",pageSize:9999,queryData:{...e.queryData},...e})}Zt(s),Se(()=>t.value,async e=>{try{await l(e)}catch(t){console.log(t)}},{debounce:200,immediate:!0});const n=Ca(async e=>{await s({keyword:e,pageNo:1}),e||await l(t.value)},200);return(t,l)=>{const o=ra("a-tooltip"),s=ra("a-tree-select");return ta(),At(s,{"search-value":a.value,"onUpdate:searchValue":l[0]||(l[0]=e=>a.value=e),value:e.value,style:{width:"100%"},"tree-data":ma(i),"show-search":"","allow-clear":!0,multiple:"","tree-node-label-prop":"full_path","show-checked-strategy":ma(el).SHOW_ALL,"max-tag-count":"responsive","max-tag-text-length":2,virtual:!1,"filter-tree-node":()=>!0,"dropdown-class-name":"vxe-table--ignore-clear",onSearch:ma(n)},{maxTagPlaceholder:ga(e=>{return[jt(o,{title:(t=e,t.map(e=>{var t;return null===(t=e.label)||void 0===t||null===(t=t.children)||void 0===t||null===(t=t.map(e=>e.children))||void 0===t?void 0:t.join(":")}).join(", "))},{default:ga(()=>[Pt("span",null,"+"+ua(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},8,["search-value","value","tree-data","show-checked-strategy","onSearch"])}}}),pd=cd,vd=/* @__PURE__ */Kt({__name:"tree-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},setup(e){const t=e,a=oa([]),l=oa(),o=Mt(()=>"permissionScope"===t.filterType);Zt(async()=>{o.value&&await(async()=>{const{modelKey:e}=t.apiParams??{};l.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField})();const e=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listAll"},{},{}),i=Array.isArray(e)?e:e.data??[],s=i.map(e=>(void 0===e.__NON_LEAF__&&(e.__NON_LEAF__=i.some(t=>t.parent_id_===e.id_)),{label:e.name_||e[l.value]||e.id_,value:e.id_,full_path_:e.full_path_,_item:e,id:e.id_,pId:e.parent_id_,isLeaf:!e.__NON_LEAF__}));a.value=s.map(e=>{const t=e.full_path_.split("/").map(e=>{const t=s.find(t=>t.value===e);return t?t.label:null}).filter(e=>e).join("/");return{...e,label:t,title:e.label}})});const i=(e,t)=>{var a;return null==t||null===(a=t.title)||void 0===a?void 0:a.toLowerCase().includes(e.toLowerCase())};return(e,t)=>{const l=ra("a-tooltip"),s=ra("a-tree-select");return ta(),At(s,{"tree-data":a.value,"tree-data-simple-mode":"","allow-clear":"","show-checked-strategy":ma(el).SHOW_ALL,"tree-node-label-prop":"label",multiple:"","filter-tree-node":!!o.value&&i,"max-tag-count":"responsive","max-tag-text-length":2,"show-search":o.value},{maxTagPlaceholder:ga(e=>{return[jt(l,{title:(t=e,t.map(e=>e&&e.label?e.label:String(e)).join(", "))},{default:ga(()=>[Pt("span",null,"+"+ua(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},8,["tree-data","show-checked-strategy","filter-tree-node","show-search"])}}}),md=vd,hd=/* @__PURE__ */Kt({__name:"select-modal-cmp",props:{supportModalType:{},pickerCompParams:{},value:{}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,o=oa(),i="range-user-modal_"+It(16,16),s=oa([]),n=oa([]),r=oa([]),d=oa([]),u=oa([]),c=oa({}),p=Mt(()=>{var e;return null===(e=a.pickerCompParams)||void 0===e?void 0:e.multiple}),v=Mt(()=>({mode:p.value?"multiple":void 0,dropdownClassName:"hidden"})),m=Mt(()=>{if(a.value){let e=a.value;const t=p.value?Array.isArray(e)?e:(null==e?void 0:e.split(",").filter(e=>e))||[]:e;return"range_user"===a.supportModalType?t:e}}),h=e=>{if("range_user"===a.supportModalType){const t=a.value,o=(p.value?Array.isArray(t)?[...t]:String(t??"").split(",").filter(Boolean):null!=t&&""!==t?[String(t)]:[]).filter(t=>String(t)!==String(e));return void l("change",o.length?o:"",0)}if("label_template_ref"===a.supportModalType)if(p.value){const t=a.value;l("change",(Array.isArray(t)?[...t]:null!=t&&""!==t?String(t).split(",").filter(Boolean):[]).filter(t=>String(t)!==String(e)),0)}else l("change","",0)},y=Mt(()=>"range_user"===a.supportModalType?[...s.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...n.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...r.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...d.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)})]:"label_template_ref"===a.supportModalType?u.value.map(e=>({...e,value:e.id,label:`${e.name}${e.version&&"btw"!==e.printType?" : "+e.version:""}`})):[]),f=async e=>{var t;if(!(null==e?void 0:e.length))return;const a=null==e||null===(t=e.filter(e=>e.includes("USER:")&&!d.value.some(t=>t.value===e)))||void 0===t?void 0:t.map(e=>e.replace(/USER:/,""));null!=a&&a.length&&await g(a)},g=async e=>{const t=(await _api.platform.orgUserPicker.getTenantManagementUserListByIds({ids:e.join(",")})??[]).map(e=>({...e,value:`USER:${e.id}`,label:e.fullname}));d.value.push(...t)},b=e=>!!(null==e?void 0:e.printType)&&"btw"===e.printType;async function _(e=m.value){await w(e);const t=E(e);if(!t.length)return p.value?[]:void 0;const a=t.map(e=>u.value.find(t=>String(t.id)===String(e))).filter(Boolean).map(e=>{const t=u.value.find(t=>t.id===(null==e?void 0:e.key)),a=(null==t?void 0:t.categoryId)||e.categoryId,l={...e,categoryId:a};return{...l,version:b(l)?"":null==l?void 0:l.version}});return p.value?a.map(e=>ca(e)):a[0]?ca(a[0]):void 0}function E(e){return null==e||""===e?[]:p.value?Array.isArray(e)?e.map(String).filter(Boolean):String(e).split(",").filter(Boolean):[String(e)]}async function w(e){const t=E(e??m.value);t.length&&await Promise.all(t.map(async e=>{u.value.some(t=>String(t.id)===String(e))||await async function(e){const t=await _api.apaas.printDesigner.getInfo({id:e,moduleType:mt.LABEL});return t&&u.value.push({...t,id:t.baseId?t.baseId+":"+t.id:t.id}),t}((String(e).includes(":")?String(e).split(":").pop():String(e))||e)}))}const T=async e=>{var t;const a=null==e||null===(t=e.filter(e=>e.includes("USER:")&&!d.value.some(t=>t.value===e)))||void 0===t?void 0:t.map(e=>e.replace(/USER:/,""));null!=a&&a.length&&await g(a),l("change",e.length?e:"",0)},C=async()=>{if("range_user"===a.supportModalType)o.value.open({selectedValue:m.value,title:""});else if("label_template_ref"===a.supportModalType){var e;const t=await _gct.openUtil.modal(Rr,{selected:await _(),moduleType:mt.LABEL,isRdo:!0,btwForceVisible:!0,multiple:p.value},{title:Rt("sys.pageDesigner.chooseTmplSth",{sth:""}),width:1100,height:734,okText:Rt("sys.okText"),wrapClassName:"vxe-table--ignore-clear"});if(t.ok&&(null===(e=t.params)||void 0===e||null===(e=e.selected)||void 0===e?void 0:e.length)){const{selected:e}=t.params;e.forEach(e=>{b(e)&&(e.id=`${e.baseId}:${e.id}`,e.version="")}),e.forEach(e=>{u.value.some(t=>t.id===e.id)||u.value.push({...e})}),l("change",p.value?e.map(e=>e.id):e[0].id,0)}}};return ya(()=>m,async e=>{if("range_user"!==a.supportModalType){if("label_template_ref"===a.supportModalType){var t;const a=E(e);await w(e);const l=null==a||null===(t=a.map(e=>u.value.find(t=>t.id==e)))||void 0===t?void 0:t.filter(Boolean);if(!(null==l?void 0:l.length))return void(c.value={});const o=l[0];c.value={...o,version:b(o)?"":null==o?void 0:o.version}}}else f(p.value?e:[e])},{immediate:!0,deep:!0}),Qt(()=>{var e;"range_user"===a.supportModalType&&((async()=>{s.value=(await _api.apaas.role.getList({})??[]).map(e=>({...e,value:`ROLE:${e.id}`,label:e.name,iconExtraProps:{}}))})(),(async()=>{n.value=(await _api.apaas.userGroup.getList({})??[]).map(e=>({...e,value:`USER_GROUP:${e.id}`,label:e.name}))})(),(async()=>{r.value=(await _api.apaas.designerCommon.getGetCanBeUsedOrg({})??[]).map(e=>({...e,value:`ORG:${e.id}`,label:e.name}))})(),(!p.value&&m.value||p.value&&(null===(e=m.value)||void 0===e?void 0:e.length))&&f(p.value?m.value:[m.value])),"label_template_ref"===a.supportModalType&&w()}),(e,t)=>{const a=ra("a-select");return ta(),Ut(Lt,null,[jt(a,qt({open:!1,value:m.value,"max-tag-count":"responsive","max-tag-text-length":2,options:y.value},v.value,{onClick:C,onDeselect:h}),null,16,["value","options"]),jt(ma(U),{ref_key:"selectUserModalRef",ref:o,"class-name":i,"destroy-on-close":!0,onOk:T},null,512)],64)}}}),yd=hd,fd={[dt.DATE]:Rt("sys.webRender.date"),[dt.TIME]:Rt("sys.webRender.time"),[dt.DATE_TIME]:Rt("sys.webRender.dateTime"),[dt.ORG]:"",[dt.ORG_MULTI]:"",[dt.USER]:Rt("sys.webRender.user"),[dt.USER_MULTI]:Rt("sys.webRender.user")},gd=/* @__PURE__ */function(e){return e.CUR_USER="__CUR_USER__",e.CUR_USER_ORG="__CUR_USER_ORG__",e.CUR_USER_MASTER_ORG="__CUR_USER_MASTER_ORG__",e.CUR_USER_PRINCIPAL_ORG="__CUR_USER_PRINCIPAL_ORG__",e.CUR_USER_DIRECT_SUBORDINATE="__CUR_USER_DIRECT_SUBORDINATE__",e}({}),bd=/* @__PURE__ */function(e){return e.NOW="__NOW__",e.CUR_DAY="__CUR_DAY__",e.CUR_WEEK="__CUR_WEEK__",e.CUR_MONTH="__CUR_MONTH__",e.CUR_YEAR="__CUR_YEAR__",e}({}),_d=[gd.CUR_USER,gd.CUR_USER_ORG,gd.CUR_USER_MASTER_ORG,gd.CUR_USER_PRINCIPAL_ORG,gd.CUR_USER_DIRECT_SUBORDINATE],Ed=[bd.NOW,bd.CUR_DAY,bd.CUR_WEEK,bd.CUR_MONTH,bd.CUR_YEAR],wd={[bd.NOW]:e=>Rt("sys.webRender.sysNow",{text:Rt(e)}),[bd.CUR_DAY]:()=>Rt("sys.webRender.curDay"),[bd.CUR_WEEK]:()=>Rt("sys.webRender.curWeek"),[bd.CUR_MONTH]:()=>Rt("sys.webRender.curMonth"),[bd.CUR_YEAR]:()=>Rt("sys.webRender.curYear"),[gd.CUR_USER]:()=>Rt("sys.webRender.curUser"),[gd.CUR_USER_ORG]:e=>Rt("sys.webRender.curUserOrg",{text:e}),[gd.CUR_USER_MASTER_ORG]:e=>Rt("sys.webRender.curUserMasterOrg",{text:e}),[gd.CUR_USER_PRINCIPAL_ORG]:e=>Rt("sys.webRender.curUserPrincipalOrg",{text:e}),[gd.CUR_USER_DIRECT_SUBORDINATE]:Rt("sys.webRender.curUserDirectSubordinate")},Td=/* @__PURE__ */function(e){return e.FIXED="FIXED",e.SYS="SYS",e.FIELD="FIELD",e.VAR="VAR",e.COMP_PARAMS="COMP_PARAMS",e.BUILT_PARAMS="BUILT_PARAMS",e}({}),Cd={[Td.FIXED]:{name:Rt("sys.webRender.fixed"),abbr:Rt("sys.webRender.fixedAbbr")},[Td.SYS]:{name:Rt("sys.webRender.system"),abbr:Rt("sys.webRender.systemAbbr")},[Td.FIELD]:{name:Rt("sys.webRender.field"),abbr:Rt("sys.webRender.fieldAbbr")},[Td.VAR]:{name:Rt("sys.webRender.var"),abbr:Rt("sys.webRender.varAbbr")},[Td.COMP_PARAMS]:{name:"组件传参",abbr:"组"},[Td.BUILT_PARAMS]:{name:"内置传参",abbr:"内"}},Rd=/* @__PURE__ */function(e){return e.INPUT="input",e.SELECT="select",e.REQUEST_SELECT="request_select",e.DATEPICKER="datePicker",e.CUSTOM="custom",e.REQUEST_TREE_SELECT="request_tree_select",e.NDO_SELECT="NdoSelect",e.RDO_SELECT="RdoSelect",e.TREE_SELECT="TreeSelect",e.SELECT_BUILTIN_PARAMS="select_builtin_params",e.MODAL_SELECT="modal_select",e}({}),Sd=/* @__PURE__ */function(e){return e.Single="single",e.Comb="comb",e.Hidden="hidden",e}({}),xd=[{label:Rt("sys.webRender.booleanTrue"),value:"true"},{label:Rt("sys.webRender.booleanFalse"),value:"false"}],Od=[ht.CONTAINANY,ht.CONTAINALL,ht.IN,ht.NOTIN,ht.VERSIONIN,ht.VERSIONNOTIN],kd=e=>e===dt.TRANSACTION?_api.apaas.designerCommon.getTableEntityModelList:e===dt.MESSAGE_TMPL?_api.apaas.messageTmpl.getList:e===dt.PRINTER?_api.apaas.print.getPrintDropdownList:e===dt.RDO_REF?_api.apaas.bizService.postModelKeyBsKey:_api.apaas.modelData.postQueryRefData,Dd=({fieldType:e,bindInfo:t,modelKey:a,fieldKey:l,refModelType:o})=>e===dt.RDO_REF?{bsKey:"rdoListAll",modelKey:t}:[dt.PRINTER].includes(e)?{fieldType:e}:[dt.TRANSACTION].includes(e)?{type:"TRANSACTION"}:[dt.MESSAGE_TMPL].includes(e)?{}:{modelKey:a,fieldKey:l,bindModelKey:t,..."TREE"!==o&&{pageNo:1,pageSize:30},..."TREE"===o&&{searchType:"ALL"}},Id=({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,refModelType:i})=>{const s={};if(["NDO","RDO","TREE","BASE"].includes(e))return Object.assign(s,{apiParams:{modelKey:l}}),s;if(e===dt.DATE)Object.assign(s,{picker:"date"});else if(e===dt.TIME)Object.assign(s,{picker:"time"});else if(e===dt.DATE_TIME)Object.assign(s,{showTime:!0});else if([dt.USER,dt.USER_MULTI,dt.ORG,dt.ORG_MULTI].includes(e))Object.assign(s,{supportModalType:[dt.ORG_MULTI,dt.ORG].includes(e)?"org":[ht.CONTAINALL,ht.EQ,ht.NE,ht.IN,ht.NOTIN].includes(t)?"user":"user&org",mode:Od.includes(t)?"multiple":"",pickerCompParams:{modelKey:a,fieldKey:l,multiple:Od.includes(t)}});else if([dt.OPTION,dt.OPTION_MULTI].includes(e))console.log("OPTION",e);else if([dt.RANGE_USER,dt.LABEL_TEMPLATE_REF].includes(e))Object.assign(s,{supportModalType:e===dt.RANGE_USER?"range_user":"label_template_ref",mode:Od.includes(t)?"multiple":"",pickerCompParams:{modelKey:a,fieldKey:l,multiple:Od.includes(t)}});else if([dt.ENUM,dt.ENUM_MULTI,dt.REF,dt.REF_MULTI,dt.RDO_REF,dt.PRIMARY_KEY,dt.TRANSACTION,dt.MESSAGE_TMPL,dt.PRINTER].includes(e)){const n=![ht.EQ,ht.NE].includes(t);Object.assign(s,{mode:n?"multiple":""}),[dt.REF,dt.REF_MULTI,dt.RDO_REF,dt.PRIMARY_KEY,dt.TRANSACTION,dt.MESSAGE_TMPL,dt.PRINTER].includes(e)?Object.assign(s,{showSearch:!0,multiple:n,api:kd(e),apiParams:Dd({fieldType:e,bindInfo:o,modelKey:a,fieldKey:l,refModelType:i})}):Object.assign(s,{api:_api.apaas.enumModelField.getPageList,apiParams:{pageSize:9999,enumModelKey:o}})}return s},Ld={basicText:{isDefault:!0,comps:Rd.INPUT},[dt.BOOLEAN]:{isDefault:!0,comps:Rd.SELECT,compAttrs:{options:xd}},basicDate:{comps:[Rd.DATEPICKER,Rd.SELECT],compAttrs:[Id,{optionsKeys:[...Ed],filter:{type:"contain",list:[bd.NOW]}}]},basicUserDep:{typeKeys:[Td.FIXED,Td.SYS],default:Td.FIXED,comps:[Rd.CUSTOM,Rd.SELECT],compAttrs:[Id,{optionsKeys:[..._d],filter:({operatorType:e,fieldType:t})=>{const a=[dt.USER,dt.ORG].includes(t)&&[ht.EQ,ht.NE].includes(e);return{type:e===ht.CONTAINALL||a?"contain":"exclude",list:e===ht.CONTAINALL||a?[[dt.ORG_MULTI,dt.ORG].includes(t)?gd.CUR_USER_MASTER_ORG:gd.CUR_USER]:[dt.ORG_MULTI,dt.ORG].includes(t)?[gd.CUR_USER,gd.CUR_USER_DIRECT_SUBORDINATE]:[]}}}]},basicModalSel:{isDefault:!0,comps:Rd.MODAL_SELECT,compAttrs:Id},basicEnum:{isDefault:!0,comps:Rd.REQUEST_SELECT,compAttrs:Id},basicModel:{isDefault:!0,comps:({refModelType:e,fieldType:t})=>"TREE"===e||t===dt.PRINTER?Rd.REQUEST_TREE_SELECT:Rd.REQUEST_SELECT,compAttrs:Id},NDO:{isDefault:!0,comps:Rd.NDO_SELECT,compAttrs:Id},RDO:{isDefault:!0,comps:Rd.RDO_SELECT,compAttrs:Id},TREE:{isDefault:!0,comps:Rd.TREE_SELECT,compAttrs:Id},BASE:{isDefault:!0,comps:Rd.NDO_SELECT,compAttrs:Id}},Md=[ht.RANGE,ht.ORANGE,ht.RORANGE,ht.LORANGE,ht.IN,ht.NOTIN,ht.CONTAINANY,ht.CONTAINALL,ht.VERSIONIN,ht.VERSIONNOTIN],Ad=({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,valueType:i,refModelType:s,fieldOptions:n,mainModelKey:r,isPageDesigner:d,isOnlineFormDesigner:u,varOptions:c})=>{let p="";if(!t)return[];switch(e){case dt.TEXT:case dt.LONG_TEXT:case dt.SERIAL:case dt.INTEGER:case dt.LONG:case dt.DOUBLE:case dt.DECIMAL:case dt.OPTION:case dt.OPTION_MULTI:p="basicText";break;case dt.DATE:case dt.TIME:case dt.DATE_TIME:p="basicDate";break;case dt.USER:case dt.ORG:case dt.USER_MULTI:case dt.ORG_MULTI:p="basicUserDep";break;case dt.ENUM:case dt.ENUM_MULTI:p="basicEnum";break;case dt.REF:case dt.REF_MULTI:case dt.RDO_REF:case dt.PRIMARY_KEY:case dt.TRANSACTION:case dt.MESSAGE_TMPL:case dt.PRINTER:p="basicModel";break;case dt.LABEL_TEMPLATE_REF:case dt.RANGE_USER:p="basicModalSel"}const v=(m=t,[ht.ISNOTNULL,ht.ISNULL].includes(m)?Sd.Hidden:[ht.RANGE,ht.ORANGE,ht.RORANGE,ht.LORANGE].includes(m)?Sd.Comb:Sd.Single);var m;if(v===Sd.Hidden)return[{isHide:!0}];let h=[];const y=Ta(Ld[p||e]),f=(v===Sd.Comb?[y,Ta(y)]:[y]).map((i,m)=>{var y;const f={};var g,b,_;(null==i?void 0:i.isDefault)||u?Ma(f,{typeKeys:[Td.FIXED],default:Td.FIXED}):xa(i,"default")&&xa(i,"typeKeys")?Ma(f,Na(i,["typeKeys","default"])):"basicDate"===p&&(v===Sd.Single?Ma(f,{typeKeys:[Td.FIXED,Td.SYS],default:Td.FIXED}):v===Sd.Comb&&(Ma(f,{typeKeys:0===m&&t!==ht.RANGE?[Td.FIXED]:[Td.FIXED,Td.SYS],default:(0===m&&ht.RANGE,Td.FIXED)}),t===ht.RANGE&&0===m&&(e===dt.TIME&&Object.assign(f,{typeKeys:[Td.FIXED],default:Td.FIXED}),i.compAttrs[1].filter={type:"exclude",list:[bd.NOW]}))),Md.includes(t)||[dt.OPTION,dt.OPTION_MULTI].includes(e)||null===(g=f.typeKeys)||void 0===g||g.push(Td.FIELD),d&&(null===(b=f.typeKeys)||void 0===b||b.push(Td.VAR)),u&&(null===(_=f.typeKeys)||void 0===_||_.push(Td.COMP_PARAMS,Td.BUILT_PARAMS)),Ma(f,{valueTypeOptions:null===(y=f.typeKeys)||void 0===y?void 0:y.map(e=>({label:Rt(Cd[e].name),value:e,abbr:Rt(Cd[e].abbr)}))});const E="function"==typeof(null==i?void 0:i.comps)?null==i?void 0:i.comps({refModelType:s,fieldType:e}):null==i?void 0:i.comps,w=Array.isArray(E)?E:[E];if(h=1==w.length?[Td.FIXED]:[Td.FIXED,Td.SYS],Md.includes(t)||[dt.OPTION,dt.OPTION_MULTI].includes(e)||(w.push(Rd.SELECT),h.push(Td.FIELD)),d&&(w.push(Rd.SELECT),h.push(Td.VAR)),u&&(w.push(Rd.INPUT,Rd.SELECT_BUILTIN_PARAMS),h.push(Td.COMP_PARAMS,Td.BUILT_PARAMS)),w.forEach((e,t)=>{Ma(f,{[h[t]]:{cmp:e}})}),xa(i,"compAttrs")){const n="function"==typeof i.compAttrs?i.compAttrs({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,refModelType:s}):i.compAttrs;(Array.isArray(n)?n:[n]).forEach((i,s)=>{const n={},r="function"==typeof i?i({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o}):i;xa(r,"filter")&&Object.assign(n,{filter:"function"==typeof r.filter?r.filter({operatorType:t,fieldType:e}):r.filter});const d={};var u;(null==r?void 0:r.optionsKeys)&&Object.assign(d,{options:null==r||null===(u=r.optionsKeys)||void 0===u?void 0:u.filter(e=>{if(!ka(null==n?void 0:n.filter)){const t=null==n?void 0:n.filter;return"contain"===t.type?t.list.includes(e):"exclude"!==t.type||!t.list.includes(e)}return!0}).map(t=>({label:"function"==typeof wd[t]?wd[t](fd[e]):wd[t],value:t}))}),Ma(f,{[h[s]]:{...f[h[s]],attrs:{...Aa(r,"filter"),...d},...n}})})}return(r||u)&&(f[Td.FIELD]={...f[Td.FIELD],attrs:{options:n}}),d&&(f[Td.FIELD]={...f[Td.FIELD],attrs:{options:n}},f[Td.VAR]={...f[Td.VAR],attrs:{options:c}}),f});return[dt.DATE,dt.DATE_TIME].includes(e)&&t===ht.RANGE&&i===Td.SYS?f.slice(0,1):f},Nd={class:"tree-action-node"},Ud={key:0,class:"ml-4px mr-4px"},Pd={key:1,style:{flex:"1","min-width":"0","background-color":"#f5f6f7"}},Vd={class:"tree-action-node__actions"},Fd=/* @__PURE__ */Kt({__name:"tree-action-node",props:{data:{},fieldList:{},selectFiledKeys:{},filterType:{},readonly:{type:Boolean},mainModelKey:{},isPageDesigner:{type:Boolean},isOnlineFormDesigner:{type:Boolean},isAllowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},onlineFormFieldList:{},modelName:{},cascadeField:{type:Boolean},searchType:{}},setup(e){const t=[dt.TEXT,dt.LONG_TEXT,dt.INTEGER,dt.LONG,dt.DOUBLE,dt.DECIMAL,dt.BOOLEAN,dt.DATE,dt.DATE_TIME,dt.TIME,dt.ENUM,dt.ENUM_MULTI,dt.REF,dt.REF_MULTI];function a(e){return t.includes(e.type)&&("USER_DEFINED"===e.createType||"BUILTIN"===e.createType)}const l=zt("isDataFilterEditor"),o={[Rd.INPUT]:za,[Rd.SELECT]:Wa,[Rd.DATEPICKER]:Ka,[Rd.CUSTOM]:ad,[Rd.REQUEST_SELECT]:od,[Rd.REQUEST_TREE_SELECT]:sd,[Rd.NDO_SELECT]:rd,[Rd.RDO_SELECT]:pd,[Rd.TREE_SELECT]:md,[Rd.MODAL_SELECT]:yd},i={[dt.DATE]:"YYYY-MM-DD",[dt.DATE_TIME]:"YYYY-MM-DD HH:mm:ss",[dt.TIME]:"HH:mm:ss"},s=e,{addNewRow:n,deleteRow:r,updateNodeItem:d}=Zr(s.readonly),u=oa([]),c=oa([]),p=oa([]),v=Mt(()=>"filterConfig"===s.filterType),m=Mt(()=>"businessFlow"===s.filterType),h=Mt(()=>"edhrBuiltPerms"===s.filterType),y=Mt(()=>s.data.key),f=Mt(()=>{var e;return null===(e=s.data.leftValue)||void 0===e?void 0:e.type}),g=Mt(()=>[dt.DATE,dt.DATE_TIME,dt.TIME].includes(f.value));console.log("props----------",s);const b=Mt(()=>{var e,t;if(h.value)return null===(t=s.fieldList)||void 0===t?void 0:t.map(e=>({key:e.key,value:e.id,label:e.name,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type}}));let a;if(m.value){var l,o,i;(null===(l=s.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.nodeKey)||(s.data.leftValue.nodeKey=null===(i=s.fieldList)||void 0===i||null===(i=i.find(e=>e.defaultValue))||void 0===i?void 0:i.key);const e=null===(o=s.fieldList)||void 0===o?void 0:o.find(e=>e.fixed);if(a=((null==e?void 0:e.children)||[]).filter(e=>Object.keys(s.searchType).includes(e.type)).map(t=>({...t,id:`${e.id}.${t.id}`})),s.data.leftValue.nodeKey!==e.key){var n;const e=null===(n=s.fieldList)||void 0===n?void 0:n.find(e=>{var t;return e.key===(null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey)});a=((null==e?void 0:e.children)||[]).filter(e=>Object.keys(s.searchType).includes(e.type)).map(t=>({...t,id:`${e.id}.${t.id}`})).concat(a)}}return null===(e=m.value?a:s.fieldList)||void 0===e?void 0:e.filter(e=>![dt.IMAGE,dt.ATTACHMENT,dt.MASTERSLAVE].includes(e.type)).map(e=>{var t;return{label:v.value||m.value?`${e.modelName}.${e.name}`:e.name,value:e.id,disabled:!1,filedInfo:{id:e.id,key:m.value?e.id:e.key,name:e.name,type:e.type,bindInfo:e.bindInfo,modelKey:e.modelKey,refModelType:e.refModelType,nodeKey:m.value?null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey:void 0}}})}),_=Mt(()=>{var e;return null===(e=b.value)||void 0===e?void 0:e.filter(e=>{var t,a,l,o;return(null===(t=e.filedInfo)||void 0===t?void 0:t.type)===(null===(a=s.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.type)&&(null===(l=e.filedInfo)||void 0===l?void 0:l.key)!==(null===(o=s.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key)})}),E=Mt(()=>{var e,t,a;if(h.value)return[{label:Rt("sys.appDesigner.conditionVisible"),value:ht.IN},{label:Rt("sys.appDesigner.conditionInvisible"),value:ht.NOTIN}];if(!f.value)return[];const l=null===(e=s.searchType)||void 0===e?void 0:e[f.value],o=(null==l?void 0:l.filter)||[],i=null==o||null===(t=o.concat(...(null==l||null===(a=l.contain)||void 0===a?void 0:a.map(e=>{var t;return(null===(t=s.searchType)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.filter)||[]}))||[]))||void 0===t?void 0:t.map(e=>({label:Rt(`sys.model.${e}`),value:e}));return null==i?void 0:i.filter(e=>{var t;return!(null===(t=s.excludeOperatorType)||void 0===t?void 0:t.includes(e.value))})}),w=Mt(()=>{var e;return(null===(e=s.data)||void 0===e||null===(e=e.rightValue)||void 0===e?void 0:e.map(e=>g.value&&e.result&&e.valueType===Td.FIXED?ll(e.result).format(i[f.value]||"YYYY-MM-DD"):e.result))||[]});ya(()=>s.mainModelKey,async e=>{var t;e?(await async function(e){var t;const a=[e];m.value&&(null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.modelKey)&&a.push(s.data.leftValue.modelKey);const l=a.map(e=>async function(e){var t;return(null===(t=(await _api.apaas.modelMeta.getDetail({modelKey:e},s.apiConfig)||{}).fieldMetaList)||void 0===t?void 0:t.map(e=>({label:e.name,value:e.key})))||[]}(e));p.value=(await Promise.all(l)).flat()}(e),T({operatorType:null===(t=s.data)||void 0===t?void 0:t.operatorValue,valueType:void 0})):p.value=[]},{immediate:!0}),ya(()=>{var e;return null===(e=s.data)||void 0===e||null===(e=e.leftValue)||void 0===e?void 0:e.modelKey},e=>{var t;m.value&&!e&&(s.data.leftValue||(s.data.leftValue={}),s.data.leftValue.nodeKey=null===(t=s.fieldList)||void 0===t||null===(t=t.find(e=>e.default))||void 0===t?void 0:t.key)},{immediate:!0});const T=async e=>{var t,a,l,o,i;u.value=Ad({fieldType:f.value,operatorType:(null==e?void 0:e.operatorType)||(null===(t=s.data)||void 0===t?void 0:t.operatorValue),modelKey:null===(a=s.data.leftValue)||void 0===a?void 0:a.modelKey,fieldKey:null===(l=s.data.leftValue)||void 0===l?void 0:l.key,bindInfo:null===(o=s.data.leftValue)||void 0===o?void 0:o.bindInfo,refModelType:null===(i=s.data.leftValue)||void 0===i?void 0:i.refModelType,valueType:(null==e?void 0:e.valueType)||void 0,fieldOptions:s.isOnlineFormDesigner?s.onlineFormFieldList:s.isPageDesigner||m.value?_.value:p.value,mainModelKey:s.mainModelKey,isPageDesigner:s.isPageDesigner||m.value,isOnlineFormDesigner:s.isOnlineFormDesigner,varOptions:c.value}),u.value.forEach((e,t)=>{var a,l,o;const i=(null===(a=e[null==e||null===(l=e.typeKeys)||void 0===l?void 0:l[t]])||void 0===a||null===(a=a.attrs)||void 0===a?void 0:a.options)||[];i.length&&i.forEach(e=>{e.label=Rt(e.label)}),e.valueTypeOptions=null===(o=e.valueTypeOptions)||void 0===o?void 0:o.filter(e=>{var t;return!(null===(t=s.excludeValueType)||void 0===t?void 0:t.includes(e.value))})})};ya([f.value,()=>s.data.leftValue,()=>s.data.operatorValue],async()=>{if(f.value&&s.data.leftValue&&s.data.operatorValue){var e,t,a;const l={};if(g.value&&(null===(e=s.data)||void 0===e?void 0:e.operatorValue)===ht.RANGE&&Array.isArray(s.data.rightValue)&&0!==s.data.rightValue.length){const e=s.data.rightValue[0];e.valueType===Td.FIXED&&Object.assign(l,{valueType:e.valueType})}s.isPageDesigner&&!c.value.length&&await async function(e=!0){const t=await _api.apaas.appGlobalSettings.getList({type:"var",fullInfo:e,source:_gct.store.context.platform},s.apiConfig)||[];c.value=(null==t?void 0:t.map(e=>({value:e.id,label:e.key,varInfo:e.configJson?JSON.parse(e.configJson):null})))||[]}(),s.isPageDesigner&&"FIELD"==(null===(t=s.data.rightValue)||void 0===t?void 0:t[0].valueType)&&!(null===(a=_.value)||void 0===a?void 0:a.length)?setTimeout(()=>T(l),200):T(l)}},{deep:!0,immediate:!0});const C=(e,t)=>{s.data.leftValue.nodeKey=e},R=(e,t)=>{if(!e)return void O(e,{});const{key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}=t;O(o,{filedInfo:{field_search_key:e,key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}})},S=(e,t)=>{var a;return t.name?t.name.includes(null==e?void 0:e.trim()):null===(a=t.label)||void 0===a?void 0:a.includes(null==e?void 0:e.trim())},x=Mt(()=>{var e,t,a;const l=null===(e=b.value)||void 0===e?void 0:e.map(e=>e.value);var o;return(null==l?void 0:l.includes(null===(t=s.data.leftValue)||void 0===t?void 0:t.id))?null===(a=s.data.leftValue)||void 0===a?void 0:a.id:null===(o=s.data.leftValue)||void 0===o?void 0:o.name}),O=async(e,t)=>{e?(d(y.value,"leftValue",t.filedInfo),u.value=[]):(d(y.value,"leftValue",void 0),u.value=[])},k=(e,t)=>{T({operatorType:e,valueType:void 0});const a=u.value.map(e=>e.default);d(y.value,"operatorValue",e,{key:"valueType",defaultValues:a})},D=()=>{n(s.data.pid,y.value)},I=()=>{r(y.value)};return(t,n)=>{const r=ra("a-select"),c=ra("a-form-item-rest"),p=ra("a-input"),v=ra("a-input-group"),_=ra("DeleteOutlined"),L=ra("a-button"),M=ra("PlusOutlined");return ta(),Ut("div",Nd,[jt(c,null,{default:ga(()=>{var t,l,o;return[m.value?(ta(),At(r,{key:0,style:{width:"140px","margin-right":"16px"},placeholder:ma(Rt)("sys.chooseText"),options:e.fieldList,value:null===(t=e.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey,class:"tree-action-select",disabled:e.readonly,"field-names":{label:"nodeName",value:"key"},onChange:C},null,8,["placeholder","options","value","disabled"])):Nt("",!0),e.modelName&&e.cascadeField?(ta(),At(ma(ve),{key:1,"filter-field-by-function":a,style:{flex:"1","min-width":"0","margin-right":"16px"},"field-meta-list":e.fieldList,"model-name":e.modelName,value:(null===(l=e.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.field_search_key)||(null===(o=e.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key),onFieldClick:R},null,8,["field-meta-list","model-name","value"])):(ta(),At(r,{key:2,style:{flex:"1",width:"200px","min-width":"0","margin-right":"16px"},placeholder:h.value?ma(Rt)("sys.chooseText"):ma(Rt)("sys.appDesigner.leftValue"),options:b.value,value:x.value,class:"tree-action-select",disabled:e.readonly,"allow-clear":e.isAllowClear,"show-search":"","filter-option":S,onChange:O},null,8,["placeholder","options","value","disabled","allow-clear"]))]}),_:1}),jt(c,null,{default:ga(()=>{var t;return[jt(r,{class:Xt(e.readonly?"tree-action-select":""),style:{flex:"1","min-width":"0","margin-right":"16px"},disabled:e.readonly||!e.data.leftValue,placeholder:h.value?ma(Rt)("sys.chooseText"):ma(Rt)("sys.appDesigner.operator"),options:E.value,value:null===(t=e.data)||void 0===t?void 0:t.operatorValue,onChange:k},null,8,["class","disabled","placeholder","options","value"])]}),_:1}),Array.isArray(u.value)&&0===u.value.length?(ta(),At(c,{key:0},{default:ga(()=>[jt(p,{disabled:!0,placeholder:h.value?ma(Rt)("sys.chooseText"):"",style:{flex:"1","min-width":"0"}},null,8,["placeholder"])]),_:1})):Nt("",!0),(ta(!0),Ut(Lt,null,sa(u.value,(t,a)=>(ta(),Ut(Lt,{key:a},[u.value.length>1&&a===u.value.length-1?(ta(),Ut("span",Ud,ua(ma(Rt)("sys.webRender.to")),1)):Nt("",!0),t.isHide?(ta(),Ut("div",Pd)):(ta(),At(c,{key:2},{default:ga(()=>[jt(v,{compact:"",class:"tree-action-node__flex-value"},{default:ga(()=>{var l,n,c,p,v;return[jt(r,{class:Xt([e.readonly?"tree-action-select is-unit":"","primary-gct"]),disabled:e.readonly,style:{width:"40px"},options:t.valueTypeOptions,"dropdown-match-select-width":!1,"option-label-prop":"abbr","show-arrow":!1,value:null===(l=e.data)||void 0===l||null===(l=l.rightValue)||void 0===l?void 0:l[a].valueType,onChange:e=>((e,t)=>{var a;if((null===(a=s.data)||void 0===a?void 0:a.operatorValue)===ht.RANGE&&g.value&&0===t){var l;T({operatorType:null===(l=s.data)||void 0===l?void 0:l.operatorValue,valueType:e});const a=u.value.map(e=>e.default);d(y.value,"rightValue",e,{index:t,key:"valueType",isRest:!0,defaultValues:a})}else d(y.value,"rightValue",e,{index:t,key:"valueType"})})(e,a)},null,8,["class","disabled","options","value","onChange"]),(ta(),At(da(o[null===(n=t[null===(c=e.data)||void 0===c||null===(c=c.rightValue)||void 0===c?void 0:c[a].valueType])||void 0===n?void 0:n.cmp]),qt({class:e.readonly?"tree-action-select left-border":"",disabled:e.readonly,style:{width:"calc(100% - 40px)"},placeholder:ma(Rt)("sys.appDesigner.value"),value:w.value[a],bordered:""},{ref_for:!0},null===(p=t[null===(v=e.data)||void 0===v||null===(v=v.rightValue)||void 0===v?void 0:v[a].valueType])||void 0===p?void 0:p.attrs,{"filter-type":e.filterType,onChange:e=>((e,t)=>{var a;const l=null===(a=s.data)||void 0===a||null===(a=a.rightValue)||void 0===a?void 0:a[t].valueType;let o;var n;o=g.value?l!==Td.FIXED||ka(e)?e:ll(e).format(i[f.value]):(null==e?void 0:e.target)?null===(n=e.target)||void 0===n?void 0:n.value:e,d(y.value,"rightValue",o,{index:t,key:"result"})})(e,a),"onUpdate:pageNo":e=>function(e,t){var a,l;const o=u.value[e],i=null===(a=o[null==o||null===(l=o.typeKeys)||void 0===l?void 0:l[e]])||void 0===a||null===(a=a.attrs)||void 0===a||null===(a=a.apiParams)||void 0===a?void 0:a.pageNo;t?u.value[e][u.value[e].typeKeys[e]].attrs.apiParams.pageNo=t:i&&(u.value[e][u.value[e].typeKeys[e]].attrs.apiParams.pageNo=i+1)}(a,e)}),null,16,["class","disabled","placeholder","value","filter-type","onChange","onUpdate:pageNo"]))]}),_:2},1024)]),_:2},1024))],64))),128)),Pt("div",Vd,[e.readonly||e.data.firstRow&&!ma(l)?Nt("",!0):(ta(),At(L,{key:0,type:"link",style:{padding:"4px 0"},size:"small",class:"ml-8px",onClick:I},{icon:ga(()=>[jt(_,{class:"text-16px"})]),_:1})),e.readonly?Nt("",!0):(ta(),At(L,{key:1,type:"link",size:"small",style:{padding:"4px 0"},onClick:D},{icon:ga(()=>[jt(M)]),_:1}))])])}}}),jd=/* @__PURE__ */$e(Fd,[["__scopeId","data-v-f37ec578"]]),Bd={class:"perm-root-node"},Kd=/* @__PURE__ */Kt({__name:"perm-root-node",props:{data:{},level:{},id:{},operatorType:{},readonly:{type:Boolean}},setup(e){const t=[{label:Rt(zr[Gr.AND]),value:Gr.AND},{label:Rt(zr[Gr.OR]),value:Gr.OR}],a=e,{updateNodeItem:l}=Zr(a.readonly),o=Mt({get:()=>a.operatorType,set(e){l(a.id,"operatorType",e)}});return(a,l)=>{const i=ra("a-radio-button"),s=ra("a-radio-group"),n=ra("a-form-item-rest");return ta(),Ut("div",Bd,[Pt("div",null,[jt(n,null,{default:ga(()=>[jt(s,{value:o.value,"onUpdate:value":l[0]||(l[0]=e=>o.value=e),disabled:e.readonly},{default:ga(()=>[(ta(),Ut(Lt,null,sa(t,e=>jt(i,{key:e.value,value:e.value},{default:ga(()=>[Ft(ua(e.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value","disabled"])]),_:1})])])}}}),Gd=/* @__PURE__ */$e(Kd,[["__scopeId","data-v-ca5c9d20"]]),$d={class:"perm-action-node"},zd={key:0,class:"mx-4px"},Hd={key:1,style:{flex:"1","min-width":"0","background-color":"#f5f6f7"}},qd={class:"perm-action-node__flex-value"},Yd={class:"perm-action-node__actions"},Xd=/* @__PURE__ */Kt({__name:"perm-action-node",props:{data:{},fieldList:{},selectFiledKeys:{},filterType:{},readonly:{type:Boolean},isPageDesigner:{type:Boolean},isAllowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},modelName:{},cascadeField:{type:Boolean},hasPermScopeError:{type:Boolean}},setup(e){const t=[dt.TEXT,dt.LONG_TEXT,dt.INTEGER,dt.LONG,dt.DOUBLE,dt.DECIMAL,dt.BOOLEAN,dt.DATE,dt.DATE_TIME,dt.TIME,dt.ENUM,dt.ENUM_MULTI,dt.REF,dt.REF_MULTI];function a(e){return t.includes(e.type)&&("USER_DEFINED"===e.createType||"BUILTIN"===e.createType)}const l={[Rd.INPUT]:za,[Rd.SELECT]:Wa,[Rd.DATEPICKER]:Ka,[Rd.CUSTOM]:ad,[Rd.REQUEST_SELECT]:od,[Rd.REQUEST_TREE_SELECT]:sd,[Rd.NDO_SELECT]:rd,[Rd.RDO_SELECT]:pd,[Rd.TREE_SELECT]:md},o={[dt.DATE]:"YYYY-MM-DD",[dt.DATE_TIME]:"YYYY-MM-DD HH:mm:ss",[dt.TIME]:"HH:mm:ss"},i=e,{deleteRow:s,updateNodeItem:n}=Zr(i.readonly),r=oa([]),d=oa([]),u=oa([]),c=Mt(()=>"filterConfig"===i.filterType),p=Mt(()=>"permissionScope"===i.filterType),v=Mt(()=>i.data.key),m=Mt(()=>{var e;return null===(e=i.data.leftValue)||void 0===e?void 0:e.type}),h=Mt(()=>[dt.DATE,dt.DATE_TIME,dt.TIME].includes(m.value)),y=Mt(()=>{var e,t;return p.value?null===(t=i.fieldList)||void 0===t?void 0:t.map(e=>({key:e.key,value:e.id,label:e.name,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type}})):null===(e=i.fieldList)||void 0===e?void 0:e.filter(e=>![dt.IMAGE,dt.ATTACHMENT,dt.MASTERSLAVE].includes(e.type)).map(e=>({label:c.value?`${e.modelName}.${e.name}`:e.name,value:e.id,disabled:!1,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type,bindInfo:e.bindInfo,modelKey:e.modelKey,refModelType:e.refModelType,nodeKey:void 0}}))}),f=Mt(()=>{var e;return null===(e=y.value)||void 0===e?void 0:e.filter(e=>{var t,a,l,o;return(null===(t=e.filedInfo)||void 0===t?void 0:t.type)===(null===(a=i.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.type)&&(null===(l=e.filedInfo)||void 0===l?void 0:l.key)!==(null===(o=i.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key)})}),g=Mt(()=>[{label:Rt("sys.appDesigner.conditionVisible"),value:"RDO"===m.value?"defVersionIn":ht.IN},{label:Rt("sys.appDesigner.conditionInvisible"),value:"RDO"===m.value?"defVersionNotIn":ht.NOTIN}]),b=Mt(()=>{var e;return(null===(e=i.data)||void 0===e||null===(e=e.rightValue)||void 0===e?void 0:e.map(e=>h.value&&e.result&&e.valueType===Td.FIXED?ll(e.result).format(o[m.value]||"YYYY-MM-DD"):e.result))||[]});p.value&&(i.data.operatorValue="RDO"===m.value?"defVersionIn":ht.IN);const _=async e=>{var t,a,l,o,s;r.value=Ad({fieldType:m.value,operatorType:(null==e?void 0:e.operatorType)||(null===(t=i.data)||void 0===t?void 0:t.operatorValue),modelKey:null===(a=i.data.leftValue)||void 0===a?void 0:a.modelKey,fieldKey:null===(l=i.data.leftValue)||void 0===l?void 0:l.key,bindInfo:null===(o=i.data.leftValue)||void 0===o?void 0:o.bindInfo,refModelType:null===(s=i.data.leftValue)||void 0===s?void 0:s.refModelType,valueType:(null==e?void 0:e.valueType)||void 0,fieldOptions:(i.isPageDesigner?f.value:u.value)??[],mainModelKey:void 0,isPageDesigner:i.isPageDesigner,isOnlineFormDesigner:!1,varOptions:d.value}),r.value.forEach((e,t)=>{var a,l,o;const s=(null===(a=e[null==e||null===(l=e.typeKeys)||void 0===l?void 0:l[t]])||void 0===a||null===(a=a.attrs)||void 0===a?void 0:a.options)||[];s.length&&s.forEach(e=>{e.label=Rt(e.label)}),e.valueTypeOptions=null===(o=e.valueTypeOptions)||void 0===o?void 0:o.filter(e=>{var t;return!(null===(t=i.excludeValueType)||void 0===t?void 0:t.includes(e.value))})})};ya([m.value,()=>i.data.leftValue,()=>i.data.operatorValue],async()=>{if(m.value&&i.data.leftValue&&i.data.operatorValue){var e,t,a;const l={};if(h.value&&(null===(e=i.data)||void 0===e?void 0:e.operatorValue)===ht.RANGE&&Array.isArray(i.data.rightValue)&&0!==i.data.rightValue.length){const e=i.data.rightValue[0];e.valueType===Td.FIXED&&Object.assign(l,{valueType:e.valueType})}i.isPageDesigner&&"FIELD"==(null===(t=i.data.rightValue)||void 0===t?void 0:t[0].valueType)&&!(null===(a=f.value)||void 0===a?void 0:a.length)?setTimeout(()=>_(l),200):_(l)}},{deep:!0,immediate:!0});const E=(e,t)=>{if(!e)return void C(e,{});const{key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}=t;C(o,{filedInfo:{field_search_key:e,key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}})},w=(e,t)=>{var a;return t.name?t.name.includes(null==e?void 0:e.trim()):null===(a=t.label)||void 0===a?void 0:a.includes(null==e?void 0:e.trim())},T=Mt(()=>{var e,t,a;const l=null===(e=y.value)||void 0===e?void 0:e.map(e=>e.value);var o;return(null==l?void 0:l.includes(null===(t=i.data.leftValue)||void 0===t?void 0:t.id))?null===(a=i.data.leftValue)||void 0===a?void 0:a.id:null===(o=i.data.leftValue)||void 0===o?void 0:o.name}),C=async(e,t)=>{if(e){if(n(v.value,"leftValue",t.filedInfo),r.value=[],p.value){var a;const e=null===(a=g.value)||void 0===a?void 0:a[0];await Yt(),R(e.value,e)}}else n(v.value,"leftValue",void 0),r.value=[]},R=(e,t)=>{var a;if(p.value&&!(null===(a=i.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.key))return;_({operatorType:e,valueType:void 0});const l=r.value.map(e=>e.default);n(v.value,"operatorValue",e,{key:"valueType",defaultValues:l})},S=()=>{s(v.value)};return(t,s)=>{const d=ra("a-select"),u=ra("a-form-item-rest"),c=ra("a-input"),p=ra("a-button");return ta(),Ut("div",$d,[jt(u,null,{default:ga(()=>{var t,l;return[e.modelName&&e.cascadeField?(ta(),At(ma(ve),{key:0,value:(null===(t=e.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.field_search_key)||(null===(l=e.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.key),"filter-field-by-function":a,"field-meta-list":e.fieldList,"model-name":e.modelName,style:{flex:"1","min-width":"0","margin-right":"12px"},onFieldClick:E},null,8,["value","field-meta-list","model-name"])):(ta(),At(d,{key:1,value:T.value,options:y.value,disabled:e.readonly,"allow-clear":e.isAllowClear,"filter-option":w,placeholder:ma(Rt)("sys.chooseText"),"show-search":"",style:{width:"212px","margin-right":"12px"},class:Xt(["tree-action-select",e.hasPermScopeError&&!T.value?"is-perm-scope-error":""]),onChange:C},null,8,["value","options","disabled","allow-clear","placeholder","class"]))]}),_:1}),jt(u,null,{default:ga(()=>{var t;return[jt(d,{class:Xt(e.readonly?"tree-action-select":""),disabled:e.readonly||!1,placeholder:ma(Rt)("sys.chooseText"),options:g.value,value:null===(t=e.data)||void 0===t?void 0:t.operatorValue,style:{width:"120px","margin-right":"12px"},onChange:R},null,8,["class","disabled","placeholder","options","value"])]}),_:1}),Array.isArray(r.value)&&0===r.value.length?(ta(),At(u,{key:0},{default:ga(()=>[jt(c,{disabled:!0,placeholder:ma(Rt)("sys.chooseText"),style:{flex:"1","min-width":"0"}},null,8,["placeholder"])]),_:1})):Nt("",!0),(ta(!0),Ut(Lt,null,sa(r.value,(t,a)=>(ta(),Ut(Lt,{key:a},[r.value.length>1&&a===r.value.length-1?(ta(),Ut("span",zd,ua(ma(Rt)("sys.webRender.to")),1)):Nt("",!0),t.isHide?(ta(),Ut("div",Hd)):(ta(),At(u,{key:2},{default:ga(()=>{var s,d,u,c,p;return[Pt("div",qd,[(ta(),At(da(l[null===(s=t[null===(d=e.data)||void 0===d||null===(d=d.rightValue)||void 0===d?void 0:d[a].valueType])||void 0===s?void 0:s.cmp]),qt({disabled:e.readonly,style:{width:"100%"},placeholder:ma(Rt)("sys.pleaseSelectSth"),value:b.value[a],bordered:""},{ref_for:!0},null===(u=t[null===(c=e.data)||void 0===c||null===(c=c.rightValue)||void 0===c?void 0:c[a].valueType])||void 0===u?void 0:u.attrs,{"filter-type":e.filterType,class:[e.readonly?"tree-action-select left-border":"",!e.hasPermScopeError||!T.value||b.value[a]&&(null===(p=b.value[a])||void 0===p?void 0:p.length)?"":"is-perm-scope-error"],onChange:e=>((e,t)=>{var a;const l=null===(a=i.data)||void 0===a||null===(a=a.rightValue)||void 0===a?void 0:a[t].valueType;let s;var r;s=h.value?l!==Td.FIXED||ka(e)?e:ll(e).format(o[m.value]):(null==e?void 0:e.target)?null===(r=e.target)||void 0===r?void 0:r.value:e,n(v.value,"rightValue",s,{index:t,key:"result"})})(e,a),"onUpdate:pageNo":e=>function(e){var t,a;const l=r.value[e];(null===(t=l[null==l||null===(a=l.typeKeys)||void 0===a?void 0:a[e]])||void 0===t||null===(t=t.attrs)||void 0===t||null===(t=t.apiParams)||void 0===t?void 0:t.pageNo)&&(r.value[e][r.value[e].typeKeys[e]].attrs.apiParams.pageNo=r.value[e][r.value[e].typeKeys[e]].attrs.apiParams.pageNo+1)}(a)}),null,16,["disabled","placeholder","value","filter-type","class","onChange","onUpdate:pageNo"]))])]}),_:2},1024))],64))),128)),Pt("div",Yd,[!e.readonly&&(e.selectFiledKeys&&e.selectFiledKeys.length>1||e.data.dataLen>1)?(ta(),At(p,{key:0,type:"link",size:"small",class:"ml-12px perm-action-delete",onClick:S},{icon:ga(()=>[...s[0]||(s[0]=[Pt("i",{class:"gct-iconfont icon-icon_shanchu"},null,-1)])]),_:1})):Nt("",!0)])])}}}),Wd=/* @__PURE__ */$e(Xd,[["__scopeId","data-v-a053095c"]]),Zd={key:1,class:"data-rules-header"},Jd=/* @__PURE__ */Kt({__name:"data-rules-container",props:{fieldList:{},detail:{},type:{},readonly:{type:Boolean},isDesign:{type:Boolean},mainModelKey:{},isPageDesigner:{type:Boolean},isOnlineFormDesigner:{type:Boolean},allowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},onlineFormFieldList:{},cascadeField:{type:Boolean},hasPermScopeError:{type:Boolean},searchType:{}},setup(e,{expose:t}){const a=e,{showDataRulesTree:l,editDataRulesTree:o,setTree:i,getDataRules:s,resetTree:n,getAllExpandedKeys:r,addNewRow:d}=Zr(a.readonly),u=oa(!1),c=oa([]),p=oa([]),v=Mt(()=>"filterConfig"===a.type),m=Mt(()=>"businessFlow"===a.type),h=Mt(()=>"edhrBuiltPerms"===a.type),y=Mt(()=>"permissionScope"===a.type),f=Mt(()=>a.readonly?l.value:o.value),g=Mt(()=>{var e;return m.value||h.value||y.value?a.fieldList:null===(e=a.fieldList)||void 0===e?void 0:e.filter(e=>Object.keys(a.searchType).includes(e.type))}),b=Mt(()=>{var e;return a.allowClear&&1==f.value.length&&1==(null===(e=f.value[0])||void 0===e||null===(e=e.children)||void 0===e?void 0:e.length)||a.allowClear&&y.value});function _(){a.detail&&(u.value=a.detail.dataRuleEnabled,i(a.detail.dataRuleConfig))}return ya(()=>a.detail,()=>{_()},{deep:!0}),ya(()=>f,()=>{const e=r();c.value=e.allExpandedKeys,p.value=e.selectFiledKeys},{deep:!0}),ya(()=>a.hasPermScopeError,e=>{var t;!a.readonly&&e&&(null===(t=o.value[0])||void 0===t||null===(t=t.children)||void 0===t||t.forEach(t=>{t.hasPermScopeError=e}))},{immediate:!0}),Qt(()=>{_()}),t({getDataRulesResult:()=>{var e;const t=s(a.type,a.mainModelKey);return{dataRuleEnabled:u.value,...t,operator:y.value?null===(e=f.value[0])||void 0===e?void 0:e.operatorType:void 0}},resetData:()=>{n()}}),(t,a)=>{const l=ra("a-tree"),o=ra("plus-outlined"),i=ra("a-button");return ta(),Ut("div",{class:Xt(["data-rules-container",y.value?"perm-scope-style":""])},[v.value||e.isDesign||m.value||h.value||y.value?e.readonly||e.isDesign||m.value||h.value||y.value?Nt("",!0):(ta(),Ut("div",Zd,ua(ma(Rt)("sys.model.viewFilterCondition")),1)):(ta(),At(Pr,{key:0,checked:u.value,"onUpdate:checked":a[0]||(a[0]=e=>u.value=e),title:ma(Rt)("sys.appDesigner.rulesGroup"),style:Wt(u.value?{borderBottom:"1px solid #eaeaea"}:{})},null,8,["checked","title","style"])),v.value||u.value||m.value||h.value||y.value?(ta(),At(l,{key:2,"expanded-keys":c.value,"onUpdate:expandedKeys":a[1]||(a[1]=e=>c.value=e),class:"data-rules-container-tree","tree-data":f.value,"default-expand-all":!0,"block-node":!0,selectable:!1,"show-line":{showLeafIcon:!1}},{title:ga(({data:t})=>{var a,l;return["group"===t.type?(ta(),Ut(Lt,{key:0},[y.value?(ta(),At(Gd,{key:1,id:t.key,data:t,"operator-type":t.operatorType,readonly:e.readonly},null,8,["id","data","operator-type","readonly"])):(ta(),At(ed,{key:0,id:t.key,level:t.level,data:t,"operator-type":t.operatorType,readonly:e.readonly},null,8,["id","level","data","operator-type","readonly"]))],64)):(ta(),Ut(Lt,{key:1},[y.value?(ta(),At(Wd,{key:1,data:t,"field-list":g.value,"select-filed-keys":p.value,"filter-type":e.type,readonly:e.readonly,"is-page-designer":e.isPageDesigner,"is-allow-clear":b.value,"exclude-value-type":e.excludeValueType,"exclude-operator-type":e.excludeOperatorType,"api-config":e.apiConfig,"model-name":null===(l=e.detail)||void 0===l?void 0:l.modelName,"cascade-field":e.cascadeField,"has-perm-scope-error":t.hasPermScopeError},null,8,["data","field-list","select-filed-keys","filter-type","readonly","is-page-designer","is-allow-clear","exclude-value-type","exclude-operator-type","api-config","model-name","cascade-field","has-perm-scope-error"])):(ta(),At(jd,{key:0,data:t,"field-list":g.value,"select-filed-keys":p.value,"filter-type":e.type,readonly:e.readonly,"main-model-key":e.mainModelKey,"online-form-field-list":e.onlineFormFieldList,"is-page-designer":e.isPageDesigner,"is-online-form-designer":e.isOnlineFormDesigner,"is-allow-clear":b.value,"exclude-value-type":e.excludeValueType,"exclude-operator-type":e.excludeOperatorType,"api-config":e.apiConfig,"model-name":null===(a=e.detail)||void 0===a?void 0:a.modelName,"cascade-field":e.cascadeField,"search-type":e.searchType},null,8,["data","field-list","select-filed-keys","filter-type","readonly","main-model-key","online-form-field-list","is-page-designer","is-online-form-designer","is-allow-clear","exclude-value-type","exclude-operator-type","api-config","model-name","cascade-field","search-type"]))],64))]}),_:1},8,["expanded-keys","tree-data"])):Nt("",!0),y.value?(ta(),At(i,{key:3,class:"perm-root-node-add-row",type:"link",onClick:a[2]||(a[2]=e=>(()=>{const e=f.value[0];d((null==e?void 0:e.key)||"root")})())},{default:ga(()=>[jt(o),Ft(" "+ua(ma(Rt)("sys.add")),1)]),_:1})):Nt("",!0)],2)}}}),Qd=Jd,eu={class:"field-role-container"},tu={key:0,class:"table-wrap"},au=/* @__PURE__ */Kt({__name:"field-role-container",props:{dataSource:{},detail:{}},setup(e,{expose:t}){const a=[{title:Rt("sys.appDesigner.field"),dataIndex:"name"}],l=e,o=oa(),i=oa(!1),s=oa({selectedRowKeys:[],onChange:function(e,t){s.value.selectedRowKeys=e,o.value=t}});return ya([()=>l.detail,()=>l.dataSource],()=>{var e,t;l.detail&&(i.value=l.detail.fieldPermissionEnabled,o.value=null===(e=l.dataSource)||void 0===e?void 0:e.filter(e=>l.detail.fieldPermission.includes(e.key)),s.value.selectedRowKeys=null===(t=o.value)||void 0===t?void 0:t.map(e=>e.key))},{deep:!0}),t({getFieldRoleResult:()=>{var e;return{fieldPermissionEnabled:i.value,selectRows:(null===(e=o.value)||void 0===e?void 0:e.map(e=>e.key))||[]}},resetData:()=>{o.value=void 0,i.value=!1,s.value.selectedRowKeys=[]}}),(t,l)=>{const o=ra("a-table");return ta(),Ut("div",eu,[jt(Pr,{checked:i.value,"onUpdate:checked":l[0]||(l[0]=e=>i.value=e),title:ma(Rt)("sys.appDesigner.fieldList")},null,8,["checked","title"]),i.value?(ta(),Ut("div",tu,[jt(o,{"data-source":e.dataSource,columns:a,"show-index-column":!1,pagination:!1,striped:!1,bordered:!0,"row-selection":s.value},null,8,["data-source","row-selection"])])):Nt("",!0)])}}}),lu=au,ou={mounted(e,t){var a;if(!t.value)return!1;null===(a=t.instance)||void 0===a||a.$nextTick(()=>{const a=t.value,l=e,o=document.createElement("div");l.appendChild(o),o.style.cursor="col-resize",o.style.position="absolute",o.style.height="100%",o.style.width="5px",o.style.right="0px",o.style.top="0px",o.style.background="rgba(255, 0, 0, 0);",o.onmousedown=t=>{const o=l.clientWidth,i=t.clientX;document.onmousemove=function(t){t.preventDefault();let s=o+(t.clientX-i);s=s<a?a:s,l.setAttribute("style",`width:${s}px !important;`);const n=new CustomEvent("drag-resize-width",{detail:{width:s,resizing:!0}});e.dispatchEvent(n)},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}})}},iu={mounted(e,t){e.__ellipsisHandler__=()=>{const a=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,l=t.value;a?e.setAttribute("title",l):e.removeAttribute("title")},e.addEventListener("mouseenter",e.__ellipsisHandler__)},beforeUnmount(e){e.__ellipsisHandler__&&e.removeEventListener("mouseenter",e.__ellipsisHandler__)}},su=/* @__PURE__ */$e(/* @__PURE__ */Kt({__name:"target-loading",props:{tip:{type:String,default:""},size:{type:String,default:yt.LARGE,validator:e=>[yt.DEFAULT,yt.SMALL,yt.LARGE].includes(e)},absolute:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},background:{type:String},theme:{type:String}},setup:e=>(t,a)=>ba((ta(),Ut("section",{class:Xt(["full-loading",{absolute:e.absolute,[e.theme]:!!e.theme}]),style:Wt([e.background?`background-color: ${e.background}`:""])},[jt(ma(Ja),qt(t.$attrs,{tip:e.tip,size:e.size,spinning:e.loading}),null,16,["tip","size","spinning"])],6)),[[ha,e.loading]])}),[["__scopeId","data-v-d448466c"]]),nu={mounted(e,t){const a=e.getAttribute("loading-tip"),l=e.getAttribute("loading-background"),o=e.getAttribute("loading-size"),i=!!t.modifiers.fullscreen;e.instance=function(e,t,a=!1){let l=null;const o=la({tip:"",loading:!0,...e});function i(e=document.body){l&&l.el&&e.appendChild(l.el)}return l=jt(Kt({render:()=>$t(su,{...o})})),a?setTimeout(()=>{ia(l,document.createElement("div"))},0):ia(l,document.createElement("div")),t&&i(t),{vm:l,close:function(){(null==l?void 0:l.el)&&l.el.parentNode&&l.el.parentNode.removeChild(l.el)},open:i,setTip:e=>{o.tip=e},setLoading:e=>{o.loading=e},get loading(){return o.loading},get $el(){return null==l?void 0:l.el}}}({tip:a,background:l,size:o||"large",loading:!!t.value,absolute:!i},i?document.body:e)},updated(e,t){const a=e.instance;var l;a&&(a.setTip(e.getAttribute("loading-tip")),t.oldValue!==t.value&&(null===(l=a.setLoading)||void 0===l||l.call(a,t.value&&!a.loading)))},unmounted(e){var t;null==e||null===(t=e.instance)||void 0===t||t.close()}};function ru(e){e.use(Va),function(e){!function(e){e.directive("dragResize",ou)}(e),function(e){e.directive("ellipsis-title",iu)}(e),function(e){e.directive("target-loading",nu)}(e)}(e),e.use(pe),Object.entries(sl).forEach(([t,a])=>{e.component(t,a)}),e.component(f.name,f),e.component(gn.name,gn),e.component("OverlayScrollbarsComponent",r),e.use(Ir),ol(e),e.use(As),e.use(un),e.use(W)}async function du(e){console.log("coreWebSetupApp")}_gct.message=new xe,_gct.openUtil=Ie,_gct.register.editor=new ao,_gct.register.formItem=new lo,_gct.register.tableEditor=new Ys;var uu=new URL("./index.min.css",import.meta.url);bt.load(uu.href);export{fe as BaseButton,I as BasicButton,W as BasicModal,he as BatchSelectList,xd as BoolOptions,ge as ButtonTextEnum,k as CONTENT_TYPE,cn as CategoryModal,yn as CategorySider,fd as Ch_FieldTypeName,$r as Ch_Operator,zr as Ch_Perm_Operator,wd as Ch_SystemVars,Cd as Ch_ValueType,M as CodeEditor,gn as ColorEditor,f as ColorPicker,Rd as ComponentTypeEnum,q as ControllerKey,Ln as CopperFreeModal,jn as CopperModal,H as CopyModuleKey,Gn as CropperAvatar,ir as CropperFree,xn as CropperImage,w as DATA_TYPE,Kr as DataRoleSetTabsEnum,Qd as DataRulesContainer,J as DataRulesModal,Br as DataTypeOptions,bd as DateSystemEnum,Ed as DateSystemKeys,P as DesignSaveTip,ce as DesignStepCheck,oe as DesignViewLayout,$ as DoubleInput,Pl as EditFormController,Fl as EditorController,ao as EditorRegister,_l as EditorRegisterConst,El as EditorType,wl as FORM_CONTROLLER_INJECT_TAG,ve as FieldCascader,lu as FieldRoleContainer,se as FieldUpload,Gl as FormCollapseController,Kl as FormCollapsePaneController,Rl as FormCollapsePaneState,Sl as FormCollapseState,ql as FormEditItemController,kl as FormEditItemState,Hl as FormGroupController,Dl as FormGroupState,Xl as FormHiddenItemController,jl as FormItemBasicController,Cl as FormItemBasicState,Yl as FormItemController,lo as FormItemRegister,Il as FormItemState,Wl as FormLineController,Ll as FormLineState,Tl as FormState,$l as FormTabController,zl as FormTabPaneController,Ol as FormTabPaneState,xl as FormTabState,F as FullScreen,bn as GCT_DND_INSERT_POS,wn as GctDndContainer,En as GctDndDropLine,_n as GctDndItem,yo as GctFormCollapseModel,po as GctFormCollapsePaneModel,Ul as GctFormController,_o as GctFormGroupModel,jo as GctFormHiddenItemModel,Bo as GctFormItemModel,Co as GctFormLineModel,Oo as GctFormTabModel,Mo as GctFormTabPaneModel,Vo as GctFormTitleGroupModel,zs as GctTableController,be as I18Modal,_e as I18nSelectBtn,ye as I18nSelectInput,D as I18nSelectInputForm,G as I18nSelectTextarea,z as I18nSelectTextareaForm,zn as ImagePreview,ee as ImageUpload,E as LabelDesignControlComps,C as LabelDesigner,c as LabelParamsSelect,We as Lang,xe as MessageUtil,Y as ModalNameEditor,Fr as ModalTypeEnum,fn as MonacoEditor,Od as MultiOperatorTypes,te as NumberRange,Gr as OperatorTypeEnum,Ge as OverlayController,s as PRINT_ELE_TYPE,K as PaasBpmnLog,Ye as Prop,j as QR_CODE_TYPE,Sd as RangTypeEnum,jr as RelationTypeEnum,L as SceneType,Vr as SearchTypeEnum,U as SelectUserModal,Q as SerialNumberContainer,V as ShrinkPanel,we as StageCanvas,v as StageView,js as TableActionItemController,Bs as TableEditItemController,Ps as TableEditItemState,Ys as TableEditorRegister,Us as TableITemState,Fs as TableItemController,$s as TableRowController,Vs as TableRowState,Ns as TableState,Xe as Theme,Z as TreeEx,me as TreeSelectEx,Me as UseDragByLine,d as UserPickType,gd as UserSystemEnum,_d as UserSystemKeys,Td as ValueTypeEnum,de as ViewContainer,ae as Vue3GridDndItem,N as WUJIE_FORMULA_EVENTS,Hr as calcTreeChildLevel,ru as coreWebCreateAppVue,du as coreWebSetupApp,Jn as createImgPreview,Yr as dropNode,Fe as filterTreeData,Ke as findRecursiveChild,qr as findTreePathById,B as gctFieldSortPopover,ie as gctFieldTreeSelect,to as gctFormItemEditorProps,Ad as getCmpConfig,le as getController,ne as getSpecificationsForSize,Al as getValue,Rr as labelTmplModal,p as loadLabelInfo,Oe as monacoLoader,Ee as openFormulaEditor,re as openSelectUserModal,Ie as overlay,Ue as recursiveIterate,ke as recursiveTransfer,m as setIdentify,Nl as setValue,h as sizeOpt,O as transformCoordinateByDpi,x as transformsize,qs as useAntTableScrollHeight,ue as useController,Vl as useEditFormController,u as useEditorConsole,_ as useEditorConsoleInner,Zl as useForm,Bl as useFormItemController,eo as useFormValue,Jl as useGctFormValue,Ql as useGctFormValueByText,A as useI18nSelect,Le as useKeyParser,S as useLabelModalPicker,Ve as useLocale,n as useModal,g as useModalContext,b as useModalDragMove,X as useModalInner,T as useModalPicker,y as usePage,Pe as usePrinter,R as useProp,Hs as useTableController,Be as useTheme,ze as useTreeList,qe as validateFieldDefaultForLength,De as validateFieldDefaultForValue,He as validateLengthRange,Ml as widthEditorInstall,je as withInstall};
|
|
1
|
+
/*! @gct-paas/core-web v0.1.6-dev.19 */
|
|
2
|
+
import{i as e}from"./chunk-C9ZKDnvz.js";import{t}from"./defineProperty-DiReHMuo.js";import{a,i as l,r as o,t as i}from"./diagram-config-item-virtual-Dw36zOeJ.js";import{A as s,B as n,C as r,Ct as d,D as u,Dt as c,E as p,Et as v,G as m,H as h,I as y,J as f,K as g,L as b,M as _,N as E,O as w,Ot as T,P as C,Q as R,R as S,S as x,St as O,T as k,Tt as D,U as I,V as L,W as M,X as A,Y as N,Z as U,_ as P,_t as V,a as F,at as j,b as B,bt as K,c as G,ct as $,d as z,dt as H,et as q,f as Y,ft as X,g as W,gt as Z,h as J,ht as Q,i as ee,it as te,j as ae,k as le,kt as oe,l as ie,lt as se,m as ne,mt as re,n as de,nt as ue,o as ce,ot as pe,p as ve,pt as me,r as he,rt as ye,s as fe,st as ge,t as be,tt as _e,u as Ee,ut as we,v as Te,vt as Ce,w as Re,wt as Se,x as xe,xt as Oe,y as ke,yt as De,z as Ie}from"./components-DtFY5KCF.js";import{C as Le,D as Me,F as Ae,N as Ne,S as Ue,_ as Pe,a as Ve,b as Fe,c as je,d as Be,f as Ke,g as Ge,h as $e,i as ze,l as He,m as qe,n as Ye,o as Xe,p as We,r as Ze,s as Je,t as Qe,u as et,x as tt,y as at}from"./_plugin-vue_export-helper-CyelNe0I.js";import{n as lt,r as ot,t as it}from"./useMonacoEditor-C3S2BSui.js";import{r as st,t as nt}from"./relationship-diagram-config-BwVOMUAb.js";import{i as rt,o as dt,r as ut,s as ct}from"./hooks-BuOffqGU.js";import{t as pt}from"./diagram-config-item-DYCiDqAy.js";import{t as vt}from"./diagram-config-item-reverse-BKf_yXvB.js";import{BasicAction as mt,CategoryModuleEnum as ht,EditorRegisterConst as yt,ExpressionModeEnum as ft,FIELD_TYPE as gt,FormContainerType as bt,FormDesignEnum as _t,PrintModeEnums as Et,PrintResourceEnum as wt,PrintTypeEnum as Tt,SEARCH_SERVICE as Ct,SizeEnum as Rt,TreeHelper as St,cacheFnReturn as xt,cssLoader as Ot,dataURLtoBlob as kt,fileUrlParser as Dt,getInterfaceApi as It,modelLoader as Lt,presetColor as Mt,t as At,transformUrl as Nt,useCopyToClipboard as Ut,useModal as Pt,useNamespace as Vt,useUUid as Ft,uuid2 as jt}from"@gct-paas/core";import{Fragment as Bt,computed as Kt,createBlock as Gt,createCommentVNode as $t,createElementBlock as zt,createElementVNode as Ht,createSlots as qt,createTextVNode as Yt,createVNode as Xt,defineAsyncComponent as Wt,defineComponent as Zt,getCurrentInstance as Jt,h as Qt,inject as ea,isVNode as ta,mergeProps as aa,nextTick as la,normalizeClass as oa,normalizeStyle as ia,onBeforeMount as sa,onBeforeUnmount as na,onMounted as ra,onUnmounted as da,openBlock as ua,provide as ca,reactive as pa,ref as va,render as ma,renderList as ha,renderSlot as ya,resolveComponent as fa,resolveDynamicComponent as ga,toDisplayString as ba,toRaw as _a,toRef as Ea,toRefs as wa,unref as Ta,vShow as Ca,watch as Ra,watchEffect as Sa,withCtx as xa,withDirectives as Oa,withKeys as ka,withModifiers as Da}from"vue";import{clone as Ia,cloneDeep as La,debounce as Ma,defaults as Aa,groupBy as Na,has as Ua,isBoolean as Pa,isEmpty as Va,isFunction as Fa,isNil as ja,isString as Ba,merge as Ka,omit as Ga,pick as $a,pickBy as za,throttle as Ha}from"lodash-es";import qa,{Checkbox as Ya,CheckboxGroup as Xa,Collapse as Wa,DatePicker as Za,Form as Ja,Image as Qa,Input as el,Modal as tl,Radio as al,RadioButton as ll,RadioGroup as ol,Select as il,Space as sl,Spin as nl,Tooltip as rl,TreeSelect as dl,Upload as ul,message as cl}from"ant-design-vue";import pl from"dayjs";import{coreComponentsCreateAppVue as vl}from"@gct-paas/core-components";import ml from"vuedraggable";import*as hl from"@ant-design/icons-vue";import{CloseOutlined as yl,DeleteOutlined as fl,EditOutlined as gl,ExclamationCircleOutlined as bl,EyeOutlined as _l,LeftOutlined as El,PlusOutlined as wl,ReloadOutlined as Tl,RightOutlined as Cl}from"@ant-design/icons-vue";import{VxeColumn as Rl,VxeTable as Sl}from"vxe-table";import{DotEndpoint as xl,FlowchartConnector as Ol}from"@jsplumb/browser-ui";var kl=/* @__PURE__ */function(e){return e.PREFIX="EDITOR___",e}({}),Dl=/* @__PURE__ */function(e){return e.LENGTH_UNIT="length-unit",e.COLOR="color",e.SPAN="span",e.TEXT="text",e.NUMBER="number",e.INFO="info",e.MSG="msg",e.SELECT="select",e.SELECT_GROUP="select-group",e.RADIO="radio",e.PICKER="picker",e.MULTIPLE_CHOICE="multiple-choice",e.I18N="i18n",e.TEXTAREA="textarea",e.DATE_RANGE="date-range",e.SWITCH="switch",e.CHECK_SWITCH="check-switch",e.ICON_SELECT="icon-select",e.CHECKBOX="checkbox",e.DATE="date",e.MODEL_SELECT="model-select",e.ACTION="action",e.TABLE="table",e.SELECT_TABLE="select-table",e.EMPTY="empty",e.FORM_MODEL_FIELD_SELECT="form-model-field-select",e.PIXEL_CONFIG="pixel-config",e.FIELD_INFO="field-info",e.DATE_FORMAT_SELECT="date-format-select",e.FORMULA="formula",e}({}),Il="formController",Ll=class{constructor(){t(this,"loaded",!1),t(this,"count",0),t(this,"isNew",!0),t(this,"loading",!1),t(this,"destroyed",!1),t(this,"data",{})}},Ml=class{constructor(){t(this,"disabled",!1),t(this,"readonly",!1),t(this,"visible",!0),t(this,"keepalive",!1),t(this,"destroyed",!1)}},Al=class extends Ml{},Nl=class extends Ml{},Ul=class extends Ml{constructor(...e){super(...e),t(this,"activePane","")}},Pl=class extends Ml{},Vl=class extends Ml{constructor(...e){super(...e),t(this,"label",""),t(this,"value",null),t(this,"options",[])}},Fl=class extends Ml{constructor(...e){super(...e),t(this,"expand",!0)}},jl=class extends Vl{},Bl=class extends Ml{};function Kl(e,t,a,l){return{install(o){e&&t&&_gct.register.editor.register(kl.PREFIX+e,t),a&&o.component(l??a.name,a)}}}function Gl(e,t){const a=e.split(".");try{return a.reduce((e,t)=>e[t],t)}catch(l){console.warn(l)}}function $l(e,t,a){const l=t.split("."),o=l.length-1;l.reduce((t,a,l)=>(l===o?t[a]=e:t[a]||(t[a]={}),t[a]),a)}var zl=class{constructor(e){t(this,"model",void 0),t(this,"evt",new a),t(this,"state",pa(new Ll)),t(this,"item",{}),t(this,"provider",{}),t(this,"context",{}),t(this,"params",{}),t(this,"fields",[]),t(this,"modelMap",{}),this.model=e,this.init()}init(){this.model.children&&this.initFormItems(this.model.children),this.initEvent(),this.calcState()}initEvent(){}calcState(){}initFormItems(e){e.forEach(e=>{let t=null;if("item"!==e.type&&"hidden"!==e.type||(this.fields.push(e.name),this.modelMap[e.name]=e),"item"===e.type&&(t=_gct.register.formItem.create(`${e.type}___${e.editor.type}___${e.name}`),t||(t=_gct.register.formItem.create(`${e.type}___${e.editor.type}`))),t||(t=_gct.register.formItem.create(e.type)),t){if(this.provider[e.name]=t,"item"===e.type){const a=e;this.item[a.name]=t.createController(this,a)}else if("hidden"===e.type){const a=e;this.item[a.name]=t.createController(this,a)}else if("container"===e.type||e.isContainer||e.container){const a=e;this.item[e.name]=t.createController(this,a),a.children&&this.initFormItems(a.children)}}else console.error(`未找到表单项提供者:${e.type}`,e)})}calcHidden(){Object.keys(this.item).forEach(e=>{const t=this.item[e];if(t.model.hidden){const e=t.model.hidden(this,t,this.state.data);null!=e&&(t.state.visible=!e)}})}getData(){const e={};return this.fields.forEach(t=>{const a=this.item[t];!a||!0!==a.state.visible&&"hidden"!==a.model.type&&-1===t.indexOf(".")||$l(a.value,a.key,e)}),e}resetData(){this.fields.forEach(e=>{const t=this.item[e];t&&t.reset()})}async load(){try{if(!this.model.loadRequest)return{};this.state.loading=!0;const e=await this.model.loadRequest({id:this.context.id});return this.fields.forEach(t=>{const a=this.item[t];a&&(a.value=e[a.key]),a.defaultValue()}),this.state.loaded=!0,e}finally{this.state.loading=!1}}destroy(){this.state.destroyed=!0,this.evt.reset(),this.fields.forEach(e=>{const t=this.item[e];t&&t.destroy()})}validate(){return Promise.resolve(!0)}validateItem(e){return Promise.resolve(!0)}loaded(){this.calcHidden(),this.fields.forEach(e=>{const t=this.item[e];t?t.defaultValue():console.warn(`表单项控制器未找到:${e}`)}),this.calcState()}mounted(){}},Hl=class extends zl{initEvent(){super.initEvent(),this.evt.on("change",(e,t,a)=>{if(this.model.watch){const l=this.model.watch[e];l&&l(this,t,a)}const l=this.item[e];l&&l.model.watch&&l.model.watch(this,l,t,a),l&&l.model.change&&l.model.change(this,l,this.state.data),t!=a&&this.calcHidden()})}save(){const e=this.getData();return!0===this.state.isNew&&this.model.newRequest?this.model.newRequest(e):this.model.updateRequest?this.model.updateRequest({id:this.context.id},e):Promise.resolve(e)}};function ql(e){const t=e();return t.state=pa(t.state),da(()=>t.destroy()),t}var Yl=class{constructor(e){t(this,"model",void 0),t(this,"options",[]),this.model=e,this.init()}init(){if(this.model.codeList)"static"===this.model.codeList.mode&&this.model.codeList.items&&(this.options=this.model.codeList.items);else if(this.model.codeTag){const e=_gct.dictionary.getConfig(this.model.codeTag);e&&"static"===e.mode&&(this.options=_gct.dictionary.get(this.model.codeTag))}}},Xl=class{get key(){return this.model.name}get data(){return this.form.state.data}constructor(e,a){t(this,"form",void 0),t(this,"model",void 0),t(this,"state",this.crateItemState()),this.form=e,this.model=a,this.init()}init(){}destroy(){this.state.destroyed=!0}defaultValue(){const e=this.form.state.data;null==Gl(this.key,e)&&null!=this.model.defaultValue&&$l(this.model.defaultValue,this.key,e)}crateItemState(){return new Ml}};function Wl(e){const t=e();return t.state=pa(t.state),t}var Zl=class extends Xl{constructor(...e){super(...e),t(this,"type","collapse-pane")}crateItemState(){return new Al}},Jl=class extends Xl{constructor(...e){super(...e),t(this,"type","collapse")}crateItemState(){return new Nl}},Ql=class extends Xl{constructor(...e){super(...e),t(this,"type","tab")}crateItemState(){return new Ul}},eo=class extends Xl{constructor(...e){super(...e),t(this,"type","tab-pane")}crateItemState(){return new Pl}},to=class extends Xl{constructor(...e){super(...e),t(this,"type","group")}crateItemState(){return new Fl}},ao=class extends Xl{get key(){return this.model.field??this.model.name}get value(){return Gl(this.key,this.form.state.data)}set value(e){const t=this.form.state.data,a=La(Gl(this.key,t));$l(e,this.key,t),this.form.evt.emit("change",this.key,e,a),this.state.value=e}get editorValue(){return this.model.fields?this.model.fields.map(e=>this.form.item[e].value):this.value}set editorValue(e){this.model.fields?this.model.fields.forEach((t,a)=>{this.form.item[t].value=null==e?void 0:e[a]}):this.value=e}init(){if(super.init(),"hidden"!==this.model.type){const{editor:e}=this.model;this.state.readonly=e.readonly,null!=e.disabled&&(this.state.disabled=e.disabled)}if(this.model.dictionary){const{mode:e}=this.model.dictionary;"static"===e&&(this.state.options=this.model.dictionary.items||[])}}blur(){null!=this.state.value&&""!==this.state.value||null==this.model.defaultValue||(this.value=this.model.defaultValue,this.form.evt.emit("blur",this.key,this.value))}reset(){void 0!==this.model.defaultValue?this.value=this.model.defaultValue:this.value=void 0}crateItemState(){return new Vl}},lo=class extends ao{constructor(...e){super(...e),t(this,"type","item")}async loadDictionary(e,t){if(this.state.options.length>0&&!0!==t)return this.state.options;this.state.options=[],this.state.loading=!0;try{return this.model.dictionary?this.state.options=await _gct.dictionary.asyncGetByConfig(this.model.dictionary,e):this.model.dictionaryTag&&(this.state.options=await _gct.dictionary.asyncGet(this.model.dictionaryTag,e)),this.state.options}finally{this.state.loading=!1}}clearDictionary(){this.state.options=[]}crateItemState(){return new jl}},oo=class extends Xl{constructor(...e){super(...e),t(this,"type","hidden")}},io=class extends Xl{constructor(...e){super(...e),t(this,"type","line")}crateItemState(){return new Bl}};function so(){return ea("formController")}function no(e){let t=null;if(e){const a=so().item[e];a&&(t=Kt({get:()=>a.value,set(e){"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||(a.value=e)}}))}else{let e=Jt().proxy;const a=e.$props,l=e.$emit;t=Kt({get:()=>a.value,set:e=>{"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||l("update:value",e)}}),e=null}return t}function ro(e,t){let a=Jt().proxy;const l=a.$props,o=a.$emit,i=e?e.length:0,s=t?t.length:0;return a=null,Kt({get:()=>{if(!l.value)return"";let a=l.value;return i>0&&a.startsWith(e)&&(a=a.substring(i)),s>0&&a.endsWith(t)&&(a=a.substring(0,a.length-s)),a},set:a=>{if(l.value===a)return;if(""==a)return void o("update:value","");let n=a;i>0&&(n=e+n),s>0&&(n+=t),o("update:value",n)}})}function uo(){let e=Jt().proxy;const t=e.$props,a=e.$emit,l=va(t.value);return Ra(()=>t.value,e=>{l.value!==e&&(l.value=e)}),Ra(l,(e,t)=>{t!==e&&a("update:value",e)}),e=null,l}function co(){return{context:{type:Object,default:()=>({})},value:{type:Object},model:{type:Object,required:!0},c:{type:Object,required:!0},itemModel:{type:Object},data:{type:Object},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},keepalive:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},size:{type:String},count:{type:Number,default:0},isEmptyText:{type:Boolean,default:!1}}}var po=class{constructor(){t(this,"editors",/* @__PURE__ */new Map),t(this,"providers",/* @__PURE__ */new Map)}register(e,t){this.editors.set(e,t)}unregister(e){this.editors.delete(e)}get(e){if(this.providers.has(e))return this.providers.get(e);const t=this.editors.get(e);if(t){const a=t();return this.providers.set(e,a),a}return null}},vo=class{constructor(){t(this,"items",/* @__PURE__ */new Map)}register(e,t){this.items.set(e,t)}unregister(e){this.items.delete(e)}create(e){const t=this.items.get(e);return t?t():null}},mo=/* @__PURE__ */Zt({name:"GctFormItem",props:{c:{type:Object,required:!0},formModel:{type:Object,required:!0},model:{type:Object,required:!0},count:{type:Number,default:0},context:{type:Object,default:()=>({})}},setup(e){const t=Vt("form-item"),a={};e.formModel.labelWidth&&(a[t.cssVarName("form-item-label-width")]=e.formModel.labelWidth),e.model.labelWidth&&(a[t.cssVarName("form-item-label-width")]=e.model.labelWidth),e.model.labelAlign&&(a[t.cssVarName("form-item-label-align")]=e.model.labelAlign),e.model.editorAlign&&(a[t.cssVarName("form-item-editor-align")]=e.model.editorAlign),e.model.width&&(a[t.cssVarName("form-item-width")]=e.model.width),e.model.margin&&(a.margin=e.model.margin),e.model.padding&&(a.padding=e.model.padding);const l=Kt(()=>{var t;return!!(null===(t=e.model.rules)||void 0===t?void 0:t.find(e=>e.required))});return{ns:t,style:a,required:l,renderLabelTooltip:()=>e.model.labelTooltip?Xt(fa("a-tooltip"),{class:t.e("label-tooltip"),overlayClassName:t.e("label-tooltip-overlay"),overlayStyle:{width:e.model.labelTipWidth},placement:"top",title:e.model.labelTooltip},{default:()=>[Xt("span",{class:"iconfont icon-assist ml5px text-[#bfbfbf]"},null)]}):null}},render(){const e=_gct.register.editor.get(yt.PREFIX+this.model.editor.type);if(!e)return console.error(`未找到表单项${this.model.name}的编辑器${this.model.editor.type}的适配器实例:`,this.model),null;const t=this.model.labelPosition||"left";let a=null;e?e.render?a=e.render(this.c.editorValue,this.c.data,this.model):e.component?a=Qt("string"==typeof e.component?fa(e.component):e.component,{key:this.model.name,c:this.c,value:this.c.editorValue,itemModel:this.model,model:this.model.editor,data:this.c.data,disabled:this.c.state.disabled,readonly:this.c.state.readonly,keepalive:this.c.state.keepalive,visible:this.c.state.visible,size:this.formModel.size,count:this.count,isEmptyText:this.formModel.isEmptyText,context:this.context,class:[this.ns.e("editor"),this.ns.e(t),this.formModel.size?this.ns.m(this.formModel.size):null,this.model.editor.class],style:this.model.editor.style,"onUpdate:value":e=>{this.c.editorValue=e},onBlur:()=>{this.c.blur()}}):console.error(`未找到编辑器绘制组件:${this.model.name} - ${this.model.editor.type},请实现 component 或 render 方法`):console.error(`未找到编辑器适配器:${this.model.name} - ${this.model.editor.type}`),this.model.label&&"top"===t&&(a=[Xt("div",{class:[this.ns.e("label"),this.ns.em("label",t)]},[this.model.label,this.renderLabelTooltip()]),a]);const l={default:()=>a};var o;return"left"===t&&this.model.label&&(l.label=()=>[Xt("span",null,[this.model.label]),this.renderLabelTooltip()]),!1!==this.c.state.visible?Xt(fa("a-form-item"),{key:this.c.model.name,count:this.count,colon:!0!==this.formModel.noColon&&!0!==this.model.noColon,name:this.model.name.split("."),label:void 0,class:[this.ns.b(),this.ns.is("readonly",!0===this.model.editor.readonly),this.ns.is("required",this.required),this.ns.is("hidden-label",!this.model.label),this.ns.m("label-"+t),this.ns.is("hidden-error",!0===this.model.hiddenError||!0===this.formModel.hiddenError)],style:this.style,rules:!0===this.c.state.visible?this.model.rules:[],layout:"horizontal"},"function"==typeof(o=l)||"[object Object]"===Object.prototype.toString.call(o)&&!ta(o)?l:{default:()=>[l]}):void 0}}),ho=/* @__PURE__ */Zt({name:"GctForm",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Vt("form");ca(Il,e.c);const a=va(),l=e.c;Object.keys(l.item).forEach(e=>{const t=l.item[e];t.state=pa(t.state)});const o=t=>Xt(fa("gct-form-item"),{class:t.class,style:t.style,count:l.state.count,c:l.item[t.name],formModel:e.model,model:t,context:e.context},null),i=t=>{const a=l.provider[t.name];return a?a?Qt("string"==typeof a.component?fa(a.component):a.component,{key:t.name,model:t,count:l.state.count,c:l.item[t.name],data:l.state.data,class:t.class,style:t.style,context:e.context},{default:()=>s(t.children||[])}):void console.error(`未找到表单容器适配器:${t.name} - ${t.type}`):(console.error(`未找到表单项适配器实例:${t.name}`,t),null)},s=e=>{if(!e)return[];const t=[];return e.forEach(e=>{if("hidden"===e.type)return null;let a=null;const l=e;a="container"===l.type||l.isContainer||l.container?i(l):o(e),a&&t.push(a)}),t},n={};return e.model.labelWidth&&(n[t.cssVarName("form-item-label-width")]=e.model.labelWidth),{ns:t,formRef:a,staticStyle:n,renderItem:o,renderContainer:i,renderChildren:s}},render(){let e;return Xt(fa("a-form"),{ref:"formRef",layout:this.model.layout,model:this.c.state.data,count:this.c.state.count,class:[this.ns.b(),this.ns.is("info",!0===this.model.info),this.model.size?this.ns.m(this.model.size):null],autocomplete:"off",style:this.staticStyle},"function"==typeof(t=e=this.model.children.map(e=>this.renderContainer(e)))||"[object Object]"===Object.prototype.toString.call(t)&&!ta(t)?e:{default:()=>[e]});var t}}),yo=class{constructor(){t(this,"component","gct-form-item")}createController(e,t){return Wl(()=>new lo(e,t))}},fo=class{constructor(){t(this,"component","gct-form-hidden-item")}createController(e,t){return Wl(()=>new oo(e,t))}},go=class{constructor(){t(this,"component","gct-form-collapse-pane")}createController(e,t){return Wl(()=>new Zl(e,t))}};function bo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var _o=/* @__PURE__ */Zt({name:"GctFormCollapsePane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Vt("form-collapse-pane"),a={};return e.model.width&&(a[t.cssVarName("form-collapse-pane-width")]=e.model.width),e.model.height&&(a[t.cssVarName("form-collapse-pane-height")]=e.model.height),{ns:t,style:a,renderContainer:function(t){return"flex"===e.model.layout?Xt(fa("flex-container"),{layout:e.model.flex},bo(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Xt(fa("grid-container"),{layout:e.model.grid},bo(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[],l=a[a.length-1];return l&&(l.props=aa(l.props||{},{class:this.ns.e("last-child")})),Xt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),Eo=class{constructor(e,a,l,o){t(this,"type","collapse-pane"),t(this,"isContainer",!0),t(this,"title",void 0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"collapsible",void 0),this.name=e,this.title=a,l&&Object.assign(this,l),o&&(this.children=o)}},wo={install(e){_gct.register.formItem.register("collapse-pane",()=>new go),e.component(_o.name,_o)}},To=class{constructor(){t(this,"component","gct-form-collapse")}createController(e,t){return Wl(()=>new Jl(e,t))}},Co=/* @__PURE__ */Zt({name:"GctFormCollapse",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){var t;const a=Vt("form-collapse"),l=va([0]),o={};e.model.width&&(o[a.cssVarName("form-collapse-width")]=e.model.width),e.model.height&&(o[a.cssVarName("form-collapse-height")]=e.model.height);const i=va([]);return i.value=(null===(t=e.model.children)||void 0===t?void 0:t.map(e=>e.name))||[],{ns:a,keys:l,style:o,activeKeys:i,expandIconPosition:Kt(()=>"left"===e.model.expandIconPosition?"left":"right")}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return Xt(Wa,{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.ns.m("icon-"+(this.model.expandIconStyle||"up-down"))],style:this.style,accordion:this.model.accordion,expandIconPosition:this.expandIconPosition,activeKey:this.activeKeys,"onUpdate:activeKey":e=>this.activeKeys=e},{default:()=>{var e;return[null===(e=this.model.children)||void 0===e?void 0:e.map((e,t)=>{if(!1===a[t].props.c.state.visible)return;const l=!1!==e.collapsible?void 0:"disabled";return Xt(Wa.Panel,{key:e.name,header:e.title,collapsible:l},{default:()=>[a[t]]})})]}})}}),Ro=class{constructor(e,a,l){t(this,"type","collapse"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"accordion",void 0),t(this,"expandIconPosition",void 0),t(this,"expandIconStyle",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},So={install(e){_gct.register.formItem.register("collapse",()=>new To),e.component(Co.name,Co)}},xo=class{constructor(){t(this,"component","gct-form-group")}createController(e,t){return Wl(()=>new to(e,t))}},Oo=/* @__PURE__ */Zt({name:"GctFormGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e,{slots:t}){const a=Vt("form-group"),l=va([0]);function o(){return"flex"===e.model.layout?Xt(fa("flex-container"),{layout:e.model.flex},{default:()=>{var e;return null===(e=t.default)||void 0===e?void 0:e.call(t)}}):"grid"===e.model.layout?Xt(fa("grid-container"),{layout:e.model.grid},{default:()=>{var e;return null===(e=t.default)||void 0===e?void 0:e.call(t)}}):void console.error("不支持的layout类型"+e.model.layout)}const i={};return e.model.width&&(i[a.cssVarName("form-group-width")]=e.model.width),e.model.height&&(i[a.cssVarName("form-group-height")]=e.model.height),()=>{if(!0!==e.c.state.keepalive&&!1===e.c.state.visible)return null;if(e.model.isCollapse){let t;return Xt(fa("a-collapse"),{activeKey:l.value,"onUpdate:activeKey":e=>l.value=e,class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible)],style:i,ghost:!0},{default:()=>{return[Xt(fa("a-collapse-panel"),{key:"0",header:e.model.title},(a=t=o(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!ta(a)?t:{default:()=>[t]}))];var a}})}return Xt("div",{class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible),e.model.class],style:i},[!1===e.model.showHeader?Xt("div",{class:a.e("title")},[e.model.title]):null,Xt("div",{class:a.e("content")},[o()])])}}}),ko=class{constructor(e,a,l){t(this,"type","group"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"title",void 0),t(this,"showHeader",void 0),t(this,"isCollapse",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},Do={install(e){_gct.register.formItem.register("container",()=>new xo),e.component(Oo.name,Oo)}},Io=class{constructor(){t(this,"component","gct-form-line")}createController(e,t){return Wl(()=>new io(e,t))}},Lo=/* @__PURE__ */Zt({name:"GctFormLine",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup:e=>({ns:Vt("form-line"),style:Kt(()=>{const{paddingTop:t,paddingBottom:a}=e.model;return{paddingTop:t,paddingBottom:a}})}),render(){return Xt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[Xt("div",{class:this.ns.e("line")},null)])}}),Mo=class{constructor(e,a={}){t(this,"type","line"),t(this,"layout","grid"),t(this,"name",""),t(this,"isContainer",!0),this.name=e,Object.assign(this,a)}},Ao={install(e){_gct.register.formItem.register("line",()=>new Io),e.component(Lo.name,Lo)}},No=class{constructor(){t(this,"component","gct-form-tab")}createController(e,t){return Wl(()=>new Ql(e,t))}},Uo=/* @__PURE__ */Zt({name:"GctFormTab",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Vt("form-tab"),a=so(),l={};return e.model.width&&(l[t.cssVarName("form-tab-width")]=e.model.width),e.model.height&&(l[t.cssVarName("form-tab-height")]=e.model.height),Ra(e.c.state,()=>{a.evt.emit("changeState",e.c.model.name,e.c)}),ra(()=>{var t;const a=(null===(t=e.model.children)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.name)||"";e.c.state.activePane=a}),{ns:t,style:l}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return Xt(fa("a-tabs"),{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.ns.m(this.model.navPosition||"left")],style:this.style,activeKey:this.c.state.activePane,"onUpdate:activeKey":e=>this.c.state.activePane=e},{default:()=>{var e;return[null===(e=this.model.children)||void 0===e?void 0:e.map((e,t)=>Xt(fa("a-tab-pane"),{key:e.name,tab:e.title},{default:()=>[a[t]]}))]}})}}),Po=class{constructor(e,a,l){t(this,"type","tab"),t(this,"isContainer",!0),t(this,"children",[]),t(this,"layout","grid"),t(this,"navPosition","center"),t(this,"name",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},Vo={install(e){_gct.register.formItem.register("tab",()=>new No),e.component(Uo.name,Uo)}},Fo=class{constructor(){t(this,"component","gct-form-tab-pane")}createController(e,t){return Wl(()=>new eo(e,t))}};function jo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var Bo=/* @__PURE__ */Zt({name:"GctFormTabPane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Vt("form-tab-pane"),a={};return e.model.width&&(a[t.cssVarName("form-tab-pane-width")]=e.model.width),e.model.height&&(a[t.cssVarName("form-tab-pane-height")]=e.model.height),{ns:t,style:a,renderContainer:function(t){return"flex"===e.model.layout?Xt(fa("flex-container"),{layout:e.model.flex},jo(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Xt(fa("grid-container"),{layout:e.model.grid},jo(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return Xt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),Ko=class{constructor(e,a,l,o){t(this,"type","tab-pane"),t(this,"isContainer",!0),t(this,"title",void 0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),this.name=e,this.title=a,l&&Object.assign(this,l),o&&(this.children=o)}},Go={install(e){_gct.register.formItem.register("tab-pane",()=>new Fo),e.component(Bo.name,Bo)}},$o=class{constructor(){t(this,"component","gct-form-title-group")}createController(e,t){return Wl(()=>new to(e,t))}};function zo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var Ho=/* @__PURE__ */Zt({name:"GctFormTitleGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0}},setup(e){const t=Vt("form-title-group"),a=va([0]),l={};return e.model.width&&(l[t.cssVarName("form-title-group-width")]=e.model.width),e.model.height&&(l[t.cssVarName("form-title-group-height")]=e.model.height),{ns:t,keys:a,style:l,renderContainer:function(t){return"flex"===e.model.layout?Xt(fa("flex-container"),{layout:e.model.flex},zo(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Xt(fa("grid-container"),{layout:e.model.grid},zo(t)?t:{default:()=>[t]}):void console.error("不支持的layout类型"+e.model.layout)}}},render(){var e,t;if(!0!==this.c.state.keepalive&&!1===this.c.state.visible)return null;const a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return Xt("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.model.class],style:this.style},[Xt("div",{class:this.ns.e("title")},[this.model.title]),Xt("div",{class:this.ns.e("content")},[this.renderContainer(a)])])}}),qo=class{constructor(e,a,l){t(this,"type","group"),t(this,"isContainer",!0),t(this,"layout","grid"),t(this,"children",[]),t(this,"name",void 0),t(this,"title",void 0),t(this,"showHeader",void 0),t(this,"isCollapse",void 0),this.name=e,a&&Object.assign(this,a),l&&(this.children=l)}},Yo={install(e){_gct.register.formItem.register(bt.FORM_TITLE_GROUP,()=>new $o),e.component(Ho.name,Ho)}},Xo=class{constructor(e,a){t(this,"type","hidden"),t(this,"name",void 0),t(this,"field",void 0),t(this,"defaultValue",void 0),t(this,"editor",void 0),this.name=e,a&&Object.assign(this,a)}},Wo=class{constructor(e,a,l,o){t(this,"type","item"),t(this,"name",void 0),t(this,"editor",void 0),t(this,"label",void 0),t(this,"rules",void 0),this.name=e,a&&(this.label=a),l&&Object.assign(this,l),this.editor=o}},Zo={install(e){_gct.register.formItem.register("item",()=>new yo),_gct.register.formItem.register("hidden",()=>new fo),e.use(wo),e.use(So),e.use(Do),e.use(Ao),e.use(Vo),e.use(Go),e.use(Yo),e.component(ho.name,ho),e.component(mo.name,mo)}},Jo=/* @__PURE__ */Zt({name:"FlexItem",props:{layout:Object},setup:e=>({ns:Vt("flex-item"),getStyle:()=>{const t={};if(e.layout){const{order:a,alignSelf:l,flexBasis:o,flexGrow:i,flexShrink:s}=e.layout;null!=a&&(t.order=a),null!=l&&(t["align-self"]=l),null!=o&&(t["flex-basis"]=o),null!=i&&(t["flex-grow"]=i),null!=s&&(t["flex-shrink"]=s)}return t}}),render(){var e,t;return Xt("div",{class:this.ns.b(),style:this.getStyle()},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)])}}),Qo=/* @__PURE__ */Zt({name:"FlexContainer",props:{layout:Object},setup:e=>({ns:Vt("flex-container"),getStyle:()=>{const t={};if(e.layout){const{alignContent:a,alignItems:l,flexDirection:o,flexWrap:i,justifyContent:s}=e.layout;null!=a&&(t.alignContent=a),null!=l&&(t.alignItems=l),null!=o&&(t.flexDirection=o),null!=i&&(t.flexWrap=i),null!=s&&(t.justifyContent=s)}return t},getItemStyle:e=>{const t={};if(e){const{width:a,height:l}=e;null!=a&&(t.width=a),null!=l&&(t.height=l)}return t}}),render(){var e,t;let a=(null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t))||[];return a.length>0&&(a=a[0].children||[]),Xt("div",{class:this.ns.b(),style:this.getStyle()},[a.map(e=>{if(!e)return null;const t=e.props.model.flexItem;return Xt(Jo,{layout:t,style:this.getItemStyle(e.props.model)},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!ta(a)?e:{default:()=>[e]});var a})])}});function ei(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var ti=/* @__PURE__ */Zt({name:"GridContainer",props:{layout:Object},setup(e,{slots:t}){const a=Vt("grid-container");return()=>{var l;let o;const i=e.layout||{};let s=(null===(l=t.default)||void 0===l?void 0:l.call(t))||[];return s.length>0&&(s=s[0].children||[]),Xt(fa("a-row"),{class:a.b(),wrap:!0,gutter:i.gutter},ei(o=s.map(e=>{if(!e)return null;const t=e.props.model.gridItem;return Xt(fa("a-col"),{span:t?t.span??24:24,offset:t?t.offset??0:0},ei(e)?e:{default:()=>[e]})}))?o:{default:()=>[o]})}}}),ai=/* @__PURE__ */Zt({name:"GctFormAction",props:{c:{type:Object,required:!0},data:{type:Object,required:!0},model:{type:Object,required:!0},size:{type:String}},setup(e){const t=Vt("gct-form-action"),a=so();return{ns:t,onClick:function(t){t.stopPropagation(),e.model.click&&e.model.click(t,a,e.c,e.data)}}},render(){return Xt(fa("a-button"),aa({class:this.ns.b(),onClick:this.onClick,size:this.size,type:"link"},this.model.props||{}),{default:()=>[this.model.label]})}}),li=class{constructor(){t(this,"component","gct-form-action")}},oi=Kl(Dl.ACTION,()=>new li,ai);function ii(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var si=/* @__PURE__ */Zt({name:"GctFormDateFormatSelect",props:co(),setup(e){var t;const a=Vt("form-date-format-select"),l=Kt(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.fieldTypeKey)||"type"]}),o=Kt(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.mappingTypeKey)||"mapping_type"]}),i=no((null===(t=e.model)||void 0===t?void 0:t.separatorKey)||"separator"),s=[{label:"-",value:"-"},{label:"/",value:"/"},{label:"·",value:"."}],n=no(),r=Kt(()=>l.value===gt.DATE_TIME||o.value===gt.DATE_TIME?[{label:`yyyy${i.value}MM${i.value}dd HH`,value:`YYYY${i.value}MM${i.value}DD HH`},{label:`yyyy${i.value}MM${i.value}dd HH:mm`,value:`YYYY${i.value}MM${i.value}DD HH:mm`},{label:`yyyy${i.value}MM${i.value}dd HH:mm:ss`,value:`YYYY${i.value}MM${i.value}DD HH:mm:ss`}]:l.value===gt.DATE||o.value===gt.DATE?[{label:"yyyy",value:"YYYY"},{label:`yyyy${i.value}MM`,value:`YYYY${i.value}MM`},{label:`yyyy${i.value}MM${i.value}dd`,value:`YYYY${i.value}MM${i.value}DD`}]:[]);return Ra(i,()=>{l.value!==gt.DATE_TIME&&o.value!==gt.DATE_TIME?l.value!==gt.DATE&&o.value!==gt.DATE?n.value="":n.value=`YYYY${i.value}MM${i.value}DD`:n.value=`YYYY${i.value}MM${i.value}DD HH:mm:ss`}),()=>{var t,l;let o,d;return Xt("div",{class:a.b()},[Xt("span",{class:a.e("first")},[Xt(fa("a-select"),aa({value:i.value,"onUpdate:value":e=>i.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||At("sys.chooseText")},(null===(t=e.model)||void 0===t?void 0:t.props)||{}),ii(o=s.map(e=>Xt(fa("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?o:{default:()=>[o]})]),Xt("span",{class:a.e("second")},[Xt(fa("a-select"),aa({value:n.value,"onUpdate:value":e=>n.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||At("sys.chooseText")},(null===(l=e.model)||void 0===l?void 0:l.props)||{}),ii(d=r.value.map(e=>Xt(fa("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?d:{default:()=>[d]})])])}}}),ni=class{constructor(){t(this,"component","gct-form-date-format-select")}},ri=Kl(Dl.DATE_FORMAT_SELECT,()=>new ni,si),di=/* @__PURE__ */Zt({name:"GctFormLengthUnit",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup:()=>({ns:Vt("form-length-unit"),val:no()}),render(){return Xt(fa("length-unit-editor"),aa({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("readonly",this.model.readonly)]}),null)}}),ui=class{constructor(){t(this,"component","gct-form-length-unit")}},ci=Kl(Dl.LENGTH_UNIT,()=>new ui,di),pi=/* @__PURE__ */Zt({name:"GctFormColor",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup(e){const t=Vt("form-color"),a=no();return console.debug("GctFormColor props",e),()=>Xt(fa("color-editor"),aa({value:a.value,"onUpdate:value":e=>a.value=e},e.model.props||{},{class:[t.b(),t.is("readonly",e.model.readonly)]}),null)}}),vi=class{constructor(){t(this,"component","gct-form-color")}},mi=Kl(Dl.COLOR,()=>new vi,pi),hi=class{constructor(){t(this,"component","gct-form-date")}},yi=/* @__PURE__ */Zt({name:"GctFormDate",props:{model:{type:Object,required:!0},value:{type:String,default:""},isDate:{type:Boolean,default:!0},isTime:{type:Boolean,default:!1}},emits:["update:value"],setup(e){const t=Vt("gct-form-date"),a=new Yl(e.model),l=no(),o=va(l.value?pl(l.value):null),i=va(l.value?pl(l.value):null);return{ns:t,c:a,dateVal:o,timeVal:i,onChange:()=>{let e="";o.value&&(e=o.value.format("YYYY-MM-DD")),i.value?e+=` ${i.value.format("HH:mm:ss")}`:e+=" 00:00:00",l.value=e}}},render(){return Xt("div",{class:[this.ns.b()]},[this.isDate?Xt(fa("a-date-picker"),aa({picker:"date",value:this.dateVal,"onUpdate:value":e=>this.dateVal=e,format:"YYYY-MM-DD"},this.model.props||{},{placeholder:"请选择日期",onChange:this.onChange}),null):null,this.isTime?Xt(fa("a-time-picker"),{value:this.timeVal,"onUpdate:value":e=>this.timeVal=e,placeholder:"请选择时间",onChange:this.onChange},null):null])}}),fi=Kl(Dl.DATE,()=>new hi,yi),gi=/* @__PURE__ */Zt({name:"GctFormFormula",props:{c:{type:Object,required:!0},itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup(e){const t=Vt("form-formula"),a=so(),l=va(),o=no(),i=no("expressionEcho"),s=async()=>{const t=await T({expr:o.value.expr,exprEcho:null==i?void 0:i.value,returnType:o.value.mappingType||"string",mode:ft.DATA_SET_FORMULA,identifiers:{},...e.model.config||{}});t&&(o.value={expr:t.expr,mappingType:t.returnType},i&&(i.value=t.exprEcho),a.validateItem(e.itemModel.name))};return()=>Xt("div",{class:t.b(),onClick:s},[Xt(fa("a-input"),{ref:l,class:t.e("input"),readonly:!0,value:(null==i?void 0:i.value)||o.value,placeholder:At("sys.inputText")},null)])}}),bi=class{constructor(){t(this,"component","gct-form-formula")}},_i=Kl(Dl.FORMULA,()=>new bi,gi),Ei=class{constructor(){t(this,"component","gct-form-check-switch")}},wi=/* @__PURE__ */Zt({name:"GctFormCheckSwitch",props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:Boolean,default:!1},size:{type:String}},emits:["update:value"],setup:()=>({ns:Vt("gct-form-check-switch"),val:no()}),render(){return this.model.isSwitch?Xt("div",{class:[this.ns.b(),this.ns.m("switch"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]},[Xt(fa("a-switch"),aa({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)]):Xt(fa("a-checkbox"),aa({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{},{class:[this.ns.b(),this.ns.m("checkbox"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]}),{default:()=>[this.model.label]})}}),Ti=Kl(Dl.CHECK_SWITCH,()=>new Ei,wi);function Ci(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var Ri=/* @__PURE__ */Zt({name:"GctFormSelectGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e,{emit:t}){const a=Vt("form-select-group"),l=ea("formController"),o=va(""),i=va(null),s=va(!1),n=va(/* @__PURE__ */new Set),r=Kt({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}});function d(e,t){return e.className.indexOf(t)>-1?e:e.parentElement?d(e.parentElement,t):null}function u(e){var t;d(e.target,"ant-select-dropdown")||null===(t=i.value)||void 0===t||t.blur()}window.addEventListener("wheel",u);const c=va(),p=Kt({get:()=>!e.c.state.options.find(t=>t.value===e.value)&&r.value?r.value:e.value||void 0,set:e=>{if(!e)return t("update:value",void 0),void(r.value="");"string"==typeof e&&(e=e.trim()),t("update:value",e);let a=null;v.value.find(t=>(t.options&&(a=t.options.find(t=>t.value==e)),!!a)),a&&(r.value=a.label)}}),v=Kt(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:[]),m=async()=>e.c.loadDictionary();return null!=p.value&&m(),da(()=>{window.removeEventListener("wheel",u)}),{ns:a,selectRef:i,searchValue:o,open:s,rootRef:c,val:p,options:v,loadOptions:m,toggleGroupCollapse:t=>{e.model.groupCollapsible&&(n.value.has(t)?n.value.delete(t):n.value.add(t))},isGroupCollapsed:t=>!0!==e.model.groupCollapsible||!n.value.has(t)}},render(){let e;return Xt("div",{ref:"rootRef",class:this.ns.b()},[Xt(fa("a-select"),{ref:"selectRef",open:this.open,value:this.val,"onUpdate:value":e=>this.val=e,allowClear:!0,disabled:this.c.state.disabled,size:this.size,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,"show-search":!0,"filter-option":()=>!0,searchValue:this.searchValue,onSearch:e=>this.searchValue=null==e?void 0:e.trim(),onFocus:()=>this.open=!0,onBlur:()=>this.open=!1,onChange:()=>this.open=!1},Ci(e=this.options.map(e=>{let t;const a=null!=e.label?e.label:" ",l=String(e.value),o=this.isGroupCollapsed(l),i=(o&&e.options||[]).filter(e=>!this.searchValue||e.label.toLowerCase().indexOf(this.searchValue.toLowerCase())>=0);return 0===i.length?null:Xt(fa("a-select-opt-group"),{key:e.value,label:Xt("div",{class:[this.ns.b("group-header"),this.model.groupCollapsible?this.ns.b("group-header--clickable"):""],onClick:()=>this.toggleGroupCollapse(l)},[this.model.groupCollapsible&&Xt("span",{class:[this.ns.be("group-header","arrow"),o?this.ns.bem("group-header","arrow","collapsed"):""]},[Xt("i",{class:["iconfont",1!=o?"icon-right":"icon-Down"]},null)]),Xt("span",{class:this.ns.be("group-header","title")},[a])])},Ci(t=i.map(e=>Xt(fa("a-select-option"),{class:this.ns.b("item-option"),key:e.value,value:e.value},{default:()=>[e.icon?Xt("span",{class:this.ns.be("item-option","item-icon")},[Xt("i",{class:`iconfont ${e.icon}`},null)]):"",Xt("span",{class:this.ns.be("item-option","item-label")},[e.label])]})))?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}}),Si=class{constructor(){t(this,"component","gct-form-select-group")}},xi=Kl(Dl.SELECT_GROUP,()=>new Si,Ri),Oi=class{constructor(){t(this,"component","gct-form-i18n")}},ki=/* @__PURE__ */Zt({name:"GctFormI18n",props:co(),emits:["update:value","blur"],setup(e,{emit:t}){var a;const l=Vt("form-i18n"),o=so(),i=va({}),s=va(!1),n=o.item[(null===(a=e.model)||void 0===a?void 0:a.cfgKey)||"i18nConfig"];n||console.warn("i18nConfig not found in form item, please ensure that the model has a valid cfgKey or i18nConfig is defined in the form.");const r=Kt(()=>{var t,a;return(null===(t=e.data)||void 0===t?void 0:t[(null===(a=e.model)||void 0===a?void 0:a.fieldKey)||"fieldKey"])||null});r.value&&async function(){var t;const a=await Lt.loadField((null===(t=e.data)||void 0===t?void 0:t.modelKey)||e.context.modelKey,r.value);a&&(i.value=a)}();const d=Kt({get:()=>e.value?e.value:!0===s.value?"":i.value.name,set:a=>{"string"==typeof a&&(a=a.trim()),s.value=!0,"object"!=typeof a&&e.value==a||(a||(u.value=""),t("update:value",a))}}),u=Kt({get:()=>n?{i18nKey:n.value}:"",set:e=>{if(n)try{n.value=JSON.parse(e).i18nKey}catch(t){console.error(t)}}});return{ns:l,val:d,i18nConfigValue:u,onBlur:function(){s.value=!1}}},render(){var e;return Xt(fa("i18n-select-input"),aa({class:[this.ns.b(),this.ns.m(this.size)],i18nText:this.val,"onUpdate:i18nText":e=>this.val=e,i18nConfig:this.i18nConfigValue,"onUpdate:i18nConfig":e=>this.i18nConfigValue=e,placeholderText:this.model.placeholder||At("sys.inputText"),attr:"i18nKey",btnHeight:"small"===this.size?"26px":void 0,inputExtraProps:{showCount:!0,maxlength:this.model.max||32,disabled:this.c.state.disabled},onBlur:e=>{this.onBlur(),this.$emit("blur",e)},size:this.size},(null===(e=this.model)||void 0===e?void 0:e.props)||{}),null)}}),Di=Kl(Dl.I18N,()=>new Oi,ki),Ii=/* @__PURE__ */Zt({name:"GctFormIconSelect",props:{value:{type:Object},model:{type:Object,required:!0}},emits:["update:value"],setup(e,{emit:t}){var a,l,o;const i=Vt("gct-form-icon-select"),s=va(e.value),n=va((null===(a=s.value)||void 0===a?void 0:a.icon)||e.model.defaultIcon),r=va((null===(l=s.value)||void 0===l?void 0:l.color)||e.model.defaultColor),d=va((null===(o=s.value)||void 0===o?void 0:o.background)||e.model.defaultBackground);return Ra(()=>e.value,e=>{s.value=e,e&&(n.value=e.icon,r.value=e.color)}),Ra([n,r,d],()=>{s.value={icon:n.value,color:r.value},t("update:value",s.value)}),{ns:i,icon:n,color:r,background:d,nextPickerStyle:Kt(()=>{if(e.model.size)return{"--box-size":e.model.size+"px"}})}},render(){return Xt("div",{class:this.ns.b()},[Xt(fa("icon-next-picker"),{value:this.icon,"onUpdate:value":e=>this.icon=e,color:this.color,"onUpdate:color":e=>this.color=e,background:"#f5f5f5",disabled:this.model.disabled,showColor:!1!==this.model.showColor,style:this.nextPickerStyle},null),this.model.label?Xt("span",{class:this.ns.e("title")},[this.model.label]):null])}}),Li=class{constructor(){t(this,"component","gct-form-icon-select")}},Mi=Kl(Dl.ICON_SELECT,()=>new Li,Ii),Ai=class{constructor(){t(this,"component","gct-form-number")}},Ni=/* @__PURE__ */Zt({name:"GctFormNumber",props:{model:{type:Object,required:!0},value:{type:String,default:""}},emits:["update:value"],setup:()=>({ns:Vt("gct-form-number"),val:no()}),render(){return Xt(fa("a-input-number"),aa({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.model.class],prefix:this.model.prefix,suffix:this.model.suffix,addonBefore:this.model.addonBefore,addonAfter:this.model.addonAfter,placeholder:this.model.placeholder,max:this.model.max,min:this.model.min,precision:this.model.precision}),null)}}),Ui=Kl(Dl.NUMBER,()=>new Ai,Ni),Pi=class{constructor(){t(this,"component","gct-form-picker")}},Vi=/* @__PURE__ */Zt({name:"GctFormPicker",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(e,{emit:t}){const a=Vt("gct-form-picker"),l=so(),o=Kt({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}}),i=Kt({get:()=>!e.c.state.options.find(t=>t.value===e.value)&&o.value?o.value:e.value,set:a=>{if("string"==typeof a&&(a=a.trim()),"object"!=typeof a&&e.value==a)return;const o=e.c.state.options.find(e=>e.value===a);o&&o.data&&e.model.fieldMap&&e.model.fieldMap.map(e=>{const[t,a]=e.split(":");a&&(l.item[a].editorValue=o.data[t])}),t("update:value",a)}});return null!=i.value&&e.c.loadDictionary(),{ns:a,val:i,nameVal:o,loadOptions:()=>e.c.loadDictionary(),onChange:(e,t)=>{o.value=t.label}}},render(){return Xt(fa("a-select"),aa({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:this.ns.b(),disabled:this.c.state.disabled,loading:this.c.state.loading,options:this.c.state.options,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,onChange:this.onChange,"show-search":!0,"filter-option":(e,t)=>!!t.label&&t.label.toLowerCase().indexOf(e.toLowerCase())>=0}),null)}}),Fi=Kl(Dl.PICKER,()=>new Pi,Vi),ji=/* @__PURE__ */Zt({name:"GctFormPixelConfig",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup(){const e=Vt("form-pixel-config"),t=no("label_mode"),a=no(),l=[{label:"百分比",value:"percent"},{label:"固定",value:"fixed"}],o=Kt(()=>"fixed"===t.value?"px":"%");function i(e){t.value=e,a.value="fixed"===e?100:30}return()=>Xt(fa("a-input-group"),{compact:!0,class:e.b()},{default:()=>[Xt(fa("a-select"),{class:e.e("select"),value:t.value,"onUpdate:value":e=>t.value=e,options:l,onChange:i},null),Xt(fa("a-input-number"),{class:e.e("input"),value:a.value,"onUpdate:value":e=>a.value=e,min:0,placeholder:"请输入",size:"small",max:"fixed"===t.value?500:100,addonAfter:o.value},null)]})}}),Bi=class{constructor(){t(this,"component","gct-form-pixel-config")}},Ki=Kl(Dl.PIXEL_CONFIG,()=>new Bi,ji),Gi=class{constructor(){t(this,"component","gct-form-select")}},$i=/* @__PURE__ */Zt({name:"GctFormSelect",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=Vt("gct-form-select"),a=va();Le(a,()=>{var e;l.value=!1,null===(e=a.value)||void 0===e||e.blur()});const l=va(!1);function o(e,t){var a;return(null===(a=e.className)||void 0===a?void 0:a.indexOf(t))>-1?e:e.parentElement?o(e.parentElement,t):null}function i(e){var t;o(e.target,"ant-select-dropdown")||null===(t=a.value)||void 0===t||t.blur()}window.addEventListener("wheel",i);const s=va(),n=new Yl(e.model),r=no(),d=Kt({get:()=>null!=r.value?r.value:void 0,set(e){r.value=e}}),u=Kt(()=>{var t,a;return(null===(t=e.c)||void 0===t||null===(t=t.state)||void 0===t?void 0:t.options)&&(null===(a=e.c)||void 0===a||null===(a=a.state)||void 0===a||null===(a=a.options)||void 0===a?void 0:a.length)>0?e.c.state.options:n.options});return da(()=>{window.removeEventListener("wheel",i)}),{ns:t,selectRef:a,open:l,rootRef:s,editorC:n,val2:d,options:u,onCloseDropdown:function(){l.value=!1,a.value&&a.value.blur()},onOpenDropdown:function(){l.value=!0},onChangeDropdown:function(){l.value=!l.value}}},render(){return Xt("div",{ref:"rootRef",class:this.ns.b()},[this.model.beforeText?Xt("div",{class:this.ns.e("before-text")},[this.model.beforeText]):null,Xt("div",{class:this.ns.e("content")},[Xt(fa("a-select"),aa({ref:"selectRef",open:this.open,value:this.val2,"onUpdate:value":e=>this.val2=e,options:this.options,allowClear:!0,disabled:this.c.state.disabled,size:this.size,placeholder:this.model.placeholder,onChange:this.onCloseDropdown,onClick:this.onChangeDropdown},this.model.props||{}),null)]),this.model.afterText?Xt("div",{class:this.ns.e("after-text")},[this.model.afterText]):null])}}),zi=Kl(Dl.SELECT,()=>new Gi,$i),Hi=class{constructor(){t(this,"component","gct-form-span")}},qi=/* @__PURE__ */Zt({name:"GctFormSpan",props:{c:{type:Object,required:!0},itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEmptyText:{type:Boolean,default:!1}},setup(e){const t=Vt("form-span"),{model:a,itemModel:l,c:o}=wa(e);return o.value.loadDictionary(),{ns:t,val:Kt(()=>{if(a.value.format&&"function"==typeof a.value.format)return a.value.format(o.value.data,l.value,o.value);if(null==e.value||""===e.value)return e.value;if(l.value.dictionary){const t=(l.value.dictionary.items||[]).find(t=>t.value==e.value);if(t)return t.label}if(o.value.state.options.length>0){const t=o.value.state.options.find(t=>t.value==e.value);if(t)return t.label}return e.value}),handleClipboardKey:function(){const{isSuccessRef:t}=Ut(e.value);t.value&&cl.success(At("sys.copySuccess"))}}},render(){let e=this.val;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),Xt("div",{class:this.ns.b()},[Xt("span",{class:this.ns.e("info")},[e]),this.model.copy&&Xt("span",{class:this.ns.e("copy")},[Xt("i",{class:"iconfont icon-fuzhi primary-gct",onClick:this.handleClipboardKey},null)])])}}),Yi=Kl(Dl.SPAN,()=>new Hi,qi),Xi=class{constructor(){t(this,"component","gct-form-switch")}},Wi=/* @__PURE__ */Zt({name:"GctFormSwitch",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup:()=>({ns:Vt("gct-form-switch"),val:no()}),render(){return Xt("div",{class:this.ns.b()},[Xt(fa("a-switch"),aa({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)])}}),Zi=Kl(Dl.SWITCH,()=>new Xi,Wi),Ji=class{constructor(){t(this,"component","gct-form-text")}},Qi=/* @__PURE__ */Zt({name:"GctFormText",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=Vt("gct-form-text"),a=ro(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);function l(){"string"==typeof a.value&&(a.value=a.value.trim())}return()=>Xt(fa("a-input"),aa({value:a.value,"onUpdate:value":e=>a.value=e,size:e.size},e.model.props||{},{class:t.b(),prefix:e.model.prefix,suffix:e.model.suffix,addonBefore:e.model.addonBefore,addonAfter:e.model.addonAfter,placeholder:e.model.placeholder,"show-count":null!=e.model.max,maxlength:e.model.max,onBlur:l}),null)}}),es=Kl(Dl.TEXT,()=>new Ji,Qi),ts=/* @__PURE__ */Zt({name:"GctFormEmpty",setup(){const e=Vt("gct-form-empty");return()=>Xt("span",{class:e.b()},null)}}),as=class{constructor(){t(this,"component","gct-form-empty")}},ls=Kl(Dl.EMPTY,()=>new as,ts),os=class{constructor(){t(this,"component","gct-form-textarea")}},is=/* @__PURE__ */Zt({name:"GctFormTextarea",props:{model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(){const e=Vt("gct-form-textarea"),t=no();return{ns:e,val:t,handleBlur:()=>{"string"==typeof t.value&&(t.value=t.value.trim())}}},render(){return Xt(fa("a-textarea"),aa({value:this.val,"onUpdate:value":e=>this.val=e,class:this.ns.b(),"auto-size":this.model.autoSize,"show-count":null!=this.model.max,maxlength:this.model.max,placeholder:this.model.placeholder,onBlur:this.handleBlur},this.model.props||{}),null)}}),ss=Kl(Dl.TEXTAREA,()=>new os,is);function ns(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var rs=/* @__PURE__ */Zt({name:"GctFormRadio",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup:()=>({ns:Vt("gct-form-radio"),val:no()}),render(){let e;const t={...this.model.props||{},allowClear:!0,disabled:this.c.state.disabled};if(this.model.buttonMode){let e;return Xt(ol,aa({class:[this.ns.b(),this.ns.m("button")],value:this.val,"onUpdate:value":e=>this.val=e,size:"small","button-style":"solid"},t),ns(e=this.c.state.options.map(e=>Xt(ll,{key:e.value,value:e.value},{default:()=>[e.label]})))?e:{default:()=>[e]})}return Xt(ol,aa({class:[this.ns.b(),this.ns.m("radio")],value:this.val,"onUpdate:value":e=>this.val=e,size:this.size},t),ns(e=this.c.state.options.map(e=>{var t;return Xt(al,{class:[this.ns.e("item"),this.ns.em("item","pos-"+((null===(t=this.model.icon)||void 0===t?void 0:t.pos)||"left"))],key:e.value,value:e.value,disabled:e.disabled},{default:()=>{var t,a,l;return[e.icon?Xt("span",{class:this.ns.e("item-icon"),style:{width:null===(t=this.model.icon)||void 0===t?void 0:t.width,height:null===(a=this.model.icon)||void 0===a?void 0:a.height,fontSize:null===(l=this.model.icon)||void 0===l?void 0:l.fontSize}},["string"==typeof e.icon&&e.icon.endsWith(".svg")?Xt(fa("assets-svg-icon"),{src:e.icon},null):e.icon]):null,Xt("span",{class:this.ns.e("item-label")},[e.label])]}})}))?e:{default:()=>[e]})}}),ds=class{constructor(){t(this,"component","gct-form-radio")}},us=Kl(Dl.RADIO,()=>new ds,rs),cs=/* @__PURE__ */Zt({name:"GctFormInfo",props:{value:{type:String,default:""},model:{type:Object,required:!0},size:{type:String},isEmptyText:{type:Boolean,default:!1}},emits:["update:value"],setup:()=>({ns:Vt("gct-form-info"),val:no()}),render(){let e=this.val||this.model.content;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),Xt("div",{class:[this.ns.b(),this.size?this.ns.m(this.size):null]},[this.model.icon?Xt("span",{class:this.ns.e("icon")},[Xt("i",{class:`iconfont ${this.model.icon}`},null)]):null,Xt("span",{class:this.ns.e("content"),title:e},[e])])}}),ps=class{constructor(){t(this,"component","gct-form-info")}},vs=Kl(Dl.INFO,()=>new ps,cs),ms=ml,hs=/* @__PURE__ */Zt({name:"GctFormCheckbox",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e,{emit:t}){const a=Vt("gct-form-checkbox"),l=no(),o=Kt(()=>e.model.isDrag?(l.value||[]).filter(e=>e.checked).map(e=>e.value):l.value),i=Kt(()=>{var t;return e.model.isDrag&&l.value&&(null===(t=l.value)||void 0===t?void 0:t.length)?l.value.map(t=>{var a;return{...t,label:(null===(a=e.c.state.options.find(e=>e.value===t.value))||void 0===a?void 0:a.label)||""}}):e.c.state.options});return{ns:a,checked:o,onChange:a=>{i.value.forEach(t=>{e.model.minLength&&a.length<=e.model.minLength&&a.includes(t.value)?t.disabled=!0:t.disabled=!1,t.checked=a.includes(t.value)}),e.model.isDrag?t("update:value",i.value):t("update:value",a)},onDragEnd:e=>{const{newIndex:a,oldIndex:l}=e;i.value.splice(a,0,i.value.splice(l,1)[0]),t("update:value",i.value)},slots:{item:({element:e})=>Xt("div",{class:"drag-checkbox-item ks-row-middle"},[Xt("i",{class:"icon-drag iconfont mr4px cursor-move text-[#C3C3C3] primary-gct-hover"},null),Xt(Ya,{value:e.value,disabled:e.disabled},{default:()=>[e.label]})])},options:i}},render(){const e={...this.model.props||{},class:[this.ns.b(),this.ns.m("checkbox"),"column"===this.model.layout&&"isColumn",this.size?this.ns.m(this.size):null],disabled:this.c.state.disabled};return[Oa(Xt(Xa,aa({value:this.checked,"onUpdate:value":e=>this.checked=e},e,{onChange:this.onChange}),{default:()=>[Xt(ms,{modelValue:this.options,"onUpdate:modelValue":e=>this.options=e,handle:".cursor-move",animation:"200","chosen-class":"drawing-chosen","drag-class":"drawing-drag","item-key":"value",class:"drag-wrap",onEnd:this.onDragEnd},this.slots)]}),[[Ca,this.model.isDrag]]),Oa(Xt(Xa,aa({value:this.checked,"onUpdate:value":e=>this.checked=e,options:this.options},e,{onChange:this.onChange}),null),[[Ca,!this.model.isDrag]])]}}),ys=class{constructor(){t(this,"component","gct-form-checkbox")}},fs=Kl(Dl.CHECKBOX,()=>new ys,hs);function gs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var bs=[{value:"entity",label:"sys.pageDesigner.entity"},{value:"data",label:"sys.pageDesigner.data"},{value:"view",label:"sys.pageDesigner.view"},{value:"form",label:"sys.pageDesigner.form",project:["eDHR","MEDPRO"]},{value:"system",label:"sys.pageDesigner.system"}],_s=/* @__PURE__ */Zt({name:"GctFormModelSelect",props:{model:{type:Object,required:!0},value:{type:String}},setup(e){const t=Vt("form-model-select"),a=no(),l=no("category"),o=no("categorySelect"),i=no("modelName"),s=no("formId"),n=va([]),r=va({}),d=async()=>{return"system"===o.value?(n.value=await _api.apaas.report.getListSystemModels()||[],{[At("sys.pageDesigner.system")]:n.value}):(n.value=await _api.apaas.modelComprehensive.getModelSummary({type:(null===(t=e.model.props)||void 0===t?void 0:t.modelTypes)||"NDO,BASE,TREE,TRANSACTION,SIGN",category:l.value,report:!0})||[],Na(n.value,"group"));var t},{onFieldChange:u}=Ja.useInjectFormItemContext();ra(async()=>{a.value=a.value?a.value:void 0,l.value=l.value||"entity",o.value=o.value||l.value,r.value=await d()});const c=async e=>{l.value=e,a.value=null,s.value=void 0,r.value=await d()},p=e=>{const t=n.value.find(t=>t.key===e);t&&(i.value=t.name),"system"===o.value&&(l.value=t.modelCategory),u(),"system"!==o.value&&(r.value=Na(n.value,"group"))};return()=>{let l,i;return Xt("div",{class:t.b()},[Xt(fa("a-input-group"),{compact:!0},{default:()=>[Xt(fa("a-select"),{value:o.value,"onUpdate:value":e=>o.value=e,class:t.e("class"),placeholder:"请选择",onSelect:c,disabled:e.model.disabled},gs(l=bs.filter(t=>{var a;return(null===(a=e.model.props)||void 0===a?void 0:a.exclude)?!e.model.props.exclude.includes(t.value)&&(!t.project||t.project&&_gct.store.appInfo.suiteKey&&t.project.includes(_gct.store.appInfo.suiteKey)):!t.project||_gct.store.appInfo.suiteKey&&t.project.includes(_gct.store.appInfo.suiteKey)}).map(e=>{let t;return Xt(fa("a-select-option"),{key:e.value,value:e.value},gs(t=At(e.label))?t:{default:()=>[t]})}))?l:{default:()=>[l]}),Xt(fa("a-select"),{value:a.value,"onUpdate:value":e=>a.value=e,class:t.e("model"),onSelect:p,"show-search":!0,placeholder:"请选择",disabled:e.model.disabled,filterOption:(e,t)=>(t.label||t.name).toLowerCase().indexOf(e.toLowerCase())>=0},gs(i=Object.keys(r.value).map(e=>{const t=r.value[e].map(e=>Xt(fa("a-select-option"),{key:e.key,value:e.key,label:e.name},{default:()=>[e.name]}));return Xt(fa("a-select-opt-group"),{key:e,label:e},gs(t)?t:{default:()=>[t]})}))?i:{default:()=>[i]})]})])}}}),Es=class{constructor(){t(this,"component","gct-form-model-select")}},ws=Kl(Dl.MODEL_SELECT,()=>new Es,_s),Ts=/* @__PURE__ */Zt({name:"GctFormMultipleChoice",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:Array,default:null}},emits:["update:value"],setup(e,{emit:t}){const a=Vt("form-multiple-choice"),l=va(),o=Kt({get:()=>e.value??[],set:e=>{t("update:value",e)}});return null!=o.value&&e.c.loadDictionary(),{ns:a,rootRef:l,val:o,loadOptions:()=>e.c.loadDictionary({},e.model.force)}},render(){return Xt("div",{ref:"rootRef",class:this.ns.b()},[Xt(fa("a-select"),aa({value:this.val,"onUpdate:value":e=>this.val=e,mode:"multiple","max-tag-count":5,disabled:this.c.state.disabled,loading:this.c.state.loading,options:this.c.state.options,placeholder:this.model.placeholder,onDropdownVisibleChange:this.loadOptions,getPopupContainer:()=>this.rootRef},this.model.props||{}),null)])}}),Cs=class{constructor(){t(this,"component","GctFormMultipleChoice")}},Rs=Kl(Dl.MULTIPLE_CHOICE,()=>new Cs,Ts),Ss=/* @__PURE__ */Zt({name:"GctFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=Vt("form-table"),a=no();return()=>Xt("div",{class:t.b()},[Xt(fa("gct-table"),aa({data:a.value,model:e.model.tableModel,count:a.value.length.toString()},e.model.props||{}),null)])}}),xs=class{constructor(){t(this,"component","gct-form-table")}},Os=Kl(Dl.TABLE,()=>new xs,Ss),ks=/* @__PURE__ */Zt({name:"GctSelectFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=Vt("select-form-table"),a=va(),l=va(""),o=no(),i=Kt(()=>({type:e.model.multiple?"checkbox":"radio",fixed:!0,selectedRowKeys:e.model.isKeys?o.value:o.value.map(t=>t[e.model.tableModel.key||"id"]),onChange:(t,a)=>{e.model.isKeys?o.value=t:o.value=a},getCheckboxProps:e=>({disabled:"Disabled User"===e.name,name:e.name})}));function s(){l.value?(l.value=l.value.trim(),l.value&&a.value&&a.value.reload({query:l.value})):a.value&&a.value.reload()}return()=>Xt("div",{class:t.b()},[Xt("div",{class:t.e("search")},[Xt(fa("a-input-search"),{placeholder:"搜索数据集名称",value:l.value,"onUpdate:value":e=>l.value=e,onSearch:s},null)]),Xt("div",{class:t.e("table")},[Xt(fa("gct-table"),aa({ref:a,"row-selection":i.value,data:o.value,model:e.model.tableModel,count:o.value.length.toString()},e.model.props||{}),null)])])}}),Ds=class{constructor(){t(this,"component","gct-select-form-table")}},Is=Kl(Dl.SELECT_TABLE,()=>new Ds,ks),Ls=class{constructor(){t(this,"component","gct-form-date-range")}},Ms=/* @__PURE__ */Zt({name:"GctFormDateRange",props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},data:{type:Object,required:!0},value:{type:Object,default:()=>[]}},emits:["update:value"],setup(e){var t;const a=Vt("gct-form-date-range"),l=e.model.format||"YYYY-MM-DD HH:mm:ss",o=uo(),i=e.model.props||{},[s,n]=e.itemModel.fields||[],r=null===(t=e.itemModel)||void 0===t?void 0:t.default;return r&&r.length>0&&(o.value=r.map(e=>e?pl(e):null)),Ra(o,()=>{if(o.value){const[t,a]=o.value;t&&(e.data[s]=t.format(l)),a&&(e.data[n]=a.format(l))}}),{ns:a,val:o,editorProps:i}},render(){return Xt(fa("a-range-picker"),aa(this.editorProps,{value:this.val,"onUpdate:value":e=>this.val=e,class:this.ns.b(),"show-time":!0,placeholder:this.model.placeholder}),null)}}),As=Kl(Dl.DATE_RANGE,()=>new Ls,Ms),Ns={install(e){e.use(ci).use(mi).use(ri).use(fi).use(_i).use(Ti).use(Di).use(xi).use(Mi).use(Ui).use(Fi).use(Ki).use(zi).use(Yi).use(Zi).use(es).use(ss).use(us).use(vs).use(fs).use(fi).use(ws).use(Rs).use(Os).use(Is).use(oi).use(ls).use(As)}},Us=/* @__PURE__ */Zt({name:"GctEditForm",props:{embed:{type:Boolean,default:!1},context:{type:Object,default:()=>({})},params:{type:Object,default:()=>({})},controller:{type:Object},model:{type:Object,required:!0},data:{type:Object},count:{type:Number,default:0},adaptModal:{type:Boolean,default:!0}},emits:["update:data","change"],setup(e,{emit:t,expose:a}){const l=Vt("gct-edit-form");console.debug("GctEditForm props:",e);const o=e.controller||ql(()=>new Hl(e.model)),i=va(),s=async e=>{try{await i.value.formRef.validateFields([e])}catch(t){return console.error(t),!1}return!0};o.validate=async()=>{try{await i.value.formRef.validate()}catch(e){return console.error(e),!1}return!0},o.validateItem=s;const{context:n,params:r}=wa(e);return Ra(n,()=>{Object.assign(o.context,e.context),o.state.isNew=!o.context.id},{immediate:!0,deep:!0}),Ra(r,()=>{Object.assign(o.params,e.params)},{deep:!0}),Ra(()=>e.count,()=>{o.state.count+=1}),Ra(()=>e.data,()=>{Object.assign(o.state.data,e.data)},{deep:!0}),!1!==e.adaptModal&&Pt(async()=>{try{await i.value.formRef.validate();const e=await o.save();if(e)return{ok:!0,data:[La(e)]}}catch(e){console.error(e)}return{ok:!1}}),e.data?(Object.assign(o.state.data,e.data),o.loaded()):!0!==o.state.isNew?o.load().then(()=>{o.loaded()}):o.loaded(),e.embed&&o.evt.on("change",()=>{const e=o.getData();t("update:data",e),t("change",e)}),o.evt.on("blur",e=>{s(e)}),a({c:o}),()=>{let t=null;return(o.state.isNew||0==o.state.isNew&&o.state.loaded)&&(t=Xt(fa("gct-form"),{class:"h-full",ref:i,c:o,model:e.model,context:e.context},null)),Xt("div",{class:l.b()},[t])}}}),Ps=class{constructor(){t(this,"data",{})}},Vs=class{constructor(e){t(this,"model",void 0),t(this,"state",new Ps),this.model=e}getData(){var e;const t={};return null===(e=this.model)||void 0===e||null===(e=e.fields)||void 0===e||e.forEach(e=>{null!=this.state.data[e]&&(t[e]=this.state.data[e])}),t}resetData(){Object.keys(this.state.data).forEach(e=>{const t=this.state.data[e];t&&("object"==typeof t?Array.isArray(t)?this.state.data[e]=[]:this.state.data[e]={}:this.state.data[e]=null)})}},Fs=/* @__PURE__ */Zt({name:"AppFormItem",props:{model:{type:Object,required:!0}},setup:()=>({ns:Vt("app-form-item")}),render(){return Xt(fa("a-form-item"),{label:this.model.label,class:this.ns.b()},{default:()=>{var e,t;return[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)]}})}});function js(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var Bs=/* @__PURE__ */Zt({name:"AppForm",props:{model:{type:Object,required:!0}},setup(e){const t=Vt("app-form"),a=function(e){const t=new Vs(e);return t.state=pa(t.state),t}(e.model),l=e=>{if("hidden"===e.editor.type)return null;const t=_gct.register.editor.get(kl.PREFIX+e.editor.type);console.log("item--------------",a,e,t);let l=null;return t?t.render?l=t.render(a.state.data[e.name],a.state.data,e):t.component?l=Qt("string"==typeof t.component?fa(t.component):t.component,{c:a,value:a.state.data[e.name],itemModel:e,model:e.editor,data:a.state.data,"onUpdate:value":t=>{console.log("onUpdate:value",t,a.state.data),a.state.data[e.name]=t,console.log("c.state.data----------",a.state.data)}}):console.error(`未找到编辑器绘制组件:${e.name} - ${e.editor.type},请实现 component 或 render 方法`):console.error(`未找到编辑器适配器:${e.name} - ${e.editor.type}`),Xt(Fs,{model:e},js(l)?l:{default:()=>[l]})},o=e=>e?e.flatMap(e=>{const t=e;return t.children?o(t.children):l(e)}):null;return{ns:t,c:a,renderItem:l,renderContainer:e=>{if("flex"===e.layout){let t;return Xt(Qo,{layout:e.flex},js(t=o(e.children))?t:{default:()=>[t]})}if("grid"===e.layout){let t;return Xt(ti,{layout:e.grid},js(t=o(e.children))?t:{default:()=>[t]})}console.error("不支持的layout类型"+e.layout)},renderChildren:o}},render(){let e;return Xt(fa("a-form"),{model:this.c.state.data,class:this.ns.b()},js(e=this.model.children.map(e=>this.renderContainer(e)))?e:{default:()=>[e]})}}),Ks=/* @__PURE__ */Zt({name:"GctSearchForm",props:{model:{type:Object,required:!0},isFixed:{type:Boolean,default:!1}},emits:["search","reset"],setup(e,{emit:t}){const a=Vt("gct-search-form"),l=va(null),o=Kt(()=>{var e;return null===(e=l.value)||void 0===e?void 0:e.c}),i=()=>o.value.getData();return{ns:a,formRef:l,getData:i,resetData:()=>{o.value.resetData(),t("reset",{})},onSearch:()=>{t("search",i())}}},render(){return Xt("div",{class:this.ns.b()},[Xt("div",{class:this.ns.b("wrapper")},[Xt(Bs,{ref:"formRef",model:this.model},null)]),Xt("div",{class:[this.ns.b("actions"),this.ns.is("fixed",this.isFixed)]},[Xt(fa("a-button"),{class:this.ns.e("reset"),onClick:this.resetData},{default:()=>[Yt("重置")]}),Xt(fa("a-button"),{class:this.ns.e("query"),type:"primary",onClick:this.onSearch},{default:()=>[Yt("查询")]})])])}}),Gs={install(e){e.use(Ns),e.component(Qo.name,Qo),e.component(Jo.name,Jo),e.component(ti.name,ti),e.component(Us.name,Us),e.component(Ks.name,Ks),e.use(Zo)}},$s=class{constructor(){t(this,"formData",{}),t(this,"items",[]),t(this,"page",1),t(this,"total",0),t(this,"size",20)}},zs=class{constructor(){t(this,"keepalive",!0),t(this,"visible",!0)}},Hs=class extends zs{constructor(...e){super(...e),t(this,"error",!1),t(this,"errMessage",""),t(this,"readonly",!1),t(this,"disabled",!1)}},qs=class{constructor(){t(this,"hover",!1),t(this,"active",!1),t(this,"deleted",!1)}},Ys=class{get value(){return this.row.data[this.model.dataIndex]}set value(e){const t=this.row.data[this.model.dataIndex];this.row.data[this.model.dataIndex]=e,this.row.change(this.model.name,e,t)}constructor(e,a){t(this,"row",void 0),t(this,"model",void 0),t(this,"state",this.createState()),this.row=e,this.model=a}createState(){return new zs}async init(){}async destroy(){}},Xs=class extends Ys{},Ws=class extends Ys{createState(){return new Hs}active(){return this.row.active()}unActive(){return this.row.unActive()}},Zs=class{constructor(){t(this,"promise",null),t(this,"resolve",null),t(this,"count",0)}get isLock(){return this.count>0}startPromise(){this.promise=new Promise(e=>{this.resolve=e})}endPromise(){this.resolve&&(this.resolve(),this.resolve=null,this.promise=null)}lock(){this.count+=1,this.promise||this.startPromise()}unlock(){if(this.count<1)return this.count=0,void console.warn("lock和unlock次数不匹配!");this.count-=1,0===this.count&&this.endPromise()}async await(){if(this.promise)return this.promise}};function Js(e,t,a){return{install(l){e&&t&&_gct.register.tableEditor.register(yt.PREFIX+e,t),a&&l.component(a.name||a.__name,a)}}}var Qs=class{get key(){return this.data[this.model.key]}constructor(e,a,l){t(this,"table",void 0),t(this,"model",void 0),t(this,"data",void 0),t(this,"item",{}),t(this,"fields",[]),t(this,"state",this.createState()),t(this,"activeCount",new Zs),this.table=e,this.model=a,this.data=l}async init(){const e=this.model.columns.map(e=>{let t=null;switch(e.type){case"edit":t=new Ws(this,e);break;case"actions":t=new Xs(this,e);break;default:t=new Ys(this,e)}return this.fields.push(e.name),t.state=pa(t.state),this.item[e.name]=t,t});await Promise.all(e)}change(e,t,a){this.table.change(this,e,t,a)}async destroy(){const e=Object.keys(this.item).map(e=>this.item[e].destroy());this.item={},await Promise.all(e)}active(){this.activeCount.isLock?this.activeCount.lock():(this.activeCount.lock(),this.state.active=!0,this.activeCount.await().then(()=>{this.state.active=!1}))}unActive(){this.activeCount.unlock()}createState(){return new qs}},en=class{constructor(e){t(this,"model",void 0),t(this,"evt",new a),t(this,"state",this.createState()),t(this,"row",{}),t(this,"editorProviders",{}),this.model=e,this.init()}init(){this.initTableItems(this.model.columns)}initTableItems(e){e&&e.forEach(e=>{if("edit"===e.type){const t=_gct.register.tableEditor.get(yt.PREFIX+e.editor.type);t&&(this.editorProviders[e.name]=t)}})}async setData(e){await this.destroyControllers(),await this.initControllers(e),this.state.items=e||[]}getData(){return this.state.items}createState(){return new $s}async initControllers(e){const t=e.map(e=>{const t=e[this.model.key];if(this.row[t])return;const a=new Qs(this,this.model,e);return a.state=pa(a.state),a.data=pa(a.data),this.row[t]=a,Object.keys(e).forEach(a=>{this.state.formData[`${a}___${t}`]=e[a]}),a.init()});await Promise.all(t)}async destroyControllers(){const e=this.state.items.map(e=>e[this.model.key]),t=Object.keys(this.row).filter(t=>!e.includes(t)).map(e=>{const t=this.row[e];delete this.row[e];{const e=Object.keys(t.data),a=t.data[this.model.key];e.forEach(e=>{const t=`${e}___${a}`;delete this.state.formData[t]})}return t.destroy()});await Promise.all(t)}async load(e={}){if(Aa(e,{page:this.state.page,size:this.state.size}),this.model.fetch){const t=await this.model.fetch(e,this);this.state.items=t,this.destroyControllers(),this.initControllers(this.state.items)}}async reload(e){await this.load(e)}async search(e){await this.reload(e)}async refresh(e){await this.load(e)}destroy(){this.evt.reset()}change(e,t,a,l){const o=this.state.items.find(t=>t[this.model.key]===e.key);o&&(Object.assign(o,e.data),this.state.formData[`${t}___${o[this.model.key]}`]=a,this.evt.emit("change",o,t,a,l))}updatePagination(e){ja(e.total)||(this.state.total=e.total),ja(e.size)||(this.state.size=e.size),ja(e.page)||(this.state.page=e.page)}};function tn(e){const t=e();return t.state=pa(t.state),da(()=>t.destroy()),t}function an(e,{pagination:t=!0,triggerByWindowSize:a=!0}={}){const l=va(0);let o=[],i=null,s=null;const n=()=>{var a,s;if(!e)return;i&&(clearTimeout(i),i=null);const r=Ta(e).$el??Ta(e),d=r.getBoundingClientRect().height??0,u=Math.max((null===(a=r.querySelector(".ant-table-thead"))||void 0===a?void 0:a.getBoundingClientRect().height)??0,48),c=t?Math.max((null===(s=r.querySelector(".ant-table-pagination"))||void 0===s?void 0:s.getBoundingClientRect().height)??0,24)+16:0;l.value=d-u-c,o.push(l.value),o.length>=3&&o[o.length-3]===o[o.length-1]&&o[o.length-2]===o[o.length-1]?o=[]:i=setTimeout(()=>{n()},100)};return a&&window.addEventListener("resize",n),Ra(e,async t=>{await la(),t&&(n(),(()=>{s&&(s.disconnect(),s=null);const t=Ta(e).$el??Ta(e);t&&"undefined"!=typeof ResizeObserver&&(s=new ResizeObserver(()=>{i&&clearTimeout(i),i=setTimeout(()=>{n()},100)}),s.observe(t))})())},{immediate:!0}),da(()=>{window.removeEventListener("resize",n),s&&(s.disconnect(),s=null),i&&(clearTimeout(i),i=null)}),{scrollHeight:l,calcScrollHeight:n}}var ln=class{constructor(){t(this,"editors",/* @__PURE__ */new Map),t(this,"providers",/* @__PURE__ */new Map)}register(e,t){this.editors.set(e,t)}unregister(e){this.editors.delete(e)}get(e){if(this.providers.has(e))return this.providers.get(e);const t=this.editors.get(e);if(t){const a=t();return this.providers.set(e,a),a}return null}},on=class{constructor(){t(this,"component","gct-table-span")}},sn=/* @__PURE__ */Zt({name:"GctTableSpan",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup:()=>({ns:Vt("table-span")}),render(){return Xt("div",{class:this.ns.b()},[this.model.icon?Xt("span",{class:this.ns.e("icon")},[Xt("i",{class:`iconfont ${"string"==typeof this.model.icon?this.model.icon:this.model.icon(this.c.row.data)}`},null)]):null,Xt("span",{class:this.ns.e("text")},[this.value])])}}),nn=Js(Dl.SPAN,()=>new on,sn),rn=class{constructor(){t(this,"component","gct-table-text")}},dn=/* @__PURE__ */Zt({name:"GctTableText",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEdit:{type:Boolean,default:!1}},emits:["update:value"],setup(e){const t=Vt("table-text"),a=ro(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);return{ns:t,val:a,handleBlur:()=>{"string"==typeof a.value&&(a.value=a.value.trim())}}},render(){return!1===this.isEdit?Xt("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):Xt(fa("a-input"),aa({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("error",this.c.state.error)],prefix:this.model.prefix,suffix:this.model.suffix,addonBefore:this.model.addonBefore,addonAfter:this.model.addonAfter,placeholder:this.model.placeholder,"show-count":null!=this.model.max,maxlength:this.model.max,autocomplete:"off",onBlur:this.handleBlur}),null)}}),un=Js(Dl.TEXT,()=>new rn,dn),cn=class{constructor(){t(this,"component","gct-table-date")}},pn=/* @__PURE__ */Zt({name:"GctTableDate",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""},isEdit:{type:Boolean,default:!1}},emits:["update:value"],setup:()=>({ns:Vt("table-date"),val:no()}),render(){return!1===this.isEdit?Xt("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):Xt(fa("a-date-picker"),aa({picker:"date",value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("error",this.c.state.error)],placeholder:this.model.placeholder}),null)}}),vn=Js(Dl.DATE,()=>new cn,pn),mn={install(e){e.use(nn).use(un).use(vn)}};function hn(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!ta(e)}var yn=/* @__PURE__ */Zt({name:"GctTable",props:{count:{type:Number,default:0},model:{type:Object,required:!0},data:{type:Array,default:()=>[]}},emits:["rowChange"],setup(e,{emit:t}){const a=Vt("gct-table"),l=va({}),o=va(),i=va(),s=va();let n=null,r=null;const d=tn(()=>new en(e.model));d.evt.on("change",async(e,a,l,o)=>{t("rowChange",La(e),a,l,o)}),!0===d.model.local&&Ra(()=>e.count,()=>{d.setData(La(e.data))}),!0!==d.model.local&&!1!==d.model.autoLoad&&d.load();const u=e=>{if(!e||e===o.value)return null;return e.getAttribute("data-row-key")||u(e.parentElement)},c=e=>{const t=u(e.target);if(t){const e=d.row[t];n&&(n.state.hover=!1),e.state.hover=!0,n=e}},p=e=>{!u(e.target)&&n&&(n.state.hover=!1,n=null)},v=e=>{const t=u(e.target);if(t){const e=d.row[t];r&&r.unActive(),e.active(),r=e}else r&&(r.unActive(),r=null)},m=()=>{r&&(r.unActive(),r=null)};ra(()=>{o.value&&(o.value.addEventListener("mouseover",c,{capture:!0}),o.value.addEventListener("mouseout",c,{capture:!0}),o.value.addEventListener("mouseleave",p,{capture:!0}),o.value.addEventListener("click",v,{capture:!0})),window.addEventListener("click",m,{capture:!0})}),da(()=>{o.value&&(o.value.removeEventListener("mouseover",c,{capture:!0}),o.value.removeEventListener("mouseout",c,{capture:!0}),o.value.removeEventListener("mouseleave",p,{capture:!0}),o.value.removeEventListener("click",v,{capture:!0})),window.removeEventListener("click",m,{capture:!0})});const h=Kt(()=>{var t;if(ja(e.model.pagination))return!1;const a=Ia(e.model.pagination);Aa(a,{pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showTotal:!0});const l=!0===a.showTotal?e=>At("sys.component.table.total",{total:e}):a.showTotal||void 0,o=null===(t=a.pageSizeOptions)||void 0===t?void 0:t.map(e=>`${e}`);return{class:"pagination-total-left",total:d.state.total,current:d.state.page,pageSize:d.state.size,pageSizeOptions:o,showSizeChanger:a.showSizeChanger,showTotal:l}}),{scrollHeight:y}=an(o,{pagination:!!h.value});return{ns:a,c:d,loadingState:l,elRef:o,formRef:i,tableRef:s,scrollHeight:y,pagination:h,isEdit:Kt(()=>d.model.columns.some(e=>"edit"===e.type)),handleTableChange:(e,t,a)=>{d.updatePagination({page:e.current,size:e.pageSize}),d.reload()},mouseOver:c,mouseOut:e=>{!u(e.target)&&n&&(n.state.hover=!1,n=null)},onValidate:(e,t,a)=>{const l=e.split("___");if(2===l.length){const[e,o]=l,i=d.row[o];if(i){const l=i.item[e];l&&(l.state.error=!t,a&&a.length>0?l.state.errMessage=a[0]:l.state.errMessage="")}}},validate:()=>i.value.validate(),reload:e=>d.load(e)}},render(){return Xt("div",{ref:"elRef",class:this.ns.b(),onMouseover:this.mouseOver,onMouseout:this.mouseOut},[Xt(fa("a-form"),{ref:"formRef",model:this.c.state.formData,onValidate:this.onValidate},{default:()=>[Xt(fa("a-table"),aa({ref:"tableRef",class:["flex-1",this.ns.is("pagination",!!this.pagination),this.ns.is("not-edit",!this.isEdit)],scroll:{y:this.scrollHeight},columns:this.model.columns,"data-source":this.c.state.items,"row-key":e=>e[this.c.model.key],pagination:this.pagination,onChange:this.handleTableChange},this.$attrs),{headerCell:({title:e,column:t})=>{const a=t;if("edit"===a.type&&a.rules&&a.rules.length>0){const t=a.rules.some(e=>!0===e.required);return Xt("span",{title:e,class:[this.ns.e("table-header"),this.ns.is("required",t)]},[Xt("span",{class:this.ns.e("table-item")},[e])])}return e},bodyCell:({column:e,text:t,record:a})=>{t=null==t&&1==this.model.isEmptyText?_gct.store.getEmptyDisplay:Pa(t)?t.toString():t;const i=e;if(i.customRender)return i.customRender({record:a});if("edit"===e.type){const t=a[this.c.model.key],l=this.c.row[t];if(l){let a;const o=this.c.editorProviders[e.name],i=fa(o.component),s=l.item[e.name],n=!0===l.state.hover||!0===s.state.error||!0===l.state.active||"all"===this.c.model.rowEditMode;return Xt(fa("a-form-item"),{name:`${e.name}___${t}`,class:[this.ns.b("table-item"),this.ns.bm("table-item","edit")],rules:s.model.rules||[]},hn(a=Qt(i,{key:s.model.name,c:s,model:s.model.editor,readonly:s.state.readonly,disabled:s.state.disabled,value:s.value,itemModel:s.model,data:l.data,keepalive:s.state.keepalive,visible:s.state.visible,isEdit:n,"onUpdate:value":e=>{s.value=e}}))?a:{default:()=>[a]})}}if("actions"===e.type){const t=e;return Xt("div",{class:this.ns.b("table-actions")},[t.actions.filter(e=>!e.hidden||!e.hidden(a)).map(e=>{if("divider"===e.mode)return Xt(fa("a-divider"),{type:"vertical"},null);const i=`${e.type}___${e.tag}___${a[this.c.model.key]}`,s=Xt(fa("a-button"),aa({class:this.ns.b("table-action-item"),type:e.type,size:"small",loading:!0===this.loadingState[i],onClick:async s=>{if(!e.confirm)if(s.stopPropagation(),e.action)if(l(e.action)||o(e.action)){this.loadingState[i]=!0;try{await e.action(a)}catch(n){console.log(n)}finally{this.loadingState[i]=!1}}else e.action(a);else t.action(e.tag,a)}},e.props),{default:()=>[e.text]});return e.confirm?Xt(fa("a-popconfirm"),aa({onConfirm:async()=>{if(e.action)if(l(e.action)||o(e.action)){this.loadingState[i]=!0;try{await e.action(a)}catch(s){console.log(s)}finally{this.loadingState[i]=!1}}else e.action(a);else t.action(e.tag,a)}},e.confirm),hn(s)?s:{default:()=>[s]}):s})])}return"link"===e.type?Xt("a",{class:this.ns.e("table-link"),onClick:e=>{e.stopPropagation(),i.click&&i.click(a)}},[t]):t}})]})])}}),fn={install(e){e.component(yn.name,yn)}},gn={install(e){e.use(fn)}},bn={install(e){e.use(mn),e.use(gn)}},_n=/* @__PURE__ */Qe(/* @__PURE__ */Zt({__name:"category-modal",props:{data:{default:()=>({})},module:{}},setup(e){const t=Vt("category-modal"),a=pa({...e.data}),l=va();return Pt(async()=>(await l.value.validate(),{ok:!0,data:[za(a,e=>void 0!==e)]})),(e,o)=>{const i=fa("a-input"),s=fa("a-form-item"),n=fa("a-form");return ua(),zt("div",{class:oa(Ta(t).b())},[Xt(n,{ref_key:"formRef",ref:l,model:a,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off"},{default:xa(()=>[Xt(s,{label:`${Ta(At)("sys.category")}${Ta(At)("sys.name")}`,name:"name",rules:[{required:!0}]},{default:xa(()=>[Xt(i,{value:a.name,"onUpdate:value":o[0]||(o[0]=e=>a.name=e),"show-count":"",maxlength:100},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])],2)}}}),[["__scopeId","data-v-b560615c"]]),En=At,wn=xt(function(e){const t=/* @__PURE__ */new Map,a=va(),l=[_t.EDHR,ht.INSPECTION,ht.RELEASE,_t.ONLINE_FORM].includes(e.module);async function o(t){const a=!!t.data.id,l=await _gct.openUtil.modal(_n,{data:t.data,module:e.module},{title:a?`${En("sys.edit")}${En("sys.category")}`:En("sys.new")+En("sys.category"),width:640,height:360,okText:En("sys.okText"),showFooter:!0});if(null==l?void 0:l.ok)return null==l?void 0:l.data[0]}async function i(){const o=l?await It.getCategoryList({moduleType:e.module})||[]:await _api.apaas.category.getListComplete({module:e.module})||[];a.value=o,t.clear(),ze(o,({item:e})=>{t.set(e.id,e)},{childrenFields:["child"]})}return{categoryTreeData:a,createCategory:async function(t={}){const a=await o({data:t});return a&&(a.module=e.module,await _api.apaas.category.post(a),await i()),a?{parentId:null==a?void 0:a.parentId}:{}},load:i,editCategory:async function(t){const a={name:t.name||t.title,id:t.key||t.id},l=await o({data:a});l&&(await _api.apaas.category.putId({id:a.id??""},{...l,module:e.module}),await i())},deleteCategoryAPI:async function(e,t,a){return new Promise(l=>{tl.confirm({title:En("sys.sureToDeleteCategoryWithName",{name:`${e.name||e.title}`}),icon:Xt(bl),content:a||"",okText:En("sys.okText"),cancelText:En("sys.cancel"),async onOk(){try{t?await t({id:e.key||e.id}):await _api.apaas.category.delete({ids:e.key||e.id}),cl.success(En("sys.delSuccess")),await i(),l(!0)}catch(a){console.error(a),l(!1)}},onCancel(){l(!1)}})})},getCategoryById:function(e){return t.get(e)},dragCategory:async function(e){await _api.apaas.category.postDrag(e),await i()},isFormDesign:l}}),Tn=["title"],Cn=/* @__PURE__ */Zt({__name:"category-sider",props:{module:{},value:{},siderTitle:{},readonly:{type:Boolean},isTree:{type:Boolean},needFolderIcon:{type:Boolean},customDelFunc:{},customDelTips:{},hasTitle:{type:Boolean,default:!0},draggable:{type:Boolean,default:!0},ignoreCase:{},hasPerBtns:{default:()=>[mt.Insert,mt.Update,mt.Delete]}},emits:["update:value","changeCategory","changeValue"],setup(e,{expose:t,emit:a}){const l="edit",o="delete",i=At,s=Vt("category-sider"),n=e,r=a,d=Kt({get:()=>n.value?[n.value]:void 0,set(e){r("update:value",null==e?void 0:e[0])}}),u=va([]),c=va(),p=va(),{load:v,createCategory:m,editCategory:h,deleteCategoryAPI:y,dragCategory:f,categoryTreeData:g,isFormDesign:b}=wn({module:n.module}),_=va(""),E=(e,t)=>{_.value=e?t:""},w=(e,{node:t})=>{var a;0!==e.length&&((null===(a=t.dataRef)||void 0===a||null===(a=a.children)||void 0===a?void 0:a.length)&&!b||(t.categoryId&&!u.value.includes(t.categoryId)&&u.value.push(t.categoryId),r("changeValue",t.dataRef)))},T=Kt(()=>Ve(g.value||[],(e,t)=>{const a=e,l={key:a.id,title:a.name,sortNum:a.sortNum,showFolder:a.children&&n.isTree||n.needFolderIcon,sysBuiltin:a.sysBuiltin};return(a.children||a.child)&&n.isTree&&(l.children=t(a.children||a.child)),l}));ra(async()=>{var e;await v(),n.value||(r("update:value",null===(e=T.value[0])||void 0===e?void 0:e.key),T.value[0]&&r("changeValue",T.value[0]))}),Ra(p,()=>{var e;null===(e=p.value)||void 0===e||e.expandAll()},{immediate:!0});const C=async({dragNode:e,after:t})=>{var a;let l=1;t.nextNode?l=Number(t.nextNode.sortNum??0)+1:t.prevNode&&(l=Number(t.prevNode.sortNum??1)),await f({id:e.key,targetParentId:null===(a=t.parent)||void 0===a?void 0:a.key,targetSortNum:l})},R=async()=>{const e=await m();E(!1,""),e.parentId&&u.value.push(e.parentId),d.value=T.value.length?[T.value[0].key]:[],r("changeValue",T.value[0])};return t({getCategoryData:()=>T.value}),(t,a)=>{const v=fa("a-button"),m=fa("a-input"),f=fa("ellipsis-outlined"),g=fa("a-menu-item"),b=fa("a-menu"),S=fa("a-dropdown");return ua(),zt("div",{class:oa([Ta(s).b()])},[e.hasTitle||!e.readonly?(ua(),zt("div",{key:0,class:oa([Ta(s).e("title-container")])},[Ht("span",{class:oa([Ta(s).e("title")])},ba(e.siderTitle),3),!e.readonly&&e.hasPerBtns.includes(Ta(mt).Insert)?(ua(),Gt(v,{key:0,type:"link",class:oa([Ta(s).e("add")]),onClick:R},{default:xa(()=>[a[3]||(a[3]=Ht("i",{class:"iconfont icon-chuangjian"},null,-1)),Yt(" "+ba(Ta(i)("sys.newCategory")),1)]),_:1},8,["class"])):$t("",!0)],2)):$t("",!0),Ht("div",{class:oa([Ta(s).e("search-container")])},[Xt(m,{value:c.value,"onUpdate:value":a[0]||(a[0]=e=>c.value=e),class:oa([Ta(s).e("search-input")]),placeholder:Ta(At)("sys.onlineForm.searchCategory"),"allow-clear":""},{prefix:xa(()=>[...a[4]||(a[4]=[Ht("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","class","placeholder"])],2),Ht("div",{class:oa([Ta(s).e("tree-container")])},[T.value.length?(ua(),Gt(Ta(Te),{key:0,ref_key:"treeExRef",ref:p,"selected-keys":d.value,"onUpdate:selectedKeys":a[1]||(a[1]=e=>d.value=e),"expanded-keys":u.value,"onUpdate:expandedKeys":a[2]||(a[2]=e=>u.value=e),class:oa([Ta(s).e("tree"),e.draggable&&"draggable-tree"]),draggable:e.draggable,data:T.value,"last-selection-locked":"",filter:c.value?c.value.trim():"","ignore-case":e.ignoreCase,onDrop:C,onSelect:w},{title:xa(({node:t})=>[Ht("div",{class:oa([Ta(s).b("tree-node"),Ta(s).is("highlight",_.value===t.key)])},[Ht("span",{class:oa([Ta(s).be("tree-node","title")]),title:t.title},ba(t.title),11,Tn),e.readonly||!e.hasPerBtns.includes(Ta(mt).Update)&&!e.hasPerBtns.includes(Ta(mt).Delete)?$t("",!0):(ua(),Gt(S,{key:0,class:oa([Ta(s).be("tree-node","more")]),onVisibleChange:e=>{return a=e,l=t.key,void E(a,l);var a,l}},{overlay:xa(()=>[Xt(b,{style:{width:"102px"},onClick:e=>((e,t)=>{(async(e,t)=>{switch(t){case l:await h(e),E(!1,e.key);break;case o:{const t=d.value[0],a=await y(e,n.customDelFunc,n.customDelTips);E(!1,e.key),a&&t===e.key&&(d.value=T.value.length?[T.value[0].key]:[],r("changeValue",T.value[0]));break}}})(e,String(t.key))})(t,e)},{default:xa(()=>[e.hasPerBtns.includes(Ta(mt).Update)?(ua(),Gt(g,{key:l},{default:xa(()=>[Yt(ba(Ta(i)("sys.component.dataConnection.rename")),1)]),_:1})):$t("",!0),e.hasPerBtns.includes(Ta(mt).Delete)?(ua(),Gt(g,{key:o},{default:xa(()=>[Yt(ba(Ta(i)("sys.delText")),1)]),_:1})):$t("",!0)]),_:1},8,["onClick"])]),default:xa(()=>[Xt(f)]),_:2},1032,["class","onVisibleChange"]))],2)]),_:1},8,["selected-keys","expanded-keys","class","draggable","data","filter","ignore-case"])):$t("",!0)],2)],2)}}}),Rn=/* @__PURE__ */Qe(Cn,[["__scopeId","data-v-2ad0d132"]]),Sn=Wt(()=>import("./monaco-editor-CHnBEX6V.js")),xn=/* @__PURE__ */Qe(/* @__PURE__ */Zt({name:"ColorEditor",__name:"color-editor",props:{value:{}},emits:["update:value"],setup(e,{emit:t}){const a=t,l=(e,t)=>{a("update:value",t)};return(t,a)=>{const o=fa("color-picker");return ua(),Gt(o,{preset:Ta(Mt),color:e.value,"onUpdate:color":l},{icon:xa(()=>[Ht("div",{class:"color-picker-icon",style:ia({backgroundColor:e.value})},null,4)]),_:1},8,["preset","color"])}}}),[["__scopeId","data-v-7b102f87"]]),On={FIRST:"first",BEFORE:"before",AFTER:"after",LAST:"last"},kn=/* @__PURE__ */Zt({name:"GctDndItem",props:{config:{type:Object,required:!0},index:{type:Number,required:!0},data:{type:Object,required:!0},last:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=Vt("dnd-item"),o=va(null),i=va(!1),s=ea("vue3-dnd-drop-line-state"),n=va(-1),[r,d,u]=Ge({type:a.group,item:()=>({index:e.index,id:e.data.id,data:e.data,group:a.group,mode:a.mode??"move",tagMap:a.tagMap??{},types:[]}),collect:e=>({canDrag:e.canDrag(),isDragging:e.isDragging()}),canDrag:()=>!1!==a.isDrag&&(!a.canDrag||a.canDrag(e.data)),end:async(e,t)=>{const l=t.getDropResult();if(l&&l.asyncDrop){const t=await l.asyncDrop();!0===t.success&&t.data&&(a.end&&a.end(e,t),a.add&&a.add(t.data),console.debug("drop success"))}}});if(!0!==e.config.isDrop){const[e,t]=$e({accept:a.group,canDrop:()=>!1});t(o)}else{const[t,l]=$e({accept:a.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:(t,a)=>!0!==r.value.isDragging&&t.id!==e.data.id&&a.isOver({shallow:!0}),hover(t,l){if(!1!==l.canDrop())if(l.isOver({shallow:!0})){const t=o.value.getBoundingClientRect(),n=l.getClientOffset(),r=a.offset??0;let d=0;if("vertical"===a.direction){const{top:e,height:a}=t,{y:l}=n;if(d=l-e-a/2,Math.abs(d)<r)return;i.value=d<0}else if("horizontal"===a.direction){const{left:e,width:a}=t,{x:l}=n;if(d=l-e-a/2,Math.abs(d)<r)return;i.value=d<0}s.activeKey=e.data.id,s.isBeforeHover=i.value}else s.activeKey=""},drop:(l,o)=>{if(s.activeKey="",!0===t.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let t=l.data;return a.drop&&(t=await a.drop(l),!t)?{group:a.group,cfg:La(e.config),success:!1}:(c(i.value?On.BEFORE:On.AFTER,t),{group:a.group,success:!0,cfg:La(e.config),data:t})}}}});l(o)}function c(e,a){t("drop",e,a)}return a.handle||!1===a.isDrag||d(o),u(o),{ns:l,rootRef:o,posState:n,collect:r,onDrop:c,drag:d}},render(){var e,t;const a={index:this.index,data:this.data,drag:this.drag};return Xt("div",{ref:"rootRef",class:[this.ns.b(),this.ns.is("dragging",this.collect.isDragging),this.ns.is("not-drag",!1===this.collect.canDrag)]},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t,a)])}}),Dn=/* @__PURE__ */Zt({name:"GctDndDropLine",props:{config:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=Vt("dnd-drop-line"),o=va(null),[i,s]=$e({accept:e.config.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:e=>!1!==a.isDrop&&(!a.canDrop||a.canDrop(e)),drop:(l,o)=>{if(!0===i.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let o=l.data;return a.drop&&(o=await a.drop(l),!o)?{group:a.group,cfg:La(e.config),success:!1}:(t("drop",o),{group:a.group,success:!0,cfg:La(e.config),data:o})}}}});return!1!==a.isDrop&&s(o),{ns:l,rootRef:o,collect:i}},render(){return Xt("div",{ref:"rootRef",class:[this.collect.handlerId,this.ns.b(),this.ns.is("over",this.collect.isOver&&this.collect.canDrop),this.ns.is("shallow-over",this.collect.isShallowOver&&this.collect.canDrop),this.ns.is("not-drop",!1===this.collect.canDrop&&this.collect.isShallowOver),this.ns.is("active",this.active)]},[Xt("div",{class:this.ns.e("line")},null)])}}),In=/* @__PURE__ */Zt({name:"GctDndContainer",props:{config:{type:Object,default:()=>({group:"GctDnd",insertPos:On.LAST})},items:{type:Array,default:()=>[]}},emits:["update:items"],setup(e,{emit:t}){const{config:a}=e,l=Vt("dnd-container"),o=va(null),i=pa({activeKey:"",isBeforeHover:!1});ca("vue3-dnd-drop-line-state",i);const s=Ea(e.items),[n,r]=$e({accept:a.group,collect:e=>({handlerId:e.getHandlerId(),isOver:e.isOver(),canDrop:e.canDrop(),isShallowOver:e.isOver({shallow:!0})}),canDrop:e=>!1!==a.isDrop&&(!a.canDrop||a.canDrop(e)),drop:(l,o)=>{if(!0===n.value.isShallowOver&&!1!==o.canDrop())return{asyncDrop:async()=>{let o=l.data;return a.drop&&(o=await a.drop(l),!o)?{group:a.group,success:!1,cfg:La(e.config)}:(-1===s.value.findIndex(e=>e.id===l.data.id)&&d(e.config.insertPos,o),t("update:items",s.value),{group:a.group,success:!0,cfg:La(e.config),data:o})}}}});function d(e,a,l=-1){if(a){if(e===On.FIRST)s.value.unshift(a);else if(e===On.LAST)s.value.push(a);else{if(-1===l)return void console.error("insertIndex is required");const t=s.value.findIndex(e=>e.id===a.id);if(t===l)return;-1!==t&&l<t&&s.value.splice(t,1),e===On.AFTER?s.value.splice(l+1,0,a):s.value.splice(l,0,a),-1!==t&&l>t&&s.value.splice(t,1)}t("update:items",s.value)}else console.error("data is required")}return!1!==a.isDrop&&r(o),Ra(n,()=>{!0!==n.value.isOver&&(i.activeKey="")}),{ns:l,rootRef:o,dropLineState:i,collect:n,onDrop:d}},render(){var e,t,a,l;const o=this.items[this.items.length-1];return Xt("div",{ref:"rootRef",class:[this.collect.handlerId,this.ns.b(),this.ns.is("over",this.collect.isOver&&this.collect.canDrop),this.ns.is("not-drop",!1===this.collect.canDrop&&this.collect.isOver),this.ns.is("shallow-over",this.collect.isShallowOver&&this.collect.canDrop)]},[null===(e=(t=this.$slots).before)||void 0===e?void 0:e.call(t),this.items.map((e,t)=>{const a=this.items[t-1],l=[];return!1!==this.config.isDrop&&l.push(Xt(Dn,{key:e.id+"___line",config:this.config,active:!0===this.dropLineState.isBeforeHover&&this.dropLineState.activeKey===e.id||a&&this.dropLineState.activeKey===a.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(On.BEFORE,e,t)},null)),l.push(Xt(kn,{key:e.id,config:this.config,index:t,data:e,last:t===this.items.length-1,onDrop:(e,a)=>this.onDrop(e,a,t)},{default:this.$slots.default})),l}),o?Xt(Dn,{key:o.id+"___last-line",config:this.config,active:this.dropLineState.activeKey===o.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(On.AFTER,e,this.items.length-1)},null):null,null===(a=(l=this.$slots).after)||void 0===a?void 0:a.call(l)])}}),Ln={aspectRatio:1,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,autoCrop:!0,background:!0,highlight:!0,center:!0,responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,scalable:!0,modal:!0,guides:!0,movable:!0,rotatable:!0},Mn={src:{type:String,required:!0},alt:{type:String},circled:{type:Boolean,default:!1},realTimePreview:{type:Boolean,default:!0},height:{type:[String,Number],default:"360px"},width:{type:[String,Number],default:"360px"},crossorigin:{type:String,default:void 0},imageStyle:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},An=Zt({name:"CropperImage",props:Mn,emits:["cropend","ready","cropendError"],setup(t,{attrs:a,emit:l}){const o=va(),i=va(),s=va(!1),n=Vt("cropper-image"),r=Ne(p,80),d=Kt(()=>({height:t.height,width:t.width,maxWidth:"100%",...t.imageStyle})),u=Kt(()=>[n.b(),a.class,{[n.m("circled")]:t.circled}]),c=Kt(()=>({height:`${t.height}`.replace(/px/,"")+"px",width:`${t.width}`.replace(/px/,"")+"px"}));function p(){t.realTimePreview&&v()}function v(){if(!i.value)return;let e=i.value.getData();(t.circled?function(){const e=i.value.getCroppedCanvas(),t=document.createElement("canvas"),a=t.getContext("2d"),l=e.width,o=e.height;return t.width=l,t.height=o,a.imageSmoothingEnabled=!0,a.drawImage(e,0,0,l,o),a.globalCompositeOperation="destination-in",a.beginPath(),a.arc(l/2,o/2,Math.min(l,o)/2,0,2*Math.PI,!0),a.fill(),t}():i.value.getCroppedCanvas()).toBlob(t=>{if(!t)return;let a=new FileReader;a.readAsDataURL(t),a.onloadend=t=>{var a;l("cropend",{imgBase64:(null===(a=t.target)||void 0===a?void 0:a.result)??"",imgInfo:e})},a.onerror=()=>{l("cropendError")}},"image/png")}return ra(async function(){const a=Ta(o);if(!a)return;const[{default:n}]=await Promise.all([import("./cropper-BuY_n52N.js").then(t=>/* @__PURE__ */e(t.default,1)),Promise.resolve({ })]);i.value=new n(a,{...Ln,ready:()=>{s.value=!0,p(),l("ready",i.value)},crop(){r()},zoom(){r()},cropmove(){r()},...t.options})}),da(()=>{var e;null===(e=i.value)||void 0===e||e.destroy()}),{getClass:u,imgElRef:o,getWrapperStyle:c,getImageStyle:d,isReady:s,croppered:v}}}),Nn=["src","alt","crossorigin"],Un=/* @__PURE__ */Qe(An,[["render",function(e,t,a,l,o,i){return ua(),zt("div",{class:oa(e.getClass),style:ia(e.getWrapperStyle)},[Oa(Ht("img",{ref:"imgElRef",src:e.src,alt:e.alt,crossorigin:e.crossorigin,style:ia(e.getImageStyle)},null,12,Nn),[[Ca,e.isReady]])],6)}]]),Pn={key:1,class:"empty"},Vn={class:"flex flex-col justify-center items-center"},Fn=["title"],jn=/* @__PURE__ */Zt({__name:"CopperFreeModal",props:{title:{type:String,default:"图片上传"},circled:{type:Boolean,default:!0},uploadApi:{type:Function},src:{type:String},aspectRatio:{type:Number},accept:{type:Array,default:["jpg","jpeg","png","bmp"]},beforeUpload:{type:Function},uploadText:{type:String}},emits:["uploadSuccess","register"],setup(e,{emit:t}){const a=e,l=t,o=va(a.src||""),i=va(a.src||""),s=va(""),r=va();let d=1,u=1,c="";const p=Kt(()=>a.accept.map(e=>`image/${e}`).join(",")),v=Vt("cropper-free"),[m,{closeModal:h,setModalProps:y}]=n(e=>{(null==e?void 0:e.file)&&f(e.file)});async function f(e){if(a.beforeUpload&&await a.beforeUpload(e),e.size/1024/1024>4)return cl.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!p.value.includes(e.type))return cl.warning(`【${e.name}】${At("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),o.value="",s.value="",t.onload=function(t){var a;o.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",c=e.name},!1}function g({imgBase64:e}){s.value=e}function b(e){r.value=e}function _(e,t){var a,l;"scaleX"===e&&(d=t=-1===d?1:-1),"scaleY"===e&&(u=t=-1===u?1:-1),null===(a=r.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function E(){const e=a.uploadApi;if(e&&Fa(e)){const t=kt(s.value);try{y({confirmLoading:!0});const a=await e({name:"file",file:t,filename:c});l("uploadSuccess",{source:s.value,data:a.data}),h()}finally{y({confirmLoading:!1})}}}function w(){o.value="",setTimeout(()=>{o.value=i.value||""})}return Ra(()=>a.src,e=>{o.value=e||"",i.value=e||""}),(t,a)=>{const l=fa("PlusOutlined"),i=fa("a-button");return ua(),Gt(Ta(S),aa(t.$attrs,{title:e.title,width:"640px","min-height":"510","can-fullscreen":!1,"ok-text":Ta(At)("sys.okText"),onRegister:Ta(m),onOk:E,onCancel:w}),{default:xa(()=>[Ht("div",{class:oa(Ta(v).b())},[Ht("div",{class:oa(Ta(v).b("left"))},[Ht("div",{class:oa(Ta(v).b("cropper"))},[o.value?(ua(),Gt(Un,{key:0,src:o.value,height:"304px",width:"538px",options:{aspectRatio:e.aspectRatio??200/120},onCropend:g,onReady:b},null,8,["src","options"])):(ua(),zt("div",Pn,[Xt(Ta(ul),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":f},{default:xa(()=>[Ht("div",Vn,[Xt(l),a[14]||(a[14]=Ht("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Ht("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),o.value?(ua(),zt("div",{key:0,class:oa(Ta(v).b("toolbar"))},[Xt(Ta(ul),{"file-list":[],accept:p.value,"before-upload":f},{default:xa(()=>[e.uploadText?(ua(),Gt(i,{key:0,type:"link",size:"small",style:{padding:"0"}},{default:xa(()=>[Yt(ba(e.uploadText),1)]),_:1})):(ua(),zt("a",{key:1,title:Ta(At)("sys.reUpload"),placement:"bottom"},ba(Ta(At)("sys.reUpload")),9,Fn))]),_:1},8,["accept"]),Xt(Ta(sl),null,{default:xa(()=>[Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Da(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>_("zoom",.1))},{icon:xa(()=>[...a[16]||(a[16]=[Ht("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Da(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>_("zoom",-.1))},{icon:xa(()=>[...a[17]||(a[17]=[Ht("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Da(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>_("rotate",-45))},{icon:xa(()=>[...a[18]||(a[18]=[Ht("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Da(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>_("rotate",45))},{icon:xa(()=>[...a[19]||(a[19]=[Ht("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Da(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>_("scaleX"))},{icon:xa(()=>[...a[20]||(a[20]=[Ht("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Da(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>_("scaleY"))},{icon:xa(()=>[...a[21]||(a[21]=[Ht("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:xa(()=>[Xt(i,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Da(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>_("reset"))},{icon:xa(()=>[Xt(Ta(Tl))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):$t("",!0)],2)],2)]),_:1},16,["title","ok-text","onRegister"])}}}),Bn=/* @__PURE__ */Qe(jn,[["__scopeId","data-v-da6428d3"]]),Kn={key:1,class:"empty"},Gn={class:"flex flex-col justify-center items-center"},$n=["title"],zn={class:"flex-col"},Hn={class:"flex-col"},qn={class:"flex-col text-center"},Yn=/* @__PURE__ */Zt({__name:"CopperModal",props:{circled:{type:Boolean,default:!0},uploadApi:{type:Function},src:{type:String},sourceUrlValue:{type:String}},emits:["uploadSuccess","register"],setup(e,{emit:t}){const a=e,l=t,o=va(a.src||""),i=va(""),s=va();let r=1,d=1,u="";const c=Vt("cropper-am"),[p,{closeModal:v,setModalProps:m}]=n();function h(e){if(e.size/1024/1024>4)return cl.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!["image/jpg","image/jpeg","image/png","image/bmp"].includes(e.type))return cl.warning(`【${e.name}】${At("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),o.value="",i.value="",t.onload=function(t){var a;o.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",u=e.name},!1}function y({imgBase64:e}){i.value=e}function f(e){s.value=e}function g(e,t){var a,l;"scaleX"===e&&(r=t=-1===r?1:-1),"scaleY"===e&&(d=t=-1===d?1:-1),null===(a=s.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function b(){const e=a.uploadApi;if(e&&Fa(e)){const t=kt(i.value);try{m({confirmLoading:!0});const a=await e({name:"file",file:t,filename:u});l("uploadSuccess",{source:i.value,data:a.data.data}),v()}finally{m({confirmLoading:!1})}}}return(t,a)=>{const l=fa("PlusOutlined"),s=fa("a-button"),n=fa("Avatar");return ua(),Gt(Ta(S),aa(t.$attrs,{title:Ta(At)("sys.component.cropper.modalTitle"),width:"600px","min-height":"570","can-fullscreen":!1,"ok-text":Ta(At)("sys.okText"),onRegister:Ta(p),onOk:b}),{default:xa(()=>[Ht("div",{class:oa(Ta(c).b())},[Ht("div",{class:oa(Ta(c).b("left"))},[Ht("div",{class:oa(Ta(c).b("cropper"))},[o.value?(ua(),Gt(Un,{key:0,src:o.value,height:"360px",width:"360px",circled:e.circled,onCropend:y,onReady:f},null,8,["src","circled"])):$t("",!0),e.sourceUrlValue||"/404.png"!==o.value?$t("",!0):(ua(),zt("div",Kn,[Xt(Ta(ul),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":h},{default:xa(()=>[Ht("div",Gn,[Xt(l),a[14]||(a[14]=Ht("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Ht("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),e.sourceUrlValue||"/404.png"!==o.value?(ua(),zt("div",{key:0,class:oa(Ta(c).b("toolbar"))},[Xt(Ta(ul),{"file-list":[],accept:"image/*","before-upload":h},{default:xa(()=>[Ht("a",{title:Ta(At)("sys.reUpload"),placement:"bottom"},ba(Ta(At)("sys.reUpload")),9,$n)]),_:1}),Xt(Ta(sl),null,{default:xa(()=>[Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Da(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>g("zoom",.1))},{icon:xa(()=>[...a[16]||(a[16]=[Ht("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Da(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>g("zoom",-.1))},{icon:xa(()=>[...a[17]||(a[17]=[Ht("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Da(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>g("rotate",-45))},{icon:xa(()=>[...a[18]||(a[18]=[Ht("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Da(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>g("rotate",45))},{icon:xa(()=>[...a[19]||(a[19]=[Ht("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Da(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>g("scaleX"))},{icon:xa(()=>[...a[20]||(a[20]=[Ht("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Da(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>g("scaleY"))},{icon:xa(()=>[...a[21]||(a[21]=[Ht("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Xt(Ta(rl),{title:Ta(At)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:xa(()=>[Xt(s,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Da(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>g("reset"))},{icon:xa(()=>[Xt(Ta(Tl))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):$t("",!0)],2),Ht("div",{class:oa([Ta(c).b("right"),"text-center"])},[a[22]||(a[22]=Yt(" 预览 ",-1)),Ht("div",{class:oa(Ta(c).b("group"))},[Ht("div",zn,[Xt(n,{src:i.value,size:102},null,8,["src"])]),Ht("div",Hn,[Xt(n,{src:i.value,size:78},null,8,["src"])]),Ht("div",qn,[Xt(n,{src:i.value,size:28},null,8,["src"])])],2)],2)],2),a[23]||(a[23]=Ht("div",{class:"absolute z-10 top-0 left-2/3 w-0 h-full",style:{"border-left":"1px solid #e0e3ea"}},null,-1))]),_:1},16,["title","ok-text","onRegister"])}}}),Xn=/* @__PURE__ */Qe(Yn,[["__scopeId","data-v-f1134678"]]),Wn=["src"],Zn=/* @__PURE__ */Zt({__name:"CropperAvatar",props:{width:{type:[String,Number],default:"200px"},value:{type:String},showBtn:{type:Boolean,default:!0},btnProps:{type:Object},btnText:{type:String,default:""},uploadApi:{type:Function}},emits:["update:value","change"],setup(e,{expose:t,emit:a}){const l=e,o=a,i=va("/extras-assets/images/default_avatar.png"),s=va(Nt(l.value)||""),n=va(l.value||""),r=Vt("cropper-avatar"),[d,{openModal:u,closeModal:c}]=Ie(),p=Kt(()=>[r.b()]),v=Kt(()=>`${l.width}`.replace(/px/,"")+"px"),m=Kt(()=>parseInt(`${l.width}`.replace(/px/,""))/2+"px"),h=Kt(()=>({width:Ta(v)})),y=Kt(()=>({width:Ta(v),height:Ta(v)}));function f({source:e,data:t}){s.value=Nt(t),n.value=t,o("change",{source:e,data:t})}Sa(()=>{s.value=Nt(l.value)||"",n.value=l.value||""}),Ra(()=>n.value,e=>{o("update:value",e)});const g=()=>{u()};return t({openModal:u.bind(null,!0),closeModal:c}),(t,a)=>{const l=fa("a-button");return ua(),zt("div",{class:oa(p.value),style:ia(h.value)},[Ht("div",{class:oa(Ta(r).b("image-wrapper")),style:ia(y.value),onClick:g},[Ht("div",{class:oa(Ta(r).b("image-mask")),style:ia(y.value)},[Xt(Ta(gl),{style:ia({width:m.value,height:m.value}),"two-tone-color":"#d6d6d6"},null,8,["style"])],6),Ht("img",{src:e.value?s.value:i.value,alt:"avatar"},null,8,Wn)],6),e.showBtn?(ua(),Gt(l,aa({key:0,class:Ta(r).b("upload-btn")},e.btnProps,{onClick:Ta(u)}),{default:xa(()=>[Yt(ba(e.btnText?e.btnText:Ta(At)("sys.component.cropper.selectImage")),1)]),_:1},16,["class","onClick"])):$t("",!0),Xt(Xn,{"upload-api":e.uploadApi,src:s.value,"source-url-value":n.value,onRegister:Ta(d),onUploadSuccess:f},null,8,["upload-api","src","source-url-value","onRegister"])],6)}}}),Jn=/* @__PURE__ */Qe(Zn,[["__scopeId","data-v-ef939ff0"]]),Qn=/* @__PURE__ */Zt({__name:"picture-preview",props:{functional:{type:Boolean},imageList:{type:Array,default:()=>[]}},setup(e){const t=e,a=Vt("image-preview"),l=Kt(()=>t.imageList.map(e=>Ba(e)?{src:e,placeholder:!1}:e));return(t,o)=>{const i=fa("PreviewGroup");return ua(),zt("div",{class:oa(Ta(a).b())},[Xt(i,null,{default:xa(()=>[!e.imageList||t.$slots.default?ya(t.$slots,"default",{key:0}):(ua(!0),zt(Bt,{key:1},ha(l.value,e=>(ua(),Gt(Ta(Qa),aa({key:e.src,ref_for:!0},e),qt({_:2},[e.placeholder?{name:"placeholder",fn:xa(()=>[Xt(Ta(Qa),aa({ref_for:!0},e,{src:e.placeholder,preview:!1}),null,16,["src"])]),key:"0"}:void 0]),1040))),128))]),_:3})],2)}}}),er=Qn,tr=/* @__PURE__ */function(e){return e[e.LOADING=0]="LOADING",e[e.DONE=1]="DONE",e[e.FAIL=2]="FAIL",e}(tr||{}),ar={show:{type:Boolean,default:!1},imageList:{type:Array,default:null},index:{type:Number,default:0},scaleStep:{type:Number},defaultWidth:{type:Number},maskClosable:{type:Boolean},rememberState:{type:Boolean}},lr="img-preview",or=/* @__PURE__ */Zt({name:"ImagePreview",props:ar,emits:["img-load","img-error"],setup(e,{expose:t,emit:a}){const l=/* @__PURE__ */new Map,o=pa({currentUrl:"",imgScale:1,imgRotate:0,imgTop:0,imgLeft:0,status:tr.LOADING,currentIndex:0,moveX:0,moveY:0,show:e.show}),i=va(null),s=va(null);function n(){o.imgScale=1,o.imgRotate=0,o.imgTop=0,o.imgLeft=0}const r=Kt(()=>{const t=(null==e?void 0:e.scaleStep)??0;return t>0&&t<100?t/100:o.imgScale/10});function d(e){(e=e||window.event).delta=e.wheelDelta||-e.detail,e.preventDefault(),e.delta>0&&u(r.value),e.delta<0&&u(-r.value)}function u(e){o.imgScale<=.2&&e<0||(o.imgScale+=.1*e,o.imgScale<0&&(o.imgScale=.02))}function c(e){o.imgRotate+=e}function p(){const e=Ta(s);e&&(e.onmousemove=null)}function v(t){o.status=tr.LOADING;const i=new Image;i.src=t,i.onload=i=>{if(o.currentUrl!==t){const s=i.composedPath();if(e.rememberState){l.set(o.currentUrl,{scale:o.imgScale,top:o.imgTop,left:o.imgLeft,rotate:o.imgRotate});const a=l.get(t);a?(o.imgScale=a.scale,o.imgTop=a.top,o.imgRotate=a.rotate,o.imgLeft=a.left):(n(),e.defaultWidth&&(o.imgScale=e.defaultWidth/s[0].naturalWidth))}else e.defaultWidth&&(o.imgScale=e.defaultWidth/s[0].naturalWidth);s&&a("img-load",{index:o.currentIndex,dom:s[0],url:t})}o.currentUrl=t,o.status=tr.DONE},i.onerror=e=>{const l=e.composedPath();l&&a("img-error",{index:o.currentIndex,dom:l[0],url:t}),o.status=tr.FAIL}}function m(e){e&&e.stopPropagation(),h()}function h(){o.show=!1,document.body.removeEventListener("DOMMouseScroll",d),document.ondragstart=null}function y(){n()}function f(t){const{currentIndex:a}=o,{imageList:l}=e;"left"===t&&(o.currentIndex-=1,a<=0&&(o.currentIndex=l.length-1)),"right"===t&&(o.currentIndex+=1,a>=l.length-1&&(o.currentIndex=0)),v(l[o.currentIndex])}function g(e){e=e||window.event,o.moveX=e.clientX,o.moveY=e.clientY;const t=Ta(s);t&&(t.onmousemove=b)}function b(e){(e=e||window.event).preventDefault();const t=e.clientX-o.moveX,a=e.clientY-o.moveY;o.imgLeft+=t,o.imgTop+=a,o.moveX=e.clientX,o.moveY=e.clientY}t({resume:y,close:h,prev:f.bind(null,"left"),next:f.bind(null,"right"),setScale:e=>{e>0&&e<=10&&(o.imgScale=e)},setRotate:e=>{o.imgRotate=e}});const _=Kt(()=>{const{imgScale:t,imgRotate:a,imgTop:l,imgLeft:i}=o;return{transform:`scale(${t}) rotate(${a}deg)`,marginTop:`${l}px`,marginLeft:`${i}px`,maxWidth:e.defaultWidth?"unset":"100%"}}),E=Kt(()=>{const{imageList:t}=e;return t.length>1});Sa(()=>{e.show&&function(){!function(){const e=Ta(i);e&&(e.onmousewheel=d,document.body.addEventListener("DOMMouseScroll",d),document.ondragstart=function(){return!1})}();const{index:t,imageList:a}=e;if(!a||!a.length)throw new Error("imageList is undefined");o.currentIndex=t,v(a[t])}(),e.imageList&&n()});const w=t=>{e.maskClosable&&t.target&&t.target.classList.contains(`${lr}-content`)&&m(t)},T=()=>{if(!Ta(E))return null;const{currentIndex:t}=o,{imageList:a}=e;return Xt("div",{class:`${lr}__index`},[t+1,Yt(" / "),a.length])},C=e=>Ta(E)?Xt("div",{class:[`${lr}__arrow`,e],onClick:()=>f(e)},[Xt("left"===e?El:Cl,null,null)]):null;return()=>o.show&&Xt("div",{class:lr,ref:i,onMouseup:p,onClick:w},[Xt("div",{class:`${lr}-content`},[Xt("img",{style:Ta(_),class:[`${lr}-image`,o.status===tr.DONE?"":"hidden"],ref:s,src:o.currentUrl,onMousedown:g},null),Xt("div",{class:`${lr}__close`,onClick:m},[Xt(yl,{class:`${lr}__close-icon`},null)]),T(),Xt("div",{class:`${lr}__controller`},[Xt("div",{class:`${lr}__controller-item`,onClick:()=>u(-r.value)},[Xt("img",{src:"/extras-assets/svg/preview/unscale.svg"},null)]),Xt("div",{class:`${lr}__controller-item`,onClick:()=>u(r.value)},[Xt("img",{src:"/extras-assets/svg/preview/scale.svg"},null)]),Xt("div",{class:`${lr}__controller-item`,onClick:y},[Xt("img",{src:"/extras-assets/svg/preview/resume.svg"},null)]),Xt("div",{class:`${lr}__controller-item`,onClick:()=>c(-90)},[Xt("img",{src:"/extras-assets/svg/preview/unrotate.svg"},null)]),Xt("div",{class:`${lr}__controller-item`,onClick:()=>c(90)},[Xt("img",{src:"/extras-assets/svg/preview/p-rotate.svg"},null)])]),C("left"),C("right")])])}}),ir=or,sr=null;function nr(e){var t;const a={},l=document.createElement("div");return Object.assign(a,{show:!0,index:0,scaleStep:100},e),sr=Xt(ir,a),ma(sr,l),document.body.appendChild(l),null===(t=sr.component)||void 0===t?void 0:t.exposed}var rr=["src"],dr={key:0,class:"iconfont icon-tupian-shili"},ur={class:"prompt"},cr={key:0,class:"auxiliary"},pr="cropper-photo",vr=/* @__PURE__ */Zt({__name:"CropperFree",props:{value:{type:String},uploadApi:{type:Function},aspectRatio:{type:Number},auxiliary:{type:String},icon:{type:String},isDrag:{type:Boolean,default:!1},accept:{type:Array},beforeUpload:{type:Function},modalTitle:{type:String},uploadText:{type:String},disabled:{type:Boolean,default:!1}},emits:["update:value","change"],setup(e,{expose:t,emit:a}){const l=e,o=a,i=va(l.value||""),s=Kt(()=>i.value?Dt(i.value):"");let n={};const[r,{openModal:d,closeModal:u}]=Ie(),c=Kt(()=>l.disabled),p=Kt(()=>{var e,t,a;return(null===(e=l.accept)||void 0===e?void 0:e.length)?[...new Set((null===(t=l.accept)||void 0===t?void 0:t.some(e=>"jpg"===e||"jpeg"===e))?null===(a=l.accept)||void 0===a?void 0:a.concat(["jpg","jpeg"]):l.accept)].map(e=>"image/"+e):["image/jpg","image/jpeg","image/png"]});function v({source:e,data:t}){i.value=t,o("change",{source:e,data:t})}function m(){n=nr({imageList:[s.value]})}function h(){i.value=""}Sa(()=>{i.value=l.value||""}),Ra(()=>i.value,e=>{o("update:value",e)}),na(()=>{n&&n.close&&n.close()}),ra(()=>{const e=document.getElementById("dropzone");null==e||e.addEventListener("dragover",e=>{e.stopPropagation(),e.preventDefault()}),null==e||e.addEventListener("drop",e=>{var t;e.stopPropagation(),e.preventDefault();const a=null===(t=e.dataTransfer)||void 0===t?void 0:t.files[0];if(a){if(!p.value.includes(a.type))return void cl.warning(At("sys.component.cropper.acceptTip"));d(!0,{file:a})}})});const y=()=>{d()};return t({openModal:d.bind(null,!0),closeModal:u}),(t,a)=>{var l;const o=fa("Icon");return ua(),zt("div",{id:"dropzone",class:oa([pr,c.value&&"not-allow"])},[s.value?(ua(),zt(Bt,{key:0},[Ht("div",{class:oa(`${pr}__wrapper`)},[Ht("img",{src:s.value},null,8,rr)],2),Ht("div",{class:oa(`${pr}__mask`)},[Xt(Ta(_l),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:m}),Xt(Ta(gl),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:a[0]||(a[0]=()=>Ta(d)())}),Xt(Ta(fl),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:h})],2)],64)):(ua(),zt("div",{key:1,class:oa(`${pr}__trigger`),onClick:y},[e.icon?(ua(),zt("i",dr)):(ua(),Gt(o,{key:1,icon:"ant-design:plus-outlined",size:36})),e.isDrag?(ua(),zt(Bt,{key:2},[Ht("p",ur,ba(Ta(At)("sys.pageDesigner.clickOrDragToUpload")),1),e.accept?(ua(),zt("p",cr,ba(`支持${null===(l=e.accept)||void 0===l?void 0:l.join("、")}图片格式,大小100KB以内`),1)):$t("",!0)],64)):$t("",!0),e.auxiliary?$t("",!0):(ua(),zt(Bt,{key:3},[Yt(ba(Ta(At)("sys.clickToDoSth",{sth:Ta(At)("sys.add")})),1)],64))],2)),Xt(Bn,{"upload-api":e.uploadApi,"aspect-ratio":e.aspectRatio,src:s.value,accept:e.accept,"before-upload":e.beforeUpload,title:e.modalTitle,"upload-text":e.uploadText,onRegister:Ta(r),onUploadSuccess:v},null,8,["upload-api","aspect-ratio","src","accept","before-upload","title","upload-text","onRegister"])],2)}}}),mr=/* @__PURE__ */Qe(vr,[["__scopeId","data-v-840e141f"]]),hr={key:0,class:"px-2"},yr={key:1,class:"font-bold mb-3"},fr={key:2,class:"gct-print-tmpl-modal-wrap ks-col"},gr={class:"print-tmpl-vxe-table-wrapper"},br={class:"print-tmpl-vxe-table-area"},_r={class:"ks-row"},Er={class:"gct-text-overflow"},wr={key:0,class:"gct-custom-tag ml4px"},Tr={class:"ks-row"},Cr=["title"],Rr={class:"pt-12px"},Sr={key:3,class:"gct-print-tmpl-modal-right btw-visible flex flex-col h-full px-2 py-3"},xr={class:"print-tmpl-vxe-table-wrapper"},Or={class:"print-tmpl-vxe-table-area"},kr={class:"tmpl-path"},Dr=["src"],Ir=["src"],Lr={class:"pt-12px"},Mr=/* @__PURE__ */Zt({__name:"print-tmpl-modal",props:{selected:{},modal:{},moduleType:{},printMode:{},className:{},isRdo:{type:Boolean,default:!1},multiple:{type:Boolean},categoryTitle:{default:void 0},queryParams:{},btwForceVisible:{type:Boolean,default:!1},ignoreCase:{},modelKey:{}},setup(e){const t=e,a=Vt("print-tmpl-modal"),l=va([]),o=va(),i=va(),s=va({pageNo:1,pageSize:20}),n=va({pageNo:1,pageSize:20}),r=va("design"),d=va(0),u=va(!1),c=va(0),p=va(!1),v=Kt(()=>t.printMode===Et.Server||t.btwForceVisible),m=Kt(()=>t.moduleType),h=va(Kt(()=>{var e,a;return Array.isArray(t.selected)?null===(e=t.selected)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.categoryId:null===(a=t.selected)||void 0===a?void 0:a.categoryId}).value||""),y=va({categoryId:h.value,name:""}),f=va({name:""}),g=va(""),b=/(?<!\\)\\(?!\\)/g,_=Kt(()=>({current:s.value.pageNo,pageSize:s.value.pageSize,total:d.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>At("sys.component.table.total",{total:e})})),E=Kt(()=>({current:n.value.pageNo,pageSize:n.value.pageSize,total:c.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>At("sys.component.table.total",{total:e})})),w=va([]),T=va([]),C={[Tt.LABEL]:At("sys.pageDesigner.label"),[Tt.RECEIPT]:At("sys.pageDesigner.document"),[_t.EDHR]:"DHR",[_t.ONLINE_FORM]:At("sys.pageDesigner.fieldCmp.online_form")};ra(()=>{la(()=>{t.selected&&(Array.isArray(t.selected)?(R(t.selected),l.value=[...t.selected]):(R([t.selected]),l.value=[{...t.selected}]))})});const R=e=>{const t=o.value;t&&t.setCheckboxRow(e,!0)},S=e=>e.children||!t.isRdo?e.name:e.version,x=Kt(()=>[_t.EDHR,_t.ONLINE_FORM].includes(t.moduleType)),O=Kt(()=>C[t.moduleType]),k=Kt(()=>t.categoryTitle||!ja(t.categoryTitle)?t.categoryTitle:At("sys.categoryOfSth",{sth:O.value})),D=e=>{y.value.categoryId=null==e?void 0:e.key},I=e=>{l.value=[{...e.row}]},L=({checked:e,row:t})=>{var a,o;e?null===(a=l.value)||void 0===a||a.push(t):l.value=null===(o=l.value)||void 0===o?void 0:o.filter(e=>e.id!==t.id)};function M(e,t){s.value.pageNo=e,s.value.pageSize=t,U()}function A(e,t){n.value.pageNo=e,n.value.pageSize=t,P()}const N=()=>{};Pt(()=>Promise.resolve({ok:!0,params:{selected:l.value}}));const U=async()=>{var e,a,l;y.value.name=y.value.name.trim();const i=_api.apaas.printDesigner.getRdoPageList;u.value=!0;const n=await i({...y.value,...s.value,...t.queryParams||{},moduleType:t.moduleType,modelKey:t.modelKey})||{};u.value=!1,w.value=h.value&&(null===(e=n.data)||void 0===e?void 0:e.map(e=>{let a;var l;return t.isRdo?a={...e,children:null===(l=e.children)||void 0===l?void 0:l.map(t=>({...t,id:t.baseId+":"+t.id,categoryId:e.categoryId}))}:(delete e.children,a={...e,id:e.baseId+":"+e.id,categoryId:y.value.categoryId}),a}))||[],d.value=n.totalCount,await la();const r=F(w.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});console.log(o.value,"tableRef.value"),r&&(null===(a=o.value)||void 0===a||a.setRadioRow(r)),t.isRdo&&(null===(l=o.value)||void 0===l||l.setAllTreeExpand(!0))},P=async()=>{f.value.name=f.value.name.trim(),p.value=!0,_api.apaas.label.getBtwPageList({...f.value,...n.value}).then(async e=>{var a,l;null==e||null===(a=e.data)||void 0===a||a.forEach(e=>{if(null==e?void 0:e.fullPath){var t;const a=null===(t=e.fullPath)||void 0===t?void 0:t.split("/");a.pop(),a.shift(),e.tmplPath=a}}),T.value=e.data||[],c.value=e.totalCount,await la();const o=F(T.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});o&&(null===(l=i.value)||void 0===l||l.setRadioRow(o))}).finally(()=>{p.value=!1})},V=e=>{const t=e.target.value;(!t||t.length<g.value.length)&&P(),g.value=t},F=e=>function e(t,a){let l=[];for(const i of t){var o;i.level=a,l.push(i),(null===(o=i.children)||void 0===o?void 0:o.length)&&(l=[...l,...e(i.children,a+1)])}return l}(JSON.parse(JSON.stringify(e)),1);return Ra(()=>y.value.categoryId,e=>{e?U():(w.value=[],d.value=0)},{immediate:!0}),Ra(()=>r.value,()=>{"btw"===r.value?(T.value=[],n.value.pageNo=1,P()):(w.value=[],s.value.pageNo=1,U())}),Ra(()=>l.value,()=>{var e;!(null==t?void 0:t.multiple)&&(null===(e=t.modal)||void 0===e?void 0:e.state)&&(t.modal.state.okDisabled=!l.value.length)},{immediate:!0}),(t,l)=>{const s=fa("a-tab-pane"),n=fa("a-tabs"),d=fa("a-input"),c=fa("a-form-item"),g=fa("a-form"),C=fa("a-tooltip"),R=fa("a-pagination");return ua(),zt("div",{class:oa(["gct-print-tmpl-modal ks-column",v.value?"px-2 pt-4":"p-4"])},[v.value?(ua(),zt("div",hr,[Xt(n,{"active-key":r.value,"onUpdate:activeKey":l[0]||(l[0]=e=>r.value=e)},{default:xa(()=>[Xt(s,{key:"design",tab:k.value},null,8,["tab"]),Xt(s,{key:"btw",tab:".btw 标签模板 "})]),_:1},8,["active-key"])])):(ua(),zt("div",yr,ba(k.value),1)),!v.value||v.value&&"design"===r.value?(ua(),zt("div",fr,[Ht("div",{class:oa(["gct-print-tmpl-modal-left",v.value?"btw-visible":""])},[Xt(Ta(Rn),{value:h.value,"onUpdate:value":l[1]||(l[1]=e=>h.value=e),class:oa([Ta(a).e("sider")]),"sider-title":"",module:m.value,"need-folder-icon":!x.value,readonly:"","has-title":!1,draggable:!1,"is-tree":x.value,"ignore-case":e.ignoreCase,onChangeValue:D,onChangeCategory:N},null,8,["value","class","module","need-folder-icon","is-tree","ignore-case"])],2),Ht("div",{class:oa(["gct-print-tmpl-modal-right flex flex-col h-full px-16px py-12px",v.value?"btw-visible":""])},[Xt(g,{model:y.value},{default:xa(()=>[Xt(c,{label:""},{default:xa(()=>[Xt(d,{value:y.value.name,"onUpdate:value":l[2]||(l[2]=e=>y.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:Ta(At)("sys.searchNameOfSth",{sth:O.value}),clearable:"",onKeyup:l[3]||(l[3]=ka(e=>U(),["enter"])),onChange:l[4]||(l[4]=()=>{!y.value.name&&U()})},{prefix:xa(()=>[...l[7]||(l[7]=[Ht("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Ht("div",gr,[Ht("div",br,[Xt(Ta(Sl),{ref_key:"tableRef",ref:o,class:oa(["select-none",{vxetable:!0,default:!0}]),data:w.value,height:"100%","min-height":"88",loading:u.value,"loading-config":{text:" "},"column-config":{resizable:!0},"tree-config":{},"row-config":{isHover:!0,keyField:"id"},"checkbox-config":e.multiple?{highlight:!0,trigger:"row",reserve:!0,checkStrictly:!0}:{},"radio-config":e.multiple?{}:{highlight:!0,trigger:"row",reserve:!0},onCheckboxChange:L,onRadioChange:I},{default:xa(()=>[e.multiple?(ua(),Gt(Ta(Rl),{key:0,type:"checkbox",width:"40"})):(ua(),Gt(Ta(Rl),{key:1,type:"radio",width:"40",resizable:!1})),Xt(Ta(Rl),{field:"name",title:Ta(At)("sys.name"),"show-overflow":"","tree-node":e.isRdo},{default:xa(t=>{var a;return[Ht("div",_r,[Xt(C,null,{title:xa(()=>[Yt(ba(S((null==t?void 0:t.row)||{})),1)]),default:xa(()=>[Ht("div",Er,ba(S((null==t?void 0:t.row)||{})),1)]),_:2},1024),(null==t||null===(a=t.row)||void 0===a?void 0:a.default)&&e.isRdo?(ua(),zt("div",wr,ba(Ta(At)("sys.default")),1)):$t("",!0)])]}),_:1},8,["title","tree-node"]),Xt(Ta(Rl),{field:"description",title:Ta(At)("sys.description"),"show-overflow":""},{default:xa(e=>{var t,a;return[Ht("div",Tr,[Ht("span",{class:"gct-text-overflow",title:null==e||null===(t=e.row)||void 0===t?void 0:t.description},ba(null==e||null===(a=e.row)||void 0===a?void 0:a.description),9,Cr)])]}),_:1},8,["title"]),Xt(Ta(Rl),{field:"modifyUserName",title:Ta(At)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),Xt(Ta(Rl),{field:"modifyTime",title:Ta(At)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Ht("div",Rr,[Xt(R,aa(_.value,{class:"pagination-total-left",onChange:M}),null,16)])])],2)])):$t("",!0),v.value&&"btw"===r.value?(ua(),zt("div",Sr,[Xt(g,{model:f.value},{default:xa(()=>[Xt(c,{label:""},{default:xa(()=>[Xt(d,{value:f.value.name,"onUpdate:value":l[5]||(l[5]=e=>f.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:Ta(At)("sys.searchNameOfSth",{sth:"标签"}),clearable:"",onKeyup:l[6]||(l[6]=ka(e=>P(),["enter"])),onChange:V},{prefix:xa(()=>[...l[8]||(l[8]=[Ht("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Ht("div",xr,[Ht("div",Or,[Xt(Ta(Sl),{ref_key:"btwTableRef",ref:i,class:oa(["select-none",{vxetable:!0,default:!0}]),data:T.value,height:"100%","min-height":"88",loading:p.value,"loading-config":{text:" "},"column-config":{resizable:!0},"tree-config":{},"row-config":{isHover:!0,keyField:"id"},"checkbox-config":e.multiple?{highlight:!0,trigger:"row",reserve:!0,checkStrictly:!0}:{},"radio-config":e.multiple?{}:{highlight:!0,trigger:"row",reserve:!0},onCheckboxChange:L,onRadioChange:I},{default:xa(()=>[e.multiple?(ua(),Gt(Ta(Rl),{key:0,type:"checkbox",width:"40"})):(ua(),Gt(Ta(Rl),{key:1,type:"radio",width:"40",resizable:!1})),Xt(Ta(Rl),{field:"name",title:"标签模板名称","min-width":"120","show-overflow":""}),Xt(Ta(Rl),{field:"modelName",title:"关联模型",width:"120","show-overflow":""}),Xt(Ta(Rl),{field:"tmplPath",title:"BarTender "+Ta(At)("sys.labelTmplPath"),"min-width":"220","show-overflow":""},{default:xa(e=>{var t,a;return[Ht("span",kr,[Ht("img",{width:"16",height:"16",src:Ta("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon_printer'%3e%3cg%20id='Group%20427319057'%3e%3cpath%20id='Rectangle%204856'%20d='M4.32373%203.3C4.32373%203.13431%204.45805%203%204.62373%203L15.3709%203C15.5366%203%2015.6709%203.13431%2015.6709%203.3V7L4.32373%207V3.3Z'%20fill='%2388898D'/%3e%3crect%20id='Rectangle%204857'%20x='5.5'%20y='1.5'%20width='9'%20height='5'%20fill='%23DDDFE1'/%3e%3cg%20id='Mask%20group'%3e%3cmask%20id='mask0_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='1'%20y='6'%20width='18'%20height='11'%3e%3cpath%20id='Union'%20d='M19%2015.5C19%2016.0523%2018.5523%2016.5%2018%2016.5H2C1.44772%2016.5%201%2016.0523%201%2015.5V10.3117C1%209.77409%201.08671%209.23999%201.25678%208.72997L1.77246%207.18359C1.90865%206.77542%202.29039%206.50002%202.7207%206.5H17.2793C17.7096%206.50002%2018.0914%206.77542%2018.2275%207.18359L18.7432%208.72997C18.9133%209.23999%2019%209.77409%2019%2010.3117V15.5Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2169_716)'%3e%3cpath%20id='Union_2'%20d='M19%2015.5C19%2016.0523%2018.5523%2016.5%2018%2016.5H2C1.44772%2016.5%201%2016.0523%201%2015.5V10.3117C1%209.77409%201.08671%209.23999%201.25678%208.72997L1.77246%207.18359C1.90865%206.77542%202.29039%206.50002%202.7207%206.5H17.2793C17.7096%206.50002%2018.0914%206.77542%2018.2275%207.18359L18.7432%208.72997C18.9133%209.23999%2019%209.77409%2019%2010.3117V15.5Z'%20fill='url(%23paint0_linear_2169_716)'/%3e%3cpath%20id='Union_3'%20d='M16.1686%2016.517C16.1686%2017.0693%2015.8702%2017.517%2015.502%2017.517L4.49089%2017.5C4.1227%2017.5%203.82422%2017.0523%203.82422%2016.5V10.0491C3.82422%209.68413%203.86418%209.32026%203.94338%208.964L4.33919%207.18359C4.42999%206.77542%204.68448%206.50002%204.97135%206.5L15.0215%206.51697C15.3084%206.51699%2015.5629%206.79239%2015.6537%207.20056L16.0495%208.98097C16.1287%209.33723%2016.1686%209.70109%2016.1686%2010.0661V16.517Z'%20fill='url(%23paint1_linear_2169_716)'/%3e%3cg%20id='Mask%20group_2'%3e%3cmask%20id='mask1_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='3'%20y='6'%20width='14'%20height='6'%3e%3cpath%20id='Rectangle%204861'%20d='M3.82422%206L16.1686%206.01697V11.017L3.82422%2011V6Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask1_2169_716)'%3e%3cpath%20id='Union_4'%20d='M16.1686%2015.517C16.1686%2016.0692%2015.8702%2016.517%2015.502%2016.517L4.49089%2016.5C4.1227%2016.5%203.82422%2016.0523%203.82422%2015.5V9.91205C3.82422%209.6378%203.84678%209.36403%203.89168%209.09348L4.37308%206.19266C4.46387%205.78449%204.71836%205.50909%205.00524%205.50906L14.9876%205.52603C15.2745%205.52605%2015.529%205.80145%2015.6198%206.20962L16.1012%209.11045C16.1461%209.38099%2016.1686%209.65477%2016.1686%209.92901V15.517Z'%20fill='url(%23paint2_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3cpath%20id='Rectangle%204859'%20d='M1%209.5H3.5V16.5H1.5C1.22386%2016.5%201%2016.2761%201%2016V9.5Z'%20fill='url(%23paint3_linear_2169_716)'/%3e%3cpath%20id='Union_5'%20d='M4%206.5L3.55442%209.17345C3.5182%209.39078%203.5%209.61073%203.5%209.83105V10.5H1V6.5H4Z'%20fill='url(%23paint4_linear_2169_716)'/%3e%3cpath%20id='Rectangle%204860'%20d='M16.5%209.5H19V16.5H16.5V9.5Z'%20fill='url(%23paint5_linear_2169_716)'/%3e%3cpath%20id='Rectangle%204859_2'%20opacity='0.3'%20d='M5.34473%207.39502L14.6389%207.35339L14.5%206.50001H5.50001L5.34473%207.39502Z'%20fill='url(%23paint6_linear_2169_716)'/%3e%3cpath%20id='Union_6'%20d='M16%206.5L16.4456%209.17345C16.4818%209.39078%2016.5%209.61073%2016.5%209.83105V10.5H19V6.5H16Z'%20fill='url(%23paint7_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3cpath%20id='Rectangle%204858'%20d='M14.4224%2013.8896C15.3187%2013.8911%2016.0443%2014.6183%2016.0444%2015.5146V16.6426L15.9194%2016.6416L4.06689%2016.625H3.94189V15.502C3.942%2014.6038%204.67071%2013.8759%205.56885%2013.877L14.4224%2013.8896Z'%20fill='%2336363A'%20stroke='url(%23paint8_linear_2169_716)'%20stroke-width='0.25'/%3e%3cpath%20id='Rectangle%204855'%20d='M4.06689%2015.5014C4.06689%2014.9486%204.51548%2014.5006%205.06833%2014.5014L14.9211%2014.5155C15.4729%2014.5163%2015.9197%2014.9638%2015.9197%2015.5155V18.0163C15.9197%2018.2927%2015.6954%2018.5166%2015.419%2018.5163L4.56618%2018.5007C4.29032%2018.5003%204.06689%2018.2766%204.06689%2018.0007V15.5014Z'%20fill='url(%23paint9_linear_2169_716)'/%3e%3c/g%3e%3cg%20id='Mask%20group_3'%3e%3cmask%20id='mask2_2169_716'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='5'%20y='7'%20width='3'%20height='2'%3e%3cpath%20id='Rectangle%204862'%20d='M5.62474%207.67027C5.63945%207.57239%205.72354%207.5%205.82251%207.5L7.3%207.5C7.41046%207.5%207.5%207.58954%207.5%207.7V8.3C7.5%208.41046%207.41046%208.5%207.3%208.5H5.73231C5.61001%208.5%205.51635%208.39121%205.53454%208.27027L5.62474%207.67027Z'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask2_2169_716)'%3e%3cpath%20id='Rectangle%204864'%20d='M5.62474%207.67027C5.63945%207.57239%205.72354%207.5%205.82251%207.5L7.3%207.5C7.41046%207.5%207.5%207.58954%207.5%207.7V8.3C7.5%208.41046%207.41046%208.5%207.3%208.5H5.73231C5.61001%208.5%205.51635%208.39121%205.53454%208.27027L5.62474%207.67027Z'%20fill='%23D9D9D9'/%3e%3cpath%20id='Rectangle%204863'%20d='M6.53881%207.5H7.5V8.5H6.48926L6.53881%207.5Z'%20fill='url(%23paint10_linear_2169_716)'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2169_716'%20x1='10'%20y1='6.5'%20x2='10'%20y2='8.14483'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%2382828A'/%3e%3cstop%20offset='1'%20stop-color='%233F3F42'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2169_716'%20x1='10'%20y1='9.5'%20x2='10'%20y2='13'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23E1E5EA'/%3e%3cstop%20offset='1'%20stop-color='%23999EA1'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2169_716'%20x1='10'%20y1='9.49998'%20x2='10'%20y2='11'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%236B727A'/%3e%3cstop%20offset='1'%20stop-color='%237C7D7E'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2169_716'%20x1='2.25'%20y1='9.5'%20x2='2.25'%20y2='16.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23D4DCE2'/%3e%3cstop%20offset='1'%20stop-color='%23959696'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2169_716'%20x1='2.5'%20y1='9.5'%20x2='2.5'%20y2='10.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239DA6B2'/%3e%3cstop%20offset='1'%20stop-color='%23C9D1D9'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_2169_716'%20x1='17.75'%20y1='9.5'%20x2='17.75'%20y2='16.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23D4DCE2'/%3e%3cstop%20offset='1'%20stop-color='%23959696'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_2169_716'%20x1='10'%20y1='7.35339'%20x2='10'%20y2='6.20902'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23CDD2D5'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23CDD2D5'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_2169_716'%20x1='17.5'%20y1='9.5'%20x2='17.5'%20y2='10.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%239DA6B2'/%3e%3cstop%20offset='1'%20stop-color='%23C9D1D9'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_2169_716'%20x1='9.9933'%20y1='14'%20x2='9.9933'%20y2='16.517'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'%20stop-opacity='0.6'/%3e%3cstop%20offset='1'%20stop-color='white'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_2169_716'%20x1='9.99999'%20y1='14.5'%20x2='9.99999'%20y2='15.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23383839'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%2361656C'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_2169_716'%20x1='6.99463'%20y1='7.5'%20x2='6.99463'%20y2='8.5'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23B9C0C4'/%3e%3cstop%20offset='1'%20stop-color='%2392999D'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")},null,8,Dr),Ht("span",null,ba(null==e||null===(t=e.row)||void 0===t?void 0:t.printName),1),(ua(!0),zt(Bt,null,ha((null==e||null===(a=e.row)||void 0===a?void 0:a.tmplPath)||[],(t,a)=>{var o,i;return ua(),zt(Bt,{key:a},[l[9]||(l[9]=Yt(" /",-1)),Ht("img",{width:"16",height:"16",class:"ml-3px mr-2px",src:Ta("data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20id='icon_folder'%3e%3cg%20id='Group%20427318809'%3e%3cpath%20id='Subtract'%20d='M5.97207%202.19995C6.30242%202.19995%206.61145%202.3631%206.79779%202.63588L7.5%203.66382H16C16.5523%203.66382%2017%204.11153%2017%204.66382V16.95C17%2017.3642%2016.6642%2017.7%2016.25%2017.7H2C1.44772%2017.7%201%2017.2522%201%2016.7V3.19995C1%202.64767%201.44772%202.19995%202%202.19995H5.97207Z'%20fill='url(%23paint0_linear_2167_599)'/%3e%3cg%20id='Vector'%3e%3cpath%20d='M3%2017.7H2.25C2.66421%2017.7%203%2017.3642%203%2016.95V17.7Z'%20fill='%23FDB418'/%3e%3cpath%20d='M3%206.44995C3%205.89767%203.44771%205.44995%204%205.44995H18.25C18.6642%205.44995%2019%205.78574%2019%206.19995L19%2016.95C19%2017.3642%2018.6642%2017.7%2018.25%2017.7H3L3%206.44995Z'%20fill='url(%23paint1_linear_2167_599)'/%3e%3cpath%20d='M4%205.85034H18.25C18.4433%205.85034%2018.5996%206.00665%2018.5996%206.19995V16.95C18.5996%2017.1432%2018.4433%2017.2996%2018.25%2017.2996H3.40039V6.44995C3.40039%206.11858%203.66863%205.85034%204%205.85034Z'%20stroke='url(%23paint2_linear_2167_599)'%20stroke-opacity='0.85'%20stroke-width='0.8'/%3e%3c/g%3e%3cg%20id='Vector_2'%3e%3cpath%20d='M3%2017.7H2.25C2.66421%2017.7%203%2017.3642%203%2016.95V17.7Z'%20fill='url(%23paint3_linear_2167_599)'/%3e%3cpath%20d='M3%206.44995C3%205.89767%203.44771%205.44995%204%205.44995H18.25C18.6642%205.44995%2019%205.78574%2019%206.19995L19%2016.95C19%2017.3642%2018.6642%2017.7%2018.25%2017.7H3L3%206.44995Z'%20fill='url(%23paint4_linear_2167_599)'/%3e%3c/g%3e%3cpath%20id='Rectangle%204807'%20opacity='0.9'%20d='M14.25%208.99994H16.75V9.59994H14.25V8.99994Z'%20fill='%23EE9B01'/%3e%3cpath%20id='Rectangle%204808'%20opacity='0.9'%20d='M14.25%207.80008H16.75V8.40008H14.25V7.80008Z'%20fill='%23EE9B01'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_2167_599'%20x1='5.5'%20y1='3.69995'%20x2='9'%20y2='12.2'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23EE9B00'/%3e%3cstop%20offset='1'%20stop-color='%23EEA300'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2167_599'%20x1='6.5'%20y1='7.69995'%20x2='14'%20y2='17.2'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFBF35'/%3e%3cstop%20offset='1'%20stop-color='%23FFD560'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2167_599'%20x1='2.5'%20y1='6.19995'%20x2='6'%20y2='11.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='white'%20stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2167_599'%20x1='14'%20y1='15.7'%20x2='14'%20y2='16.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFCF54'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23F9B700'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2167_599'%20x1='14'%20y1='15.7'%20x2='14'%20y2='16.7'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FFCF54'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%23F9B700'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e")},null,8,Ir),Ht("span",null,ba(null==t?void 0:t.replace(b,"/")),1),0===a?(ua(),zt("span",{key:0,class:oa(["btw-label-tag","common"===(null==e||null===(o=e.row)||void 0===o?void 0:o.pathType)?"common":"local"])},ba("common"===(null==e||null===(i=e.row)||void 0===i?void 0:i.pathType)?Ta(At)("sys.shared"):Ta(At)("sys.local")),3)):$t("",!0)],64)}),128))])]}),_:1},8,["title"]),Xt(Ta(Rl),{field:"macAddress",title:Ta(At)("sys.macAddress"),width:"175","show-overflow":""},null,8,["title"]),Xt(Ta(Rl),{field:"createUserName",title:Ta(At)("sys.creator"),width:"120","show-overflow":""},null,8,["title"]),Xt(Ta(Rl),{field:"createTime",title:Ta(At)("sys.createTime"),width:"185"},null,8,["title"]),Xt(Ta(Rl),{field:"modifyUserName",title:Ta(At)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),Xt(Ta(Rl),{field:"modifyTime",title:Ta(At)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Ht("div",Lr,[Xt(R,aa(E.value,{class:"pagination-total-left",onChange:A}),null,16)])])])):$t("",!0)],2)}}}),Ar=/* @__PURE__ */Qe(Mr,[["__scopeId","data-v-d94551a9"]]),Nr=class{constructor(){t(this,"type",dt.DEFAULT),t(this,"ns",Vt("diagram-config-default-link")),t(this,"sourceHandle","handle-select"),t(this,"deleteMessage","sys.pageDesigner.dataLinkage.confirm.title")}reverse(e,t){let a=null;if(a=t.reverse?e.node.get(t.target,0,!0):e.node.get(t.source,0,!0),a){if(!0!==t.reverse?e.node.cache.reverseClear(a,rt.FORWARD):e.node.cache.reverseClear(a,rt.REVERSE),e.node.update(Object.assign(a,{value:null,label:null,noSelectField:!0!==t.reverse})),t.reverse){if(e.node.cache.reverseReset(a,rt.FORWARD))return}else if(e.node.cache.reverseReset(a,rt.REVERSE))return;t.reverse||e.node.create({type:ct.REVERSE,reverse:!0},{type:dt.VIRTUAL,reverse:!0,dashed:!0})}}options(e,t){let a=t.reverse?["Left",[1,.5,0,0,0,14]]:["Right",[0,.5,0,0,0,14]];t.return?a=t.startLine%2==1?["Right","Right"]:["Left","Left"]:t.startLine%2==0&&(a=t.reverse?["Right",[0,.5,0,0,0,14]]:["Left",[1,.5,0,0,0,14]]);let l="right";return l=t.startLine%2==1?t.return||t.reverse?"left":"right":t.return||t.reverse?"right":"left",{hoverClass:this.ns.e("line-hover"),paintStyle:{strokeWidth:1,stroke:"#3168EC",dashstyle:"0"},endpointStyle:{fill:"#3168EC"},anchors:a,connector:{type:Ol.type,options:{stub:[0,25],cornerRadius:10}},endpoints:[{type:xl.type,options:{radius:3}},{type:st.type,options:{direction:l}}],overlays:[{type:"Custom",options:{id:"change",location:.5,create:()=>{const e=document.createElement("div");return e.classList.add(this.ns.b("custom-overlay-line")),!0===t.return?e.classList.add(this.ns.be("custom-overlay-line","special-line")):e.classList.add(this.ns.be("custom-overlay-line","not-special-line")),e}}},{type:"Custom",options:{id:"delete",location:.5,create:()=>{const a=document.createElement("div");if(a.classList.add(this.ns.b("custom-overlay")),!0===t.return?a.classList.add(this.ns.be("custom-overlay","special-line")):a.classList.add(this.ns.be("custom-overlay","not-special-line")),t.type!==dt.VIRTUAL||!0===t.reverse){const l=document.createElement("i");l.className="iconfont icon-caiqie1 delete-action",l.onclick=a=>{a.stopPropagation(),tl.confirm({title:At(this.deleteMessage),content:At("sys.pageDesigner.dataLinkage.confirm.content"),onOk:()=>{if(!0!==t.reverse){const a=e.node.get(t.source,0,!0);a&&(e.node.cache.clear(a),e.node.update(Object.assign(a,{value:null,label:null})))}else{const a=e.node.get(t.target,0,!0);a&&(e.node.cache.reverseClear(a),e.node.update(Object.assign(a,{value:null,label:null,noSelectField:!1})))}}})},a.appendChild(l)}if(!0===e.config.oneDirection&&0===t.i||!1===e.config.oneDirection&&(null==e.config.reverseCount||t.i>=e.config.reverseCount)){const l=document.createElement("i");l.className="iconfont icon-qiehuan1 reverse-action",l.onclick=a=>{a.stopPropagation(),this.reverse(e,t)},a.appendChild(l)}return a}}}]}}click(e,t){(!0===e.config.oneDirection&&0===t.i||!1===e.config.oneDirection&&(null==e.config.reverseCount||t.i>=e.config.reverseCount))&&this.reverse(e,t)}},Ur=class{constructor(){t(this,"type",ct.DEFAULT),t(this,"component","DiagramConfigItem")}},Pr=class{constructor(){t(this,"type",ct.REVERSE),t(this,"component","DiagramConfigItemReverse")}},Vr=class extends Nr{options(e,t){const a=super.options(e,t);return a.paintStyle={strokeWidth:1,stroke:"#C3C3C3",dashstyle:"4 4"},a.endpointStyle={fill:"#C3C3C3"},a}},Fr=class{constructor(){t(this,"type",ct.VIRTUAL),t(this,"component","DiagramConfigItemVirtual")}},jr={install(e){ut.registerLink(dt.DEFAULT,new Nr),ut.registerLink(dt.VIRTUAL,new Vr),ut.registerNode(ct.DEFAULT,new Ur),ut.registerNode(ct.VIRTUAL,new Fr),ut.registerNode(ct.REVERSE,new Pr),e.component(nt.name,Wt(()=>import("./relationship-diagram-config-BwVOMUAb.js").then(e=>e.n))),e.component(pt.name,Wt(()=>import("./diagram-config-item-DYCiDqAy.js").then(e=>e.n))),e.component(i.name,Wt(()=>import("./diagram-config-item-virtual-Dw36zOeJ.js").then(e=>e.n))),e.component(vt.name,Wt(()=>import("./diagram-config-item-reverse-BKf_yXvB.js").then(e=>e.n)))}},Br={class:"header-action"},Kr={class:"title"},Gr={class:"switch-area"},$r={class:"check-title"},zr=/* @__PURE__ */Zt({__name:"header-action",props:{checked:{type:Boolean},title:{}},emits:["update:checked"],setup(e,{emit:t}){const a=e,l=t,o=Kt({get:()=>a.checked,set(e){l("update:checked",e)}});return(t,a)=>{const l=fa("a-switch");return ua(),zt("div",Br,[Ht("span",Kr,ba(e.title),1),Ht("div",Gr,[Ht("span",$r,ba(o.value?Ta(At)("sys.appDesigner.fieldEnable"):Ta(At)("sys.appDesigner.fieldUnEnable")),1),Xt(l,{checked:o.value,"onUpdate:checked":a[0]||(a[0]=e=>o.value=e)},null,8,["checked"])])])}}}),Hr=/* @__PURE__ */Qe(zr,[["__scopeId","data-v-4e281013"]]),qr=/* @__PURE__ */function(e){return e.USER_GROUP="USER_GROUP",e.MEMBER="MEMBER",e.ROLE="ROLE",e.MODEL="MODEL",e}({}),Yr=/* @__PURE__ */function(e){return e.Create="create",e.Edit="edit",e.Delete="delete",e}({}),Xr=/* @__PURE__ */function(e){return e.ORG="ORG",e.USER="USER",e.ROLE="ROLE",e.ENTITY_MODEL_DATA="ENTITY_MODEL_DATA",e.BUILT_CONDITION_MODEL="BUILT_CONDITION_MODEL",e.PERMISSION_SCOPE="PERMISSION_SCOPE",e}({}),Wr=[{label:At("sys.appDesigner.physicalBusinessModel"),value:Xr.ENTITY_MODEL_DATA},{label:At("sys.appDesigner.builtinConditionalModel"),value:Xr.BUILT_CONDITION_MODEL},{label:At("sys.appDesigner.permissionScope"),value:Xr.PERMISSION_SCOPE}],Zr=/* @__PURE__ */function(e){return e.TAB_DATA_RULES="tab_data_rules",e.TAB_FIELD_ROLE="tab_field_role",e.TAB_BUILT_PREM="tab_built_prem",e.TAB_PERM_SCOPE="tab_perm_scope",e}({}),Jr=/* @__PURE__ */function(e){return e.AND="AND",e.OR="OR",e}({}),Qr={[Jr.AND]:At("sys.webRender.and"),[Jr.OR]:At("sys.webRender.or")},ed={[Jr.AND]:At("sys.webRender.allCondition"),[Jr.OR]:At("sys.webRender.anyCondition")},td=e=>{if(!e||Array.isArray(e)&&0===e.length)return 0;const t=new Array(e.length).fill(0);return e.forEach((e,a)=>{t[a]+=1,Array.isArray(e.children)&&(t[a]+=e.children.length?td(e.children):1)}),Math.max(...t)},ad=(e,t)=>{for(let a=0;a<t.length;a++){if(e===t[a].id)return t[a];if(t[a].children){const l=ad(e,t[a].children);if(l)return l}}return null},ld=(e,t)=>{const{dragNode:a,node:l}=e,o=a.dataRef,i=l.dataRef,s=e.node.pos.split("-"),n=Number(s[s.length-1]),r=e.dropPosition-n,d=i.fullPath.split("/").length-1,u=ad(o.id,t),c=td(null==u?void 0:u.children),p={id:o.id};if(0===r){if(console.log("拖拽到目录里"),d+c>4)return{type:"error",msg:At("sys.webRender.dragError")};Object.assign(p,{targetParentId:i.id,targetSortNum:0})}else if(0!==r){if(console.log("拖拽到目录平级"),d+c>5)return{type:"error",msg:At("sys.webRender.dragError")};Object.assign(p,{targetParentId:i.parentId,targetSortNum:i.sortNum+1})}return p},od=va([]),id=va([]);function sd(e){const{getUuidGenerate:t}=Ft(va([]),va(""),{needPrefix:!0,isString:!1,prefix:"t_"}),a=t([]),l=e=>e.map(e=>{const t=pa(Object.assign({},{key:e.key,pid:e.pid,level:e.level,class:e.class},"group"===e.type?{operatorType:e.operatorType,type:e.type,children:pa([])}:{firstRow:e.firstRow,leftValue:e.leftValue,operatorValue:e.operatorValue,rightValue:e.rightValue}));var a;return Array.isArray(e.children)&&(null===(a=t.children)||void 0===a||a.push(...l(e.children))),t}),o=(e,t)=>e.forEach((a,l)=>{if(Array.isArray(a.children))a.type="group",a.class="tree-group",Va(a.operatorType)&&(a.operatorType=Jr.AND),o(a.children,a.children.length);else{const o=e.filter(e=>!e.children);0===l||l===o.length-1?(a.class=`${0===l?"first-node":""} ${l===o.length-1?"last-node":""}`,a.firstRow=0===l):a.class="",a.dataLen=t}}),i=({pid:e,insertId:t,data:a,isGroup:l=!1,prevId:o=""})=>{if("init"===e){const e={key:"root",pid:"",level:1,class:void 0,operatorType:void 0,type:void 0,children:pa([])};return void a.push(e)}return a.forEach(a=>{if(a.key===e){const e=pa(Object.assign({},{key:t,pid:a.key,level:Number(a.level)+1,class:""},l?{operatorType:void 0,type:void 0,children:pa([])}:{firstRow:void 0,leftValue:void 0,operatorValue:void 0,rightValue:void 0}));if(o){const t=a.children.findIndex(e=>e.key===o);a.children.splice(t+1,0,e)}else a.children.push(e);return void a.children.forEach(e=>{var t;e.dataLen=null===(t=a.children)||void 0===t?void 0:t.length})}a.children&&i({pid:e,insertId:t,data:a.children,isGroup:l,prevId:o})})},s=(e,t)=>t.forEach((a,l)=>{a.key!==e?a.children&&s(e,a.children):t.splice(l,1)}),n=(e,t,l=!1)=>{const s=a.next();i({pid:l?"init":t,insertId:s,data:e,isGroup:!0}),i({pid:l?t:s,insertId:l?s:a.next(),data:e}),o(e)},r=(e,t)=>{for(let a=0;a<t.length;a++){if(e===t[a].key)return t[a];if(t[a].children){const l=r(e,t[a].children);if(l)return l}}return null},d=(e=[],t)=>[].concat(...e.map(e=>(e.pathStr=`${t}|${e.children?e.operatorType:"content"}`,[].concat({key:e.key,pid:e.pid,operatorType:e.children?e.operatorType:"content",pathStr:e.pathStr,leftValue:e.leftValue,operatorValue:e.operatorValue,rightValue:e.rightValue},d(e.children||[],e.pathStr))))),u=(e=[],t,a)=>[].concat(...e.map(e=>{let l="";return!e.children&&e.leftValue&&e.leftValue.key&&e.operatorValue&&e.key&&(l=`${e.leftValue.field_search_key||e.leftValue.key}.${e.operatorValue}:${e.key}`,"filterConfig"===a?l=`${e.leftValue.modelKey}#${e.leftValue.key}.${e.operatorValue}:${e.key}`:"businessFlow"===a&&(l=`${e.leftValue.nodeKey}.${e.leftValue.modelKey}.${e.operatorValue}:${e.key}`)),[].concat(e.children?[]:e.leftValue&&e.leftValue.key&&e.operatorValue&&e.key?{name:l,type:t.operatorType,operatorType:e.children?e.operatorType:"content"}:[],[u(e.children||[],e,a)])})),c=e=>{const t=[];return e.forEach(e=>{Array.isArray(e)&&0!==e.length?t.push(c(e)):Array.isArray(e)||"content"!==e.operatorType||t.push(e)}),t},p=e=>{const t=[];return e.forEach((a,l)=>{0===l&&t.push(`#before${a.type}#`),Array.isArray(a)&&0!==a.length?t.push(...p(a)):Array.isArray(a)||t.push(a.name),l===e.length-1&&t.push("#after#")}),t};return{setTree:t=>{t?(console.log("转换成页面想要的tree结构",JSON.parse(t)),e?id.value=l(JSON.parse(t)):od.value=l(JSON.parse(t))):n(e?id.value:od.value,"root",!0)},showDataRulesTree:id,editDataRulesTree:od,addNewGroup:e=>{n(od.value,e)},addNewRow:(e,t)=>{i({pid:e,insertId:a.next(),data:od.value,isGroup:!1,prevId:t}),o(od.value)},deleteGroup:e=>{s(e,od.value),o(od.value)},deleteRow:e=>{s(e,od.value),o(od.value)},updateNodeItem:(e,t,a,l)=>{const o=r(e,od.value);if(o)if("rightValue"===t?((null==l?void 0:l.isRest)&&(o.rightValue=pa(l.defaultValues.map(e=>({[l.key]:e})))),"valueType"===(null==l?void 0:l.key)&&(o[t][l.index]={}),o[t][null==l?void 0:l.index][null==l?void 0:l.key]=a):o[t]="object"==typeof a?pa(a):a,"leftValue"===t)o.operatorValue=void 0,o.rightValue=void 0;else if("operatorValue"===t){var i;o.rightValue=pa(null==l||null===(i=l.defaultValues)||void 0===i?void 0:i.map(e=>({[l.key]:e})))}},getDataRules:(t,a)=>{const l=d(e?id.value:od.value,"");let o;const i={},s=[],n={};if(l.forEach(e=>{if("content"===e.operatorType){if(Va(e.leftValue)||Va(e.operatorValue)||Va(e.rightValue))return void(o=At("sys.webRender.saveTip"));let l="";if(l="businessFlow"===t?`${e.leftValue.nodeKey}.${e.leftValue.modelKey}.${e.operatorValue}:${e.key}`:"filterConfig"===t?`${e.leftValue.modelKey}#${e.leftValue.key}.${e.operatorValue}:${e.key}`:`${e.leftValue.field_search_key||e.leftValue.key}.${e.operatorValue}:${e.key}`,[Ct.ISNOTNULL,Ct.ISNULL].includes(e.operatorValue))Object.assign(i,{[l]:null});else{if(e.rightValue.some(e=>Va(e.result)))return void(o=At("sys.webRender.saveTip"));const t=[],r=e.rightValue.map(o=>{if(t.push(o.valueType),"SYS"===o.valueType&&s.push(l),[gt.USER_MULTI,gt.ORG_MULTI,gt.USER,gt.ORG].includes(e.leftValue.type)&&"FIXED"===o.valueType){var i,n;const t=(null==o||null===(i=o.result)||void 0===i||null===(i=i.orgs)||void 0===i?void 0:i.map(e=>`ORG:${e}`))??[],a=(null==o||null===(n=o.result)||void 0===n||null===(n=n.users)||void 0===n?void 0:n.map(e=>`USER:${e}`))??[];var r;return[gt.USER,gt.ORG].includes(e.leftValue.type)&&[Ct.EQ,Ct.NE].includes(e.operatorValue)?null===(r=[...t,...a])||void 0===r?void 0:r[0]:[...t,...a]}return"FIELD"===(null==o?void 0:o.valueType)?a?`__F__:${a}.${null==o?void 0:o.result}`:`__F__:${null==o?void 0:o.result.replace("$",".")}`:null==o?void 0:o.result});Object.assign(n,{[l]:1===t.length?_a(t[0]):_a(t)}),Object.assign(i,{[l]:1===r.length?_a(r[0]):_a(r)})}}}),o)return{error:o};const r=p(c(u((e?id.value:od.value)[0].children,(e?id.value:od.value)[0],t))),v=r.toString().replace(/#beforeAND#,/g,"AND(").replace(/#beforeOR#,/g,"OR(").replace(/,#after#/g,")");return console.warn("getDataRules query",i),console.warn("getDataRules varKeys",s),console.warn("getDataRules explist",r),console.warn("getDataRules expStr",v),{query:i,varKeys:s,exp:v,treeStr:JSON.stringify(e?id.value:od.value),typeMap:n}},resetTree:()=>{e?id.value=[]:od.value=[]},getAllExpandedKeys:()=>{const t=d(e?id.value:od.value,"");return{allExpandedKeys:t.map(e=>e.key),selectFiledKeys:t.map(e=>{var t;return null===(t=e.leftValue)||void 0===t?void 0:t.id}).filter(e=>e)}}}}var nd={class:"tree-root-node"},rd=/* @__PURE__ */Zt({__name:"tree-root-node",props:{data:{},level:{},id:{},operatorType:{},readonly:{type:Boolean}},setup(e){const t=ea("isDataFilterEditor"),a=[{label:At(Qr[Jr.AND]),value:Jr.AND},{label:At(Qr[Jr.OR]),value:Jr.OR}],l=e,{addNewGroup:o,deleteGroup:i,updateNodeItem:s,addNewRow:n}=sd(l.readonly),r=Kt({get:()=>l.operatorType,set(e){s(l.id,"operatorType",e)}}),d=Kt(()=>1===l.level),u=()=>{o(l.id)},c=()=>{i(l.id)},p=Kt(()=>l.data.key),v=Kt(()=>{var e;return null===(e=l.data)||void 0===e||null===(e=e.children)||void 0===e?void 0:e.filter(e=>!e.children).length}),m=()=>{n(p.value)};return(l,o)=>{const i=fa("a-select"),s=fa("a-form-item-rest"),n=fa("a-button");return ua(),zt(Bt,null,[Ht("div",nd,[Xt(s,null,{default:xa(()=>[Xt(i,{value:r.value,"onUpdate:value":o[0]||(o[0]=e=>r.value=e),class:"tree-root-node-select",disabled:e.readonly,style:{width:"60px"},options:a,placeholder:Ta(At)("sys.chooseText")},null,8,["value","disabled","placeholder"])]),_:1}),e.readonly?$t("",!0):(ua(),Gt(n,{key:0,type:"primary",style:{"margin-left":"24px"},ghost:"",onClick:u},{icon:xa(()=>[Xt(Ta(wl))]),default:xa(()=>[Yt(" "+ba(Ta(At)("sys.appDesigner.createGroup")),1)]),_:1})),e.readonly||d.value?$t("",!0):(ua(),Gt(n,{key:1,type:"primary",ghost:"",danger:"",style:{"margin-left":"16px"},onClick:c},{icon:xa(()=>[...o[1]||(o[1]=[Ht("i",{class:"iconfont icon-shanchu1",style:{"margin-right":"4px"}},null,-1)])]),default:xa(()=>[Yt(" "+ba(Ta(At)("sys.component.userCmp.deleteGroup")),1)]),_:1}))]),Ta(t)&&!v.value?(ua(),zt("div",{key:0,class:"tree-root-node-add-row mt4px",onClick:m}," +"+ba(Ta(At)("sys.appDesigner.addCondition")),1)):$t("",!0)],64)}}}),dd=/* @__PURE__ */Qe(rd,[["__scopeId","data-v-74e5fbf3"]]),ud=/* @__PURE__ */Zt({__name:"select-userdep-cmp",props:{supportModalType:{},pickerCompParams:{},value:{}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,{openPickerByUser:o,openPicker:i,openPickerByDept:s,getUserByIds:n,getDeptOptions:r}=ae({type:_.APP,fieldKey:a.pickerCompParams.fieldKey,modelKey:a.pickerCompParams.modelKey}),d=va([]),u=Kt(()=>{var e,t;if(a.value)return[].concat((null===(e=a.value)||void 0===e?void 0:e.orgs)??[],(null===(t=a.value)||void 0===t?void 0:t.users)??[])});Ra([()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.orgs},()=>{var e;return null===(e=a.value)||void 0===e?void 0:e.users}],async([e,t])=>{let a=[],l=[];if(Array.isArray(t)&&0!==t.length){const e=await n({ids:_a(t).join(",")});a=null==e?void 0:e.map(e=>({label:At(e.__LABEL__),value:e.id}))}if(Array.isArray(e)&&0!==e.length){const e=await r();l=null==e?void 0:e.map(e=>({label:At(e.name),value:e.id}))}d.value=[...a,...l]},{deep:!0,immediate:!0});const c=(e,t)=>{var o,i;const s=((null===(o=a.value)||void 0===o?void 0:o.orgs)??[]).filter(t=>t!==e),n=((null===(i=a.value)||void 0===i?void 0:i.users)??[]).filter(t=>t!==e),r={};0===s.length&&0===n.length||(r.orgs=s,r.users=n),l("change",r,0)},p=()=>{var e,t;if("user&org"===a.supportModalType)i({userIds:(null===(e=a.value)||void 0===e?void 0:e.users)??[],deptIds:(null===(t=a.value)||void 0===t?void 0:t.orgs)??[],callback:async e=>{const{deptIds:t,userIds:a}=e,o={};0===t.length&&0===a.length||(o.orgs=t,o.users=a),l("change",o,0)}});else if("user"===a.supportModalType){var n;o({userIds:(null===(n=a.value)||void 0===n?void 0:n.users)??[],multiple:a.pickerCompParams.multiple,callback(e,t){const a={};0!==e.length&&(a.users=e),l("change",a,0)}})}else if("org"===a.supportModalType){var r;s({deptIds:(null===(r=a.value)||void 0===r?void 0:r.orgs)??[],multiple:a.pickerCompParams.multiple,callback:async e=>{const t={};0!==e.length&&(t.orgs=e),l("change",t,0)}})}};return(e,t)=>{const a=fa("a-select");return ua(),Gt(a,{open:!1,value:u.value,"max-tag-count":"responsive","max-tag-text-length":2,options:d.value,onClick:p,onDeselect:c},null,8,["value","options"])}}}),cd=ud,pd=/* @__PURE__ */Zt({__name:"request-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},emits:["update:pageNo","update:value"],setup(e,{emit:t}){const a=t,l=e,o=va([]),i=va(""),s=va("name_"),n=Kt(()=>l.value||[]);function r(e){return{label:e.__LABEL__??e.text??e.name_??e.name??"",value:e.id_??e.value??e.key??e.id??""}}const d=(e,t)=>!!t&&(t.label?t.label.toLowerCase().includes(e.toLowerCase()):null!=t.value&&String(t.value).toLowerCase().includes(e.toLowerCase())),u=Kt(()=>{var e;return null===(e=Object.keys(l.apiParams))||void 0===e?void 0:e.includes("pageNo")}),c=Kt(()=>({showSearch:!0,filterOption:!u.value&&d,maxTagTextLength:2,maxTagCount:"responsive"}));async function p(e){if("function"!=typeof l.api)return[];const t=await l.api({...e??{}});return(Array.isArray(t)?t:(null==t?void 0:t.data)??[]).map(r)}function v(e){if(!(null==e?void 0:e.trim()))return l.apiParams??{};const t=`${s.value}.ilike`;return{...l.apiParams,query:{[t]:e.trim()},exp:`OR(${t})`}}async function m(e){var t;const s=e.target;if(s.scrollTop+s.offsetHeight!==s.scrollHeight)return;const{pageNo:n=1,pageSize:r=10}=l.apiParams??{};if(Number(n)*Number(r)>(null===(t=o.value)||void 0===t?void 0:t.length))return;a("update:pageNo"),await la();const d=await p(v(i.value??"")??{}),u=new Set(o.value.map(e=>e.value)),c=d.filter(e=>!u.has(e.value));c.length&&(o.value=[...o.value,...c])}const h=Ma(async e=>{u.value&&(i.value=e.trim(),a("update:pageNo",1),o.value=await p(v(i.value)))},200),y=async e=>{a("update:value",e),e&&0!==e.length||!u.value||(a("update:pageNo",1),o.value=await p(l.apiParams??{}))},f=async()=>{u.value&&(n.value&&0!==n.value.length||!i.value||(a("update:pageNo",1),o.value=await p(l.apiParams??{})),i.value="")};return sa(async()=>{!async function(){const{bindModelKey:e}=l.apiParams??{};e&&(s.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField||"name_")}(),o.value=await p(l.apiParams??{})}),(e,t)=>{const a=fa("a-select");return ua(),Gt(a,aa({value:n.value,options:o.value},c.value,{onPopupScroll:m,onSearch:Ta(h),onChange:y,onFocus:f}),null,16,["value","options","onSearch"])}}}),vd=pd,md=/* @__PURE__ */Zt({__name:"request-tree-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},setup(e){const t=e,a=va([]);return sa(async()=>{if("function"==typeof t.api){const l=await t.api({...t.apiParams??{}}),o=Array.isArray(l)?l:l.data??[];if((null==(e=t.apiParams)?void 0:e.fieldType)===gt.PRINTER){const e=function(e){return e.flatMap(e=>{var t,a;const l=null===(t=e.printChildNode)||void 0===t?void 0:t.find(e=>"是"===e.defaultPrint);return[{...e,label:e.name,value:e.printKey,parentId:e.parentId||"ROOT",dftPrintInfo:e.type===wt.CLIENT_PRINT&&l?{...l,value:l.printKey,label:l.name}:void 0},...(null===(a=e.printChildNode)||void 0===a?void 0:a.map(t=>({...t,label:t.name,value:t.printKey,parentId:e.printKey})))??[]]})}(o??[]);a.value=St.list_to_tree(La(e.map(e=>({...e,id:e.printKey}))),e=>({...e,title:e.label??e.name??"",disabled:"ROOT"===e.parentId&&e.type===wt.INTERNET_PRINT}))}else{const e=o.map(e=>(void 0===e.__NON_LEAF__&&(e.__NON_LEAF__=o.some(t=>t.parent_id_===e.id_)),{label:e.__LABEL__,value:e.id_,full_path_:e.full_path_,_item:e,id:e.id_,pId:e.parent_id_,isLeaf:!e.__NON_LEAF__}));a.value=e.map(t=>{const a=t.full_path_.split("/").map(t=>{const a=e.find(e=>e.value===t);return a?a.label:null}).filter(e=>e).join("/");return{...t,label:a,title:a}})}}var e}),(e,t)=>{const l=fa("a-tree-select");return ua(),Gt(l,{class:"gct-request-tree-select","dropdown-class-name":"gct-request-tree-select-dropdown","tree-data":a.value,"tree-data-simple-mode":"","allow-clear":"","show-checked-strategy":Ta(dl).SHOW_ALL,"tree-node-label-prop":"label","filter-tree-node":!1,"max-tag-count":"responsive","max-tag-text-length":3},null,8,["tree-data","show-checked-strategy"])}}}),hd=md,yd=/* @__PURE__ */Zt({__name:"ndo-select-cmp",props:{value:{},apiParams:{},filterType:{}},setup(e){const t=e,a=va([]),l=va([]),o=va([]),i=va(""),s=va(!1),n=va(!1),r=va(),d=va({initial:{pageNo:1,totalPage:1,hasMore:!0},search:{pageNo:1,totalPage:1,hasMore:!0}}),u=Kt(()=>""!==i.value),c=Kt(()=>1===(u.value?d.value.search:d.value.initial).pageNo);Ra(()=>t.value,async e=>{e&&0!==e.length&&0!==e.filter(e=>!ja(e)).filter(e=>![...l.value,...o.value,...a.value].some(t=>t.value===e)).length&&await async function(e){try{const a=await _api.apaas.modelComprehensive.getBizServiceModelCategoryModelKeyBsKey({bsKey:"listByIds",...t.apiParams??{},modelCategory:"entity"},{ids:e.join(",")});if(null==a?void 0:a.data){_.value&&!r.value&&await f();const e=((null==a?void 0:a.data)??[]).map(e=>({label:e.name_||e[r.value],value:e.id_,type:"data"}));_.value?(o.value=b(o.value,e),l.value=b(l.value,e)):(o.value=[...e,...o.value],l.value=[...e,...l.value])}}catch(a){console.error("获取回显数据失败:",a)}}(e)},{immediate:!0});const p=Kt(()=>u.value?a.value:l.value),v=Kt(()=>{if(h.value)return[];const e=p.value.filter(e=>"status"!==e.type).map(e=>({label:e.label,value:e.value})),t=[];return p.value.length>0&&(s.value||n.value?t.push({label:s.value?At("sys.loadingText"):At("sys.edhr.loadingMore"),value:"loading_status",disabled:!0,type:"status"}):m.value||_.value||t.push({label:At("sys.noMoreData"),value:"no_more_status",disabled:!0,type:"status"})),[...e,...t]}),m=Kt(()=>(u.value?d.value.search:d.value.initial).hasMore),h=Kt(()=>!s.value&&0===p.value.length),y=Kt(()=>({dropdownMatchSelectWidth:180,dropdownClassName:"gct-project-select-dropdown vxe-table--ignore-clear",allowClear:!0,showSearch:!0,defaultActiveFirstOption:!1,filterOption:!!_.value&&g,mode:"multiple",maxTagCount:"responsive",maxTagTextLength:2,notFoundContent:h.value&&!_.value?At("sys.edhr.noSearchResult"):void 0}));sa(async()=>{await E(!0),_.value&&f()});const f=async()=>{const{modelKey:e}=t.apiParams??{};r.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField},g=(e,t)=>{if(!t)return!1;const a=e.toLowerCase();return t.label?String(t.label).toLowerCase().includes(a):null!=t.value&&String(t.value).toLowerCase().includes(a)},b=(e,t)=>{const a=/* @__PURE__ */new Map;return[...e,...t].forEach(e=>{a.has(e.value)||a.set(e.value,e)}),Array.from(a.values())},_=Kt(()=>"permissionScope"===t.filterType),E=async(e=!0)=>{if(s.value)return;s.value=!0;const a=d.value.initial;try{e&&(a.pageNo=1);const i=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listByPage"},{pageNo:a.pageNo,pageSize:20},{addDisplayLabel:_.value?1:void 0});if(null==i?void 0:i.data){const t=((null==i?void 0:i.data)??[]).map(e=>({label:e.name_||e.__LABEL__,value:e.id_,type:"data"}));a.totalPage=i.totalPage||1,a.hasMore=a.pageNo<a.totalPage,l.value=b(e?o.value:l.value,t)}}catch(i){console.error("加载数据失败:",i),a.hasMore=!1}finally{s.value=!1}},w=async(e,l=!0)=>{if(s.value)return;s.value=!0;const o=d.value.search;try{l&&(o.pageNo=1);const i=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listByPage"},{pageNo:o.pageNo,pageSize:20,query:{name_:_.value?void 0:e}},{addDisplayLabel:_.value?1:void 0});if(null==i?void 0:i.data){const e=((null==i?void 0:i.data)??[]).map(e=>({label:e.name_,value:e.id_,type:"data"}));o.totalPage=i.totalPage||1,o.hasMore=o.pageNo<o.totalPage,a.value=l?e:[...a.value,...e]}else a.value=[]}catch(i){console.error("加载搜索数据失败:",i),a.value=[],o.hasMore=!1}finally{s.value=!1}},T=Ha(e=>{if(s.value||n.value||!m.value)return;const t=e.target;t.scrollHeight-t.scrollTop-t.clientHeight<=30&&C()},200),C=async()=>{n.value=!0;try{(u.value?d.value.search:d.value.initial).pageNo+=1,u.value?await w(i.value,!1):await E(!1)}catch(e){console.error("加载更多数据失败:",e)}finally{n.value=!1}},R=Ma(e=>{i.value=e.trim(),i.value&&w(i.value,!0)},500),S=e=>{_.value||R(e)},x=()=>{i.value=""};return(t,a)=>{const l=fa("a-tooltip"),o=fa("a-select");return ua(),Gt(o,aa({value:e.value,options:v.value,loading:s.value&&c.value},y.value,{onSearch:S,onClear:x,onPopupScroll:Ta(T)}),{maxTagPlaceholder:xa(e=>{return[Xt(l,{title:(t=e,t.map(e=>e&&e.label?e.label:String(e)).join(", "))},{default:xa(()=>[Ht("span",null,"+"+ba(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},16,["value","options","loading","onPopupScroll"])}}}),fd=yd,gd=/* @__PURE__ */Zt({__name:"select-more",emits:["next"],setup(e,{emit:t}){const a=va(null),l=t,o=Me(a,([{isIntersecting:e}],t)=>{e&&l("next")});return da(()=>{o.stop()}),(e,t)=>{const l=fa("a-spin");return ua(),zt("div",{ref_key:"target",ref:a},[Xt(l,{size:"small"})],512)}}});function bd({bindModelKey:e,modelCategory:t}){const a=va([]);let l=(null==="name_"?void 0:"name_".split(","))||[];async function o({id_:a}={}){var l;const[o,i]=(null==a?void 0:a.split(":"))??["",""];console.log("_cId",i);const s=await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListVersionByRefIdsWithParent",modelKey:e,modelCategory:t},{foreignFields:[]},{refIds:a,includeDeleted:1})||{},n=null==s||null===(l=s.data)||void 0===l?void 0:l[0],r=n.__LABEL__||n.name_;let d=[];try{var u;d=null===(u=(await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListVersionById",modelKey:e,modelCategory:t},{foreignFields:[]},{id:o})||{}).data)||void 0===u?void 0:u.map(e=>{const t=e.__LABEL__||e.version_;return{value:`${o}:${e.id_}`,title:Qt("div",[Qt("span",{class:"version"},t),e.default_?Qt("span",{class:"version gct-custom-tag ml8px"},At("sys.default")):null]),_info:{...e},full_path:Qt("div",[Qt("span",`${r}:${t}`)])}})}catch(c){console.error("getChildrens 获取子节点失败:",c)}return{value:o,title:r,full_path:Qt("div",[Qt("span",`${r}`),Qt("span",{class:"gct-custom-tag ml8px"},At("sys.default"))]),children:d}}return async function(){if(e){var t;const a=await _api.apaas.modelMeta.getInfo({id:e})||{};l=(null===(t=a.displayField?`${a.displayField},name_`:"name_")||void 0===t?void 0:t.split(","))||[]}}(),{getChildrens:async(e=[])=>{try{if(!Array.isArray(e)||0===e.length)return;for(const s of e){var t,l;if(!s)continue;const[e,n]=s.split(":");if(console.log("_cId",n),null===(t=a.value)||void 0===t?void 0:t.some(t=>t.value===e))continue;const r=await o({id_:s});var i;(null===(l=a.value)||void 0===l?void 0:l.some(t=>t.value===e))||r&&(null===(i=a.value)||void 0===i||i.unshift(r))}}catch(s){console.error("getChildrens 批量加载失败:",s)}},getAsyncOptions:async function o(i){var s;i.pageNo||(i.pageNo=1);const{optionsData:n,complete:r}=await async function(a={}){let o=!0,i=[];const s=a.keyword?(n=a.keyword,(null==l?void 0:l.reduce((e,t)=>(e[t.split(".").length>1?t:t+".like"]=n,e),{}))||{}):{};var n;const r=`OR(${l.map(e=>`${e}.like`).join(",")})`,d=await _api.apaas.modelComprehensive.postBizServiceModelCategoryModelKeyBsKey({bsKey:"rdoListByPage",modelKey:e,modelCategory:t},{},{exp:r,query:s,pageSize:30,pageNo:a.pageNo})||{};return o=!d.totalPage||d.totalPage<=d.pageNo,i=((null==d?void 0:d.data)||[]).map(e=>{var t,a;const l=e.__LABEL__||e.name_;return{value:e.id_,title:l,_info:null===(t=e.__CHILDREN__)||void 0===t?void 0:t.find(e=>e.default_),full_path:Qt("div",[Qt("span",`${l}`),Qt("span",{class:"gct-custom-tag ml8px"},At("sys.default"))]),children:null===(a=e.__CHILDREN__)||void 0===a?void 0:a.map(t=>{const a=t.__LABEL__||t.version_;return{value:`${e.id_}:${t.id_}`,title:Qt("div",[Qt("span",{class:"version"},a),t.default_?Qt("span",{class:"version gct-custom-tag ml8px"},At("sys.default")):null]),_info:{...t},full_path:Qt("div",[Qt("span",`${l}:${a}`)])}})}}),{complete:o,optionsData:i}}(i);if(null===(s=a.value)||void 0===s?void 0:s.length)if(i.pageNo>1){var d;null===(d=a.value)||void 0===d||d.pop()}else a.value=[];var u;n.forEach(e=>{var t;null===(t=a.value)||void 0===t||t.push(e)}),r||null===(u=a.value)||void 0===u||u.push({selectable:!1,title:()=>Qt(gd,{onNextOnce:()=>{i.pageNo+=1,o(i)}})})},treeData:a}}var _d=/* @__PURE__ */Zt({__name:"rdo-select-cmp",props:{value:{},apiParams:{},parentToDefault:{type:Boolean,default:!0}},setup(e){const t=e,a=va(),{getChildrens:l,getAsyncOptions:o,treeData:i}=bd({bindModelKey:t.apiParams.modelKey,modelCategory:"entity"});async function s(e={}){await o({modelCategory:"entity",pageSize:9999,queryData:{...e.queryData},...e})}sa(s),Ae(()=>t.value,async e=>{try{await l(e)}catch(t){console.log(t)}},{debounce:200,immediate:!0});const n=Ma(async e=>{await s({keyword:e,pageNo:1}),e||await l(t.value)},200);return(t,l)=>{const o=fa("a-tooltip"),s=fa("a-tree-select");return ua(),Gt(s,{"search-value":a.value,"onUpdate:searchValue":l[0]||(l[0]=e=>a.value=e),value:e.value,style:{width:"100%"},"tree-data":Ta(i),"show-search":"","allow-clear":!0,multiple:"","tree-node-label-prop":"full_path","show-checked-strategy":Ta(dl).SHOW_ALL,"max-tag-count":"responsive","max-tag-text-length":2,virtual:!1,"filter-tree-node":()=>!0,"dropdown-class-name":"vxe-table--ignore-clear",onSearch:Ta(n)},{maxTagPlaceholder:xa(e=>{return[Xt(o,{title:(t=e,t.map(e=>{var t;return null===(t=e.label)||void 0===t||null===(t=t.children)||void 0===t||null===(t=t.map(e=>e.children))||void 0===t?void 0:t.join(":")}).join(", "))},{default:xa(()=>[Ht("span",null,"+"+ba(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},8,["search-value","value","tree-data","show-checked-strategy","onSearch"])}}}),Ed=_d,wd=/* @__PURE__ */Zt({__name:"tree-select-cmp",props:{value:{},api:{type:Function},apiParams:{},filterType:{}},setup(e){const t=e,a=va([]),l=va(),o=Kt(()=>"permissionScope"===t.filterType);sa(async()=>{o.value&&await(async()=>{const{modelKey:e}=t.apiParams??{};l.value=(await _api.apaas.modelMeta.getInfo({id:e})||{}).displayField})();const e=await _api.apaas.bizService.postModelKeyBsKey({...t.apiParams??{},bsKey:"listAll"},{},{}),i=Array.isArray(e)?e:e.data??[],s=i.map(e=>(void 0===e.__NON_LEAF__&&(e.__NON_LEAF__=i.some(t=>t.parent_id_===e.id_)),{label:e.name_||e[l.value]||e.id_,value:e.id_,full_path_:e.full_path_,_item:e,id:e.id_,pId:e.parent_id_,isLeaf:!e.__NON_LEAF__}));a.value=s.map(e=>{const t=e.full_path_.split("/").map(e=>{const t=s.find(t=>t.value===e);return t?t.label:null}).filter(e=>e).join("/");return{...e,label:t,title:e.label}})});const i=(e,t)=>{var a;return null==t||null===(a=t.title)||void 0===a?void 0:a.toLowerCase().includes(e.toLowerCase())};return(e,t)=>{const l=fa("a-tooltip"),s=fa("a-tree-select");return ua(),Gt(s,{"tree-data":a.value,"tree-data-simple-mode":"","allow-clear":"","show-checked-strategy":Ta(dl).SHOW_ALL,"tree-node-label-prop":"label",multiple:"","filter-tree-node":!!o.value&&i,"max-tag-count":"responsive","max-tag-text-length":2,"show-search":o.value},{maxTagPlaceholder:xa(e=>{return[Xt(l,{title:(t=e,t.map(e=>e&&e.label?e.label:String(e)).join(", "))},{default:xa(()=>[Ht("span",null,"+"+ba(null==e?void 0:e.length),1)]),_:2},1032,["title"])];var t}),_:1},8,["tree-data","show-checked-strategy","filter-tree-node","show-search"])}}}),Td=wd,Cd=/* @__PURE__ */Zt({__name:"select-modal-cmp",props:{supportModalType:{},pickerCompParams:{},value:{}},emits:["change"],setup(e,{emit:t}){const a=e,l=t,o=va(),i="range-user-modal_"+jt(16,16),s=va([]),n=va([]),r=va([]),d=va([]),u=va([]),c=va({}),p=Kt(()=>{var e;return null===(e=a.pickerCompParams)||void 0===e?void 0:e.multiple}),v=Kt(()=>({mode:p.value?"multiple":void 0,dropdownClassName:"hidden"})),m=Kt(()=>{if(a.value){let e=a.value;const t=p.value?Array.isArray(e)?e:(null==e?void 0:e.split(",").filter(e=>e))||[]:e;return"range_user"===a.supportModalType?t:e}}),h=e=>{if("range_user"===a.supportModalType){const t=a.value,o=(p.value?Array.isArray(t)?[...t]:String(t??"").split(",").filter(Boolean):null!=t&&""!==t?[String(t)]:[]).filter(t=>String(t)!==String(e));return void l("change",o.length?o:"",0)}if("label_template_ref"===a.supportModalType)if(p.value){const t=a.value;l("change",(Array.isArray(t)?[...t]:null!=t&&""!==t?String(t).split(",").filter(Boolean):[]).filter(t=>String(t)!==String(e)),0)}else l("change","",0)},y=Kt(()=>"range_user"===a.supportModalType?[...s.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...n.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...r.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)}),...d.value.filter(e=>{var t;return null===(t=m.value)||void 0===t?void 0:t.includes(e.value)})]:"label_template_ref"===a.supportModalType?u.value.map(e=>({...e,value:e.id,label:`${e.name}${e.version&&"btw"!==e.printType?" : "+e.version:""}`})):[]),f=async e=>{var t;if(!(null==e?void 0:e.length))return;const a=null==e||null===(t=e.filter(e=>e.includes("USER:")&&!d.value.some(t=>t.value===e)))||void 0===t?void 0:t.map(e=>e.replace(/USER:/,""));null!=a&&a.length&&await g(a)},g=async e=>{const t=(await _api.platform.orgUserPicker.getTenantManagementUserListByIds({ids:e.join(",")})??[]).map(e=>({...e,value:`USER:${e.id}`,label:e.fullname}));d.value.push(...t)},b=e=>!!(null==e?void 0:e.printType)&&"btw"===e.printType;async function _(e=m.value){await w(e);const t=E(e);if(!t.length)return p.value?[]:void 0;const a=t.map(e=>u.value.find(t=>String(t.id)===String(e))).filter(Boolean).map(e=>{const t=u.value.find(t=>t.id===(null==e?void 0:e.key)),a=(null==t?void 0:t.categoryId)||e.categoryId,l={...e,categoryId:a};return{...l,version:b(l)?"":null==l?void 0:l.version}});return p.value?a.map(e=>_a(e)):a[0]?_a(a[0]):void 0}function E(e){return null==e||""===e?[]:p.value?Array.isArray(e)?e.map(String).filter(Boolean):String(e).split(",").filter(Boolean):[String(e)]}async function w(e){const t=E(e??m.value);t.length&&await Promise.all(t.map(async e=>{u.value.some(t=>String(t.id)===String(e))||await async function(e){const t=await _api.apaas.printDesigner.getInfo({id:e,moduleType:Tt.LABEL});return t&&u.value.push({...t,id:t.baseId?t.baseId+":"+t.id:t.id}),t}((String(e).includes(":")?String(e).split(":").pop():String(e))||e)}))}const T=async e=>{var t;const a=null==e||null===(t=e.filter(e=>e.includes("USER:")&&!d.value.some(t=>t.value===e)))||void 0===t?void 0:t.map(e=>e.replace(/USER:/,""));null!=a&&a.length&&await g(a),l("change",e.length?e:"",0)},C=async()=>{if("range_user"===a.supportModalType)o.value.open({selectedValue:m.value,title:""});else if("label_template_ref"===a.supportModalType){var e;const t=await _gct.openUtil.modal(Ar,{selected:await _(),moduleType:Tt.LABEL,isRdo:!0,btwForceVisible:!0,multiple:p.value},{title:At("sys.pageDesigner.chooseTmplSth",{sth:""}),width:1100,height:734,okText:At("sys.okText"),wrapClassName:"vxe-table--ignore-clear"});if(t.ok&&(null===(e=t.params)||void 0===e||null===(e=e.selected)||void 0===e?void 0:e.length)){const{selected:e}=t.params;e.forEach(e=>{b(e)&&(e.id=`${e.baseId}:${e.id}`,e.version="")}),e.forEach(e=>{u.value.some(t=>t.id===e.id)||u.value.push({...e})}),l("change",p.value?e.map(e=>e.id):e[0].id,0)}}};return Ra(()=>m,async e=>{if("range_user"!==a.supportModalType){if("label_template_ref"===a.supportModalType){var t;const a=E(e);await w(e);const l=null==a||null===(t=a.map(e=>u.value.find(t=>t.id==e)))||void 0===t?void 0:t.filter(Boolean);if(!(null==l?void 0:l.length))return void(c.value={});const o=l[0];c.value={...o,version:b(o)?"":null==o?void 0:o.version}}}else f(p.value?e:[e])},{immediate:!0,deep:!0}),ra(()=>{var e;"range_user"===a.supportModalType&&((async()=>{s.value=(await _api.apaas.role.getList({})??[]).map(e=>({...e,value:`ROLE:${e.id}`,label:e.name,iconExtraProps:{}}))})(),(async()=>{n.value=(await _api.apaas.userGroup.getList({})??[]).map(e=>({...e,value:`USER_GROUP:${e.id}`,label:e.name}))})(),(async()=>{r.value=(await _api.apaas.designerCommon.getGetCanBeUsedOrg({})??[]).map(e=>({...e,value:`ORG:${e.id}`,label:e.name}))})(),(!p.value&&m.value||p.value&&(null===(e=m.value)||void 0===e?void 0:e.length))&&f(p.value?m.value:[m.value])),"label_template_ref"===a.supportModalType&&w()}),(e,t)=>{const a=fa("a-select");return ua(),zt(Bt,null,[Xt(a,aa({open:!1,value:m.value,"max-tag-count":"responsive","max-tag-text-length":2,options:y.value},v.value,{onClick:C,onDeselect:h}),null,16,["value","options"]),Xt(Ta(P),{ref_key:"selectUserModalRef",ref:o,"class-name":i,"destroy-on-close":!0,onOk:T},null,512)],64)}}}),Rd=Cd,Sd={[gt.DATE]:At("sys.webRender.date"),[gt.TIME]:At("sys.webRender.time"),[gt.DATE_TIME]:At("sys.webRender.dateTime"),[gt.ORG]:"",[gt.ORG_MULTI]:"",[gt.USER]:At("sys.webRender.user"),[gt.USER_MULTI]:At("sys.webRender.user")},xd=/* @__PURE__ */function(e){return e.CUR_USER="__CUR_USER__",e.CUR_USER_ORG="__CUR_USER_ORG__",e.CUR_USER_MASTER_ORG="__CUR_USER_MASTER_ORG__",e.CUR_USER_PRINCIPAL_ORG="__CUR_USER_PRINCIPAL_ORG__",e.CUR_USER_DIRECT_SUBORDINATE="__CUR_USER_DIRECT_SUBORDINATE__",e}({}),Od=/* @__PURE__ */function(e){return e.NOW="__NOW__",e.CUR_DAY="__CUR_DAY__",e.CUR_WEEK="__CUR_WEEK__",e.CUR_MONTH="__CUR_MONTH__",e.CUR_YEAR="__CUR_YEAR__",e}({}),kd=[xd.CUR_USER,xd.CUR_USER_ORG,xd.CUR_USER_MASTER_ORG,xd.CUR_USER_PRINCIPAL_ORG,xd.CUR_USER_DIRECT_SUBORDINATE],Dd=[Od.NOW,Od.CUR_DAY,Od.CUR_WEEK,Od.CUR_MONTH,Od.CUR_YEAR],Id={[Od.NOW]:e=>At("sys.webRender.sysNow",{text:At(e)}),[Od.CUR_DAY]:()=>At("sys.webRender.curDay"),[Od.CUR_WEEK]:()=>At("sys.webRender.curWeek"),[Od.CUR_MONTH]:()=>At("sys.webRender.curMonth"),[Od.CUR_YEAR]:()=>At("sys.webRender.curYear"),[xd.CUR_USER]:()=>At("sys.webRender.curUser"),[xd.CUR_USER_ORG]:e=>At("sys.webRender.curUserOrg",{text:e}),[xd.CUR_USER_MASTER_ORG]:e=>At("sys.webRender.curUserMasterOrg",{text:e}),[xd.CUR_USER_PRINCIPAL_ORG]:e=>At("sys.webRender.curUserPrincipalOrg",{text:e}),[xd.CUR_USER_DIRECT_SUBORDINATE]:At("sys.webRender.curUserDirectSubordinate")},Ld=/* @__PURE__ */function(e){return e.FIXED="FIXED",e.SYS="SYS",e.FIELD="FIELD",e.VAR="VAR",e.COMP_PARAMS="COMP_PARAMS",e.BUILT_PARAMS="BUILT_PARAMS",e}({}),Md={[Ld.FIXED]:{name:At("sys.webRender.fixed"),abbr:At("sys.webRender.fixedAbbr")},[Ld.SYS]:{name:At("sys.webRender.system"),abbr:At("sys.webRender.systemAbbr")},[Ld.FIELD]:{name:At("sys.webRender.field"),abbr:At("sys.webRender.fieldAbbr")},[Ld.VAR]:{name:At("sys.webRender.var"),abbr:At("sys.webRender.varAbbr")},[Ld.COMP_PARAMS]:{name:"组件传参",abbr:"组"},[Ld.BUILT_PARAMS]:{name:"内置传参",abbr:"内"}},Ad=/* @__PURE__ */function(e){return e.INPUT="input",e.SELECT="select",e.REQUEST_SELECT="request_select",e.DATEPICKER="datePicker",e.CUSTOM="custom",e.REQUEST_TREE_SELECT="request_tree_select",e.NDO_SELECT="NdoSelect",e.RDO_SELECT="RdoSelect",e.TREE_SELECT="TreeSelect",e.SELECT_BUILTIN_PARAMS="select_builtin_params",e.MODAL_SELECT="modal_select",e}({}),Nd=/* @__PURE__ */function(e){return e.Single="single",e.Comb="comb",e.Hidden="hidden",e}({}),Ud=[{label:At("sys.webRender.booleanTrue"),value:"true"},{label:At("sys.webRender.booleanFalse"),value:"false"}],Pd=[Ct.CONTAINANY,Ct.CONTAINALL,Ct.IN,Ct.NOTIN,Ct.VERSIONIN,Ct.VERSIONNOTIN],Vd=e=>e===gt.TRANSACTION?_api.apaas.designerCommon.getTableEntityModelList:e===gt.MESSAGE_TMPL?_api.apaas.messageTmpl.getList:e===gt.PRINTER?_api.apaas.print.getPrintDropdownList:e===gt.RDO_REF?_api.apaas.bizService.postModelKeyBsKey:_api.apaas.modelData.postQueryRefData,Fd=({fieldType:e,bindInfo:t,modelKey:a,fieldKey:l,refModelType:o})=>e===gt.RDO_REF?{bsKey:"rdoListAll",modelKey:t}:[gt.PRINTER].includes(e)?{fieldType:e}:[gt.TRANSACTION].includes(e)?{type:"TRANSACTION"}:[gt.MESSAGE_TMPL].includes(e)?{}:{modelKey:a,fieldKey:l,bindModelKey:t,..."TREE"!==o&&{pageNo:1,pageSize:30},..."TREE"===o&&{searchType:"ALL"}},jd=({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,refModelType:i})=>{const s={};if(["NDO","RDO","TREE","BASE"].includes(e))return Object.assign(s,{apiParams:{modelKey:l}}),s;if(e===gt.DATE)Object.assign(s,{picker:"date"});else if(e===gt.TIME)Object.assign(s,{picker:"time"});else if(e===gt.DATE_TIME)Object.assign(s,{showTime:!0});else if([gt.USER,gt.USER_MULTI,gt.ORG,gt.ORG_MULTI].includes(e))Object.assign(s,{supportModalType:[gt.ORG_MULTI,gt.ORG].includes(e)?"org":[Ct.CONTAINALL,Ct.EQ,Ct.NE,Ct.IN,Ct.NOTIN].includes(t)?"user":"user&org",mode:Pd.includes(t)?"multiple":"",pickerCompParams:{modelKey:a,fieldKey:l,multiple:Pd.includes(t)}});else if([gt.OPTION,gt.OPTION_MULTI].includes(e))console.log("OPTION",e);else if([gt.RANGE_USER,gt.LABEL_TEMPLATE_REF].includes(e))Object.assign(s,{supportModalType:e===gt.RANGE_USER?"range_user":"label_template_ref",mode:Pd.includes(t)?"multiple":"",pickerCompParams:{modelKey:a,fieldKey:l,multiple:Pd.includes(t)}});else if([gt.ENUM,gt.ENUM_MULTI,gt.REF,gt.REF_MULTI,gt.RDO_REF,gt.PRIMARY_KEY,gt.TRANSACTION,gt.MESSAGE_TMPL,gt.PRINTER].includes(e)){const n=![Ct.EQ,Ct.NE].includes(t);Object.assign(s,{mode:n?"multiple":""}),[gt.REF,gt.REF_MULTI,gt.RDO_REF,gt.PRIMARY_KEY,gt.TRANSACTION,gt.MESSAGE_TMPL,gt.PRINTER].includes(e)?Object.assign(s,{showSearch:!0,multiple:n,api:Vd(e),apiParams:Fd({fieldType:e,bindInfo:o,modelKey:a,fieldKey:l,refModelType:i})}):Object.assign(s,{api:_api.apaas.enumModelField.getPageList,apiParams:{pageSize:9999,enumModelKey:o}})}return s},Bd={basicText:{isDefault:!0,comps:Ad.INPUT},[gt.BOOLEAN]:{isDefault:!0,comps:Ad.SELECT,compAttrs:{options:Ud}},basicDate:{comps:[Ad.DATEPICKER,Ad.SELECT],compAttrs:[jd,{optionsKeys:[...Dd],filter:{type:"contain",list:[Od.NOW]}}]},basicUserDep:{typeKeys:[Ld.FIXED,Ld.SYS],default:Ld.FIXED,comps:[Ad.CUSTOM,Ad.SELECT],compAttrs:[jd,{optionsKeys:[...kd],filter:({operatorType:e,fieldType:t})=>{const a=[gt.USER,gt.ORG].includes(t)&&[Ct.EQ,Ct.NE].includes(e);return{type:e===Ct.CONTAINALL||a?"contain":"exclude",list:e===Ct.CONTAINALL||a?[[gt.ORG_MULTI,gt.ORG].includes(t)?xd.CUR_USER_MASTER_ORG:xd.CUR_USER]:[gt.ORG_MULTI,gt.ORG].includes(t)?[xd.CUR_USER,xd.CUR_USER_DIRECT_SUBORDINATE]:[]}}}]},basicModalSel:{isDefault:!0,comps:Ad.MODAL_SELECT,compAttrs:jd},basicEnum:{isDefault:!0,comps:Ad.REQUEST_SELECT,compAttrs:jd},basicModel:{isDefault:!0,comps:({refModelType:e,fieldType:t})=>"TREE"===e||t===gt.PRINTER?Ad.REQUEST_TREE_SELECT:Ad.REQUEST_SELECT,compAttrs:jd},NDO:{isDefault:!0,comps:Ad.NDO_SELECT,compAttrs:jd},RDO:{isDefault:!0,comps:Ad.RDO_SELECT,compAttrs:jd},TREE:{isDefault:!0,comps:Ad.TREE_SELECT,compAttrs:jd},BASE:{isDefault:!0,comps:Ad.NDO_SELECT,compAttrs:jd}},Kd=[Ct.RANGE,Ct.ORANGE,Ct.RORANGE,Ct.LORANGE,Ct.IN,Ct.NOTIN,Ct.CONTAINANY,Ct.CONTAINALL,Ct.VERSIONIN,Ct.VERSIONNOTIN],Gd=({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,valueType:i,refModelType:s,fieldOptions:n,mainModelKey:r,isPageDesigner:d,isOnlineFormDesigner:u,varOptions:c})=>{let p="";if(!t)return[];switch(e){case gt.TEXT:case gt.LONG_TEXT:case gt.SERIAL:case gt.INTEGER:case gt.LONG:case gt.DOUBLE:case gt.DECIMAL:case gt.OPTION:case gt.OPTION_MULTI:p="basicText";break;case gt.DATE:case gt.TIME:case gt.DATE_TIME:p="basicDate";break;case gt.USER:case gt.ORG:case gt.USER_MULTI:case gt.ORG_MULTI:p="basicUserDep";break;case gt.ENUM:case gt.ENUM_MULTI:p="basicEnum";break;case gt.REF:case gt.REF_MULTI:case gt.RDO_REF:case gt.PRIMARY_KEY:case gt.TRANSACTION:case gt.MESSAGE_TMPL:case gt.PRINTER:p="basicModel";break;case gt.LABEL_TEMPLATE_REF:case gt.RANGE_USER:p="basicModalSel"}const v=(m=t,[Ct.ISNOTNULL,Ct.ISNULL].includes(m)?Nd.Hidden:[Ct.RANGE,Ct.ORANGE,Ct.RORANGE,Ct.LORANGE].includes(m)?Nd.Comb:Nd.Single);var m;if(v===Nd.Hidden)return[{isHide:!0}];let h=[];const y=La(Bd[p||e]),f=(v===Nd.Comb?[y,La(y)]:[y]).map((i,m)=>{var y;const f={};var g,b,_;(null==i?void 0:i.isDefault)||u?Ka(f,{typeKeys:[Ld.FIXED],default:Ld.FIXED}):Ua(i,"default")&&Ua(i,"typeKeys")?Ka(f,$a(i,["typeKeys","default"])):"basicDate"===p&&(v===Nd.Single?Ka(f,{typeKeys:[Ld.FIXED,Ld.SYS],default:Ld.FIXED}):v===Nd.Comb&&(Ka(f,{typeKeys:0===m&&t!==Ct.RANGE?[Ld.FIXED]:[Ld.FIXED,Ld.SYS],default:(0===m&&Ct.RANGE,Ld.FIXED)}),t===Ct.RANGE&&0===m&&(e===gt.TIME&&Object.assign(f,{typeKeys:[Ld.FIXED],default:Ld.FIXED}),i.compAttrs[1].filter={type:"exclude",list:[Od.NOW]}))),Kd.includes(t)||[gt.OPTION,gt.OPTION_MULTI].includes(e)||null===(g=f.typeKeys)||void 0===g||g.push(Ld.FIELD),d&&(null===(b=f.typeKeys)||void 0===b||b.push(Ld.VAR)),u&&(null===(_=f.typeKeys)||void 0===_||_.push(Ld.COMP_PARAMS,Ld.BUILT_PARAMS)),Ka(f,{valueTypeOptions:null===(y=f.typeKeys)||void 0===y?void 0:y.map(e=>({label:At(Md[e].name),value:e,abbr:At(Md[e].abbr)}))});const E="function"==typeof(null==i?void 0:i.comps)?null==i?void 0:i.comps({refModelType:s,fieldType:e}):null==i?void 0:i.comps,w=Array.isArray(E)?E:[E];if(h=1==w.length?[Ld.FIXED]:[Ld.FIXED,Ld.SYS],Kd.includes(t)||[gt.OPTION,gt.OPTION_MULTI].includes(e)||(w.push(Ad.SELECT),h.push(Ld.FIELD)),d&&(w.push(Ad.SELECT),h.push(Ld.VAR)),u&&(w.push(Ad.INPUT,Ad.SELECT_BUILTIN_PARAMS),h.push(Ld.COMP_PARAMS,Ld.BUILT_PARAMS)),w.forEach((e,t)=>{Ka(f,{[h[t]]:{cmp:e}})}),Ua(i,"compAttrs")){const n="function"==typeof i.compAttrs?i.compAttrs({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o,refModelType:s}):i.compAttrs;(Array.isArray(n)?n:[n]).forEach((i,s)=>{const n={},r="function"==typeof i?i({fieldType:e,operatorType:t,modelKey:a,fieldKey:l,bindInfo:o}):i;Ua(r,"filter")&&Object.assign(n,{filter:"function"==typeof r.filter?r.filter({operatorType:t,fieldType:e}):r.filter});const d={};var u;(null==r?void 0:r.optionsKeys)&&Object.assign(d,{options:null==r||null===(u=r.optionsKeys)||void 0===u?void 0:u.filter(e=>{if(!Va(null==n?void 0:n.filter)){const t=null==n?void 0:n.filter;return"contain"===t.type?t.list.includes(e):"exclude"!==t.type||!t.list.includes(e)}return!0}).map(t=>({label:"function"==typeof Id[t]?Id[t](Sd[e]):Id[t],value:t}))}),Ka(f,{[h[s]]:{...f[h[s]],attrs:{...Ga(r,"filter"),...d},...n}})})}return(r||u)&&(f[Ld.FIELD]={...f[Ld.FIELD],attrs:{options:n}}),d&&(f[Ld.FIELD]={...f[Ld.FIELD],attrs:{options:n}},f[Ld.VAR]={...f[Ld.VAR],attrs:{options:c}}),f});return[gt.DATE,gt.DATE_TIME].includes(e)&&t===Ct.RANGE&&i===Ld.SYS?f.slice(0,1):f},$d={class:"tree-action-node"},zd={key:0,class:"ml-4px mr-4px"},Hd={key:1,style:{flex:"1","min-width":"0","background-color":"#f5f6f7"}},qd={class:"tree-action-node__actions"},Yd=/* @__PURE__ */Zt({__name:"tree-action-node",props:{data:{},fieldList:{},selectFiledKeys:{},filterType:{},readonly:{type:Boolean},mainModelKey:{},isPageDesigner:{type:Boolean},isOnlineFormDesigner:{type:Boolean},isAllowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},onlineFormFieldList:{},modelName:{},cascadeField:{type:Boolean},searchType:{}},setup(e){const t=[gt.TEXT,gt.LONG_TEXT,gt.INTEGER,gt.LONG,gt.DOUBLE,gt.DECIMAL,gt.BOOLEAN,gt.DATE,gt.DATE_TIME,gt.TIME,gt.ENUM,gt.ENUM_MULTI,gt.REF,gt.REF_MULTI];function a(e){return t.includes(e.type)&&("USER_DEFINED"===e.createType||"BUILTIN"===e.createType)}const l=ea("isDataFilterEditor"),o={[Ad.INPUT]:el,[Ad.SELECT]:il,[Ad.DATEPICKER]:Za,[Ad.CUSTOM]:cd,[Ad.REQUEST_SELECT]:vd,[Ad.REQUEST_TREE_SELECT]:hd,[Ad.NDO_SELECT]:fd,[Ad.RDO_SELECT]:Ed,[Ad.TREE_SELECT]:Td,[Ad.MODAL_SELECT]:Rd},i={[gt.DATE]:"YYYY-MM-DD",[gt.DATE_TIME]:"YYYY-MM-DD HH:mm:ss",[gt.TIME]:"HH:mm:ss"},s=e,{addNewRow:n,deleteRow:r,updateNodeItem:d}=sd(s.readonly),u=va([]),c=va([]),p=va([]),v=Kt(()=>"filterConfig"===s.filterType),m=Kt(()=>"businessFlow"===s.filterType),h=Kt(()=>"edhrBuiltPerms"===s.filterType),y=Kt(()=>s.data.key),f=Kt(()=>{var e;return null===(e=s.data.leftValue)||void 0===e?void 0:e.type}),g=Kt(()=>[gt.DATE,gt.DATE_TIME,gt.TIME].includes(f.value));console.log("props----------",s);const b=Kt(()=>{var e,t;if(h.value)return null===(t=s.fieldList)||void 0===t?void 0:t.map(e=>({key:e.key,value:e.id,label:e.name,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type}}));let a;if(m.value){var l,o,i;(null===(l=s.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.nodeKey)||(s.data.leftValue.nodeKey=null===(i=s.fieldList)||void 0===i||null===(i=i.find(e=>e.defaultValue))||void 0===i?void 0:i.key);const e=null===(o=s.fieldList)||void 0===o?void 0:o.find(e=>e.fixed);if(a=((null==e?void 0:e.children)||[]).filter(e=>Object.keys(s.searchType).includes(e.type)).map(t=>({...t,id:`${e.id}.${t.id}`})),s.data.leftValue.nodeKey!==e.key){var n;const e=null===(n=s.fieldList)||void 0===n?void 0:n.find(e=>{var t;return e.key===(null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey)});a=((null==e?void 0:e.children)||[]).filter(e=>Object.keys(s.searchType).includes(e.type)).map(t=>({...t,id:`${e.id}.${t.id}`})).concat(a)}}return null===(e=m.value?a:s.fieldList)||void 0===e?void 0:e.filter(e=>![gt.IMAGE,gt.ATTACHMENT,gt.MASTERSLAVE].includes(e.type)).map(e=>{var t;return{label:v.value||m.value?`${e.modelName}.${e.name}`:e.name,value:e.id,disabled:!1,filedInfo:{id:e.id,key:m.value?e.id:e.key,name:e.name,type:e.type,bindInfo:e.bindInfo,modelKey:e.modelKey,refModelType:e.refModelType,nodeKey:m.value?null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey:void 0}}})}),_=Kt(()=>{var e;return null===(e=b.value)||void 0===e?void 0:e.filter(e=>{var t,a,l,o;return(null===(t=e.filedInfo)||void 0===t?void 0:t.type)===(null===(a=s.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.type)&&(null===(l=e.filedInfo)||void 0===l?void 0:l.key)!==(null===(o=s.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key)})}),E=Kt(()=>{var e,t,a;if(h.value)return[{label:At("sys.appDesigner.conditionVisible"),value:Ct.IN},{label:At("sys.appDesigner.conditionInvisible"),value:Ct.NOTIN}];if(!f.value)return[];const l=null===(e=s.searchType)||void 0===e?void 0:e[f.value],o=(null==l?void 0:l.filter)||[],i=null==o||null===(t=o.concat(...(null==l||null===(a=l.contain)||void 0===a?void 0:a.map(e=>{var t;return(null===(t=s.searchType)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.filter)||[]}))||[]))||void 0===t?void 0:t.map(e=>({label:At(`sys.model.${e}`),value:e}));return null==i?void 0:i.filter(e=>{var t;return!(null===(t=s.excludeOperatorType)||void 0===t?void 0:t.includes(e.value))})}),w=Kt(()=>{var e;return(null===(e=s.data)||void 0===e||null===(e=e.rightValue)||void 0===e?void 0:e.map(e=>g.value&&e.result&&e.valueType===Ld.FIXED?pl(e.result).format(i[f.value]||"YYYY-MM-DD"):e.result))||[]});Ra(()=>s.mainModelKey,async e=>{var t;e?(await async function(e){var t;const a=[e];m.value&&(null===(t=s.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.modelKey)&&a.push(s.data.leftValue.modelKey);const l=a.map(e=>async function(e){var t;return(null===(t=(await _api.apaas.modelMeta.getDetail({modelKey:e},s.apiConfig)||{}).fieldMetaList)||void 0===t?void 0:t.map(e=>({label:e.name,value:e.key})))||[]}(e));p.value=(await Promise.all(l)).flat()}(e),T({operatorType:null===(t=s.data)||void 0===t?void 0:t.operatorValue,valueType:void 0})):p.value=[]},{immediate:!0}),Ra(()=>{var e;return null===(e=s.data)||void 0===e||null===(e=e.leftValue)||void 0===e?void 0:e.modelKey},e=>{var t;m.value&&!e&&(s.data.leftValue||(s.data.leftValue={}),s.data.leftValue.nodeKey=null===(t=s.fieldList)||void 0===t||null===(t=t.find(e=>e.default))||void 0===t?void 0:t.key)},{immediate:!0});const T=async e=>{var t,a,l,o,i;u.value=Gd({fieldType:f.value,operatorType:(null==e?void 0:e.operatorType)||(null===(t=s.data)||void 0===t?void 0:t.operatorValue),modelKey:null===(a=s.data.leftValue)||void 0===a?void 0:a.modelKey,fieldKey:null===(l=s.data.leftValue)||void 0===l?void 0:l.key,bindInfo:null===(o=s.data.leftValue)||void 0===o?void 0:o.bindInfo,refModelType:null===(i=s.data.leftValue)||void 0===i?void 0:i.refModelType,valueType:(null==e?void 0:e.valueType)||void 0,fieldOptions:s.isOnlineFormDesigner?s.onlineFormFieldList:s.isPageDesigner||m.value?_.value:p.value,mainModelKey:s.mainModelKey,isPageDesigner:s.isPageDesigner||m.value,isOnlineFormDesigner:s.isOnlineFormDesigner,varOptions:c.value}),u.value.forEach((e,t)=>{var a,l,o;const i=(null===(a=e[null==e||null===(l=e.typeKeys)||void 0===l?void 0:l[t]])||void 0===a||null===(a=a.attrs)||void 0===a?void 0:a.options)||[];i.length&&i.forEach(e=>{e.label=At(e.label)}),e.valueTypeOptions=null===(o=e.valueTypeOptions)||void 0===o?void 0:o.filter(e=>{var t;return!(null===(t=s.excludeValueType)||void 0===t?void 0:t.includes(e.value))})})};Ra([f.value,()=>s.data.leftValue,()=>s.data.operatorValue],async()=>{if(f.value&&s.data.leftValue&&s.data.operatorValue){var e,t,a;const l={};if(g.value&&(null===(e=s.data)||void 0===e?void 0:e.operatorValue)===Ct.RANGE&&Array.isArray(s.data.rightValue)&&0!==s.data.rightValue.length){const e=s.data.rightValue[0];e.valueType===Ld.FIXED&&Object.assign(l,{valueType:e.valueType})}s.isPageDesigner&&!c.value.length&&await async function(e=!0){const t=await _api.apaas.appGlobalSettings.getList({type:"var",fullInfo:e,source:_gct.store.context.platform},s.apiConfig)||[];c.value=(null==t?void 0:t.map(e=>({value:e.id,label:e.key,varInfo:e.configJson?JSON.parse(e.configJson):null})))||[]}(),s.isPageDesigner&&"FIELD"==(null===(t=s.data.rightValue)||void 0===t?void 0:t[0].valueType)&&!(null===(a=_.value)||void 0===a?void 0:a.length)?setTimeout(()=>T(l),200):T(l)}},{deep:!0,immediate:!0});const C=(e,t)=>{s.data.leftValue.nodeKey=e},R=(e,t)=>{if(!e)return void O(e,{});const{key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}=t;O(o,{filedInfo:{field_search_key:e,key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}})},S=(e,t)=>{var a;return t.name?t.name.includes(null==e?void 0:e.trim()):null===(a=t.label)||void 0===a?void 0:a.includes(null==e?void 0:e.trim())},x=Kt(()=>{var e,t,a;const l=null===(e=b.value)||void 0===e?void 0:e.map(e=>e.value);var o;return(null==l?void 0:l.includes(null===(t=s.data.leftValue)||void 0===t?void 0:t.id))?null===(a=s.data.leftValue)||void 0===a?void 0:a.id:null===(o=s.data.leftValue)||void 0===o?void 0:o.name}),O=async(e,t)=>{e?(d(y.value,"leftValue",t.filedInfo),u.value=[]):(d(y.value,"leftValue",void 0),u.value=[])},k=(e,t)=>{T({operatorType:e,valueType:void 0});const a=u.value.map(e=>e.default);d(y.value,"operatorValue",e,{key:"valueType",defaultValues:a})},D=()=>{n(s.data.pid,y.value)},I=()=>{r(y.value)};return(t,n)=>{const r=fa("a-select"),c=fa("a-form-item-rest"),p=fa("a-input"),v=fa("a-input-group"),_=fa("DeleteOutlined"),L=fa("a-button"),M=fa("PlusOutlined");return ua(),zt("div",$d,[Xt(c,null,{default:xa(()=>{var t,l,o;return[m.value?(ua(),Gt(r,{key:0,style:{width:"140px","margin-right":"16px"},placeholder:Ta(At)("sys.chooseText"),options:e.fieldList,value:null===(t=e.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.nodeKey,class:"tree-action-select",disabled:e.readonly,"field-names":{label:"nodeName",value:"key"},onChange:C},null,8,["placeholder","options","value","disabled"])):$t("",!0),e.modelName&&e.cascadeField?(ua(),Gt(Ta(we),{key:1,"filter-field-by-function":a,style:{flex:"1","min-width":"0","margin-right":"16px"},"field-meta-list":e.fieldList,"model-name":e.modelName,value:(null===(l=e.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.field_search_key)||(null===(o=e.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key),onFieldClick:R},null,8,["field-meta-list","model-name","value"])):(ua(),Gt(r,{key:2,style:{flex:"1",width:"200px","min-width":"0","margin-right":"16px"},placeholder:h.value?Ta(At)("sys.chooseText"):Ta(At)("sys.appDesigner.leftValue"),options:b.value,value:x.value,class:"tree-action-select",disabled:e.readonly,"allow-clear":e.isAllowClear,"show-search":"","filter-option":S,onChange:O},null,8,["placeholder","options","value","disabled","allow-clear"]))]}),_:1}),Xt(c,null,{default:xa(()=>{var t;return[Xt(r,{class:oa(e.readonly?"tree-action-select":""),style:{flex:"1","min-width":"0","margin-right":"16px"},disabled:e.readonly||!e.data.leftValue,placeholder:h.value?Ta(At)("sys.chooseText"):Ta(At)("sys.appDesigner.operator"),options:E.value,value:null===(t=e.data)||void 0===t?void 0:t.operatorValue,onChange:k},null,8,["class","disabled","placeholder","options","value"])]}),_:1}),Array.isArray(u.value)&&0===u.value.length?(ua(),Gt(c,{key:0},{default:xa(()=>[Xt(p,{disabled:!0,placeholder:h.value?Ta(At)("sys.chooseText"):"",style:{flex:"1","min-width":"0"}},null,8,["placeholder"])]),_:1})):$t("",!0),(ua(!0),zt(Bt,null,ha(u.value,(t,a)=>(ua(),zt(Bt,{key:a},[u.value.length>1&&a===u.value.length-1?(ua(),zt("span",zd,ba(Ta(At)("sys.webRender.to")),1)):$t("",!0),t.isHide?(ua(),zt("div",Hd)):(ua(),Gt(c,{key:2},{default:xa(()=>[Xt(v,{compact:"",class:"tree-action-node__flex-value"},{default:xa(()=>{var l,n,c,p,v;return[Xt(r,{class:oa([e.readonly?"tree-action-select is-unit":"","primary-gct"]),disabled:e.readonly,style:{width:"40px"},options:t.valueTypeOptions,"dropdown-match-select-width":!1,"option-label-prop":"abbr","show-arrow":!1,value:null===(l=e.data)||void 0===l||null===(l=l.rightValue)||void 0===l?void 0:l[a].valueType,onChange:e=>((e,t)=>{var a;if((null===(a=s.data)||void 0===a?void 0:a.operatorValue)===Ct.RANGE&&g.value&&0===t){var l;T({operatorType:null===(l=s.data)||void 0===l?void 0:l.operatorValue,valueType:e});const a=u.value.map(e=>e.default);d(y.value,"rightValue",e,{index:t,key:"valueType",isRest:!0,defaultValues:a})}else d(y.value,"rightValue",e,{index:t,key:"valueType"})})(e,a)},null,8,["class","disabled","options","value","onChange"]),(ua(),Gt(ga(o[null===(n=t[null===(c=e.data)||void 0===c||null===(c=c.rightValue)||void 0===c?void 0:c[a].valueType])||void 0===n?void 0:n.cmp]),aa({class:e.readonly?"tree-action-select left-border":"",disabled:e.readonly,style:{width:"calc(100% - 40px)"},placeholder:Ta(At)("sys.appDesigner.value"),value:w.value[a],bordered:""},{ref_for:!0},null===(p=t[null===(v=e.data)||void 0===v||null===(v=v.rightValue)||void 0===v?void 0:v[a].valueType])||void 0===p?void 0:p.attrs,{"filter-type":e.filterType,onChange:e=>((e,t)=>{var a;const l=null===(a=s.data)||void 0===a||null===(a=a.rightValue)||void 0===a?void 0:a[t].valueType;let o;var n;o=g.value?l!==Ld.FIXED||Va(e)?e:pl(e).format(i[f.value]):(null==e?void 0:e.target)?null===(n=e.target)||void 0===n?void 0:n.value:e,d(y.value,"rightValue",o,{index:t,key:"result"})})(e,a),"onUpdate:pageNo":e=>function(e,t){var a,l;const o=u.value[e],i=null===(a=o[null==o||null===(l=o.typeKeys)||void 0===l?void 0:l[e]])||void 0===a||null===(a=a.attrs)||void 0===a||null===(a=a.apiParams)||void 0===a?void 0:a.pageNo;t?u.value[e][u.value[e].typeKeys[e]].attrs.apiParams.pageNo=t:i&&(u.value[e][u.value[e].typeKeys[e]].attrs.apiParams.pageNo=i+1)}(a,e)}),null,16,["class","disabled","placeholder","value","filter-type","onChange","onUpdate:pageNo"]))]}),_:2},1024)]),_:2},1024))],64))),128)),Ht("div",qd,[e.readonly||e.data.firstRow&&!Ta(l)?$t("",!0):(ua(),Gt(L,{key:0,type:"link",style:{padding:"4px 0"},size:"small",class:"ml-8px",onClick:I},{icon:xa(()=>[Xt(_,{class:"text-16px"})]),_:1})),e.readonly?$t("",!0):(ua(),Gt(L,{key:1,type:"link",size:"small",style:{padding:"4px 0"},onClick:D},{icon:xa(()=>[Xt(M)]),_:1}))])])}}}),Xd=/* @__PURE__ */Qe(Yd,[["__scopeId","data-v-f37ec578"]]),Wd={class:"perm-root-node"},Zd=/* @__PURE__ */Zt({__name:"perm-root-node",props:{data:{},level:{},id:{},operatorType:{},readonly:{type:Boolean}},setup(e){const t=[{label:At(ed[Jr.AND]),value:Jr.AND},{label:At(ed[Jr.OR]),value:Jr.OR}],a=e,{updateNodeItem:l}=sd(a.readonly),o=Kt({get:()=>a.operatorType,set(e){l(a.id,"operatorType",e)}});return(a,l)=>{const i=fa("a-radio-button"),s=fa("a-radio-group"),n=fa("a-form-item-rest");return ua(),zt("div",Wd,[Ht("div",null,[Xt(n,null,{default:xa(()=>[Xt(s,{value:o.value,"onUpdate:value":l[0]||(l[0]=e=>o.value=e),disabled:e.readonly},{default:xa(()=>[(ua(),zt(Bt,null,ha(t,e=>Xt(i,{key:e.value,value:e.value},{default:xa(()=>[Yt(ba(e.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value","disabled"])]),_:1})])])}}}),Jd=/* @__PURE__ */Qe(Zd,[["__scopeId","data-v-ca5c9d20"]]),Qd={class:"perm-action-node"},eu={key:0,class:"mx-4px"},tu={key:1,style:{flex:"1","min-width":"0","background-color":"#f5f6f7"}},au={class:"perm-action-node__flex-value"},lu={class:"perm-action-node__actions"},ou=/* @__PURE__ */Zt({__name:"perm-action-node",props:{data:{},fieldList:{},selectFiledKeys:{},filterType:{},readonly:{type:Boolean},isPageDesigner:{type:Boolean},isAllowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},modelName:{},cascadeField:{type:Boolean},hasPermScopeError:{type:Boolean}},setup(e){const t=[gt.TEXT,gt.LONG_TEXT,gt.INTEGER,gt.LONG,gt.DOUBLE,gt.DECIMAL,gt.BOOLEAN,gt.DATE,gt.DATE_TIME,gt.TIME,gt.ENUM,gt.ENUM_MULTI,gt.REF,gt.REF_MULTI];function a(e){return t.includes(e.type)&&("USER_DEFINED"===e.createType||"BUILTIN"===e.createType)}const l={[Ad.INPUT]:el,[Ad.SELECT]:il,[Ad.DATEPICKER]:Za,[Ad.CUSTOM]:cd,[Ad.REQUEST_SELECT]:vd,[Ad.REQUEST_TREE_SELECT]:hd,[Ad.NDO_SELECT]:fd,[Ad.RDO_SELECT]:Ed,[Ad.TREE_SELECT]:Td},o={[gt.DATE]:"YYYY-MM-DD",[gt.DATE_TIME]:"YYYY-MM-DD HH:mm:ss",[gt.TIME]:"HH:mm:ss"},i=e,{deleteRow:s,updateNodeItem:n}=sd(i.readonly),r=va([]),d=va([]),u=va([]),c=Kt(()=>"filterConfig"===i.filterType),p=Kt(()=>"permissionScope"===i.filterType),v=Kt(()=>i.data.key),m=Kt(()=>{var e;return null===(e=i.data.leftValue)||void 0===e?void 0:e.type}),h=Kt(()=>[gt.DATE,gt.DATE_TIME,gt.TIME].includes(m.value)),y=Kt(()=>{var e,t;return p.value?null===(t=i.fieldList)||void 0===t?void 0:t.map(e=>({key:e.key,value:e.id,label:e.name,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type}})):null===(e=i.fieldList)||void 0===e?void 0:e.filter(e=>![gt.IMAGE,gt.ATTACHMENT,gt.MASTERSLAVE].includes(e.type)).map(e=>({label:c.value?`${e.modelName}.${e.name}`:e.name,value:e.id,disabled:!1,filedInfo:{id:e.id,key:e.key,name:e.name,type:e.type,bindInfo:e.bindInfo,modelKey:e.modelKey,refModelType:e.refModelType,nodeKey:void 0}}))}),f=Kt(()=>{var e;return null===(e=y.value)||void 0===e?void 0:e.filter(e=>{var t,a,l,o;return(null===(t=e.filedInfo)||void 0===t?void 0:t.type)===(null===(a=i.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.type)&&(null===(l=e.filedInfo)||void 0===l?void 0:l.key)!==(null===(o=i.data)||void 0===o||null===(o=o.leftValue)||void 0===o?void 0:o.key)})}),g=Kt(()=>[{label:At("sys.appDesigner.conditionVisible"),value:"RDO"===m.value?"defVersionIn":Ct.IN},{label:At("sys.appDesigner.conditionInvisible"),value:"RDO"===m.value?"defVersionNotIn":Ct.NOTIN}]),b=Kt(()=>{var e;return(null===(e=i.data)||void 0===e||null===(e=e.rightValue)||void 0===e?void 0:e.map(e=>h.value&&e.result&&e.valueType===Ld.FIXED?pl(e.result).format(o[m.value]||"YYYY-MM-DD"):e.result))||[]});p.value&&(i.data.operatorValue="RDO"===m.value?"defVersionIn":Ct.IN);const _=async e=>{var t,a,l,o,s;r.value=Gd({fieldType:m.value,operatorType:(null==e?void 0:e.operatorType)||(null===(t=i.data)||void 0===t?void 0:t.operatorValue),modelKey:null===(a=i.data.leftValue)||void 0===a?void 0:a.modelKey,fieldKey:null===(l=i.data.leftValue)||void 0===l?void 0:l.key,bindInfo:null===(o=i.data.leftValue)||void 0===o?void 0:o.bindInfo,refModelType:null===(s=i.data.leftValue)||void 0===s?void 0:s.refModelType,valueType:(null==e?void 0:e.valueType)||void 0,fieldOptions:(i.isPageDesigner?f.value:u.value)??[],mainModelKey:void 0,isPageDesigner:i.isPageDesigner,isOnlineFormDesigner:!1,varOptions:d.value}),r.value.forEach((e,t)=>{var a,l,o;const s=(null===(a=e[null==e||null===(l=e.typeKeys)||void 0===l?void 0:l[t]])||void 0===a||null===(a=a.attrs)||void 0===a?void 0:a.options)||[];s.length&&s.forEach(e=>{e.label=At(e.label)}),e.valueTypeOptions=null===(o=e.valueTypeOptions)||void 0===o?void 0:o.filter(e=>{var t;return!(null===(t=i.excludeValueType)||void 0===t?void 0:t.includes(e.value))})})};Ra([m.value,()=>i.data.leftValue,()=>i.data.operatorValue],async()=>{if(m.value&&i.data.leftValue&&i.data.operatorValue){var e,t,a;const l={};if(h.value&&(null===(e=i.data)||void 0===e?void 0:e.operatorValue)===Ct.RANGE&&Array.isArray(i.data.rightValue)&&0!==i.data.rightValue.length){const e=i.data.rightValue[0];e.valueType===Ld.FIXED&&Object.assign(l,{valueType:e.valueType})}i.isPageDesigner&&"FIELD"==(null===(t=i.data.rightValue)||void 0===t?void 0:t[0].valueType)&&!(null===(a=f.value)||void 0===a?void 0:a.length)?setTimeout(()=>_(l),200):_(l)}},{deep:!0,immediate:!0});const E=(e,t)=>{if(!e)return void C(e,{});const{key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}=t;C(o,{filedInfo:{field_search_key:e,key:a,bindInfo:l,id:o,modelKey:i,name:s,refModelType:n,type:r}})},w=(e,t)=>{var a;return t.name?t.name.includes(null==e?void 0:e.trim()):null===(a=t.label)||void 0===a?void 0:a.includes(null==e?void 0:e.trim())},T=Kt(()=>{var e,t,a;const l=null===(e=y.value)||void 0===e?void 0:e.map(e=>e.value);var o;return(null==l?void 0:l.includes(null===(t=i.data.leftValue)||void 0===t?void 0:t.id))?null===(a=i.data.leftValue)||void 0===a?void 0:a.id:null===(o=i.data.leftValue)||void 0===o?void 0:o.name}),C=async(e,t)=>{if(e){if(n(v.value,"leftValue",t.filedInfo),r.value=[],p.value){var a;const e=null===(a=g.value)||void 0===a?void 0:a[0];await la(),R(e.value,e)}}else n(v.value,"leftValue",void 0),r.value=[]},R=(e,t)=>{var a;if(p.value&&!(null===(a=i.data)||void 0===a||null===(a=a.leftValue)||void 0===a?void 0:a.key))return;_({operatorType:e,valueType:void 0});const l=r.value.map(e=>e.default);n(v.value,"operatorValue",e,{key:"valueType",defaultValues:l})},S=()=>{s(v.value)};return(t,s)=>{const d=fa("a-select"),u=fa("a-form-item-rest"),c=fa("a-input"),p=fa("a-button");return ua(),zt("div",Qd,[Xt(u,null,{default:xa(()=>{var t,l;return[e.modelName&&e.cascadeField?(ua(),Gt(Ta(we),{key:0,value:(null===(t=e.data)||void 0===t||null===(t=t.leftValue)||void 0===t?void 0:t.field_search_key)||(null===(l=e.data)||void 0===l||null===(l=l.leftValue)||void 0===l?void 0:l.key),"filter-field-by-function":a,"field-meta-list":e.fieldList,"model-name":e.modelName,style:{flex:"1","min-width":"0","margin-right":"12px"},onFieldClick:E},null,8,["value","field-meta-list","model-name"])):(ua(),Gt(d,{key:1,value:T.value,options:y.value,disabled:e.readonly,"allow-clear":e.isAllowClear,"filter-option":w,placeholder:Ta(At)("sys.chooseText"),"show-search":"",style:{width:"212px","margin-right":"12px"},class:oa(["tree-action-select",e.hasPermScopeError&&!T.value?"is-perm-scope-error":""]),onChange:C},null,8,["value","options","disabled","allow-clear","placeholder","class"]))]}),_:1}),Xt(u,null,{default:xa(()=>{var t;return[Xt(d,{class:oa(e.readonly?"tree-action-select":""),disabled:e.readonly||!1,placeholder:Ta(At)("sys.chooseText"),options:g.value,value:null===(t=e.data)||void 0===t?void 0:t.operatorValue,style:{width:"120px","margin-right":"12px"},onChange:R},null,8,["class","disabled","placeholder","options","value"])]}),_:1}),Array.isArray(r.value)&&0===r.value.length?(ua(),Gt(u,{key:0},{default:xa(()=>[Xt(c,{disabled:!0,placeholder:Ta(At)("sys.chooseText"),style:{flex:"1","min-width":"0"}},null,8,["placeholder"])]),_:1})):$t("",!0),(ua(!0),zt(Bt,null,ha(r.value,(t,a)=>(ua(),zt(Bt,{key:a},[r.value.length>1&&a===r.value.length-1?(ua(),zt("span",eu,ba(Ta(At)("sys.webRender.to")),1)):$t("",!0),t.isHide?(ua(),zt("div",tu)):(ua(),Gt(u,{key:2},{default:xa(()=>{var s,d,u,c,p;return[Ht("div",au,[(ua(),Gt(ga(l[null===(s=t[null===(d=e.data)||void 0===d||null===(d=d.rightValue)||void 0===d?void 0:d[a].valueType])||void 0===s?void 0:s.cmp]),aa({disabled:e.readonly,style:{width:"100%"},placeholder:Ta(At)("sys.pleaseSelectSth"),value:b.value[a],bordered:""},{ref_for:!0},null===(u=t[null===(c=e.data)||void 0===c||null===(c=c.rightValue)||void 0===c?void 0:c[a].valueType])||void 0===u?void 0:u.attrs,{"filter-type":e.filterType,class:[e.readonly?"tree-action-select left-border":"",!e.hasPermScopeError||!T.value||b.value[a]&&(null===(p=b.value[a])||void 0===p?void 0:p.length)?"":"is-perm-scope-error"],onChange:e=>((e,t)=>{var a;const l=null===(a=i.data)||void 0===a||null===(a=a.rightValue)||void 0===a?void 0:a[t].valueType;let s;var r;s=h.value?l!==Ld.FIXED||Va(e)?e:pl(e).format(o[m.value]):(null==e?void 0:e.target)?null===(r=e.target)||void 0===r?void 0:r.value:e,n(v.value,"rightValue",s,{index:t,key:"result"})})(e,a),"onUpdate:pageNo":e=>function(e){var t,a;const l=r.value[e];(null===(t=l[null==l||null===(a=l.typeKeys)||void 0===a?void 0:a[e]])||void 0===t||null===(t=t.attrs)||void 0===t||null===(t=t.apiParams)||void 0===t?void 0:t.pageNo)&&(r.value[e][r.value[e].typeKeys[e]].attrs.apiParams.pageNo=r.value[e][r.value[e].typeKeys[e]].attrs.apiParams.pageNo+1)}(a)}),null,16,["disabled","placeholder","value","filter-type","class","onChange","onUpdate:pageNo"]))])]}),_:2},1024))],64))),128)),Ht("div",lu,[!e.readonly&&(e.selectFiledKeys&&e.selectFiledKeys.length>1||e.data.dataLen>1)?(ua(),Gt(p,{key:0,type:"link",size:"small",class:"ml-12px perm-action-delete",onClick:S},{icon:xa(()=>[...s[0]||(s[0]=[Ht("i",{class:"gct-iconfont icon-icon_shanchu"},null,-1)])]),_:1})):$t("",!0)])])}}}),iu=/* @__PURE__ */Qe(ou,[["__scopeId","data-v-a053095c"]]),su={key:1,class:"data-rules-header"},nu=/* @__PURE__ */Zt({__name:"data-rules-container",props:{fieldList:{},detail:{},type:{},readonly:{type:Boolean},isDesign:{type:Boolean},mainModelKey:{},isPageDesigner:{type:Boolean},isOnlineFormDesigner:{type:Boolean},allowClear:{type:Boolean},excludeValueType:{},excludeOperatorType:{},apiConfig:{},onlineFormFieldList:{},cascadeField:{type:Boolean},hasPermScopeError:{type:Boolean},searchType:{}},setup(e,{expose:t}){const a=e,{showDataRulesTree:l,editDataRulesTree:o,setTree:i,getDataRules:s,resetTree:n,getAllExpandedKeys:r,addNewRow:d}=sd(a.readonly),u=va(!1),c=va([]),p=va([]),v=Kt(()=>"filterConfig"===a.type),m=Kt(()=>"businessFlow"===a.type),h=Kt(()=>"edhrBuiltPerms"===a.type),y=Kt(()=>"permissionScope"===a.type),f=Kt(()=>a.readonly?l.value:o.value),g=Kt(()=>{var e;return m.value||h.value||y.value?a.fieldList:null===(e=a.fieldList)||void 0===e?void 0:e.filter(e=>Object.keys(a.searchType).includes(e.type))}),b=Kt(()=>{var e;return a.allowClear&&1==f.value.length&&1==(null===(e=f.value[0])||void 0===e||null===(e=e.children)||void 0===e?void 0:e.length)||a.allowClear&&y.value});function _(){a.detail&&(u.value=a.detail.dataRuleEnabled,i(a.detail.dataRuleConfig))}return Ra(()=>a.detail,()=>{_()},{deep:!0}),Ra(()=>f,()=>{const e=r();c.value=e.allExpandedKeys,p.value=e.selectFiledKeys},{deep:!0}),Ra(()=>a.hasPermScopeError,e=>{var t;!a.readonly&&e&&(null===(t=o.value[0])||void 0===t||null===(t=t.children)||void 0===t||t.forEach(t=>{t.hasPermScopeError=e}))},{immediate:!0}),ra(()=>{_()}),t({getDataRulesResult:()=>{var e;const t=s(a.type,a.mainModelKey);return{dataRuleEnabled:u.value,...t,operator:y.value?null===(e=f.value[0])||void 0===e?void 0:e.operatorType:void 0}},resetData:()=>{n()}}),(t,a)=>{const l=fa("a-tree"),o=fa("plus-outlined"),i=fa("a-button");return ua(),zt("div",{class:oa(["data-rules-container",y.value?"perm-scope-style":""])},[v.value||e.isDesign||m.value||h.value||y.value?e.readonly||e.isDesign||m.value||h.value||y.value?$t("",!0):(ua(),zt("div",su,ba(Ta(At)("sys.model.viewFilterCondition")),1)):(ua(),Gt(Hr,{key:0,checked:u.value,"onUpdate:checked":a[0]||(a[0]=e=>u.value=e),title:Ta(At)("sys.appDesigner.rulesGroup"),style:ia(u.value?{borderBottom:"1px solid #eaeaea"}:{})},null,8,["checked","title","style"])),v.value||u.value||m.value||h.value||y.value?(ua(),Gt(l,{key:2,"expanded-keys":c.value,"onUpdate:expandedKeys":a[1]||(a[1]=e=>c.value=e),class:"data-rules-container-tree","tree-data":f.value,"default-expand-all":!0,"block-node":!0,selectable:!1,"show-line":{showLeafIcon:!1}},{title:xa(({data:t})=>{var a,l;return["group"===t.type?(ua(),zt(Bt,{key:0},[y.value?(ua(),Gt(Jd,{key:1,id:t.key,data:t,"operator-type":t.operatorType,readonly:e.readonly},null,8,["id","data","operator-type","readonly"])):(ua(),Gt(dd,{key:0,id:t.key,level:t.level,data:t,"operator-type":t.operatorType,readonly:e.readonly},null,8,["id","level","data","operator-type","readonly"]))],64)):(ua(),zt(Bt,{key:1},[y.value?(ua(),Gt(iu,{key:1,data:t,"field-list":g.value,"select-filed-keys":p.value,"filter-type":e.type,readonly:e.readonly,"is-page-designer":e.isPageDesigner,"is-allow-clear":b.value,"exclude-value-type":e.excludeValueType,"exclude-operator-type":e.excludeOperatorType,"api-config":e.apiConfig,"model-name":null===(l=e.detail)||void 0===l?void 0:l.modelName,"cascade-field":e.cascadeField,"has-perm-scope-error":t.hasPermScopeError},null,8,["data","field-list","select-filed-keys","filter-type","readonly","is-page-designer","is-allow-clear","exclude-value-type","exclude-operator-type","api-config","model-name","cascade-field","has-perm-scope-error"])):(ua(),Gt(Xd,{key:0,data:t,"field-list":g.value,"select-filed-keys":p.value,"filter-type":e.type,readonly:e.readonly,"main-model-key":e.mainModelKey,"online-form-field-list":e.onlineFormFieldList,"is-page-designer":e.isPageDesigner,"is-online-form-designer":e.isOnlineFormDesigner,"is-allow-clear":b.value,"exclude-value-type":e.excludeValueType,"exclude-operator-type":e.excludeOperatorType,"api-config":e.apiConfig,"model-name":null===(a=e.detail)||void 0===a?void 0:a.modelName,"cascade-field":e.cascadeField,"search-type":e.searchType},null,8,["data","field-list","select-filed-keys","filter-type","readonly","main-model-key","online-form-field-list","is-page-designer","is-online-form-designer","is-allow-clear","exclude-value-type","exclude-operator-type","api-config","model-name","cascade-field","search-type"]))],64))]}),_:1},8,["expanded-keys","tree-data"])):$t("",!0),y.value?(ua(),Gt(i,{key:3,class:"perm-root-node-add-row",type:"link",onClick:a[2]||(a[2]=e=>(()=>{const e=f.value[0];d((null==e?void 0:e.key)||"root")})())},{default:xa(()=>[Xt(o),Yt(" "+ba(Ta(At)("sys.add")),1)]),_:1})):$t("",!0)],2)}}}),ru=nu,du={class:"field-role-container"},uu={key:0,class:"table-wrap"},cu=/* @__PURE__ */Zt({__name:"field-role-container",props:{dataSource:{},detail:{}},setup(e,{expose:t}){const a=[{title:At("sys.appDesigner.field"),dataIndex:"name"}],l=e,o=va(),i=va(!1),s=va({selectedRowKeys:[],onChange:function(e,t){s.value.selectedRowKeys=e,o.value=t}});return Ra([()=>l.detail,()=>l.dataSource],()=>{var e,t;l.detail&&(i.value=l.detail.fieldPermissionEnabled,o.value=null===(e=l.dataSource)||void 0===e?void 0:e.filter(e=>l.detail.fieldPermission.includes(e.key)),s.value.selectedRowKeys=null===(t=o.value)||void 0===t?void 0:t.map(e=>e.key))},{deep:!0}),t({getFieldRoleResult:()=>{var e;return{fieldPermissionEnabled:i.value,selectRows:(null===(e=o.value)||void 0===e?void 0:e.map(e=>e.key))||[]}},resetData:()=>{o.value=void 0,i.value=!1,s.value.selectedRowKeys=[]}}),(t,l)=>{const o=fa("a-table");return ua(),zt("div",du,[Xt(Hr,{checked:i.value,"onUpdate:checked":l[0]||(l[0]=e=>i.value=e),title:Ta(At)("sys.appDesigner.fieldList")},null,8,["checked","title"]),i.value?(ua(),zt("div",uu,[Xt(o,{"data-source":e.dataSource,columns:a,"show-index-column":!1,pagination:!1,striped:!1,bordered:!0,"row-selection":s.value},null,8,["data-source","row-selection"])])):$t("",!0)])}}}),pu=cu,vu={mounted(e,t){var a;if(!t.value)return!1;null===(a=t.instance)||void 0===a||a.$nextTick(()=>{const a=t.value,l=e,o=document.createElement("div");l.appendChild(o),o.style.cursor="col-resize",o.style.position="absolute",o.style.height="100%",o.style.width="5px",o.style.right="0px",o.style.top="0px",o.style.background="rgba(255, 0, 0, 0);",o.onmousedown=t=>{const o=l.clientWidth,i=t.clientX;document.onmousemove=function(t){t.preventDefault();let s=o+(t.clientX-i);s=s<a?a:s,l.setAttribute("style",`width:${s}px !important;`);const n=new CustomEvent("drag-resize-width",{detail:{width:s,resizing:!0}});e.dispatchEvent(n)},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}})}},mu={mounted(e,t){e.__ellipsisHandler__=()=>{const a=e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight,l=t.value;a?e.setAttribute("title",l):e.removeAttribute("title")},e.addEventListener("mouseenter",e.__ellipsisHandler__)},beforeUnmount(e){e.__ellipsisHandler__&&e.removeEventListener("mouseenter",e.__ellipsisHandler__)}},hu=/* @__PURE__ */Qe(/* @__PURE__ */Zt({__name:"target-loading",props:{tip:{type:String,default:""},size:{type:String,default:Rt.LARGE,validator:e=>[Rt.DEFAULT,Rt.SMALL,Rt.LARGE].includes(e)},absolute:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},background:{type:String},theme:{type:String}},setup:e=>(t,a)=>Oa((ua(),zt("section",{class:oa(["full-loading",{absolute:e.absolute,[e.theme]:!!e.theme}]),style:ia([e.background?`background-color: ${e.background}`:""])},[Xt(Ta(nl),aa(t.$attrs,{tip:e.tip,size:e.size,spinning:e.loading}),null,16,["tip","size","spinning"])],6)),[[Ca,e.loading]])}),[["__scopeId","data-v-d448466c"]]),yu={mounted(e,t){const a=e.getAttribute("loading-tip"),l=e.getAttribute("loading-background"),o=e.getAttribute("loading-size"),i=!!t.modifiers.fullscreen;e.instance=function(e,t,a=!1){let l=null;const o=pa({tip:"",loading:!0,...e});function i(e=document.body){l&&l.el&&e.appendChild(l.el)}return l=Xt(Zt({render:()=>Qt(hu,{...o})})),a?setTimeout(()=>{ma(l,document.createElement("div"))},0):ma(l,document.createElement("div")),t&&i(t),{vm:l,close:function(){(null==l?void 0:l.el)&&l.el.parentNode&&l.el.parentNode.removeChild(l.el)},open:i,setTip:e=>{o.tip=e},setLoading:e=>{o.loading=e},get loading(){return o.loading},get $el(){return null==l?void 0:l.el}}}({tip:a,background:l,size:o||"large",loading:!!t.value,absolute:!i},i?document.body:e)},updated(e,t){const a=e.instance;var l;a&&(a.setTip(e.getAttribute("loading-tip")),t.oldValue!==t.value&&(null===(l=a.setLoading)||void 0===l||l.call(a,t.value&&!a.loading)))},unmounted(e){var t;null==e||null===(t=e.instance)||void 0===t||t.close()}};function fu(e){e.use(qa),function(e){!function(e){e.directive("dragResize",vu)}(e),function(e){e.directive("ellipsis-title",mu)}(e),function(e){e.directive("target-loading",yu)}(e)}(e),e.use(be),Object.entries(hl).forEach(([t,a])=>{e.component(t,a)}),e.component(g.name,g),e.component(xn.name,xn),e.component("OverlayScrollbarsComponent",N),e.use(jr),vl(e),e.use(Gs),e.use(bn),e.use(S)}async function gu(e){console.log("coreWebSetupApp")}_gct.message=new Ue,_gct.openUtil=je,_gct.register.editor=new po,_gct.register.formItem=new vo,_gct.register.tableEditor=new ln;var bu=new URL("./index.min.css",import.meta.url);Ot.load(bu.href);export{c as BaseButton,v as BasicButton,ee as BasicGrid,S as BasicModal,De as BatchSelectList,Ud as BoolOptions,E as ButtonTextEnum,pe as CONTENT_TYPE,_n as CategoryModal,Rn as CategorySider,Sd as Ch_FieldTypeName,Qr as Ch_Operator,ed as Ch_Perm_Operator,Id as Ch_SystemVars,Md as Ch_ValueType,me as CodeEditor,xn as ColorEditor,g as ColorPicker,Ad as ComponentTypeEnum,ve as ControllerKey,Bn as CopperFreeModal,Xn as CopperModal,Se as CopyModuleKey,Jn as CropperAvatar,mr as CropperFree,Un as CropperImage,ge as DATA_TYPE,Zr as DataRoleSetTabsEnum,ru as DataRulesContainer,Ce as DataRulesModal,Wr as DataTypeOptions,Od as DateSystemEnum,Dd as DateSystemKeys,V as DesignSaveTip,Z as DesignStepCheck,re as DesignViewLayout,D as DoubleInput,Hl as EditFormController,Yl as EditorController,po as EditorRegister,kl as EditorRegisterConst,Dl as EditorType,he as EmbedGrid,Il as FORM_CONTROLLER_INJECT_TAG,we as FieldCascader,pu as FieldRoleContainer,O as FieldUpload,Ee as FormAlert,Jl as FormCollapseController,Zl as FormCollapsePaneController,Al as FormCollapsePaneState,Nl as FormCollapseState,ao as FormEditItemController,Vl as FormEditItemState,to as FormGroupController,Fl as FormGroupState,oo as FormHiddenItemController,Xl as FormItemBasicController,Ml as FormItemBasicState,lo as FormItemController,vo as FormItemRegister,jl as FormItemState,io as FormLineController,Bl as FormLineState,Ll as FormState,Ql as FormTabController,eo as FormTabPaneController,Pl as FormTabPaneState,Ul as FormTabState,K as FullScreen,On as GCT_DND_INSERT_POS,In as GctDndContainer,Dn as GctDndDropLine,kn as GctDndItem,Ro as GctFormCollapseModel,Eo as GctFormCollapsePaneModel,zl as GctFormController,ko as GctFormGroupModel,Xo as GctFormHiddenItemModel,Wo as GctFormItemModel,Mo as GctFormLineModel,Po as GctFormTabModel,Ko as GctFormTabPaneModel,qo as GctFormTitleGroupModel,en as GctTableController,ie as GridBtns,F as GridPagination,ce as HightLight,s as I18Modal,w as I18nSelectBtn,u as I18nSelectInput,p as I18nSelectInputForm,k as I18nSelectTextarea,Re as I18nSelectTextareaForm,G as IconTooltip,er as ImagePreview,d as ImageUpload,I as LabelDesignControlComps,C as LabelDesigner,M as LabelParamsSelect,it as Lang,Ue as MessageUtil,Q as ModalNameEditor,Yr as ModalTypeEnum,fe as ModalWrapper,Sn as MonacoEditor,Pd as MultiOperatorTypes,z as NumberRange,Jr as OperatorTypeEnum,Je as OverlayController,$ as PRINT_ELE_TYPE,Oe as PaasBpmnLog,lt as Prop,se as QR_CODE_TYPE,Nd as RangTypeEnum,Xr as RelationTypeEnum,ne as SceneType,qr as SearchTypeEnum,P as SelectUserModal,r as SerialNumberContainer,B as ShrinkPanel,f as StageCanvas,U as StageView,Xs as TableActionItemController,Ws as TableEditItemController,Hs as TableEditItemState,ln as TableEditorRegister,zs as TableITemState,Ys as TableItemController,Qs as TableRowController,qs as TableRowState,$s as TableState,ot as Theme,Te as TreeEx,ke as TreeSelectEx,Ke as UseDragByLine,_ as UserPickType,xd as UserSystemEnum,kd as UserSystemKeys,Ld as ValueTypeEnum,X as ViewContainer,H as Vue3GridDndItem,oe as WUJIE_FORMULA_EVENTS,td as calcTreeChildLevel,fu as coreWebCreateAppVue,gu as coreWebSetupApp,nr as createImgPreview,ld as dropNode,Ye as filterTreeData,Ze as findRecursiveChild,ad as findTreePathById,xe as gctFieldSortPopover,x as gctFieldTreeSelect,co as gctFormItemEditorProps,Gd as getCmpConfig,J as getController,ue as getSpecificationsForSize,Gl as getValue,Ar as labelTmplModal,q as loadLabelInfo,de as modalConfirm,Pe as monacoLoader,T as openFormulaEditor,Y as openSelectUserModal,je as overlay,ze as recursiveIterate,Ve as recursiveTransfer,m as setIdentify,$l as setValue,ye as sizeOpt,te as transformCoordinateByDpi,j as transformsize,an as useAntTableScrollHeight,W as useController,ql as useEditFormController,y as useEditorConsole,b as useEditorConsoleInner,so as useForm,Wl as useFormItemController,uo as useFormValue,no as useGctFormValue,ro as useGctFormValueByText,le as useI18nSelect,Be as useKeyParser,A as useLabelModalPicker,qe as useLocale,Ie as useModal,L as useModalContext,h as useModalDragMove,n as useModalInner,ae as useModalPicker,_e as usePage,He as usePrinter,R as useProp,tn as useTableController,We as useTheme,et as useTreeList,at as validateFieldDefaultForLength,Fe as validateFieldDefaultForValue,tt as validateLengthRange,Kl as widthEditorInstall,Xe as withInstall};
|