@gct-paas/core-web 0.1.6-dev.5 → 0.1.6-dev.6
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/ColorPicker-DGQQb8I7.js +1 -0
- package/dist/{_plugin-vue_export-helper-59SbqtUR.js → _plugin-vue_export-helper-C9hXqKoS.js} +1 -1
- package/dist/{de_DE-BnwOalCV.js → de_DE-B3f8kAv-.js} +1 -1
- package/dist/diagram-config-item-C5Ha2XJq.js +1 -0
- package/dist/diagram-config-item-reverse-ChoxnW-Z.js +1 -0
- package/dist/diagram-config-item-virtual-Cbmggfwt.js +1 -0
- package/dist/{en_US-6Hw6WWah.js → en_US-BSG3Kz6v.js} +1 -1
- package/dist/{es_ES-tAqXFGrR.js → es_ES-BGP8IOmQ.js} +1 -1
- package/dist/{fr_FR-BkDgVS_P.js → fr_FR-Y-6CzjUq.js} +1 -1
- package/dist/hooks-yX21uJ6d.js +1 -0
- package/dist/index.min.css +1 -1
- package/dist/{ja_JP-AsmV92nC.js → ja_JP-CDlH1v8M.js} +1 -1
- package/dist/loader.esm.min.js +1 -1
- package/dist/{monaco-editor-CgESUPw_.js → monaco-editor-BTqXEIZI.js} +1 -1
- package/dist/{pt_PT-CCVWOJzE.js → pt_PT-N-iIoE2_.js} +1 -1
- package/dist/relationship-diagram-config-DstwwXCO.js +1 -0
- package/dist/{ru_RU-w4sUgbzL.js → ru_RU--ESLRHrj.js} +1 -1
- package/dist/template-1ZQd8Z1w.js +1 -0
- package/dist/{tr_TR-CGZch3eB.js → tr_TR-BOIykdZO.js} +1 -1
- package/dist/{vi_VN-DONxIDR7.js → vi_VN-CmVoM2Rw.js} +1 -1
- package/dist/{zh_CN-BxdD8hqG.js → zh_CN-DhsO5Qwx.js} +1 -1
- package/dist/{zh_TW-D5Y8j-oG.js → zh_TW-DWdp2kVo.js} +1 -1
- package/es/components/UserPick/src/user-pick.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/base-button/base-button.vue.mjs +1 -1
- package/es/components/field-cascader/src/hooks.d.ts +1 -0
- package/es/components/label-design/modal/template.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/label-design/panels/modals/diff-modal.vue_vue_type_script_setup_true_lang.mjs +2 -2
- package/es/components/label-design/panels/panel.vue_vue_type_script_setup_true_lang.mjs +1 -1
- package/es/components/label-design/panels/widget/controls/ImageData.vue.mjs +2 -2
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_script_setup_true_name_image-data_lang.mjs +2 -2
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_style_index_0_scoped_9232a443_lang.css +3 -0
- package/es/components/label-design/stage/stage.vue.d.ts +9 -0
- package/es/components/label-design/stage/stage.vue.mjs +2 -2
- package/es/components/label-design/stage/stage.vue_vue_type_script_setup_true_lang.mjs +2 -1
- package/es/components/label-design/stage/{stage.vue_vue_type_style_index_0_scoped_53b1f897_lang.css → stage.vue_vue_type_style_index_0_scoped_9275e9fb_lang.css} +8 -8
- package/es/components/layout/view-container/view-container.d.ts +1 -11
- package/es/components/layout/view-container/view-container.mjs +10 -14
- package/es/create-app-vue.mjs +4 -2
- package/es/index.d.ts +3 -2
- package/es/index.mjs +25 -24
- package/es/modules/color-picker/src/color-editor.vue.mjs +1 -1
- package/es/modules/gct-form/controller/form-item-basic/form-item-basic.controller.mjs +2 -0
- package/es/modules/gct-form/controller/gct-form/gct-form.controller.mjs +1 -0
- package/es/modules/gct-table/controller/gct-table/gct-table.controller.mjs +1 -0
- package/es/modules/gct-table/controller/table-item/table-item.controller.mjs +2 -0
- package/es/modules/gct-table/controller/table-row/table-row.controller.mjs +3 -0
- package/es/modules/global-modal/src/components/ModalWrapper.vue_vue_type_script_lang.mjs +1 -4
- package/es/modules/print-tmpl/print-tmpl-modal.vue_vue_type_script_setup_true_name_print-tmpl-modal_lang.mjs +2 -2
- package/es/modules/relationship-diagram-config/cache.controller.d.ts +70 -0
- package/es/modules/relationship-diagram-config/cache.controller.mjs +128 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.css +123 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.d.ts +381 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item/diagram-config-item.mjs +98 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.css +71 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.d.ts +28 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-container/diagram-config-item-container.mjs +53 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-info/diagram-config-item-info.d.ts +27 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-info/diagram-config-item-info.mjs +2 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.css +107 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.d.ts +34 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-reverse/diagram-config-item-reverse.mjs +198 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.css +68 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.d.ts +31 -0
- package/es/modules/relationship-diagram-config/components/diagram-config-item-virtual/diagram-config-item-virtual.mjs +53 -0
- package/es/modules/relationship-diagram-config/components/index.d.ts +5 -0
- package/es/modules/relationship-diagram-config/components/index.mjs +5 -0
- package/es/modules/relationship-diagram-config/constant/index.d.ts +72 -0
- package/es/modules/relationship-diagram-config/constant/index.mjs +70 -0
- package/es/modules/relationship-diagram-config/hooks/index.d.ts +10 -0
- package/es/modules/relationship-diagram-config/hooks/index.mjs +19 -0
- package/es/modules/relationship-diagram-config/index.d.ts +6 -0
- package/es/modules/relationship-diagram-config/index.mjs +28 -0
- package/es/modules/relationship-diagram-config/interface/i-link-provider/i-link-provider.d.ts +57 -0
- package/es/modules/relationship-diagram-config/interface/i-node-provider/i-node-provider.d.ts +18 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-link/i-relationship-diagram-link.d.ts +80 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-node/i-relationship-diagram-node.d.ts +82 -0
- package/es/modules/relationship-diagram-config/interface/i-relationship-diagram-options/i-relationship-diagram-options.d.ts +51 -0
- package/es/modules/relationship-diagram-config/interface/i-rule-config/i-rule-config.d.ts +135 -0
- package/es/modules/relationship-diagram-config/interface/index.d.ts +6 -0
- package/es/modules/relationship-diagram-config/link.controller.d.ts +75 -0
- package/es/modules/relationship-diagram-config/link.controller.mjs +121 -0
- package/es/modules/relationship-diagram-config/node.controller.d.ts +102 -0
- package/es/modules/relationship-diagram-config/node.controller.mjs +189 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/arrow-endpoint.d.ts +23 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/arrow-endpoint.mjs +33 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/blank-endpoint-renderer.d.ts +1 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/blank-endpoint-renderer.mjs +27 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/index.d.ts +3 -0
- package/es/modules/relationship-diagram-config/plumb-plugin/index.mjs +2 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.css +132 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.d.ts +21 -0
- package/es/modules/relationship-diagram-config/providers/default-link-provider/default-link-provider.mjs +184 -0
- package/es/modules/relationship-diagram-config/providers/default-node-provider/default-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/default-node-provider/default-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/providers/index.d.ts +5 -0
- package/es/modules/relationship-diagram-config/providers/index.mjs +5 -0
- package/es/modules/relationship-diagram-config/providers/reverse-node-provider/reverse-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/reverse-node-provider/reverse-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/providers/virtual-link-provider/virtual-link-provider.d.ts +16 -0
- package/es/modules/relationship-diagram-config/providers/virtual-link-provider/virtual-link-provider.mjs +26 -0
- package/es/modules/relationship-diagram-config/providers/virtual-node-provider/virtual-node-provider.d.ts +14 -0
- package/es/modules/relationship-diagram-config/providers/virtual-node-provider/virtual-node-provider.mjs +17 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.controller.d.ts +119 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.controller.mjs +199 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.css +113 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.d.ts +102 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.mjs +104 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.state.d.ts +44 -0
- package/es/modules/relationship-diagram-config/relationship-diagram-config.state.mjs +46 -0
- package/es/modules/relationship-diagram-config/utils/index.d.ts +1 -0
- package/es/modules/relationship-diagram-config/utils/register/register.d.ts +71 -0
- package/es/modules/relationship-diagram-config/utils/register/register.mjs +81 -0
- package/es/utils/recursive.mjs +1 -0
- package/package.json +10 -9
- package/dist/components-Dw_doMp_.js +0 -1
- package/dist/template-tzWsbHZE.js +0 -1
- package/es/components/label-design/panels/widget/controls/ImageData.vue_vue_type_style_index_0_scoped_3c4a9733_lang.css +0 -3
- /package/dist/{JsBarcode-DlXSdlvD.js → JsBarcode-DY53cVJ6.js} +0 -0
- /package/dist/{cropper-tw7tUDDe.js → cropper-DK_hFgpO.js} +0 -0
- /package/dist/{icon-next-picker-B_S_yInJ.js → icon-next-picker-DYiHqnNR.js} +0 -0
- /package/dist/{objectSpread2-DxfE1S3_.js → objectSpread2-DARadIQB.js} +0 -0
- /package/dist/{overlayscrollbars-vue-DtKFrHnA.js → overlayscrollbars-vue-Df-3wShc.js} +0 -0
- /package/dist/{rich-editor-K2Pv0Uja.js → rich-editor-DVOriJH0.js} +0 -0
- /package/dist/{useMonacoEditor-BO2ALW-7.js → useMonacoEditor-DqSQTg7b.js} +0 -0
package/dist/loader.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunk-DPOkwzLC.js";import{t}from"./defineProperty-Co6UJKQ3.js";import{$ as a,G as l,H as s,J as o,K as i,Q as n,U as r,W as c,X as d,Y as u,Z as p,_ as m,a as h,at as v,b as f,c as g,ct as y,d as b,et as w,f as _,g as x,h as C,i as k,it as S,l as O,lt as D,m as E,n as T,nt as I,o as j,ot as M,p as L,q as R,r as z,rt as F,s as U,st as B,t as A,tt as $,u as P,x as N,y as G}from"./components-Dw_doMp_.js";import{O as V,_ as H,a as q,b as K,c as Y,d as W,f as X,g as Z,i as J,l as Q,m as ee,n as te,o as ae,p as le,r as se,s as oe,t as ie,u as ne,v as re,y as ce}from"./_plugin-vue_export-helper-59SbqtUR.js";import{n as de,r as ue,t as pe}from"./useMonacoEditor-BO2ALW-7.js";import{t as me}from"./overlayscrollbars-vue-DtKFrHnA.js";import{BasicAction as he,CategoryModuleEnum as ve,EditorRegisterConst as fe,ExpressionModeEnum as ge,FIELD_TYPE as ye,FormContainerType as be,FormDesignEnum as we,PrintModeEnums as _e,PrintTypeEnum as xe,SizeEnum as Ce,cacheFnReturn as ke,cssLoader as Se,dataURLtoBlob as Oe,fileUrlParser as De,getInterfaceApi as Ee,modelLoader as Te,presetColor as Ie,t as je,transformUrl as Me,useCopyToClipboard as Le,useModal as Re,useNamespace as ze}from"@gct-paas/core";import{Fragment as Fe,computed as Ue,createBlock as Be,createCommentVNode as Ae,createElementBlock as $e,createElementVNode as Pe,createSlots as Ne,createTextVNode as Ge,createVNode as Ve,defineAsyncComponent as He,defineComponent as qe,getCurrentInstance as Ke,h as Ye,inject as We,isVNode as Xe,mergeProps as Ze,nextTick as Je,normalizeClass as Qe,normalizeStyle as et,onBeforeUnmount as tt,onMounted as at,onUnmounted as lt,openBlock as st,provide as ot,reactive as it,ref as nt,render as rt,renderList as ct,renderSlot as dt,resolveComponent as ut,toDisplayString as pt,toRef as mt,toRefs as ht,unref as vt,vShow as ft,watch as gt,watchEffect as yt,withCtx as bt,withDirectives as wt,withKeys as _t,withModifiers as xt}from"vue";import{clone as Ct,cloneDeep as kt,defaults as St,groupBy as Ot,isBoolean as Dt,isFunction as Et,isNil as Tt,isString as It,pickBy as jt}from"lodash-es";import Mt,{Checkbox as Lt,CheckboxGroup as Rt,Collapse as zt,Form as Ft,Image as Ut,Modal as Bt,Radio as At,RadioButton as $t,RadioGroup as Pt,Space as Nt,Spin as Gt,Tooltip as Vt,Upload as Ht,message as qt}from"ant-design-vue";import Kt from"dayjs";import{coreComponentsCreateAppVue as Yt}from"@gct-paas/core-components";import Wt from"vuedraggable";import*as Xt from"@ant-design/icons-vue";import{CloseOutlined as Zt,DeleteOutlined as Jt,EditOutlined as Qt,ExclamationCircleOutlined as ea,EyeOutlined as ta,LeftOutlined as aa,ReloadOutlined as la,RightOutlined as sa}from"@ant-design/icons-vue";import{VxeColumn as oa,VxeTable as ia}from"vxe-table";var na=/* @__PURE__ */function(e){return e.PREFIX="EDITOR___",e}({}),ra=/* @__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}({}),ca="formController",da=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",{})}},ua=class{constructor(){t(this,"disabled",!1),t(this,"readonly",!1),t(this,"visible",!0),t(this,"keepalive",!1),t(this,"destroyed",!1)}},pa=class extends ua{},ma=class extends ua{},ha=class extends ua{constructor(...e){super(...e),t(this,"activePane","")}},va=class extends ua{},fa=class extends ua{constructor(...e){super(...e),t(this,"label",""),t(this,"value",null),t(this,"options",[])}},ga=class extends ua{constructor(...e){super(...e),t(this,"expand",!0)}},ya=class extends fa{},ba=class extends ua{},wa=class{constructor(){this.map=/* @__PURE__ */new Map,this.maxListeners=100}setMaxListeners(e){this.maxListeners=e}getSize(e){return this.map.has(e)?this.map.get(e).length:0}addListener(e,t){if(t instanceof Function){this.map.has(e)||this.map.set(e,[]);const a=this.map.get(e);if(!(a.length<this.maxListeners))throw new Error(`事件监听已达最大上限[${this.maxListeners}],无法新增监听!`);a.push(t)}}removeListener(e,t){if(this.map.has(e)){const a=this.map.get(e);if(a.length>0)for(let e=0;e<a.length;e++)if(a[e]===t){a.splice(e,1);break}}}emit(e,...t){this.map.has(e)&&this.map.get(e).forEach(e=>{e(...t)})}async asyncEmit(e,...t){if(this.map.has(e)){const a=this.map.get(e).map(e=>e(...t));return Promise.all(a)}return[]}reset(){this.map.forEach(e=>{!function(e){if(e instanceof Array)e&&e.length>0&&e.splice(0,e.length);else if(e instanceof Object&&e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&delete e[t]}(e)}),this.map.clear()}},_a=class{constructor(e){this.e=new wa,this.e.setMaxListeners(e||300)}getSize(e){return this.e.getSize(e)}on(e,t){this.e.addListener(e,t)}off(e,t){this.e.removeListener(e,t)}emit(e,...t){this.e.emit(e,...t)}asyncEmit(e,...t){return this.e.asyncEmit(e,...t)}reset(){this.e.reset()}},{toString:xa}=Object.prototype;function Ca(e){return"[object AsyncFunction]"===xa.call(e)}function ka(e){return"[object Promise]"===xa.call(e)}function Sa(e,t,a,l){return{install(s){e&&t&&_gct.register.editor.register(na.PREFIX+e,t),a&&s.component(l??a.name,a)}}}function Oa(e,t){const a=e.split(".");try{return a.reduce((e,t)=>e[t],t)}catch(l){console.warn(l)}}function Da(e,t,a){const l=t.split("."),s=l.length-1;l.reduce((t,a,l)=>(l===s?t[a]=e:t[a]||(t[a]={}),t[a]),a)}var Ea=class{constructor(e){t(this,"evt",new _a),t(this,"state",it(new da)),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(".")||Da(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(){}},Ta=class extends Ea{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 Ia(e){const t=e();return t.state=it(t.state),lt(()=>t.destroy()),t}var ja=class{constructor(e){t(this,"model",void 0),t(this,"options",[]),this.model=e}},Ma=class{get key(){return this.model.name}get data(){return this.form.state.data}constructor(e,a){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==Oa(this.key,e)&&null!=this.model.defaultValue&&Da(this.model.defaultValue,this.key,e)}crateItemState(){return new ua}};function La(e){const t=e();return t.state=it(t.state),t}var Ra=class extends Ma{constructor(...e){super(...e),t(this,"type","collapse-pane")}crateItemState(){return new pa}},za=class extends Ma{constructor(...e){super(...e),t(this,"type","collapse")}crateItemState(){return new ma}},Fa=class extends Ma{constructor(...e){super(...e),t(this,"type","tab")}crateItemState(){return new ha}},Ua=class extends Ma{constructor(...e){super(...e),t(this,"type","tab-pane")}crateItemState(){return new va}},Ba=class extends Ma{constructor(...e){super(...e),t(this,"type","group")}crateItemState(){return new ga}},Aa=class extends Ma{get key(){return this.model.field??this.model.name}get value(){return Oa(this.key,this.form.state.data)}set value(e){const t=this.form.state.data,a=kt(Oa(this.key,t));Da(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 fa}},$a=class extends Aa{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 ya}},Pa=class extends Ma{constructor(...e){super(...e),t(this,"type","hidden")}},Na=class extends Ma{constructor(...e){super(...e),t(this,"type","line")}crateItemState(){return new ba}};function Ga(){return We("formController")}function Va(e){let t=null;if(e){const a=Ga().item[e];a&&(t=Ue({get:()=>a.value,set(e){"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||(a.value=e)}}))}else{let e=Ke().proxy;const a=e.$props,l=e.$emit;t=Ue({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 Ha(e,t){let a=Ke().proxy;const l=a.$props,s=a.$emit,o=e?e.length:0,i=t?t.length:0;return a=null,Ue({get:()=>{if(!l.value)return"";let a=l.value;return o>0&&a.startsWith(e)&&(a=a.substring(o)),i>0&&a.endsWith(t)&&(a=a.substring(0,a.length-i)),a},set:a=>{if(l.value===a)return;if(""==a)return void s("update:value","");let n=a;o>0&&(n=e+n),i>0&&(n+=t),s("update:value",n)}})}function qa(){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 Ka=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}},Ya=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}},Wa=/* @__PURE__ */qe({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=ze("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=Ue(()=>{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?Ve(ut("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:()=>[Ve("span",{class:"iconfont icon-assist ml5px text-[#bfbfbf]"},null)]}):null}},render(){const e=_gct.register.editor.get(fe.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=Ye("string"==typeof e.component?ut(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=[Ve("div",{class:[this.ns.e("label"),this.ns.em("label",t)]},[this.model.label,this.renderLabelTooltip()]),a]);const l={default:()=>a};var s;return"left"===t&&this.model.label&&(l.label=()=>[Ve("span",null,[this.model.label]),this.renderLabelTooltip()]),!1!==this.c.state.visible?Ve(ut("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(s=l)||"[object Object]"===Object.prototype.toString.call(s)&&!Xe(s)?l:{default:()=>[l]}):void 0}}),Xa=/* @__PURE__ */qe({name:"GctForm",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=ze("form");ot(ca,e.c);const a=nt(),l=e.c;Object.keys(l.item).forEach(e=>{const t=l.item[e];t.state=it(t.state)});const s=t=>Ve(ut("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),o=t=>{const a=l.provider[t.name];return a?a?Ye("string"==typeof a.component?ut(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:()=>i(t.children||[])}):void console.error(`未找到表单容器适配器:${t.name} - ${t.type}`):(console.error(`未找到表单项适配器实例:${t.name}`,t),null)},i=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?o(l):s(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:s,renderContainer:o,renderChildren:i}},render(){let e;return Ve(ut("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)&&!Xe(t)?e:{default:()=>[e]});var t}}),Za=class{constructor(){t(this,"component","gct-form-item")}createController(e,t){return La(()=>new $a(e,t))}},Ja=class{constructor(){t(this,"component","gct-form-hidden-item")}createController(e,t){return La(()=>new Pa(e,t))}},Qa=class{constructor(){t(this,"component","gct-form-collapse-pane")}createController(e,t){return La(()=>new Ra(e,t))}};function el(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var tl=/* @__PURE__ */qe({name:"GctFormCollapsePane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=ze("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?Ve(ut("flex-container"),{layout:e.model.flex},el(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Ve(ut("grid-container"),{layout:e.model.grid},el(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=Ze(l.props||{},{class:this.ns.e("last-child")})),Ve("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),al=class{constructor(e,a,l,s){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),s&&(this.children=s)}},ll={install(e){_gct.register.formItem.register("collapse-pane",()=>new Qa),e.component(tl.name,tl)}},sl=class{constructor(){t(this,"component","gct-form-collapse")}createController(e,t){return La(()=>new za(e,t))}},ol=/* @__PURE__ */qe({name:"GctFormCollapse",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){var t;const a=ze("form-collapse"),l=nt([0]),s={};e.model.width&&(s[a.cssVarName("form-collapse-width")]=e.model.width),e.model.height&&(s[a.cssVarName("form-collapse-height")]=e.model.height);const o=nt([]);return o.value=(null===(t=e.model.children)||void 0===t?void 0:t.map(e=>e.name))||[],{ns:a,keys:l,style:s,activeKeys:o,expandIconPosition:Ue(()=>"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 Ve(zt,{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 Ve(zt.Panel,{key:e.name,header:e.title,collapsible:l},{default:()=>[a[t]]})})]}})}}),il=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)}},nl={install(e){_gct.register.formItem.register("collapse",()=>new sl),e.component(ol.name,ol)}},rl=class{constructor(){t(this,"component","gct-form-group")}createController(e,t){return La(()=>new Ba(e,t))}},cl=/* @__PURE__ */qe({name:"GctFormGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e,{slots:t}){const a=ze("form-group"),l=nt([0]);function s(){return"flex"===e.model.layout?Ve(ut("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?Ve(ut("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 o={};return e.model.width&&(o[a.cssVarName("form-group-width")]=e.model.width),e.model.height&&(o[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 Ve(ut("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:o,ghost:!0},{default:()=>{return[Ve(ut("a-collapse-panel"),{key:"0",header:e.model.title},(a=t=s(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!Xe(a)?t:{default:()=>[t]}))];var a}})}return Ve("div",{class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible),e.model.class],style:o},[!1===e.model.showHeader?Ve("div",{class:a.e("title")},[e.model.title]):null,Ve("div",{class:a.e("content")},[s()])])}}}),dl=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)}},ul={install(e){_gct.register.formItem.register("container",()=>new rl),e.component(cl.name,cl)}},pl=class{constructor(){t(this,"component","gct-form-line")}createController(e,t){return La(()=>new Na(e,t))}},ml=/* @__PURE__ */qe({name:"GctFormLine",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup:e=>({ns:ze("form-line"),style:Ue(()=>{const{paddingTop:t,paddingBottom:a}=e.model;return{paddingTop:t,paddingBottom:a}})}),render(){return Ve("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[Ve("div",{class:this.ns.e("line")},null)])}}),hl=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)}},vl={install(e){_gct.register.formItem.register("line",()=>new pl),e.component(ml.name,ml)}},fl=class{constructor(){t(this,"component","gct-form-tab")}createController(e,t){return La(()=>new Fa(e,t))}},gl=/* @__PURE__ */qe({name:"GctFormTab",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=ze("form-tab"),a=Ga(),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),gt(e.c.state,()=>{a.evt.emit("changeState",e.c.model.name,e.c)}),at(()=>{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 Ve(ut("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)=>Ve(ut("a-tab-pane"),{key:e.name,tab:e.title},{default:()=>[a[t]]}))]}})}}),yl=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)}},bl={install(e){_gct.register.formItem.register("tab",()=>new fl),e.component(gl.name,gl)}},wl=class{constructor(){t(this,"component","gct-form-tab-pane")}createController(e,t){return La(()=>new Ua(e,t))}};function _l(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var xl=/* @__PURE__ */qe({name:"GctFormTabPane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=ze("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?Ve(ut("flex-container"),{layout:e.model.flex},_l(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Ve(ut("grid-container"),{layout:e.model.grid},_l(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 Ve("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),Cl=class{constructor(e,a,l,s){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),s&&(this.children=s)}},kl={install(e){_gct.register.formItem.register("tab-pane",()=>new wl),e.component(xl.name,xl)}},Sl=class{constructor(){t(this,"component","gct-form-title-group")}createController(e,t){return La(()=>new Ba(e,t))}};function Ol(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var Dl=/* @__PURE__ */qe({name:"GctFormTitleGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0}},setup(e){const t=ze("form-title-group"),a=nt([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?Ve(ut("flex-container"),{layout:e.model.flex},Ol(t)?t:{default:()=>[t]}):"grid"===e.model.layout?Ve(ut("grid-container"),{layout:e.model.grid},Ol(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 Ve("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.model.class],style:this.style},[Ve("div",{class:this.ns.e("title")},[this.model.title]),Ve("div",{class:this.ns.e("content")},[this.renderContainer(a)])])}}),El=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)}},Tl={install(e){_gct.register.formItem.register(be.FORM_TITLE_GROUP,()=>new Sl),e.component(Dl.name,Dl)}},Il=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)}},jl=class{constructor(e,a,l,s){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=s}},Ml={install(e){_gct.register.formItem.register("item",()=>new Za),_gct.register.formItem.register("hidden",()=>new Ja),e.use(ll),e.use(nl),e.use(ul),e.use(vl),e.use(bl),e.use(kl),e.use(Tl),e.component(Xa.name,Xa),e.component(Wa.name,Wa)}},Ll=/* @__PURE__ */qe({name:"FlexItem",props:{layout:Object},setup:e=>({ns:ze("flex-item"),getStyle:()=>{const t={};if(e.layout){const{order:a,alignSelf:l,flexBasis:s,flexGrow:o,flexShrink:i}=e.layout;null!=a&&(t.order=a),null!=l&&(t["align-self"]=l),null!=s&&(t["flex-basis"]=s),null!=o&&(t["flex-grow"]=o),null!=i&&(t["flex-shrink"]=i)}return t}}),render(){var e,t;return Ve("div",{class:this.ns.b(),style:this.getStyle()},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)])}}),Rl=/* @__PURE__ */qe({name:"FlexContainer",props:{layout:Object},setup:e=>({ns:ze("flex-container"),getStyle:()=>{const t={};if(e.layout){const{alignContent:a,alignItems:l,flexDirection:s,flexWrap:o,justifyContent:i}=e.layout;null!=a&&(t.alignContent=a),null!=l&&(t.alignItems=l),null!=s&&(t.flexDirection=s),null!=o&&(t.flexWrap=o),null!=i&&(t.justifyContent=i)}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||[]),Ve("div",{class:this.ns.b(),style:this.getStyle()},[a.map(e=>{if(!e)return null;const t=e.props.model.flexItem;return Ve(Ll,{layout:t,style:this.getItemStyle(e.props.model)},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!Xe(a)?e:{default:()=>[e]});var a})])}});function zl(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var Fl=/* @__PURE__ */qe({name:"GridContainer",props:{layout:Object},setup(e,{slots:t}){const a=ze("grid-container");return()=>{var l;let s;const o=e.layout||{};let i=(null===(l=t.default)||void 0===l?void 0:l.call(t))||[];return i.length>0&&(i=i[0].children||[]),Ve(ut("a-row"),{class:a.b(),wrap:!0,gutter:o.gutter},zl(s=i.map(e=>{if(!e)return null;const t=e.props.model.gridItem;return Ve(ut("a-col"),{span:t?t.span??24:24,offset:t?t.offset??0:0},zl(e)?e:{default:()=>[e]})}))?s:{default:()=>[s]})}}}),Ul=/* @__PURE__ */qe({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=ze("gct-form-action"),a=Ga();return{ns:t,onClick:function(t){t.stopPropagation(),e.model.click&&e.model.click(t,a,e.c,e.data)}}},render(){return Ve(ut("a-button"),Ze({class:this.ns.b(),onClick:this.onClick,size:this.size,type:"link"},this.model.props||{}),{default:()=>[this.model.label]})}}),Bl=class{constructor(){t(this,"component","gct-form-action")}},Al=Sa(ra.ACTION,()=>new Bl,Ul);function $l(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var Pl=/* @__PURE__ */qe({name:"GctFormDateFormatSelect",props:qa(),setup(e){var t;const a=ze("form-date-format-select"),l=Ue(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.fieldTypeKey)||"type"]}),s=Ue(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.mappingTypeKey)||"mapping_type"]}),o=Va((null===(t=e.model)||void 0===t?void 0:t.separatorKey)||"separator"),i=[{label:"-",value:"-"},{label:"/",value:"/"},{label:"·",value:"."}],n=Va(),r=Ue(()=>l.value===ye.DATE_TIME||s.value===ye.DATE_TIME?[{label:`yyyy${o.value}MM${o.value}dd HH`,value:`YYYY${o.value}MM${o.value}DD HH`},{label:`yyyy${o.value}MM${o.value}dd HH:mm`,value:`YYYY${o.value}MM${o.value}DD HH:mm`},{label:`yyyy${o.value}MM${o.value}dd HH:mm:ss`,value:`YYYY${o.value}MM${o.value}DD HH:mm:ss`}]:l.value===ye.DATE||s.value===ye.DATE?[{label:"yyyy",value:"YYYY"},{label:`yyyy${o.value}MM`,value:`YYYY${o.value}MM`},{label:`yyyy${o.value}MM${o.value}dd`,value:`YYYY${o.value}MM${o.value}DD`}]:[]);return gt(o,()=>{l.value!==ye.DATE_TIME&&s.value!==ye.DATE_TIME?l.value!==ye.DATE&&s.value!==ye.DATE?n.value="":n.value=`YYYY${o.value}MM${o.value}DD`:n.value=`YYYY${o.value}MM${o.value}DD HH:mm:ss`}),()=>{var t,l;let s,c;return Ve("div",{class:a.b()},[Ve("span",{class:a.e("first")},[Ve(ut("a-select"),Ze({value:o.value,"onUpdate:value":e=>o.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||je("sys.chooseText")},(null===(t=e.model)||void 0===t?void 0:t.props)||{}),$l(s=i.map(e=>Ve(ut("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?s:{default:()=>[s]})]),Ve("span",{class:a.e("second")},[Ve(ut("a-select"),Ze({value:n.value,"onUpdate:value":e=>n.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||je("sys.chooseText")},(null===(l=e.model)||void 0===l?void 0:l.props)||{}),$l(c=r.value.map(e=>Ve(ut("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?c:{default:()=>[c]})])])}}}),Nl=class{constructor(){t(this,"component","gct-form-date-format-select")}},Gl=Sa(ra.DATE_FORMAT_SELECT,()=>new Nl,Pl),Vl=/* @__PURE__ */qe({name:"GctFormLengthUnit",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup:()=>({ns:ze("form-length-unit"),val:Va()}),render(){return Ve(ut("length-unit-editor"),Ze({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("readonly",this.model.readonly)]}),null)}}),Hl=class{constructor(){t(this,"component","gct-form-length-unit")}},ql=Sa(ra.LENGTH_UNIT,()=>new Hl,Vl),Kl=/* @__PURE__ */qe({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=ze("form-color"),a=Va();return console.debug("GctFormColor props",e),()=>Ve(ut("color-editor"),Ze({value:a.value,"onUpdate:value":e=>a.value=e},e.model.props||{},{class:[t.b(),t.is("readonly",e.model.readonly)]}),null)}}),Yl=class{constructor(){t(this,"component","gct-form-color")}},Wl=Sa(ra.COLOR,()=>new Yl,Kl),Xl=class{constructor(){t(this,"component","gct-form-date")}},Zl=/* @__PURE__ */qe({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=ze("gct-form-date"),a=new ja(e.model),l=Va(),s=nt(l.value?Kt(l.value):null),o=nt(l.value?Kt(l.value):null);return{ns:t,c:a,dateVal:s,timeVal:o,onChange:()=>{let e="";s.value&&(e=s.value.format("YYYY-MM-DD")),o.value?e+=` ${o.value.format("HH:mm:ss")}`:e+=" 00:00:00",l.value=e}}},render(){return Ve("div",{class:[this.ns.b()]},[this.isDate?Ve(ut("a-date-picker"),Ze({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?Ve(ut("a-time-picker"),{value:this.timeVal,"onUpdate:value":e=>this.timeVal=e,placeholder:"请选择时间",onChange:this.onChange},null):null])}}),Jl=Sa(ra.DATE,()=>new Xl,Zl),Ql=/* @__PURE__ */qe({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=ze("form-formula"),a=Ga(),l=nt(),s=Va(),o=Va("expressionEcho"),i=async()=>{const t=await y({expr:s.value.expr,exprEcho:null==o?void 0:o.value,returnType:s.value.mappingType||"string",mode:ge.DATA_SET_FORMULA,identifiers:{},...e.model.config||{}});t&&(s.value={expr:t.expr,mappingType:t.returnType},o&&(o.value=t.exprEcho),a.validateItem(e.itemModel.name))};return()=>Ve("div",{class:t.b(),onClick:i},[Ve(ut("a-input"),{ref:l,class:t.e("input"),readonly:!0,value:(null==o?void 0:o.value)||s.value,placeholder:je("sys.inputText")},null)])}}),es=class{constructor(){t(this,"component","gct-form-formula")}},ts=Sa(ra.FORMULA,()=>new es,Ql),as=class{constructor(){t(this,"component","gct-form-check-switch")}},ls=/* @__PURE__ */qe({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:ze("gct-form-check-switch"),val:Va()}),render(){return this.model.isSwitch?Ve("div",{class:[this.ns.b(),this.ns.m("switch"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]},[Ve(ut("a-switch"),Ze({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)]):Ve(ut("a-checkbox"),Ze({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]})}}),ss=Sa(ra.CHECK_SWITCH,()=>new as,ls);function os(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var is=/* @__PURE__ */qe({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=ze("form-select-group"),l=We("formController"),s=nt(""),o=nt(null),i=nt(!1),n=nt(/* @__PURE__ */new Set),r=Ue({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 c(e,t){return e.className.indexOf(t)>-1?e:e.parentElement?c(e.parentElement,t):null}function d(e){var t;c(e.target,"ant-select-dropdown")||null===(t=o.value)||void 0===t||t.blur()}window.addEventListener("wheel",d);const u=nt(),p=Ue({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;m.value.find(t=>(t.options&&(a=t.options.find(t=>t.value==e)),!!a)),a&&(r.value=a.label)}}),m=Ue(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:[]),h=async()=>e.c.loadDictionary();return null!=p.value&&h(),lt(()=>{window.removeEventListener("wheel",d)}),{ns:a,selectRef:o,searchValue:s,open:i,rootRef:u,val:p,options:m,loadOptions:h,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 Ve("div",{ref:"rootRef",class:this.ns.b()},[Ve(ut("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},os(e=this.options.map(e=>{let t;const a=null!=e.label?e.label:" ",l=String(e.value),s=this.isGroupCollapsed(l),o=(s&&e.options||[]).filter(e=>!this.searchValue||e.label.toLowerCase().indexOf(this.searchValue.toLowerCase())>=0);return 0===o.length?null:Ve(ut("a-select-opt-group"),{key:e.value,label:Ve("div",{class:[this.ns.b("group-header"),this.model.groupCollapsible?this.ns.b("group-header--clickable"):""],onClick:()=>this.toggleGroupCollapse(l)},[this.model.groupCollapsible&&Ve("span",{class:[this.ns.be("group-header","arrow"),s?this.ns.bem("group-header","arrow","collapsed"):""]},[Ve("i",{class:["iconfont",1!=s?"icon-right":"icon-Down"]},null)]),Ve("span",{class:this.ns.be("group-header","title")},[a])])},os(t=o.map(e=>Ve(ut("a-select-option"),{class:this.ns.b("item-option"),key:e.value,value:e.value},{default:()=>[e.icon?Ve("span",{class:this.ns.be("item-option","item-icon")},[Ve("i",{class:`iconfont ${e.icon}`},null)]):"",Ve("span",{class:this.ns.be("item-option","item-label")},[e.label])]})))?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}}),ns=class{constructor(){t(this,"component","gct-form-select-group")}},rs=Sa(ra.SELECT_GROUP,()=>new ns,is),cs=class{constructor(){t(this,"component","gct-form-i18n")}},ds=/* @__PURE__ */qe({name:"GctFormI18n",props:qa(),emits:["update:value","blur"],setup(e,{emit:t}){var a;const l=ze("form-i18n"),s=Ga(),o=nt({}),i=nt(!1),n=s.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=Ue(()=>{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 Te.loadField((null===(t=e.data)||void 0===t?void 0:t.modelKey)||e.context.modelKey,r.value);a&&(o.value=a)}();const c=Ue({get:()=>e.value?e.value:!0===i.value?"":o.value.name,set:a=>{"string"==typeof a&&(a=a.trim()),i.value=!0,"object"!=typeof a&&e.value==a||(a||(d.value=""),t("update:value",a))}}),d=Ue({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:c,i18nConfigValue:d,onBlur:function(){i.value=!1}}},render(){var e;return Ve(ut("i18n-select-input"),Ze({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||this.$t("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)}}),us=Sa(ra.I18N,()=>new cs,ds),ps=/* @__PURE__ */qe({name:"GctFormIconSelect",props:{value:{type:Object},model:{type:Object,required:!0}},emits:["update:value"],setup(e,{emit:t}){var a,l,s;const o=ze("gct-form-icon-select"),i=nt(e.value),n=nt((null===(a=i.value)||void 0===a?void 0:a.icon)||e.model.defaultIcon),r=nt((null===(l=i.value)||void 0===l?void 0:l.color)||e.model.defaultColor),c=nt((null===(s=i.value)||void 0===s?void 0:s.background)||e.model.defaultBackground);return gt(()=>e.value,e=>{i.value=e,e&&(n.value=e.icon,r.value=e.color)}),gt([n,r,c],()=>{i.value={icon:n.value,color:r.value},t("update:value",i.value)}),{ns:o,icon:n,color:r,background:c,nextPickerStyle:Ue(()=>{if(e.model.size)return{"--box-size":e.model.size+"px"}})}},render(){return Ve("div",{class:this.ns.b()},[Ve(ut("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?Ve("span",{class:this.ns.e("title")},[this.model.label]):null])}}),ms=class{constructor(){t(this,"component","gct-form-icon-select")}},hs=Sa(ra.ICON_SELECT,()=>new ms,ps),vs=class{constructor(){t(this,"component","gct-form-number")}},fs=/* @__PURE__ */qe({name:"GctFormNumber",props:{model:{type:Object,required:!0},value:{type:String,default:""}},emits:["update:value"],setup:()=>({ns:ze("gct-form-number"),val:Va()}),render(){return Ve(ut("a-input-number"),Ze({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)}}),gs=Sa(ra.NUMBER,()=>new vs,fs),ys=class{constructor(){t(this,"component","gct-form-picker")}},bs=/* @__PURE__ */qe({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=ze("gct-form-picker"),l=Ga(),s=Ue({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}}),o=Ue({get:()=>!e.c.state.options.find(t=>t.value===e.value)&&s.value?s.value:e.value,set:a=>{if("string"==typeof a&&(a=a.trim()),"object"!=typeof a&&e.value==a)return;const s=e.c.state.options.find(e=>e.value===a);s&&s.data&&e.model.fieldMap&&e.model.fieldMap.map(e=>{const[t,a]=e.split(":");a&&(l.item[a].editorValue=s.data[t])}),t("update:value",a)}});return null!=o.value&&e.c.loadDictionary(),{ns:a,val:o,nameVal:s,loadOptions:()=>e.c.loadDictionary(),onChange:(e,t)=>{s.value=t.label}}},render(){return Ve(ut("a-select"),Ze({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)}}),ws=Sa(ra.PICKER,()=>new ys,bs),_s=/* @__PURE__ */qe({name:"GctFormPixelConfig",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup(){const e=ze("form-pixel-config"),t=Va("label_mode"),a=Va(),l=[{label:"百分比",value:"percent"},{label:"固定",value:"fixed"}],s=Ue(()=>"fixed"===t.value?"px":"%");function o(e){t.value=e,a.value="fixed"===e?100:30}return()=>Ve(ut("a-input-group"),{compact:!0,class:e.b()},{default:()=>[Ve(ut("a-select"),{class:e.e("select"),value:t.value,"onUpdate:value":e=>t.value=e,options:l,onChange:o},null),Ve(ut("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:s.value},null)]})}}),xs=class{constructor(){t(this,"component","gct-form-pixel-config")}},Cs=Sa(ra.PIXEL_CONFIG,()=>new xs,_s),ks=class{constructor(){t(this,"component","gct-form-select")}},Ss=/* @__PURE__ */qe({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=ze("gct-form-select"),a=nt();K(a,()=>{var e;l.value=!1,null===(e=a.value)||void 0===e||e.blur()});const l=nt(!1);function s(e,t){var a;return(null===(a=e.className)||void 0===a?void 0:a.indexOf(t))>-1?e:e.parentElement?s(e.parentElement,t):null}function o(e){var t;s(e.target,"ant-select-dropdown")||null===(t=a.value)||void 0===t||t.blur()}window.addEventListener("wheel",o);const i=nt(),n=new ja(e.model),r=Va(),c=Ue({get:()=>null!=r.value?r.value:void 0,set(e){r.value=e}}),d=Ue(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:n.options);return lt(()=>{window.removeEventListener("wheel",o)}),{ns:t,selectRef:a,open:l,rootRef:i,editorC:n,val2:c,options:d,onCloseDropdown:function(){l.value=!1,a.value&&a.value.blur()},onOpenDropdown:function(){l.value=!0},onChangeDropdown:function(){l.value=!l.value}}},render(){return Ve("div",{ref:"rootRef",class:this.ns.b()},[this.model.beforeText?Ve("div",{class:this.ns.e("before-text")},[this.model.beforeText]):null,Ve("div",{class:this.ns.e("content")},[Ve(ut("a-select"),Ze({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?Ve("div",{class:this.ns.e("after-text")},[this.model.afterText]):null])}}),Os=Sa(ra.SELECT,()=>new ks,Ss),Ds=class{constructor(){t(this,"component","gct-form-span")}},Es=/* @__PURE__ */qe({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=ze("form-span"),{model:a,itemModel:l,c:s}=ht(e);return s.value.loadDictionary(),{ns:t,val:Ue(()=>{if(a.value.format&&"function"==typeof a.value.format)return a.value.format(s.value.data,l.value,s.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(s.value.state.options.length>0){const t=s.value.state.options.find(t=>t.value==e.value);if(t)return t.label}return e.value}),handleClipboardKey:function(){const{isSuccessRef:t}=Le(e.value);t.value&&qt.success(je("sys.copySuccess"))}}},render(){let e=this.val;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),Ve("div",{class:this.ns.b()},[Ve("span",{class:this.ns.e("info")},[e]),this.model.copy&&Ve("span",{class:this.ns.e("copy")},[Ve("i",{class:"iconfont icon-fuzhi primary-gct",onClick:this.handleClipboardKey},null)])])}}),Ts=Sa(ra.SPAN,()=>new Ds,Es),Is=class{constructor(){t(this,"component","gct-form-switch")}},js=/* @__PURE__ */qe({name:"GctFormSwitch",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup:()=>({ns:ze("gct-form-switch"),val:Va()}),render(){return Ve("div",{class:this.ns.b()},[Ve(ut("a-switch"),Ze({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)])}}),Ms=Sa(ra.SWITCH,()=>new Is,js),Ls=class{constructor(){t(this,"component","gct-form-text")}},Rs=/* @__PURE__ */qe({name:"GctFormText",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=ze("gct-form-text"),a=Ha(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);function l(){"string"==typeof a.value&&(a.value=a.value.trim())}return()=>Ve(ut("a-input"),Ze({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)}}),zs=Sa(ra.TEXT,()=>new Ls,Rs),Fs=/* @__PURE__ */qe({name:"GctFormEmpty",setup(){const e=ze("gct-form-empty");return()=>Ve("span",{class:e.b()},null)}}),Us=class{constructor(){t(this,"component","gct-form-empty")}},Bs=Sa(ra.EMPTY,()=>new Us,Fs),As=class{constructor(){t(this,"component","gct-form-textarea")}},$s=/* @__PURE__ */qe({name:"GctFormTextarea",props:{model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(){const e=ze("gct-form-textarea"),t=Va();return{ns:e,val:t,handleBlur:()=>{"string"==typeof t.value&&(t.value=t.value.trim())}}},render(){return Ve(ut("a-textarea"),Ze({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)}}),Ps=Sa(ra.TEXTAREA,()=>new As,$s);function Ns(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var Gs=/* @__PURE__ */qe({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:ze("gct-form-radio"),val:Va()}),render(){let e;const t={...this.model.props||{},allowClear:!0,disabled:this.c.state.disabled};if(this.model.buttonMode){let e;return Ve(Pt,Ze({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=>Ve($t,{key:e.value,value:e.value},{default:()=>[e.label]})))?e:{default:()=>[e]})}return Ve(Pt,Ze({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 Ve(At,{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?Ve("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")?Ve(ut("assets-svg-icon"),{src:e.icon},null):e.icon]):null,Ve("span",{class:this.ns.e("item-label")},[e.label])]}})}))?e:{default:()=>[e]})}}),Vs=class{constructor(){t(this,"component","gct-form-radio")}},Hs=Sa(ra.RADIO,()=>new Vs,Gs),qs=/* @__PURE__ */qe({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:ze("gct-form-info"),val:Va()}),render(){let e=this.val||this.model.content;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),Ve("div",{class:[this.ns.b(),this.size?this.ns.m(this.size):null]},[this.model.icon?Ve("span",{class:this.ns.e("icon")},[Ve("i",{class:`iconfont ${this.model.icon}`},null)]):null,Ve("span",{class:this.ns.e("content"),title:e},[e])])}}),Ks=class{constructor(){t(this,"component","gct-form-info")}},Ys=Sa(ra.INFO,()=>new Ks,qs),Ws=Wt,Xs=/* @__PURE__ */qe({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=ze("gct-form-checkbox"),l=Va(),s=Ue(()=>e.model.isDrag?(l.value||[]).filter(e=>e.checked).map(e=>e.value):l.value),o=Ue(()=>{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:s,onChange:a=>{o.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",o.value):t("update:value",a)},onDragEnd:e=>{const{newIndex:a,oldIndex:l}=e;o.value.splice(a,0,o.value.splice(l,1)[0]),t("update:value",o.value)},slots:{item:({element:e})=>Ve("div",{class:"drag-checkbox-item ks-row-middle"},[Ve("i",{class:"icon-drag iconfont mr4px cursor-move text-[#C3C3C3] primary-gct-hover"},null),Ve(Lt,{value:e.value,disabled:e.disabled},{default:()=>[e.label]})])},options:o}},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[wt(Ve(Rt,Ze({value:this.checked,"onUpdate:value":e=>this.checked=e},e,{onChange:this.onChange}),{default:()=>[Ve(Ws,{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)]}),[[ft,this.model.isDrag]]),wt(Ve(Rt,Ze({value:this.checked,"onUpdate:value":e=>this.checked=e,options:this.options},e,{onChange:this.onChange}),null),[[ft,!this.model.isDrag]])]}}),Zs=class{constructor(){t(this,"component","gct-form-checkbox")}},Js=Sa(ra.CHECKBOX,()=>new Zs,Xs);function Qs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var eo=[{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"}],to=/* @__PURE__ */qe({name:"GctFormModelSelect",props:{model:{type:Object,required:!0},value:{type:String}},setup(e){const t=ze("form-model-select"),a=Va(),l=Va("category"),s=Va("categorySelect"),o=Va("modelName"),i=Va("formId"),n=nt([]),r=nt({}),c=async()=>{return"system"===s.value?(n.value=await _api.apaas.report.getListSystemModels()||[],{[je("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})||[],Ot(n.value,"group"));var t},{onFieldChange:d}=Ft.useInjectFormItemContext();at(async()=>{a.value=a.value?a.value:void 0,l.value=l.value||"entity",s.value=s.value||l.value,r.value=await c()});const u=async e=>{l.value=e,a.value=null,i.value=void 0,r.value=await c()},p=e=>{const t=n.value.find(t=>t.key===e);t&&(o.value=t.name),"system"===s.value&&(l.value=t.modelCategory),d(),"system"!==s.value&&(r.value=Ot(n.value,"group"))};return()=>{let l,o;return Ve("div",{class:t.b()},[Ve(ut("a-input-group"),{compact:!0},{default:()=>[Ve(ut("a-select"),{value:s.value,"onUpdate:value":e=>s.value=e,class:t.e("class"),placeholder:"请选择",onSelect:u,disabled:e.model.disabled},Qs(l=eo.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 Ve(ut("a-select-option"),{key:e.value,value:e.value},Qs(t=je(e.label))?t:{default:()=>[t]})}))?l:{default:()=>[l]}),Ve(ut("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},Qs(o=Object.keys(r.value).map(e=>{const t=r.value[e].map(e=>Ve(ut("a-select-option"),{key:e.key,value:e.key,label:e.name},{default:()=>[e.name]}));return Ve(ut("a-select-opt-group"),{key:e,label:e},Qs(t)?t:{default:()=>[t]})}))?o:{default:()=>[o]})]})])}}}),ao=class{constructor(){t(this,"component","gct-form-model-select")}},lo=Sa(ra.MODEL_SELECT,()=>new ao,to),so=/* @__PURE__ */qe({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=ze("form-multiple-choice"),l=nt(),s=Ue({get:()=>e.value??[],set:e=>{t("update:value",e)}});return null!=s.value&&e.c.loadDictionary(),{ns:a,rootRef:l,val:s,loadOptions:()=>e.c.loadDictionary({},e.model.force)}},render(){return Ve("div",{ref:"rootRef",class:this.ns.b()},[Ve(ut("a-select"),Ze({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)])}}),oo=class{constructor(){t(this,"component","GctFormMultipleChoice")}},io=Sa(ra.MULTIPLE_CHOICE,()=>new oo,so),no=/* @__PURE__ */qe({name:"GctFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=ze("form-table"),a=Va();return()=>Ve("div",{class:t.b()},[Ve(ut("gct-table"),Ze({data:a.value,model:e.model.tableModel,count:a.value.length.toString()},e.model.props||{}),null)])}}),ro=class{constructor(){t(this,"component","gct-form-table")}},co=Sa(ra.TABLE,()=>new ro,no),uo=/* @__PURE__ */qe({name:"GctSelectFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=ze("select-form-table"),a=nt(),l=nt(""),s=Va(),o=Ue(()=>({type:e.model.multiple?"checkbox":"radio",fixed:!0,selectedRowKeys:e.model.isKeys?s.value:s.value.map(t=>t[e.model.tableModel.key||"id"]),onChange:(t,a)=>{e.model.isKeys?s.value=t:s.value=a},getCheckboxProps:e=>({disabled:"Disabled User"===e.name,name:e.name})}));function i(){l.value?(l.value=l.value.trim(),l.value&&a.value&&a.value.reload({query:l.value})):a.value&&a.value.reload()}return()=>Ve("div",{class:t.b()},[Ve("div",{class:t.e("search")},[Ve(ut("a-input-search"),{placeholder:"搜索数据集名称",value:l.value,"onUpdate:value":e=>l.value=e,onSearch:i},null)]),Ve("div",{class:t.e("table")},[Ve(ut("gct-table"),Ze({ref:a,"row-selection":o.value,data:s.value,model:e.model.tableModel,count:s.value.length.toString()},e.model.props||{}),null)])])}}),po=class{constructor(){t(this,"component","gct-select-form-table")}},mo=Sa(ra.SELECT_TABLE,()=>new po,uo),ho={install(e){e.use(ql).use(Wl).use(Gl).use(Jl).use(ts).use(ss).use(us).use(rs).use(hs).use(gs).use(ws).use(Cs).use(Os).use(Ts).use(Ms).use(zs).use(Ps).use(Hs).use(Ys).use(Js).use(Jl).use(lo).use(io).use(co).use(mo).use(Al).use(Bs)}},vo=/* @__PURE__ */qe({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=ze("gct-edit-form");console.debug("GctEditForm props:",e);const s=e.controller||Ia(()=>new Ta(e.model)),o=nt(),i=async e=>{try{await o.value.formRef.validateFields([e])}catch(t){return console.error(t),!1}return!0};s.validate=async()=>{try{await o.value.formRef.validate()}catch(e){return console.error(e),!1}return!0},s.validateItem=i;const{context:n,params:r}=ht(e);return gt(n,()=>{Object.assign(s.context,e.context),s.state.isNew=!s.context.id},{immediate:!0,deep:!0}),gt(r,()=>{Object.assign(s.params,e.params)},{deep:!0}),gt(()=>e.count,()=>{s.state.count+=1}),gt(()=>e.data,()=>{Object.assign(s.state.data,e.data)},{deep:!0}),!1!==e.adaptModal&&Re(async()=>{try{await o.value.formRef.validate();const e=await s.save();if(e)return{ok:!0,data:[kt(e)]}}catch(e){console.error(e)}return{ok:!1}}),e.data?(Object.assign(s.state.data,e.data),s.loaded()):!0!==s.state.isNew?s.load().then(()=>{s.loaded()}):s.loaded(),e.embed&&s.evt.on("change",()=>{const e=s.getData();t("update:data",e),t("change",e)}),s.evt.on("blur",e=>{i(e)}),a({c:s}),()=>{let t=null;return(s.state.isNew||0==s.state.isNew&&s.state.loaded)&&(t=Ve(ut("gct-form"),{class:"h-full",ref:o,c:s,model:e.model,context:e.context},null)),Ve("div",{class:l.b()},[t])}}}),fo={install(e){e.use(ho),e.component(Rl.name,Rl),e.component(Ll.name,Ll),e.component(Fl.name,Fl),e.component(vo.name,vo),e.use(Ml)}},go=class{constructor(){t(this,"formData",{}),t(this,"items",[]),t(this,"page",1),t(this,"total",0),t(this,"size",20)}},yo=class{constructor(){t(this,"keepalive",!0),t(this,"visible",!0)}},bo=class extends yo{constructor(...e){super(...e),t(this,"error",!1),t(this,"errMessage",""),t(this,"readonly",!1),t(this,"disabled",!1)}},wo=class{constructor(){t(this,"hover",!1),t(this,"active",!1),t(this,"deleted",!1)}},_o=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,"state",this.createState()),this.row=e,this.model=a}createState(){return new yo}async init(){}async destroy(){}},xo=class extends _o{},Co=class extends _o{createState(){return new bo}active(){return this.row.active()}unActive(){return this.row.unActive()}},ko=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 So(e,t,a){return{install(l){e&&t&&_gct.register.tableEditor.register(fe.PREFIX+e,t),a&&l.component(a.name||a.__name,a)}}}var Oo=class{get key(){return this.data[this.model.key]}constructor(e,a,l){t(this,"item",{}),t(this,"fields",[]),t(this,"state",this.createState()),t(this,"activeCount",new ko),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 Co(this,e);break;case"actions":t=new xo(this,e);break;default:t=new _o(this,e)}return this.fields.push(e.name),t.state=it(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 wo}},Do=class{constructor(e){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(fe.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 go}async initControllers(e){const t=e.map(e=>{const t=e[this.model.key];if(this.row[t])return;const a=new Oo(this,this.model,e);return a.state=it(a.state),a.data=it(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(St(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 s=this.state.items.find(t=>t[this.model.key]===e.key);s&&(Object.assign(s,e.data),this.state.formData[`${t}___${s[this.model.key]}`]=a,this.evt.emit("change",s,t,a,l))}updatePagination(e){Tt(e.total)||(this.state.total=e.total),Tt(e.size)||(this.state.size=e.size),Tt(e.page)||(this.state.page=e.page)}};function Eo(e){const t=e();return t.state=it(t.state),lt(()=>t.destroy()),t}function To(e,{pagination:t=!0,triggerByWindowSize:a=!0}={}){const l=nt(0);let s=[],o=null,i=null;const n=()=>{var a,i;if(!e)return;o&&(clearTimeout(o),o=null);const r=vt(e).$el??vt(e),c=r.getBoundingClientRect().height??0,d=Math.max((null===(a=r.querySelector(".ant-table-thead"))||void 0===a?void 0:a.getBoundingClientRect().height)??0,48),u=t?Math.max((null===(i=r.querySelector(".ant-table-pagination"))||void 0===i?void 0:i.getBoundingClientRect().height)??0,24)+16:0;l.value=c-d-u,s.push(l.value),s.length>=3&&s[s.length-3]===s[s.length-1]&&s[s.length-2]===s[s.length-1]?s=[]:o=setTimeout(()=>{n()},100)};return a&&window.addEventListener("resize",n),gt(e,async t=>{await Je(),t&&(n(),(()=>{i&&(i.disconnect(),i=null);const t=vt(e).$el??vt(e);t&&"undefined"!=typeof ResizeObserver&&(i=new ResizeObserver(()=>{o&&clearTimeout(o),o=setTimeout(()=>{n()},100)}),i.observe(t))})())},{immediate:!0}),lt(()=>{window.removeEventListener("resize",n),i&&(i.disconnect(),i=null),o&&(clearTimeout(o),o=null)}),{scrollHeight:l,calcScrollHeight:n}}var Io=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}},jo=class{constructor(){t(this,"component","gct-table-span")}},Mo=/* @__PURE__ */qe({name:"GctTableSpan",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup:()=>({ns:ze("table-span")}),render(){return Ve("div",{class:this.ns.b()},[this.model.icon?Ve("span",{class:this.ns.e("icon")},[Ve("i",{class:`iconfont ${"string"==typeof this.model.icon?this.model.icon:this.model.icon(this.c.row.data)}`},null)]):null,Ve("span",{class:this.ns.e("text")},[this.value])])}}),Lo=So(ra.SPAN,()=>new jo,Mo),Ro=class{constructor(){t(this,"component","gct-table-text")}},zo=/* @__PURE__ */qe({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=ze("table-text"),a=Ha(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?Ve("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):Ve(ut("a-input"),Ze({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)}}),Fo=So(ra.TEXT,()=>new Ro,zo),Uo=class{constructor(){t(this,"component","gct-table-date")}},Bo=/* @__PURE__ */qe({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:ze("table-date"),val:Va()}),render(){return!1===this.isEdit?Ve("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):Ve(ut("a-date-picker"),Ze({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)}}),Ao=So(ra.DATE,()=>new Uo,Bo),$o={install(e){e.use(Lo).use(Fo).use(Ao)}};function Po(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!Xe(e)}var No=/* @__PURE__ */qe({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=ze("gct-table"),l=nt({}),s=nt(),o=nt(),i=nt();let n=null,r=null;const c=Eo(()=>new Do(e.model));c.evt.on("change",async(e,a,l,s)=>{t("rowChange",kt(e),a,l,s)}),!0===c.model.local&>(()=>e.count,()=>{c.setData(kt(e.data))}),!0!==c.model.local&&!1!==c.model.autoLoad&&c.load();const d=e=>{if(!e||e===s.value)return null;return e.getAttribute("data-row-key")||d(e.parentElement)},u=e=>{const t=d(e.target);if(t){const e=c.row[t];n&&(n.state.hover=!1),e.state.hover=!0,n=e}},p=e=>{!d(e.target)&&n&&(n.state.hover=!1,n=null)},m=e=>{const t=d(e.target);if(t){const e=c.row[t];r&&r.unActive(),e.active(),r=e}else r&&(r.unActive(),r=null)},h=()=>{r&&(r.unActive(),r=null)};at(()=>{s.value&&(s.value.addEventListener("mouseover",u,{capture:!0}),s.value.addEventListener("mouseout",u,{capture:!0}),s.value.addEventListener("mouseleave",p,{capture:!0}),s.value.addEventListener("click",m,{capture:!0})),window.addEventListener("click",h,{capture:!0})}),lt(()=>{s.value&&(s.value.removeEventListener("mouseover",u,{capture:!0}),s.value.removeEventListener("mouseout",u,{capture:!0}),s.value.removeEventListener("mouseleave",p,{capture:!0}),s.value.removeEventListener("click",m,{capture:!0})),window.removeEventListener("click",h,{capture:!0})});const v=Ue(()=>{var t;if(Tt(e.model.pagination))return!1;const a=Ct(e.model.pagination);St(a,{pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showTotal:!0});const l=!0===a.showTotal?e=>je("sys.component.table.total",{total:e}):a.showTotal||void 0,s=null===(t=a.pageSizeOptions)||void 0===t?void 0:t.map(e=>`${e}`);return{class:"pagination-total-left",total:c.state.total,current:c.state.page,pageSize:c.state.size,pageSizeOptions:s,showSizeChanger:a.showSizeChanger,showTotal:l}}),{scrollHeight:f}=To(s,{pagination:!!v.value});return{ns:a,c:c,loadingState:l,elRef:s,formRef:o,tableRef:i,scrollHeight:f,pagination:v,isEdit:Ue(()=>c.model.columns.some(e=>"edit"===e.type)),handleTableChange:(e,t,a)=>{c.updatePagination({page:e.current,size:e.pageSize}),c.reload()},mouseOver:u,mouseOut:e=>{!d(e.target)&&n&&(n.state.hover=!1,n=null)},onValidate:(e,t,a)=>{const l=e.split("___");if(2===l.length){const[e,s]=l,o=c.row[s];if(o){const l=o.item[e];l&&(l.state.error=!t,a&&a.length>0?l.state.errMessage=a[0]:l.state.errMessage="")}}},validate:()=>o.value.validate(),reload:e=>c.load(e)}},render(){return Ve("div",{ref:"elRef",class:this.ns.b(),onMouseover:this.mouseOver,onMouseout:this.mouseOut},[Ve(ut("a-form"),{ref:"formRef",model:this.c.state.formData,onValidate:this.onValidate},{default:()=>[Ve(ut("a-table"),Ze({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 Ve("span",{title:e,class:[this.ns.e("table-header"),this.ns.is("required",t)]},[Ve("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:Dt(t)?t.toString():t;const l=e;if(l.customRender)return l.customRender({record:a});if("edit"===e.type){const t=a[this.c.model.key],l=this.c.row[t];if(l){let a;const s=this.c.editorProviders[e.name],o=ut(s.component),i=l.item[e.name],n=!0===l.state.hover||!0===i.state.error||!0===l.state.active||"all"===this.c.model.rowEditMode;return Ve(ut("a-form-item"),{name:`${e.name}___${t}`,class:[this.ns.b("table-item"),this.ns.bm("table-item","edit")],rules:i.model.rules||[]},Po(a=Ye(o,{key:i.model.name,c:i,model:i.model.editor,readonly:i.state.readonly,disabled:i.state.disabled,value:i.value,itemModel:i.model,data:l.data,keepalive:i.state.keepalive,visible:i.state.visible,isEdit:n,"onUpdate:value":e=>{i.value=e}}))?a:{default:()=>[a]})}}if("actions"===e.type){const t=e;return Ve("div",{class:this.ns.b("table-actions")},[t.actions.filter(e=>!e.hidden||!e.hidden(a)).map(e=>{if("divider"===e.mode)return Ve(ut("a-divider"),{type:"vertical"},null);const l=`${e.type}___${e.tag}___${a[this.c.model.key]}`,s=Ve(ut("a-button"),Ze({class:this.ns.b("table-action-item"),type:e.type,size:"small",loading:!0===this.loadingState[l],onClick:async s=>{if(!e.confirm)if(s.stopPropagation(),e.action)if(ka(e.action)||Ca(e.action)){this.loadingState[l]=!0;try{await e.action(a)}catch(o){console.log(o)}finally{this.loadingState[l]=!1}}else e.action(a);else t.action(e.tag,a)}},e.props),{default:()=>[e.text]});return e.confirm?Ve(ut("a-popconfirm"),Ze({onConfirm:async()=>{if(e.action)if(ka(e.action)||Ca(e.action)){this.loadingState[l]=!0;try{await e.action(a)}catch(s){console.log(s)}finally{this.loadingState[l]=!1}}else e.action(a);else t.action(e.tag,a)}},e.confirm),Po(s)?s:{default:()=>[s]}):s})])}return"link"===e.type?Ve("a",{class:this.ns.e("table-link"),onClick:e=>{e.stopPropagation(),l.click&&l.click(a)}},[t]):t}})]})])}}),Go={install(e){e.component(No.name,No)}},Vo={install(e){e.use(Go)}},Ho={install(e){e.use($o),e.use(Vo)}},qo=He(()=>import("./monaco-editor-CgESUPw_.js")),Ko=/* @__PURE__ */ie(/* @__PURE__ */qe({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 s=ut("color-picker");return st(),Be(s,{preset:vt(Ie),color:e.value,"onUpdate:color":l},{icon:bt(()=>[Pe("div",{class:"color-picker-icon",style:et({backgroundColor:e.value})},null,4)]),_:1},8,["preset","color"])}}}),[["__scopeId","data-v-7b102f87"]]),Yo={FIRST:"first",BEFORE:"before",AFTER:"after",LAST:"last"},Wo=/* @__PURE__ */qe({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=ze("dnd-item"),s=nt(null),o=nt(!1),i=We("vue3-dnd-drop-line-state"),n=nt(-1),[r,c,d]=le({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]=X({accept:a.group,canDrop:()=>!1});t(s)}else{const[t,l]=X({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=s.value.getBoundingClientRect(),n=l.getClientOffset(),r=a.offset??0;let c=0;if("vertical"===a.direction){const{top:e,height:a}=t,{y:l}=n;if(c=l-e-a/2,Math.abs(c)<r)return;o.value=c<0}else if("horizontal"===a.direction){const{left:e,width:a}=t,{x:l}=n;if(c=l-e-a/2,Math.abs(c)<r)return;o.value=c<0}i.activeKey=e.data.id,i.isBeforeHover=o.value}else i.activeKey=""},drop:(l,s)=>{if(i.activeKey="",!0===t.value.isShallowOver&&!1!==s.canDrop())return{asyncDrop:async()=>{let t=l.data;return a.drop&&(t=await a.drop(l),!t)?{group:a.group,cfg:kt(e.config),success:!1}:(u(o.value?Yo.BEFORE:Yo.AFTER,t),{group:a.group,success:!0,cfg:kt(e.config),data:t})}}}});l(s)}function u(e,a){t("drop",e,a)}return a.handle||!1===a.isDrag||c(s),d(s),{ns:l,rootRef:s,posState:n,collect:r,onDrop:u,drag:c}},render(){var e,t;const a={index:this.index,data:this.data,drag:this.drag};return Ve("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)])}}),Xo=/* @__PURE__ */qe({name:"GctDndDropLine",props:{config:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=ze("dnd-drop-line"),s=nt(null),[o,i]=X({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,s)=>{if(!0===o.value.isShallowOver&&!1!==s.canDrop())return{asyncDrop:async()=>{let s=l.data;return a.drop&&(s=await a.drop(l),!s)?{group:a.group,cfg:kt(e.config),success:!1}:(t("drop",s),{group:a.group,success:!0,cfg:kt(e.config),data:s})}}}});return!1!==a.isDrop&&i(s),{ns:l,rootRef:s,collect:o}},render(){return Ve("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)]},[Ve("div",{class:this.ns.e("line")},null)])}}),Zo=/* @__PURE__ */qe({name:"GctDndContainer",props:{config:{type:Object,default:()=>({group:"GctDnd",insertPos:Yo.LAST})},items:{type:Array,default:()=>[]}},emits:["update:items"],setup(e,{emit:t}){const{config:a}=e,l=ze("dnd-container"),s=nt(null),o=it({activeKey:"",isBeforeHover:!1});ot("vue3-dnd-drop-line-state",o);const i=mt(e.items),[n,r]=X({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,s)=>{if(!0===n.value.isShallowOver&&!1!==s.canDrop())return{asyncDrop:async()=>{let s=l.data;return a.drop&&(s=await a.drop(l),!s)?{group:a.group,success:!1,cfg:kt(e.config)}:(-1===i.value.findIndex(e=>e.id===l.data.id)&&c(e.config.insertPos,s),t("update:items",i.value),{group:a.group,success:!0,cfg:kt(e.config),data:s})}}}});function c(e,a,l=-1){if(a){if(e===Yo.FIRST)i.value.unshift(a);else if(e===Yo.LAST)i.value.push(a);else{if(-1===l)return void console.error("insertIndex is required");const t=i.value.findIndex(e=>e.id===a.id);if(t===l)return;-1!==t&&l<t&&i.value.splice(t,1),e===Yo.AFTER?i.value.splice(l+1,0,a):i.value.splice(l,0,a),-1!==t&&l>t&&i.value.splice(t,1)}t("update:items",i.value)}else console.error("data is required")}return!1!==a.isDrop&&r(s),gt(n,()=>{!0!==n.value.isOver&&(o.activeKey="")}),{ns:l,rootRef:s,dropLineState:o,collect:n,onDrop:c}},render(){var e,t,a,l;const s=this.items[this.items.length-1];return Ve("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(Ve(Xo,{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(Yo.BEFORE,e,t)},null)),l.push(Ve(Wo,{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}),s?Ve(Xo,{key:s.id+"___last-line",config:this.config,active:this.dropLineState.activeKey===s.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(Yo.AFTER,e,this.items.length-1)},null):null,null===(a=(l=this.$slots).after)||void 0===a?void 0:a.call(l)])}}),Jo={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},Qo={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:()=>({})}},ei=qe({name:"CropperImage",props:Qo,emits:["cropend","ready","cropendError"],setup(t,{attrs:a,emit:l}){const s=nt(),o=nt(),i=nt(!1),n=ze("cropper-image"),r=V(p,80),c=Ue(()=>({height:t.height,width:t.width,maxWidth:"100%",...t.imageStyle})),d=Ue(()=>[n.b(),a.class,{[n.m("circled")]:t.circled}]),u=Ue(()=>({height:`${t.height}`.replace(/px/,"")+"px",width:`${t.width}`.replace(/px/,"")+"px"}));function p(){t.realTimePreview&&m()}function m(){if(!o.value)return;let e=o.value.getData();(t.circled?function(){const e=o.value.getCroppedCanvas(),t=document.createElement("canvas"),a=t.getContext("2d"),l=e.width,s=e.height;return t.width=l,t.height=s,a.imageSmoothingEnabled=!0,a.drawImage(e,0,0,l,s),a.globalCompositeOperation="destination-in",a.beginPath(),a.arc(l/2,s/2,Math.min(l,s)/2,0,2*Math.PI,!0),a.fill(),t}():o.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 at(async function(){const a=vt(s);if(!a)return;const[{default:n}]=await Promise.all([import("./cropper-tw7tUDDe.js").then(t=>/* @__PURE__ */e(t.default,1)),Promise.resolve({ })]);o.value=new n(a,{...Jo,ready:()=>{i.value=!0,p(),l("ready",o.value)},crop(){r()},zoom(){r()},cropmove(){r()},...t.options})}),lt(()=>{var e;null===(e=o.value)||void 0===e||e.destroy()}),{getClass:d,imgElRef:s,getWrapperStyle:u,getImageStyle:c,isReady:i,croppered:m}}}),ti=["src","alt","crossorigin"],ai=/* @__PURE__ */ie(ei,[["render",function(e,t,a,l,s,o){return st(),$e("div",{class:Qe(e.getClass),style:et(e.getWrapperStyle)},[wt(Pe("img",{ref:"imgElRef",src:e.src,alt:e.alt,crossorigin:e.crossorigin,style:et(e.getImageStyle)},null,12,ti),[[ft,e.isReady]])],6)}]]),li={key:1,class:"empty"},si={class:"flex flex-col justify-center items-center"},oi=["title"],ii=/* @__PURE__ */qe({__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,s=nt(a.src||""),o=nt(a.src||""),i=nt(""),n=nt();let r=1,c=1,d="";const u=Ue(()=>a.accept.map(e=>`image/${e}`).join(",")),p=ze("cropper-free"),[m,{closeModal:h,setModalProps:v}]=I(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 qt.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!u.value.includes(e.type))return qt.warning(`【${e.name}】${je("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),s.value="",i.value="",t.onload=function(t){var a;s.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",d=e.name},!1}function g({imgBase64:e}){i.value=e}function y(e){n.value=e}function b(e,t){var a,l;"scaleX"===e&&(r=t=-1===r?1:-1),"scaleY"===e&&(c=t=-1===c?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&&Et(e)){const t=Oe(i.value);try{v({confirmLoading:!0});const a=await e({name:"file",file:t,filename:d});l("uploadSuccess",{source:i.value,data:a.data}),h()}finally{v({confirmLoading:!1})}}}function x(){s.value="",setTimeout(()=>{s.value=o.value||""})}return gt(()=>a.src,e=>{s.value=e||"",o.value=e||""}),(t,a)=>{const l=ut("PlusOutlined"),o=ut("a-button");return st(),Be(vt(w),Ze(t.$attrs,{title:e.title,width:"640px","min-height":"510","can-fullscreen":!1,"ok-text":vt(je)("sys.okText"),onRegister:vt(m),onOk:_,onCancel:x}),{default:bt(()=>[Pe("div",{class:Qe(vt(p).b())},[Pe("div",{class:Qe(vt(p).b("left"))},[Pe("div",{class:Qe(vt(p).b("cropper"))},[s.value?(st(),Be(ai,{key:0,src:s.value,height:"304px",width:"538px",options:{aspectRatio:e.aspectRatio??200/120},onCropend:g,onReady:y},null,8,["src","options"])):(st(),$e("div",li,[Ve(vt(Ht),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":f},{default:bt(()=>[Pe("div",si,[Ve(l),a[14]||(a[14]=Pe("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Pe("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),s.value?(st(),$e("div",{key:0,class:Qe(vt(p).b("toolbar"))},[Ve(vt(Ht),{"file-list":[],accept:u.value,"before-upload":f},{default:bt(()=>[e.uploadText?(st(),Be(o,{key:0,type:"link",size:"small",style:{padding:"0"}},{default:bt(()=>[Ge(pt(e.uploadText),1)]),_:1})):(st(),$e("a",{key:1,title:vt(je)("sys.reUpload"),placement:"bottom"},pt(vt(je)("sys.reUpload")),9,oi))]),_:1},8,["accept"]),Ve(vt(Nt),null,{default:bt(()=>[Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[0]||(a[0]=xt(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>b("zoom",.1))},{icon:bt(()=>[...a[16]||(a[16]=[Pe("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[2]||(a[2]=xt(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>b("zoom",-.1))},{icon:bt(()=>[...a[17]||(a[17]=[Pe("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[4]||(a[4]=xt(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>b("rotate",-45))},{icon:bt(()=>[...a[18]||(a[18]=[Pe("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[6]||(a[6]=xt(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>b("rotate",45))},{icon:bt(()=>[...a[19]||(a[19]=[Pe("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[8]||(a[8]=xt(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>b("scaleX"))},{icon:bt(()=>[...a[20]||(a[20]=[Pe("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[10]||(a[10]=xt(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>b("scaleY"))},{icon:bt(()=>[...a[21]||(a[21]=[Pe("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:bt(()=>[Ve(o,{size:"small",disabled:!s.value,onMousedown:a[12]||(a[12]=xt(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>b("reset"))},{icon:bt(()=>[Ve(vt(la))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Ae("",!0)],2)],2)]),_:1},16,["title","ok-text","onRegister"])}}}),ni=/* @__PURE__ */ie(ii,[["__scopeId","data-v-da6428d3"]]),ri={key:1,class:"empty"},ci={class:"flex flex-col justify-center items-center"},di=["title"],ui={class:"flex-col"},pi={class:"flex-col"},mi={class:"flex-col text-center"},hi=/* @__PURE__ */qe({__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,s=nt(a.src||""),o=nt(""),i=nt();let n=1,r=1,c="";const d=ze("cropper-am"),[u,{closeModal:p,setModalProps:m}]=I();function h(e){if(e.size/1024/1024>4)return qt.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!["image/jpg","image/jpeg","image/png","image/bmp"].includes(e.type))return qt.warning(`【${e.name}】${je("sys.component.cropper.acceptAvatarTypeTip")}`),!1;const t=new FileReader;return t.readAsDataURL(e),s.value="",o.value="",t.onload=function(t){var a;s.value=(null===(a=t.target)||void 0===a?void 0:a.result)??"",c=e.name},!1}function v({imgBase64:e}){o.value=e}function f(e){i.value=e}function g(e,t){var a,l;"scaleX"===e&&(n=t=-1===n?1:-1),"scaleY"===e&&(r=t=-1===r?1:-1),null===(a=i.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function y(){const e=a.uploadApi;if(e&&Et(e)){const t=Oe(o.value);try{m({confirmLoading:!0});const a=await e({name:"file",file:t,filename:c});l("uploadSuccess",{source:o.value,data:a.data.data}),p()}finally{m({confirmLoading:!1})}}}return(t,a)=>{const l=ut("PlusOutlined"),i=ut("a-button"),n=ut("Avatar");return st(),Be(vt(w),Ze(t.$attrs,{title:vt(je)("sys.component.cropper.modalTitle"),width:"600px","min-height":"570","can-fullscreen":!1,"ok-text":vt(je)("sys.okText"),onRegister:vt(u),onOk:y}),{default:bt(()=>[Pe("div",{class:Qe(vt(d).b())},[Pe("div",{class:Qe(vt(d).b("left"))},[Pe("div",{class:Qe(vt(d).b("cropper"))},[s.value?(st(),Be(ai,{key:0,src:s.value,height:"360px",width:"360px",circled:e.circled,onCropend:v,onReady:f},null,8,["src","circled"])):Ae("",!0),e.sourceUrlValue||"/404.png"!==s.value?Ae("",!0):(st(),$e("div",ri,[Ve(vt(Ht),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":h},{default:bt(()=>[Pe("div",ci,[Ve(l),a[14]||(a[14]=Pe("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Pe("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),e.sourceUrlValue||"/404.png"!==s.value?(st(),$e("div",{key:0,class:Qe(vt(d).b("toolbar"))},[Ve(vt(Ht),{"file-list":[],accept:"image/*","before-upload":h},{default:bt(()=>[Pe("a",{title:vt(je)("sys.reUpload"),placement:"bottom"},pt(vt(je)("sys.reUpload")),9,di)]),_:1}),Ve(vt(Nt),null,{default:bt(()=>[Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[0]||(a[0]=xt(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>g("zoom",.1))},{icon:bt(()=>[...a[16]||(a[16]=[Pe("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[2]||(a[2]=xt(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>g("zoom",-.1))},{icon:bt(()=>[...a[17]||(a[17]=[Pe("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[4]||(a[4]=xt(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>g("rotate",-45))},{icon:bt(()=>[...a[18]||(a[18]=[Pe("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[6]||(a[6]=xt(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>g("rotate",45))},{icon:bt(()=>[...a[19]||(a[19]=[Pe("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[8]||(a[8]=xt(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>g("scaleX"))},{icon:bt(()=>[...a[20]||(a[20]=[Pe("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[10]||(a[10]=xt(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>g("scaleY"))},{icon:bt(()=>[...a[21]||(a[21]=[Pe("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),Ve(vt(Vt),{title:vt(je)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:bt(()=>[Ve(i,{size:"small",disabled:!s.value,onMousedown:a[12]||(a[12]=xt(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>g("reset"))},{icon:bt(()=>[Ve(vt(la))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Ae("",!0)],2),Pe("div",{class:Qe([vt(d).b("right"),"text-center"])},[a[22]||(a[22]=Ge(" 预览 ",-1)),Pe("div",{class:Qe(vt(d).b("group"))},[Pe("div",ui,[Ve(n,{src:o.value,size:102},null,8,["src"])]),Pe("div",pi,[Ve(n,{src:o.value,size:78},null,8,["src"])]),Pe("div",mi,[Ve(n,{src:o.value,size:28},null,8,["src"])])],2)],2)],2),a[23]||(a[23]=Pe("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"])}}}),vi=/* @__PURE__ */ie(hi,[["__scopeId","data-v-f1134678"]]),fi=["src"],gi=/* @__PURE__ */qe({__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,s=a,o=nt("/extras-assets/images/default_avatar.png"),i=nt(Me(l.value)||""),n=nt(l.value||""),r=ze("cropper-avatar"),[c,{openModal:d,closeModal:u}]=$(),p=Ue(()=>[r.b()]),m=Ue(()=>`${l.width}`.replace(/px/,"")+"px"),h=Ue(()=>parseInt(`${l.width}`.replace(/px/,""))/2+"px"),v=Ue(()=>({width:vt(m)})),f=Ue(()=>({width:vt(m),height:vt(m)}));function g({source:e,data:t}){i.value=Me(t),n.value=t,s("change",{source:e,data:t})}yt(()=>{i.value=Me(l.value)||"",n.value=l.value||""}),gt(()=>n.value,e=>{s("update:value",e)});const y=()=>{d()};return t({openModal:d.bind(null,!0),closeModal:u}),(t,a)=>{const l=ut("a-button");return st(),$e("div",{class:Qe(p.value),style:et(v.value)},[Pe("div",{class:Qe(vt(r).b("image-wrapper")),style:et(f.value),onClick:y},[Pe("div",{class:Qe(vt(r).b("image-mask")),style:et(f.value)},[Ve(vt(Qt),{style:et({width:h.value,height:h.value}),"two-tone-color":"#d6d6d6"},null,8,["style"])],6),Pe("img",{src:e.value?i.value:o.value,alt:"avatar"},null,8,fi)],6),e.showBtn?(st(),Be(l,Ze({key:0,class:vt(r).b("upload-btn")},e.btnProps,{onClick:vt(d)}),{default:bt(()=>[Ge(pt(e.btnText?e.btnText:vt(je)("sys.component.cropper.selectImage")),1)]),_:1},16,["class","onClick"])):Ae("",!0),Ve(vi,{"upload-api":e.uploadApi,src:i.value,"source-url-value":n.value,onRegister:vt(c),onUploadSuccess:g},null,8,["upload-api","src","source-url-value","onRegister"])],6)}}}),yi=/* @__PURE__ */ie(gi,[["__scopeId","data-v-ef939ff0"]]),bi=/* @__PURE__ */qe({__name:"picture-preview",props:{functional:{type:Boolean},imageList:{type:Array,default:()=>[]}},setup(e){const t=e,a=ze("image-preview"),l=Ue(()=>t.imageList.map(e=>It(e)?{src:e,placeholder:!1}:e));return(t,s)=>{const o=ut("PreviewGroup");return st(),$e("div",{class:Qe(vt(a).b())},[Ve(o,null,{default:bt(()=>[!e.imageList||t.$slots.default?dt(t.$slots,"default",{key:0}):(st(!0),$e(Fe,{key:1},ct(l.value,e=>(st(),Be(vt(Ut),Ze({key:e.src,ref_for:!0},e),Ne({_:2},[e.placeholder?{name:"placeholder",fn:bt(()=>[Ve(vt(Ut),Ze({ref_for:!0},e,{src:e.placeholder,preview:!1}),null,16,["src"])]),key:"0"}:void 0]),1040))),128))]),_:3})],2)}}}),wi=bi,_i=/* @__PURE__ */function(e){return e[e.LOADING=0]="LOADING",e[e.DONE=1]="DONE",e[e.FAIL=2]="FAIL",e}(_i||{}),xi={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}},Ci="img-preview",ki=/* @__PURE__ */qe({name:"ImagePreview",props:xi,emits:["img-load","img-error"],setup(e,{expose:t,emit:a}){const l=/* @__PURE__ */new Map,s=it({currentUrl:"",imgScale:1,imgRotate:0,imgTop:0,imgLeft:0,status:_i.LOADING,currentIndex:0,moveX:0,moveY:0,show:e.show}),o=nt(null),i=nt(null);function n(){s.imgScale=1,s.imgRotate=0,s.imgTop=0,s.imgLeft=0}const r=Ue(()=>{const t=(null==e?void 0:e.scaleStep)??0;return t>0&&t<100?t/100:s.imgScale/10});function c(e){(e=e||window.event).delta=e.wheelDelta||-e.detail,e.preventDefault(),e.delta>0&&d(r.value),e.delta<0&&d(-r.value)}function d(e){s.imgScale<=.2&&e<0||(s.imgScale+=.1*e,s.imgScale<0&&(s.imgScale=.02))}function u(e){s.imgRotate+=e}function p(){const e=vt(i);e&&(e.onmousemove=null)}function m(t){s.status=_i.LOADING;const o=new Image;o.src=t,o.onload=o=>{if(s.currentUrl!==t){const i=o.composedPath();if(e.rememberState){l.set(s.currentUrl,{scale:s.imgScale,top:s.imgTop,left:s.imgLeft,rotate:s.imgRotate});const a=l.get(t);a?(s.imgScale=a.scale,s.imgTop=a.top,s.imgRotate=a.rotate,s.imgLeft=a.left):(n(),e.defaultWidth&&(s.imgScale=e.defaultWidth/i[0].naturalWidth))}else e.defaultWidth&&(s.imgScale=e.defaultWidth/i[0].naturalWidth);i&&a("img-load",{index:s.currentIndex,dom:i[0],url:t})}s.currentUrl=t,s.status=_i.DONE},o.onerror=e=>{const l=e.composedPath();l&&a("img-error",{index:s.currentIndex,dom:l[0],url:t}),s.status=_i.FAIL}}function h(e){e&&e.stopPropagation(),v()}function v(){s.show=!1,document.body.removeEventListener("DOMMouseScroll",c),document.ondragstart=null}function f(){n()}function g(t){const{currentIndex:a}=s,{imageList:l}=e;"left"===t&&(s.currentIndex-=1,a<=0&&(s.currentIndex=l.length-1)),"right"===t&&(s.currentIndex+=1,a>=l.length-1&&(s.currentIndex=0)),m(l[s.currentIndex])}function y(e){e=e||window.event,s.moveX=e.clientX,s.moveY=e.clientY;const t=vt(i);t&&(t.onmousemove=b)}function b(e){(e=e||window.event).preventDefault();const t=e.clientX-s.moveX,a=e.clientY-s.moveY;s.imgLeft+=t,s.imgTop+=a,s.moveX=e.clientX,s.moveY=e.clientY}t({resume:f,close:v,prev:g.bind(null,"left"),next:g.bind(null,"right"),setScale:e=>{e>0&&e<=10&&(s.imgScale=e)},setRotate:e=>{s.imgRotate=e}});const w=Ue(()=>{const{imgScale:t,imgRotate:a,imgTop:l,imgLeft:o}=s;return{transform:`scale(${t}) rotate(${a}deg)`,marginTop:`${l}px`,marginLeft:`${o}px`,maxWidth:e.defaultWidth?"unset":"100%"}}),_=Ue(()=>{const{imageList:t}=e;return t.length>1});yt(()=>{e.show&&function(){!function(){const e=vt(o);e&&(e.onmousewheel=c,document.body.addEventListener("DOMMouseScroll",c),document.ondragstart=function(){return!1})}();const{index:t,imageList:a}=e;if(!a||!a.length)throw new Error("imageList is undefined");s.currentIndex=t,m(a[t])}(),e.imageList&&n()});const x=t=>{e.maskClosable&&t.target&&t.target.classList.contains(`${Ci}-content`)&&h(t)},C=()=>{if(!vt(_))return null;const{currentIndex:t}=s,{imageList:a}=e;return Ve("div",{class:`${Ci}__index`},[t+1,Ge(" / "),a.length])},k=e=>vt(_)?Ve("div",{class:[`${Ci}__arrow`,e],onClick:()=>g(e)},[Ve("left"===e?aa:sa,null,null)]):null;return()=>s.show&&Ve("div",{class:Ci,ref:o,onMouseup:p,onClick:x},[Ve("div",{class:`${Ci}-content`},[Ve("img",{style:vt(w),class:[`${Ci}-image`,s.status===_i.DONE?"":"hidden"],ref:i,src:s.currentUrl,onMousedown:y},null),Ve("div",{class:`${Ci}__close`,onClick:h},[Ve(Zt,{class:`${Ci}__close-icon`},null)]),C(),Ve("div",{class:`${Ci}__controller`},[Ve("div",{class:`${Ci}__controller-item`,onClick:()=>d(-r.value)},[Ve("img",{src:"/extras-assets/svg/preview/unscale.svg"},null)]),Ve("div",{class:`${Ci}__controller-item`,onClick:()=>d(r.value)},[Ve("img",{src:"/extras-assets/svg/preview/scale.svg"},null)]),Ve("div",{class:`${Ci}__controller-item`,onClick:f},[Ve("img",{src:"/extras-assets/svg/preview/resume.svg"},null)]),Ve("div",{class:`${Ci}__controller-item`,onClick:()=>u(-90)},[Ve("img",{src:"/extras-assets/svg/preview/unrotate.svg"},null)]),Ve("div",{class:`${Ci}__controller-item`,onClick:()=>u(90)},[Ve("img",{src:"/extras-assets/svg/preview/p-rotate.svg"},null)])]),k("left"),k("right")])])}}),Si=ki,Oi=null;function Di(e){var t;const a={},l=document.createElement("div");return Object.assign(a,{show:!0,index:0,scaleStep:100},e),Oi=Ve(Si,a),rt(Oi,l),document.body.appendChild(l),null===(t=Oi.component)||void 0===t?void 0:t.exposed}var Ei=["src"],Ti={key:0,class:"iconfont icon-tupian-shili"},Ii={class:"prompt"},ji={key:0,class:"auxiliary"},Mi="cropper-photo",Li=/* @__PURE__ */qe({__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,s=a,o=nt(l.value||""),i=Ue(()=>o.value?De(o.value):"");let n={};const[r,{openModal:c,closeModal:d}]=$(),u=Ue(()=>l.disabled),p=Ue(()=>{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}){o.value=t,s("change",{source:e,data:t})}function h(){n=Di({imageList:[i.value]})}function v(){o.value=""}yt(()=>{o.value=l.value||""}),gt(()=>o.value,e=>{s("update:value",e)}),tt(()=>{n&&n.close&&n.close()}),at(()=>{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 qt.warning(je("sys.component.cropper.acceptTip"));c(!0,{file:a})}})});const f=()=>{c()};return t({openModal:c.bind(null,!0),closeModal:d}),(t,a)=>{var l;const s=ut("Icon");return st(),$e("div",{id:"dropzone",class:Qe([Mi,u.value&&"not-allow"])},[i.value?(st(),$e(Fe,{key:0},[Pe("div",{class:Qe(`${Mi}__wrapper`)},[Pe("img",{src:i.value},null,8,Ei)],2),Pe("div",{class:Qe(`${Mi}__mask`)},[Ve(vt(ta),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:h}),Ve(vt(Qt),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:a[0]||(a[0]=()=>vt(c)())}),Ve(vt(Jt),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:v})],2)],64)):(st(),$e("div",{key:1,class:Qe(`${Mi}__trigger`),onClick:f},[e.icon?(st(),$e("i",Ti)):(st(),Be(s,{key:1,icon:"ant-design:plus-outlined",size:36})),e.isDrag?(st(),$e(Fe,{key:2},[Pe("p",Ii,pt(t.$t("sys.pageDesigner.clickOrDragToUpload")),1),e.accept?(st(),$e("p",ji,pt(`支持${null===(l=e.accept)||void 0===l?void 0:l.join("、")}图片格式,大小100KB以内`),1)):Ae("",!0)],64)):Ae("",!0),e.auxiliary?Ae("",!0):(st(),$e(Fe,{key:3},[Ge(pt(vt(je)("sys.clickToDoSth",{sth:vt(je)("sys.add")})),1)],64))],2)),Ve(ni,{"upload-api":e.uploadApi,"aspect-ratio":e.aspectRatio,src:i.value,accept:e.accept,"before-upload":e.beforeUpload,title:e.modalTitle,"upload-text":e.uploadText,onRegister:vt(r),onUploadSuccess:m},null,8,["upload-api","aspect-ratio","src","accept","before-upload","title","upload-text","onRegister"])],2)}}}),Ri=/* @__PURE__ */ie(Li,[["__scopeId","data-v-c85d53db"]]),zi=/* @__PURE__ */ie(/* @__PURE__ */qe({__name:"category-modal",props:{data:{default:()=>({})},module:{}},setup(e){const t=ze("category-modal"),a=it({...e.data}),l=nt();return Re(async()=>(await l.value.validate(),{ok:!0,data:[jt(a,e=>void 0!==e)]})),(e,s)=>{const o=ut("a-input"),i=ut("a-form-item"),n=ut("a-form");return st(),$e("div",{class:Qe(vt(t).b())},[Ve(n,{ref_key:"formRef",ref:l,model:a,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off"},{default:bt(()=>[Ve(i,{label:`${vt(je)("sys.category")}${vt(je)("sys.name")}`,name:"name",rules:[{required:!0}]},{default:bt(()=>[Ve(o,{value:a.name,"onUpdate:value":s[0]||(s[0]=e=>a.name=e),"show-count":"",maxlength:100},null,8,["value"])]),_:1},8,["label"])]),_:1},8,["model"])],2)}}}),[["__scopeId","data-v-b560615c"]]),Fi=je,Ui=ke(function(e){const t=/* @__PURE__ */new Map,a=nt(),l=[we.EDHR,ve.INSPECTION,ve.RELEASE,we.ONLINE_FORM].includes(e.module);async function s(t){const a=!!t.data.id,l=await _gct.openUtil.modal(zi,{data:t.data,module:e.module},{title:a?`${Fi("sys.edit")}${Fi("sys.category")}`:Fi("sys.new")+Fi("sys.category"),width:640,height:360,okText:Fi("sys.okText"),showFooter:!0});if(null==l?void 0:l.ok)return null==l?void 0:l.data[0]}async function o(){const s=l?await Ee.getCategoryList({moduleType:e.module})||[]:await _api.apaas.category.getListComplete({})||[];a.value=s,t.clear(),J(s,({item:e})=>{t.set(e.id,e)},{childrenFields:["child"]})}return{categoryTreeData:a,createCategory:async function(t={}){const a=await s({data:t});return a&&(a.module=e.module,await _api.apaas.category.post(a),await o()),a?{parentId:null==a?void 0:a.parentId}:{}},load:o,editCategory:async function(t){const a={name:t.name||t.title,id:t.key||t.id},l=await s({data:a});l&&(await _api.apaas.category.putId({id:a.id??""},{...l,module:e.module}),await o())},deleteCategoryAPI:async function(e,t,a){return new Promise(l=>{Bt.confirm({title:Fi("sys.sureToDeleteCategoryWithName",{name:`${e.name||e.title}`}),icon:Ve(ea),content:a||"",okText:Fi("sys.okText"),cancelText:Fi("sys.cancel"),async onOk(){try{t?await t({id:e.key||e.id}):await _api.apaas.category.delete({ids:e.key||e.id}),qt.success(Fi("sys.delSuccess")),await o(),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 o()},isFormDesign:l}}),Bi=["title"],Ai=/* @__PURE__ */qe({__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:()=>[he.Insert,he.Update,he.Delete]}},emits:["update:value","changeCategory","changeValue"],setup(e,{expose:t,emit:a}){const l="edit",s="delete",o=je,i=ze("category-sider"),n=e,r=a,c=Ue({get:()=>n.value?[n.value]:void 0,set(e){r("update:value",null==e?void 0:e[0])}}),d=nt([]),u=nt(),p=nt(),{load:m,createCategory:h,editCategory:v,deleteCategoryAPI:f,dragCategory:g,categoryTreeData:y,isFormDesign:b}=Ui({module:n.module}),w=nt(""),_=(e,t)=>{w.value=e?t:""},x=(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&&!d.value.includes(t.categoryId)&&d.value.push(t.categoryId),r("changeValue",t.dataRef)))},C=Ue(()=>q(y.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}));at(async()=>{var e;await m(),n.value||(r("update:value",null===(e=C.value[0])||void 0===e?void 0:e.key),C.value[0]&&r("changeValue",C.value[0]))}),gt(p,()=>{var e;null===(e=p.value)||void 0===e||e.expandAll()},{immediate:!0});const k=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 g({id:e.key,targetParentId:null===(a=t.parent)||void 0===a?void 0:a.key,targetSortNum:l})},S=async()=>{const e=await h();_(!1,""),e.parentId&&d.value.push(e.parentId),c.value=C.value.length?[C.value[0].key]:[],r("changeValue",C.value[0])};return t({getCategoryData:()=>C.value}),(t,a)=>{const m=ut("a-button"),h=ut("a-input"),g=ut("ellipsis-outlined"),y=ut("a-menu-item"),b=ut("a-menu"),O=ut("a-dropdown");return st(),$e("div",{class:Qe([vt(i).b()])},[e.hasTitle||!e.readonly?(st(),$e("div",{key:0,class:Qe([vt(i).e("title-container")])},[Pe("span",{class:Qe([vt(i).e("title")])},pt(e.siderTitle),3),!e.readonly&&e.hasPerBtns.includes(vt(he).Insert)?(st(),Be(m,{key:0,type:"link",class:Qe([vt(i).e("add")]),onClick:S},{default:bt(()=>[a[3]||(a[3]=Pe("i",{class:"iconfont icon-chuangjian"},null,-1)),Ge(" "+pt(vt(o)("sys.newCategory")),1)]),_:1},8,["class"])):Ae("",!0)],2)):Ae("",!0),Pe("div",{class:Qe([vt(i).e("search-container")])},[Ve(h,{value:u.value,"onUpdate:value":a[0]||(a[0]=e=>u.value=e),class:Qe([vt(i).e("search-input")]),placeholder:vt(je)("sys.onlineForm.searchCategory"),"allow-clear":""},{prefix:bt(()=>[...a[4]||(a[4]=[Pe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","class","placeholder"])],2),Pe("div",{class:Qe([vt(i).e("tree-container")])},[C.value.length?(st(),Be(vt(z),{key:0,ref_key:"treeExRef",ref:p,"selected-keys":c.value,"onUpdate:selectedKeys":a[1]||(a[1]=e=>c.value=e),"expanded-keys":d.value,"onUpdate:expandedKeys":a[2]||(a[2]=e=>d.value=e),class:Qe([vt(i).e("tree"),e.draggable&&"draggable-tree"]),draggable:e.draggable,data:C.value,"last-selection-locked":"",filter:u.value?u.value.trim():"","ignore-case":e.ignoreCase,onDrop:k,onSelect:x},{title:bt(({node:t})=>[Pe("div",{class:Qe([vt(i).b("tree-node"),vt(i).is("highlight",w.value===t.key)])},[Pe("span",{class:Qe([vt(i).be("tree-node","title")]),title:t.title},pt(t.title),11,Bi),e.readonly||!e.hasPerBtns.includes(vt(he).Update)&&!e.hasPerBtns.includes(vt(he).Delete)?Ae("",!0):(st(),Be(O,{key:0,class:Qe([vt(i).be("tree-node","more")]),onVisibleChange:e=>{return a=e,l=t.key,void _(a,l);var a,l}},{overlay:bt(()=>[Ve(b,{style:{width:"102px"},onClick:e=>((e,t)=>{(async(e,t)=>{switch(t){case l:await v(e),_(!1,e.key);break;case s:{const t=c.value[0],a=await f(e,n.customDelFunc,n.customDelTips);_(!1,e.key),a&&t===e.key&&(c.value=C.value.length?[C.value[0].key]:[],r("changeValue",C.value[0]));break}}})(e,String(t.key))})(t,e)},{default:bt(()=>[e.hasPerBtns.includes(vt(he).Update)?(st(),Be(y,{key:l},{default:bt(()=>[Ge(pt(vt(o)("sys.component.dataConnection.rename")),1)]),_:1})):Ae("",!0),e.hasPerBtns.includes(vt(he).Delete)?(st(),Be(y,{key:s},{default:bt(()=>[Ge(pt(vt(o)("sys.delText")),1)]),_:1})):Ae("",!0)]),_:1},8,["onClick"])]),default:bt(()=>[Ve(g)]),_:2},1032,["class","onVisibleChange"]))],2)]),_:1},8,["selected-keys","expanded-keys","class","draggable","data","filter","ignore-case"])):Ae("",!0)],2)],2)}}}),$i=/* @__PURE__ */ie(Ai,[["__scopeId","data-v-5af8c1ba"]]),Pi={key:0,class:"px-2"},Ni={key:1,class:"font-bold mb-3"},Gi={key:2,class:"gct-print-tmpl-modal-wrap ks-col"},Vi={class:"print-tmpl-vxe-table-wrapper"},Hi={class:"print-tmpl-vxe-table-area"},qi={class:"ks-row"},Ki={class:"gct-text-overflow"},Yi={key:0,class:"gct-custom-tag ml4px"},Wi={class:"ks-row"},Xi=["title"],Zi={class:"pt-12px"},Ji={key:3,class:"gct-print-tmpl-modal-right btw-visible flex flex-col h-full px-2 py-3"},Qi={class:"print-tmpl-vxe-table-wrapper"},en={class:"print-tmpl-vxe-table-area"},tn={class:"tmpl-path"},an=["src"],ln=["src"],sn={class:"pt-12px"},on=/* @__PURE__ */qe({__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=ze("print-tmpl-modal"),l=nt([]),s=nt(),o=nt(),i=nt({pageNo:1,pageSize:20}),n=nt({pageNo:1,pageSize:20}),r=nt("design"),c=nt(0),d=nt(!1),u=nt(0),p=nt(!1),m=Ue(()=>t.printMode===_e.Server||t.btwForceVisible),h=Ue(()=>t.moduleType),v=nt(Ue(()=>{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||""),f=nt({categoryId:v.value,name:""}),g=nt({name:""}),y=nt(""),b=/(?<!\\)\\(?!\\)/g,w=Ue(()=>({current:i.value.pageNo,pageSize:i.value.pageSize,total:c.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>je("sys.component.table.total",{total:e})})),_=Ue(()=>({current:n.value.pageNo,pageSize:n.value.pageSize,total:u.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>je("sys.component.table.total",{total:e})})),x=nt([]),C=nt([]),k={[xe.LABEL]:je("sys.pageDesigner.label"),[xe.RECEIPT]:je("sys.pageDesigner.document"),[we.EDHR]:"DHR",[we.ONLINE_FORM]:je("sys.pageDesigner.fieldCmp.online_form")};at(()=>{Je(()=>{t.selected&&(Array.isArray(t.selected)?(S(t.selected),l.value=[...t.selected]):(S([t.selected]),l.value=[{...t.selected}]))})});const S=e=>{const t=s.value;t&&t.setCheckboxRow(e,!0)},O=e=>e.children||!t.isRdo?e.name:e.version,D=Ue(()=>[we.EDHR,we.ONLINE_FORM].includes(t.moduleType)),E=Ue(()=>k[t.moduleType]),T=Ue(()=>t.categoryTitle||!Tt(t.categoryTitle)?t.categoryTitle:je("sys.categoryOfSth",{sth:E.value})),I=e=>{f.value.categoryId=null==e?void 0:e.key},j=e=>{l.value=[{...e.row}]},M=({checked:e,row:t})=>{var a,s;e?null===(a=l.value)||void 0===a||a.push(t):l.value=null===(s=l.value)||void 0===s?void 0:s.filter(e=>e.id!==t.id)};function L(e,t){i.value.pageNo=e,i.value.pageSize=t,F()}function R(e,t){n.value.pageNo=e,n.value.pageSize=t,U()}const z=()=>{};Re(()=>Promise.resolve({ok:!0,params:{selected:l.value}}));const F=async()=>{var e,a,l;f.value.name=f.value.name.trim();const o=_api.apaas.printDesigner.getRdoPageBaseList;d.value=!0;const n=await o({...f.value,...i.value,...t.queryParams||{},moduleType:t.moduleType,modelKey:t.modelKey})||{};d.value=!1,x.value=v.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:f.value.categoryId}),a}))||[],c.value=n.totalCount,await Je();const r=A(x.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});console.log(s.value,"tableRef.value"),r&&(null===(a=s.value)||void 0===a||a.setRadioRow(r)),t.isRdo&&(null===(l=s.value)||void 0===l||l.setAllTreeExpand(!0))},U=async()=>{g.value.name=g.value.name.trim(),p.value=!0,_api.apaas.label.getBtwPageList({...g.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}}),C.value=e.data||[],u.value=e.totalCount,await Je();const s=A(C.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});s&&(null===(l=o.value)||void 0===l||l.setRadioRow(s))}).finally(()=>{p.value=!1})},B=e=>{const t=e.target.value;(!t||t.length<y.value.length)&&U(),y.value=t},A=e=>function e(t,a){let l=[];for(const o of t){var s;o.level=a,l.push(o),(null===(s=o.children)||void 0===s?void 0:s.length)&&(l=[...l,...e(o.children,a+1)])}return l}(JSON.parse(JSON.stringify(e)),1);return gt(()=>f.value.categoryId,e=>{e?F():(x.value=[],c.value=0)},{immediate:!0}),gt(()=>r.value,()=>{"btw"===r.value?(C.value=[],n.value.pageNo=1,U()):(x.value=[],i.value.pageNo=1,F())}),gt(()=>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 i=ut("a-tab-pane"),n=ut("a-tabs"),c=ut("a-input"),u=ut("a-form-item"),y=ut("a-form"),k=ut("a-tooltip"),S=ut("a-pagination");return st(),$e("div",{class:Qe(["gct-print-tmpl-modal ks-column",m.value?"px-2 pt-4":"p-4"])},[m.value?(st(),$e("div",Pi,[Ve(n,{"active-key":r.value,"onUpdate:activeKey":l[0]||(l[0]=e=>r.value=e)},{default:bt(()=>[Ve(i,{key:"design",tab:T.value},null,8,["tab"]),Ve(i,{key:"btw",tab:".btw 标签模板 "})]),_:1},8,["active-key"])])):(st(),$e("div",Ni,pt(T.value),1)),!m.value||m.value&&"design"===r.value?(st(),$e("div",Gi,[Pe("div",{class:Qe(["gct-print-tmpl-modal-left",m.value?"btw-visible":""])},[Ve(vt($i),{value:v.value,"onUpdate:value":l[1]||(l[1]=e=>v.value=e),class:Qe([vt(a).e("sider")]),"sider-title":"",module:h.value,"need-folder-icon":!D.value,readonly:"","has-title":!1,draggable:!1,"is-tree":D.value,"ignore-case":e.ignoreCase,onChangeValue:I,onChangeCategory:z},null,8,["value","class","module","need-folder-icon","is-tree","ignore-case"])],2),Pe("div",{class:Qe(["gct-print-tmpl-modal-right flex flex-col h-full px-16px py-12px",m.value?"btw-visible":""])},[Ve(y,{model:f.value},{default:bt(()=>[Ve(u,{label:""},{default:bt(()=>[Ve(c,{value:f.value.name,"onUpdate:value":l[2]||(l[2]=e=>f.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:vt(je)("sys.searchNameOfSth",{sth:E.value}),clearable:"",onKeyup:l[3]||(l[3]=_t(e=>F(),["enter"])),onChange:l[4]||(l[4]=()=>{!f.value.name&&F()})},{prefix:bt(()=>[...l[7]||(l[7]=[Pe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Pe("div",Vi,[Pe("div",Hi,[Ve(vt(ia),{ref_key:"tableRef",ref:s,class:Qe(["select-none",{vxetable:!0,default:!0}]),data:x.value,height:"100%","min-height":"88",loading:d.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:M,onRadioChange:j},{default:bt(()=>[e.multiple?(st(),Be(vt(oa),{key:0,type:"checkbox",width:"40"})):(st(),Be(vt(oa),{key:1,type:"radio",width:"40",resizable:!1})),Ve(vt(oa),{field:"name",title:vt(je)("sys.name"),"show-overflow":"","tree-node":e.isRdo},{default:bt(t=>{var a;return[Pe("div",qi,[Ve(k,null,{title:bt(()=>[Ge(pt(O((null==t?void 0:t.row)||{})),1)]),default:bt(()=>[Pe("div",Ki,pt(O((null==t?void 0:t.row)||{})),1)]),_:2},1024),(null==t||null===(a=t.row)||void 0===a?void 0:a.default)&&e.isRdo?(st(),$e("div",Yi,pt(vt(je)("sys.default")),1)):Ae("",!0)])]}),_:1},8,["title","tree-node"]),Ve(vt(oa),{field:"description",title:vt(je)("sys.description"),"show-overflow":""},{default:bt(e=>{var t,a;return[Pe("div",Wi,[Pe("span",{class:"gct-text-overflow",title:null==e||null===(t=e.row)||void 0===t?void 0:t.description},pt(null==e||null===(a=e.row)||void 0===a?void 0:a.description),9,Xi)])]}),_:1},8,["title"]),Ve(vt(oa),{field:"modifyUserName",title:vt(je)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),Ve(vt(oa),{field:"modifyTime",title:vt(je)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Pe("div",Zi,[Ve(S,Ze(w.value,{class:"pagination-total-left",onChange:L}),null,16)])])],2)])):Ae("",!0),m.value&&"btw"===r.value?(st(),$e("div",Ji,[Ve(y,{model:g.value},{default:bt(()=>[Ve(u,{label:""},{default:bt(()=>[Ve(c,{value:g.value.name,"onUpdate:value":l[5]||(l[5]=e=>g.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:vt(je)("sys.searchNameOfSth",{sth:"标签"}),clearable:"",onKeyup:l[6]||(l[6]=_t(e=>U(),["enter"])),onChange:B},{prefix:bt(()=>[...l[8]||(l[8]=[Pe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Pe("div",Qi,[Pe("div",en,[Ve(vt(ia),{ref_key:"btwTableRef",ref:o,class:Qe(["select-none",{vxetable:!0,default:!0}]),data:C.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:M,onRadioChange:j},{default:bt(()=>[e.multiple?(st(),Be(vt(oa),{key:0,type:"checkbox",width:"40"})):(st(),Be(vt(oa),{key:1,type:"radio",width:"40",resizable:!1})),Ve(vt(oa),{field:"name",title:"标签模板名称","min-width":"120","show-overflow":""}),Ve(vt(oa),{field:"modelName",title:"关联模型",width:"120","show-overflow":""}),Ve(vt(oa),{field:"tmplPath",title:"BarTender "+vt(je)("sys.labelTmplPath"),"min-width":"220","show-overflow":""},{default:bt(e=>{var t,a;return[Pe("span",tn,[Pe("img",{width:"16",height:"16",src:vt("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,an),Pe("span",null,pt(null==e||null===(t=e.row)||void 0===t?void 0:t.printName),1),(st(!0),$e(Fe,null,ct((null==e||null===(a=e.row)||void 0===a?void 0:a.tmplPath)||[],(t,a)=>{var s,o;return st(),$e(Fe,{key:a},[l[9]||(l[9]=Ge(" /",-1)),Pe("img",{width:"16",height:"16",class:"ml-3px mr-2px",src:vt("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,ln),Pe("span",null,pt(null==t?void 0:t.replace(b,"/")),1),0===a?(st(),$e("span",{key:0,class:Qe(["btw-label-tag","common"===(null==e||null===(s=e.row)||void 0===s?void 0:s.pathType)?"common":"local"])},pt("common"===(null==e||null===(o=e.row)||void 0===o?void 0:o.pathType)?vt(je)("sys.shared"):vt(je)("sys.local")),3)):Ae("",!0)],64)}),128))])]}),_:1},8,["title"]),Ve(vt(oa),{field:"macAddress",title:vt(je)("sys.macAddress"),width:"175","show-overflow":""},null,8,["title"]),Ve(vt(oa),{field:"createUserName",title:vt(je)("sys.creator"),width:"120","show-overflow":""},null,8,["title"]),Ve(vt(oa),{field:"createTime",title:vt(je)("sys.createTime"),width:"185"},null,8,["title"]),Ve(vt(oa),{field:"modifyUserName",title:vt(je)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),Ve(vt(oa),{field:"modifyTime",title:vt(je)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Pe("div",sn,[Ve(S,Ze(_.value,{class:"pagination-total-left",onChange:R}),null,16)])])])):Ae("",!0)],2)}}}),nn=/* @__PURE__ */ie(on,[["__scopeId","data-v-c60841b8"]]),rn={scrollbars:{autoHide:"leave",autoHideDelay:100,theme:"os-theme-dark"}},cn=/* @__PURE__ */qe({name:"GctOverlayScrollbars",inheritAttrs:!1,props:{options:{type:[Object,Boolean],default:null},handleColor:{type:String,default:"rgba(144, 147, 153, 0.3)"}},setup(e,{expose:t}){const a=nt(),l=Ue(()=>{if(!1===e.options)return!1;const t=e.options??{},a=t.scrollbars??{};return{...rn,...t,scrollbars:{...rn.scrollbars,...a}}}),s=Ue(()=>e.handleColor?{"--gct-h-bg":e.handleColor}:void 0);return t({osInstance:()=>{var e;return(null===(e=a.value)||void 0===e?void 0:e.osInstance())??null},getElement:()=>{var e;return(null===(e=a.value)||void 0===e?void 0:e.getElement())??null}}),{mergedOptions:l,colorStyle:s,setOsRef:e=>{a.value=e}}},render(){return Ve(me,Ze({ref:this.setOsRef,options:this.mergedOptions},this.$attrs,{"data-gct-os":"","data-gct-color":this.handleColor?"":void 0,style:this.colorStyle}),{default:()=>{var e,t;return[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)]}})}}),dn={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,s=document.createElement("div");l.appendChild(s),s.style.cursor="col-resize",s.style.position="absolute",s.style.height="100%",s.style.width="5px",s.style.right="0px",s.style.top="0px",s.style.background="rgba(255, 0, 0, 0);",s.onmousedown=t=>{const s=l.clientWidth,o=t.clientX;document.onmousemove=function(t){t.preventDefault();let i=s+(t.clientX-o);i=i<a?a:i,l.setAttribute("style",`width:${i}px !important;`);const n=new CustomEvent("drag-resize-width",{detail:{width:i,resizing:!0}});e.dispatchEvent(n)},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}})}},un={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__)}},pn=/* @__PURE__ */ie(/* @__PURE__ */qe({__name:"target-loading",props:{tip:{type:String,default:""},size:{type:String,default:Ce.LARGE,validator:e=>[Ce.DEFAULT,Ce.SMALL,Ce.LARGE].includes(e)},absolute:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},background:{type:String},theme:{type:String}},setup:e=>(t,a)=>wt((st(),$e("section",{class:Qe(["full-loading",{absolute:e.absolute,[e.theme]:!!e.theme}]),style:et([e.background?`background-color: ${e.background}`:""])},[Ve(vt(Gt),Ze(t.$attrs,{tip:e.tip,size:e.size,spinning:e.loading}),null,16,["tip","size","spinning"])],6)),[[ft,e.loading]])}),[["__scopeId","data-v-d448466c"]]),mn={mounted(e,t){const a=e.getAttribute("loading-tip"),l=e.getAttribute("loading-background"),s=e.getAttribute("loading-size"),o=!!t.modifiers.fullscreen;e.instance=function(e,t,a=!1){let l=null;const s=it({tip:"",loading:!0,...e});function o(e=document.body){l&&l.el&&e.appendChild(l.el)}return l=Ve(qe({render:()=>Ye(pn,{...s})})),a?setTimeout(()=>{rt(l,document.createElement("div"))},0):rt(l,document.createElement("div")),t&&o(t),{vm:l,close:function(){(null==l?void 0:l.el)&&l.el.parentNode&&l.el.parentNode.removeChild(l.el)},open:o,setTip:e=>{s.tip=e},setLoading:e=>{s.loading=e},get loading(){return s.loading},get $el(){return null==l?void 0:l.el}}}({tip:a,background:l,size:s||"large",loading:!!t.value,absolute:!o},o?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()}};async function hn(e){e.use(Mt),function(e){!function(e){e.directive("dragResize",dn)}(e),function(e){e.directive("ellipsis-title",un)}(e),function(e){e.directive("target-loading",mn)}(e)}(e),e.use(A),Object.entries(Xt).forEach(([t,a])=>{e.component(t,a)}),e.component(v.name,v),e.component(Ko.name,Ko),e.component("OverlayScrollbarsComponent",cn),await Yt(e),e.use(fo),e.use(Ho),e.use(w)}async function vn(e){console.log("coreWebSetupApp")}_gct.message=new ce,_gct.openUtil=Y,_gct.register.editor=new Ka,_gct.register.formItem=new Ya,_gct.register.tableEditor=new Io;var fn=new URL("./index.min.css",import.meta.url);Se.load(fn.href);export{a as BaseButton,n as BasicButton,w as BasicModal,zi as CategoryModal,$i as CategorySider,l as CodeEditor,Ko as ColorEditor,v as ColorPicker,ni as CopperFreeModal,vi as CopperModal,d as CopyModuleKey,yi as CropperAvatar,Ri as CropperFree,ai as CropperImage,p as DoubleInput,Ta as EditFormController,ja as EditorController,Ka as EditorRegister,na as EditorRegisterConst,ra as EditorType,ca as FORM_CONTROLLER_INJECT_TAG,s as FieldCascader,o as FieldUpload,za as FormCollapseController,Ra as FormCollapsePaneController,pa as FormCollapsePaneState,ma as FormCollapseState,Aa as FormEditItemController,fa as FormEditItemState,Ba as FormGroupController,ga as FormGroupState,Pa as FormHiddenItemController,Ma as FormItemBasicController,ua as FormItemBasicState,$a as FormItemController,Ya as FormItemRegister,ya as FormItemState,Na as FormLineController,ba as FormLineState,da as FormState,Fa as FormTabController,Ua as FormTabPaneController,va as FormTabPaneState,ha as FormTabState,i as FullScreen,Yo as GCT_DND_INSERT_POS,Zo as GctDndContainer,Xo as GctDndDropLine,Wo as GctDndItem,il as GctFormCollapseModel,al as GctFormCollapsePaneModel,Ea as GctFormController,dl as GctFormGroupModel,Il as GctFormHiddenItemModel,jl as GctFormItemModel,hl as GctFormLineModel,yl as GctFormTabModel,Cl as GctFormTabPaneModel,El as GctFormTitleGroupModel,Do as GctTableController,E as I18Modal,_ as I18nSelectBtn,b as I18nSelectInput,P as I18nSelectInputForm,O as I18nSelectTextarea,g as I18nSelectTextareaForm,wi as ImagePreview,u as ImageUpload,pe as Lang,ce as MessageUtil,qo as MonacoEditor,T as NumberRange,oe as OverlayController,R as PaasBpmnLog,C as PaasBpmnRuntime,de as Prop,U as SerialNumberContainer,N as StageView,xo as TableActionItemController,Co as TableEditItemController,bo as TableEditItemState,Io as TableEditorRegister,yo as TableITemState,_o as TableItemController,Oo as TableRowController,wo as TableRowState,go as TableState,ue as Theme,z as TreeEx,k as TreeSelectEx,Q as UseDragByLine,m as UserPickType,c as ViewContainer,r as Vue3GridDndItem,D as WUJIE_FORMULA_EVENTS,hn as coreWebCreateAppVue,vn as coreWebSetupApp,Di as createImgPreview,te as filterTreeData,se as findRecursiveChild,h as gctFieldSortPopover,j as gctFieldTreeSelect,qa as gctFormItemEditorProps,Oa as getValue,nn as labelTmplModal,ee as monacoLoader,y as openFormulaEditor,Y as overlay,J as recursiveIterate,q as recursiveTransfer,G as setIdentify,Da as setValue,To as useAntTableScrollHeight,Ia as useEditFormController,M as useEditorConsole,B as useEditorConsoleInner,Ga as useForm,La as useFormItemController,Va as useGctFormValue,Ha as useGctFormValueByText,L as useI18nSelect,f as useLabelModalPicker,W as useLocale,$ as useModal,F as useModalContext,S as useModalDragMove,I as useModalInner,x as useModalPicker,Eo as useTableController,ne as useTheme,Z as validateFieldDefaultForLength,H as validateFieldDefaultForValue,re as validateLengthRange,Sa as widthEditorInstall,ae as withInstall};
|
|
1
|
+
import{i as e}from"./chunk-DPOkwzLC.js";import{t}from"./defineProperty-Co6UJKQ3.js";import{a,i as l,r as o,t as s}from"./diagram-config-item-virtual-Cbmggfwt.js";import{$ as i,C as n,D as r,O as c,Q as d,S as u,T as p,X as m,Z as h,_ as v,a as g,at as f,b as y,c as b,ct as w,d as _,et as x,f as C,g as k,h as S,i as O,it as E,k as D,l as T,lt as I,m as j,n as L,nt as R,o as M,ot as z,p as F,r as U,rt as A,s as B,st as N,t as V,tt as P,u as $,v as G,w as H,x as q,y as K}from"./ColorPicker-DGQQb8I7.js";import{O as Y,_ as W,a as X,b as Z,c as J,d as Q,f as ee,g as te,i as ae,l as le,m as oe,n as se,o as ie,p as ne,r as re,s as ce,t as de,u as ue,v as pe,y as me}from"./_plugin-vue_export-helper-C9hXqKoS.js";import{n as he,r as ve,t as ge}from"./useMonacoEditor-DqSQTg7b.js";import{r as fe,t as ye}from"./relationship-diagram-config-DstwwXCO.js";import{i as be,o as we,r as _e,s as xe}from"./hooks-yX21uJ6d.js";import{t as Ce}from"./diagram-config-item-C5Ha2XJq.js";import{t as ke}from"./diagram-config-item-reverse-ChoxnW-Z.js";import{t as Se}from"./overlayscrollbars-vue-Df-3wShc.js";import{BasicAction as Oe,CategoryModuleEnum as Ee,EditorRegisterConst as De,ExpressionModeEnum as Te,FIELD_TYPE as Ie,FormContainerType as je,FormDesignEnum as Le,PrintModeEnums as Re,PrintTypeEnum as Me,SizeEnum as ze,cacheFnReturn as Fe,cssLoader as Ue,dataURLtoBlob as Ae,fileUrlParser as Be,getInterfaceApi as Ne,modelLoader as Ve,presetColor as Pe,t as $e,transformUrl as Ge,useCopyToClipboard as He,useModal as qe,useNamespace as Ke}from"@gct-paas/core";import{Fragment as Ye,computed as We,createBlock as Xe,createCommentVNode as Ze,createElementBlock as Je,createElementVNode as Qe,createSlots as et,createTextVNode as tt,createVNode as at,defineAsyncComponent as lt,defineComponent as ot,getCurrentInstance as st,h as it,inject as nt,isVNode as rt,mergeProps as ct,nextTick as dt,normalizeClass as ut,normalizeStyle as pt,onBeforeUnmount as mt,onMounted as ht,onUnmounted as vt,openBlock as gt,provide as ft,reactive as yt,ref as bt,render as wt,renderList as _t,renderSlot as xt,resolveComponent as Ct,toDisplayString as kt,toRef as St,toRefs as Ot,unref as Et,vShow as Dt,watch as Tt,watchEffect as It,withCtx as jt,withDirectives as Lt,withKeys as Rt,withModifiers as Mt}from"vue";import{clone as zt,cloneDeep as Ft,defaults as Ut,groupBy as At,isBoolean as Bt,isFunction as Nt,isNil as Vt,isString as Pt,pickBy as $t}from"lodash-es";import Gt,{Checkbox as Ht,CheckboxGroup as qt,Collapse as Kt,Form as Yt,Image as Wt,Modal as Xt,Radio as Zt,RadioButton as Jt,RadioGroup as Qt,Space as ea,Spin as ta,Tooltip as aa,Upload as la,message as oa}from"ant-design-vue";import sa from"dayjs";import{coreComponentsCreateAppVue as ia}from"@gct-paas/core-components";import na from"vuedraggable";import*as ra from"@ant-design/icons-vue";import{CloseOutlined as ca,DeleteOutlined as da,EditOutlined as ua,ExclamationCircleOutlined as pa,EyeOutlined as ma,LeftOutlined as ha,ReloadOutlined as va,RightOutlined as ga}from"@ant-design/icons-vue";import{VxeColumn as fa,VxeTable as ya}from"vxe-table";import{DotEndpoint as ba,FlowchartConnector as wa}from"@jsplumb/browser-ui";var _a=/* @__PURE__ */function(e){return e.PREFIX="EDITOR___",e}({}),xa=/* @__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}({}),Ca="formController",ka=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",{})}},Sa=class{constructor(){t(this,"disabled",!1),t(this,"readonly",!1),t(this,"visible",!0),t(this,"keepalive",!1),t(this,"destroyed",!1)}},Oa=class extends Sa{},Ea=class extends Sa{},Da=class extends Sa{constructor(...e){super(...e),t(this,"activePane","")}},Ta=class extends Sa{},Ia=class extends Sa{constructor(...e){super(...e),t(this,"label",""),t(this,"value",null),t(this,"options",[])}},ja=class extends Sa{constructor(...e){super(...e),t(this,"expand",!0)}},La=class extends Ia{},Ra=class extends Sa{};function Ma(e,t,a,l){return{install(o){e&&t&&_gct.register.editor.register(_a.PREFIX+e,t),a&&o.component(l??a.name,a)}}}function za(e,t){const a=e.split(".");try{return a.reduce((e,t)=>e[t],t)}catch(l){console.warn(l)}}function Fa(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 Ua=class{constructor(e){t(this,"model",void 0),t(this,"evt",new a),t(this,"state",yt(new ka)),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(".")||Fa(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(){}},Aa=class extends Ua{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 Ba(e){const t=e();return t.state=yt(t.state),vt(()=>t.destroy()),t}var Na=class{constructor(e){t(this,"model",void 0),t(this,"options",[]),this.model=e}},Va=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==za(this.key,e)&&null!=this.model.defaultValue&&Fa(this.model.defaultValue,this.key,e)}crateItemState(){return new Sa}};function Pa(e){const t=e();return t.state=yt(t.state),t}var $a=class extends Va{constructor(...e){super(...e),t(this,"type","collapse-pane")}crateItemState(){return new Oa}},Ga=class extends Va{constructor(...e){super(...e),t(this,"type","collapse")}crateItemState(){return new Ea}},Ha=class extends Va{constructor(...e){super(...e),t(this,"type","tab")}crateItemState(){return new Da}},qa=class extends Va{constructor(...e){super(...e),t(this,"type","tab-pane")}crateItemState(){return new Ta}},Ka=class extends Va{constructor(...e){super(...e),t(this,"type","group")}crateItemState(){return new ja}},Ya=class extends Va{get key(){return this.model.field??this.model.name}get value(){return za(this.key,this.form.state.data)}set value(e){const t=this.form.state.data,a=Ft(za(this.key,t));Fa(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 Ia}},Wa=class extends Ya{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 La}},Xa=class extends Va{constructor(...e){super(...e),t(this,"type","hidden")}},Za=class extends Va{constructor(...e){super(...e),t(this,"type","line")}crateItemState(){return new Ra}};function Ja(){return nt("formController")}function Qa(e){let t=null;if(e){const a=Ja().item[e];a&&(t=We({get:()=>a.value,set(e){"string"==typeof e&&(e=e.trim()),"object"!=typeof e&&a.value==e||(a.value=e)}}))}else{let e=st().proxy;const a=e.$props,l=e.$emit;t=We({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 el(e,t){let a=st().proxy;const l=a.$props,o=a.$emit,s=e?e.length:0,i=t?t.length:0;return a=null,We({get:()=>{if(!l.value)return"";let a=l.value;return s>0&&a.startsWith(e)&&(a=a.substring(s)),i>0&&a.endsWith(t)&&(a=a.substring(0,a.length-i)),a},set:a=>{if(l.value===a)return;if(""==a)return void o("update:value","");let n=a;s>0&&(n=e+n),i>0&&(n+=t),o("update:value",n)}})}function tl(){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 al=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}},ll=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}},ol=/* @__PURE__ */ot({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=Ke("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=We(()=>{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?at(Ct("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:()=>[at("span",{class:"iconfont icon-assist ml5px text-[#bfbfbf]"},null)]}):null}},render(){const e=_gct.register.editor.get(De.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=it("string"==typeof e.component?Ct(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=[at("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=()=>[at("span",null,[this.model.label]),this.renderLabelTooltip()]),!1!==this.c.state.visible?at(Ct("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)&&!rt(o)?l:{default:()=>[l]}):void 0}}),sl=/* @__PURE__ */ot({name:"GctForm",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Ke("form");ft(Ca,e.c);const a=bt(),l=e.c;Object.keys(l.item).forEach(e=>{const t=l.item[e];t.state=yt(t.state)});const o=t=>at(Ct("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),s=t=>{const a=l.provider[t.name];return a?a?it("string"==typeof a.component?Ct(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:()=>i(t.children||[])}):void console.error(`未找到表单容器适配器:${t.name} - ${t.type}`):(console.error(`未找到表单项适配器实例:${t.name}`,t),null)},i=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?s(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:s,renderChildren:i}},render(){let e;return at(Ct("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)&&!rt(t)?e:{default:()=>[e]});var t}}),il=class{constructor(){t(this,"component","gct-form-item")}createController(e,t){return Pa(()=>new Wa(e,t))}},nl=class{constructor(){t(this,"component","gct-form-hidden-item")}createController(e,t){return Pa(()=>new Xa(e,t))}},rl=class{constructor(){t(this,"component","gct-form-collapse-pane")}createController(e,t){return Pa(()=>new $a(e,t))}};function cl(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var dl=/* @__PURE__ */ot({name:"GctFormCollapsePane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Ke("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?at(Ct("flex-container"),{layout:e.model.flex},cl(t)?t:{default:()=>[t]}):"grid"===e.model.layout?at(Ct("grid-container"),{layout:e.model.grid},cl(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=ct(l.props||{},{class:this.ns.e("last-child")})),at("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),ul=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)}},pl={install(e){_gct.register.formItem.register("collapse-pane",()=>new rl),e.component(dl.name,dl)}},ml=class{constructor(){t(this,"component","gct-form-collapse")}createController(e,t){return Pa(()=>new Ga(e,t))}},hl=/* @__PURE__ */ot({name:"GctFormCollapse",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){var t;const a=Ke("form-collapse"),l=bt([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 s=bt([]);return s.value=(null===(t=e.model.children)||void 0===t?void 0:t.map(e=>e.name))||[],{ns:a,keys:l,style:o,activeKeys:s,expandIconPosition:We(()=>"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 at(Kt,{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 at(Kt.Panel,{key:e.name,header:e.title,collapsible:l},{default:()=>[a[t]]})})]}})}}),vl=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)}},gl={install(e){_gct.register.formItem.register("collapse",()=>new ml),e.component(hl.name,hl)}},fl=class{constructor(){t(this,"component","gct-form-group")}createController(e,t){return Pa(()=>new Ka(e,t))}},yl=/* @__PURE__ */ot({name:"GctFormGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e,{slots:t}){const a=Ke("form-group"),l=bt([0]);function o(){return"flex"===e.model.layout?at(Ct("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?at(Ct("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 s={};return e.model.width&&(s[a.cssVarName("form-group-width")]=e.model.width),e.model.height&&(s[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 at(Ct("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:s,ghost:!0},{default:()=>{return[at(Ct("a-collapse-panel"),{key:"0",header:e.model.title},(a=t=o(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!rt(a)?t:{default:()=>[t]}))];var a}})}return at("div",{class:[a.b(),a.is("hidden-header",!1===e.model.showHeader),a.is("hidden",!1===e.c.state.visible),e.model.class],style:s},[!1===e.model.showHeader?at("div",{class:a.e("title")},[e.model.title]):null,at("div",{class:a.e("content")},[o()])])}}}),bl=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)}},wl={install(e){_gct.register.formItem.register("container",()=>new fl),e.component(yl.name,yl)}},_l=class{constructor(){t(this,"component","gct-form-line")}createController(e,t){return Pa(()=>new Za(e,t))}},xl=/* @__PURE__ */ot({name:"GctFormLine",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup:e=>({ns:Ke("form-line"),style:We(()=>{const{paddingTop:t,paddingBottom:a}=e.model;return{paddingTop:t,paddingBottom:a}})}),render(){return at("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[at("div",{class:this.ns.e("line")},null)])}}),Cl=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)}},kl={install(e){_gct.register.formItem.register("line",()=>new _l),e.component(xl.name,xl)}},Sl=class{constructor(){t(this,"component","gct-form-tab")}createController(e,t){return Pa(()=>new Ha(e,t))}},Ol=/* @__PURE__ */ot({name:"GctFormTab",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Ke("form-tab"),a=Ja(),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),Tt(e.c.state,()=>{a.evt.emit("changeState",e.c.model.name,e.c)}),ht(()=>{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 at(Ct("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)=>at(Ct("a-tab-pane"),{key:e.name,tab:e.title},{default:()=>[a[t]]}))]}})}}),El=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)}},Dl={install(e){_gct.register.formItem.register("tab",()=>new Sl),e.component(Ol.name,Ol)}},Tl=class{constructor(){t(this,"component","gct-form-tab-pane")}createController(e,t){return Pa(()=>new qa(e,t))}};function Il(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var jl=/* @__PURE__ */ot({name:"GctFormTabPane",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},context:{type:Object,default:()=>({})}},setup(e){const t=Ke("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?at(Ct("flex-container"),{layout:e.model.flex},Il(t)?t:{default:()=>[t]}):"grid"===e.model.layout?at(Ct("grid-container"),{layout:e.model.grid},Il(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 at("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible)],style:this.style},[this.renderContainer(a)])}}),Ll=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)}},Rl={install(e){_gct.register.formItem.register("tab-pane",()=>new Tl),e.component(jl.name,jl)}},Ml=class{constructor(){t(this,"component","gct-form-title-group")}createController(e,t){return Pa(()=>new Ka(e,t))}};function zl(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var Fl=/* @__PURE__ */ot({name:"GctFormTitleGroup",props:{c:{type:Object,required:!0},model:{type:Object,required:!0}},setup(e){const t=Ke("form-title-group"),a=bt([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?at(Ct("flex-container"),{layout:e.model.flex},zl(t)?t:{default:()=>[t]}):"grid"===e.model.layout?at(Ct("grid-container"),{layout:e.model.grid},zl(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 at("div",{class:[this.ns.b(),this.ns.is("hidden",!1===this.c.state.visible),this.model.class],style:this.style},[at("div",{class:this.ns.e("title")},[this.model.title]),at("div",{class:this.ns.e("content")},[this.renderContainer(a)])])}}),Ul=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)}},Al={install(e){_gct.register.formItem.register(je.FORM_TITLE_GROUP,()=>new Ml),e.component(Fl.name,Fl)}},Bl=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)}},Nl=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}},Vl={install(e){_gct.register.formItem.register("item",()=>new il),_gct.register.formItem.register("hidden",()=>new nl),e.use(pl),e.use(gl),e.use(wl),e.use(kl),e.use(Dl),e.use(Rl),e.use(Al),e.component(sl.name,sl),e.component(ol.name,ol)}},Pl=/* @__PURE__ */ot({name:"FlexItem",props:{layout:Object},setup:e=>({ns:Ke("flex-item"),getStyle:()=>{const t={};if(e.layout){const{order:a,alignSelf:l,flexBasis:o,flexGrow:s,flexShrink:i}=e.layout;null!=a&&(t.order=a),null!=l&&(t["align-self"]=l),null!=o&&(t["flex-basis"]=o),null!=s&&(t["flex-grow"]=s),null!=i&&(t["flex-shrink"]=i)}return t}}),render(){var e,t;return at("div",{class:this.ns.b(),style:this.getStyle()},[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)])}}),$l=/* @__PURE__ */ot({name:"FlexContainer",props:{layout:Object},setup:e=>({ns:Ke("flex-container"),getStyle:()=>{const t={};if(e.layout){const{alignContent:a,alignItems:l,flexDirection:o,flexWrap:s,justifyContent:i}=e.layout;null!=a&&(t.alignContent=a),null!=l&&(t.alignItems=l),null!=o&&(t.flexDirection=o),null!=s&&(t.flexWrap=s),null!=i&&(t.justifyContent=i)}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||[]),at("div",{class:this.ns.b(),style:this.getStyle()},[a.map(e=>{if(!e)return null;const t=e.props.model.flexItem;return at(Pl,{layout:t,style:this.getItemStyle(e.props.model)},"function"==typeof(a=e)||"[object Object]"===Object.prototype.toString.call(a)&&!rt(a)?e:{default:()=>[e]});var a})])}});function Gl(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var Hl=/* @__PURE__ */ot({name:"GridContainer",props:{layout:Object},setup(e,{slots:t}){const a=Ke("grid-container");return()=>{var l;let o;const s=e.layout||{};let i=(null===(l=t.default)||void 0===l?void 0:l.call(t))||[];return i.length>0&&(i=i[0].children||[]),at(Ct("a-row"),{class:a.b(),wrap:!0,gutter:s.gutter},Gl(o=i.map(e=>{if(!e)return null;const t=e.props.model.gridItem;return at(Ct("a-col"),{span:t?t.span??24:24,offset:t?t.offset??0:0},Gl(e)?e:{default:()=>[e]})}))?o:{default:()=>[o]})}}}),ql=/* @__PURE__ */ot({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=Ke("gct-form-action"),a=Ja();return{ns:t,onClick:function(t){t.stopPropagation(),e.model.click&&e.model.click(t,a,e.c,e.data)}}},render(){return at(Ct("a-button"),ct({class:this.ns.b(),onClick:this.onClick,size:this.size,type:"link"},this.model.props||{}),{default:()=>[this.model.label]})}}),Kl=class{constructor(){t(this,"component","gct-form-action")}},Yl=Ma(xa.ACTION,()=>new Kl,ql);function Wl(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var Xl=/* @__PURE__ */ot({name:"GctFormDateFormatSelect",props:tl(),setup(e){var t;const a=Ke("form-date-format-select"),l=We(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.fieldTypeKey)||"type"]}),o=We(()=>{var t;return e.data[(null===(t=e.model)||void 0===t?void 0:t.mappingTypeKey)||"mapping_type"]}),s=Qa((null===(t=e.model)||void 0===t?void 0:t.separatorKey)||"separator"),i=[{label:"-",value:"-"},{label:"/",value:"/"},{label:"·",value:"."}],n=Qa(),r=We(()=>l.value===Ie.DATE_TIME||o.value===Ie.DATE_TIME?[{label:`yyyy${s.value}MM${s.value}dd HH`,value:`YYYY${s.value}MM${s.value}DD HH`},{label:`yyyy${s.value}MM${s.value}dd HH:mm`,value:`YYYY${s.value}MM${s.value}DD HH:mm`},{label:`yyyy${s.value}MM${s.value}dd HH:mm:ss`,value:`YYYY${s.value}MM${s.value}DD HH:mm:ss`}]:l.value===Ie.DATE||o.value===Ie.DATE?[{label:"yyyy",value:"YYYY"},{label:`yyyy${s.value}MM`,value:`YYYY${s.value}MM`},{label:`yyyy${s.value}MM${s.value}dd`,value:`YYYY${s.value}MM${s.value}DD`}]:[]);return Tt(s,()=>{l.value!==Ie.DATE_TIME&&o.value!==Ie.DATE_TIME?l.value!==Ie.DATE&&o.value!==Ie.DATE?n.value="":n.value=`YYYY${s.value}MM${s.value}DD`:n.value=`YYYY${s.value}MM${s.value}DD HH:mm:ss`}),()=>{var t,l;let o,c;return at("div",{class:a.b()},[at("span",{class:a.e("first")},[at(Ct("a-select"),ct({value:s.value,"onUpdate:value":e=>s.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||$e("sys.chooseText")},(null===(t=e.model)||void 0===t?void 0:t.props)||{}),Wl(o=i.map(e=>at(Ct("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?o:{default:()=>[o]})]),at("span",{class:a.e("second")},[at(Ct("a-select"),ct({value:n.value,"onUpdate:value":e=>n.value=e,disabled:e.c.state.disabled,size:e.size,placeholder:e.model.placeholder||$e("sys.chooseText")},(null===(l=e.model)||void 0===l?void 0:l.props)||{}),Wl(c=r.value.map(e=>at(Ct("a-select-option"),{key:e.value,value:e.value},{default:()=>[e.label]})))?c:{default:()=>[c]})])])}}}),Zl=class{constructor(){t(this,"component","gct-form-date-format-select")}},Jl=Ma(xa.DATE_FORMAT_SELECT,()=>new Zl,Xl),Ql=/* @__PURE__ */ot({name:"GctFormLengthUnit",inheritAttrs:!1,props:{itemModel:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String}},emits:["update:value"],setup:()=>({ns:Ke("form-length-unit"),val:Qa()}),render(){return at(Ct("length-unit-editor"),ct({value:this.val,"onUpdate:value":e=>this.val=e},this.model.props||{},{class:[this.ns.b(),this.ns.is("readonly",this.model.readonly)]}),null)}}),eo=class{constructor(){t(this,"component","gct-form-length-unit")}},to=Ma(xa.LENGTH_UNIT,()=>new eo,Ql),ao=/* @__PURE__ */ot({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=Ke("form-color"),a=Qa();return console.debug("GctFormColor props",e),()=>at(Ct("color-editor"),ct({value:a.value,"onUpdate:value":e=>a.value=e},e.model.props||{},{class:[t.b(),t.is("readonly",e.model.readonly)]}),null)}}),lo=class{constructor(){t(this,"component","gct-form-color")}},oo=Ma(xa.COLOR,()=>new lo,ao),so=class{constructor(){t(this,"component","gct-form-date")}},io=/* @__PURE__ */ot({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=Ke("gct-form-date"),a=new Na(e.model),l=Qa(),o=bt(l.value?sa(l.value):null),s=bt(l.value?sa(l.value):null);return{ns:t,c:a,dateVal:o,timeVal:s,onChange:()=>{let e="";o.value&&(e=o.value.format("YYYY-MM-DD")),s.value?e+=` ${s.value.format("HH:mm:ss")}`:e+=" 00:00:00",l.value=e}}},render(){return at("div",{class:[this.ns.b()]},[this.isDate?at(Ct("a-date-picker"),ct({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?at(Ct("a-time-picker"),{value:this.timeVal,"onUpdate:value":e=>this.timeVal=e,placeholder:"请选择时间",onChange:this.onChange},null):null])}}),no=Ma(xa.DATE,()=>new so,io),ro=/* @__PURE__ */ot({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=Ke("form-formula"),a=Ja(),l=bt(),o=Qa(),s=Qa("expressionEcho"),i=async()=>{const t=await w({expr:o.value.expr,exprEcho:null==s?void 0:s.value,returnType:o.value.mappingType||"string",mode:Te.DATA_SET_FORMULA,identifiers:{},...e.model.config||{}});t&&(o.value={expr:t.expr,mappingType:t.returnType},s&&(s.value=t.exprEcho),a.validateItem(e.itemModel.name))};return()=>at("div",{class:t.b(),onClick:i},[at(Ct("a-input"),{ref:l,class:t.e("input"),readonly:!0,value:(null==s?void 0:s.value)||o.value,placeholder:$e("sys.inputText")},null)])}}),co=class{constructor(){t(this,"component","gct-form-formula")}},uo=Ma(xa.FORMULA,()=>new co,ro),po=class{constructor(){t(this,"component","gct-form-check-switch")}},mo=/* @__PURE__ */ot({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:Ke("gct-form-check-switch"),val:Qa()}),render(){return this.model.isSwitch?at("div",{class:[this.ns.b(),this.ns.m("switch"),this.ns.is("readonly",this.model.readonly),this.size?this.ns.m(this.size):null]},[at(Ct("a-switch"),ct({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)]):at(Ct("a-checkbox"),ct({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]})}}),ho=Ma(xa.CHECK_SWITCH,()=>new po,mo);function vo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var go=/* @__PURE__ */ot({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=Ke("form-select-group"),l=nt("formController"),o=bt(""),s=bt(null),i=bt(!1),n=bt(/* @__PURE__ */new Set),r=We({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 c(e,t){return e.className.indexOf(t)>-1?e:e.parentElement?c(e.parentElement,t):null}function d(e){var t;c(e.target,"ant-select-dropdown")||null===(t=s.value)||void 0===t||t.blur()}window.addEventListener("wheel",d);const u=bt(),p=We({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;m.value.find(t=>(t.options&&(a=t.options.find(t=>t.value==e)),!!a)),a&&(r.value=a.label)}}),m=We(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:[]),h=async()=>e.c.loadDictionary();return null!=p.value&&h(),vt(()=>{window.removeEventListener("wheel",d)}),{ns:a,selectRef:s,searchValue:o,open:i,rootRef:u,val:p,options:m,loadOptions:h,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 at("div",{ref:"rootRef",class:this.ns.b()},[at(Ct("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},vo(e=this.options.map(e=>{let t;const a=null!=e.label?e.label:" ",l=String(e.value),o=this.isGroupCollapsed(l),s=(o&&e.options||[]).filter(e=>!this.searchValue||e.label.toLowerCase().indexOf(this.searchValue.toLowerCase())>=0);return 0===s.length?null:at(Ct("a-select-opt-group"),{key:e.value,label:at("div",{class:[this.ns.b("group-header"),this.model.groupCollapsible?this.ns.b("group-header--clickable"):""],onClick:()=>this.toggleGroupCollapse(l)},[this.model.groupCollapsible&&at("span",{class:[this.ns.be("group-header","arrow"),o?this.ns.bem("group-header","arrow","collapsed"):""]},[at("i",{class:["iconfont",1!=o?"icon-right":"icon-Down"]},null)]),at("span",{class:this.ns.be("group-header","title")},[a])])},vo(t=s.map(e=>at(Ct("a-select-option"),{class:this.ns.b("item-option"),key:e.value,value:e.value},{default:()=>[e.icon?at("span",{class:this.ns.be("item-option","item-icon")},[at("i",{class:`iconfont ${e.icon}`},null)]):"",at("span",{class:this.ns.be("item-option","item-label")},[e.label])]})))?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}}),fo=class{constructor(){t(this,"component","gct-form-select-group")}},yo=Ma(xa.SELECT_GROUP,()=>new fo,go),bo=class{constructor(){t(this,"component","gct-form-i18n")}},wo=/* @__PURE__ */ot({name:"GctFormI18n",props:tl(),emits:["update:value","blur"],setup(e,{emit:t}){var a;const l=Ke("form-i18n"),o=Ja(),s=bt({}),i=bt(!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=We(()=>{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 Ve.loadField((null===(t=e.data)||void 0===t?void 0:t.modelKey)||e.context.modelKey,r.value);a&&(s.value=a)}();const c=We({get:()=>e.value?e.value:!0===i.value?"":s.value.name,set:a=>{"string"==typeof a&&(a=a.trim()),i.value=!0,"object"!=typeof a&&e.value==a||(a||(d.value=""),t("update:value",a))}}),d=We({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:c,i18nConfigValue:d,onBlur:function(){i.value=!1}}},render(){var e;return at(Ct("i18n-select-input"),ct({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||this.$t("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)}}),_o=Ma(xa.I18N,()=>new bo,wo),xo=/* @__PURE__ */ot({name:"GctFormIconSelect",props:{value:{type:Object},model:{type:Object,required:!0}},emits:["update:value"],setup(e,{emit:t}){var a,l,o;const s=Ke("gct-form-icon-select"),i=bt(e.value),n=bt((null===(a=i.value)||void 0===a?void 0:a.icon)||e.model.defaultIcon),r=bt((null===(l=i.value)||void 0===l?void 0:l.color)||e.model.defaultColor),c=bt((null===(o=i.value)||void 0===o?void 0:o.background)||e.model.defaultBackground);return Tt(()=>e.value,e=>{i.value=e,e&&(n.value=e.icon,r.value=e.color)}),Tt([n,r,c],()=>{i.value={icon:n.value,color:r.value},t("update:value",i.value)}),{ns:s,icon:n,color:r,background:c,nextPickerStyle:We(()=>{if(e.model.size)return{"--box-size":e.model.size+"px"}})}},render(){return at("div",{class:this.ns.b()},[at(Ct("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?at("span",{class:this.ns.e("title")},[this.model.label]):null])}}),Co=class{constructor(){t(this,"component","gct-form-icon-select")}},ko=Ma(xa.ICON_SELECT,()=>new Co,xo),So=class{constructor(){t(this,"component","gct-form-number")}},Oo=/* @__PURE__ */ot({name:"GctFormNumber",props:{model:{type:Object,required:!0},value:{type:String,default:""}},emits:["update:value"],setup:()=>({ns:Ke("gct-form-number"),val:Qa()}),render(){return at(Ct("a-input-number"),ct({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)}}),Eo=Ma(xa.NUMBER,()=>new So,Oo),Do=class{constructor(){t(this,"component","gct-form-picker")}},To=/* @__PURE__ */ot({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=Ke("gct-form-picker"),l=Ja(),o=We({get:()=>e.model.nameField?l.item[e.model.nameField].value:"",set(t){if(e.model.nameField)return l.item[e.model.nameField].editorValue=t}}),s=We({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!=s.value&&e.c.loadDictionary(),{ns:a,val:s,nameVal:o,loadOptions:()=>e.c.loadDictionary(),onChange:(e,t)=>{o.value=t.label}}},render(){return at(Ct("a-select"),ct({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)}}),Io=Ma(xa.PICKER,()=>new Do,To),jo=/* @__PURE__ */ot({name:"GctFormPixelConfig",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup(){const e=Ke("form-pixel-config"),t=Qa("label_mode"),a=Qa(),l=[{label:"百分比",value:"percent"},{label:"固定",value:"fixed"}],o=We(()=>"fixed"===t.value?"px":"%");function s(e){t.value=e,a.value="fixed"===e?100:30}return()=>at(Ct("a-input-group"),{compact:!0,class:e.b()},{default:()=>[at(Ct("a-select"),{class:e.e("select"),value:t.value,"onUpdate:value":e=>t.value=e,options:l,onChange:s},null),at(Ct("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)]})}}),Lo=class{constructor(){t(this,"component","gct-form-pixel-config")}},Ro=Ma(xa.PIXEL_CONFIG,()=>new Lo,jo),Mo=class{constructor(){t(this,"component","gct-form-select")}},zo=/* @__PURE__ */ot({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=Ke("gct-form-select"),a=bt();Z(a,()=>{var e;l.value=!1,null===(e=a.value)||void 0===e||e.blur()});const l=bt(!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 s(e){var t;o(e.target,"ant-select-dropdown")||null===(t=a.value)||void 0===t||t.blur()}window.addEventListener("wheel",s);const i=bt(),n=new Na(e.model),r=Qa(),c=We({get:()=>null!=r.value?r.value:void 0,set(e){r.value=e}}),d=We(()=>e.c.state.options&&e.c.state.options.length>0?e.c.state.options:n.options);return vt(()=>{window.removeEventListener("wheel",s)}),{ns:t,selectRef:a,open:l,rootRef:i,editorC:n,val2:c,options:d,onCloseDropdown:function(){l.value=!1,a.value&&a.value.blur()},onOpenDropdown:function(){l.value=!0},onChangeDropdown:function(){l.value=!l.value}}},render(){return at("div",{ref:"rootRef",class:this.ns.b()},[this.model.beforeText?at("div",{class:this.ns.e("before-text")},[this.model.beforeText]):null,at("div",{class:this.ns.e("content")},[at(Ct("a-select"),ct({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?at("div",{class:this.ns.e("after-text")},[this.model.afterText]):null])}}),Fo=Ma(xa.SELECT,()=>new Mo,zo),Uo=class{constructor(){t(this,"component","gct-form-span")}},Ao=/* @__PURE__ */ot({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=Ke("form-span"),{model:a,itemModel:l,c:o}=Ot(e);return o.value.loadDictionary(),{ns:t,val:We(()=>{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}=He(e.value);t.value&&oa.success($e("sys.copySuccess"))}}},render(){let e=this.val;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),at("div",{class:this.ns.b()},[at("span",{class:this.ns.e("info")},[e]),this.model.copy&&at("span",{class:this.ns.e("copy")},[at("i",{class:"iconfont icon-fuzhi primary-gct",onClick:this.handleClipboardKey},null)])])}}),Bo=Ma(xa.SPAN,()=>new Uo,Ao),No=class{constructor(){t(this,"component","gct-form-switch")}},Vo=/* @__PURE__ */ot({name:"GctFormSwitch",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},setup:()=>({ns:Ke("gct-form-switch"),val:Qa()}),render(){return at("div",{class:this.ns.b()},[at(Ct("a-switch"),ct({checked:this.val,"onUpdate:checked":e=>this.val=e,size:this.size},this.model.props||{}),null)])}}),Po=Ma(xa.SWITCH,()=>new No,Vo),$o=class{constructor(){t(this,"component","gct-form-text")}},Go=/* @__PURE__ */ot({name:"GctFormText",props:{model:{type:Object,required:!0},value:{type:String,default:""},size:{type:String}},emits:["update:value"],setup(e){const t=Ke("gct-form-text"),a=el(e.model.prefix||e.model.addonBefore,e.model.suffix||e.model.addonAfter);function l(){"string"==typeof a.value&&(a.value=a.value.trim())}return()=>at(Ct("a-input"),ct({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)}}),Ho=Ma(xa.TEXT,()=>new $o,Go),qo=/* @__PURE__ */ot({name:"GctFormEmpty",setup(){const e=Ke("gct-form-empty");return()=>at("span",{class:e.b()},null)}}),Ko=class{constructor(){t(this,"component","gct-form-empty")}},Yo=Ma(xa.EMPTY,()=>new Ko,qo),Wo=class{constructor(){t(this,"component","gct-form-textarea")}},Xo=/* @__PURE__ */ot({name:"GctFormTextarea",props:{model:{type:Object,required:!0},value:{type:String,default:null}},emits:["update:value"],setup(){const e=Ke("gct-form-textarea"),t=Qa();return{ns:e,val:t,handleBlur:()=>{"string"==typeof t.value&&(t.value=t.value.trim())}}},render(){return at(Ct("a-textarea"),ct({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)}}),Zo=Ma(xa.TEXTAREA,()=>new Wo,Xo);function Jo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var Qo=/* @__PURE__ */ot({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:Ke("gct-form-radio"),val:Qa()}),render(){let e;const t={...this.model.props||{},allowClear:!0,disabled:this.c.state.disabled};if(this.model.buttonMode){let e;return at(Qt,ct({class:[this.ns.b(),this.ns.m("button")],value:this.val,"onUpdate:value":e=>this.val=e,size:"small","button-style":"solid"},t),Jo(e=this.c.state.options.map(e=>at(Jt,{key:e.value,value:e.value},{default:()=>[e.label]})))?e:{default:()=>[e]})}return at(Qt,ct({class:[this.ns.b(),this.ns.m("radio")],value:this.val,"onUpdate:value":e=>this.val=e,size:this.size},t),Jo(e=this.c.state.options.map(e=>{var t;return at(Zt,{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?at("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")?at(Ct("assets-svg-icon"),{src:e.icon},null):e.icon]):null,at("span",{class:this.ns.e("item-label")},[e.label])]}})}))?e:{default:()=>[e]})}}),es=class{constructor(){t(this,"component","gct-form-radio")}},ts=Ma(xa.RADIO,()=>new es,Qo),as=/* @__PURE__ */ot({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:Ke("gct-form-info"),val:Qa()}),render(){let e=this.val||this.model.content;return this.val||!0!==this.isEmptyText||(e=_gct.store.getEmptyDisplay),at("div",{class:[this.ns.b(),this.size?this.ns.m(this.size):null]},[this.model.icon?at("span",{class:this.ns.e("icon")},[at("i",{class:`iconfont ${this.model.icon}`},null)]):null,at("span",{class:this.ns.e("content"),title:e},[e])])}}),ls=class{constructor(){t(this,"component","gct-form-info")}},os=Ma(xa.INFO,()=>new ls,as),ss=na,is=/* @__PURE__ */ot({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=Ke("gct-form-checkbox"),l=Qa(),o=We(()=>e.model.isDrag?(l.value||[]).filter(e=>e.checked).map(e=>e.value):l.value),s=We(()=>{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=>{s.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",s.value):t("update:value",a)},onDragEnd:e=>{const{newIndex:a,oldIndex:l}=e;s.value.splice(a,0,s.value.splice(l,1)[0]),t("update:value",s.value)},slots:{item:({element:e})=>at("div",{class:"drag-checkbox-item ks-row-middle"},[at("i",{class:"icon-drag iconfont mr4px cursor-move text-[#C3C3C3] primary-gct-hover"},null),at(Ht,{value:e.value,disabled:e.disabled},{default:()=>[e.label]})])},options:s}},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[Lt(at(qt,ct({value:this.checked,"onUpdate:value":e=>this.checked=e},e,{onChange:this.onChange}),{default:()=>[at(ss,{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)]}),[[Dt,this.model.isDrag]]),Lt(at(qt,ct({value:this.checked,"onUpdate:value":e=>this.checked=e,options:this.options},e,{onChange:this.onChange}),null),[[Dt,!this.model.isDrag]])]}}),ns=class{constructor(){t(this,"component","gct-form-checkbox")}},rs=Ma(xa.CHECKBOX,()=>new ns,is);function cs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var ds=[{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"}],us=/* @__PURE__ */ot({name:"GctFormModelSelect",props:{model:{type:Object,required:!0},value:{type:String}},setup(e){const t=Ke("form-model-select"),a=Qa(),l=Qa("category"),o=Qa("categorySelect"),s=Qa("modelName"),i=Qa("formId"),n=bt([]),r=bt({}),c=async()=>{return"system"===o.value?(n.value=await _api.apaas.report.getListSystemModels()||[],{[$e("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})||[],At(n.value,"group"));var t},{onFieldChange:d}=Yt.useInjectFormItemContext();ht(async()=>{a.value=a.value?a.value:void 0,l.value=l.value||"entity",o.value=o.value||l.value,r.value=await c()});const u=async e=>{l.value=e,a.value=null,i.value=void 0,r.value=await c()},p=e=>{const t=n.value.find(t=>t.key===e);t&&(s.value=t.name),"system"===o.value&&(l.value=t.modelCategory),d(),"system"!==o.value&&(r.value=At(n.value,"group"))};return()=>{let l,s;return at("div",{class:t.b()},[at(Ct("a-input-group"),{compact:!0},{default:()=>[at(Ct("a-select"),{value:o.value,"onUpdate:value":e=>o.value=e,class:t.e("class"),placeholder:"请选择",onSelect:u,disabled:e.model.disabled},cs(l=ds.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 at(Ct("a-select-option"),{key:e.value,value:e.value},cs(t=$e(e.label))?t:{default:()=>[t]})}))?l:{default:()=>[l]}),at(Ct("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},cs(s=Object.keys(r.value).map(e=>{const t=r.value[e].map(e=>at(Ct("a-select-option"),{key:e.key,value:e.key,label:e.name},{default:()=>[e.name]}));return at(Ct("a-select-opt-group"),{key:e,label:e},cs(t)?t:{default:()=>[t]})}))?s:{default:()=>[s]})]})])}}}),ps=class{constructor(){t(this,"component","gct-form-model-select")}},ms=Ma(xa.MODEL_SELECT,()=>new ps,us),hs=/* @__PURE__ */ot({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=Ke("form-multiple-choice"),l=bt(),o=We({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 at("div",{ref:"rootRef",class:this.ns.b()},[at(Ct("a-select"),ct({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)])}}),vs=class{constructor(){t(this,"component","GctFormMultipleChoice")}},gs=Ma(xa.MULTIPLE_CHOICE,()=>new vs,hs),fs=/* @__PURE__ */ot({name:"GctFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=Ke("form-table"),a=Qa();return()=>at("div",{class:t.b()},[at(Ct("gct-table"),ct({data:a.value,model:e.model.tableModel,count:a.value.length.toString()},e.model.props||{}),null)])}}),ys=class{constructor(){t(this,"component","gct-form-table")}},bs=Ma(xa.TABLE,()=>new ys,fs),ws=/* @__PURE__ */ot({name:"GctSelectFormTable",props:{model:{type:Object,required:!0},value:{type:Array,default:()=>[]}},setup(e){const t=Ke("select-form-table"),a=bt(),l=bt(""),o=Qa(),s=We(()=>({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 i(){l.value?(l.value=l.value.trim(),l.value&&a.value&&a.value.reload({query:l.value})):a.value&&a.value.reload()}return()=>at("div",{class:t.b()},[at("div",{class:t.e("search")},[at(Ct("a-input-search"),{placeholder:"搜索数据集名称",value:l.value,"onUpdate:value":e=>l.value=e,onSearch:i},null)]),at("div",{class:t.e("table")},[at(Ct("gct-table"),ct({ref:a,"row-selection":s.value,data:o.value,model:e.model.tableModel,count:o.value.length.toString()},e.model.props||{}),null)])])}}),_s=class{constructor(){t(this,"component","gct-select-form-table")}},xs=Ma(xa.SELECT_TABLE,()=>new _s,ws),Cs={install(e){e.use(to).use(oo).use(Jl).use(no).use(uo).use(ho).use(_o).use(yo).use(ko).use(Eo).use(Io).use(Ro).use(Fo).use(Bo).use(Po).use(Ho).use(Zo).use(ts).use(os).use(rs).use(no).use(ms).use(gs).use(bs).use(xs).use(Yl).use(Yo)}},ks=/* @__PURE__ */ot({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=Ke("gct-edit-form");console.debug("GctEditForm props:",e);const o=e.controller||Ba(()=>new Aa(e.model)),s=bt(),i=async e=>{try{await s.value.formRef.validateFields([e])}catch(t){return console.error(t),!1}return!0};o.validate=async()=>{try{await s.value.formRef.validate()}catch(e){return console.error(e),!1}return!0},o.validateItem=i;const{context:n,params:r}=Ot(e);return Tt(n,()=>{Object.assign(o.context,e.context),o.state.isNew=!o.context.id},{immediate:!0,deep:!0}),Tt(r,()=>{Object.assign(o.params,e.params)},{deep:!0}),Tt(()=>e.count,()=>{o.state.count+=1}),Tt(()=>e.data,()=>{Object.assign(o.state.data,e.data)},{deep:!0}),!1!==e.adaptModal&&qe(async()=>{try{await s.value.formRef.validate();const e=await o.save();if(e)return{ok:!0,data:[Ft(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=>{i(e)}),a({c:o}),()=>{let t=null;return(o.state.isNew||0==o.state.isNew&&o.state.loaded)&&(t=at(Ct("gct-form"),{class:"h-full",ref:s,c:o,model:e.model,context:e.context},null)),at("div",{class:l.b()},[t])}}}),Ss={install(e){e.use(Cs),e.component($l.name,$l),e.component(Pl.name,Pl),e.component(Hl.name,Hl),e.component(ks.name,ks),e.use(Vl)}},Os=class{constructor(){t(this,"formData",{}),t(this,"items",[]),t(this,"page",1),t(this,"total",0),t(this,"size",20)}},Es=class{constructor(){t(this,"keepalive",!0),t(this,"visible",!0)}},Ds=class extends Es{constructor(...e){super(...e),t(this,"error",!1),t(this,"errMessage",""),t(this,"readonly",!1),t(this,"disabled",!1)}},Ts=class{constructor(){t(this,"hover",!1),t(this,"active",!1),t(this,"deleted",!1)}},Is=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 Es}async init(){}async destroy(){}},js=class extends Is{},Ls=class extends Is{createState(){return new Ds}active(){return this.row.active()}unActive(){return this.row.unActive()}},Rs=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 Ms(e,t,a){return{install(l){e&&t&&_gct.register.tableEditor.register(De.PREFIX+e,t),a&&l.component(a.name||a.__name,a)}}}var zs=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 Rs),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 Ls(this,e);break;case"actions":t=new js(this,e);break;default:t=new Is(this,e)}return this.fields.push(e.name),t.state=yt(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 Ts}},Fs=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(De.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 Os}async initControllers(e){const t=e.map(e=>{const t=e[this.model.key];if(this.row[t])return;const a=new zs(this,this.model,e);return a.state=yt(a.state),a.data=yt(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(Ut(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){Vt(e.total)||(this.state.total=e.total),Vt(e.size)||(this.state.size=e.size),Vt(e.page)||(this.state.page=e.page)}};function Us(e){const t=e();return t.state=yt(t.state),vt(()=>t.destroy()),t}function As(e,{pagination:t=!0,triggerByWindowSize:a=!0}={}){const l=bt(0);let o=[],s=null,i=null;const n=()=>{var a,i;if(!e)return;s&&(clearTimeout(s),s=null);const r=Et(e).$el??Et(e),c=r.getBoundingClientRect().height??0,d=Math.max((null===(a=r.querySelector(".ant-table-thead"))||void 0===a?void 0:a.getBoundingClientRect().height)??0,48),u=t?Math.max((null===(i=r.querySelector(".ant-table-pagination"))||void 0===i?void 0:i.getBoundingClientRect().height)??0,24)+16:0;l.value=c-d-u,o.push(l.value),o.length>=3&&o[o.length-3]===o[o.length-1]&&o[o.length-2]===o[o.length-1]?o=[]:s=setTimeout(()=>{n()},100)};return a&&window.addEventListener("resize",n),Tt(e,async t=>{await dt(),t&&(n(),(()=>{i&&(i.disconnect(),i=null);const t=Et(e).$el??Et(e);t&&"undefined"!=typeof ResizeObserver&&(i=new ResizeObserver(()=>{s&&clearTimeout(s),s=setTimeout(()=>{n()},100)}),i.observe(t))})())},{immediate:!0}),vt(()=>{window.removeEventListener("resize",n),i&&(i.disconnect(),i=null),s&&(clearTimeout(s),s=null)}),{scrollHeight:l,calcScrollHeight:n}}var Bs=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}},Ns=class{constructor(){t(this,"component","gct-table-span")}},Vs=/* @__PURE__ */ot({name:"GctTableSpan",props:{c:{type:Object,required:!0},model:{type:Object,required:!0},value:{type:String,default:""}},setup:()=>({ns:Ke("table-span")}),render(){return at("div",{class:this.ns.b()},[this.model.icon?at("span",{class:this.ns.e("icon")},[at("i",{class:`iconfont ${"string"==typeof this.model.icon?this.model.icon:this.model.icon(this.c.row.data)}`},null)]):null,at("span",{class:this.ns.e("text")},[this.value])])}}),Ps=Ms(xa.SPAN,()=>new Ns,Vs),$s=class{constructor(){t(this,"component","gct-table-text")}},Gs=/* @__PURE__ */ot({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=Ke("table-text"),a=el(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?at("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):at(Ct("a-input"),ct({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)}}),Hs=Ms(xa.TEXT,()=>new $s,Gs),qs=class{constructor(){t(this,"component","gct-table-date")}},Ks=/* @__PURE__ */ot({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:Ke("table-date"),val:Qa()}),render(){return!1===this.isEdit?at("div",{class:[this.ns.b(),this.ns.e("info")]},[this.c.value]):at(Ct("a-date-picker"),ct({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)}}),Ys=Ms(xa.DATE,()=>new qs,Ks),Ws={install(e){e.use(Ps).use(Hs).use(Ys)}};function Xs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!rt(e)}var Zs=/* @__PURE__ */ot({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=Ke("gct-table"),l=bt({}),o=bt(),s=bt(),i=bt();let n=null,r=null;const c=Us(()=>new Fs(e.model));c.evt.on("change",async(e,a,l,o)=>{t("rowChange",Ft(e),a,l,o)}),!0===c.model.local&&Tt(()=>e.count,()=>{c.setData(Ft(e.data))}),!0!==c.model.local&&!1!==c.model.autoLoad&&c.load();const d=e=>{if(!e||e===o.value)return null;return e.getAttribute("data-row-key")||d(e.parentElement)},u=e=>{const t=d(e.target);if(t){const e=c.row[t];n&&(n.state.hover=!1),e.state.hover=!0,n=e}},p=e=>{!d(e.target)&&n&&(n.state.hover=!1,n=null)},m=e=>{const t=d(e.target);if(t){const e=c.row[t];r&&r.unActive(),e.active(),r=e}else r&&(r.unActive(),r=null)},h=()=>{r&&(r.unActive(),r=null)};ht(()=>{o.value&&(o.value.addEventListener("mouseover",u,{capture:!0}),o.value.addEventListener("mouseout",u,{capture:!0}),o.value.addEventListener("mouseleave",p,{capture:!0}),o.value.addEventListener("click",m,{capture:!0})),window.addEventListener("click",h,{capture:!0})}),vt(()=>{o.value&&(o.value.removeEventListener("mouseover",u,{capture:!0}),o.value.removeEventListener("mouseout",u,{capture:!0}),o.value.removeEventListener("mouseleave",p,{capture:!0}),o.value.removeEventListener("click",m,{capture:!0})),window.removeEventListener("click",h,{capture:!0})});const v=We(()=>{var t;if(Vt(e.model.pagination))return!1;const a=zt(e.model.pagination);Ut(a,{pageSizeOptions:[10,20,30,40,50],showSizeChanger:!0,showTotal:!0});const l=!0===a.showTotal?e=>$e("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:c.state.total,current:c.state.page,pageSize:c.state.size,pageSizeOptions:o,showSizeChanger:a.showSizeChanger,showTotal:l}}),{scrollHeight:g}=As(o,{pagination:!!v.value});return{ns:a,c:c,loadingState:l,elRef:o,formRef:s,tableRef:i,scrollHeight:g,pagination:v,isEdit:We(()=>c.model.columns.some(e=>"edit"===e.type)),handleTableChange:(e,t,a)=>{c.updatePagination({page:e.current,size:e.pageSize}),c.reload()},mouseOver:u,mouseOut:e=>{!d(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,s=c.row[o];if(s){const l=s.item[e];l&&(l.state.error=!t,a&&a.length>0?l.state.errMessage=a[0]:l.state.errMessage="")}}},validate:()=>s.value.validate(),reload:e=>c.load(e)}},render(){return at("div",{ref:"elRef",class:this.ns.b(),onMouseover:this.mouseOver,onMouseout:this.mouseOut},[at(Ct("a-form"),{ref:"formRef",model:this.c.state.formData,onValidate:this.onValidate},{default:()=>[at(Ct("a-table"),ct({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 at("span",{title:e,class:[this.ns.e("table-header"),this.ns.is("required",t)]},[at("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:Bt(t)?t.toString():t;const s=e;if(s.customRender)return s.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],s=Ct(o.component),i=l.item[e.name],n=!0===l.state.hover||!0===i.state.error||!0===l.state.active||"all"===this.c.model.rowEditMode;return at(Ct("a-form-item"),{name:`${e.name}___${t}`,class:[this.ns.b("table-item"),this.ns.bm("table-item","edit")],rules:i.model.rules||[]},Xs(a=it(s,{key:i.model.name,c:i,model:i.model.editor,readonly:i.state.readonly,disabled:i.state.disabled,value:i.value,itemModel:i.model,data:l.data,keepalive:i.state.keepalive,visible:i.state.visible,isEdit:n,"onUpdate:value":e=>{i.value=e}}))?a:{default:()=>[a]})}}if("actions"===e.type){const t=e;return at("div",{class:this.ns.b("table-actions")},[t.actions.filter(e=>!e.hidden||!e.hidden(a)).map(e=>{if("divider"===e.mode)return at(Ct("a-divider"),{type:"vertical"},null);const s=`${e.type}___${e.tag}___${a[this.c.model.key]}`,i=at(Ct("a-button"),ct({class:this.ns.b("table-action-item"),type:e.type,size:"small",loading:!0===this.loadingState[s],onClick:async i=>{if(!e.confirm)if(i.stopPropagation(),e.action)if(l(e.action)||o(e.action)){this.loadingState[s]=!0;try{await e.action(a)}catch(n){console.log(n)}finally{this.loadingState[s]=!1}}else e.action(a);else t.action(e.tag,a)}},e.props),{default:()=>[e.text]});return e.confirm?at(Ct("a-popconfirm"),ct({onConfirm:async()=>{if(e.action)if(l(e.action)||o(e.action)){this.loadingState[s]=!0;try{await e.action(a)}catch(i){console.log(i)}finally{this.loadingState[s]=!1}}else e.action(a);else t.action(e.tag,a)}},e.confirm),Xs(i)?i:{default:()=>[i]}):i})])}return"link"===e.type?at("a",{class:this.ns.e("table-link"),onClick:e=>{e.stopPropagation(),s.click&&s.click(a)}},[t]):t}})]})])}}),Js={install(e){e.component(Zs.name,Zs)}},Qs={install(e){e.use(Js)}},ei={install(e){e.use(Ws),e.use(Qs)}},ti=/* @__PURE__ */de(/* @__PURE__ */ot({__name:"category-modal",props:{data:{default:()=>({})},module:{}},setup(e){const t=Ke("category-modal"),a=yt({...e.data}),l=bt();return qe(async()=>(await l.value.validate(),{ok:!0,data:[$t(a,e=>void 0!==e)]})),(e,o)=>{const s=Ct("a-input"),i=Ct("a-form-item"),n=Ct("a-form");return gt(),Je("div",{class:ut(Et(t).b())},[at(n,{ref_key:"formRef",ref:l,model:a,"label-col":{span:6},"wrapper-col":{span:16},autocomplete:"off"},{default:jt(()=>[at(i,{label:`${Et($e)("sys.category")}${Et($e)("sys.name")}`,name:"name",rules:[{required:!0}]},{default:jt(()=>[at(s,{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"]]),ai=$e,li=Fe(function(e){const t=/* @__PURE__ */new Map,a=bt(),l=[Le.EDHR,Ee.INSPECTION,Ee.RELEASE,Le.ONLINE_FORM].includes(e.module);async function o(t){const a=!!t.data.id,l=await _gct.openUtil.modal(ti,{data:t.data,module:e.module},{title:a?`${ai("sys.edit")}${ai("sys.category")}`:ai("sys.new")+ai("sys.category"),width:640,height:360,okText:ai("sys.okText"),showFooter:!0});if(null==l?void 0:l.ok)return null==l?void 0:l.data[0]}async function s(){const o=l?await Ne.getCategoryList({moduleType:e.module})||[]:await _api.apaas.category.getListComplete({})||[];a.value=o,t.clear(),ae(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 s()),a?{parentId:null==a?void 0:a.parentId}:{}},load:s,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 s())},deleteCategoryAPI:async function(e,t,a){return new Promise(l=>{Xt.confirm({title:ai("sys.sureToDeleteCategoryWithName",{name:`${e.name||e.title}`}),icon:at(pa),content:a||"",okText:ai("sys.okText"),cancelText:ai("sys.cancel"),async onOk(){try{t?await t({id:e.key||e.id}):await _api.apaas.category.delete({ids:e.key||e.id}),oa.success(ai("sys.delSuccess")),await s(),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 s()},isFormDesign:l}}),oi=["title"],si=/* @__PURE__ */ot({__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:()=>[Oe.Insert,Oe.Update,Oe.Delete]}},emits:["update:value","changeCategory","changeValue"],setup(e,{expose:t,emit:a}){const l="edit",o="delete",s=$e,i=Ke("category-sider"),n=e,r=a,c=We({get:()=>n.value?[n.value]:void 0,set(e){r("update:value",null==e?void 0:e[0])}}),d=bt([]),u=bt(),p=bt(),{load:m,createCategory:h,editCategory:v,deleteCategoryAPI:g,dragCategory:f,categoryTreeData:y,isFormDesign:b}=li({module:n.module}),w=bt(""),_=(e,t)=>{w.value=e?t:""},x=(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&&!d.value.includes(t.categoryId)&&d.value.push(t.categoryId),r("changeValue",t.dataRef)))},C=We(()=>X(y.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}));ht(async()=>{var e;await m(),n.value||(r("update:value",null===(e=C.value[0])||void 0===e?void 0:e.key),C.value[0]&&r("changeValue",C.value[0]))}),Tt(p,()=>{var e;null===(e=p.value)||void 0===e||e.expandAll()},{immediate:!0});const k=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})},S=async()=>{const e=await h();_(!1,""),e.parentId&&d.value.push(e.parentId),c.value=C.value.length?[C.value[0].key]:[],r("changeValue",C.value[0])};return t({getCategoryData:()=>C.value}),(t,a)=>{const m=Ct("a-button"),h=Ct("a-input"),f=Ct("ellipsis-outlined"),y=Ct("a-menu-item"),b=Ct("a-menu"),O=Ct("a-dropdown");return gt(),Je("div",{class:ut([Et(i).b()])},[e.hasTitle||!e.readonly?(gt(),Je("div",{key:0,class:ut([Et(i).e("title-container")])},[Qe("span",{class:ut([Et(i).e("title")])},kt(e.siderTitle),3),!e.readonly&&e.hasPerBtns.includes(Et(Oe).Insert)?(gt(),Xe(m,{key:0,type:"link",class:ut([Et(i).e("add")]),onClick:S},{default:jt(()=>[a[3]||(a[3]=Qe("i",{class:"iconfont icon-chuangjian"},null,-1)),tt(" "+kt(Et(s)("sys.newCategory")),1)]),_:1},8,["class"])):Ze("",!0)],2)):Ze("",!0),Qe("div",{class:ut([Et(i).e("search-container")])},[at(h,{value:u.value,"onUpdate:value":a[0]||(a[0]=e=>u.value=e),class:ut([Et(i).e("search-input")]),placeholder:Et($e)("sys.onlineForm.searchCategory"),"allow-clear":""},{prefix:jt(()=>[...a[4]||(a[4]=[Qe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","class","placeholder"])],2),Qe("div",{class:ut([Et(i).e("tree-container")])},[C.value.length?(gt(),Xe(Et(M),{key:0,ref_key:"treeExRef",ref:p,"selected-keys":c.value,"onUpdate:selectedKeys":a[1]||(a[1]=e=>c.value=e),"expanded-keys":d.value,"onUpdate:expandedKeys":a[2]||(a[2]=e=>d.value=e),class:ut([Et(i).e("tree"),e.draggable&&"draggable-tree"]),draggable:e.draggable,data:C.value,"last-selection-locked":"",filter:u.value?u.value.trim():"","ignore-case":e.ignoreCase,onDrop:k,onSelect:x},{title:jt(({node:t})=>[Qe("div",{class:ut([Et(i).b("tree-node"),Et(i).is("highlight",w.value===t.key)])},[Qe("span",{class:ut([Et(i).be("tree-node","title")]),title:t.title},kt(t.title),11,oi),e.readonly||!e.hasPerBtns.includes(Et(Oe).Update)&&!e.hasPerBtns.includes(Et(Oe).Delete)?Ze("",!0):(gt(),Xe(O,{key:0,class:ut([Et(i).be("tree-node","more")]),onVisibleChange:e=>{return a=e,l=t.key,void _(a,l);var a,l}},{overlay:jt(()=>[at(b,{style:{width:"102px"},onClick:e=>((e,t)=>{(async(e,t)=>{switch(t){case l:await v(e),_(!1,e.key);break;case o:{const t=c.value[0],a=await g(e,n.customDelFunc,n.customDelTips);_(!1,e.key),a&&t===e.key&&(c.value=C.value.length?[C.value[0].key]:[],r("changeValue",C.value[0]));break}}})(e,String(t.key))})(t,e)},{default:jt(()=>[e.hasPerBtns.includes(Et(Oe).Update)?(gt(),Xe(y,{key:l},{default:jt(()=>[tt(kt(Et(s)("sys.component.dataConnection.rename")),1)]),_:1})):Ze("",!0),e.hasPerBtns.includes(Et(Oe).Delete)?(gt(),Xe(y,{key:o},{default:jt(()=>[tt(kt(Et(s)("sys.delText")),1)]),_:1})):Ze("",!0)]),_:1},8,["onClick"])]),default:jt(()=>[at(f)]),_:2},1032,["class","onVisibleChange"]))],2)]),_:1},8,["selected-keys","expanded-keys","class","draggable","data","filter","ignore-case"])):Ze("",!0)],2)],2)}}}),ii=/* @__PURE__ */de(si,[["__scopeId","data-v-5af8c1ba"]]),ni=lt(()=>import("./monaco-editor-BTqXEIZI.js")),ri=/* @__PURE__ */de(/* @__PURE__ */ot({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=Ct("color-picker");return gt(),Xe(o,{preset:Et(Pe),color:e.value,"onUpdate:color":l},{icon:jt(()=>[Qe("div",{class:"color-picker-icon",style:pt({backgroundColor:e.value})},null,4)]),_:1},8,["preset","color"])}}}),[["__scopeId","data-v-7b102f87"]]),ci={FIRST:"first",BEFORE:"before",AFTER:"after",LAST:"last"},di=/* @__PURE__ */ot({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=Ke("dnd-item"),o=bt(null),s=bt(!1),i=nt("vue3-dnd-drop-line-state"),n=bt(-1),[r,c,d]=ne({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]=ee({accept:a.group,canDrop:()=>!1});t(o)}else{const[t,l]=ee({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 c=0;if("vertical"===a.direction){const{top:e,height:a}=t,{y:l}=n;if(c=l-e-a/2,Math.abs(c)<r)return;s.value=c<0}else if("horizontal"===a.direction){const{left:e,width:a}=t,{x:l}=n;if(c=l-e-a/2,Math.abs(c)<r)return;s.value=c<0}i.activeKey=e.data.id,i.isBeforeHover=s.value}else i.activeKey=""},drop:(l,o)=>{if(i.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:Ft(e.config),success:!1}:(u(s.value?ci.BEFORE:ci.AFTER,t),{group:a.group,success:!0,cfg:Ft(e.config),data:t})}}}});l(o)}function u(e,a){t("drop",e,a)}return a.handle||!1===a.isDrag||c(o),d(o),{ns:l,rootRef:o,posState:n,collect:r,onDrop:u,drag:c}},render(){var e,t;const a={index:this.index,data:this.data,drag:this.drag};return at("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)])}}),ui=/* @__PURE__ */ot({name:"GctDndDropLine",props:{config:{type:Object,required:!0},active:{type:Boolean,default:!1}},emits:["drop"],setup(e,{emit:t}){const{config:a}=e,l=Ke("dnd-drop-line"),o=bt(null),[s,i]=ee({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===s.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:Ft(e.config),success:!1}:(t("drop",o),{group:a.group,success:!0,cfg:Ft(e.config),data:o})}}}});return!1!==a.isDrop&&i(o),{ns:l,rootRef:o,collect:s}},render(){return at("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)]},[at("div",{class:this.ns.e("line")},null)])}}),pi=/* @__PURE__ */ot({name:"GctDndContainer",props:{config:{type:Object,default:()=>({group:"GctDnd",insertPos:ci.LAST})},items:{type:Array,default:()=>[]}},emits:["update:items"],setup(e,{emit:t}){const{config:a}=e,l=Ke("dnd-container"),o=bt(null),s=yt({activeKey:"",isBeforeHover:!1});ft("vue3-dnd-drop-line-state",s);const i=St(e.items),[n,r]=ee({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:Ft(e.config)}:(-1===i.value.findIndex(e=>e.id===l.data.id)&&c(e.config.insertPos,o),t("update:items",i.value),{group:a.group,success:!0,cfg:Ft(e.config),data:o})}}}});function c(e,a,l=-1){if(a){if(e===ci.FIRST)i.value.unshift(a);else if(e===ci.LAST)i.value.push(a);else{if(-1===l)return void console.error("insertIndex is required");const t=i.value.findIndex(e=>e.id===a.id);if(t===l)return;-1!==t&&l<t&&i.value.splice(t,1),e===ci.AFTER?i.value.splice(l+1,0,a):i.value.splice(l,0,a),-1!==t&&l>t&&i.value.splice(t,1)}t("update:items",i.value)}else console.error("data is required")}return!1!==a.isDrop&&r(o),Tt(n,()=>{!0!==n.value.isOver&&(s.activeKey="")}),{ns:l,rootRef:o,dropLineState:s,collect:n,onDrop:c}},render(){var e,t,a,l;const o=this.items[this.items.length-1];return at("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(at(ui,{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(ci.BEFORE,e,t)},null)),l.push(at(di,{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?at(ui,{key:o.id+"___last-line",config:this.config,active:this.dropLineState.activeKey===o.id&&!1===this.dropLineState.isBeforeHover,onDrop:e=>this.onDrop(ci.AFTER,e,this.items.length-1)},null):null,null===(a=(l=this.$slots).after)||void 0===a?void 0:a.call(l)])}}),mi={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},hi={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:()=>({})}},vi=ot({name:"CropperImage",props:hi,emits:["cropend","ready","cropendError"],setup(t,{attrs:a,emit:l}){const o=bt(),s=bt(),i=bt(!1),n=Ke("cropper-image"),r=Y(p,80),c=We(()=>({height:t.height,width:t.width,maxWidth:"100%",...t.imageStyle})),d=We(()=>[n.b(),a.class,{[n.m("circled")]:t.circled}]),u=We(()=>({height:`${t.height}`.replace(/px/,"")+"px",width:`${t.width}`.replace(/px/,"")+"px"}));function p(){t.realTimePreview&&m()}function m(){if(!s.value)return;let e=s.value.getData();(t.circled?function(){const e=s.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}():s.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 ht(async function(){const a=Et(o);if(!a)return;const[{default:n}]=await Promise.all([import("./cropper-DK_hFgpO.js").then(t=>/* @__PURE__ */e(t.default,1)),Promise.resolve({ })]);s.value=new n(a,{...mi,ready:()=>{i.value=!0,p(),l("ready",s.value)},crop(){r()},zoom(){r()},cropmove(){r()},...t.options})}),vt(()=>{var e;null===(e=s.value)||void 0===e||e.destroy()}),{getClass:d,imgElRef:o,getWrapperStyle:u,getImageStyle:c,isReady:i,croppered:m}}}),gi=["src","alt","crossorigin"],fi=/* @__PURE__ */de(vi,[["render",function(e,t,a,l,o,s){return gt(),Je("div",{class:ut(e.getClass),style:pt(e.getWrapperStyle)},[Lt(Qe("img",{ref:"imgElRef",src:e.src,alt:e.alt,crossorigin:e.crossorigin,style:pt(e.getImageStyle)},null,12,gi),[[Dt,e.isReady]])],6)}]]),yi={key:1,class:"empty"},bi={class:"flex flex-col justify-center items-center"},wi=["title"],_i=/* @__PURE__ */ot({__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=bt(a.src||""),s=bt(a.src||""),i=bt(""),r=bt();let c=1,d=1,u="";const p=We(()=>a.accept.map(e=>`image/${e}`).join(",")),m=Ke("cropper-free"),[h,{closeModal:v,setModalProps:g}]=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 oa.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!p.value.includes(e.type))return oa.warning(`【${e.name}】${$e("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 b(e){r.value=e}function w(e,t){var a,l;"scaleX"===e&&(c=t=-1===c?1:-1),"scaleY"===e&&(d=t=-1===d?1:-1),null===(a=r.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function _(){const e=a.uploadApi;if(e&&Nt(e)){const t=Ae(i.value);try{g({confirmLoading:!0});const a=await e({name:"file",file:t,filename:u});l("uploadSuccess",{source:i.value,data:a.data}),v()}finally{g({confirmLoading:!1})}}}function x(){o.value="",setTimeout(()=>{o.value=s.value||""})}return Tt(()=>a.src,e=>{o.value=e||"",s.value=e||""}),(t,a)=>{const l=Ct("PlusOutlined"),s=Ct("a-button");return gt(),Xe(Et(q),ct(t.$attrs,{title:e.title,width:"640px","min-height":"510","can-fullscreen":!1,"ok-text":Et($e)("sys.okText"),onRegister:Et(h),onOk:_,onCancel:x}),{default:jt(()=>[Qe("div",{class:ut(Et(m).b())},[Qe("div",{class:ut(Et(m).b("left"))},[Qe("div",{class:ut(Et(m).b("cropper"))},[o.value?(gt(),Xe(fi,{key:0,src:o.value,height:"304px",width:"538px",options:{aspectRatio:e.aspectRatio??200/120},onCropend:y,onReady:b},null,8,["src","options"])):(gt(),Je("div",yi,[at(Et(la),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":f},{default:jt(()=>[Qe("div",bi,[at(l),a[14]||(a[14]=Qe("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Qe("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),o.value?(gt(),Je("div",{key:0,class:ut(Et(m).b("toolbar"))},[at(Et(la),{"file-list":[],accept:p.value,"before-upload":f},{default:jt(()=>[e.uploadText?(gt(),Xe(s,{key:0,type:"link",size:"small",style:{padding:"0"}},{default:jt(()=>[tt(kt(e.uploadText),1)]),_:1})):(gt(),Je("a",{key:1,title:Et($e)("sys.reUpload"),placement:"bottom"},kt(Et($e)("sys.reUpload")),9,wi))]),_:1},8,["accept"]),at(Et(ea),null,{default:jt(()=>[at(Et(aa),{title:Et($e)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Mt(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>w("zoom",.1))},{icon:jt(()=>[...a[16]||(a[16]=[Qe("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Mt(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>w("zoom",-.1))},{icon:jt(()=>[...a[17]||(a[17]=[Qe("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Mt(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>w("rotate",-45))},{icon:jt(()=>[...a[18]||(a[18]=[Qe("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Mt(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>w("rotate",45))},{icon:jt(()=>[...a[19]||(a[19]=[Qe("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Mt(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>w("scaleX"))},{icon:jt(()=>[...a[20]||(a[20]=[Qe("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Mt(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>w("scaleY"))},{icon:jt(()=>[...a[21]||(a[21]=[Qe("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:jt(()=>[at(s,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Mt(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>w("reset"))},{icon:jt(()=>[at(Et(va))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Ze("",!0)],2)],2)]),_:1},16,["title","ok-text","onRegister"])}}}),xi=/* @__PURE__ */de(_i,[["__scopeId","data-v-da6428d3"]]),Ci={key:1,class:"empty"},ki={class:"flex flex-col justify-center items-center"},Si=["title"],Oi={class:"flex-col"},Ei={class:"flex-col"},Di={class:"flex-col text-center"},Ti=/* @__PURE__ */ot({__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=bt(a.src||""),s=bt(""),i=bt();let r=1,c=1,d="";const u=Ke("cropper-am"),[p,{closeModal:m,setModalProps:h}]=n();function v(e){if(e.size/1024/1024>4)return oa.warn(`【${e.name}】文件大小不能超过 4MB`),!1;if(!["image/jpg","image/jpeg","image/png","image/bmp"].includes(e.type))return oa.warning(`【${e.name}】${$e("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)??"",d=e.name},!1}function g({imgBase64:e}){s.value=e}function f(e){i.value=e}function y(e,t){var a,l;"scaleX"===e&&(r=t=-1===r?1:-1),"scaleY"===e&&(c=t=-1===c?1:-1),null===(a=i.value)||void 0===a||null===(l=a[e])||void 0===l||l.call(a,t)}async function b(){const e=a.uploadApi;if(e&&Nt(e)){const t=Ae(s.value);try{h({confirmLoading:!0});const a=await e({name:"file",file:t,filename:d});l("uploadSuccess",{source:s.value,data:a.data.data}),m()}finally{h({confirmLoading:!1})}}}return(t,a)=>{const l=Ct("PlusOutlined"),i=Ct("a-button"),n=Ct("Avatar");return gt(),Xe(Et(q),ct(t.$attrs,{title:Et($e)("sys.component.cropper.modalTitle"),width:"600px","min-height":"570","can-fullscreen":!1,"ok-text":Et($e)("sys.okText"),onRegister:Et(p),onOk:b}),{default:jt(()=>[Qe("div",{class:ut(Et(u).b())},[Qe("div",{class:ut(Et(u).b("left"))},[Qe("div",{class:ut(Et(u).b("cropper"))},[o.value?(gt(),Xe(fi,{key:0,src:o.value,height:"360px",width:"360px",circled:e.circled,onCropend:g,onReady:f},null,8,["src","circled"])):Ze("",!0),e.sourceUrlValue||"/404.png"!==o.value?Ze("",!0):(gt(),Je("div",Ci,[at(Et(la),{"list-type":"picture-card","file-list":[],accept:"image/*","before-upload":v},{default:jt(()=>[Qe("div",ki,[at(l),a[14]||(a[14]=Qe("div",{class:"mt12px"},"点击或将图片拖拽到这里上传",-1)),a[15]||(a[15]=Qe("div",{class:"color-[#8B8B8B] mt8px"}," 仅支持JPG、PNG、JPEG、BMP格式,文件小于4M ",-1))])]),_:1})]))],2),e.sourceUrlValue||"/404.png"!==o.value?(gt(),Je("div",{key:0,class:ut(Et(u).b("toolbar"))},[at(Et(la),{"file-list":[],accept:"image/*","before-upload":v},{default:jt(()=>[Qe("a",{title:Et($e)("sys.reUpload"),placement:"bottom"},kt(Et($e)("sys.reUpload")),9,Si)]),_:1}),at(Et(ea),null,{default:jt(()=>[at(Et(aa),{title:Et($e)("sys.component.cropper.btn_zoom_in"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[0]||(a[0]=Mt(()=>{},["prevent"])),onClick:a[1]||(a[1]=e=>y("zoom",.1))},{icon:jt(()=>[...a[16]||(a[16]=[Qe("i",{class:"iconfont icon-fangda_zoom-in"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_zoom_out"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[2]||(a[2]=Mt(()=>{},["prevent"])),onClick:a[3]||(a[3]=e=>y("zoom",-.1))},{icon:jt(()=>[...a[17]||(a[17]=[Qe("i",{class:"iconfont icon-a-suoxiao_zoom-out1"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_rotate_left"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[4]||(a[4]=Mt(()=>{},["prevent"])),onClick:a[5]||(a[5]=e=>y("rotate",-45))},{icon:jt(()=>[...a[18]||(a[18]=[Qe("i",{class:"iconfont icon-xuanzhuan_rotate"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_rotate_right"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[6]||(a[6]=Mt(()=>{},["prevent"])),onClick:a[7]||(a[7]=e=>y("rotate",45))},{icon:jt(()=>[...a[19]||(a[19]=[Qe("i",{class:"iconfont icon-xuanzhuan_2"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_scale_x"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[8]||(a[8]=Mt(()=>{},["prevent"])),onClick:a[9]||(a[9]=e=>y("scaleX"))},{icon:jt(()=>[...a[20]||(a[20]=[Qe("i",{class:"iconfont icon-shuipingfanzhuan_flip-horizontally"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_scale_y"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[10]||(a[10]=Mt(()=>{},["prevent"])),onClick:a[11]||(a[11]=e=>y("scaleY"))},{icon:jt(()=>[...a[21]||(a[21]=[Qe("i",{class:"iconfont icon-chuizhifanzhuan_flip-vertically"},null,-1)])]),_:1},8,["disabled"])]),_:1},8,["title"]),at(Et(aa),{title:Et($e)("sys.component.cropper.btn_reset"),placement:"bottom"},{default:jt(()=>[at(i,{size:"small",disabled:!o.value,onMousedown:a[12]||(a[12]=Mt(()=>{},["prevent"])),onClick:a[13]||(a[13]=e=>y("reset"))},{icon:jt(()=>[at(Et(va))]),_:1},8,["disabled"])]),_:1},8,["title"])]),_:1})],2)):Ze("",!0)],2),Qe("div",{class:ut([Et(u).b("right"),"text-center"])},[a[22]||(a[22]=tt(" 预览 ",-1)),Qe("div",{class:ut(Et(u).b("group"))},[Qe("div",Oi,[at(n,{src:s.value,size:102},null,8,["src"])]),Qe("div",Ei,[at(n,{src:s.value,size:78},null,8,["src"])]),Qe("div",Di,[at(n,{src:s.value,size:28},null,8,["src"])])],2)],2)],2),a[23]||(a[23]=Qe("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"])}}}),Ii=/* @__PURE__ */de(Ti,[["__scopeId","data-v-f1134678"]]),ji=["src"],Li=/* @__PURE__ */ot({__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,s=bt("/extras-assets/images/default_avatar.png"),i=bt(Ge(l.value)||""),n=bt(l.value||""),r=Ke("cropper-avatar"),[c,{openModal:d,closeModal:p}]=u(),m=We(()=>[r.b()]),h=We(()=>`${l.width}`.replace(/px/,"")+"px"),v=We(()=>parseInt(`${l.width}`.replace(/px/,""))/2+"px"),g=We(()=>({width:Et(h)})),f=We(()=>({width:Et(h),height:Et(h)}));function y({source:e,data:t}){i.value=Ge(t),n.value=t,o("change",{source:e,data:t})}It(()=>{i.value=Ge(l.value)||"",n.value=l.value||""}),Tt(()=>n.value,e=>{o("update:value",e)});const b=()=>{d()};return t({openModal:d.bind(null,!0),closeModal:p}),(t,a)=>{const l=Ct("a-button");return gt(),Je("div",{class:ut(m.value),style:pt(g.value)},[Qe("div",{class:ut(Et(r).b("image-wrapper")),style:pt(f.value),onClick:b},[Qe("div",{class:ut(Et(r).b("image-mask")),style:pt(f.value)},[at(Et(ua),{style:pt({width:v.value,height:v.value}),"two-tone-color":"#d6d6d6"},null,8,["style"])],6),Qe("img",{src:e.value?i.value:s.value,alt:"avatar"},null,8,ji)],6),e.showBtn?(gt(),Xe(l,ct({key:0,class:Et(r).b("upload-btn")},e.btnProps,{onClick:Et(d)}),{default:jt(()=>[tt(kt(e.btnText?e.btnText:Et($e)("sys.component.cropper.selectImage")),1)]),_:1},16,["class","onClick"])):Ze("",!0),at(Ii,{"upload-api":e.uploadApi,src:i.value,"source-url-value":n.value,onRegister:Et(c),onUploadSuccess:y},null,8,["upload-api","src","source-url-value","onRegister"])],6)}}}),Ri=/* @__PURE__ */de(Li,[["__scopeId","data-v-ef939ff0"]]),Mi=/* @__PURE__ */ot({__name:"picture-preview",props:{functional:{type:Boolean},imageList:{type:Array,default:()=>[]}},setup(e){const t=e,a=Ke("image-preview"),l=We(()=>t.imageList.map(e=>Pt(e)?{src:e,placeholder:!1}:e));return(t,o)=>{const s=Ct("PreviewGroup");return gt(),Je("div",{class:ut(Et(a).b())},[at(s,null,{default:jt(()=>[!e.imageList||t.$slots.default?xt(t.$slots,"default",{key:0}):(gt(!0),Je(Ye,{key:1},_t(l.value,e=>(gt(),Xe(Et(Wt),ct({key:e.src,ref_for:!0},e),et({_:2},[e.placeholder?{name:"placeholder",fn:jt(()=>[at(Et(Wt),ct({ref_for:!0},e,{src:e.placeholder,preview:!1}),null,16,["src"])]),key:"0"}:void 0]),1040))),128))]),_:3})],2)}}}),zi=Mi,Fi=/* @__PURE__ */function(e){return e[e.LOADING=0]="LOADING",e[e.DONE=1]="DONE",e[e.FAIL=2]="FAIL",e}(Fi||{}),Ui={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}},Ai="img-preview",Bi=/* @__PURE__ */ot({name:"ImagePreview",props:Ui,emits:["img-load","img-error"],setup(e,{expose:t,emit:a}){const l=/* @__PURE__ */new Map,o=yt({currentUrl:"",imgScale:1,imgRotate:0,imgTop:0,imgLeft:0,status:Fi.LOADING,currentIndex:0,moveX:0,moveY:0,show:e.show}),s=bt(null),i=bt(null);function n(){o.imgScale=1,o.imgRotate=0,o.imgTop=0,o.imgLeft=0}const r=We(()=>{const t=(null==e?void 0:e.scaleStep)??0;return t>0&&t<100?t/100:o.imgScale/10});function c(e){(e=e||window.event).delta=e.wheelDelta||-e.detail,e.preventDefault(),e.delta>0&&d(r.value),e.delta<0&&d(-r.value)}function d(e){o.imgScale<=.2&&e<0||(o.imgScale+=.1*e,o.imgScale<0&&(o.imgScale=.02))}function u(e){o.imgRotate+=e}function p(){const e=Et(i);e&&(e.onmousemove=null)}function m(t){o.status=Fi.LOADING;const s=new Image;s.src=t,s.onload=s=>{if(o.currentUrl!==t){const i=s.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/i[0].naturalWidth))}else e.defaultWidth&&(o.imgScale=e.defaultWidth/i[0].naturalWidth);i&&a("img-load",{index:o.currentIndex,dom:i[0],url:t})}o.currentUrl=t,o.status=Fi.DONE},s.onerror=e=>{const l=e.composedPath();l&&a("img-error",{index:o.currentIndex,dom:l[0],url:t}),o.status=Fi.FAIL}}function h(e){e&&e.stopPropagation(),v()}function v(){o.show=!1,document.body.removeEventListener("DOMMouseScroll",c),document.ondragstart=null}function g(){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)),m(l[o.currentIndex])}function y(e){e=e||window.event,o.moveX=e.clientX,o.moveY=e.clientY;const t=Et(i);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:g,close:v,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 w=We(()=>{const{imgScale:t,imgRotate:a,imgTop:l,imgLeft:s}=o;return{transform:`scale(${t}) rotate(${a}deg)`,marginTop:`${l}px`,marginLeft:`${s}px`,maxWidth:e.defaultWidth?"unset":"100%"}}),_=We(()=>{const{imageList:t}=e;return t.length>1});It(()=>{e.show&&function(){!function(){const e=Et(s);e&&(e.onmousewheel=c,document.body.addEventListener("DOMMouseScroll",c),document.ondragstart=function(){return!1})}();const{index:t,imageList:a}=e;if(!a||!a.length)throw new Error("imageList is undefined");o.currentIndex=t,m(a[t])}(),e.imageList&&n()});const x=t=>{e.maskClosable&&t.target&&t.target.classList.contains(`${Ai}-content`)&&h(t)},C=()=>{if(!Et(_))return null;const{currentIndex:t}=o,{imageList:a}=e;return at("div",{class:`${Ai}__index`},[t+1,tt(" / "),a.length])},k=e=>Et(_)?at("div",{class:[`${Ai}__arrow`,e],onClick:()=>f(e)},[at("left"===e?ha:ga,null,null)]):null;return()=>o.show&&at("div",{class:Ai,ref:s,onMouseup:p,onClick:x},[at("div",{class:`${Ai}-content`},[at("img",{style:Et(w),class:[`${Ai}-image`,o.status===Fi.DONE?"":"hidden"],ref:i,src:o.currentUrl,onMousedown:y},null),at("div",{class:`${Ai}__close`,onClick:h},[at(ca,{class:`${Ai}__close-icon`},null)]),C(),at("div",{class:`${Ai}__controller`},[at("div",{class:`${Ai}__controller-item`,onClick:()=>d(-r.value)},[at("img",{src:"/extras-assets/svg/preview/unscale.svg"},null)]),at("div",{class:`${Ai}__controller-item`,onClick:()=>d(r.value)},[at("img",{src:"/extras-assets/svg/preview/scale.svg"},null)]),at("div",{class:`${Ai}__controller-item`,onClick:g},[at("img",{src:"/extras-assets/svg/preview/resume.svg"},null)]),at("div",{class:`${Ai}__controller-item`,onClick:()=>u(-90)},[at("img",{src:"/extras-assets/svg/preview/unrotate.svg"},null)]),at("div",{class:`${Ai}__controller-item`,onClick:()=>u(90)},[at("img",{src:"/extras-assets/svg/preview/p-rotate.svg"},null)])]),k("left"),k("right")])])}}),Ni=Bi,Vi=null;function Pi(e){var t;const a={},l=document.createElement("div");return Object.assign(a,{show:!0,index:0,scaleStep:100},e),Vi=at(Ni,a),wt(Vi,l),document.body.appendChild(l),null===(t=Vi.component)||void 0===t?void 0:t.exposed}var $i=["src"],Gi={key:0,class:"iconfont icon-tupian-shili"},Hi={class:"prompt"},qi={key:0,class:"auxiliary"},Ki="cropper-photo",Yi=/* @__PURE__ */ot({__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,s=bt(l.value||""),i=We(()=>s.value?Be(s.value):"");let n={};const[r,{openModal:c,closeModal:d}]=u(),p=We(()=>l.disabled),m=We(()=>{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 h({source:e,data:t}){s.value=t,o("change",{source:e,data:t})}function v(){n=Pi({imageList:[i.value]})}function g(){s.value=""}It(()=>{s.value=l.value||""}),Tt(()=>s.value,e=>{o("update:value",e)}),mt(()=>{n&&n.close&&n.close()}),ht(()=>{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(!m.value.includes(a.type))return void oa.warning($e("sys.component.cropper.acceptTip"));c(!0,{file:a})}})});const f=()=>{c()};return t({openModal:c.bind(null,!0),closeModal:d}),(t,a)=>{var l;const o=Ct("Icon");return gt(),Je("div",{id:"dropzone",class:ut([Ki,p.value&&"not-allow"])},[i.value?(gt(),Je(Ye,{key:0},[Qe("div",{class:ut(`${Ki}__wrapper`)},[Qe("img",{src:i.value},null,8,$i)],2),Qe("div",{class:ut(`${Ki}__mask`)},[at(Et(ma),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:v}),at(Et(ua),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:a[0]||(a[0]=()=>Et(c)())}),at(Et(da),{style:{fontSize:24},"two-tone-color":"#ffffff",onClick:g})],2)],64)):(gt(),Je("div",{key:1,class:ut(`${Ki}__trigger`),onClick:f},[e.icon?(gt(),Je("i",Gi)):(gt(),Xe(o,{key:1,icon:"ant-design:plus-outlined",size:36})),e.isDrag?(gt(),Je(Ye,{key:2},[Qe("p",Hi,kt(t.$t("sys.pageDesigner.clickOrDragToUpload")),1),e.accept?(gt(),Je("p",qi,kt(`支持${null===(l=e.accept)||void 0===l?void 0:l.join("、")}图片格式,大小100KB以内`),1)):Ze("",!0)],64)):Ze("",!0),e.auxiliary?Ze("",!0):(gt(),Je(Ye,{key:3},[tt(kt(Et($e)("sys.clickToDoSth",{sth:Et($e)("sys.add")})),1)],64))],2)),at(xi,{"upload-api":e.uploadApi,"aspect-ratio":e.aspectRatio,src:i.value,accept:e.accept,"before-upload":e.beforeUpload,title:e.modalTitle,"upload-text":e.uploadText,onRegister:Et(r),onUploadSuccess:h},null,8,["upload-api","aspect-ratio","src","accept","before-upload","title","upload-text","onRegister"])],2)}}}),Wi=/* @__PURE__ */de(Yi,[["__scopeId","data-v-c85d53db"]]),Xi={key:0,class:"px-2"},Zi={key:1,class:"font-bold mb-3"},Ji={key:2,class:"gct-print-tmpl-modal-wrap ks-col"},Qi={class:"print-tmpl-vxe-table-wrapper"},en={class:"print-tmpl-vxe-table-area"},tn={class:"ks-row"},an={class:"gct-text-overflow"},ln={key:0,class:"gct-custom-tag ml4px"},on={class:"ks-row"},sn=["title"],nn={class:"pt-12px"},rn={key:3,class:"gct-print-tmpl-modal-right btw-visible flex flex-col h-full px-2 py-3"},cn={class:"print-tmpl-vxe-table-wrapper"},dn={class:"print-tmpl-vxe-table-area"},un={class:"tmpl-path"},pn=["src"],mn=["src"],hn={class:"pt-12px"},vn=/* @__PURE__ */ot({__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=Ke("print-tmpl-modal"),l=bt([]),o=bt(),s=bt(),i=bt({pageNo:1,pageSize:20}),n=bt({pageNo:1,pageSize:20}),r=bt("design"),c=bt(0),d=bt(!1),u=bt(0),p=bt(!1),m=We(()=>t.printMode===Re.Server||t.btwForceVisible),h=We(()=>t.moduleType),v=bt(We(()=>{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||""),g=bt({categoryId:v.value,name:""}),f=bt({name:""}),y=bt(""),b=/(?<!\\)\\(?!\\)/g,w=We(()=>({current:i.value.pageNo,pageSize:i.value.pageSize,total:c.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>$e("sys.component.table.total",{total:e})})),_=We(()=>({current:n.value.pageNo,pageSize:n.value.pageSize,total:u.value,showSizeChanger:!0,pageSizeOptions:["10","20","30"],showTotal:e=>$e("sys.component.table.total",{total:e})})),x=bt([]),C=bt([]),k={[Me.LABEL]:$e("sys.pageDesigner.label"),[Me.RECEIPT]:$e("sys.pageDesigner.document"),[Le.EDHR]:"DHR",[Le.ONLINE_FORM]:$e("sys.pageDesigner.fieldCmp.online_form")};ht(()=>{dt(()=>{t.selected&&(Array.isArray(t.selected)?(S(t.selected),l.value=[...t.selected]):(S([t.selected]),l.value=[{...t.selected}]))})});const S=e=>{const t=o.value;t&&t.setCheckboxRow(e,!0)},O=e=>e.children||!t.isRdo?e.name:e.version,E=We(()=>[Le.EDHR,Le.ONLINE_FORM].includes(t.moduleType)),D=We(()=>k[t.moduleType]),T=We(()=>t.categoryTitle||!Vt(t.categoryTitle)?t.categoryTitle:$e("sys.categoryOfSth",{sth:D.value})),I=e=>{g.value.categoryId=null==e?void 0:e.key},j=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 R(e,t){i.value.pageNo=e,i.value.pageSize=t,F()}function M(e,t){n.value.pageNo=e,n.value.pageSize=t,U()}const z=()=>{};qe(()=>Promise.resolve({ok:!0,params:{selected:l.value}}));const F=async()=>{var e,a,l;g.value.name=g.value.name.trim();const s=_api.apaas.printDesigner.getRdoPageBaseList;d.value=!0;const n=await s({...g.value,...i.value,...t.queryParams||{},moduleType:t.moduleType,modelKey:t.modelKey})||{};d.value=!1,x.value=v.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:g.value.categoryId}),a}))||[],c.value=n.totalCount,await dt();const r=B(x.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))},U=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}}),C.value=e.data||[],u.value=e.totalCount,await dt();const o=B(C.value||[]).find(e=>{var a;return e.id==(null===(a=t.selected)||void 0===a?void 0:a.id)});o&&(null===(l=s.value)||void 0===l||l.setRadioRow(o))}).finally(()=>{p.value=!1})},A=e=>{const t=e.target.value;(!t||t.length<y.value.length)&&U(),y.value=t},B=e=>function e(t,a){let l=[];for(const s of t){var o;s.level=a,l.push(s),(null===(o=s.children)||void 0===o?void 0:o.length)&&(l=[...l,...e(s.children,a+1)])}return l}(JSON.parse(JSON.stringify(e)),1);return Tt(()=>g.value.categoryId,e=>{e?F():(x.value=[],c.value=0)},{immediate:!0}),Tt(()=>r.value,()=>{"btw"===r.value?(C.value=[],n.value.pageNo=1,U()):(x.value=[],i.value.pageNo=1,F())}),Tt(()=>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 i=Ct("a-tab-pane"),n=Ct("a-tabs"),c=Ct("a-input"),u=Ct("a-form-item"),y=Ct("a-form"),k=Ct("a-tooltip"),S=Ct("a-pagination");return gt(),Je("div",{class:ut(["gct-print-tmpl-modal ks-column",m.value?"px-2 pt-4":"p-4"])},[m.value?(gt(),Je("div",Xi,[at(n,{"active-key":r.value,"onUpdate:activeKey":l[0]||(l[0]=e=>r.value=e)},{default:jt(()=>[at(i,{key:"design",tab:T.value},null,8,["tab"]),at(i,{key:"btw",tab:".btw 标签模板 "})]),_:1},8,["active-key"])])):(gt(),Je("div",Zi,kt(T.value),1)),!m.value||m.value&&"design"===r.value?(gt(),Je("div",Ji,[Qe("div",{class:ut(["gct-print-tmpl-modal-left",m.value?"btw-visible":""])},[at(Et(ii),{value:v.value,"onUpdate:value":l[1]||(l[1]=e=>v.value=e),class:ut([Et(a).e("sider")]),"sider-title":"",module:h.value,"need-folder-icon":!E.value,readonly:"","has-title":!1,draggable:!1,"is-tree":E.value,"ignore-case":e.ignoreCase,onChangeValue:I,onChangeCategory:z},null,8,["value","class","module","need-folder-icon","is-tree","ignore-case"])],2),Qe("div",{class:ut(["gct-print-tmpl-modal-right flex flex-col h-full px-16px py-12px",m.value?"btw-visible":""])},[at(y,{model:g.value},{default:jt(()=>[at(u,{label:""},{default:jt(()=>[at(c,{value:g.value.name,"onUpdate:value":l[2]||(l[2]=e=>g.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:Et($e)("sys.searchNameOfSth",{sth:D.value}),clearable:"",onKeyup:l[3]||(l[3]=Rt(e=>F(),["enter"])),onChange:l[4]||(l[4]=()=>{!g.value.name&&F()})},{prefix:jt(()=>[...l[7]||(l[7]=[Qe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Qe("div",Qi,[Qe("div",en,[at(Et(ya),{ref_key:"tableRef",ref:o,class:ut(["select-none",{vxetable:!0,default:!0}]),data:x.value,height:"100%","min-height":"88",loading:d.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:j},{default:jt(()=>[e.multiple?(gt(),Xe(Et(fa),{key:0,type:"checkbox",width:"40"})):(gt(),Xe(Et(fa),{key:1,type:"radio",width:"40",resizable:!1})),at(Et(fa),{field:"name",title:Et($e)("sys.name"),"show-overflow":"","tree-node":e.isRdo},{default:jt(t=>{var a;return[Qe("div",tn,[at(k,null,{title:jt(()=>[tt(kt(O((null==t?void 0:t.row)||{})),1)]),default:jt(()=>[Qe("div",an,kt(O((null==t?void 0:t.row)||{})),1)]),_:2},1024),(null==t||null===(a=t.row)||void 0===a?void 0:a.default)&&e.isRdo?(gt(),Je("div",ln,kt(Et($e)("sys.default")),1)):Ze("",!0)])]}),_:1},8,["title","tree-node"]),at(Et(fa),{field:"description",title:Et($e)("sys.description"),"show-overflow":""},{default:jt(e=>{var t,a;return[Qe("div",on,[Qe("span",{class:"gct-text-overflow",title:null==e||null===(t=e.row)||void 0===t?void 0:t.description},kt(null==e||null===(a=e.row)||void 0===a?void 0:a.description),9,sn)])]}),_:1},8,["title"]),at(Et(fa),{field:"modifyUserName",title:Et($e)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),at(Et(fa),{field:"modifyTime",title:Et($e)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Qe("div",nn,[at(S,ct(w.value,{class:"pagination-total-left",onChange:R}),null,16)])])],2)])):Ze("",!0),m.value&&"btw"===r.value?(gt(),Je("div",rn,[at(y,{model:f.value},{default:jt(()=>[at(u,{label:""},{default:jt(()=>[at(c,{value:f.value.name,"onUpdate:value":l[5]||(l[5]=e=>f.value.name=e),class:"gct-print-tmpl-input",style:{width:"224px"},placeholder:Et($e)("sys.searchNameOfSth",{sth:"标签"}),clearable:"",onKeyup:l[6]||(l[6]=Rt(e=>U(),["enter"])),onChange:A},{prefix:jt(()=>[...l[8]||(l[8]=[Qe("i",{class:"iconfont icon-sousuo1"},null,-1)])]),_:1},8,["value","placeholder"])]),_:1})]),_:1},8,["model"]),Qe("div",cn,[Qe("div",dn,[at(Et(ya),{ref_key:"btwTableRef",ref:s,class:ut(["select-none",{vxetable:!0,default:!0}]),data:C.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:j},{default:jt(()=>[e.multiple?(gt(),Xe(Et(fa),{key:0,type:"checkbox",width:"40"})):(gt(),Xe(Et(fa),{key:1,type:"radio",width:"40",resizable:!1})),at(Et(fa),{field:"name",title:"标签模板名称","min-width":"120","show-overflow":""}),at(Et(fa),{field:"modelName",title:"关联模型",width:"120","show-overflow":""}),at(Et(fa),{field:"tmplPath",title:"BarTender "+Et($e)("sys.labelTmplPath"),"min-width":"220","show-overflow":""},{default:jt(e=>{var t,a;return[Qe("span",un,[Qe("img",{width:"16",height:"16",src:Et("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,pn),Qe("span",null,kt(null==e||null===(t=e.row)||void 0===t?void 0:t.printName),1),(gt(!0),Je(Ye,null,_t((null==e||null===(a=e.row)||void 0===a?void 0:a.tmplPath)||[],(t,a)=>{var o,s;return gt(),Je(Ye,{key:a},[l[9]||(l[9]=tt(" /",-1)),Qe("img",{width:"16",height:"16",class:"ml-3px mr-2px",src:Et("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,mn),Qe("span",null,kt(null==t?void 0:t.replace(b,"/")),1),0===a?(gt(),Je("span",{key:0,class:ut(["btw-label-tag","common"===(null==e||null===(o=e.row)||void 0===o?void 0:o.pathType)?"common":"local"])},kt("common"===(null==e||null===(s=e.row)||void 0===s?void 0:s.pathType)?Et($e)("sys.shared"):Et($e)("sys.local")),3)):Ze("",!0)],64)}),128))])]}),_:1},8,["title"]),at(Et(fa),{field:"macAddress",title:Et($e)("sys.macAddress"),width:"175","show-overflow":""},null,8,["title"]),at(Et(fa),{field:"createUserName",title:Et($e)("sys.creator"),width:"120","show-overflow":""},null,8,["title"]),at(Et(fa),{field:"createTime",title:Et($e)("sys.createTime"),width:"185"},null,8,["title"]),at(Et(fa),{field:"modifyUserName",title:Et($e)("sys.appDesigner.modifier"),width:"120","show-overflow":""},null,8,["title"]),at(Et(fa),{field:"modifyTime",title:Et($e)("sys.appDesigner.modificationTime"),width:"185"},null,8,["title"])]),_:1},8,["data","loading","checkbox-config","radio-config"])]),Qe("div",hn,[at(S,ct(_.value,{class:"pagination-total-left",onChange:M}),null,16)])])])):Ze("",!0)],2)}}}),gn=/* @__PURE__ */de(vn,[["__scopeId","data-v-c60841b8"]]),fn=class{constructor(){t(this,"type",we.DEFAULT),t(this,"ns",Ke("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,be.FORWARD):e.node.cache.reverseClear(a,be.REVERSE),e.node.update(Object.assign(a,{value:null,label:null,noSelectField:!0!==t.reverse})),t.reverse){if(e.node.cache.reverseReset(a,be.FORWARD))return}else if(e.node.cache.reverseReset(a,be.REVERSE))return;t.reverse||e.node.create({type:xe.REVERSE,reverse:!0},{type:we.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:wa.type,options:{stub:[0,25],cornerRadius:10}},endpoints:[{type:ba.type,options:{radius:3}},{type:fe.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!==we.VIRTUAL||!0===t.reverse){const l=document.createElement("i");l.className="iconfont icon-caiqie1 delete-action",l.onclick=a=>{a.stopPropagation(),Xt.confirm({title:$e(this.deleteMessage),content:$e("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)}},yn=class{constructor(){t(this,"type",xe.DEFAULT),t(this,"component","DiagramConfigItem")}},bn=class{constructor(){t(this,"type",xe.REVERSE),t(this,"component","DiagramConfigItemReverse")}},wn=class extends fn{options(e,t){const a=super.options(e,t);return a.paintStyle={strokeWidth:1,stroke:"#C3C3C3",dashstyle:"4 4"},a.endpointStyle={fill:"#C3C3C3"},a}},_n=class{constructor(){t(this,"type",xe.VIRTUAL),t(this,"component","DiagramConfigItemVirtual")}},xn={install(e){_e.registerLink(we.DEFAULT,new fn),_e.registerLink(we.VIRTUAL,new wn),_e.registerNode(xe.DEFAULT,new yn),_e.registerNode(xe.VIRTUAL,new _n),_e.registerNode(xe.REVERSE,new bn),e.component(ye.name,lt(()=>import("./relationship-diagram-config-DstwwXCO.js").then(e=>e.n))),e.component(Ce.name,lt(()=>import("./diagram-config-item-C5Ha2XJq.js").then(e=>e.n))),e.component(s.name,lt(()=>import("./diagram-config-item-virtual-Cbmggfwt.js").then(e=>e.n))),e.component(ke.name,lt(()=>import("./diagram-config-item-reverse-ChoxnW-Z.js").then(e=>e.n)))}},Cn={scrollbars:{autoHide:"leave",autoHideDelay:100,theme:"os-theme-dark"}},kn=/* @__PURE__ */ot({name:"GctOverlayScrollbars",inheritAttrs:!1,props:{options:{type:[Object,Boolean],default:null},handleColor:{type:String,default:"rgba(144, 147, 153, 0.3)"}},setup(e,{expose:t}){const a=bt(),l=We(()=>{if(!1===e.options)return!1;const t=e.options??{},a=t.scrollbars??{};return{...Cn,...t,scrollbars:{...Cn.scrollbars,...a}}}),o=We(()=>e.handleColor?{"--gct-h-bg":e.handleColor}:void 0);return t({osInstance:()=>{var e;return(null===(e=a.value)||void 0===e?void 0:e.osInstance())??null},getElement:()=>{var e;return(null===(e=a.value)||void 0===e?void 0:e.getElement())??null}}),{mergedOptions:l,colorStyle:o,setOsRef:e=>{a.value=e}}},render(){return at(Se,ct({ref:this.setOsRef,options:this.mergedOptions},this.$attrs,{"data-gct-os":"","data-gct-color":this.handleColor?"":void 0,style:this.colorStyle}),{default:()=>{var e,t;return[null===(e=(t=this.$slots).default)||void 0===e?void 0:e.call(t)]}})}}),Sn={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,s=t.clientX;document.onmousemove=function(t){t.preventDefault();let i=o+(t.clientX-s);i=i<a?a:i,l.setAttribute("style",`width:${i}px !important;`);const n=new CustomEvent("drag-resize-width",{detail:{width:i,resizing:!0}});e.dispatchEvent(n)},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}})}},On={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__)}},En=/* @__PURE__ */de(/* @__PURE__ */ot({__name:"target-loading",props:{tip:{type:String,default:""},size:{type:String,default:ze.LARGE,validator:e=>[ze.DEFAULT,ze.SMALL,ze.LARGE].includes(e)},absolute:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},background:{type:String},theme:{type:String}},setup:e=>(t,a)=>Lt((gt(),Je("section",{class:ut(["full-loading",{absolute:e.absolute,[e.theme]:!!e.theme}]),style:pt([e.background?`background-color: ${e.background}`:""])},[at(Et(ta),ct(t.$attrs,{tip:e.tip,size:e.size,spinning:e.loading}),null,16,["tip","size","spinning"])],6)),[[Dt,e.loading]])}),[["__scopeId","data-v-d448466c"]]),Dn={mounted(e,t){const a=e.getAttribute("loading-tip"),l=e.getAttribute("loading-background"),o=e.getAttribute("loading-size"),s=!!t.modifiers.fullscreen;e.instance=function(e,t,a=!1){let l=null;const o=yt({tip:"",loading:!0,...e});function s(e=document.body){l&&l.el&&e.appendChild(l.el)}return l=at(ot({render:()=>it(En,{...o})})),a?setTimeout(()=>{wt(l,document.createElement("div"))},0):wt(l,document.createElement("div")),t&&s(t),{vm:l,close:function(){(null==l?void 0:l.el)&&l.el.parentNode&&l.el.parentNode.removeChild(l.el)},open:s,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:!s},s?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()}};async function Tn(e){e.use(Gt),function(e){!function(e){e.directive("dragResize",Sn)}(e),function(e){e.directive("ellipsis-title",On)}(e),function(e){e.directive("target-loading",Dn)}(e)}(e),e.use(O),Object.entries(ra).forEach(([t,a])=>{e.component(t,a)}),e.component(V.name,V),e.component(ri.name,ri),e.component("OverlayScrollbarsComponent",kn),e.use(xn),await ia(e),e.use(Ss),e.use(ei),e.use(q)}async function In(e){console.log("coreWebSetupApp")}_gct.message=new me,_gct.openUtil=J,_gct.register.editor=new al,_gct.register.formItem=new ll,_gct.register.tableEditor=new Bs;var jn=new URL("./index.min.css",import.meta.url);Ue.load(jn.href);export{N as BaseButton,z as BasicButton,q as BasicModal,ti as CategoryModal,ii as CategorySider,i as CodeEditor,ri as ColorEditor,V as ColorPicker,xi as CopperFreeModal,Ii as CopperModal,E as CopyModuleKey,Ri as CropperAvatar,Wi as CropperFree,fi as CropperImage,f as DoubleInput,Aa as EditFormController,Na as EditorController,al as EditorRegister,_a as EditorRegisterConst,xa as EditorType,Ca as FORM_CONTROLLER_INJECT_TAG,m as FieldCascader,R as FieldUpload,Ga as FormCollapseController,$a as FormCollapsePaneController,Oa as FormCollapsePaneState,Ea as FormCollapseState,Ya as FormEditItemController,Ia as FormEditItemState,Ka as FormGroupController,ja as FormGroupState,Xa as FormHiddenItemController,Va as FormItemBasicController,Sa as FormItemBasicState,Wa as FormItemController,ll as FormItemRegister,La as FormItemState,Za as FormLineController,Ra as FormLineState,ka as FormState,Ha as FormTabController,qa as FormTabPaneController,Ta as FormTabPaneState,Da as FormTabState,x as FullScreen,ci as GCT_DND_INSERT_POS,pi as GctDndContainer,ui as GctDndDropLine,di as GctDndItem,vl as GctFormCollapseModel,ul as GctFormCollapsePaneModel,Ua as GctFormController,bl as GctFormGroupModel,Bl as GctFormHiddenItemModel,Nl as GctFormItemModel,Cl as GctFormLineModel,El as GctFormTabModel,Ll as GctFormTabPaneModel,Ul as GctFormTitleGroupModel,Fs as GctTableController,v as I18Modal,S as I18nSelectBtn,j as I18nSelectInput,F as I18nSelectInputForm,C as I18nSelectTextarea,_ as I18nSelectTextareaForm,zi as ImagePreview,A as ImageUpload,ge as Lang,me as MessageUtil,ni as MonacoEditor,g as NumberRange,ce as OverlayController,P as PaasBpmnLog,G as PaasBpmnRuntime,he as Prop,$ as SerialNumberContainer,D as StageView,js as TableActionItemController,Ls as TableEditItemController,Ds as TableEditItemState,Bs as TableEditorRegister,Es as TableITemState,Is as TableItemController,zs as TableRowController,Ts as TableRowState,Os as TableState,ve as Theme,M as TreeEx,B as TreeSelectEx,le as UseDragByLine,y as UserPickType,d as ViewContainer,h as Vue3GridDndItem,I as WUJIE_FORMULA_EVENTS,Tn as coreWebCreateAppVue,In as coreWebSetupApp,Pi as createImgPreview,se as filterTreeData,re as findRecursiveChild,b as gctFieldSortPopover,T as gctFieldTreeSelect,tl as gctFormItemEditorProps,za as getValue,gn as labelTmplModal,oe as monacoLoader,w as openFormulaEditor,J as overlay,ae as recursiveIterate,X as recursiveTransfer,r as setIdentify,Fa as setValue,As as useAntTableScrollHeight,Ba as useEditFormController,L as useEditorConsole,U as useEditorConsoleInner,Ja as useForm,Pa as useFormItemController,Qa as useGctFormValue,el as useGctFormValueByText,k as useI18nSelect,c as useLabelModalPicker,Q as useLocale,u as useModal,H as useModalContext,p as useModalDragMove,n as useModalInner,K as useModalPicker,Us as useTableController,ue as useTheme,te as validateFieldDefaultForLength,W as validateFieldDefaultForValue,pe as validateLengthRange,Ma as widthEditorInstall,ie as withInstall};
|