unione-form-vue 0.0.19 → 0.0.20
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/index.umd.js +1 -1
- package/dist/version/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Z,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("@hufe921/canvas-editor"),require("dayjs"),require("prismjs"),require("@ant-design/icons-vue"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","@hufe921/canvas-editor","dayjs","prismjs","@ant-design/icons-vue","uuid"],Y):(Z=typeof globalThis<"u"?globalThis:Z||self,Y(Z.index={},Z.UnioneBaseVue,Z.Vue,Z.antDesignVue,Z.lodashEs,Z.vueCodemirror,Z.langJavascript,Z.canvasEditor,Z.dayjs,Z.prism,Z.iconsVue,Z.uuid))})(this,function(Z,Y,i,X,ha,jt,fa,re,ua,xl,Ke,pa){"use strict";const ma={isDebug:!0,axios:{form:"/portal"},listPageUrl:"/unione/page/list",addPageUrl:"/unione/page/add",editPageUrl:"/unione/page/edit",viewPageUrl:"/unione/page/view",formRules:[]},nn=i.ref(ma);function Fe(a){return a&&(nn.value=Y.utils.obj.ext(nn.value,a)),nn.value}const ga={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},ka={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},ba=i.ref([ga,ka]);function ya(a,e){return Y.locales.loadLanguage(a,()=>new Promise((t,n)=>{const l=ba.value.filter(o=>o.localeName==a);if(e)if(typeof e=="function")e().then(o=>{if(l.length==0){const s={...o,localeName:a};t(s)}else{const s={...l[0],...o};t(s)}});else if(l.length==0){const o={...e,localeName:a};t(o)}else{const o={...l[0],...e};t(o)}else l.length>0?t(l[0]):n("local language not defined ,lang:"+a)}))}const ln={...Y.locales};ln.loadLanguage=ya;class wa{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(e,t){this.$psn=i.ref(e),this.$pid=i.ref(""),this.$store=i.ref({}),this.$forms=i.ref({}),this.$params=i.ref({}),this.$refObj=i.ref({}),this.$refData=i.ref({}),this.$model=t}params(e){if(e){this.$params.value=e,e.id&&(this.$pid.value=e.id,this.$psn.value&&this.use(this.$psn.value,"form").detail(this.$pid.value));for(const t in this.$store.value)this.$store.value[t].$params=e}return this.$params.value}psn(e){return e&&(this.$psn.value=e),this.$psn.value}regRef(e,t){}setRefData(e,t,n){}use(e,t,n){let l=this.$store.value[e];return l||(l=new on(e,t,this.$model),this.$store.value[e]=l,l.$params=this.$params.value),n&&(l.$form=n,this.$forms.value[e]=n),l}useForm(e,t,n){const l=this.use(e,"form",t);return this.$psn.value==e&&this.$pid.value&&l.detail(this.$pid.value).then(o=>{n&&n(o)}),l}data(e){return this.$store.value[e]}form(e){return e?this.$forms.value[e]:this.$forms.value}primary(){return this.data(this.$psn.value)}dsnList(){return Object.keys(this.$store.value)}}class on{$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(e,t,n){typeof e=="string"?(this.$dsn=e,this.$store={controller:"/api/data/storage/v1"}):(this.$store=e,this.$dsn=""),this.$type=t,this.$data=i.ref(t=="form"?{}:{body:[],total:0}),this.$dialog=Y.useDialog(),this.$model=n||i.ref("run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(e){return e&&(this.$store=e),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(e){this.$data.value=e,this.$form?.setValue(e)}$processParams(e,t){if(t)t.forEach(n=>{e[n.name]==null&&e[n.name]==null&&(this.$params[n.name]!=null&&this.$params[n.name]!=null?e[n.alias||n.name]=this.$params[n.name]:n.value!=null&&n.value!=null&&(e[n.alias||n.name]=n.value))});else if(this.$params)for(const n in this.$params)e[n]==null&&e[n]==null&&this.$params[n]!=null&&this.$params[n]!=null&&(e[n]=this.$params[n]);return e}request(e){return new Promise((t,n)=>{const l=X.message.loading("数据请求中..."),o=this.$store.controller+e.url;Y.axios.form({method:"post",...e,url:o}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+o,options:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+o,options:e,err:s})}).finally(()=>{l()})})}find(e){const t=this.$store.controller+(this.$store.findUrl||"/find");return!e&&this.$store.findParams&&(e={dsn:this.$dsn}),this.$isStorage()&&(e.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),e&&(e.body=this.$processParams(e.body,this.$store.findParams)),new Promise((n,l)=>{const o=X.message.loading("数据加载中...");Y.axios.form({url:t,method:"post",data:e}).then(s=>{s.success?(this.$data.value=s,n(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,err:s})}).finally(()=>{o()})})}save(e){const t=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(e.dsn=this.$dsn+(this.$model!="run"?"@dev":""),e.params=this.$processParams(e.params,this.$store.saveParams)):e.data=this.$processParams(e.data,this.$store.saveParams),new Promise((n,l)=>{const o=X.message.loading("数据提交中...");Y.axios.form({url:t,method:"post",data:this.$isStorage()?e:e.data}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{}),s.silence||X.message.success(s.message),n(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,err:s})}).finally(()=>{o()})})}loadByIds(e){return new Promise((t,n)=>{const l=X.message.loading("数据加载中..."),o=this.$store.controller+"/loadByIds";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,err:s})}).finally(()=>{l()})})}detail(e){return new Promise((t,n)=>{const l=X.message.loading("数据加载中..."),o=this.$store.controller+"/detail";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{id:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body),t(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:o,id:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:o,id:e,err:s})}).finally(()=>{l()})})}deleteByIds(e){return new Promise((t,n)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+e.length+"条。",onOk:()=>{const l=X.message.loading("数据处理中..."),o=this.$store.controller+"/delete";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:o,ids:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:o,ids:e,err:s})}).finally(()=>{l()})}})})}}class Aa{$event;$onces;$delayEmit;constructor(){this.$event=i.ref({}),this.$onces=i.ref({}),this.$delayEmit=i.ref({})}$on(e,t){if(this.$event.value[e]=t,this.$delayEmit.value[e]){const n=this.$delayEmit.value[e];t(n)}}$emit(e,t){if(this.$onces.value[e]){const n=this.$onces.value[e];delete this.$onces.value[e],n(t)}this.$event.value[e]?this.$event.value[e](t):(this.$delayEmit.value[e]=t,setTimeout(()=>{delete this.$delayEmit.value[e]},1e3*10))}$once(e,t){this.$onces.value[e]=t}$off(e){delete this.$event.value[e]}}class ut{define;ebus;model;type;$widgetList;$widgetMap;$dataManager;$axiosProccess;$dialog;constructor(e={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}}){const t=e.configs||{};this.model=i.ref("run"),this.type=i.ref(e.types||"setting"),this.define=i.ref(e),this.ebus=new Aa,this.$widgetList=i.ref([]),this.$widgetMap=i.ref({}),this.$dataManager=new wa(t.dsnList?t.dsnList[0]:"",this.model),this.$axiosProccess=i.ref({}),this.$dialog=Y.useDialog(),this.loadConfig(t)}sn(){return this.define.value.sn}load(e,t){if(!e)return;if(this.define.value.sn=e,e=="new_"){console.log("新建/本地页面sn:"+e+",define:",t),t&&t.configs&&(this.define.value=t,this.type.value=this.define.value.types||"setting",this.loadConfig(t.configs));return}const n=sessionStorage.getItem("PAGE_DEFINE:"+e);if(n&&this.model.value=="run"){this.define.value=JSON.parse(n),this.type.value=this.define.value.types||"setting",this.loadConfig(this.define.value.configs),console.log("从会话缓存中加载页面sn:"+e+",define:",this.define.value);return}Y.axios.form({url:"/api/page/define/load/"+e,method:"post"}).then(l=>{l.success?(this.define.value=l.body,this.type.value=this.define.value.types||"setting",l.body.configs?this.define.value.configs=l.body.configs:this.define.value.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.value.configs),sessionStorage.setItem("PAGE_DEFINE:"+e,JSON.stringify(this.define.value)),console.log("从远程服务加载页面sn:"+e+",define:",this.define.value)):t&&t.configs&&(this.define.value=t,this.loadConfig(t.configs))})}save(){return new Promise((e,t)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.value.sn),t();return}this.$axiosProccess.value.save=!0;const n={...this.define.value.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},l={...this.define.value};l.configs=JSON.stringify(n),Y.axios.form({url:"/api/page/define/save",method:"post",data:l}).then(o=>{this.$axiosProccess.value.save=!1,o.success?(X.message.success(o.message),this.define.value=o.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.value.sn,JSON.stringify(this.define.value)),this.load(this.define.value.sn,this.define.value),e(o.body)):(this.$dialog.error({content:o.message}),t())}).catch(o=>{console.error("页面配置保存失败",o),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(e){e.dsnList?.length&&this.$dataManager.psn(e.dsnList[0]),this.$widgetList.value=e.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value)}setModel(e){this.model.value=e}widget(e,t){if(t){const n={...t,wid:e};this.$widgetMap.value[e]||(this.$widgetList.value.push(n),n.configs?.widgets&&this.$processWidget(n.configs.widgets)),this.$widgetMap.value[e]=n}else return this.$widgetMap.value[e]}widgets(e){if(e)this.$widgetList.value=e,this.$widgetMap.value={},this.$processWidget(e);else return this.$widgetList.value}$processWidget(e){e.forEach(t=>{t.wid||(t.wid="w:"+ha.uniqueId()),this.$widgetMap.value[t.wid]=t,t.configs?.widgets&&this.$processWidget(t.configs.widgets)})}dataManager(){return this.$dataManager}}const xa={class:"widget-setting-dialog"},Ca=i.defineComponent({__name:"widget",props:{model:{type:String,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1}},emits:["setting","saving"],setup(a,{expose:e,emit:t}){const n=t,l=i.ref(),o=i.ref(),s=i.ref(!1);function r(){o.value&&(s.value=!0),n("setting")}function c(){n("saving"),s.value=!1}function h(){return l.value?.clientHeight}function f(){return l.value?.clientWidth}return e({getHeight:h,getWidth:f}),(d,p)=>{const m=i.resolveComponent("SettingOutlined"),b=i.resolveComponent("a-tooltip"),y=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["unione-widget",a.model]),ref_key:"widgetDom",ref:l},[i.createVNode(b,{title:a.settingTitle},{default:i.withCtx(()=>[a.model=="edit"&&(d.$slots["widget-setting"]||a.custome)?(i.openBlock(),i.createBlock(m,{key:0,class:"widget-setting",onClick:r})):i.createCommentVNode("",!0)]),_:1},8,["title"]),i.renderSlot(d.$slots,"default",{},void 0,!0),a.model=="edit"&&d.$slots["widget-setting"]?(i.openBlock(),i.createBlock(y,{key:0,title:a.settingTitle,ref_key:"settingModal",ref:o,open:s.value,"onUpdate:open":p[0]||(p[0]=A=>s.value=A),centered:"",width:"80%",onOk:c},{default:i.withCtx(()=>[i.createElementVNode("div",xa,[i.renderSlot(d.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):i.createCommentVNode("",!0)],2)}}}),te=(a,e)=>{const t=a.__vccOpts||a;for(const[n,l]of e)t[n]=l;return t},lt=te(Ca,[["__scopeId","data-v-17b517f5"]]),va={key:0},Sa=["onClick"],fi=te(i.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(a,{expose:e}){const t=a,n=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:k})=>k+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),l=i.ref({selectedRowKeys:[],columnWidth:"25px",onChange:k=>{l.value.selectedRowKeys=k}}),o={mounted:k=>k.focus()},s=i.ref({});function r(){const k=Object.keys(s.value);if(k.length)for(let u in k){const N=y.value.form.action.params[u];N&&s.value[u]&&Object.keys(s.value[u]).forEach(M=>{N[M]=s.value[u][M]})}s.value={}}function c(k,u,N){r();const M={};M[N]=u[N]||"",N=="showIndex"&&(M[N]=u.show?.query?.index),s.value[k]=M}function h(k,u,N){if(!u||!N){s.value={};return}const M=s.value[k][N];u[N]=M,s.value={}}function f(){y.value.form.action.params.push({title:"新建",name:"",value:""})}function d(){}const p=i.ref(""),m=i.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(k,u)=>p.value!=u&&t.preset.includes(u)?Promise.reject("预设按钮名称,请使用其他名称,["+t.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),b=i.ref([fa.javascript()]),y=i.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),A=i.ref();function x(k,u,N={}){k=JSON.parse(JSON.stringify(k)),k.event||(k.event={}),k.props||(k.props={}),k.action||(k.action={}),Object.keys(k.action).includes("maskClosable")||(k.action.maskClosable=!0),k.action.params||(k.action.params=[]),p.value=k.name,y.value.form=k,y.value.helps=N,y.value.visible=!0,A.value=u}const w=i.ref(null);function V(){w.value&&w.value.validate().then(()=>{y.value.visible=!1,A.value(y.value.form)})}return e({open:x,close}),(k,u)=>{const N=i.resolveComponent("a-input"),M=i.resolveComponent("a-form-item"),v=i.resolveComponent("a-select"),C=i.resolveComponent("a-input-number"),B=i.resolveComponent("a-checkbox"),R=i.resolveComponent("a-tab-pane"),g=i.resolveComponent("a-switch"),S=i.resolveComponent("a-button"),T=i.resolveComponent("a-divider"),O=i.resolveComponent("ToolOutlined"),F=i.resolveComponent("a-tooltip"),$=i.resolveComponent("a-table"),D=i.resolveComponent("a-tabs"),Q=i.resolveComponent("a-form"),U=i.resolveComponent("a-modal");return i.openBlock(),i.createBlock(U,{visible:y.value.visible,"onUpdate:visible":u[23]||(u[23]=E=>y.value.visible=E),title:y.value.title,centered:"",width:"50%",onOk:V},{default:i.withCtx(()=>[i.createVNode(Q,{name:"basic",ref_key:"form",ref:w,rules:m.value,model:y.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:i.withCtx(()=>[i.createVNode(D,null,{default:i.withCtx(()=>[i.createVNode(R,{key:"base",tab:"基本设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"操作标题",required:"",name:"title"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.title,"onUpdate:value":u[0]||(u[0]=E=>y.value.form.title=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"操作名称",name:"name",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.name,"onUpdate:value":u[1]||(u[1]=E=>y.value.form.name=E),disabled:t.preset.includes(y.value.form.name)},null,8,["value","disabled"])]),_:1}),i.createVNode(M,{label:"操作图标"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.icon,"onUpdate:value":u[2]||(u[2]=E=>y.value.form.icon=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮类型"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.type,"onUpdate:value":u[3]||(u[3]=E=>y.value.form.type=E),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),i.createVNode(M,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.index,"onUpdate:value":u[4]||(u[4]=E=>y.value.form.index=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮大小"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.size,"onUpdate:value":u[5]||(u[5]=E=>y.value.form.size=E),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮特性"},{default:i.withCtx(()=>[i.createVNode(B,{checked:y.value.form.props.block,"onUpdate:checked":u[6]||(u[6]=E=>y.value.form.props.block=E)},{default:i.withCtx(()=>u[24]||(u[24]=[i.createTextVNode("自适应 ")])),_:1},8,["checked"]),i.createVNode(B,{checked:y.value.form.props.danger,"onUpdate:checked":u[7]||(u[7]=E=>y.value.form.props.danger=E)},{default:i.withCtx(()=>u[25]||(u[25]=[i.createTextVNode("危险 ")])),_:1},8,["checked"]),i.createVNode(B,{checked:y.value.form.props.ghost,"onUpdate:checked":u[8]||(u[8]=E=>y.value.form.props.ghost=E)},{default:i.withCtx(()=>u[26]||(u[26]=[i.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),i.createVNode(R,{key:"action",tab:"响应设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"响应方式",required:""},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.type,"onUpdate:value":u[9]||(u[9]=E=>y.value.form.action.type=E),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.psn,"onUpdate:value":u[10]||(u[10]=E=>y.value.form.action.psn=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.component,"onUpdate:value":u[11]||(u[11]=E=>y.value.form.action.component=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(M,{label:"连接地址"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.href,"onUpdate:value":u[12]||(u[12]=E=>y.value.form.action.href=E)},null,8,["value"])]),_:1}),["link","route"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:2,label:"连接方式"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.target,"onUpdate:value":u[13]||(u[13]=E=>y.value.form.action.target=E),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:3,label:"抽屉位置"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.position,"onUpdate:value":u[14]||(u[14]=E=>y.value.form.action.position=E),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:4,label:"显示标题",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.title,"onUpdate:value":u[15]||(u[15]=E=>y.value.form.action.title=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:5,label:"蒙层关闭"},{default:i.withCtx(()=>[i.createVNode(g,{checked:y.value.form.action.maskClosable,"onUpdate:checked":u[16]||(u[16]=E=>y.value.form.action.maskClosable=E),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:6,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.width,"onUpdate:value":u[17]||(u[17]=E=>y.value.form.action.width=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:7,label:"显示高度"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.height,"onUpdate:value":u[18]||(u[18]=E=>y.value.form.action.height=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(T,{orientation:"left"},{default:i.withCtx(()=>[u[29]||(u[29]=i.createTextVNode("参数列表 ")),i.createVNode(S,{size:"small",class:"param-btn",onClick:f},{default:i.withCtx(()=>u[27]||(u[27]=[i.createTextVNode("添加")])),_:1}),i.createVNode(S,{size:"small",class:"param-btn",danger:"",onClick:d},{default:i.withCtx(()=>u[28]||(u[28]=[i.createTextVNode("删除")])),_:1})]),_:1}),i.createVNode($,{columns:n.value,"data-source":y.value.form.action.params,bordered:"",pagination:!1,"row-selection":l.value,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:E})=>[["name","title"].includes(E.key)?(i.openBlock(),i.createElementBlock("span",va,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(E.title),1)])):i.createCommentVNode("",!0),["value"].includes(E.key)?(i.openBlock(),i.createBlock(F,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:i.withCtx(()=>[i.createElementVNode("span",null,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(E.title),1)])]),_:2},1024)):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:E,text:P,record:I,index:_})=>[["name","title","value"].includes(E.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!s.value[_]||!Object.keys(s.value[_]).includes(E.dataIndex))&&!P&&"empty"]),onClick:z=>c(_,I,E.dataIndex)},[s.value[_]&&Object.keys(s.value[_]).includes(E.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(N,{key:0,value:s.value[_][E.dataIndex],"onUpdate:value":z=>s.value[_][E.dataIndex]=z,onBlur:z=>h(_,I,E.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[o]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(P),1)],64))],10,Sa)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),i.createVNode(R,{key:"event",tab:"事件设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"点击事件",help:y.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.clickScript,"onUpdate:modelValue":u[19]||(u[19]=E=>y.value.form.event.clickScript=E),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"禁用逻辑",help:y.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.disableScript,"onUpdate:modelValue":u[20]||(u[20]=E=>y.value.form.event.disableScript=E),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"显示逻辑",help:y.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.visibleScript,"onUpdate:modelValue":u[21]||(u[21]=E=>y.value.form.event.visibleScript=E),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"动态标题",help:y.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.titleScript,"onUpdate:modelValue":u[22]||(u[22]=E=>y.value.form.event.titleScript=E),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),[["__scopeId","data-v-75055a2b"]]),Ba=["src"],Na=["src"],Va=te(i.defineComponent({__name:"btn",props:{editor:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(a,{emit:e}){const t=Fe(),n=a,l=Y.useSession();i.watch(()=>n.widget?.event,()=>{s()}),i.onMounted(()=>{s()});const o=i.ref({});function s(){n.widget?.event&&(n.widget.event.clickScript?o.value.click=new Function("ctx","btn","event",n.widget.event.clickScript):n.widget.event.click&&(o.value.click=n.widget.event.click),n.widget.event.disableScript?o.value.disable=new Function("ctx","btn",n.widget.event.disableScript):n.widget.event.disable&&(o.value.disable=n.widget.event.disable),n.widget.event.visibleScript?o.value.visible=new Function("ctx","btn",n.widget.event.visibleScript):n.widget.event.visible&&(o.value.visible=n.widget.event.visible),n.widget.event.titleScript?o.value.title=new Function("ctx","btn",n.widget.event.titleScript):n.widget.event.title&&(o.value.title=n.widget.event.title)),typeof n.widget.click=="function"&&(o.value.click=n.widget.click),typeof n.widget.title=="function"&&(o.value.title=n.widget.title),typeof n.widget.visible=="function"&&(o.value.visible=n.widget.visible),typeof n.widget.disabled=="function"&&(o.value.disable=n.widget.disabled)}const r=i.computed(()=>o.value.title?o.value.title(p.value,n.widget):n.widget.title),c=i.computed(()=>o.value.visible?o.value.visible(p.value,n.widget)!=!1:n.widget.visible!=!1),h=i.computed(()=>n.disabled==!0?!0:o.value.disable?o.value.disable(p.value,n.widget):n.widget.disable==!0),f=i.ref(null);function d(){f.value?.open(n.widget,k=>{console.log("btn props",k),Object.keys(k).forEach(u=>{n.widget[u]=k[u]}),console.log("props btn",n.widget)})}const p=i.computed(()=>({...n.ctx,user:l.getPrincipal(),token:l.getToken()})),m=i.ref({open:!1}),b=i.computed(()=>{if(n.widget.action?.href){let k=n.widget.action.href;const u=k.matchAll("{[a-zA-Z.]*}"),N=[];let M=null;for(;M=u.next();){if(M&&M.value&&M.value[0]){let v=M.value[0].substring(1,M.value[0].length-1);N.includes(v)||N.push(v)}if(M.done)break}if(N.length>0)for(let v=0;v<N.length;v++){let C=N[v],B=Y.utils.obj.getValue(p.value,C);B?B instanceof Object?k=k.replaceAll("{"+C+"}",JSON.stringify(B)):Array.isArray(B)?k=k.replaceAll("{"+C+"}",B.join(",")):k=k.replaceAll("{"+C+"}",B):k=k.replaceAll("{"+C+"}","")}return k}return""}),y=i.computed(()=>{const k={};let u=n.widget.action?.href||n.widget.action?.link;if(u){const N=u.matchAll("{[a-zA-Z0-9.]*}"),M=[];let v=null;for(;v=N.next();){if(v&&v.value&&v.value[0]){let B=v.value[0].substring(1,v.value[0].length-1);M.includes(B)||M.push(B)}if(v.done)break}if(M.length>0)for(let B=0;B<M.length;B++){let R=M[B],g=Y.utils.obj.getValue(p.value,R);g?g instanceof Object?u=u.replaceAll("{"+R+"}",JSON.stringify(g)):Array.isArray(g)?u=u.replaceAll("{"+R+"}",g.join(",")):u=u.replaceAll("{"+R+"}",g):u=u.replaceAll("{"+R+"}","")}const C=u.split("?")[1];C&&C.split("&").forEach(B=>{const R=B.split("=");R[0]&&R[1]&&(k[R[0]]=R[1])})}return n.widget.action?.params&&n.widget.action.params.filter(N=>N.value+"").forEach(N=>{if(new RegExp("{[a-zA-Z0-9.]*}").test(N.value)){let v=Y.utils.obj.getValue(p.value,N.value);k[N.name]=v}else k[N.name]=N.value}),k}),A=e,x=i.inject("router");function w(k){if(t.isDebug&&console.log("unione btn click",n.widget,k),!(o.value.click&&o.value.click(p.value,n.widget,k)==!1)){if(n.widget.action?.type=="drawer"||n.widget.action?.type=="dialog")m.value.open=!0;else if(n.widget.action?.type=="route"&&(n.widget.action?.href||n.widget.action?.link)){if(n.widget.action.link&&n.editor?.type.value=="code")return;x.push({path:n.widget.action.href||n.widget.action?.link,query:y.value})}A("click",{btn:n.widget,event:k})}}function V(k){A("click",k)}return(k,u)=>{const N=i.resolveComponent("a-button"),M=i.resolveComponent("unione-btn"),v=i.resolveComponent("a-dropdown"),C=i.resolveComponent("a-drawer"),B=i.resolveComponent("a-modal");return c.value?(i.openBlock(),i.createBlock(lt,{key:0,class:i.normalizeClass(["unione-btn",a.widget.props?.block&&"unione-btn-block"]),model:a.editor?.model.value,onSetting:d,custome:!0,"setting-title":"按钮设置"},{default:i.withCtx(()=>[!a.widget.widget||a.widget.widget=="button"?(i.openBlock(),i.createBlock(N,i.mergeProps({key:0,disabled:h.value,size:a.widget.size||"small",type:a.type||a.widget.type,shape:a.widget.shape,class:"unione-btn-"+a.widget.name,loading:a.widget.loading,target:a.widget.action?.target,title:a.widget.tooltip,onClick:w},a.widget.props),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value)+" ",1)]),_:2},[a.widget.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.widget.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):i.createCommentVNode("",!0),a.widget.widget=="dropdown"?(i.openBlock(),i.createBlock(v,{key:1,trigger:[a.widget.trigger||"hover"],class:i.normalizeClass([a.widget.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["dropdown-overlay",a.widget.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.widget.items,R=>(i.openBlock(),i.createBlock(M,{key:R.name,class:"item",widget:R,editor:a.editor,preset:a.preset,ctx:a.ctx,onClick:V},null,8,["widget","editor","preset","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode(N,{size:a.widget.size||"small"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):i.createCommentVNode("",!0),a.widget.action?.type=="drawer"?(i.openBlock(),i.createBlock(C,{key:2,open:m.value.open,"onUpdate:open":u[0]||(u[0]=R=>m.value.open=R),title:a.widget.action?.title,placement:a.widget.action?.position,maskClosable:a.widget.action?.maskClosable,width:a.widget.action?.width,bodyStyle:{padding:0,overflow:!a.widget.action.component||a.widget.action.component=="iframe"?"hidden":"auto"}},{default:i.withCtx(()=>[!a.widget.action.component||a.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value},null,8,Ba)):i.createCommentVNode("",!0)]),_:1},8,["open","title","placement","maskClosable","width","bodyStyle"])):i.createCommentVNode("",!0),a.widget.action?.type=="dialog"?(i.openBlock(),i.createBlock(B,{key:3,open:m.value.open,"onUpdate:open":u[1]||(u[1]=R=>m.value.open=R),title:a.widget.action?.title,width:a.widget.action?.width,maskClosable:a.widget.action?.maskClosable,centered:"",footer:null},{default:i.withCtx(()=>[!a.widget.action.component||a.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value,style:i.normalizeStyle({height:a.widget.action?.height?a.widget.action?.height+"px":""})},null,12,Na)):i.createCommentVNode("",!0)]),_:1},8,["open","title","width","maskClosable"])):i.createCommentVNode("",!0),i.createVNode(fi,{ref_key:"btnSetting",ref:f,preset:n.preset},null,8,["preset"])]),_:1},8,["class","model"])):i.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b868da76"]]),Ra={key:0,class:"unione-widget-empty-tip"},Ea=te(i.defineComponent({__name:"tabs",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},setup(a){const e=a,t=i.ref(),n=i.computed(()=>e.editor?.widget(e.wid)||e.widget);return(l,o)=>{const s=i.resolveComponent("a-tab-pane"),r=i.resolveComponent("a-tabs");return i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-layout-tabs"]),model:e.editor?.model},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(r,{key:0,activeKey:t.value,"onUpdate:activeKey":o[0]||(o[0]=c=>t.value=c)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.chidlren,(c,h)=>(i.openBlock(),i.createBlock(s,{key:h,class:"unione-layout-tab-pane"},{tab:i.withCtx(()=>[i.createElementVNode("span",null,[c.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.icon),{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(c.title),1)])]),default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.chidlren,(f,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(f.widget),{key:d,wid:f.wid,editor:e.editor,widget:f},null,8,["wid","editor","widget"]))),128)),!c.chidlren||!c.chidlren.length?(i.openBlock(),i.createElementBlock("div",Ra,i.toDisplayString(c.emptyTips),1)):i.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["activeKey"])):i.createCommentVNode("",!0)]),_:1},8,["model"])}}}),[["__scopeId","data-v-7b565c89"]]),Oa={class:"title"},Ma={class:"text"},Ta={key:0,class:"reactive"},Ia={key:1,class:"opts"},Fa={class:"warp"},Da=te(i.defineComponent({__name:"section",props:i.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,t=i.computed(()=>e.editor?.widget(e.wid)||e.widget),n=i.computed(()=>t.value?.title||e.title),l=i.computed(()=>t.value?.icon||e.icon),o=i.computed(()=>t.value?.type||e.type),s=i.useModel(a,"modelValue");function r(){e.reactive&&(s.value=!s.value)}return(c,h)=>(i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-layout-section",s.value?"open":"close"]),model:e.editor?.model},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["head",a.location,a.reactive&&"reactive"]),onClick:r},[i.createElementVNode("div",Oa,[o.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["type",o.value])},null,2)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.value),{key:1,class:"icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",Ma,i.toDisplayString(n.value),1)]),a.reactive?(i.openBlock(),i.createElementBlock("div",Ta,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value?"UpOutlined":"DownOutlined")))])):i.createCommentVNode("",!0),a.location=="left"?(i.openBlock(),i.createElementBlock("div",Ia,[i.renderSlot(c.$slots,"opts",{},void 0,!0)])):i.createCommentVNode("",!0)],2),i.withDirectives(i.createElementVNode("div",Fa,[i.renderSlot(c.$slots,"default",{},void 0,!0)],512),[[i.vShow,s.value]])]),_:3},8,["class","model"]))}}),[["__scopeId","data-v-e75e9a84"]]),_a={class:"unione-props-setting unione-form-setting"},Pa={class:"unione-form-btns"},$a={key:0},La=["onClick"],Ua={class:"field-txt"},za=["onClick"],ja={key:1,class:"field-txt"},qa=["onClick"],Qa={key:0,class:"field-txt"},Wa={key:3,class:"edit-field"},Ya={key:0},Ha=["onClick"],Ka=te(i.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),n=i.computed(()=>{const v=e.editor.widget(e.wid)||{};return v.configs||(v.configs={}),v.configs.settings||(v.configs.settings={}),v.configs.settings.btns||(v.configs.settings.btns=[]),v}),l=i.computed(()=>(e.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),o=i.computed(()=>{const v=n.value.configs.settings.btns,C=v.map(B=>B.name);if(!C.includes("save")){const B={title:"保存",type:"primary",index:0,visible:!0,name:"save"};v.splice(B.index,0,B)}if(!C.includes("submit")){const B={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let R=B.index||1;v.splice(R,0,B)}if(!C.includes("reset")){const B={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};v.splice(B.index,0,B)}if(!C.includes("back")){const B={title:"返回",type:"default",index:3,visible:!0,name:"back"};v.splice(B.index,0,B)}return v}),s=i.ref(null);function r(v){s.value&&s.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(B=>{v[B]=C[B]}),n.value.configs.settings.btns.sort((B,R)=>{const g=B.index||1,S=R.index||1;return g-S}),n.value.configs.settings.btns=[...n.value.configs.btns]})}function c(){const v=n.value.configs.settings.btns.length+1;let C={title:"新增",name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};C.name="new_"+n.value.configs.settings.btns.length;const B=n.value.configs.settings.btns.filter(R=>R.name==C.name).length;B>0&&(C.name=C.name+B),n.value.configs.settings.btns.push(C),e.editor.widget(e.wid,n.value),s.value.open(C,R=>{Object.keys(R).forEach(g=>{C[g]=R[g]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(v){const C=()=>{if(["save","submit","reset","back"].includes(v.name))v.visible=!1,n.value.configs.settings.btns=[...n.value.configs.settings.btns];else{const B=[];n.value.configs.settings.btns.forEach(R=>{R.name!=v.name&&B.push(R)}),n.value.configs.settings.btns=B}};X.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{C()}})}const f=i.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:v=>{const C=f.value.widgets.filter(B=>B.value==v);return C[0]?C[0].label:v},toSetting:()=>{}}),d=i.ref({visible:!1,field:{},props:{},showInfo:v=>{let C="";return v.rules&&(C=v.rules.filter(B=>B.enable).length||""),C&&(C="("+C+")"),C},toSetting:()=>{const v=d.value.props,C={name:"range",trigger:v.trigger,whitespace:v.whitespace,message:v.rangeMessage};v.rangeMin!=null&&v.rangeMin!=null&&(C.min=v.rangeMin,C.enable=!0),v.rangeMax!=null&&v.rangeMax!=null&&(C.max=v.rangeMax,C.enable=!0);const B={name:"reg",trigger:v.trigger,whitespace:v.whitespace,message:v.regMessage};v.regExpress&&(B.pattern=v.regExpress,B.enable=!0),d.value.field.rules=[C,B],d.value.visible=!1,d.value.props={},console.log("rule",d.value.field.rules)}});function p(v){d.value.visible=!0,d.value.field=v;const C=v.rules||[],B={trigger:"change",whitespace:!0};C.forEach(R=>{R.name=="reg"&&(B.trigger=R.trigger,B.whitespace=R.whitespace,B.regExpress=R.pattern,B.regMessage=R.message),R.name=="range"&&(B.rangeMin=R.min,B.rangeMax=R.max,B.rangeMessage=R.message)}),d.value.props=B}const m=i.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{m.value.visible=!1}});function b(v,C){const B=w.value.filter(g=>g.name==v.name);B.forEach(g=>{C!="isSort"?g[C]=!0:g[C]=!g[C]});const R=B[0];if(!(!R||C=="isSort")){switch(m.value.prop=C,m.value.field=v,R.show||(R.show={}),C){case"isQuery":R.show.query||(R.show.query={}),m.value.show=R.show.query,m.value.title=`查询设置/${v.title}(${v.name})`;break;case"isForm":R.show.form||(R.show.form={}),m.value.show=R.show.form,m.value.title=`表单设置/${v.title}(${v.name})`;break;case"isView":R.show.view||(R.show.view={}),m.value.show=R.show.view,m.value.title=`详情设置/${v.title}(${v.name})`;break;case"isList":R.show.list||(R.show.list={}),m.value.show=R.show.list,m.value.title=`列头设置/${v.title}(${v.name})`;break}m.value.visible=!0}}const y=i.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{y.value.convert.options||(y.value.convert.options=[]),y.value.convert.options.push({label:"",value:""})},toDelOption:(v,C)=>{y.value.convert.options.splice(v,1)},toSetting:()=>{y.value.visible=!1}});function A(v){y.value.visible=!0,y.value.field=v,y.value.convert=v.convert||{}}const x=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),w=i.computed(()=>x.value.fields?.length?x.value.fields:[]),V={mounted:v=>v.focus()},k=i.ref({});function u(v,C){const B={};C=="convertName"?B[C]=v.convert?.type:B[C]=v[C]||"",k.value={},k.value[v.name]=B}function N(v,C){{k.value={};return}}function M(v,C){w.value.filter(R=>R.name==v.name).forEach(R=>{R[C]=!R[C]})}return(v,C)=>{const B=i.resolveComponent("a-divider"),R=i.resolveComponent("CloseOutlined"),g=i.resolveComponent("a-button"),S=i.resolveComponent("PlusOutlined"),T=i.resolveComponent("a-select"),O=i.resolveComponent("ToolOutlined"),F=i.resolveComponent("a-checkbox"),$=i.resolveComponent("a-table"),D=i.resolveComponent("a-select-option"),Q=i.resolveComponent("a-form-item"),U=i.resolveComponent("a-form"),E=i.resolveComponent("a-modal"),P=i.resolveComponent("a-checkbox-group"),I=i.resolveComponent("a-input-number"),_=i.resolveComponent("a-input"),z=i.resolveComponent("a-col"),K=i.resolveComponent("a-row");return i.openBlock(),i.createElementBlock("div",_a,[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[23]||(C[23]=[i.createTextVNode("按钮设置")])),_:1}),i.createElementVNode("div",Pa,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,L=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:L.name,class:["btn",L.name,!L.visible&&"deleted"],type:L.visible?L.type:"default",size:L.size,ref_for:!0},L.props||{},{onClick:J=>r(L)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(L.title)+" ",1),L.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"btn-del",onClick:i.withModifiers(J=>h(L),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[L.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(L.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","btn-add"]),size:"small",onClick:C[0]||(C[0]=L=>c())},{default:i.withCtx(()=>[i.createVNode(S)]),_:1})]),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[24]||(C[24]=[i.createTextVNode("表单设置")])),_:1}),C[36]||(C[36]=i.createTextVNode(" 数据模型:")),i.createVNode(T,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":C[1]||(C[1]=L=>n.value.dataModel=L)},null,8,["options","value"]),i.createVNode($,{columns:t.value,"data-source":w.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:L})=>[["widget","rules","convertName"].includes(L.key)?(i.openBlock(),i.createElementBlock("span",$a,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(L.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:L,text:J,record:ee})=>[["rules"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",!d.value.showInfo(ee)&&"empty"]),onClick:ke=>p(ee)},[i.createElementVNode("span",Ua,i.toDisplayString(d.value.showInfo(ee)),1),d.value.showInfo(ee)?(i.openBlock(),i.createBlock(g,{key:0,type:"link"},{default:i.withCtx(()=>C[25]||(C[25]=[i.createTextVNode("设置")])),_:1})):i.createCommentVNode("",!0)],10,La)):["widget"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!k.value[ee.name]||!Object.keys(k.value[ee.name]).includes(L.dataIndex))&&!J&&"empty"]),onClick:ke=>u(ee,L.dataIndex)},[k.value[ee.name]&&Object.keys(k.value[ee.name]).includes(L.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(T,{key:0,value:ee[L.dataIndex],"onUpdate:value":ke=>ee[L.dataIndex]=ke,options:f.value.widgets,onBlur:C[2]||(C[2]=ke=>N())},null,8,["value","onUpdate:value","options"])),[[V]]):(i.openBlock(),i.createElementBlock("span",ja,i.toDisplayString(f.value.widgetName(J)),1))],10,za)):["convertName"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!k.value[ee.name]||!Object.keys(k.value[ee.name]).includes(L.dataIndex))&&!ee.convert?.type&&"empty"]),onClick:ke=>u(ee,L.dataIndex)},[k.value[ee.name]&&Object.keys(k.value[ee.name]).includes(L.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(T,{key:0,value:ee[L.dataIndex],"onUpdate:value":ke=>ee[L.dataIndex]=ke,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:C[3]||(C[3]=ke=>N())},null,8,["value","onUpdate:value"])),[[V]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[ee.convert?.type?(i.openBlock(),i.createElementBlock("span",Qa,i.toDisplayString(ee.convert.type=="dict"?"字典":"静态"),1)):i.createCommentVNode("",!0),ee.convert?.type?(i.openBlock(),i.createBlock(g,{key:1,type:"link",onClick:i.withModifiers(ke=>A(ee),["stop"])},{default:i.withCtx(()=>C[26]||(C[26]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])):i.createCommentVNode("",!0)],64))],10,qa)):["isForm","isView"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",Wa,[i.createVNode(F,{checked:ee[L.dataIndex],onClick:ke=>M(ee,L.dataIndex)},null,8,["checked","onClick"]),i.createVNode(g,{type:"link",onClick:ke=>b(ee,L.dataIndex)},{default:i.withCtx(()=>C[27]||(C[27]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(E,{visible:f.value.visible,"onUpdate:visible":C[5]||(C[5]=L=>f.value.visible=L),title:"控件设置",onOk:f.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:f.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[f.value.field.widget=="a-select"?(i.openBlock(),i.createBlock(Q,{key:0,label:"下拉框类型"},{default:i.withCtx(()=>[i.createVNode(T,{value:f.value.props.mode,"onUpdate:value":C[4]||(C[4]=L=>f.value.props.mode=L),allowClear:!0},{default:i.withCtx(()=>[i.createVNode(D,{value:"multiple"},{default:i.withCtx(()=>C[28]||(C[28]=[i.createTextVNode("多选")])),_:1}),i.createVNode(D,{value:"tags"},{default:i.withCtx(()=>C[29]||(C[29]=[i.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(E,{visible:d.value.visible,"onUpdate:visible":C[13]||(C[13]=L=>d.value.visible=L),title:"规则设置",onOk:d.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:d.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[30]||(C[30]=[i.createTextVNode("基本设置")])),_:1}),i.createVNode(Q,{label:"触发时机"},{default:i.withCtx(()=>[i.createVNode(P,{value:d.value.props.trigger,"onUpdate:value":C[6]||(C[6]=L=>d.value.props.trigger=L),options:["change","blur"]},null,8,["value"])]),_:1}),d.value.field.isNull?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Q,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:i.withCtx(()=>[i.createVNode(F,{value:d.value.props.whitespace,"onUpdate:value":C[7]||(C[7]=L=>d.value.props.whitespace=L),checked:d.value.props.whitespace},{default:i.withCtx(()=>C[31]||(C[31]=[i.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[32]||(C[32]=[i.createTextVNode("数值区间")])),_:1}),i.createVNode(Q,{label:"有效区间"},{default:i.withCtx(()=>[i.createVNode(I,{value:d.value.props.rangeMin,"onUpdate:value":C[8]||(C[8]=L=>d.value.props.rangeMin=L)},null,8,["value"]),C[33]||(C[33]=i.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),i.createVNode(I,{value:d.value.props.rangeMax,"onUpdate:value":C[9]||(C[9]=L=>d.value.props.rangeMax=L)},null,8,["value"])]),_:1}),i.createVNode(Q,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.rangeMessage,"onUpdate:value":C[10]||(C[10]=L=>d.value.props.rangeMessage=L)},null,8,["value"])]),_:1}),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[34]||(C[34]=[i.createTextVNode("正则验证")])),_:1}),i.createVNode(Q,{label:"表达式"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.regExpress,"onUpdate:value":C[11]||(C[11]=L=>d.value.props.regExpress=L)},null,8,["value"])]),_:1}),i.createVNode(Q,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.regMessage,"onUpdate:value":C[12]||(C[12]=L=>d.value.props.regMessage=L)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(E,{visible:m.value.visible,"onUpdate:visible":C[20]||(C[20]=L=>m.value.visible=L),title:m.value.title,onOk:m.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:m.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(Q,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(I,{value:m.value.show.index,"onUpdate:value":C[14]||(C[14]=L=>m.value.show.index=L)},null,8,["value"])]),_:1}),["isQuery"].includes(m.value.prop)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Q,{key:0,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.width,"onUpdate:value":C[15]||(C[15]=L=>m.value.show.width=L)},null,8,["value"])]),_:1})),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:1,label:"标题宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.labelWidth,"onUpdate:value":C[16]||(C[16]=L=>m.value.show.labelWidth=L)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:2,label:"控件宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.valueWidth,"onUpdate:value":C[17]||(C[17]=L=>m.value.show.valueWidth=L)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:3,label:"固定位置"},{default:i.withCtx(()=>[i.createVNode(T,{value:m.value.show.fixed,"onUpdate:value":C[18]||(C[18]=L=>m.value.show.fixed=L),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:4,label:"对齐方式"},{default:i.withCtx(()=>[i.createVNode(T,{value:m.value.show.align,"onUpdate:value":C[19]||(C[19]=L=>m.value.show.align=L),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),i.createVNode(E,{visible:y.value.visible,"onUpdate:visible":C[22]||(C[22]=L=>y.value.visible=L),title:y.value.convert.type=="dict"?"字典设置":"选项设置",onOk:y.value.toSetting},{default:i.withCtx(()=>[y.value.convert.type!="dict"?(i.openBlock(),i.createElementBlock("div",Ya,[i.createVNode(g,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:y.value.toAddOption},{default:i.withCtx(()=>C[35]||(C[35]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode($,{columns:y.value.optionColumn,"data-source":y.value.convert.options,size:"small"},{bodyCell:i.withCtx(({column:L,record:J,index:ee})=>[L.dataIndex==="label"?(i.openBlock(),i.createBlock(_,{key:0,value:J.label,"onUpdate:value":ke=>J.label=ke,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),L.dataIndex==="value"?(i.openBlock(),i.createBlock(_,{key:1,value:J.value,"onUpdate:value":ke=>J.value=ke,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),L.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:2,onClick:ke=>y.value.toDelOption(ee,J)},"删除",8,Ha)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):i.createCommentVNode("",!0),y.value.convert.type=="dict"?(i.openBlock(),i.createBlock(U,{key:1,model:y.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(K,{type:"flex",style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(z,{span:24,order:1},{default:i.withCtx(()=>[i.createVNode(Q,{label:"字典名称:"},{default:i.withCtx(()=>[i.createVNode(_,{value:y.value.convert.dict,"onUpdate:value":C[21]||(C[21]=L=>y.value.convert.dict=L)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):i.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),i.createVNode(fi,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),Ga=te(i.defineComponent({__name:"form",props:{editor:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1}},setup(a,{expose:e}){const t=a,n=i.ref(!1),l=i.ref(),o=i.ref({}),s=i.ref(null);i.onMounted(()=>{if(c.value.dsn){const w=r.value.dataManager();c.value.primary&&w.psn(c.value.dsn),s.value.setDisabled=x,s.value.getValue=p,s.value.setValue=m,s.value.reset=b,l.value=w.useForm(c.value.dsn,s.value,V=>{o.value=V.body||{}})}t.editor||r.value.loadConfig({widgets:h.value}),t.form?.model&&r.value.setModel(t.form.model),y()});const r=i.computed(()=>t.editor||new ut),c=i.computed(()=>t.widget||t.form||{}),h=i.computed(()=>{let w=c.value.widgets||[];return!w.length&&t.form?.fields&&(w=t.form.fields),w.forEach(V=>{V.widget||(V.widget="unione-form-item"),V.control||(V.control="a-input")}),w}),f=i.inject("pageSetting",{}),d=i.computed(()=>c.value.setting||f?.form||{});i.provide("formSetting",d.value);function p(){return o.value}function m(w){o.value=w,y()}function b(){o.value={},y()}function y(){const w=V=>{V.widget=="unione-form-item"&&V.name&&(V.value!=null&&V.value!=null&&V.value!=""||V.value==0)&&(o.value[V.name]==null||o.value[V.name]==null||o.value[V.name]=="")&&(o.value[V.name]=V.value),V.widgets?.forEach(k=>{w(k)})};h.value.forEach(V=>{w(V)})}function A(){return s.value.validate()}function x(w=!0){n.value=w}return e({validate:A,getValue:p,setValue:m,reset:b,setDisabled:x}),(w,V)=>{const k=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(lt,{class:"unione-form-widget","setting-title":"表单设置",model:r.value.model.value},i.createSlots({default:i.withCtx(()=>[i.createVNode(k,{ref_key:"formObj",ref:s,model:o.value,class:i.normalizeClass(["unione-form",r.value.model.value,"form-layout-col-"+(d.value.showColumn||3)])},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(u,N)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.widget),{key:N,widget:u,editor:r.value,value:o.value[u.name],"onUpdate:value":M=>o.value[u.name]=M,disabled:n.value,formValue:o.value},null,40,["widget","editor","value","onUpdate:value","disabled","formValue"]))),128))]),_:1},8,["model","class"])]),_:2},[a.editor&&c.value.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(Ka,{wid:c.value.wid,editor:a.editor},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-cecc4588"]]);function Cl(a,e=!1){const t=Fe();if(!a)return Promise.reject("字典名称不能为空");const n=localStorage.getItem("UNIONE-DICT-"+a);return n&&e==!1?Promise.resolve(JSON.parse(n)):(t.isDebug&&console.log("进入:加载字典数据方法,dict name:"+a+",force:"+e),new Promise((l,o)=>{Y.axios.admin({url:"/api/system/dict/load/"+a}).then(s=>{if(s.success){const r=s.body.filter(c=>c.dictName!=c.dictKey);r.forEach(c=>{c.value=c.dictKey,c.label=c.dictValue}),r.length?(localStorage.setItem("UNIONE-DICT-"+a,JSON.stringify(r)),l(r)):o("字典加载失败,dict:"+a+",字典项列表为空")}else t.isDebug&&console.error("字典加载失败,dict:"+a,s),o("字典加载失败,dict:"+a+",error:"+s.message)})}))}async function vl(a,e){const t=Fe();if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("字典key为空");const n=await Cl(a),l=n.filter(o=>o.dictKey==e);return l.length>0?Promise.resolve(l[0]):(t.isDebug&&console.log("字典项匹配失败,name:"+a+",key:"+e+"options:",n),Promise.reject("字典项匹配失败,name:"+a+",key:"+e))}async function Ja(a,e){const t=await vl(a,e);return Promise.resolve(t.dictValue)}const Sl={load:Cl,getLabel:Ja,getOption:vl};class Ge{convertObj;config;options;constructor(e){(!e||!e.types)&&console.error("转换器定义不能为空,type不能为空",e),e.valueField||(e.valueField="id"),e.labelField||(e.labelField="title"),this.convertObj=e,this.options=e.options||[],this.config=Fe()}load(e,t=!1){return!(e==null||e==null||e=="undefined"||!(e+"").length)&&this.options?.length&&this.options.filter(n=>n.value==e).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((n,l)=>{if(!this.convertObj.dictName){l("字典名称不能为空,id:"+this.convertObj.id);return}Sl.load(this.convertObj.dictName,t).then(o=>{this.options=o,typeof e=="number"&&this.options.forEach(s=>{s.value=parseInt(s.value)}),n(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject("静态转换器选项为空,id:"+this.convertObj.id))):!this.convertObj.id&&this.convertObj.types!="local"?Promise.reject("转换器id不能为空,type:"+this.convertObj.types):new Promise((n,l)=>{const o={body:this.convertObj.params||{}};this.convertObj.pidField&&(o.pid=-1);const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:s,data:o,method:"POST"}).then(r=>{r.success?(this.options=r.body,this.$processOptions(this.options),typeof e=="number"&&this.options.forEach(c=>{c.value=parseInt(c.value)}),e==null||e==null||e=="undefined"||!(e+"").length?this.options.length?n(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(h=>h.value==e).length?n(this.options):(o.body||(o.body={}),o.body[this.convertObj.valueField||"id"]=e,Y.axios.admin({url:s,data:o,method:"POST"}).then(h=>{if(h.success){const f={};this.options.forEach(d=>{f[e]=!0}),h.body.forEach(d=>{f[d.value]||this.options.push(d)}),n(this.options)}else l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+r.message))})})}convert(e){if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?Sl.getLabel(this.convertObj.dictName,e):Promise.reject("字典名称不能为空");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const t=this.convertObj.options.filter(n=>n.value==e);return t.length?Promise.resolve(t[0].label):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e,this.convertObj),Promise.reject("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e))}return Promise.reject("静态转换器选项为空,id:"+this.convertObj.id)}if(this.options?.length){const t=this.options.filter(n=>n.value==e);if(t.length)return Promise.resolve(t[0].label)}return new Promise((t,n)=>{this.load(e).then(l=>{const o=l.filter(s=>s.value==e);if(o.length)return t(o[0].label);n()})})}children(e=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+e),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.reject("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id):new Promise((n,l)=>{const o=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:o,data:e,method:"POST"}).then(s=>{s.success?(this.$processOptions(s.body),this.options=[...this.options,...s.body],n(s.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e,s),l("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e+",error:"+s.message))})}):Promise.reject("转换器未设置parentField,id:"+this.convertObj.id)}search(e){if(this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+e),this.convertObj.types=="dict"||this.convertObj.types=="option")return Promise.resolve(this.options.filter(n=>n.label.indexOf(e)>=0));const t={...this.convertObj.params||{}};return new Promise(n=>{const l=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:l,data:{body:{...t,keywords:e}},method:"POST"}).then(o=>{o.success?(this.$processOptions(o.body),n(o.body)):n([])})})}$processOptions(e){return this.convertObj.types=="local"&&e.forEach(t=>{this.convertObj.idField&&(t.id=t[this.convertObj.idField]),this.convertObj.pidField&&(t.pid=t[this.convertObj.pidField]),t.value=t[this.convertObj.valueField||"id"],t.label=t[this.convertObj.labelField||"title"]}),e}}function pt(a,e=350){let t=null;return n=>{clearTimeout(t),t=setTimeout(()=>{a(n)},e)}}const Xa=["innerHTML"],Za={key:2,class:"text-view"},er=te(i.defineComponent({__name:"formItem",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.computed(()=>o.value.showFormat?o.value.showFormat.call(this,t.value,{label:A.value,form:e.formValue}):A.value||t.value),l=i.inject("formSetting");i.onMounted(()=>{s.value.value!=null&&typeof s.value.value<"u"&&(e.formValue[s.value.name]==null||e.formValue[s.value.name]==null||typeof e.formValue[s.value.name]>"u")&&(t.value=s.value.value,s.value.widget=="unione-check-box"&&(Array.isArray(s.value.value)||(typeof s.value.value=="string"?t.value=s.value.value.split(","):t.value=[s.value.value])))});const o=i.ref({}),s=i.computed(()=>{const x=e.editor?.widget(e.wid)||e.widget||{};return x.event&&Object.keys(x.event).forEach(w=>{const V=x.event[w];V&&(o.value[w]=null,typeof V=="function"?o.value[w]=V:V.enable&&V.scriptText&&(o.value[w]=new Function("value","ctx",V.scriptText)))}),x}),r=i.computed(()=>!(o.value.visible&&o.value.visible(e.formValue[s.value.name],e.formValue)==!1)),c=i.computed(()=>o.value.title&&o.value.title(e.formValue[s.value.name],e.formValue)||s.value.title),h=pt(()=>{if(o.value.change)return o.value.change(e.formValue[s.value.name],e.formValue)||s.value.change;s.value.change&&s.value.change(e.formValue[s.value.name],e.formValue)}),f=i.ref({}),d=i.computed(()=>{const x=[],w=s.value.rule||{};let V=s.value.props?.required||s.value.required;if(o.value.required&&(V=o.value.required(e.formValue[s.value.name],e.formValue)),V&&x.push({required:!0,whitespace:w?.whitespace||!1,trigger:w?.trigger||l.ruleTrigger||"change",validator:(k,u)=>(w?.whitespace&&u&&typeof u=="string"&&(u=u.trim()),u!=null&&u!=null&&(u+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(c.value+"不能为空!"))}),w.advance&&f.value[w.advance]){const k=f.value[w.advance];x.push({pattern:k.pattern,message:k.message||"表单验证不通过!",trigger:w.trigger||l.ruleTrigger||"change"})}return w.regExpress&&x.push({pattern:w.regExpress,message:w.regMessage||"表单验证不通过!",trigger:w.trigger||l.ruleTrigger||"change"}),s.value.dataLen&&x.push({validator:(k,u)=>u&&(u+"").length>s.value.dataLen?Promise.reject("最大长度["+s.value.dataLen+"],当前:["+(u+"").length+"]"):Promise.resolve(),trigger:w?.trigger||l.ruleTrigger||"change"}),x}),p=i.computed(()=>{const x=s.value.props||{};if(s.value.control=="a-input-number"){const w=s.value.rule||{};w.rangeMin!=null&&w.rangeMin!=null&&(x.min=w.rangeMin),w.rangeMax!=null&&w.rangeMax!=null&&(x.max=w.rangeMax)}return s.value.control=="a-date-picker"&&s.value.view?.dataFormat&&(x.format=s.value.view.dataFormat,x.valueFormat=s.value.view.dataFormat),s.value.required&&(x.required=s.value.required),x}),m=i.computed(()=>{const x=s.value.css||{},w=["form-item-"+s.value.name];return x.cssName&&w.push(x.cssName),l.platform=="app"?x.cssName?typeof x.cssName=="string"&&x.cssName.indexOf("all-line")<0&&w.push("all-line"):w.push("all-line"):s.value.view?.width&&(s.value.view.width>=3?(!x.cssName||typeof x.cssName=="string"&&x.cssName.indexOf("all-line")<0)&&w.push("all-line"):s.value.view.width==2&&w.push("2in-line")),w}),b=i.computed(()=>{const x=l.showColumn||3;let w=s.value.view?.labelWidth||l.labelWidth||9;return s.value.css?.cssName&&x>1&&typeof s.value.css.cssName=="string"&&s.value.css.cssName.indexOf("all-line")>=0?{span:Math.round(w/x)}:s.value.view?.width>=3&&x>1?{span:Math.round(w/x)}:{span:w}}),y=i.computed(()=>{const x=l.showColumn||3;let w=s.value.view?.valueWidth||l.valueWidth||19;return s.value.css?.cssName&&x>1&&m.value.includes("all-line")?{}:{span:w}}),A=i.ref();return i.watch(t,()=>{t.value&&e.editor?.model.value=="view"&&s.value.convert&&new Ge(s.value.convert).convert(t.value.toString()).then(x=>{A.value=x})}),(x,w)=>{const V=i.resolveComponent("a-form-item");return i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-form-item",m.value]),style:i.normalizeStyle(s.value.css?.cssText)},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createBlock(V,{key:0,label:c.value,name:s.value.name,labelCol:b.value,wrapperCol:y.value,required:s.value.props?.required,rules:d.value,help:(!e.editor||e.editor.model.value!="view")&&s.value.props?.help,tooltip:s.value.props?.tooltip},{default:i.withCtx(()=>[!e.editor||s.value.view=="self"||e.editor.model.value!="view"&&s.value.view!="html"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value.control||"a-input"),i.mergeProps({key:0,wid:s.value.wid,widget:s.value,editor:e.editor,disabled:a.disabled,onChange:i.unref(h),value:t.value,"onUpdate:value":w[0]||(w[0]=k=>t.value=k),formValue:a.formValue},p.value,{style:s.value.css?.props}),null,16,["wid","widget","editor","disabled","onChange","value","formValue","style"])):s.value.view=="html"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"text-view text-html",innerHTML:n.value},null,8,Xa)):(i.openBlock(),i.createElementBlock("div",Za,i.toDisplayString(n.value),1))]),_:1},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip"])):i.createCommentVNode("",!0)]),_:1},8,["class","style"])}}}),[["__scopeId","data-v-20adb860"]]),tr=te(i.defineComponent({__name:"selectBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){Fe();const e=a,t=i.useModel(a,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]),o=i.computed(()=>{const m=d.value.convert||e.convert||{};if(m.refValue){const b={};return m.refValue.split(",").forEach(A=>{const x=A.split("=");x.length==1?b[x[0]]=Y.utils.obj.getValue(e.formValue,x[0]):b[x[0]]=Y.utils.obj.getValue(e.formValue,x[1])}),b}return{}}),s=i.computed(()=>(d.value.convert||e.convert||{}).search||!1),r=pt(m=>{const b=d.value.convert||e.convert||{};b.params={...h.value,...o.value},p.value.search(m).then(y=>{n.value=y})},500);function c(m,b){f.value.select&&f.value.select(m,{option:b,formValue:e.formValue})}const h=i.ref();i.onMounted(()=>{const m=d.value.convert||e.convert||{};h.value=m.params||{},m.params={...h.value,...o.value},p.value.load(t.value).then(b=>{n.value=b})});const f=i.ref({}),d=i.computed(()=>{const m=e.editor?.widget(e.wid)||e.widget||{};return m.event&&Object.keys(m.event).forEach(b=>{const y=m.event[b];y&&(f.value[b]=null,typeof y=="function"?f.value[b]=y:y.enable&&y.scriptText&&(f.value[b]=new Function("value","ctx",y.scriptText)))}),m}),p=i.computed(()=>{const m=d.value.convert||e.convert||{};return new Ge(m)});return i.watch(t,pt(()=>{t.value&&p.value.load(t.value).then(m=>{n.value=m})},200)),i.watch(()=>d.value.convert||e.convert||{},pt(()=>{p.value.load().then(m=>{n.value=m})})),i.watch(()=>o.value,pt(()=>{if(console.log(d.value.name+" ref value changed",o.value),o.value){const m=d.value.convert||e.convert||{};m.params={...h.value,...o.value},p.value.load(t.value,!0).then(b=>{n.value=b})}},200),{deep:!0}),(m,b)=>{const y=i.resolveComponent("a-select");return i.openBlock(),i.createBlock(y,{class:"unione-form-select",options:l.value,showSearch:s.value,value:t.value,"onUpdate:value":b[0]||(b[0]=A=>t.value=A),onSearch:i.unref(r),onSelect:c},null,8,["options","showSearch","value","onSearch"])}}}),[["__scopeId","data-v-70aaf6fe"]]),ir=te(i.defineComponent({__name:"switchBox",props:i.mergeModels({editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.ref({});i.onMounted(()=>{s.value?.load(t.value).then(r=>{r.forEach(c=>{c.value&&(c.value=="1"||c.value=="true"||c.value=="TRUE")?(n.value.checkedChildren=c.label,c.value=="true"||c.value=="TRUE"?n.value.checkedValue=!0:n.value.checkedValue=1):(n.value.unCheckedChildren=c.label,c.value=="false"||c.value=="FALSE"?n.value.unCheckedValue=!1:n.value.unCheckedValue=0)})})});const l=i.ref({}),o=i.computed(()=>{const r=e.widget||{};return r.event&&Object.keys(r.event).forEach(c=>{const h=r.event[c];h&&(l.value[c]=null,typeof h=="function"?l.value[c]=h:h.enable&&h.scriptText&&(l.value[c]=new Function("value","ctx",h.scriptText)))}),r}),s=i.computed(()=>{const r=o.value.convert||e.convert;return r?new Ge(r):null});return(r,c)=>{const h=i.resolveComponent("a-switch");return i.openBlock(),i.createBlock(h,i.mergeProps({class:"unione-form-switch"},n.value,{checked:t.value,"onUpdate:checked":c[0]||(c[0]=f=>t.value=f)}),null,16,["checked"])}}}),[["__scopeId","data-v-32bff921"]]),nr=te(i.defineComponent({__name:"radioBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]),o=i.computed(()=>{const f=c.value.convert||e.convert||{};if(f.refValue){const d={};return f.refValue.split(",").forEach(m=>{const b=m.split("=");b.length==1?d[b[0]]=Y.utils.obj.getValue(e.formValue,b[0]):d[b[0]]=Y.utils.obj.getValue(e.formValue,b[1])}),console.log(c.value.name+" ref field:"+f.refValue+",ref value",d),d}return{}}),s=i.ref();i.onMounted(()=>{const f=c.value.convert||e.convert||{};s.value=f.params||{},f.params={...s.value,...o.value},h.value.load(t.value||c.value.value).then(d=>{n.value=d})});const r=i.ref({}),c=i.computed(()=>{const f=e.editor?.widget(e.wid)||e.widget||{};return f.event&&Object.keys(f.event).forEach(d=>{const p=f.event[d];p&&(r.value[d]=null,typeof p=="function"?r.value[d]=p:p.enable&&p.scriptText&&(r.value[d]=new Function("value","ctx",p.scriptText)))}),f}),h=i.computed(()=>{const f=c.value.convert||e.convert||{};return new Ge(f)});return i.watch(()=>o.value,()=>{if(console.log(c.value.name+" ref value changed",o.value),o.value){const f=c.value.convert||e.convert||{};f.params={...s.value,...o.value},h.value.load(void 0,!0).then(d=>{n.value=d})}},{deep:!0}),(f,d)=>{const p=i.resolveComponent("a-radio-group");return i.openBlock(),i.createBlock(p,{class:"unione-form-radio",options:l.value,value:t.value,"onUpdate:value":d[0]||(d[0]=m=>t.value=m)},null,8,["options","value"])}}}),[["__scopeId","data-v-78969849"]]),lr=te(i.defineComponent({__name:"checkBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},returnType:{type:String,default:"string"},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:i.mergeModels(["change"],["update:value"]),setup(a,{emit:e}){const t=a,n=i.useModel(a,"value"),l=i.ref(),o=i.ref([]),s=i.computed(()=>o.value?.length?o.value:t.options?.length?t.options:[]),r=i.computed(()=>{const b=f.value.convert||t.convert||{};if(b.refValue){const y={};return b.refValue.split(",").forEach(x=>{const w=x.split("=");w.length==1?y[w[0]]=Y.utils.obj.getValue(t.formValue,w[0]):y[w[0]]=Y.utils.obj.getValue(t.formValue,w[1])}),console.log(f.value.name+" ref field:"+b.refValue+",ref value",y),y}return{}}),c=i.ref();i.onMounted(()=>{const b=n.value||f.value.value;t.returnType==="string"?l.value=b.split(","):l.value=b;const y=f.value.convert||t.convert||{};c.value=y.params||{},y.params={...c.value,...r.value},m.value.load().then(A=>{o.value=A})});const h=i.ref({}),f=i.computed(()=>{const b=t.editor?.widget(t.wid)||t.widget||{};return b.event&&Object.keys(b.event).forEach(y=>{const A=b.event[y];h.value[y]=null,A.enable&&A.scriptText&&(h.value[y]=new Function("value","ctx",A.scriptText))}),b}),d=e;function p(b){t.returnType==="string"?n.value=b.join(","):n.value=b,console.log("checkbox changed",n.value),d("change",n.value)}const m=i.computed(()=>{const b=f.value.convert||t.convert||{};return new Ge(b)});return i.watch(()=>n.value,()=>{l.value=Array.isArray(n.value)?n.value:[],n.value&&!Array.isArray(n.value)&&(l.value=n.value.split(","))}),i.watch(()=>r.value,()=>{if(console.log(f.value.name+" ref value changed",r.value),r.value){l.value=[],t.returnType==="string"?n.value="":n.value=[];const b=f.value.convert||t.convert||{};b.params={...c.value,...r.value},m.value.load(void 0,!0).then(y=>{o.value=y})}},{deep:!0}),(b,y)=>{const A=i.resolveComponent("a-checkbox-group");return i.openBlock(),i.createBlock(A,{class:"unione-form-checkbox",options:s.value,value:l.value,"onUpdate:value":y[0]||(y[0]=x=>l.value=x),onChange:p},null,8,["options","value"])}}}),[["__scopeId","data-v-1aa92231"]]),or=te(i.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(a){const e=i.ref(),t=i.useModel(a,"value");return i.watch(()=>e.value,()=>{e.value?t.value=Y.utils.sm2Encrypt(e.value):t.value=""}),(n,l)=>{const o=i.resolveComponent("a-input-password");return i.openBlock(),i.createBlock(o,{class:"unione-form-password",value:e.value,"onUpdate:value":l[0]||(l[0]=s=>e.value=s)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]);function sn(a){const e=a.toLowerCase().split("_"),t=[];t.push(e[0]);for(let n=1;n<e.length;n++){const l=e[n];l&&(t.push(l.charAt(0).toUpperCase()),l.length>1&&t.push(l.substring(1)))}return t.join("")}const Bl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Nl(a=10){const e=Date.now().toString(),t=new Uint32Array(a);crypto.getRandomValues(t);let n="";for(let l=0;l<a;l++){const o=(parseInt(e[l%e.length],10)+t[l])%Bl.length;n+=Bl[o]}return n}const sr={toHump:sn,randomStr:Nl},ar=te(i.defineComponent({__name:"randomInput",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object},len:{type:Number,default:10}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value");function n(){t.value=Nl(e.len)}return(l,o)=>{const s=i.resolveComponent("SyncOutlined"),r=i.resolveComponent("a-input");return i.openBlock(),i.createBlock(r,{class:"unione-form-random-input",value:t.value,"onUpdate:value":o[0]||(o[0]=c=>t.value=c)},{suffix:i.withCtx(()=>[i.createVNode(s,{style:{color:"rgba(0, 0, 0, 0.45)"},onClick:n})]),_:1},8,["value"])}}}),[["__scopeId","data-v-8e6d89b8"]]),rr={class:"unione-props-setting unione-query-setting"},cr={class:"unione-query-opts"},dr={key:0},hr=["onClick"],fr={key:1},ur={key:1,class:"edit-field"},pr=["onClick"],mr=te(i.defineComponent({__name:"querySetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:V})=>V+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"30px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"55px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"}]),n=i.computed(()=>{const V=e.editor.widget(e.wid)||{};return V.configs||(V.configs={}),V.configs.btns||(V.configs.btns=[]),V}),l=i.computed(()=>(e.editor.dataModels()||[]).map(k=>({value:k.sn,label:k.title+"("+k.name+")"}))),o=i.computed(()=>{const V=[],k=[];return n.value.configs.btns||(n.value.configs.btns=[]),n.value.configs.btns.forEach(u=>{V.push(u),k.push(u.name)}),k.includes("query")||V.splice(0,0,{visible:!0,name:"query",title:"搜索",type:"primary"}),k.includes("reset")||V.splice(1,0,{visible:!0,name:"reset",title:"重置",type:"default"}),k.includes("reset")||V.splice(1,0,{visible:!0,name:"advanced",title:"高级搜索",type:"default"}),V.sort((u,N)=>{const M=u.index||1,v=N.index||1;return M-v}),V}),s=i.ref(null);function r(V){s.value&&s.value.open(V,k=>{k.visible=!0,Object.keys(k).forEach(u=>{V[u]=k[u]}),n.value.configs.btns.sort((u,N)=>{const M=u.index||1,v=N.index||1;return M-v}),n.value.configs.btns=[...n.value.configs.btns]})}function c(){const V=n.value.configs.btns.length+1;let k={title:"新增",name:"new_"+V,size:"default",index:V,visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.btns.push(k),e.editor.widget(e.wid,n.value),s.value.open(k,u=>{Object.keys(u).forEach(N=>{k[N]=u[N]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(V){const k=()=>{if(["query","reset","advanced"].includes(V.name))V.visible=!1,n.value.configs.btns=[...n.value.configs.btns];else{const u=[];n.value.configs.btns.forEach(N=>{N.name!=V.name&&u.push(N)}),n.value.configs.btns=u}};X.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{k()}})}const f=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),d=i.computed(()=>f.value.fields?.length?f.value.fields:[]),p={mounted:V=>V.focus()},m=i.ref({});function b(){const V=Object.keys(m.value);if(V.length)for(let k in V){const u=d.value.filter(N=>N.name==k);if(u&&u[0]){let N=m.value[k];Object.keys(N).forEach(M=>{if(M=="showIndex"){const v=u[0].show?.query||{};u[0].show||(u[0].show={}),u[0].show.query={...v,index:N[M]}}else u[0][M]=N[M]})}}m.value={}}function y(V,k){b();const u={};u[k]=V[k]||"",k=="showIndex"&&(u[k]=V.show?.query?.index),m.value[V.name]=u}function A(V,k){if(!V||!k){m.value={};return}const u=m.value[V.name][k];if(k=="showIndex"){const N=V.show?.query||{};V.show||(V.show={}),V.show.query={...N,index:u}}else V[k]=u;m.value={}}function x(V,k){d.value.filter(N=>N.name==V.name).forEach(N=>{N[k]=!N[k]})}const w=i.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:V=>{const k=w.value.options.filter(u=>u.value==V);return k[0]?k[0].label:V}});return(V,k)=>{const u=i.resolveComponent("a-divider"),N=i.resolveComponent("CloseOutlined"),M=i.resolveComponent("a-button"),v=i.resolveComponent("PlusOutlined"),C=i.resolveComponent("a-select"),B=i.resolveComponent("ToolOutlined"),R=i.resolveComponent("a-checkbox"),g=i.resolveComponent("a-input-number"),S=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",rr,[i.createVNode(u,{orientation:"left"},{default:i.withCtx(()=>k[3]||(k[3]=[i.createTextVNode("查询按钮")])),_:1}),i.createElementVNode("div",cr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,T=>(i.openBlock(),i.createBlock(M,i.mergeProps({key:T.name,class:["btn",T.name,!T.visible&&"deleted"],type:T.visible?T.type:"default",size:T.size||"default",ref_for:!0},T.props||{},{onClick:O=>r(T)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(T.title)+" ",1),T.visible?(i.openBlock(),i.createBlock(N,{key:0,class:"btn-del",onClick:i.withModifiers(O=>h(T),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[T.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(T.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(M,{class:i.normalizeClass(["btn","btn-add"]),onClick:k[0]||(k[0]=T=>c()),size:"small"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1})]),i.createVNode(u,{orientation:"left"},{default:i.withCtx(()=>k[4]||(k[4]=[i.createTextVNode("查询字段")])),_:1}),k[5]||(k[5]=i.createTextVNode(" 数据模型:")),i.createVNode(C,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":k[1]||(k[1]=T=>n.value.dataModel=T)},null,8,["options","value"]),i.createVNode(S,{columns:t.value,"data-source":d.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:T})=>[["showIndex","queryType"].includes(T.key)?(i.openBlock(),i.createElementBlock("span",dr,[i.createVNode(B),i.createTextVNode(" "+i.toDisplayString(T.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:T,text:O,record:F})=>[["queryType"].includes(T.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!m.value[F.name]||!Object.keys(m.value[F.name]).includes(T.dataIndex))&&!O&&"empty"]),onClick:$=>y(F,T.dataIndex)},[m.value[F.name]&&Object.keys(m.value[F.name]).includes(T.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(C,{key:0,value:F[T.dataIndex],"onUpdate:value":$=>F[T.dataIndex]=$,allowClear:!0,options:w.value.options,onBlur:k[2]||(k[2]=$=>A())},null,8,["value","onUpdate:value","options"])),[[p]]):(i.openBlock(),i.createElementBlock("span",fr,i.toDisplayString(w.value.showLabel(O)),1))],10,hr)):["isQuery"].includes(T.dataIndex)?(i.openBlock(),i.createElementBlock("div",ur,[i.createVNode(R,{checked:F[T.dataIndex],onClick:$=>x(F,T.dataIndex)},null,8,["checked","onClick"])])):T.dataIndex=="showIndex"?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!m.value[F.name]||!Object.keys(m.value[F.name]).includes(T.dataIndex))&&!O&&"empty"]),onClick:$=>y(F,T.dataIndex)},[m.value[F.name]&&Object.keys(m.value[F.name]).includes(T.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(g,{key:0,value:m.value[F.name][T.dataIndex],"onUpdate:value":$=>m.value[F.name][T.dataIndex]=$,onBlur:$=>A(F,T.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[p]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(F.show?.query?.index||" "),1)],64))],10,pr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(fi,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-ce575063"]]),gr={class:"query-btn"},kr={class:"btn-advanced-overlay"},Vl=te(i.defineComponent({__name:"queryForm",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},fields:{type:Array},params:{type:Object,default(){return{}}}},emits:["query","reset","btnClick"],setup(a,{emit:e}){const t=a,n=i.computed(()=>{const A=t.editor?.widget(t.wid)||t.widget||{};return A.btns||(A.btns=[]),A}),l=i.computed(()=>({visible:!0,name:"keywords",title:"关键字",placeholder:"请输入搜索内容",...n.value.keywords||{}})),o=i.computed(()=>{let A=[];return n.value.fields?.length&&(A=n.value.fields),A.length==0&&t.fields?.length&&(A=t.fields),A.sort((x,w)=>{const V=x.show?.query?.index||1,k=w.show?.query?.index||1;return V-k}),A.forEach(x=>{!x.widget&&!x.control&&x.convert&&(x.widget="unione-select-box"),x.widget=x.widget||x.control||"a-input",x.defaultValue!=null&&x.defaultValue!="undefined"&&typeof x.defaultValue<"u"&&(f.value[x.name]=x.defaultValue,x.value=x.defaultValue)}),A}),s=i.computed(()=>n.value.labelWidth||7),r=i.computed(()=>{const A=n.value.btns.filter(x=>x.name=="advanced")[0]||{};return A.event?.clickScript&&(A.event.click=new Function("ctx","btn","event",A.event.clickScript)),A.event?.disableScript&&(A.event.disable=new Function("ctx","btn",A.event.disableScript)),A.event?.visibleScript&&(A.event.visible=new Function("ctx","btn",A.event.visibleScript)),{visible:!0,name:"advanced",title:"高级搜索",...A}}),c=["query","reset","advanced"],h=i.computed(()=>{const A=n.value.btns.filter(w=>w.name!="advanced"),x=[];return A.forEach(w=>{w.size||(w.size="default"),x.push(w.name)}),x.includes("query")||A.splice(0,0,{visible:!0,name:"query",title:"查询",size:"default",type:"primary"}),x.includes("reset")||A.splice(1,0,{visible:!0,name:"reset",title:"重置",size:"default",type:"default"}),A.sort((w,V)=>{const k=w.index||1,u=V.index||1;return k-u}),A}),f=i.ref({}),d=i.computed(()=>{const A={};return n.value.params?Object.keys(n.value.params).forEach(x=>{A[x]=n.value.params[x]}):t.params&&Object.keys(t.params).forEach(x=>{A[x]=t.params[x]}),A});i.onMounted(()=>{t.editor?.ebus.$on("query-form-params",A=>{n.value.params=A}),b()});const p=e;function m({btn:A,event:x}){console.log("unione query form btn click",A,x),A.name=="query"&&b(),A.name=="reset"&&y(),p("btnClick",{btn:A,event:x})}function b(){const A=[];o.value.forEach(w=>{w.visible&&A.push(w.name)});const x={params:{...d.value},keywords:""};Object.keys(f.value).forEach(w=>{A.includes(w)&&(x.params[w]=f.value[w])}),l.value.visible&&f.value[l.value.name]&&(x.keywords=f.value[l.value.name]),p("query",x),t.editor?.ebus.$emit("table-list-search",x)}function y(){f.value={},o.value.forEach(x=>{x.visible=!1});const A={params:{...d.value},keywords:""};p("reset",A),t.editor?.ebus.$emit("table-list-reset",A)}return(A,x)=>{const w=i.resolveComponent("a-input"),V=i.resolveComponent("a-form-item"),k=i.resolveComponent("unione-btn"),u=i.resolveComponent("a-checkbox"),N=i.resolveComponent("DownOutlined"),M=i.resolveComponent("a-button"),v=i.resolveComponent("a-dropdown"),C=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(lt,{class:"unione-query-form",model:t.editor?.model.value,"setting-title":"查询设置"},i.createSlots({default:i.withCtx(()=>[i.createVNode(C,{model:f.value,layout:"horizontal","label-col":{span:s.value}},{default:i.withCtx(()=>[l.value.visible?(i.openBlock(),i.createBlock(V,{key:0,label:l.value.title,class:"query-field keywords",name:l.value.name,style:i.normalizeStyle({width:s.value})},{default:i.withCtx(()=>[i.createVNode(w,{placeholder:l.value.placeholder,value:f.value[l.value.name],"onUpdate:value":x[0]||(x[0]=B=>f.value[l.value.name]=B),allowClear:"",onKeyup:i.withKeys(b,["enter"])},null,8,["placeholder","value"])]),_:1},8,["label","name","style"])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,B=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:B.name},[B.visible?(i.openBlock(),i.createBlock(V,{key:0,label:B.title,class:i.normalizeClass(["query-field",B.name]),style:i.normalizeStyle({width:s.value}),name:B.name},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(B.widget),i.mergeProps({placeholder:B.placeholder,value:f.value[B.name],"onUpdate:value":R=>f.value[B.name]=R,ref_for:!0},B.props||{},{allowClear:"",widget:B}),null,16,["placeholder","value","onUpdate:value","widget"]))]),_:2},1032,["label","class","style","name"])):i.createCommentVNode("",!0)],64))),128)),i.createElementVNode("div",gr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,B=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:B.name},[B.visible!=!1?(i.openBlock(),i.createBlock(k,{key:0,widget:B,editor:a.editor,onClick:m,preset:c},null,8,["widget","editor"])):i.createCommentVNode("",!0)],64))),128)),r.value.visible&&o.value.length?(i.openBlock(),i.createBlock(v,{key:0,class:"btn btn-advanced",trigger:[r.value.trigger||"hover"]},{overlay:i.withCtx(()=>[i.createElementVNode("div",kr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,B=>(i.openBlock(),i.createBlock(u,{key:B.name,class:"item",checked:B.visible,onClick:R=>B.visible=!B.visible},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B.title),1)]),_:2},1032,["checked","onClick"]))),128))])]),default:i.withCtx(()=>[i.createVNode(M,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value.title)+" ",1),i.createVNode(N)]),_:1})]),_:1},8,["trigger"])):i.createCommentVNode("",!0)])]),_:1},8,["model","label-col"])]),_:2},[t.editor&&t.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(mr,{editor:t.editor,wid:t.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-05f95e36"]]),br={class:"unione-props-setting unione-table-setting"},yr={class:"unione-table-tools"},wr={key:1,class:"unione-table-opts"},Ar={key:0},xr=["onClick"],Cr={key:1,class:"edit-field"},vr=["onClick"],Sr={key:1},Br=te(i.defineComponent({__name:"tableSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"显示",dataIndex:"isList",key:"isList",width:"30px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"30px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"},{title:"对齐方式",dataIndex:"align",key:"align",width:"55px",align:"center",options:[{value:"left",label:"居左"},{value:"center",label:"居中"},{value:"right",label:"居右"}],showLabel(v,C){let B=v.filter(R=>R.value==C);return B&&B[0]&&B[0].label||C}},{title:"固定位置",dataIndex:"fixed",key:"fixed",width:"55px",align:"center",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}],showLabel(v,C){let B=v.filter(R=>R.value==C);return B&&B[0]&&B[0].label||C}},{title:"列宽",dataIndex:"showWidth",key:"showWidth",width:"50px",align:"center"}]),n=i.computed(()=>{const v=e.editor.widget(e.wid)||{};return v.configs||(v.configs={}),v.configs.leftBtns||(v.configs.leftBtns=[]),v.configs.rightBtns||(v.configs.rightBtns=[]),v.configs.operation||(v.configs.operation={}),v.configs.operation.btns||(v.configs.operation.btns=[]),v.configs.operation.more||(v.configs.operation.more={}),v}),l=i.computed(()=>(e.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),o=i.computed(()=>{if(!n.value)return[];const v=[],C=n.value.configs.leftBtns;if(C.forEach(B=>{v.push(B.name)}),!v.includes("add")){const B={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};C.splice(0,0,B)}if(!v.includes("delBatch")){const B={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};C.splice(1,0,B)}return C}),s=i.computed(()=>{if(!n.value)return[];const v=[],C=n.value.configs.rightBtns;if(C.forEach(B=>{v.push(B.name)}),!v.includes("downData")){const B={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"导出",index:0,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downData"};C.splice(0,0,B)}if(!v.includes("impData")){const B={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};C.splice(1,0,B)}if(!v.includes("expData")){const B={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};C.splice(2,0,B)}if(!v.includes("downTmpl")){const B={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};C.splice(3,0,B)}return C});function r(v,C){v=="left"?f.value.open(C,B=>{B.visible=!0,Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.leftBtns.sort((R,g)=>{const S=R.index||1,T=g.index||1;return S-T}),n.value.configs.leftBtns=[...n.value.configs.leftBtns]}):f.value.open(C,B=>{B.visible=!0,Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.rightBtns.sort((R,g)=>{const S=R.index||1,T=g.index||1;return S-T}),n.value.configs.rightBtns=[...n.value.configs.rightBtns]})}function c(v){const C=v=="left"?n.value.configs.leftBtns.length:n.value.configs.rightBtns.length;let B={title:"新增"+C,name:"new_"+C,index:C,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};v=="left"?n.value.configs.leftBtns.push(B):n.value.configs.rightBtns.push(B),e.editor.widget(e.wid,n.value),r(v,B)}function h(v,C){const B=()=>{if(["add","delBatch","expData","impData","downTmpl"].includes(C.name))C.visible=!1,v=="left"?n.value.configs.leftBtns=[...n.value.configs.leftBtns]:n.value.configs.rightBtns=[...n.value.configs.rightBtns];else if(v=="left"){const R=[];n.value.configs.leftBtns.forEach(g=>{g.name!=C.name&&R.push(g)}),n.value.configs.leftBtns=R}else{const R=[];n.value.configs.rightBtns.forEach(g=>{g.name!=C.name&&R.push(g)}),n.value.configs.rightBtns=R}};X.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{B()}})}const f=i.ref(null);function d(v){f.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(B=>{v[B]=C[B]}),n.value.configs.operation.btns.sort((B,R)=>{const g=B.index||1,S=R.index||1;return g-S}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function p(){const v=n.value.configs.operation.btns.length+1;let C={title:"新增"+v,name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.operation.btns.push(C),e.editor.widget(e.wid,n.value),f.value.open(C,B=>{Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function m(v){const C=()=>{if(["delete","view","edit"].includes(v.name))v.visible=!1,n.value.configs.operation.btns=[...n.value.configs.operation.btns];else{const B=[];n.value.configs.operation.btns.forEach(R=>{R.name!=v.name&&B.push(R)}),n.value.configs.operation.btns=B}};X.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{C()}})}const b=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),y=i.computed(()=>b.value.fields?.length?(b.value.fields.forEach(v=>{v.show||(v.show={}),v.show.list||(v.show.list={})}),b.value.fields):[]),A={mounted:v=>v.focus()},x=i.ref({});function w(){const v=Object.keys(x.value);if(v.length)for(let C in v){const B=y.value.filter(R=>R.name==C);if(B&&B[0]){let R=x.value[C];Object.keys(R).forEach(g=>{B[0].show||(B[0].show={}),B[0].show.list||(B[0].show.list={}),g=="showIndex"?B[0].show.list.index=R[g]:g=="showWidth"?B[0].show.list.width=R[g]:g=="fixed"?B[0].show.list.fixed=R[g]:g=="align"?B[0].show.list.align=R[g]:B[0][g]=R[g]})}}x.value={}}function V(v,C){w();const B={};C=="showIndex"?B[C]=v.show?.list?.index:C=="showWidth"?B[C]=v.show?.list?.width:C=="fixed"?B[C]=v.show?.list?.fixed:C=="align"?B[C]=v.show?.list?.align:B[C]=v[C]||"",x.value[v.name]=B}function k(v,C){if(!v||!C){x.value={};return}const B=x.value[v.name][C];v.show||(v.show={}),v.show.list||(v.show.list={}),C=="showIndex"?v.show.list.index=B:C=="showWidth"?v.show.list.width=B:C=="fixed"?v.show.list.fixed=B:C=="align"?v.show.list.align=B:v[C]=B,x.value={}}function u(v,C){return C=="showIndex"?v.show?.list?.index:C=="showWidth"?v.show?.list?.width:C=="fixed"?v.show?.list?.fixed:C=="align"?v.show?.list?.align:v[C]}function N(v,C){y.value.filter(R=>R.name==v.name).forEach(R=>{R[C]=!R[C]})}const M=i.ref({options:[{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:v=>{const C=M.value.options.filter(B=>B.value==v);return C[0]?C[0].label:v}});return(v,C)=>{const B=i.resolveComponent("a-divider"),R=i.resolveComponent("CloseOutlined"),g=i.resolveComponent("a-button"),S=i.resolveComponent("PlusOutlined"),T=i.resolveComponent("a-input"),O=i.resolveComponent("a-form-item"),F=i.resolveComponent("a-col"),$=i.resolveComponent("a-input-number"),D=i.resolveComponent("a-checkbox"),Q=i.resolveComponent("a-row"),U=i.resolveComponent("a-select"),E=i.resolveComponent("ToolOutlined"),P=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",br,[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[8]||(C[8]=[i.createTextVNode("工具设置")])),_:1}),i.createElementVNode("div",yr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size,ref_for:!0},I.props||{},{onClick:_=>r("left",I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"bool-del",onClick:i.withModifiers(_=>h("left",I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","tool-add"]),size:"small",onClick:C[0]||(C[0]=I=>c("left"))},{default:i.withCtx(()=>[i.createVNode(S)]),_:1}),i.createVNode(g,{class:i.normalizeClass(["btn","tool-add","right"]),onClick:C[1]||(C[1]=I=>c("right")),size:"small"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1}),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn","right",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size,ref_for:!0},I.props||{},{onClick:_=>r("right",I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"bool-del",onClick:i.withModifiers(_=>h("right",I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128))]),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[9]||(C[9]=[i.createTextVNode("操作设置")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createBlock(Q,{key:0},{default:i.withCtx(()=>[i.createVNode(F,{span:7},{default:i.withCtx(()=>[i.createVNode(O,{label:"操作标题"},{default:i.withCtx(()=>[i.createVNode(T,{value:n.value.configs.operation.title},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:5},{default:i.withCtx(()=>[i.createVNode(O,{label:"显示宽度",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode($,{value:n.value.configs.operation.width,"onUpdate:value":C[2]||(C[2]=I=>n.value.configs.operation.width=I)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:6},{default:i.withCtx(()=>[i.createVNode(O,{label:"显示按钮数量",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode($,{value:n.value.configs.operation.count,"onUpdate:value":C[3]||(C[3]=I=>n.value.configs.operation.count=I)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:5},{default:i.withCtx(()=>[i.createVNode(O,{label:"是否显示"},{default:i.withCtx(()=>[i.createVNode(D,{checked:n.value.configs.operation.visible,"onUpdate:checked":C[4]||(C[4]=I=>n.value.configs.operation.visible=I)},null,8,["checked"])]),_:1})]),_:1})]),_:1})):i.createCommentVNode("",!0),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[10]||(C[10]=[i.createTextVNode("操作按钮")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createElementBlock("div",wr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.configs.operation.btns,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size||"small",ref_for:!0},I.props||{},{onClick:_=>d(I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"btn-del",onClick:i.withModifiers(_=>m(I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","btn-add"]),onClick:C[5]||(C[5]=I=>p()),size:"small"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[11]||(C[11]=[i.createTextVNode("表头设置")])),_:1}),C[12]||(C[12]=i.createTextVNode(" 数据模型:")),i.createVNode(U,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":C[6]||(C[6]=I=>n.value.dataModel=I)},null,8,["options","value"]),i.createVNode(P,{columns:t.value,"data-source":y.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:I})=>[["showIndex","showWidth","align","fixed"].includes(I.key)?(i.openBlock(),i.createElementBlock("span",Ar,[i.createVNode(E),i.createTextVNode(" "+i.toDisplayString(I.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:I,record:_})=>[["showIndex","showWidth"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!x.value[_.name]||!Object.keys(x.value[_.name]).includes(I.dataIndex))&&!u(_,I.dataIndex)&&"empty"]),onClick:z=>V(_,I.dataIndex)},[x.value[_.name]&&Object.keys(x.value[_.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock($,{key:0,value:x.value[_.name][I.dataIndex],"onUpdate:value":z=>x.value[_.name][I.dataIndex]=z,onBlur:z=>k(_,I.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[A]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(u(_,I.dataIndex)),1)],64))],10,xr)):["isList","isQuery","isSort"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",Cr,[i.createVNode(D,{checked:_[I.dataIndex],onClick:z=>N(_,I.dataIndex)},null,8,["checked","onClick"])])):["align","fixed"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!x.value[_.name]||!Object.keys(x.value[_.name]).includes(I.dataIndex))&&!u(_,I.dataIndex)&&"empty"]),onClick:z=>V(_,I.dataIndex)},[x.value[_.name]&&Object.keys(x.value[_.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(U,{key:0,value:_.show.list[I.dataIndex],"onUpdate:value":z=>_.show.list[I.dataIndex]=z,allowClear:!0,options:I.options,onBlur:C[7]||(C[7]=z=>k())},null,8,["value","onUpdate:value","options"])),[[A]]):(i.openBlock(),i.createElementBlock("span",Sr,i.toDisplayString(I.showLabel(I.options,u(_,I.dataIndex))),1))],10,vr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(fi,{ref_key:"btnSetting",ref:f,preset:["edit","view","add","delBatch","expData","impData","downTmpl"]},null,512)])}}}),[["__scopeId","data-v-c966c24c"]]),Nr={class:"unione-table-tools"},Vr={class:"unione-table-data"},Rr={key:0,class:"unione-table-opts"},Rl=te(i.defineComponent({__name:"tableList",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},loading:{type:Boolean,default:!1},pagination:{type:Object,required:!1},dataList:{type:Array,default(){return[]}},rowKey:{type:String,default:"id"}},emits:["edit","view","add","delete","delBatch","expData","impData","downTmpl","leftBtnClick","rightBtnClick","optBtnClick","btnClick","change"],setup(a,{expose:e,emit:t}){const n=Fe(),l=a,o=i.computed(()=>l.editor?.widget(l.wid)||l.widget||{}),s=i.computed(()=>o.value.props||{}),r=i.computed(()=>o.value.rowKey||l.rowKey||"id"),c=i.computed(()=>o.value.dsn?l.editor?.dataManager().use(o.value.dsn,"list"):null),h=i.computed(()=>{const S=l.dataList||[];return!S.length&&c.value?c.value.data().body||[]:S}),f=i.computed(()=>{if(o.value.operation==!1)return{visible:!1};const S=Y.utils.obj.ext(o.value.operation||{},{title:"操作",width:200,count:2,btns:[],more:{title:"更多",visible:!0,trigger:"hover",size:"small",layout:"horizontal",items:[]}}),T=[];let O=(o.value.operation?.btns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F));if(O.forEach(F=>{T.push(F.name)}),T.includes("edit")||O.splice(0,0,{title:"编辑",name:"edit",type:"default",visible:!0}),T.includes("view")||O.splice(1,0,{title:"查看",name:"view",type:"default",visible:!0}),T.includes("delete")||O.push({title:"删除",name:"delete",type:"default",props:{danger:!0},visible:!0}),l.editor&&l.editor.type.value!="code"){const F=O.filter(D=>D.name=="edit")[0];if(F.visible&&(F.action||(F.action={}),F.action.type||(F.action.type="route"),!F.action.href)){const D=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",Q=l.editor.model.value;F.action.link=n.editPageUrl+"?psn="+D+"&model="+Q+"&id={row."+l.rowKey+"}"}const $=O.filter(D=>D.name=="view")[0];if($.visible&&($.action||($.action={}),$.action.type||($.action.type="route"),!$.action.href)){const D=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form";$.action.link=n.viewPageUrl+"?psn="+D+"&model=view&id={row."+l.rowKey+"}"}}return O=O.filter(F=>F.visible!=!1).sort((F,$)=>{const D=F.index||1,Q=$.index||1;return D-Q}),S.count&&(O.length>S.count+1?(S.btns=O.slice(0,S.count),S.more.items=O.slice(S.count,O.length),S.more.visible=!0):(S.btns=O,S.more.visible=!1)),S}),d=i.computed(()=>{let S=[];o.value.columns?.length&&(S=[...o.value.columns]);const T=[];S.forEach((F,$)=>{F.dataIndex=F.name,F.convert&&(F.dataIndex=F.name+"Label",F.convertObj=new Ge(F.convert),F.customCell=(D,Q,U)=>{const E=D[U.name];F.convertObj&&(D[U.dataIndex]==null||D[U.dataIndex]==null)&&E!=null&&E!=null&&(E+"").length>0&&(D[U.dataIndex]=E,F.convertObj.convert(E).then(P=>{P&&(D[U.dataIndex]=P)}))}),F.sort?.enable&&(F.sorter=!0,F.sort.multiple&&(F.sorter={},F.sorter.multiple=F.sort.multiple),F.sort.defoult&&(F.defaultSortOrder=F.sort.asc?"ascend":"descend")),F.customRender=({text:D})=>D||"--",F.fkey?.enable&&(F.fkey.labelName&&(F.dataIndex=sn(F.fkey.labelName)),F.fkey.labelTitle&&(F.title=F.fkey.labelTitle),F.customRender=({record:D,column:Q})=>D&&D[Q.name+"FEntry"]&&D[Q.name+"FEntry"][Q.dataIndex]||"--",F.fkey.fields?.forEach((D,Q)=>{if(!D.name)return;const U=sn(D.name),E={fkName:F.name,title:D.title,name:U,dataIndex:D.name,width:D.width,index:D.index||$+Q+1,customRender:({record:P,column:I})=>{if(P&&P[I.fkName+"FEntry"]){const _=P[I.fkName+"FEntry"][I.name];if(_)return D.convertObj&&D.convertObj.convert(_)||_}return"--"}};D.convert&&(D.convertObj=new Ge(D.convert)),T.push(E)}))}),T.forEach(F=>{S.splice(F.index,0,F)});const O=Y.utils.obj.ext(o.value.rownum,{title:"序号",fixed:"left",align:"center",width:60,visible:!0});return O&&O.visible!=!1&&(O.customRender=F=>V.value?(V.value.current-1)*V.value.pageSize+F.index+1:F.index,S=[O,...S]),f.value&&f.value.visible!=!1&&S.push({fixed:"right",align:"center",...f.value,name:"operation"}),S}),p=i.computed(()=>{if(o.value.leftBtns===!1)return[];const S=[],T=[];if((o.value.leftBtns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F)).forEach(F=>{F.visible!=!1&&S.push(F),T.push(F.name),F.name=="delBatch"&&!k.value&&(F.visible=!1)}),!T.includes("add")){const F={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};S.splice(0,0,F)}if(!T.includes("delBatch")&&k.value){const F={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};S.splice(1,0,F)}if(l.editor&&l.editor.type.value!="code"){const F=S.filter($=>$.name=="add")[0];if(F.visible&&(F.action||(F.action={}),F.action.type||(F.action.type="route"),!F.action.href)){const $=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",D=l.editor.model.value;F.action.link=n.addPageUrl+"?psn="+$+"&model="+D}}return S});function m({btn:S,event:T}){if(n.isDebug&&console.log("unione table left btn click",S,T),S.name=="delBatch"){if(!u.value.selectedRowKeys.length){X.Modal.info({title:"提示信息",content:"请选择要删除的记录!"});return}if(c.value){c.value.deleteByIds(u.value.selectedRowKeys).then(()=>{R(),B(!0)});return}X.Modal.confirm({title:"确认信息",content:"请确认是否要删除选中的("+u.value.selectedRowKeys.length+")数据",onOk:()=>{M("delBatch",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("leftBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}});return}M(S.name,{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("leftBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}const b=i.computed(()=>{if(o.value.rightBtns===!1)return[];const S=[],T=[];if((o.value.rightBtns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F)).forEach(F=>{F.visible!=!1&&S.push(F),T.push(F.name)}),!T.includes("impData")){const F={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};S.splice(1,0,F)}if(!T.includes("expData")){const F={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};S.splice(2,0,F)}if(!T.includes("downTmpl")){const F={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};S.splice(3,0,F)}return S});function y({btn:S,event:T}){n.isDebug&&console.log("unione table right btn click",S,T),M(S.name,{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("rightBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}const A=i.computed(()=>({bordered:!0,size:"small",...o.value.attrs||{}})),x=i.ref({}),w=i.ref(null),V=i.computed(()=>Y.utils.obj.ext(l.pagination||o.value.pagination,{showTotal:S=>"共"+S+"记录",pageSize:l.pagination?.pageSize||c.value?.data()?.pageSize||10,current:l.pagination?.current||c.value?.data()?.page||1,total:l.pagination?.total||c.value?.data()?.total||0,position:["bottomCenter"]})),k=i.computed(()=>typeof o.value.selection<"u"?o.value.selection:!0),u=i.ref({selectedRowKeys:[],selectedRowList:[],onChange:(S,T)=>{u.value.selectedRowKeys=S,u.value.selectedRowList=T},getCheckboxProps:S=>({disabled:S.checkable})}),N=["edit","view","add","delete","delBatch","impData","expData","downTmpl"],M=t;function v({btn:S,event:T},O){if(n.isDebug&&console.log("unione table opt btn click",S,T),S.name=="delete"){if(c.value){c.value.deleteByIds([O[r.value]]).then(()=>{R(),u.value.selectedRowKeys=u.value.selectedRowKeys.filter(F=>F!=O[r.value]),u.value.selectedRowList=u.value.selectedRowList.filter(F=>F[r.value]!=O[r.value])});return}X.Modal.confirm({title:"确认信息",content:"请确认是否要删除该记录?",onOk:()=>{M(S.name,{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("optBtnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}});return}M(S.name,{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("optBtnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}function C(S,T,O,F){console.log("tableChanged",S,T,O,F),w.value={page:S.current,pageSize:S.pageSize},O&&(Array.isArray(O)?(w.value.sorts=[],O.forEach($=>{w.value.sorts.push({name:$.column.name,asc:$.order=="ascend"})})):O.column&&(w.value.sorts=[{name:O.column.name,asc:O.order=="ascend"}])),R(),M("change",{pagination:S,filters:T,sorter:O,event:F})}function B(S=!1){S?(u.value.selectedRowKeys=[],u.value.selectedRowList=[]):X.Modal.confirm({title:"确认信息",content:`确定要清除当前选中的(${u.value.selectedRowKeys.length})条数据?`,centered:!0,onOk:()=>{u.value.selectedRowKeys=[],u.value.selectedRowList=[]}})}function R(){if(c.value){const S={page:V.value.current,pageSize:V.value.pageSize,keywords:x.value.keywords,body:x.value.params||{}};w.value?.page&&(S.page=w.value.page),w.value?.pageSize&&(S.pageSize=w.value.pageSize),w.value?.sorts&&(S.sorts=w.value.sorts),console.log("dataStorage find params",S),c.value.find(S)}}i.onMounted(()=>{d.value?.forEach(S=>{S.sort?.enable&&S.sort.defoult&&(w.value||(w.value={},w.value.sorts||(w.value.sorts=[]),w.value.sorts.push({name:S.name,asc:S.sort.asc==!0})))}),l.editor?.ebus.$on("table-list-search",S=>{console.log("table-list-search",S),x.value=S||{},R()}),l.editor?.ebus.$on("table-list-reset",()=>{console.log("table-list-reset"),x.value={},R(),B(!0)}),l.editor?.ebus.$on("table-list-reload",()=>{console.log("table-list-reload"),R()})});function g(){return{keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}}return e({getSelected:g,clearSelected:B}),(S,T)=>{const O=i.resolveComponent("unione-btn"),F=i.resolveComponent("DownOutlined"),$=i.resolveComponent("a-button"),D=i.resolveComponent("a-dropdown"),Q=i.resolveComponent("a-table");return i.openBlock(),i.createBlock(lt,{class:"unione-table-list",model:l.editor?.model.value,"setting-title":"列表设置"},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Nr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(p.value,U=>(i.openBlock(),i.createBlock(O,{key:U.name,class:"btn",widget:U,editor:a.editor,onClick:m,preset:N,ctx:{sltKeys:u.value.selectedRowKeys,sltRows:u.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128)),u.value.selectedRowKeys.length?(i.openBlock(),i.createElementBlock("span",{key:0,class:"selected-info",onClick:T[0]||(T[0]=U=>B())},"当前选中记录("+i.toDisplayString(u.value.selectedRowKeys.length)+")",1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,U=>(i.openBlock(),i.createBlock(O,{key:U.name,class:"btn right",widget:U,editor:a.editor,onClick:y,preset:N,ctx:{sltKeys:u.value.selectedRowKeys,sltRows:u.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128))]),i.createElementVNode("div",Vr,[d.value&&d.value.length?(i.openBlock(),i.createBlock(Q,i.mergeProps({key:0,columns:d.value,rowKey:r.value,"data-source":h.value,"row-selection":k.value?u.value:null,scroll:{x:s.value.scrollX||"max-content",y:s.value.scrollY},pagination:V.value,onChange:C},A.value),{bodyCell:i.withCtx(({column:U,record:E})=>[U.name==="operation"?(i.openBlock(),i.createElementBlock("div",Rr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.btns,P=>(i.openBlock(),i.createBlock(O,{key:P.name,class:"opt",widget:P,editor:a.editor,onClick:I=>v(I,E),preset:N,ctx:{row:E}},null,8,["widget","editor","onClick","ctx"]))),128)),f.value.more?.visible!=!1&&f.value.more.items?.length?(i.openBlock(),i.createBlock(D,{key:0,trigger:[f.value.more.trigger||"hover"],class:i.normalizeClass(["opt-more",f.value.more.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["opt-more-overlay",f.value.more.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.more.items,P=>(i.openBlock(),i.createBlock(O,{key:P.name,class:"item",widget:P,editor:a.editor,onClick:I=>v(I,E),type:"text",preset:N,ctx:{row:E}},null,8,["widget","editor","onClick","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode($,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.more.title)+" ",1),i.createVNode(F)]),_:1})]),_:2},1032,["trigger","class"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),_:1},16,["columns","rowKey","data-source","row-selection","scroll","pagination"])):i.createCommentVNode("",!0)])]),_:2},[l.editor&&l.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(Br,{editor:l.editor,wid:l.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-a168b83b"]]);class De{options;mask;container;inputList;constructor(e){this.options=e,this.mask=null,this.container=null,this.inputList=[],this._render()}_render(){const{title:e,data:t,onClose:n,onCancel:l,onConfirm:o}=this.options,s=document.createElement("div");s.classList.add("dialog-mask"),s.setAttribute(re.EDITOR_COMPONENT,re.EditorComponent.COMPONENT),document.body.append(s);const r=document.createElement("div");r.classList.add("dialog-container"),r.setAttribute(re.EDITOR_COMPONENT,re.EditorComponent.COMPONENT);const c=document.createElement("div");c.classList.add("dialog"),r.append(c);const h=document.createElement("div");h.classList.add("dialog-title");const f=document.createElement("span");f.append(document.createTextNode(e));const d=document.createElement("i");d.onclick=()=>{n&&n(),this._dispose()},h.append(f),h.append(d),c.append(h);const p=document.createElement("div");p.classList.add("dialog-option");for(let A=0;A<t.length;A++){const x=t[A],w=document.createElement("div");if(w.classList.add("dialog-option__item"),x.label){const k=document.createElement("span");k.append(document.createTextNode(x.label)),w.append(k),x.required&&k.classList.add("dialog-option__item--require")}let V;x.type==="select"?(V=document.createElement("select"),x.options?.forEach(k=>{const u=document.createElement("option");u.value=k.value,u.label=k.label,V.append(u)})):x.type==="textarea"?V=document.createElement("textarea"):(V=document.createElement("input"),V.type=x.type),x.width&&(V.style.width=`${x.width}px`),x.height&&(V.style.height=`${x.height}px`),V.name=x.name,V.value=x.value||"",V instanceof HTMLSelectElement||(V.placeholder=x.placeholder||""),w.append(V),p.append(w),this.inputList.push(V)}c.append(p);const m=document.createElement("div");m.classList.add("dialog-menu");const b=document.createElement("button");b.classList.add("dialog-menu__cancel"),b.append(document.createTextNode("取消")),b.type="button",b.onclick=()=>{l&&l(),this._dispose()},m.append(b);const y=document.createElement("button");y.append(document.createTextNode("确定")),y.type="submit",y.onclick=()=>{if(o){const A=this.inputList.map(x=>({name:x.name,value:x.value}));o(A)}this._dispose()},m.append(y),c.append(m),document.body.append(r),this.container=r,this.mask=s}_dispose(){this.mask?.remove(),this.container?.remove()}}function Er(a){switch(a){case"comment":case"prolog":case"doctype":case"cdata":return{color:"#008000",italic:!0};case"namespace":return{opacity:.7};case"string":return{color:"#A31515"};case"punctuation":case"operator":return{color:"#393A34"};case"url":case"symbol":case"number":case"boolean":case"variable":case"constant":case"inserted":return{color:"#36acaa"};case"atrule":case"keyword":case"attr-value":return{color:"#0000ff"};case"function":return{color:"#b9a40a"};case"deleted":case"tag":return{color:"#9a050f"};case"selector":return{color:"#00009f"};case"important":return{color:"#e90",bold:!0};case"italic":return{italic:!0};case"class-name":case"property":return{color:"#2B91AF"};case"attr-name":case"regex":case"entity":return{color:"#ff0000"};default:return null}}function Or(a){const e=[];function t(n){for(let l=0;l<n.length;l++){const o=n[l];if(typeof o=="string")e.push({content:o});else if(Array.isArray(o.content))t(o.content);else{const{type:s,content:r}=o;typeof r=="string"&&e.push({type:s,content:r,...Er(s)})}}}return t(a),e}const Mr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAVFBMVEUAAABAQGA7Tk43SVs8S1pDQ1E7RVhASVtARlc8R1c8R1k8Rlc8RlY9RlY8SFc9R1Y8R1c9R1c9R1c9R1c9R1c9R1c+Rlc9R1g9R1c9R1c9R1f///9drmTRAAAAGnRSTlMACA0OERMaHCwvSExNUFWFvr/B0dji5Ozy9AbGsiEAAAABYktHRBsCYNSkAAAAS0lEQVQYGY3BRxKAIAAEwVEw56z7/4daggfkZDc/JXzZmY98EaFykwhkh5xravHqUwLSbh3wql087NbgFQtOP/IyOOYkIiIi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2LYTp4aUbxXOcEU7gLQAQBdshWOQxX2KgEKtUaZrlQzxQ2Ul5UT/qE+AI3BRc9uSCDPAAAAAElFTkSuQmCC",Qr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAABOUlEQVQ4je2QvUtCARTFf/c982trycKpIYKGlqY+FGnQiqRJnIzWQqgtXIIimt1aG1p0SyF5NSRYS9R/0NrQVkR+PH3epicK4ZC0daZzOfC7hwN/rUgircNyY9QHIwM8ronE07sIOWAKeAXyNauQB1hZS++hHAn4QYp179fBc7lcHwAgnJlKBDvw0vE2t0X0FMgDiDJTswqTQxvUrMK46xeSycugHTx3b7MVyPWarqfm6IqlcHVvFbM9QDSR3lf0ECSEPbhNtXrRBIjGU9M4xo0KYRQ/9I2ocCKqyzWrYDrqDfUDFjdT4aV4ZkLFqKgQVrjz2IHsAAB4Nzw0YrEdvynt436AYRvzprSvgVmQR/U1ttxWPYCoZrqOUXF8jQ/QVaDlZmP22y3giPDk7bQ2Hkqlz58G/dcv9Q2n32hulF2TowAAAABJRU5ErkJggg==",Wr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAElBMVEUAAAA8R1c9R1g9R1c9R1f////4xTreAAAABHRSTlMAwsPFKmGWBgAAAAFiS0dEBfhv6ccAAAAxSURBVAjXY2CAAWYXMFBgYIHwHbAyXFhcXKAiLAyoDBcXFpy6XOC6UKWYIJYKwF0BAHOuCQoquY55AAAAAElFTkSuQmCC",Yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AGI9sLgcTI6GI2FwQCGQSwAADUiFAamiQmpAAAAAElFTkSuQmCC",Hr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAL0lEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AEwnEHIK4PH6TAwGguDAQyDWAAA9RMUBrWQGpQAAAAASUVORK5CYII=",Kr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AFwOoOQlwahF0ZjYQDBMIgFALUTFAbTYirrAAAAAElFTkSuQmCC",Gr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAJ0lEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AFGvTAYwKgXBgMAAPBTFAZ3qmVkAAAAAElFTkSuQmCC",Jr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAzM2YrVVVJSUk9SFg8RlY9R1Y8R1c9R1c9Rlc9R1f///9QjfnYAAAACnRSTlMABQYHYGJlra+1njVvfgAAAAFiS0dECx/XxMAAAAAoSURBVAjXY2CAA/UABgbWIgYGxk4DCMG2CgwSECJwNcQAFoh2B5KkADPdEacOm1TIAAAAAElFTkSuQmCC",Xr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAG1BMVEUAAABAQEA8S1o8R1Y+Rlc9R1c9R1c9R1f////nl+KoAAAAB3RSTlMABBGUlbO7ydSN6wAAAAFiS0dECIbelXoAAAApSURBVAjXY2CAg3IwYMAGmIKgDLEyAQjDvdyAHYdiuBRcMVw7JkC3FAArJgs7P7dCZAAAAABJRU5ErkJggg==",Zr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAABAQEA8SFg8R1Y+Rlc9R1c9R1c9R1dFS1ROT1BPT0/////9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ScAAAABYktHRC3N2kE9AAAAc0lEQVQYGQXBBQKCQAAAsN2JHYggKmED1v/f5wYAALJ6GKoMgEOTh5C3JUDWjCA5p4B6BxQnQB+A+AR0AYgdoMqB4gjYtgkk1w1AeS5iKC6vdQRIT3133Ow/9wUAmLx/wwoALB+/zxQAzG7fOQAQxwAA+AOHiAZ7S/gziwAAAABJRU5ErkJggg==",pc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAElBMVEUAAAA8R1c9R1g9R1c9R1f////4xTreAAAABHRSTlMAwsPFKmGWBgAAAAFiS0dEBfhv6ccAAAA9SURBVAjXY2BAABMXFycww4GBgQWZwewCBgpQUaAwmMHi4IAkwgJSAhYB60JiMLmAGC4CyCaruLg4MmABAK6mCQnMcOUgAAAAAElFTkSuQmCC",El="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAL0lEQVRoge3RoQ0AAAgDQdh/aFigmiDu5KsmrQIAAAAA/unQ5nwFF9LXAAAAAHy14HMBAug6NlQAAAAASUVORK5CYII=",mc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAANklEQVRoge3UsQkAQAgDQN1/6HcBa3n0rkwVCCQCAAAAAPhPNtkbb8GEbmvgBFd/h6sHAIBVCqg8AgOBAhyrAAAAAElFTkSuQmCC",Ol="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMElEQVRoge3RQQ0AAAgDMfAvGgxMACTt87LfqgAAAACAezq0CRvtf0tfAwAAAHDVAlQQGAInOy4AAAAAAElFTkSuQmCC",Ml="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAJUlEQVRoge3FQREAAAwCIPuX3nLowYcEAAAAAOhwnhwAAACAJg/gLTrGTJMeQQAAAABJRU5ErkJggg==",gc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAdklEQVRoge3JMVLCABRF0YMuAcu00LIGop29K5QdsBD3ADUtLU2KjONoazL3VO//S5IkSZIkWYrnH34v+MABV9zrq+rg6ds94AuveJv2OOtjfdF97xe72T7igk+cpn2sL7oPsPG3Ld6nfcatvqqeJEmSJEn+uQdnL6BXV6mCJAAAAABJRU5ErkJggg==",kc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVRoge3KwQ0AAAQEQfovmgrEl2TmeXsRAAAAAMA9Oey1/PTfHQAAAIDrGqi1DwIKMqgNAAAAAElFTkSuQmCC",bc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMElEQVRoge3LsQ0AAAjDMPj/aHiAgREke4zaCAAAAADgnhxaLba16L43vwAAAAB80GuiEAKxygkwAAAAAElFTkSuQmCC",yc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMUlEQVRoge3LwQkAMAgDQN1/aLtAEZ8Kd7+EJAIAAAAA2Cc/XTW7GmbfvV8AAAAALnj0XRgCL0bySQAAAABJRU5ErkJggg==",wc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAQAAACFbCRbAAAAAmJLR0QA/4ePzL8AAAAwSURBVAjXY2AAAcb8DiCZy56/Iv8/Q6FQ/uH8/0BG/jYQBRbJOwRmwNWAQANTfj8ArFYW+qKsr5kAAAAASUVORK5CYII=",Ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAQAAACFbCRbAAAAAmJLR0QA/4ePzL8AAAApSURBVAjXY8if2MDEAAL5//PXp3FBGP/zT5SIQRj/87ehiEDV9EN0AQD+gxekoNbgEwAAAABJRU5ErkJggg==",xc=["title"],Cc=["title"],vc={class:"options"},Sc=["title"],Bc={class:"options"},Nc={class:"options"},Vc=["title"],Rc=["title"],Ec=["title"],Oc=["title"],Mc=["title"],Tc={class:"options"},Ic={class:"options"},Fc={class:"options"},Dc={class:"options"},_c={class:"options"},Pc={class:"menu-item__search__collapse__search"},$c={class:"arrow-left"},Lc={class:"arrow-right"},Uc=te(i.defineComponent({__name:"toolbar",props:{items:{type:Array,default(){return["simple"]}},editor:{type:Object}},setup(a,{expose:e}){const t=a,n=i.ref(),l=i.computed(()=>{let R=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Watermark","Codeblock","PageBreak","Control","Checkbox","Radio","Latex","Date","Block","Divider","Search","SearchCollapse","Print"];return t.items&&(t.items.length>1?R=t.items:t.items[0]=="simple"&&(R=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Codeblock","Divider","Search","SearchCollapse","Print"])),R});function o(){return n.value?.clientHeight}function s(){return n.value?.clientWidth}const r=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent);function c(R,g){console.log("exec cmd "+R+",params:",g),R!="Separator"&&Array.isArray(g)?t.editor?.command["execute"+R](g[0],g[1]):t.editor?.command["execute"+R](g)}function h(R,g){const S=g.target.getBoundingClientRect(),T=n.value.querySelector("."+R+" .options");T.classList.toggle("visible"),T.style.top=S.height+S.top+"px"}let f=!0,d;function p(){f?(f=!1,d=window.setTimeout(()=>{f=!0,t.editor?.command.executePainter({isDblclick:!1})},200)):window.clearTimeout(d)}function m(){f=!0,window.clearTimeout(d),t.editor?.command.executePainter({isDblclick:!0})}function b(){new De({title:"LaTeX",data:[{type:"textarea",height:100,name:"value",placeholder:"请输入LaTeX文本"}],onConfirm:R=>{const g=R.find(S=>S.name==="value")?.value;g&&t.editor?.command.executeInsertElementList([{type:re.ElementType.LATEX,value:g}])}})}function y(R){t.editor?.command.executeInsertElementList([{type:R,checkbox:{value:!1},value:""}])}function A(R,g){const S=g.target.getBoundingClientRect(),T=n.value.querySelector("."+R+" .options");T.classList.toggle("visible"),T.style.top=S.height+S.top+"px";const O=ua();T.firstChild.childNodes.forEach(F=>{const $=F.attributes.getNamedItem("label-format").value;F.innerText=O.format($),F.onclick=()=>{t.editor?.command.executeInsertElementList([{type:re.ElementType.DATE,dateFormat:F.attributes.getNamedItem("data-format").value,valueList:[{value:F.innerText.trim()}]}])}})}function x(){new De({title:"内容块",data:[{type:"select",label:"类型",name:"type",value:"iframe",required:!0,options:[{label:"网址",value:"iframe"},{label:"视频",value:"video"}]},{type:"number",label:"宽度",name:"width",placeholder:"请输入宽度(默认页面内宽度)"},{type:"number",label:"高度",name:"height",required:!0,placeholder:"请输入高度"},{type:"input",label:"地址",name:"src",required:!1,placeholder:"请输入地址"},{type:"textarea",label:"HTML",height:100,name:"srcdoc",required:!1,placeholder:"请输入HTML代码(仅网址类型有效)"}],onConfirm:R=>{const g=R.find(Q=>Q.name==="type")?.value;if(!g)return;const S=R.find(Q=>Q.name==="width")?.value,T=R.find(Q=>Q.name==="height")?.value;if(!T)return;const O=R.find(Q=>Q.name==="src")?.value,F=R.find(Q=>Q.name==="srcdoc")?.value,$={type:g};if($.type===re.BlockType.IFRAME){if(!O&&!F)return;$.iframeBlock={src:O,srcdoc:F}}else if($.type===re.BlockType.VIDEO){if(!O)return;$.videoBlock={src:O}}const D={type:re.ElementType.BLOCK,value:"",height:Number(T),block:$};S&&(D.width=Number(S)),t.editor?.command.executeInsertElementList([D])}})}function w(R){const g=R.target.getBoundingClientRect(),S=n.value.querySelector(".menu-item__table__collapse");S.style.display="block",S.style.top=g.height+g.top+"px",S.style.left=g.left-270/2+"px";const T=n.value.querySelector(".menu-item__table__collapse .table-close"),O=n.value.querySelector(".menu-item__table__collapse .table-select"),F=n.value.querySelector(".menu-item__table__collapse .table-panel"),$=[];n.value.querySelector(".menu-item__table__collapse .table-panel table").firstChild.childNodes.forEach(U=>{$.push(U.childNodes)});let D=0,Q=0;F.onmousemove=U=>{const{offsetX:_,offsetY:z}=U;$.forEach(K=>{K.forEach(L=>{L.classList.remove("active")})}),D=Math.ceil(_/22)||1,Q=Math.ceil(z/26)||1,$.forEach((K,L)=>{K.forEach((J,ee)=>{ee<D&&L<Q&&J.classList.add("active")})}),O.innerText=`${Q}×${D}`},F.onclick=()=>{S.style.display="none",t.editor?.command.executeInsertTable(Q,D)},T.onclick=U=>{U.stopPropagation(),S.style.display="none"}}function V(){const R=n.value.querySelector(".menu-item__image .image");R.click(),R.onchange=function(){const g=R.files[0],S=new FileReader;S.readAsDataURL(g),S.onload=function(){const T=new Image,O=S.result;T.src=O,T.onload=function(){t.editor?.command.executeImage({value:O,width:T.width,height:T.height}),R.value=""}}}}function k(){new De({title:"超链接",data:[{type:"text",label:"文本",name:"name",required:!0,placeholder:"请输入文本",value:t.editor?.command.getRangeText()},{type:"text",label:"链接",name:"url",required:!0,placeholder:"请输入链接"}],onConfirm:R=>{const g=R.find(T=>T.name==="name")?.value;if(!g)return;const S=R.find(T=>T.name==="url")?.value;S&&t.editor?.command.executeHyperlink({type:re.ElementType.HYPERLINK,value:"",url:S,valueList:re.splitText(g).map(T=>({value:T,size:16}))})}})}function u(R){R==="add"?new De({title:"水印",data:[{type:"text",label:"内容",name:"data",required:!0,placeholder:"请输入内容"},{type:"color",label:"颜色",name:"color",required:!0,value:"#AEB5C0"},{type:"number",label:"字体大小",name:"size",required:!0,value:"120"},{type:"number",label:"透明度",name:"opacity",required:!0,value:"0.3"},{type:"select",label:"重复",name:"repeat",value:"0",required:!1,options:[{label:"不重复",value:"0"},{label:"重复",value:"1"}]},{type:"number",label:"水平间隔",name:"horizontalGap",required:!1,value:"10"},{type:"number",label:"垂直间隔",name:"verticalGap",required:!1,value:"10"}],onConfirm:g=>{if(~g.findIndex(F=>!F.value))return;const T=g.reduce((F,$)=>(F[$.name]=$.value,F),{}),O=T.repeat==="1";t.editor?.command.executeAddWatermark({data:T.data,color:T.color,size:Number(T.size),opacity:Number(T.opacity),repeat:O,gap:O&&T.horizontalGap&&T.verticalGap?[Number(T.horizontalGap),Number(T.verticalGap)]:void 0})}}):t.editor?.command.executeDeleteWatermark()}function N(){new De({title:"代码块",data:[{type:"textarea",name:"codeblock",placeholder:"请输入代码",width:500,height:300}],onConfirm:R=>{const g=R.find(F=>F.name==="codeblock")?.value;if(!g)return;const S=xl.tokenize(g,xl.languages.javascript),T=Or(S),O=[];for(let F=0;F<T.length;F++){const $=T[F],D=re.splitText($.content);for(let Q=0;Q<D.length;Q++){const E={value:D[Q]};$.color&&(E.color=$.color),$.bold&&(E.bold=!0),$.italic&&(E.italic=!0),O.push(E)}}O.unshift({value:`
|
|
1
|
+
(function(Z,Y){typeof exports=="object"&&typeof module<"u"?Y(exports,require("unione-base-vue"),require("vue"),require("ant-design-vue"),require("lodash-es"),require("vue-codemirror"),require("@codemirror/lang-javascript"),require("@hufe921/canvas-editor"),require("dayjs"),require("prismjs"),require("@ant-design/icons-vue"),require("uuid")):typeof define=="function"&&define.amd?define(["exports","unione-base-vue","vue","ant-design-vue","lodash-es","vue-codemirror","@codemirror/lang-javascript","@hufe921/canvas-editor","dayjs","prismjs","@ant-design/icons-vue","uuid"],Y):(Z=typeof globalThis<"u"?globalThis:Z||self,Y(Z.index={},Z.UnioneBaseVue,Z.Vue,Z.antDesignVue,Z.lodashEs,Z.vueCodemirror,Z.langJavascript,Z.canvasEditor,Z.dayjs,Z.prism,Z.iconsVue,Z.uuid))})(this,function(Z,Y,i,X,ha,jt,fa,re,ua,xl,Ke,pa){"use strict";const ma={isDebug:!0,axios:{form:"/portal"},listPageUrl:"/unione/page/list",addPageUrl:"/unione/page/add",editPageUrl:"/unione/page/edit",viewPageUrl:"/unione/page/view",formRules:[]},nn=i.ref(ma);function Fe(a){return a&&(nn.value=Y.utils.obj.ext(nn.value,a)),nn.value}const ga={...{...{submit:"提交","submit.ok":"已提交","submit.error":"提交失败","confirm.ok":"确定","confirm.cancel":"取消","global.setting.title":"设置"},...{"pages.home":"首页"},...{"pages.layouts.userLayout.title":"user layout"}}},ka={...{submit:"Submit","submit.ok":"Submitted","submit.error":"Submit Failed","confirm.ok":"Yes","confirm.cancel":"No","global.setting.title":"Settings"},...{"pages.home":"Home"},...{"pages.layouts.userLayout.title":"user layout"}},ba=i.ref([ga,ka]);function ya(a,e){return Y.locales.loadLanguage(a,()=>new Promise((t,n)=>{const l=ba.value.filter(o=>o.localeName==a);if(e)if(typeof e=="function")e().then(o=>{if(l.length==0){const s={...o,localeName:a};t(s)}else{const s={...l[0],...o};t(s)}});else if(l.length==0){const o={...e,localeName:a};t(o)}else{const o={...l[0],...e};t(o)}else l.length>0?t(l[0]):n("local language not defined ,lang:"+a)}))}const ln={...Y.locales};ln.loadLanguage=ya;class wa{$psn;$pid;$store;$forms;$model;$params;$refObj;$refData;constructor(e,t){this.$psn=i.ref(e),this.$pid=i.ref(""),this.$store=i.ref({}),this.$forms=i.ref({}),this.$params=i.ref({}),this.$refObj=i.ref({}),this.$refData=i.ref({}),this.$model=t}params(e){if(e){this.$params.value=e,e.id&&(this.$pid.value=e.id,this.$psn.value&&this.use(this.$psn.value,"form").detail(this.$pid.value));for(const t in this.$store.value)this.$store.value[t].$params=e}return this.$params.value}psn(e){return e&&(this.$psn.value=e),this.$psn.value}regRef(e,t){}setRefData(e,t,n){}use(e,t,n){let l=this.$store.value[e];return l||(l=new on(e,t,this.$model),this.$store.value[e]=l,l.$params=this.$params.value),n&&(l.$form=n,this.$forms.value[e]=n),l}useForm(e,t,n){const l=this.use(e,"form",t);return this.$psn.value==e&&this.$pid.value&&l.detail(this.$pid.value).then(o=>{n&&n(o)}),l}data(e){return this.$store.value[e]}form(e){return e?this.$forms.value[e]:this.$forms.value}primary(){return this.data(this.$psn.value)}dsnList(){return Object.keys(this.$store.value)}}class on{$dsn;$type;$data;$dialog;$model;$form;$params;$store;constructor(e,t,n){typeof e=="string"?(this.$dsn=e,this.$store={controller:"/api/data/storage/v1"}):(this.$store=e,this.$dsn=""),this.$type=t,this.$data=i.ref(t=="form"?{}:{body:[],total:0}),this.$dialog=Y.useDialog(),this.$model=n||i.ref("run")}$isStorage(){return this.$store.controller.indexOf("/api/data/storage")>=0}store(e){return e&&(this.$store=e),this.$store}data(){return this.$type=="form"?this.$data.value||{}:this.$data.value||[]}setValue(e){this.$data.value=e,this.$form?.setValue(e)}$processParams(e,t){if(t)t.forEach(n=>{e[n.name]==null&&e[n.name]==null&&(this.$params[n.name]!=null&&this.$params[n.name]!=null?e[n.alias||n.name]=this.$params[n.name]:n.value!=null&&n.value!=null&&(e[n.alias||n.name]=n.value))});else if(this.$params)for(const n in this.$params)e[n]==null&&e[n]==null&&this.$params[n]!=null&&this.$params[n]!=null&&(e[n]=this.$params[n]);return e}request(e){return new Promise((t,n)=>{const l=X.message.loading("数据请求中..."),o=this.$store.controller+e.url;Y.axios.form({method:"post",...e,url:o}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+o,options:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据请求失败,model sn:"+this.$dsn+",url:"+o,options:e,err:s})}).finally(()=>{l()})})}find(e){const t=this.$store.controller+(this.$store.findUrl||"/find");return!e&&this.$store.findParams&&(e={dsn:this.$dsn}),this.$isStorage()&&(e.dsn=this.$dsn+(this.$model!="run"?"@dev":"")),e&&(e.body=this.$processParams(e.body,this.$store.findParams)),new Promise((n,l)=>{const o=X.message.loading("数据加载中...");Y.axios.form({url:t,method:"post",data:e}).then(s=>{s.success?(this.$data.value=s,n(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据加载失败,model sn:"+this.$dsn,url:t,params:e,err:s})}).finally(()=>{o()})})}save(e){const t=this.$store.controller+(this.$store.saveUrl||"/save");return this.$isStorage()?(e.dsn=this.$dsn+(this.$model!="run"?"@dev":""),e.params=this.$processParams(e.params,this.$store.saveParams)):e.data=this.$processParams(e.data,this.$store.saveParams),new Promise((n,l)=>{const o=X.message.loading("数据提交中...");Y.axios.form({url:t,method:"post",data:this.$isStorage()?e:e.data}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body||{}),s.silence||X.message.success(s.message),n(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),l({info:"数据保存失败,model sn:"+this.$dsn,url:t,data:e,err:s})}).finally(()=>{o()})})}loadByIds(e){return new Promise((t,n)=>{const l=X.message.loading("数据加载中..."),o=this.$store.controller+"/loadByIds";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据加载失败,model sn:"+this.$dsn,ids:e,err:s})}).finally(()=>{l()})})}detail(e){return new Promise((t,n)=>{const l=X.message.loading("数据加载中..."),o=this.$store.controller+"/detail";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{id:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?(this.$type=="form"&&(this.$data.value=s.body),t(s)):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:o,id:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"加载数据详情失败,model sn:"+this.$dsn,url:o,id:e,err:s})}).finally(()=>{l()})})}deleteByIds(e){return new Promise((t,n)=>{this.$dialog.confirm({content:"确定要删除选中记录么?共"+e.length+"条。",onOk:()=>{const l=X.message.loading("数据处理中..."),o=this.$store.controller+"/delete";Y.axios.form({url:o,method:"post",data:this.$isStorage()?{ids:e,dsn:this.$dsn+(this.$model!="run"?"@dev":"")}:e}).then(s=>{s.success?t(s):(s.silence||this.$dialog.error({content:s.message||"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:o,ids:e,result:s}))}).catch(s=>{this.$dialog.error({content:"未知错误,请联系管理员"}),n({info:"数据删除失败,model sn:"+this.$dsn,url:o,ids:e,err:s})}).finally(()=>{l()})}})})}}class Aa{$event;$onces;$delayEmit;constructor(){this.$event=i.ref({}),this.$onces=i.ref({}),this.$delayEmit=i.ref({})}$on(e,t){if(this.$event.value[e]=t,this.$delayEmit.value[e]){const n=this.$delayEmit.value[e];t(n)}}$emit(e,t){if(this.$onces.value[e]){const n=this.$onces.value[e];delete this.$onces.value[e],n(t)}this.$event.value[e]?this.$event.value[e](t):(this.$delayEmit.value[e]=t,setTimeout(()=>{delete this.$delayEmit.value[e]},1e3*10))}$once(e,t){this.$onces.value[e]=t}$off(e){delete this.$event.value[e]}}class ut{define;ebus;model;type;$widgetList;$widgetMap;$dataManager;$axiosProccess;$dialog;constructor(e={sn:"new_",title:"新建页面",types:"setting",vers:1,configs:{widgets:[],dsnList:[]}}){const t=e.configs||{};this.model=i.ref("run"),this.type=i.ref(e.types||"setting"),this.define=i.ref(e),this.ebus=new Aa,this.$widgetList=i.ref([]),this.$widgetMap=i.ref({}),this.$dataManager=new wa(t.dsnList?t.dsnList[0]:"",this.model),this.$axiosProccess=i.ref({}),this.$dialog=Y.useDialog(),this.loadConfig(t)}sn(){return this.define.value.sn}load(e,t){if(!e)return;if(this.define.value.sn=e,e=="new_"){console.log("新建/本地页面sn:"+e+",define:",t),t&&t.configs&&(this.define.value=t,this.type.value=this.define.value.types||"setting",this.loadConfig(t.configs));return}const n=sessionStorage.getItem("PAGE_DEFINE:"+e);if(n&&this.model.value=="run"){this.define.value=JSON.parse(n),this.type.value=this.define.value.types||"setting",this.loadConfig(this.define.value.configs),console.log("从会话缓存中加载页面sn:"+e+",define:",this.define.value);return}Y.axios.form({url:"/api/page/define/load/"+e,method:"post"}).then(l=>{l.success?(this.define.value=l.body,this.type.value=this.define.value.types||"setting",l.body.configs?this.define.value.configs=l.body.configs:this.define.value.configs={widgets:[],dsnList:[]},this.loadConfig(this.define.value.configs),sessionStorage.setItem("PAGE_DEFINE:"+e,JSON.stringify(this.define.value)),console.log("从远程服务加载页面sn:"+e+",define:",this.define.value)):t&&t.configs&&(this.define.value=t,this.loadConfig(t.configs))})}save(){return new Promise((e,t)=>{if(this.$axiosProccess.value.save){console.warn("unione form editor save process runing,sn:"+this.define.value.sn),t();return}this.$axiosProccess.value.save=!0;const n={...this.define.value.configs||{},widgets:this.$widgetList.value,dsnList:this.$dataManager.dsnList()},l={...this.define.value};l.configs=JSON.stringify(n),Y.axios.form({url:"/api/page/define/save",method:"post",data:l}).then(o=>{this.$axiosProccess.value.save=!1,o.success?(X.message.success(o.message),this.define.value=o.body,sessionStorage.setItem("PAGE_DEFINE:"+this.define.value.sn,JSON.stringify(this.define.value)),this.load(this.define.value.sn,this.define.value),e(o.body)):(this.$dialog.error({content:o.message}),t())}).catch(o=>{console.error("页面配置保存失败",o),this.$dialog.error({content:"页面配置保存失败"})}).finally(()=>{this.$axiosProccess.value.save=!1})})}loadConfig(e){e.dsnList?.length&&this.$dataManager.psn(e.dsnList[0]),this.$widgetList.value=e.widgets||[],this.$widgetMap.value={},this.$processWidget(this.$widgetList.value)}setModel(e){this.model.value=e}widget(e,t){if(t){const n={...t,wid:e};this.$widgetMap.value[e]||(this.$widgetList.value.push(n),n.configs?.widgets&&this.$processWidget(n.configs.widgets)),this.$widgetMap.value[e]=n}else return this.$widgetMap.value[e]}widgets(e){if(e)this.$widgetList.value=e,this.$widgetMap.value={},this.$processWidget(e);else return this.$widgetList.value}$processWidget(e){e.forEach(t=>{t.wid||(t.wid="w:"+ha.uniqueId()),this.$widgetMap.value[t.wid]=t,t.configs?.widgets&&this.$processWidget(t.configs.widgets)})}dataManager(){return this.$dataManager}}const xa={class:"widget-setting-dialog"},Ca=i.defineComponent({__name:"widget",props:{model:{type:String,required:!1},settingTitle:{type:String,default:"组件设置"},custome:{type:Boolean,default:!1}},emits:["setting","saving"],setup(a,{expose:e,emit:t}){const n=t,l=i.ref(),o=i.ref(),s=i.ref(!1);function r(){o.value&&(s.value=!0),n("setting")}function c(){n("saving"),s.value=!1}function h(){return l.value?.clientHeight}function f(){return l.value?.clientWidth}return e({getHeight:h,getWidth:f}),(d,p)=>{const m=i.resolveComponent("SettingOutlined"),b=i.resolveComponent("a-tooltip"),y=i.resolveComponent("a-modal");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["unione-widget",a.model]),ref_key:"widgetDom",ref:l},[i.createVNode(b,{title:a.settingTitle},{default:i.withCtx(()=>[a.model=="edit"&&(d.$slots["widget-setting"]||a.custome)?(i.openBlock(),i.createBlock(m,{key:0,class:"widget-setting",onClick:r})):i.createCommentVNode("",!0)]),_:1},8,["title"]),i.renderSlot(d.$slots,"default",{},void 0,!0),a.model=="edit"&&d.$slots["widget-setting"]?(i.openBlock(),i.createBlock(y,{key:0,title:a.settingTitle,ref_key:"settingModal",ref:o,open:s.value,"onUpdate:open":p[0]||(p[0]=A=>s.value=A),centered:"",width:"80%",onOk:c},{default:i.withCtx(()=>[i.createElementVNode("div",xa,[i.renderSlot(d.$slots,"widget-setting",{},void 0,!0)])]),_:3},8,["title","open"])):i.createCommentVNode("",!0)],2)}}}),te=(a,e)=>{const t=a.__vccOpts||a;for(const[n,l]of e)t[n]=l;return t},lt=te(Ca,[["__scopeId","data-v-17b517f5"]]),va={key:0},Sa=["onClick"],fi=te(i.defineComponent({__name:"btnSetting",props:{preset:{type:Array,default(){return[]}}},setup(a,{expose:e}){const t=a,n=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:k})=>k+1},{title:"参数名称",dataIndex:"name",key:"name",width:"60px",align:"center"},{title:"参数标题",dataIndex:"title",key:"title",width:"80px",align:"center"},{title:"参数value",dataIndex:"value",key:"value",width:"100px",align:"center"}]),l=i.ref({selectedRowKeys:[],columnWidth:"25px",onChange:k=>{l.value.selectedRowKeys=k}}),o={mounted:k=>k.focus()},s=i.ref({});function r(){const k=Object.keys(s.value);if(k.length)for(let u in k){const N=y.value.form.action.params[u];N&&s.value[u]&&Object.keys(s.value[u]).forEach(M=>{N[M]=s.value[u][M]})}s.value={}}function c(k,u,N){r();const M={};M[N]=u[N]||"",N=="showIndex"&&(M[N]=u.show?.query?.index),s.value[k]=M}function h(k,u,N){if(!u||!N){s.value={};return}const M=s.value[k][N];u[N]=M,s.value={}}function f(){y.value.form.action.params.push({title:"新建",name:"",value:""})}function d(){}const p=i.ref(""),m=i.ref({title:[{required:!0,message:"按钮标题不能为空"}],name:[{required:!0,message:"按钮名称不能为空"},{validator:(k,u)=>p.value!=u&&t.preset.includes(u)?Promise.reject("预设按钮名称,请使用其他名称,["+t.preset.join(",")+"]"):Promise.resolve(),trigger:"change"}]}),b=i.ref([fa.javascript()]),y=i.ref({title:"按钮设置",visible:!1,form:{},helps:{}}),A=i.ref();function x(k,u,N={}){k=JSON.parse(JSON.stringify(k)),k.event||(k.event={}),k.props||(k.props={}),k.action||(k.action={}),Object.keys(k.action).includes("maskClosable")||(k.action.maskClosable=!0),k.action.params||(k.action.params=[]),p.value=k.name,y.value.form=k,y.value.helps=N,y.value.visible=!0,A.value=u}const w=i.ref(null);function V(){w.value&&w.value.validate().then(()=>{y.value.visible=!1,A.value(y.value.form)})}return e({open:x,close}),(k,u)=>{const N=i.resolveComponent("a-input"),M=i.resolveComponent("a-form-item"),v=i.resolveComponent("a-select"),C=i.resolveComponent("a-input-number"),B=i.resolveComponent("a-checkbox"),R=i.resolveComponent("a-tab-pane"),g=i.resolveComponent("a-switch"),S=i.resolveComponent("a-button"),T=i.resolveComponent("a-divider"),O=i.resolveComponent("ToolOutlined"),F=i.resolveComponent("a-tooltip"),$=i.resolveComponent("a-table"),D=i.resolveComponent("a-tabs"),Q=i.resolveComponent("a-form"),U=i.resolveComponent("a-modal");return i.openBlock(),i.createBlock(U,{visible:y.value.visible,"onUpdate:visible":u[23]||(u[23]=E=>y.value.visible=E),title:y.value.title,centered:"",width:"50%",onOk:V},{default:i.withCtx(()=>[i.createVNode(Q,{name:"basic",ref_key:"form",ref:w,rules:m.value,model:y.value.form,"label-col":{span:5},"wrapper-col":{span:19},autocomplete:"off",class:"form-mix btn-setting-form"},{default:i.withCtx(()=>[i.createVNode(D,null,{default:i.withCtx(()=>[i.createVNode(R,{key:"base",tab:"基本设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"操作标题",required:"",name:"title"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.title,"onUpdate:value":u[0]||(u[0]=E=>y.value.form.title=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"操作名称",name:"name",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.name,"onUpdate:value":u[1]||(u[1]=E=>y.value.form.name=E),disabled:t.preset.includes(y.value.form.name)},null,8,["value","disabled"])]),_:1}),i.createVNode(M,{label:"操作图标"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.icon,"onUpdate:value":u[2]||(u[2]=E=>y.value.form.icon=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮类型"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.type,"onUpdate:value":u[3]||(u[3]=E=>y.value.form.type=E),allowClear:"",options:[{value:"primary",label:"主要按钮"},{value:"ghost",label:"幽灵按钮"},{value:"dashed",label:"虚线按钮"},{value:"link",label:"连接按钮"},{value:"text",label:"文本按钮"},{value:"default",label:"默认按钮"}]},null,8,["value"])]),_:1}),i.createVNode(M,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.index,"onUpdate:value":u[4]||(u[4]=E=>y.value.form.index=E)},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮大小"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.size,"onUpdate:value":u[5]||(u[5]=E=>y.value.form.size=E),options:[{value:"small",label:"小"},{value:"middle",label:"中"},{value:"large",label:"大"}]},null,8,["value"])]),_:1}),i.createVNode(M,{label:"按钮特性"},{default:i.withCtx(()=>[i.createVNode(B,{checked:y.value.form.props.block,"onUpdate:checked":u[6]||(u[6]=E=>y.value.form.props.block=E)},{default:i.withCtx(()=>u[24]||(u[24]=[i.createTextVNode("自适应 ")])),_:1},8,["checked"]),i.createVNode(B,{checked:y.value.form.props.danger,"onUpdate:checked":u[7]||(u[7]=E=>y.value.form.props.danger=E)},{default:i.withCtx(()=>u[25]||(u[25]=[i.createTextVNode("危险 ")])),_:1},8,["checked"]),i.createVNode(B,{checked:y.value.form.props.ghost,"onUpdate:checked":u[8]||(u[8]=E=>y.value.form.props.ghost=E)},{default:i.withCtx(()=>u[26]||(u[26]=[i.createTextVNode("幽灵 ")])),_:1},8,["checked"])]),_:1})]),_:1}),i.createVNode(R,{key:"action",tab:"响应设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"响应方式",required:""},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.type,"onUpdate:value":u[9]||(u[9]=E=>y.value.form.action.type=E),options:[{value:"link",label:"连接"},{value:"route",label:"路由"},{value:"drawer",label:"抽屉"},{value:"dialog",label:"对话框"}]},null,8,["value"])]),_:1}),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:0,label:"页面编码",help:"根据该页面编码渲染页面内容"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.psn,"onUpdate:value":u[10]||(u[10]=E=>y.value.form.action.psn=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:1,label:"组件名称",help:"组件方式渲染,Vue全局注册的组件名称,且监听params参数,psn参数"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.component,"onUpdate:value":u[11]||(u[11]=E=>y.value.form.action.component=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(M,{label:"连接地址"},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.href,"onUpdate:value":u[12]||(u[12]=E=>y.value.form.action.href=E)},null,8,["value"])]),_:1}),["link","route"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:2,label:"连接方式"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.target,"onUpdate:value":u[13]||(u[13]=E=>y.value.form.action.target=E),options:[{value:"_blank",label:"新卡片页"},{value:"_self",label:"当前页面"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:3,label:"抽屉位置"},{default:i.withCtx(()=>[i.createVNode(v,{value:y.value.form.action.position,"onUpdate:value":u[14]||(u[14]=E=>y.value.form.action.position=E),options:[{value:"left",label:"左侧"},{value:"right",label:"右侧"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:4,label:"显示标题",required:""},{default:i.withCtx(()=>[i.createVNode(N,{value:y.value.form.action.title,"onUpdate:value":u[15]||(u[15]=E=>y.value.form.action.title=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:5,label:"蒙层关闭"},{default:i.withCtx(()=>[i.createVNode(g,{checked:y.value.form.action.maskClosable,"onUpdate:checked":u[16]||(u[16]=E=>y.value.form.action.maskClosable=E),"checked-children":"开","un-checked-children":"关"},null,8,["checked"])]),_:1})):i.createCommentVNode("",!0),["drawer","dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:6,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.width,"onUpdate:value":u[17]||(u[17]=E=>y.value.form.action.width=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["dialog"].includes(y.value.form.action.type)?(i.openBlock(),i.createBlock(M,{key:7,label:"显示高度"},{default:i.withCtx(()=>[i.createVNode(C,{value:y.value.form.action.height,"onUpdate:value":u[18]||(u[18]=E=>y.value.form.action.height=E)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(T,{orientation:"left"},{default:i.withCtx(()=>[u[29]||(u[29]=i.createTextVNode("参数列表 ")),i.createVNode(S,{size:"small",class:"param-btn",onClick:f},{default:i.withCtx(()=>u[27]||(u[27]=[i.createTextVNode("添加")])),_:1}),i.createVNode(S,{size:"small",class:"param-btn",danger:"",onClick:d},{default:i.withCtx(()=>u[28]||(u[28]=[i.createTextVNode("删除")])),_:1})]),_:1}),i.createVNode($,{columns:n.value,"data-source":y.value.form.action.params,bordered:"",pagination:!1,"row-selection":l.value,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:E})=>[["name","title"].includes(E.key)?(i.openBlock(),i.createElementBlock("span",va,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(E.title),1)])):i.createCommentVNode("",!0),["value"].includes(E.key)?(i.openBlock(),i.createBlock(F,{key:1,title:"支持常量和变量,变量使用{row.属性}方式获取"},{default:i.withCtx(()=>[i.createElementVNode("span",null,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(E.title),1)])]),_:2},1024)):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:E,text:P,record:I,index:_})=>[["name","title","value"].includes(E.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!s.value[_]||!Object.keys(s.value[_]).includes(E.dataIndex))&&!P&&"empty"]),onClick:z=>c(_,I,E.dataIndex)},[s.value[_]&&Object.keys(s.value[_]).includes(E.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(N,{key:0,value:s.value[_][E.dataIndex],"onUpdate:value":z=>s.value[_][E.dataIndex]=z,onBlur:z=>h(_,I,E.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[o]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(P),1)],64))],10,Sa)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source","row-selection"])]),_:1}),i.createVNode(R,{key:"event",tab:"事件设置"},{default:i.withCtx(()=>[i.createVNode(M,{label:"点击事件",help:y.value.helps.clickScript||"点击事件处理脚本,上下文参数:ctx,当前按钮对象:btn,当前事件对象:event,返回false则不触发默认逻辑"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.clickScript,"onUpdate:modelValue":u[19]||(u[19]=E=>y.value.form.event.clickScript=E),placeholder:"请输入点击事件处理脚本",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"禁用逻辑",help:y.value.helps.disableScript||"按钮禁用逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回true禁用,否则可用"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.disableScript,"onUpdate:modelValue":u[20]||(u[20]=E=>y.value.form.event.disableScript=E),placeholder:"请输入按钮禁用逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"显示逻辑",help:y.value.helps.visibleScript||"按钮显示逻辑控制脚本,上下文参数:ctx,当前按钮对象:btn,返回false隐藏,否则可见"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.visibleScript,"onUpdate:modelValue":u[21]||(u[21]=E=>y.value.form.event.visibleScript=E),placeholder:"请输入按钮显示逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"]),i.createVNode(M,{label:"动态标题",help:y.value.helps.titleScript||"按钮显示标题控制脚本,上下文参数:ctx,当前按钮对象:btn"},{default:i.withCtx(()=>[i.createVNode(i.unref(jt.Codemirror),{modelValue:y.value.form.event.titleScript,"onUpdate:modelValue":u[22]||(u[22]=E=>y.value.form.event.titleScript=E),placeholder:"请输入按钮动态标题逻辑",style:{height:"250px"},autofocus:!0,"indent-with-tab":!0,tabSize:8,extensions:b.value,scrollbarStyle:null},null,8,["modelValue","extensions"])]),_:1},8,["help"])]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1},8,["visible","title"])}}}),[["__scopeId","data-v-75055a2b"]]),Ba=["src"],Na=["src"],Va=te(i.defineComponent({__name:"btn",props:{editor:{type:Object,required:!1},disabled:{type:Boolean,default:!1},type:{type:String},widget:{type:Object,required:!0,default(){return{}}},preset:{type:Array,default(){return[]}},ctx:{type:Object,default(){return{}}}},emits:["click"],setup(a,{emit:e}){const t=Fe(),n=a,l=Y.useSession();i.watch(()=>n.widget?.event,()=>{s()}),i.onMounted(()=>{s()});const o=i.ref({});function s(){n.widget?.event&&(n.widget.event.clickScript?o.value.click=new Function("ctx","btn","event",n.widget.event.clickScript):n.widget.event.click&&(o.value.click=n.widget.event.click),n.widget.event.disableScript?o.value.disable=new Function("ctx","btn",n.widget.event.disableScript):n.widget.event.disable&&(o.value.disable=n.widget.event.disable),n.widget.event.visibleScript?o.value.visible=new Function("ctx","btn",n.widget.event.visibleScript):n.widget.event.visible&&(o.value.visible=n.widget.event.visible),n.widget.event.titleScript?o.value.title=new Function("ctx","btn",n.widget.event.titleScript):n.widget.event.title&&(o.value.title=n.widget.event.title)),typeof n.widget.click=="function"&&(o.value.click=n.widget.click),typeof n.widget.title=="function"&&(o.value.title=n.widget.title),typeof n.widget.visible=="function"&&(o.value.visible=n.widget.visible),typeof n.widget.disabled=="function"&&(o.value.disable=n.widget.disabled)}const r=i.computed(()=>o.value.title?o.value.title(p.value,n.widget):n.widget.title),c=i.computed(()=>o.value.visible?o.value.visible(p.value,n.widget)!=!1:n.widget.visible!=!1),h=i.computed(()=>n.disabled==!0?!0:o.value.disable?o.value.disable(p.value,n.widget):n.widget.disable==!0),f=i.ref(null);function d(){f.value?.open(n.widget,k=>{console.log("btn props",k),Object.keys(k).forEach(u=>{n.widget[u]=k[u]}),console.log("props btn",n.widget)})}const p=i.computed(()=>({...n.ctx,user:l.getPrincipal(),token:l.getToken()})),m=i.ref({open:!1}),b=i.computed(()=>{if(n.widget.action?.href){let k=n.widget.action.href;const u=k.matchAll("{[a-zA-Z.]*}"),N=[];let M=null;for(;M=u.next();){if(M&&M.value&&M.value[0]){let v=M.value[0].substring(1,M.value[0].length-1);N.includes(v)||N.push(v)}if(M.done)break}if(N.length>0)for(let v=0;v<N.length;v++){let C=N[v],B=Y.utils.obj.getValue(p.value,C);B?B instanceof Object?k=k.replaceAll("{"+C+"}",JSON.stringify(B)):Array.isArray(B)?k=k.replaceAll("{"+C+"}",B.join(",")):k=k.replaceAll("{"+C+"}",B):k=k.replaceAll("{"+C+"}","")}return k}return""}),y=i.computed(()=>{const k={};let u=n.widget.action?.href||n.widget.action?.link;if(u){const N=u.matchAll("{[a-zA-Z0-9.]*}"),M=[];let v=null;for(;v=N.next();){if(v&&v.value&&v.value[0]){let B=v.value[0].substring(1,v.value[0].length-1);M.includes(B)||M.push(B)}if(v.done)break}if(M.length>0)for(let B=0;B<M.length;B++){let R=M[B],g=Y.utils.obj.getValue(p.value,R);g?g instanceof Object?u=u.replaceAll("{"+R+"}",JSON.stringify(g)):Array.isArray(g)?u=u.replaceAll("{"+R+"}",g.join(",")):u=u.replaceAll("{"+R+"}",g):u=u.replaceAll("{"+R+"}","")}const C=u.split("?")[1];C&&C.split("&").forEach(B=>{const R=B.split("=");R[0]&&R[1]&&(k[R[0]]=R[1])})}return n.widget.action?.params&&n.widget.action.params.filter(N=>N.value+"").forEach(N=>{if(new RegExp("{[a-zA-Z0-9.]*}").test(N.value)){let v=Y.utils.obj.getValue(p.value,N.value);k[N.name]=v}else k[N.name]=N.value}),k}),A=e,x=i.inject("router");function w(k){if(t.isDebug&&console.log("unione btn click",n.widget,k),!(o.value.click&&o.value.click(p.value,n.widget,k)==!1)){if(n.widget.action?.type=="drawer"||n.widget.action?.type=="dialog")m.value.open=!0;else if(n.widget.action?.type=="route"&&(n.widget.action?.href||n.widget.action?.link)){if(n.widget.action.link&&n.editor?.type.value=="code")return;x.push({path:n.widget.action.href||n.widget.action?.link,query:y.value})}A("click",{btn:n.widget,event:k})}}function V(k){A("click",k)}return(k,u)=>{const N=i.resolveComponent("a-button"),M=i.resolveComponent("unione-btn"),v=i.resolveComponent("a-dropdown"),C=i.resolveComponent("a-drawer"),B=i.resolveComponent("a-modal");return c.value?(i.openBlock(),i.createBlock(lt,{key:0,class:i.normalizeClass(["unione-btn",a.widget.props?.block&&"unione-btn-block"]),model:a.editor?.model.value,onSetting:d,custome:!0,"setting-title":"按钮设置"},{default:i.withCtx(()=>[!a.widget.widget||a.widget.widget=="button"?(i.openBlock(),i.createBlock(N,i.mergeProps({key:0,disabled:h.value,size:a.widget.size||"small",type:a.type||a.widget.type,shape:a.widget.shape,class:"unione-btn-"+a.widget.name,loading:a.widget.loading,target:a.widget.action?.target,title:a.widget.tooltip,onClick:w},a.widget.props),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value)+" ",1)]),_:2},[a.widget.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(a.widget.icon)))]),key:"0"}:void 0]),1040,["disabled","size","type","shape","class","loading","target","title"])):i.createCommentVNode("",!0),a.widget.widget=="dropdown"?(i.openBlock(),i.createBlock(v,{key:1,trigger:[a.widget.trigger||"hover"],class:i.normalizeClass([a.widget.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["dropdown-overlay",a.widget.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.widget.items,R=>(i.openBlock(),i.createBlock(M,{key:R.name,class:"item",widget:R,editor:a.editor,preset:a.preset,ctx:a.ctx,onClick:V},null,8,["widget","editor","preset","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode(N,{size:a.widget.size||"small"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value),1)]),_:1},8,["size"])]),_:1},8,["trigger","class"])):i.createCommentVNode("",!0),a.widget.action?.type=="drawer"?(i.openBlock(),i.createBlock(C,{key:2,open:m.value.open,"onUpdate:open":u[0]||(u[0]=R=>m.value.open=R),title:a.widget.action?.title,placement:a.widget.action?.position,maskClosable:a.widget.action?.maskClosable,width:a.widget.action?.width,bodyStyle:{padding:0,overflow:!a.widget.action.component||a.widget.action.component=="iframe"?"hidden":"auto"}},{default:i.withCtx(()=>[!a.widget.action.component||a.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value},null,8,Ba)):i.createCommentVNode("",!0)]),_:1},8,["open","title","placement","maskClosable","width","bodyStyle"])):i.createCommentVNode("",!0),a.widget.action?.type=="dialog"?(i.openBlock(),i.createBlock(B,{key:3,open:m.value.open,"onUpdate:open":u[1]||(u[1]=R=>m.value.open=R),title:a.widget.action?.title,width:a.widget.action?.width,maskClosable:a.widget.action?.maskClosable,centered:"",footer:null},{default:i.withCtx(()=>[!a.widget.action.component||a.widget.action.component=="iframe"?(i.openBlock(),i.createElementBlock("iframe",{key:0,class:"unione-iframe unione-btn-iframe",src:b.value,style:i.normalizeStyle({height:a.widget.action?.height?a.widget.action?.height+"px":""})},null,12,Na)):i.createCommentVNode("",!0)]),_:1},8,["open","title","width","maskClosable"])):i.createCommentVNode("",!0),i.createVNode(fi,{ref_key:"btnSetting",ref:f,preset:n.preset},null,8,["preset"])]),_:1},8,["class","model"])):i.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b868da76"]]),Ra={key:0,class:"unione-widget-empty-tip"},Ea=te(i.defineComponent({__name:"tabs",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},setup(a){const e=a,t=i.ref(),n=i.computed(()=>e.editor?.widget(e.wid)||e.widget);return(l,o)=>{const s=i.resolveComponent("a-tab-pane"),r=i.resolveComponent("a-tabs");return i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-layout-tabs"]),model:e.editor?.model},{default:i.withCtx(()=>[n.value?(i.openBlock(),i.createBlock(r,{key:0,activeKey:t.value,"onUpdate:activeKey":o[0]||(o[0]=c=>t.value=c)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.chidlren,(c,h)=>(i.openBlock(),i.createBlock(s,{key:h,class:"unione-layout-tab-pane"},{tab:i.withCtx(()=>[i.createElementVNode("span",null,[c.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(c.icon),{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(c.title),1)])]),default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.chidlren,(f,d)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(f.widget),{key:d,wid:f.wid,editor:e.editor,widget:f},null,8,["wid","editor","widget"]))),128)),!c.chidlren||!c.chidlren.length?(i.openBlock(),i.createElementBlock("div",Ra,i.toDisplayString(c.emptyTips),1)):i.createCommentVNode("",!0)]),_:2},1024))),128))]),_:1},8,["activeKey"])):i.createCommentVNode("",!0)]),_:1},8,["model"])}}}),[["__scopeId","data-v-7b565c89"]]),Oa={class:"title"},Ma={class:"text"},Ta={key:0,class:"reactive"},Ia={key:1,class:"opts"},Fa={class:"warp"},Da=te(i.defineComponent({__name:"section",props:i.mergeModels({title:{type:String,required:!1},icon:{type:String,required:!1},type:{type:String,required:!1},location:{type:String,default:"left"},reactive:{type:Boolean,default:!1},wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1}},{modelValue:{type:Boolean,default:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(a){const e=a,t=i.computed(()=>e.editor?.widget(e.wid)||e.widget),n=i.computed(()=>t.value?.title||e.title),l=i.computed(()=>t.value?.icon||e.icon),o=i.computed(()=>t.value?.type||e.type),s=i.useModel(a,"modelValue");function r(){e.reactive&&(s.value=!s.value)}return(c,h)=>(i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-layout-section",s.value?"open":"close"]),model:e.editor?.model},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["head",a.location,a.reactive&&"reactive"]),onClick:r},[i.createElementVNode("div",Oa,[o.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["type",o.value])},null,2)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.value),{key:1,class:"icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",Ma,i.toDisplayString(n.value),1)]),a.reactive?(i.openBlock(),i.createElementBlock("div",Ta,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value?"UpOutlined":"DownOutlined")))])):i.createCommentVNode("",!0),a.location=="left"?(i.openBlock(),i.createElementBlock("div",Ia,[i.renderSlot(c.$slots,"opts",{},void 0,!0)])):i.createCommentVNode("",!0)],2),i.withDirectives(i.createElementVNode("div",Fa,[i.renderSlot(c.$slots,"default",{},void 0,!0)],512),[[i.vShow,s.value]])]),_:3},8,["class","model"]))}}),[["__scopeId","data-v-e75e9a84"]]),_a={class:"unione-props-setting unione-form-setting"},Pa={class:"unione-form-btns"},$a={key:0},La=["onClick"],Ua={class:"field-txt"},za=["onClick"],ja={key:1,class:"field-txt"},qa=["onClick"],Qa={key:0,class:"field-txt"},Wa={key:3,class:"edit-field"},Ya={key:0},Ha=["onClick"],Ka=te(i.defineComponent({__name:"formSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"控件类型",dataIndex:"widget",key:"widget",width:"60px",align:"center"},{title:"验证规则",dataIndex:"rules",key:"rules",width:"60px",align:"center"},{title:"表单",dataIndex:"isForm",key:"isForm",width:"40px",align:"center"},{title:"详情",dataIndex:"isView",key:"isView",width:"40px",align:"center"},{title:"转换器",dataIndex:"convertName",key:"convertName",width:"50px",align:"center"}]),n=i.computed(()=>{const v=e.editor.widget(e.wid)||{};return v.configs||(v.configs={}),v.configs.settings||(v.configs.settings={}),v.configs.settings.btns||(v.configs.settings.btns=[]),v}),l=i.computed(()=>(e.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),o=i.computed(()=>{const v=n.value.configs.settings.btns,C=v.map(B=>B.name);if(!C.includes("save")){const B={title:"保存",type:"primary",index:0,visible:!0,name:"save"};v.splice(B.index,0,B)}if(!C.includes("submit")){const B={title:"提交",type:"primary",index:1,visible:!0,name:"submit"};let R=B.index||1;v.splice(R,0,B)}if(!C.includes("reset")){const B={title:"重置",type:"default",index:2,visible:!0,props:{danger:!0},name:"reset"};v.splice(B.index,0,B)}if(!C.includes("back")){const B={title:"返回",type:"default",index:3,visible:!0,name:"back"};v.splice(B.index,0,B)}return v}),s=i.ref(null);function r(v){s.value&&s.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(B=>{v[B]=C[B]}),n.value.configs.settings.btns.sort((B,R)=>{const g=B.index||1,S=R.index||1;return g-S}),n.value.configs.settings.btns=[...n.value.configs.btns]})}function c(){const v=n.value.configs.settings.btns.length+1;let C={title:"新增",name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};C.name="new_"+n.value.configs.settings.btns.length;const B=n.value.configs.settings.btns.filter(R=>R.name==C.name).length;B>0&&(C.name=C.name+B),n.value.configs.settings.btns.push(C),e.editor.widget(e.wid,n.value),s.value.open(C,R=>{Object.keys(R).forEach(g=>{C[g]=R[g]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(v){const C=()=>{if(["save","submit","reset","back"].includes(v.name))v.visible=!1,n.value.configs.settings.btns=[...n.value.configs.settings.btns];else{const B=[];n.value.configs.settings.btns.forEach(R=>{R.name!=v.name&&B.push(R)}),n.value.configs.settings.btns=B}};X.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{C()}})}const f=i.ref({visible:!1,field:{},props:{},widgets:[{value:"a-input",label:"文本框"},{value:"a-textarea",label:"文本域"},{value:"a-input",label:"文本框"},{value:"a-checkbox",label:"多选框"},{value:"a-radio",label:"单选框"},{value:"a-input-number",label:"数值框"},{value:"a-select",label:"下拉框"},{value:"a-tree-select",label:"下拉树"},{value:"a-date-picker",label:"日期框"},{value:"a-input-password",label:"密码框"},{value:"a-input-search",label:"搜索框"},{value:"a-upload",label:"文件框"},{value:"unione-avatar",label:"头像框",disabled:!0},{value:"unione-picture-card",label:"照片墙"},{value:"a-switch",label:"开关"},{value:"a-slider",label:"滑块"}],widgetName:v=>{const C=f.value.widgets.filter(B=>B.value==v);return C[0]?C[0].label:v},toSetting:()=>{}}),d=i.ref({visible:!1,field:{},props:{},showInfo:v=>{let C="";return v.rules&&(C=v.rules.filter(B=>B.enable).length||""),C&&(C="("+C+")"),C},toSetting:()=>{const v=d.value.props,C={name:"range",trigger:v.trigger,whitespace:v.whitespace,message:v.rangeMessage};v.rangeMin!=null&&v.rangeMin!=null&&(C.min=v.rangeMin,C.enable=!0),v.rangeMax!=null&&v.rangeMax!=null&&(C.max=v.rangeMax,C.enable=!0);const B={name:"reg",trigger:v.trigger,whitespace:v.whitespace,message:v.regMessage};v.regExpress&&(B.pattern=v.regExpress,B.enable=!0),d.value.field.rules=[C,B],d.value.visible=!1,d.value.props={},console.log("rule",d.value.field.rules)}});function p(v){d.value.visible=!0,d.value.field=v;const C=v.rules||[],B={trigger:"change",whitespace:!0};C.forEach(R=>{R.name=="reg"&&(B.trigger=R.trigger,B.whitespace=R.whitespace,B.regExpress=R.pattern,B.regMessage=R.message),R.name=="range"&&(B.rangeMin=R.min,B.rangeMax=R.max,B.rangeMessage=R.message)}),d.value.props=B}const m=i.ref({title:"列头设置",prop:"isList",visible:!1,field:{},show:{},toSetting:()=>{m.value.visible=!1}});function b(v,C){const B=w.value.filter(g=>g.name==v.name);B.forEach(g=>{C!="isSort"?g[C]=!0:g[C]=!g[C]});const R=B[0];if(!(!R||C=="isSort")){switch(m.value.prop=C,m.value.field=v,R.show||(R.show={}),C){case"isQuery":R.show.query||(R.show.query={}),m.value.show=R.show.query,m.value.title=`查询设置/${v.title}(${v.name})`;break;case"isForm":R.show.form||(R.show.form={}),m.value.show=R.show.form,m.value.title=`表单设置/${v.title}(${v.name})`;break;case"isView":R.show.view||(R.show.view={}),m.value.show=R.show.view,m.value.title=`详情设置/${v.title}(${v.name})`;break;case"isList":R.show.list||(R.show.list={}),m.value.show=R.show.list,m.value.title=`列头设置/${v.title}(${v.name})`;break}m.value.visible=!0}}const y=i.ref({visible:!1,field:{},convert:{},optionColumn:[{title:"选项标题",dataIndex:"label"},{title:"选项值",dataIndex:"value"},{title:"操作",dataIndex:"action",width:"20%"}],toAddOption:()=>{y.value.convert.options||(y.value.convert.options=[]),y.value.convert.options.push({label:"",value:""})},toDelOption:(v,C)=>{y.value.convert.options.splice(v,1)},toSetting:()=>{y.value.visible=!1}});function A(v){y.value.visible=!0,y.value.field=v,y.value.convert=v.convert||{}}const x=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),w=i.computed(()=>x.value.fields?.length?x.value.fields:[]),V={mounted:v=>v.focus()},k=i.ref({});function u(v,C){const B={};C=="convertName"?B[C]=v.convert?.type:B[C]=v[C]||"",k.value={},k.value[v.name]=B}function N(v,C){{k.value={};return}}function M(v,C){w.value.filter(R=>R.name==v.name).forEach(R=>{R[C]=!R[C]})}return(v,C)=>{const B=i.resolveComponent("a-divider"),R=i.resolveComponent("CloseOutlined"),g=i.resolveComponent("a-button"),S=i.resolveComponent("PlusOutlined"),T=i.resolveComponent("a-select"),O=i.resolveComponent("ToolOutlined"),F=i.resolveComponent("a-checkbox"),$=i.resolveComponent("a-table"),D=i.resolveComponent("a-select-option"),Q=i.resolveComponent("a-form-item"),U=i.resolveComponent("a-form"),E=i.resolveComponent("a-modal"),P=i.resolveComponent("a-checkbox-group"),I=i.resolveComponent("a-input-number"),_=i.resolveComponent("a-input"),z=i.resolveComponent("a-col"),K=i.resolveComponent("a-row");return i.openBlock(),i.createElementBlock("div",_a,[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[23]||(C[23]=[i.createTextVNode("按钮设置")])),_:1}),i.createElementVNode("div",Pa,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,L=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:L.name,class:["btn",L.name,!L.visible&&"deleted"],type:L.visible?L.type:"default",size:L.size,ref_for:!0},L.props||{},{onClick:J=>r(L)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(L.title)+" ",1),L.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"btn-del",onClick:i.withModifiers(J=>h(L),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[L.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(L.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","btn-add"]),size:"small",onClick:C[0]||(C[0]=L=>c())},{default:i.withCtx(()=>[i.createVNode(S)]),_:1})]),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[24]||(C[24]=[i.createTextVNode("表单设置")])),_:1}),C[36]||(C[36]=i.createTextVNode(" 数据模型:")),i.createVNode(T,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":C[1]||(C[1]=L=>n.value.dataModel=L)},null,8,["options","value"]),i.createVNode($,{columns:t.value,"data-source":w.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:L})=>[["widget","rules","convertName"].includes(L.key)?(i.openBlock(),i.createElementBlock("span",$a,[i.createVNode(O),i.createTextVNode(" "+i.toDisplayString(L.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:L,text:J,record:ee})=>[["rules"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",!d.value.showInfo(ee)&&"empty"]),onClick:ke=>p(ee)},[i.createElementVNode("span",Ua,i.toDisplayString(d.value.showInfo(ee)),1),d.value.showInfo(ee)?(i.openBlock(),i.createBlock(g,{key:0,type:"link"},{default:i.withCtx(()=>C[25]||(C[25]=[i.createTextVNode("设置")])),_:1})):i.createCommentVNode("",!0)],10,La)):["widget"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["edit-field",(!k.value[ee.name]||!Object.keys(k.value[ee.name]).includes(L.dataIndex))&&!J&&"empty"]),onClick:ke=>u(ee,L.dataIndex)},[k.value[ee.name]&&Object.keys(k.value[ee.name]).includes(L.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(T,{key:0,value:ee[L.dataIndex],"onUpdate:value":ke=>ee[L.dataIndex]=ke,options:f.value.widgets,onBlur:C[2]||(C[2]=ke=>N())},null,8,["value","onUpdate:value","options"])),[[V]]):(i.openBlock(),i.createElementBlock("span",ja,i.toDisplayString(f.value.widgetName(J)),1))],10,za)):["convertName"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!k.value[ee.name]||!Object.keys(k.value[ee.name]).includes(L.dataIndex))&&!ee.convert?.type&&"empty"]),onClick:ke=>u(ee,L.dataIndex)},[k.value[ee.name]&&Object.keys(k.value[ee.name]).includes(L.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(T,{key:0,value:ee[L.dataIndex],"onUpdate:value":ke=>ee[L.dataIndex]=ke,options:[{value:"dict",label:"字典"},{value:"option",label:"静态"}],onBlur:C[3]||(C[3]=ke=>N())},null,8,["value","onUpdate:value"])),[[V]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[ee.convert?.type?(i.openBlock(),i.createElementBlock("span",Qa,i.toDisplayString(ee.convert.type=="dict"?"字典":"静态"),1)):i.createCommentVNode("",!0),ee.convert?.type?(i.openBlock(),i.createBlock(g,{key:1,type:"link",onClick:i.withModifiers(ke=>A(ee),["stop"])},{default:i.withCtx(()=>C[26]||(C[26]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])):i.createCommentVNode("",!0)],64))],10,qa)):["isForm","isView"].includes(L.dataIndex)?(i.openBlock(),i.createElementBlock("div",Wa,[i.createVNode(F,{checked:ee[L.dataIndex],onClick:ke=>M(ee,L.dataIndex)},null,8,["checked","onClick"]),i.createVNode(g,{type:"link",onClick:ke=>b(ee,L.dataIndex)},{default:i.withCtx(()=>C[27]||(C[27]=[i.createTextVNode("设置")])),_:2},1032,["onClick"])])):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(E,{visible:f.value.visible,"onUpdate:visible":C[5]||(C[5]=L=>f.value.visible=L),title:"控件设置",onOk:f.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:f.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[f.value.field.widget=="a-select"?(i.openBlock(),i.createBlock(Q,{key:0,label:"下拉框类型"},{default:i.withCtx(()=>[i.createVNode(T,{value:f.value.props.mode,"onUpdate:value":C[4]||(C[4]=L=>f.value.props.mode=L),allowClear:!0},{default:i.withCtx(()=>[i.createVNode(D,{value:"multiple"},{default:i.withCtx(()=>C[28]||(C[28]=[i.createTextVNode("多选")])),_:1}),i.createVNode(D,{value:"tags"},{default:i.withCtx(()=>C[29]||(C[29]=[i.createTextVNode("标签")])),_:1})]),_:1},8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(E,{visible:d.value.visible,"onUpdate:visible":C[13]||(C[13]=L=>d.value.visible=L),title:"规则设置",onOk:d.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:d.value.props,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off",class:"form-mix"},{default:i.withCtx(()=>[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[30]||(C[30]=[i.createTextVNode("基本设置")])),_:1}),i.createVNode(Q,{label:"触发时机"},{default:i.withCtx(()=>[i.createVNode(P,{value:d.value.props.trigger,"onUpdate:value":C[6]||(C[6]=L=>d.value.props.trigger=L),options:["change","blur"]},null,8,["value"])]),_:1}),d.value.field.isNull?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Q,{key:0,label:"忽略空格",class:"checkbox-tips"},{default:i.withCtx(()=>[i.createVNode(F,{value:d.value.props.whitespace,"onUpdate:value":C[7]||(C[7]=L=>d.value.props.whitespace=L),checked:d.value.props.whitespace},{default:i.withCtx(()=>C[31]||(C[31]=[i.createTextVNode(" 必填验证开启时,是否忽略空格 ")])),_:1},8,["value","checked"])]),_:1})),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[32]||(C[32]=[i.createTextVNode("数值区间")])),_:1}),i.createVNode(Q,{label:"有效区间"},{default:i.withCtx(()=>[i.createVNode(I,{value:d.value.props.rangeMin,"onUpdate:value":C[8]||(C[8]=L=>d.value.props.rangeMin=L)},null,8,["value"]),C[33]||(C[33]=i.createElementVNode("span",{style:{margin:"auto 5px"}},null,-1)),i.createVNode(I,{value:d.value.props.rangeMax,"onUpdate:value":C[9]||(C[9]=L=>d.value.props.rangeMax=L)},null,8,["value"])]),_:1}),i.createVNode(Q,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.rangeMessage,"onUpdate:value":C[10]||(C[10]=L=>d.value.props.rangeMessage=L)},null,8,["value"])]),_:1}),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[34]||(C[34]=[i.createTextVNode("正则验证")])),_:1}),i.createVNode(Q,{label:"表达式"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.regExpress,"onUpdate:value":C[11]||(C[11]=L=>d.value.props.regExpress=L)},null,8,["value"])]),_:1}),i.createVNode(Q,{label:"错误提示"},{default:i.withCtx(()=>[i.createVNode(_,{value:d.value.props.regMessage,"onUpdate:value":C[12]||(C[12]=L=>d.value.props.regMessage=L)},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1},8,["visible","onOk"]),i.createVNode(E,{visible:m.value.visible,"onUpdate:visible":C[20]||(C[20]=L=>m.value.visible=L),title:m.value.title,onOk:m.value.toSetting},{default:i.withCtx(()=>[i.createVNode(U,{model:m.value.show,name:"basic","label-col":{span:6},"wrapper-col":{span:18},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(Q,{label:"显示顺序"},{default:i.withCtx(()=>[i.createVNode(I,{value:m.value.show.index,"onUpdate:value":C[14]||(C[14]=L=>m.value.show.index=L)},null,8,["value"])]),_:1}),["isQuery"].includes(m.value.prop)?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Q,{key:0,label:"显示宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.width,"onUpdate:value":C[15]||(C[15]=L=>m.value.show.width=L)},null,8,["value"])]),_:1})),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:1,label:"标题宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.labelWidth,"onUpdate:value":C[16]||(C[16]=L=>m.value.show.labelWidth=L)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isForm","isView"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:2,label:"控件宽度"},{default:i.withCtx(()=>[i.createVNode(_,{value:m.value.show.valueWidth,"onUpdate:value":C[17]||(C[17]=L=>m.value.show.valueWidth=L)},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:3,label:"固定位置"},{default:i.withCtx(()=>[i.createVNode(T,{value:m.value.show.fixed,"onUpdate:value":C[18]||(C[18]=L=>m.value.show.fixed=L),options:[{value:"",label:"无"},{value:"left",label:"靠左"},{value:"right",label:"靠右"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0),["isList"].includes(m.value.prop)?(i.openBlock(),i.createBlock(Q,{key:4,label:"对齐方式"},{default:i.withCtx(()=>[i.createVNode(T,{value:m.value.show.align,"onUpdate:value":C[19]||(C[19]=L=>m.value.show.align=L),options:[{value:"left",label:"左对齐"},{value:"center",label:"居中"},{value:"right",label:"右对齐"}]},null,8,["value"])]),_:1})):i.createCommentVNode("",!0)]),_:1},8,["model"])]),_:1},8,["visible","title","onOk"]),i.createVNode(E,{visible:y.value.visible,"onUpdate:visible":C[22]||(C[22]=L=>y.value.visible=L),title:y.value.convert.type=="dict"?"字典设置":"选项设置",onOk:y.value.toSetting},{default:i.withCtx(()=>[y.value.convert.type!="dict"?(i.openBlock(),i.createElementBlock("div",Ya,[i.createVNode(g,{class:"editable-add-btn",style:{"margin-bottom":"8px"},onClick:y.value.toAddOption},{default:i.withCtx(()=>C[35]||(C[35]=[i.createTextVNode("新增")])),_:1},8,["onClick"]),i.createVNode($,{columns:y.value.optionColumn,"data-source":y.value.convert.options,size:"small"},{bodyCell:i.withCtx(({column:L,record:J,index:ee})=>[L.dataIndex==="label"?(i.openBlock(),i.createBlock(_,{key:0,value:J.label,"onUpdate:value":ke=>J.label=ke,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),L.dataIndex==="value"?(i.openBlock(),i.createBlock(_,{key:1,value:J.value,"onUpdate:value":ke=>J.value=ke,style:{margin:"-5px 0"}},null,8,["value","onUpdate:value"])):i.createCommentVNode("",!0),L.dataIndex==="action"?(i.openBlock(),i.createElementBlock("a",{key:2,onClick:ke=>y.value.toDelOption(ee,J)},"删除",8,Ha)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"])])):i.createCommentVNode("",!0),y.value.convert.type=="dict"?(i.openBlock(),i.createBlock(U,{key:1,model:y.value.convert,name:"basic","label-col":{span:8},"wrapper-col":{span:16},autocomplete:"off"},{default:i.withCtx(()=>[i.createVNode(K,{type:"flex",style:{width:"100%"}},{default:i.withCtx(()=>[i.createVNode(z,{span:24,order:1},{default:i.withCtx(()=>[i.createVNode(Q,{label:"字典名称:"},{default:i.withCtx(()=>[i.createVNode(_,{value:y.value.convert.dict,"onUpdate:value":C[21]||(C[21]=L=>y.value.convert.dict=L)},null,8,["value"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])):i.createCommentVNode("",!0)]),_:1},8,["visible","title","onOk"]),i.createVNode(fi,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-c0f75bb9"]]),Ga=te(i.defineComponent({__name:"form",props:{editor:{type:Object,required:!1},widget:{type:Object,required:!1},form:{type:Object,required:!1}},setup(a,{expose:e}){const t=a,n=i.ref(!1),l=i.ref(),o=i.ref({}),s=i.ref(null);i.onMounted(()=>{if(c.value.dsn){const w=r.value.dataManager();c.value.primary&&w.psn(c.value.dsn),s.value.setDisabled=x,s.value.getValue=p,s.value.setValue=m,s.value.reset=b,l.value=w.useForm(c.value.dsn,s.value,V=>{o.value=V.body||{}})}t.editor||r.value.loadConfig({widgets:h.value}),t.form?.model&&r.value.setModel(t.form.model),y()});const r=i.computed(()=>t.editor||new ut),c=i.computed(()=>t.widget||t.form||{}),h=i.computed(()=>{let w=c.value.widgets||[];return!w.length&&t.form?.fields&&(w=t.form.fields),w.forEach(V=>{V.widget||(V.widget="unione-form-item"),V.control||(V.control="a-input")}),w}),f=i.inject("pageSetting",{}),d=i.computed(()=>c.value.setting||f?.form||{});i.provide("formSetting",d.value);function p(){return o.value}function m(w){o.value=w,y()}function b(){o.value={},y()}function y(){const w=V=>{V.widget=="unione-form-item"&&V.name&&(V.value!=null&&V.value!=null&&V.value!=""||V.value==0)&&(o.value[V.name]==null||o.value[V.name]==null||o.value[V.name]=="")&&(o.value[V.name]=V.value),V.widgets?.forEach(k=>{w(k)})};h.value.forEach(V=>{w(V)})}function A(){return s.value.validate()}function x(w=!0){n.value=w}return e({validate:A,getValue:p,setValue:m,reset:b,setDisabled:x}),(w,V)=>{const k=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(lt,{class:"unione-form-widget","setting-title":"表单设置",model:r.value.model.value},i.createSlots({default:i.withCtx(()=>[i.createVNode(k,{ref_key:"formObj",ref:s,model:o.value,class:i.normalizeClass(["unione-form",r.value.model.value,"form-layout-col-"+(d.value.showColumn||3)])},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(u,N)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(u.widget),{key:N,widget:u,editor:r.value,value:o.value[u.name],"onUpdate:value":M=>o.value[u.name]=M,disabled:n.value,formValue:o.value},null,40,["widget","editor","value","onUpdate:value","disabled","formValue"]))),128))]),_:1},8,["model","class"])]),_:2},[a.editor&&c.value.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(Ka,{wid:c.value.wid,editor:a.editor},null,8,["wid","editor"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-cecc4588"]]);function Cl(a,e=!1){const t=Fe();if(!a)return Promise.reject("字典名称不能为空");const n=localStorage.getItem("UNIONE-DICT-"+a);return n&&e==!1?Promise.resolve(JSON.parse(n)):(t.isDebug&&console.log("进入:加载字典数据方法,dict name:"+a+",force:"+e),new Promise((l,o)=>{Y.axios.admin({url:"/api/base/dict/load/"+a}).then(s=>{if(s.success){const r=s.body.filter(c=>c.dictName!=c.dictKey);r.forEach(c=>{c.value=c.dictKey,c.label=c.dictValue}),r.length?(localStorage.setItem("UNIONE-DICT-"+a,JSON.stringify(r)),l(r)):o("字典加载失败,dict:"+a+",字典项列表为空")}else t.isDebug&&console.error("字典加载失败,dict:"+a,s),o("字典加载失败,dict:"+a+",error:"+s.message)})}))}async function vl(a,e){const t=Fe();if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("字典key为空");const n=await Cl(a),l=n.filter(o=>o.dictKey==e);return l.length>0?Promise.resolve(l[0]):(t.isDebug&&console.log("字典项匹配失败,name:"+a+",key:"+e+"options:",n),Promise.reject("字典项匹配失败,name:"+a+",key:"+e))}async function Ja(a,e){const t=await vl(a,e);return Promise.resolve(t.dictValue)}const Sl={load:Cl,getLabel:Ja,getOption:vl};class Ge{convertObj;config;options;constructor(e){(!e||!e.types)&&console.error("转换器定义不能为空,type不能为空",e),e.valueField||(e.valueField="id"),e.labelField||(e.labelField="title"),this.convertObj=e,this.options=e.options||[],this.config=Fe()}load(e,t=!1){return!(e==null||e==null||e=="undefined"||!(e+"").length)&&this.options?.length&&this.options.filter(n=>n.value==e).length?Promise.resolve(this.options):this.convertObj.types=="dict"?new Promise((n,l)=>{if(!this.convertObj.dictName){l("字典名称不能为空,id:"+this.convertObj.id);return}Sl.load(this.convertObj.dictName,t).then(o=>{this.options=o,typeof e=="number"&&this.options.forEach(s=>{s.value=parseInt(s.value)}),n(this.options)})}):this.convertObj.types=="option"?(this.options=this.convertObj.options||[],this.convertObj.options?.length?Promise.resolve(this.convertObj.options):(this.config.isDebug&&console.error("静态转换器选项为空,id:"+this.convertObj.id,this.convertObj),Promise.reject("静态转换器选项为空,id:"+this.convertObj.id))):!this.convertObj.id&&this.convertObj.types!="local"?Promise.reject("转换器id不能为空,type:"+this.convertObj.types):new Promise((n,l)=>{const o={body:this.convertObj.params||{}};this.convertObj.pidField&&(o.pid=-1);const s=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:s,data:o,method:"POST"}).then(r=>{r.success?(this.options=r.body,this.$processOptions(this.options),typeof e=="number"&&this.options.forEach(c=>{c.value=parseInt(c.value)}),e==null||e==null||e=="undefined"||!(e+"").length?this.options.length?n(this.options):(this.config.isDebug&&console.error("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)):this.options.filter(h=>h.value==e).length?n(this.options):(o.body||(o.body={}),o.body[this.convertObj.valueField||"id"]=e,Y.axios.admin({url:s,data:o,method:"POST"}).then(h=>{if(h.success){const f={};this.options.forEach(d=>{f[e]=!0}),h.body.forEach(d=>{f[d.value]||this.options.push(d)}),n(this.options)}else l("数据选项为空,type:"+this.convertObj.types+",id:"+this.convertObj.id)}))):(this.config.isDebug&&console.error("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id,r),l("数据选项加载失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",error:"+r.message))})})}convert(e){if(e==null||e==null||e=="undefined"||!(e+"").length)return Promise.reject("value为空");if(this.convertObj.types=="dict")return this.convertObj.dictName?Sl.getLabel(this.convertObj.dictName,e):Promise.reject("字典名称不能为空");if(this.convertObj.types=="option"){if(this.convertObj.options?.length){const t=this.convertObj.options.filter(n=>n.value==e);return t.length?Promise.resolve(t[0].label):(this.config.isDebug&&console.error("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e,this.convertObj),Promise.reject("静态转换器选项匹配失败,id:"+this.convertObj.id+",value:"+e))}return Promise.reject("静态转换器选项为空,id:"+this.convertObj.id)}if(this.options?.length){const t=this.options.filter(n=>n.value==e);if(t.length)return Promise.resolve(t[0].label)}return new Promise((t,n)=>{this.load(e).then(l=>{const o=l.filter(s=>s.value==e);if(o.length)return t(o[0].label);n()})})}children(e=-1){return this.config.isDebug&&console.log("进入:加载下级数据项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",pid:"+e),this.convertObj.pidField?this.convertObj.types=="dict"||this.convertObj.types=="option"?Promise.reject("字典/静态转换器不支持该方法,type:"+this.convertObj.types+",id:"+this.convertObj.id):new Promise((n,l)=>{const o=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:o,data:e,method:"POST"}).then(s=>{s.success?(this.$processOptions(s.body),this.options=[...this.options,...s.body],n(s.body)):(this.config.isDebug&&console.error("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e,s),l("加载下级数据项失败,type:"+this.convertObj.types+",id:"+this.convertObj.id+",pid:"+e+",error:"+s.message))})}):Promise.reject("转换器未设置parentField,id:"+this.convertObj.id)}search(e){if(this.config.isDebug&&console.log("进入:搜索数据选项方法,id:"+this.convertObj.id+",type:"+this.convertObj.types+",keywords:"+e),this.convertObj.types=="dict"||this.convertObj.types=="option")return Promise.resolve(this.options.filter(n=>n.label.indexOf(e)>=0));const t={...this.convertObj.params||{}};return new Promise(n=>{const l=this.convertObj.types=="local"?this.convertObj.url:"/api/data/convertor/"+this.convertObj.id;Y.axios.admin({url:l,data:{body:{...t,keywords:e}},method:"POST"}).then(o=>{o.success?(this.$processOptions(o.body),n(o.body)):n([])})})}$processOptions(e){return this.convertObj.types=="local"&&e.forEach(t=>{this.convertObj.idField&&(t.id=t[this.convertObj.idField]),this.convertObj.pidField&&(t.pid=t[this.convertObj.pidField]),t.value=t[this.convertObj.valueField||"id"],t.label=t[this.convertObj.labelField||"title"]}),e}}function pt(a,e=350){let t=null;return n=>{clearTimeout(t),t=setTimeout(()=>{a(n)},e)}}const Xa=["innerHTML"],Za={key:2,class:"text-view"},er=te(i.defineComponent({__name:"formItem",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object,required:!0},disabled:{type:Boolean,defualt:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.computed(()=>o.value.showFormat?o.value.showFormat.call(this,t.value,{label:A.value,form:e.formValue}):A.value||t.value),l=i.inject("formSetting");i.onMounted(()=>{s.value.value!=null&&typeof s.value.value<"u"&&(e.formValue[s.value.name]==null||e.formValue[s.value.name]==null||typeof e.formValue[s.value.name]>"u")&&(t.value=s.value.value,s.value.widget=="unione-check-box"&&(Array.isArray(s.value.value)||(typeof s.value.value=="string"?t.value=s.value.value.split(","):t.value=[s.value.value])))});const o=i.ref({}),s=i.computed(()=>{const x=e.editor?.widget(e.wid)||e.widget||{};return x.event&&Object.keys(x.event).forEach(w=>{const V=x.event[w];V&&(o.value[w]=null,typeof V=="function"?o.value[w]=V:V.enable&&V.scriptText&&(o.value[w]=new Function("value","ctx",V.scriptText)))}),x}),r=i.computed(()=>!(o.value.visible&&o.value.visible(e.formValue[s.value.name],e.formValue)==!1)),c=i.computed(()=>o.value.title&&o.value.title(e.formValue[s.value.name],e.formValue)||s.value.title),h=pt(()=>{if(o.value.change)return o.value.change(e.formValue[s.value.name],e.formValue)||s.value.change;s.value.change&&s.value.change(e.formValue[s.value.name],e.formValue)}),f=i.ref({}),d=i.computed(()=>{const x=[],w=s.value.rule||{};let V=s.value.props?.required||s.value.required;if(o.value.required&&(V=o.value.required(e.formValue[s.value.name],e.formValue)),V&&x.push({required:!0,whitespace:w?.whitespace||!1,trigger:w?.trigger||l.ruleTrigger||"change",validator:(k,u)=>(w?.whitespace&&u&&typeof u=="string"&&(u=u.trim()),u!=null&&u!=null&&(u+"").replace(/\s+/g,"").length>0?Promise.resolve():Promise.reject(c.value+"不能为空!"))}),w.advance&&f.value[w.advance]){const k=f.value[w.advance];x.push({pattern:k.pattern,message:k.message||"表单验证不通过!",trigger:w.trigger||l.ruleTrigger||"change"})}return w.regExpress&&x.push({pattern:w.regExpress,message:w.regMessage||"表单验证不通过!",trigger:w.trigger||l.ruleTrigger||"change"}),s.value.dataLen&&x.push({validator:(k,u)=>u&&(u+"").length>s.value.dataLen?Promise.reject("最大长度["+s.value.dataLen+"],当前:["+(u+"").length+"]"):Promise.resolve(),trigger:w?.trigger||l.ruleTrigger||"change"}),x}),p=i.computed(()=>{const x=s.value.props||{};if(s.value.control=="a-input-number"){const w=s.value.rule||{};w.rangeMin!=null&&w.rangeMin!=null&&(x.min=w.rangeMin),w.rangeMax!=null&&w.rangeMax!=null&&(x.max=w.rangeMax)}return s.value.control=="a-date-picker"&&s.value.view?.dataFormat&&(x.format=s.value.view.dataFormat,x.valueFormat=s.value.view.dataFormat),s.value.required&&(x.required=s.value.required),x}),m=i.computed(()=>{const x=s.value.css||{},w=["form-item-"+s.value.name];return x.cssName&&w.push(x.cssName),l.platform=="app"?x.cssName?typeof x.cssName=="string"&&x.cssName.indexOf("all-line")<0&&w.push("all-line"):w.push("all-line"):s.value.view?.width&&(s.value.view.width>=3?(!x.cssName||typeof x.cssName=="string"&&x.cssName.indexOf("all-line")<0)&&w.push("all-line"):s.value.view.width==2&&w.push("2in-line")),w}),b=i.computed(()=>{const x=l.showColumn||3;let w=s.value.view?.labelWidth||l.labelWidth||9;return s.value.css?.cssName&&x>1&&typeof s.value.css.cssName=="string"&&s.value.css.cssName.indexOf("all-line")>=0?{span:Math.round(w/x)}:s.value.view?.width>=3&&x>1?{span:Math.round(w/x)}:{span:w}}),y=i.computed(()=>{const x=l.showColumn||3;let w=s.value.view?.valueWidth||l.valueWidth||19;return s.value.css?.cssName&&x>1&&m.value.includes("all-line")?{}:{span:w}}),A=i.ref();return i.watch(t,()=>{t.value&&e.editor?.model.value=="view"&&s.value.convert&&new Ge(s.value.convert).convert(t.value.toString()).then(x=>{A.value=x})}),(x,w)=>{const V=i.resolveComponent("a-form-item");return i.openBlock(),i.createBlock(lt,{class:i.normalizeClass(["unione-form-item",m.value]),style:i.normalizeStyle(s.value.css?.cssText)},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createBlock(V,{key:0,label:c.value,name:s.value.name,labelCol:b.value,wrapperCol:y.value,required:s.value.props?.required,rules:d.value,help:(!e.editor||e.editor.model.value!="view")&&s.value.props?.help,tooltip:s.value.props?.tooltip},{default:i.withCtx(()=>[!e.editor||s.value.view=="self"||e.editor.model.value!="view"&&s.value.view!="html"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.value.control||"a-input"),i.mergeProps({key:0,wid:s.value.wid,widget:s.value,editor:e.editor,disabled:a.disabled,onChange:i.unref(h),value:t.value,"onUpdate:value":w[0]||(w[0]=k=>t.value=k),formValue:a.formValue},p.value,{style:s.value.css?.props}),null,16,["wid","widget","editor","disabled","onChange","value","formValue","style"])):s.value.view=="html"?(i.openBlock(),i.createElementBlock("div",{key:1,class:"text-view text-html",innerHTML:n.value},null,8,Xa)):(i.openBlock(),i.createElementBlock("div",Za,i.toDisplayString(n.value),1))]),_:1},8,["label","name","labelCol","wrapperCol","required","rules","help","tooltip"])):i.createCommentVNode("",!0)]),_:1},8,["class","style"])}}}),[["__scopeId","data-v-20adb860"]]),tr=te(i.defineComponent({__name:"selectBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){Fe();const e=a,t=i.useModel(a,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]),o=i.computed(()=>{const m=d.value.convert||e.convert||{};if(m.refValue){const b={};return m.refValue.split(",").forEach(A=>{const x=A.split("=");x.length==1?b[x[0]]=Y.utils.obj.getValue(e.formValue,x[0]):b[x[0]]=Y.utils.obj.getValue(e.formValue,x[1])}),b}return{}}),s=i.computed(()=>(d.value.convert||e.convert||{}).search||!1),r=pt(m=>{const b=d.value.convert||e.convert||{};b.params={...h.value,...o.value},p.value.search(m).then(y=>{n.value=y})},500);function c(m,b){f.value.select&&f.value.select(m,{option:b,formValue:e.formValue})}const h=i.ref();i.onMounted(()=>{const m=d.value.convert||e.convert||{};h.value=m.params||{},m.params={...h.value,...o.value},p.value.load(t.value).then(b=>{n.value=b})});const f=i.ref({}),d=i.computed(()=>{const m=e.editor?.widget(e.wid)||e.widget||{};return m.event&&Object.keys(m.event).forEach(b=>{const y=m.event[b];y&&(f.value[b]=null,typeof y=="function"?f.value[b]=y:y.enable&&y.scriptText&&(f.value[b]=new Function("value","ctx",y.scriptText)))}),m}),p=i.computed(()=>{const m=d.value.convert||e.convert||{};return new Ge(m)});return i.watch(t,pt(()=>{t.value&&p.value.load(t.value).then(m=>{n.value=m})},200)),i.watch(()=>d.value.convert||e.convert||{},pt(()=>{p.value.load().then(m=>{n.value=m})})),i.watch(()=>o.value,pt(()=>{if(console.log(d.value.name+" ref value changed",o.value),o.value){const m=d.value.convert||e.convert||{};m.params={...h.value,...o.value},p.value.load(t.value,!0).then(b=>{n.value=b})}},200),{deep:!0}),(m,b)=>{const y=i.resolveComponent("a-select");return i.openBlock(),i.createBlock(y,{class:"unione-form-select",options:l.value,showSearch:s.value,value:t.value,"onUpdate:value":b[0]||(b[0]=A=>t.value=A),onSearch:i.unref(r),onSelect:c},null,8,["options","showSearch","value","onSearch"])}}}),[["__scopeId","data-v-70aaf6fe"]]),ir=te(i.defineComponent({__name:"switchBox",props:i.mergeModels({editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.ref({});i.onMounted(()=>{s.value?.load(t.value).then(r=>{r.forEach(c=>{c.value&&(c.value=="1"||c.value=="true"||c.value=="TRUE")?(n.value.checkedChildren=c.label,c.value=="true"||c.value=="TRUE"?n.value.checkedValue=!0:n.value.checkedValue=1):(n.value.unCheckedChildren=c.label,c.value=="false"||c.value=="FALSE"?n.value.unCheckedValue=!1:n.value.unCheckedValue=0)})})});const l=i.ref({}),o=i.computed(()=>{const r=e.widget||{};return r.event&&Object.keys(r.event).forEach(c=>{const h=r.event[c];h&&(l.value[c]=null,typeof h=="function"?l.value[c]=h:h.enable&&h.scriptText&&(l.value[c]=new Function("value","ctx",h.scriptText)))}),r}),s=i.computed(()=>{const r=o.value.convert||e.convert;return r?new Ge(r):null});return(r,c)=>{const h=i.resolveComponent("a-switch");return i.openBlock(),i.createBlock(h,i.mergeProps({class:"unione-form-switch"},n.value,{checked:t.value,"onUpdate:checked":c[0]||(c[0]=f=>t.value=f)}),null,16,["checked"])}}}),[["__scopeId","data-v-32bff921"]]),nr=te(i.defineComponent({__name:"radioBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value"),n=i.ref([]),l=i.computed(()=>n.value?.length?n.value:e.options?.length?e.options:[]),o=i.computed(()=>{const f=c.value.convert||e.convert||{};if(f.refValue){const d={};return f.refValue.split(",").forEach(m=>{const b=m.split("=");b.length==1?d[b[0]]=Y.utils.obj.getValue(e.formValue,b[0]):d[b[0]]=Y.utils.obj.getValue(e.formValue,b[1])}),console.log(c.value.name+" ref field:"+f.refValue+",ref value",d),d}return{}}),s=i.ref();i.onMounted(()=>{const f=c.value.convert||e.convert||{};s.value=f.params||{},f.params={...s.value,...o.value},h.value.load(t.value||c.value.value).then(d=>{n.value=d})});const r=i.ref({}),c=i.computed(()=>{const f=e.editor?.widget(e.wid)||e.widget||{};return f.event&&Object.keys(f.event).forEach(d=>{const p=f.event[d];p&&(r.value[d]=null,typeof p=="function"?r.value[d]=p:p.enable&&p.scriptText&&(r.value[d]=new Function("value","ctx",p.scriptText)))}),f}),h=i.computed(()=>{const f=c.value.convert||e.convert||{};return new Ge(f)});return i.watch(()=>o.value,()=>{if(console.log(c.value.name+" ref value changed",o.value),o.value){const f=c.value.convert||e.convert||{};f.params={...s.value,...o.value},h.value.load(void 0,!0).then(d=>{n.value=d})}},{deep:!0}),(f,d)=>{const p=i.resolveComponent("a-radio-group");return i.openBlock(),i.createBlock(p,{class:"unione-form-radio",options:l.value,value:t.value,"onUpdate:value":d[0]||(d[0]=m=>t.value=m)},null,8,["options","value"])}}}),[["__scopeId","data-v-78969849"]]),lr=te(i.defineComponent({__name:"checkBox",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},returnType:{type:String,default:"string"},widget:{type:Object,required:!1},convert:{type:Object,required:!1},options:{type:Array,required:!1},formValue:{type:Object}},{value:{},valueModifiers:{}}),emits:i.mergeModels(["change"],["update:value"]),setup(a,{emit:e}){const t=a,n=i.useModel(a,"value"),l=i.ref(),o=i.ref([]),s=i.computed(()=>o.value?.length?o.value:t.options?.length?t.options:[]),r=i.computed(()=>{const b=f.value.convert||t.convert||{};if(b.refValue){const y={};return b.refValue.split(",").forEach(x=>{const w=x.split("=");w.length==1?y[w[0]]=Y.utils.obj.getValue(t.formValue,w[0]):y[w[0]]=Y.utils.obj.getValue(t.formValue,w[1])}),console.log(f.value.name+" ref field:"+b.refValue+",ref value",y),y}return{}}),c=i.ref();i.onMounted(()=>{const b=n.value||f.value.value;t.returnType==="string"?l.value=b.split(","):l.value=b;const y=f.value.convert||t.convert||{};c.value=y.params||{},y.params={...c.value,...r.value},m.value.load().then(A=>{o.value=A})});const h=i.ref({}),f=i.computed(()=>{const b=t.editor?.widget(t.wid)||t.widget||{};return b.event&&Object.keys(b.event).forEach(y=>{const A=b.event[y];h.value[y]=null,A.enable&&A.scriptText&&(h.value[y]=new Function("value","ctx",A.scriptText))}),b}),d=e;function p(b){t.returnType==="string"?n.value=b.join(","):n.value=b,console.log("checkbox changed",n.value),d("change",n.value)}const m=i.computed(()=>{const b=f.value.convert||t.convert||{};return new Ge(b)});return i.watch(()=>n.value,()=>{l.value=Array.isArray(n.value)?n.value:[],n.value&&!Array.isArray(n.value)&&(l.value=n.value.split(","))}),i.watch(()=>r.value,()=>{if(console.log(f.value.name+" ref value changed",r.value),r.value){l.value=[],t.returnType==="string"?n.value="":n.value=[];const b=f.value.convert||t.convert||{};b.params={...c.value,...r.value},m.value.load(void 0,!0).then(y=>{o.value=y})}},{deep:!0}),(b,y)=>{const A=i.resolveComponent("a-checkbox-group");return i.openBlock(),i.createBlock(A,{class:"unione-form-checkbox",options:s.value,value:l.value,"onUpdate:value":y[0]||(y[0]=x=>l.value=x),onChange:p},null,8,["options","value"])}}}),[["__scopeId","data-v-1aa92231"]]),or=te(i.defineComponent({__name:"pwdBox",props:{value:{},valueModifiers:{}},emits:["update:value"],setup(a){const e=i.ref(),t=i.useModel(a,"value");return i.watch(()=>e.value,()=>{e.value?t.value=Y.utils.sm2Encrypt(e.value):t.value=""}),(n,l)=>{const o=i.resolveComponent("a-input-password");return i.openBlock(),i.createBlock(o,{class:"unione-form-password",value:e.value,"onUpdate:value":l[0]||(l[0]=s=>e.value=s)},null,8,["value"])}}}),[["__scopeId","data-v-4515a2af"]]);function sn(a){const e=a.toLowerCase().split("_"),t=[];t.push(e[0]);for(let n=1;n<e.length;n++){const l=e[n];l&&(t.push(l.charAt(0).toUpperCase()),l.length>1&&t.push(l.substring(1)))}return t.join("")}const Bl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Nl(a=10){const e=Date.now().toString(),t=new Uint32Array(a);crypto.getRandomValues(t);let n="";for(let l=0;l<a;l++){const o=(parseInt(e[l%e.length],10)+t[l])%Bl.length;n+=Bl[o]}return n}const sr={toHump:sn,randomStr:Nl},ar=te(i.defineComponent({__name:"randomInput",props:i.mergeModels({wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},formValue:{type:Object},len:{type:Number,default:10}},{value:{},valueModifiers:{}}),emits:["update:value"],setup(a){const e=a,t=i.useModel(a,"value");function n(){t.value=Nl(e.len)}return(l,o)=>{const s=i.resolveComponent("SyncOutlined"),r=i.resolveComponent("a-input");return i.openBlock(),i.createBlock(r,{class:"unione-form-random-input",value:t.value,"onUpdate:value":o[0]||(o[0]=c=>t.value=c)},{suffix:i.withCtx(()=>[i.createVNode(s,{style:{color:"rgba(0, 0, 0, 0.45)"},onClick:n})]),_:1},8,["value"])}}}),[["__scopeId","data-v-8e6d89b8"]]),rr={class:"unione-props-setting unione-query-setting"},cr={class:"unione-query-opts"},dr={key:0},hr=["onClick"],fr={key:1},ur={key:1,class:"edit-field"},pr=["onClick"],mr=te(i.defineComponent({__name:"querySetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:V})=>V+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"查询",dataIndex:"isQuery",key:"isQuery",width:"30px",align:"center"},{title:"查询类型",dataIndex:"queryType",key:"queryType",width:"55px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"}]),n=i.computed(()=>{const V=e.editor.widget(e.wid)||{};return V.configs||(V.configs={}),V.configs.btns||(V.configs.btns=[]),V}),l=i.computed(()=>(e.editor.dataModels()||[]).map(k=>({value:k.sn,label:k.title+"("+k.name+")"}))),o=i.computed(()=>{const V=[],k=[];return n.value.configs.btns||(n.value.configs.btns=[]),n.value.configs.btns.forEach(u=>{V.push(u),k.push(u.name)}),k.includes("query")||V.splice(0,0,{visible:!0,name:"query",title:"搜索",type:"primary"}),k.includes("reset")||V.splice(1,0,{visible:!0,name:"reset",title:"重置",type:"default"}),k.includes("reset")||V.splice(1,0,{visible:!0,name:"advanced",title:"高级搜索",type:"default"}),V.sort((u,N)=>{const M=u.index||1,v=N.index||1;return M-v}),V}),s=i.ref(null);function r(V){s.value&&s.value.open(V,k=>{k.visible=!0,Object.keys(k).forEach(u=>{V[u]=k[u]}),n.value.configs.btns.sort((u,N)=>{const M=u.index||1,v=N.index||1;return M-v}),n.value.configs.btns=[...n.value.configs.btns]})}function c(){const V=n.value.configs.btns.length+1;let k={title:"新增",name:"new_"+V,size:"default",index:V,visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.btns.push(k),e.editor.widget(e.wid,n.value),s.value.open(k,u=>{Object.keys(u).forEach(N=>{k[N]=u[N]}),n.value.configs.btns=[...n.value.configs.btns]})}function h(V){const k=()=>{if(["query","reset","advanced"].includes(V.name))V.visible=!1,n.value.configs.btns=[...n.value.configs.btns];else{const u=[];n.value.configs.btns.forEach(N=>{N.name!=V.name&&u.push(N)}),n.value.configs.btns=u}};X.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{k()}})}const f=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),d=i.computed(()=>f.value.fields?.length?f.value.fields:[]),p={mounted:V=>V.focus()},m=i.ref({});function b(){const V=Object.keys(m.value);if(V.length)for(let k in V){const u=d.value.filter(N=>N.name==k);if(u&&u[0]){let N=m.value[k];Object.keys(N).forEach(M=>{if(M=="showIndex"){const v=u[0].show?.query||{};u[0].show||(u[0].show={}),u[0].show.query={...v,index:N[M]}}else u[0][M]=N[M]})}}m.value={}}function y(V,k){b();const u={};u[k]=V[k]||"",k=="showIndex"&&(u[k]=V.show?.query?.index),m.value[V.name]=u}function A(V,k){if(!V||!k){m.value={};return}const u=m.value[V.name][k];if(k=="showIndex"){const N=V.show?.query||{};V.show||(V.show={}),V.show.query={...N,index:u}}else V[k]=u;m.value={}}function x(V,k){d.value.filter(N=>N.name==V.name).forEach(N=>{N[k]=!N[k]})}const w=i.ref({options:[{value:"keywords",label:"关键字"},{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:V=>{const k=w.value.options.filter(u=>u.value==V);return k[0]?k[0].label:V}});return(V,k)=>{const u=i.resolveComponent("a-divider"),N=i.resolveComponent("CloseOutlined"),M=i.resolveComponent("a-button"),v=i.resolveComponent("PlusOutlined"),C=i.resolveComponent("a-select"),B=i.resolveComponent("ToolOutlined"),R=i.resolveComponent("a-checkbox"),g=i.resolveComponent("a-input-number"),S=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",rr,[i.createVNode(u,{orientation:"left"},{default:i.withCtx(()=>k[3]||(k[3]=[i.createTextVNode("查询按钮")])),_:1}),i.createElementVNode("div",cr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,T=>(i.openBlock(),i.createBlock(M,i.mergeProps({key:T.name,class:["btn",T.name,!T.visible&&"deleted"],type:T.visible?T.type:"default",size:T.size||"default",ref_for:!0},T.props||{},{onClick:O=>r(T)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(T.title)+" ",1),T.visible?(i.openBlock(),i.createBlock(N,{key:0,class:"btn-del",onClick:i.withModifiers(O=>h(T),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[T.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(T.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(M,{class:i.normalizeClass(["btn","btn-add"]),onClick:k[0]||(k[0]=T=>c()),size:"small"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1})]),i.createVNode(u,{orientation:"left"},{default:i.withCtx(()=>k[4]||(k[4]=[i.createTextVNode("查询字段")])),_:1}),k[5]||(k[5]=i.createTextVNode(" 数据模型:")),i.createVNode(C,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":k[1]||(k[1]=T=>n.value.dataModel=T)},null,8,["options","value"]),i.createVNode(S,{columns:t.value,"data-source":d.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:T})=>[["showIndex","queryType"].includes(T.key)?(i.openBlock(),i.createElementBlock("span",dr,[i.createVNode(B),i.createTextVNode(" "+i.toDisplayString(T.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:T,text:O,record:F})=>[["queryType"].includes(T.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!m.value[F.name]||!Object.keys(m.value[F.name]).includes(T.dataIndex))&&!O&&"empty"]),onClick:$=>y(F,T.dataIndex)},[m.value[F.name]&&Object.keys(m.value[F.name]).includes(T.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(C,{key:0,value:F[T.dataIndex],"onUpdate:value":$=>F[T.dataIndex]=$,allowClear:!0,options:w.value.options,onBlur:k[2]||(k[2]=$=>A())},null,8,["value","onUpdate:value","options"])),[[p]]):(i.openBlock(),i.createElementBlock("span",fr,i.toDisplayString(w.value.showLabel(O)),1))],10,hr)):["isQuery"].includes(T.dataIndex)?(i.openBlock(),i.createElementBlock("div",ur,[i.createVNode(R,{checked:F[T.dataIndex],onClick:$=>x(F,T.dataIndex)},null,8,["checked","onClick"])])):T.dataIndex=="showIndex"?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!m.value[F.name]||!Object.keys(m.value[F.name]).includes(T.dataIndex))&&!O&&"empty"]),onClick:$=>y(F,T.dataIndex)},[m.value[F.name]&&Object.keys(m.value[F.name]).includes(T.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(g,{key:0,value:m.value[F.name][T.dataIndex],"onUpdate:value":$=>m.value[F.name][T.dataIndex]=$,onBlur:$=>A(F,T.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[p]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(F.show?.query?.index||" "),1)],64))],10,pr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(fi,{ref_key:"btnSetting",ref:s},null,512)])}}}),[["__scopeId","data-v-ce575063"]]),gr={class:"query-btn"},kr={class:"btn-advanced-overlay"},Vl=te(i.defineComponent({__name:"queryForm",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},fields:{type:Array},params:{type:Object,default(){return{}}}},emits:["query","reset","btnClick"],setup(a,{emit:e}){const t=a,n=i.computed(()=>{const A=t.editor?.widget(t.wid)||t.widget||{};return A.btns||(A.btns=[]),A}),l=i.computed(()=>({visible:!0,name:"keywords",title:"关键字",placeholder:"请输入搜索内容",...n.value.keywords||{}})),o=i.computed(()=>{let A=[];return n.value.fields?.length&&(A=n.value.fields),A.length==0&&t.fields?.length&&(A=t.fields),A.sort((x,w)=>{const V=x.show?.query?.index||1,k=w.show?.query?.index||1;return V-k}),A.forEach(x=>{!x.widget&&!x.control&&x.convert&&(x.widget="unione-select-box"),x.widget=x.widget||x.control||"a-input",x.defaultValue!=null&&x.defaultValue!="undefined"&&typeof x.defaultValue<"u"&&(f.value[x.name]=x.defaultValue,x.value=x.defaultValue)}),A}),s=i.computed(()=>n.value.labelWidth||7),r=i.computed(()=>{const A=n.value.btns.filter(x=>x.name=="advanced")[0]||{};return A.event?.clickScript&&(A.event.click=new Function("ctx","btn","event",A.event.clickScript)),A.event?.disableScript&&(A.event.disable=new Function("ctx","btn",A.event.disableScript)),A.event?.visibleScript&&(A.event.visible=new Function("ctx","btn",A.event.visibleScript)),{visible:!0,name:"advanced",title:"高级搜索",...A}}),c=["query","reset","advanced"],h=i.computed(()=>{const A=n.value.btns.filter(w=>w.name!="advanced"),x=[];return A.forEach(w=>{w.size||(w.size="default"),x.push(w.name)}),x.includes("query")||A.splice(0,0,{visible:!0,name:"query",title:"查询",size:"default",type:"primary"}),x.includes("reset")||A.splice(1,0,{visible:!0,name:"reset",title:"重置",size:"default",type:"default"}),A.sort((w,V)=>{const k=w.index||1,u=V.index||1;return k-u}),A}),f=i.ref({}),d=i.computed(()=>{const A={};return n.value.params?Object.keys(n.value.params).forEach(x=>{A[x]=n.value.params[x]}):t.params&&Object.keys(t.params).forEach(x=>{A[x]=t.params[x]}),A});i.onMounted(()=>{t.editor?.ebus.$on("query-form-params",A=>{n.value.params=A}),b()});const p=e;function m({btn:A,event:x}){console.log("unione query form btn click",A,x),A.name=="query"&&b(),A.name=="reset"&&y(),p("btnClick",{btn:A,event:x})}function b(){const A=[];o.value.forEach(w=>{w.visible&&A.push(w.name)});const x={params:{...d.value},keywords:""};Object.keys(f.value).forEach(w=>{A.includes(w)&&(x.params[w]=f.value[w])}),l.value.visible&&f.value[l.value.name]&&(x.keywords=f.value[l.value.name]),p("query",x),t.editor?.ebus.$emit("table-list-search",x)}function y(){f.value={},o.value.forEach(x=>{x.visible=!1});const A={params:{...d.value},keywords:""};p("reset",A),t.editor?.ebus.$emit("table-list-reset",A)}return(A,x)=>{const w=i.resolveComponent("a-input"),V=i.resolveComponent("a-form-item"),k=i.resolveComponent("unione-btn"),u=i.resolveComponent("a-checkbox"),N=i.resolveComponent("DownOutlined"),M=i.resolveComponent("a-button"),v=i.resolveComponent("a-dropdown"),C=i.resolveComponent("a-form");return i.openBlock(),i.createBlock(lt,{class:"unione-query-form",model:t.editor?.model.value,"setting-title":"查询设置"},i.createSlots({default:i.withCtx(()=>[i.createVNode(C,{model:f.value,layout:"horizontal","label-col":{span:s.value}},{default:i.withCtx(()=>[l.value.visible?(i.openBlock(),i.createBlock(V,{key:0,label:l.value.title,class:"query-field keywords",name:l.value.name,style:i.normalizeStyle({width:s.value})},{default:i.withCtx(()=>[i.createVNode(w,{placeholder:l.value.placeholder,value:f.value[l.value.name],"onUpdate:value":x[0]||(x[0]=B=>f.value[l.value.name]=B),allowClear:"",onKeyup:i.withKeys(b,["enter"])},null,8,["placeholder","value"])]),_:1},8,["label","name","style"])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,B=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:B.name},[B.visible?(i.openBlock(),i.createBlock(V,{key:0,label:B.title,class:i.normalizeClass(["query-field",B.name]),style:i.normalizeStyle({width:s.value}),name:B.name},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(B.widget),i.mergeProps({placeholder:B.placeholder,value:f.value[B.name],"onUpdate:value":R=>f.value[B.name]=R,ref_for:!0},B.props||{},{allowClear:"",widget:B}),null,16,["placeholder","value","onUpdate:value","widget"]))]),_:2},1032,["label","class","style","name"])):i.createCommentVNode("",!0)],64))),128)),i.createElementVNode("div",gr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,B=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:B.name},[B.visible!=!1?(i.openBlock(),i.createBlock(k,{key:0,widget:B,editor:a.editor,onClick:m,preset:c},null,8,["widget","editor"])):i.createCommentVNode("",!0)],64))),128)),r.value.visible&&o.value.length?(i.openBlock(),i.createBlock(v,{key:0,class:"btn btn-advanced",trigger:[r.value.trigger||"hover"]},{overlay:i.withCtx(()=>[i.createElementVNode("div",kr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,B=>(i.openBlock(),i.createBlock(u,{key:B.name,class:"item",checked:B.visible,onClick:R=>B.visible=!B.visible},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(B.title),1)]),_:2},1032,["checked","onClick"]))),128))])]),default:i.withCtx(()=>[i.createVNode(M,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(r.value.title)+" ",1),i.createVNode(N)]),_:1})]),_:1},8,["trigger"])):i.createCommentVNode("",!0)])]),_:1},8,["model","label-col"])]),_:2},[t.editor&&t.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(mr,{editor:t.editor,wid:t.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-05f95e36"]]),br={class:"unione-props-setting unione-table-setting"},yr={class:"unione-table-tools"},wr={key:1,class:"unione-table-opts"},Ar={key:0},xr=["onClick"],Cr={key:1,class:"edit-field"},vr=["onClick"],Sr={key:1},Br=te(i.defineComponent({__name:"tableSetting",props:{wid:{type:String,required:!0},editor:{type:Object,required:!0}},setup(a){const e=a,t=i.ref([{title:"序号",dataIndex:"index",key:"index",width:"30px",fixed:"left",align:"center",customRender:({index:v})=>v+1},{title:"字段名称",dataIndex:"name",key:"name",width:"70px",rowDrag:!0,resizable:!0,fixed:"left",align:"center"},{title:"字段标题",dataIndex:"title",key:"title",width:"90px",align:"center"},{title:"显示",dataIndex:"isList",key:"isList",width:"30px",align:"center"},{title:"排序",dataIndex:"isSort",key:"isSort",width:"30px",align:"center"},{title:"显示顺序",dataIndex:"showIndex",key:"showIndex",width:"55px",align:"center"},{title:"对齐方式",dataIndex:"align",key:"align",width:"55px",align:"center",options:[{value:"left",label:"居左"},{value:"center",label:"居中"},{value:"right",label:"居右"}],showLabel(v,C){let B=v.filter(R=>R.value==C);return B&&B[0]&&B[0].label||C}},{title:"固定位置",dataIndex:"fixed",key:"fixed",width:"55px",align:"center",options:[{value:"left",label:"靠左"},{value:"right",label:"靠右"}],showLabel(v,C){let B=v.filter(R=>R.value==C);return B&&B[0]&&B[0].label||C}},{title:"列宽",dataIndex:"showWidth",key:"showWidth",width:"50px",align:"center"}]),n=i.computed(()=>{const v=e.editor.widget(e.wid)||{};return v.configs||(v.configs={}),v.configs.leftBtns||(v.configs.leftBtns=[]),v.configs.rightBtns||(v.configs.rightBtns=[]),v.configs.operation||(v.configs.operation={}),v.configs.operation.btns||(v.configs.operation.btns=[]),v.configs.operation.more||(v.configs.operation.more={}),v}),l=i.computed(()=>(e.editor.dataModels()||[]).map(C=>({value:C.sn,label:C.title+"("+C.name+")"}))),o=i.computed(()=>{if(!n.value)return[];const v=[],C=n.value.configs.leftBtns;if(C.forEach(B=>{v.push(B.name)}),!v.includes("add")){const B={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};C.splice(0,0,B)}if(!v.includes("delBatch")){const B={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};C.splice(1,0,B)}return C}),s=i.computed(()=>{if(!n.value)return[];const v=[],C=n.value.configs.rightBtns;if(C.forEach(B=>{v.push(B.name)}),!v.includes("downData")){const B={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"导出",index:0,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downData"};C.splice(0,0,B)}if(!v.includes("impData")){const B={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};C.splice(1,0,B)}if(!v.includes("expData")){const B={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};C.splice(2,0,B)}if(!v.includes("downTmpl")){const B={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};C.splice(3,0,B)}return C});function r(v,C){v=="left"?f.value.open(C,B=>{B.visible=!0,Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.leftBtns.sort((R,g)=>{const S=R.index||1,T=g.index||1;return S-T}),n.value.configs.leftBtns=[...n.value.configs.leftBtns]}):f.value.open(C,B=>{B.visible=!0,Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.rightBtns.sort((R,g)=>{const S=R.index||1,T=g.index||1;return S-T}),n.value.configs.rightBtns=[...n.value.configs.rightBtns]})}function c(v){const C=v=="left"?n.value.configs.leftBtns.length:n.value.configs.rightBtns.length;let B={title:"新增"+C,name:"new_"+C,index:C,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{}};v=="left"?n.value.configs.leftBtns.push(B):n.value.configs.rightBtns.push(B),e.editor.widget(e.wid,n.value),r(v,B)}function h(v,C){const B=()=>{if(["add","delBatch","expData","impData","downTmpl"].includes(C.name))C.visible=!1,v=="left"?n.value.configs.leftBtns=[...n.value.configs.leftBtns]:n.value.configs.rightBtns=[...n.value.configs.rightBtns];else if(v=="left"){const R=[];n.value.configs.leftBtns.forEach(g=>{g.name!=C.name&&R.push(g)}),n.value.configs.leftBtns=R}else{const R=[];n.value.configs.rightBtns.forEach(g=>{g.name!=C.name&&R.push(g)}),n.value.configs.rightBtns=R}};X.Modal.confirm({title:"确认信息",content:"请确定删除该工具?",onOk:()=>{B()}})}const f=i.ref(null);function d(v){f.value.open(v,C=>{C.visible=!0,Object.keys(C).forEach(B=>{v[B]=C[B]}),n.value.configs.operation.btns.sort((B,R)=>{const g=B.index||1,S=R.index||1;return g-S}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function p(){const v=n.value.configs.operation.btns.length+1;let C={title:"新增"+v,name:"new_"+v,index:v,size:"small",visible:!0,type:"default",props:{block:!1,ghost:!1,danger:!1},event:{clickScript:"",titleScript:"",disableScript:"",visibleScript:""}};n.value.configs.operation.btns.push(C),e.editor.widget(e.wid,n.value),f.value.open(C,B=>{Object.keys(B).forEach(R=>{C[R]=B[R]}),n.value.configs.operation.btns=[...n.value.configs.operation.btns]})}function m(v){const C=()=>{if(["delete","view","edit"].includes(v.name))v.visible=!1,n.value.configs.operation.btns=[...n.value.configs.operation.btns];else{const B=[];n.value.configs.operation.btns.forEach(R=>{R.name!=v.name&&B.push(R)}),n.value.configs.operation.btns=B}};X.Modal.confirm({title:"确认信息",content:"请确定删除该操作?",onOk:()=>{C()}})}const b=i.computed(()=>e.editor?.dataModel(n.value.dataModel||"none")||{}),y=i.computed(()=>b.value.fields?.length?(b.value.fields.forEach(v=>{v.show||(v.show={}),v.show.list||(v.show.list={})}),b.value.fields):[]),A={mounted:v=>v.focus()},x=i.ref({});function w(){const v=Object.keys(x.value);if(v.length)for(let C in v){const B=y.value.filter(R=>R.name==C);if(B&&B[0]){let R=x.value[C];Object.keys(R).forEach(g=>{B[0].show||(B[0].show={}),B[0].show.list||(B[0].show.list={}),g=="showIndex"?B[0].show.list.index=R[g]:g=="showWidth"?B[0].show.list.width=R[g]:g=="fixed"?B[0].show.list.fixed=R[g]:g=="align"?B[0].show.list.align=R[g]:B[0][g]=R[g]})}}x.value={}}function V(v,C){w();const B={};C=="showIndex"?B[C]=v.show?.list?.index:C=="showWidth"?B[C]=v.show?.list?.width:C=="fixed"?B[C]=v.show?.list?.fixed:C=="align"?B[C]=v.show?.list?.align:B[C]=v[C]||"",x.value[v.name]=B}function k(v,C){if(!v||!C){x.value={};return}const B=x.value[v.name][C];v.show||(v.show={}),v.show.list||(v.show.list={}),C=="showIndex"?v.show.list.index=B:C=="showWidth"?v.show.list.width=B:C=="fixed"?v.show.list.fixed=B:C=="align"?v.show.list.align=B:v[C]=B,x.value={}}function u(v,C){return C=="showIndex"?v.show?.list?.index:C=="showWidth"?v.show?.list?.width:C=="fixed"?v.show?.list?.fixed:C=="align"?v.show?.list?.align:v[C]}function N(v,C){y.value.filter(R=>R.name==v.name).forEach(R=>{R[C]=!R[C]})}const M=i.ref({options:[{value:"equle",label:"精确"},{value:"like",label:"模糊"},{value:"like-right",label:"右模糊"},{value:"like-left",label:"左模糊"},{value:"range",label:"范围"}],showLabel:v=>{const C=M.value.options.filter(B=>B.value==v);return C[0]?C[0].label:v}});return(v,C)=>{const B=i.resolveComponent("a-divider"),R=i.resolveComponent("CloseOutlined"),g=i.resolveComponent("a-button"),S=i.resolveComponent("PlusOutlined"),T=i.resolveComponent("a-input"),O=i.resolveComponent("a-form-item"),F=i.resolveComponent("a-col"),$=i.resolveComponent("a-input-number"),D=i.resolveComponent("a-checkbox"),Q=i.resolveComponent("a-row"),U=i.resolveComponent("a-select"),E=i.resolveComponent("ToolOutlined"),P=i.resolveComponent("a-table");return i.openBlock(),i.createElementBlock("div",br,[i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[8]||(C[8]=[i.createTextVNode("工具设置")])),_:1}),i.createElementVNode("div",yr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size,ref_for:!0},I.props||{},{onClick:_=>r("left",I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"bool-del",onClick:i.withModifiers(_=>h("left",I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","tool-add"]),size:"small",onClick:C[0]||(C[0]=I=>c("left"))},{default:i.withCtx(()=>[i.createVNode(S)]),_:1}),i.createVNode(g,{class:i.normalizeClass(["btn","tool-add","right"]),onClick:C[1]||(C[1]=I=>c("right")),size:"small"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1}),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn","right",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size,ref_for:!0},I.props||{},{onClick:_=>r("right",I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"bool-del",onClick:i.withModifiers(_=>h("right",I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128))]),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[9]||(C[9]=[i.createTextVNode("操作设置")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createBlock(Q,{key:0},{default:i.withCtx(()=>[i.createVNode(F,{span:7},{default:i.withCtx(()=>[i.createVNode(O,{label:"操作标题"},{default:i.withCtx(()=>[i.createVNode(T,{value:n.value.configs.operation.title},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:5},{default:i.withCtx(()=>[i.createVNode(O,{label:"显示宽度",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode($,{value:n.value.configs.operation.width,"onUpdate:value":C[2]||(C[2]=I=>n.value.configs.operation.width=I)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:6},{default:i.withCtx(()=>[i.createVNode(O,{label:"显示按钮数量",labelCol:{span:9}},{default:i.withCtx(()=>[i.createVNode($,{value:n.value.configs.operation.count,"onUpdate:value":C[3]||(C[3]=I=>n.value.configs.operation.count=I)},null,8,["value"])]),_:1})]),_:1}),i.createVNode(F,{span:5},{default:i.withCtx(()=>[i.createVNode(O,{label:"是否显示"},{default:i.withCtx(()=>[i.createVNode(D,{checked:n.value.configs.operation.visible,"onUpdate:checked":C[4]||(C[4]=I=>n.value.configs.operation.visible=I)},null,8,["checked"])]),_:1})]),_:1})]),_:1})):i.createCommentVNode("",!0),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[10]||(C[10]=[i.createTextVNode("操作按钮")])),_:1}),n.value?.configs?.operation?(i.openBlock(),i.createElementBlock("div",wr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.value.configs.operation.btns,I=>(i.openBlock(),i.createBlock(g,i.mergeProps({key:I.name,class:["btn",I.name,!I.visible&&"deleted"],type:I.visible?I.type:"default",size:I.size||"small",ref_for:!0},I.props||{},{onClick:_=>d(I)}),i.createSlots({default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(I.title)+" ",1),I.visible?(i.openBlock(),i.createBlock(R,{key:0,class:"btn-del",onClick:i.withModifiers(_=>m(I),["stop"])},null,8,["onClick"])):i.createCommentVNode("",!0)]),_:2},[I.icon?{name:"icon",fn:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(I.icon)))]),key:"0"}:void 0]),1040,["class","type","size","onClick"]))),128)),i.createVNode(g,{class:i.normalizeClass(["btn","btn-add"]),onClick:C[5]||(C[5]=I=>p()),size:"small"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1})])):i.createCommentVNode("",!0),i.createVNode(B,{orientation:"left"},{default:i.withCtx(()=>C[11]||(C[11]=[i.createTextVNode("表头设置")])),_:1}),C[12]||(C[12]=i.createTextVNode(" 数据模型:")),i.createVNode(U,{class:"data-model-list",options:l.value,value:n.value.dataModel,"onUpdate:value":C[6]||(C[6]=I=>n.value.dataModel=I)},null,8,["options","value"]),i.createVNode(P,{columns:t.value,"data-source":y.value,bordered:"",scroll:{x:800},pagination:!1,"row-key":"name",size:"small"},{headerCell:i.withCtx(({column:I})=>[["showIndex","showWidth","align","fixed"].includes(I.key)?(i.openBlock(),i.createElementBlock("span",Ar,[i.createVNode(E),i.createTextVNode(" "+i.toDisplayString(I.title),1)])):i.createCommentVNode("",!0)]),bodyCell:i.withCtx(({column:I,record:_})=>[["showIndex","showWidth"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["edit-field",(!x.value[_.name]||!Object.keys(x.value[_.name]).includes(I.dataIndex))&&!u(_,I.dataIndex)&&"empty"]),onClick:z=>V(_,I.dataIndex)},[x.value[_.name]&&Object.keys(x.value[_.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock($,{key:0,value:x.value[_.name][I.dataIndex],"onUpdate:value":z=>x.value[_.name][I.dataIndex]=z,onBlur:z=>k(_,I.dataIndex),style:{margin:"-5px 0"}},null,8,["value","onUpdate:value","onBlur"])),[[A]]):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(i.toDisplayString(u(_,I.dataIndex)),1)],64))],10,xr)):["isList","isQuery","isSort"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",Cr,[i.createVNode(D,{checked:_[I.dataIndex],onClick:z=>N(_,I.dataIndex)},null,8,["checked","onClick"])])):["align","fixed"].includes(I.dataIndex)?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["edit-field",(!x.value[_.name]||!Object.keys(x.value[_.name]).includes(I.dataIndex))&&!u(_,I.dataIndex)&&"empty"]),onClick:z=>V(_,I.dataIndex)},[x.value[_.name]&&Object.keys(x.value[_.name]).includes(I.dataIndex)?i.withDirectives((i.openBlock(),i.createBlock(U,{key:0,value:_.show.list[I.dataIndex],"onUpdate:value":z=>_.show.list[I.dataIndex]=z,allowClear:!0,options:I.options,onBlur:C[7]||(C[7]=z=>k())},null,8,["value","onUpdate:value","options"])),[[A]]):(i.openBlock(),i.createElementBlock("span",Sr,i.toDisplayString(I.showLabel(I.options,u(_,I.dataIndex))),1))],10,vr)):i.createCommentVNode("",!0)]),_:1},8,["columns","data-source"]),i.createVNode(fi,{ref_key:"btnSetting",ref:f,preset:["edit","view","add","delBatch","expData","impData","downTmpl"]},null,512)])}}}),[["__scopeId","data-v-c966c24c"]]),Nr={class:"unione-table-tools"},Vr={class:"unione-table-data"},Rr={key:0,class:"unione-table-opts"},Rl=te(i.defineComponent({__name:"tableList",props:{wid:{type:String,required:!1},editor:{type:Object,required:!1},widget:{type:Object,required:!1},loading:{type:Boolean,default:!1},pagination:{type:Object,required:!1},dataList:{type:Array,default(){return[]}},rowKey:{type:String,default:"id"}},emits:["edit","view","add","delete","delBatch","expData","impData","downTmpl","leftBtnClick","rightBtnClick","optBtnClick","btnClick","change"],setup(a,{expose:e,emit:t}){const n=Fe(),l=a,o=i.computed(()=>l.editor?.widget(l.wid)||l.widget||{}),s=i.computed(()=>o.value.props||{}),r=i.computed(()=>o.value.rowKey||l.rowKey||"id"),c=i.computed(()=>o.value.dsn?l.editor?.dataManager().use(o.value.dsn,"list"):null),h=i.computed(()=>{const S=l.dataList||[];return!S.length&&c.value?c.value.data().body||[]:S}),f=i.computed(()=>{if(o.value.operation==!1)return{visible:!1};const S=Y.utils.obj.ext(o.value.operation||{},{title:"操作",width:200,count:2,btns:[],more:{title:"更多",visible:!0,trigger:"hover",size:"small",layout:"horizontal",items:[]}}),T=[];let O=(o.value.operation?.btns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F));if(O.forEach(F=>{T.push(F.name)}),T.includes("edit")||O.splice(0,0,{title:"编辑",name:"edit",type:"default",visible:!0}),T.includes("view")||O.splice(1,0,{title:"查看",name:"view",type:"default",visible:!0}),T.includes("delete")||O.push({title:"删除",name:"delete",type:"default",props:{danger:!0},visible:!0}),l.editor&&l.editor.type.value!="code"){const F=O.filter(D=>D.name=="edit")[0];if(F.visible&&(F.action||(F.action={}),F.action.type||(F.action.type="route"),!F.action.href)){const D=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",Q=l.editor.model.value;F.action.link=n.editPageUrl+"?psn="+D+"&model="+Q+"&id={row."+l.rowKey+"}"}const $=O.filter(D=>D.name=="view")[0];if($.visible&&($.action||($.action={}),$.action.type||($.action.type="route"),!$.action.href)){const D=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form";$.action.link=n.viewPageUrl+"?psn="+D+"&model=view&id={row."+l.rowKey+"}"}}return O=O.filter(F=>F.visible!=!1).sort((F,$)=>{const D=F.index||1,Q=$.index||1;return D-Q}),S.count&&(O.length>S.count+1?(S.btns=O.slice(0,S.count),S.more.items=O.slice(S.count,O.length),S.more.visible=!0):(S.btns=O,S.more.visible=!1)),S}),d=i.computed(()=>{let S=[];o.value.columns?.length&&(S=[...o.value.columns]);const T=[];S.forEach((F,$)=>{F.dataIndex=F.name,F.convert&&(F.dataIndex=F.name+"Label",F.convertObj=new Ge(F.convert),F.customCell=(D,Q,U)=>{const E=D[U.name];F.convertObj&&(D[U.dataIndex]==null||D[U.dataIndex]==null)&&E!=null&&E!=null&&(E+"").length>0&&(D[U.dataIndex]=E,F.convertObj.convert(E).then(P=>{P&&(D[U.dataIndex]=P)}))}),F.sort?.enable&&(F.sorter=!0,F.sort.multiple&&(F.sorter={},F.sorter.multiple=F.sort.multiple),F.sort.defoult&&(F.defaultSortOrder=F.sort.asc?"ascend":"descend")),F.customRender=({text:D})=>D||"--",F.fkey?.enable&&(F.fkey.labelName&&(F.dataIndex=sn(F.fkey.labelName)),F.fkey.labelTitle&&(F.title=F.fkey.labelTitle),F.customRender=({record:D,column:Q})=>D&&D[Q.name+"FEntry"]&&D[Q.name+"FEntry"][Q.dataIndex]||"--",F.fkey.fields?.forEach((D,Q)=>{if(!D.name)return;const U=sn(D.name),E={fkName:F.name,title:D.title,name:U,dataIndex:D.name,width:D.width,index:D.index||$+Q+1,customRender:({record:P,column:I})=>{if(P&&P[I.fkName+"FEntry"]){const _=P[I.fkName+"FEntry"][I.name];if(_)return D.convertObj&&D.convertObj.convert(_)||_}return"--"}};D.convert&&(D.convertObj=new Ge(D.convert)),T.push(E)}))}),T.forEach(F=>{S.splice(F.index,0,F)});const O=Y.utils.obj.ext(o.value.rownum,{title:"序号",fixed:"left",align:"center",width:60,visible:!0});return O&&O.visible!=!1&&(O.customRender=F=>V.value?(V.value.current-1)*V.value.pageSize+F.index+1:F.index,S=[O,...S]),f.value&&f.value.visible!=!1&&S.push({fixed:"right",align:"center",...f.value,name:"operation"}),S}),p=i.computed(()=>{if(o.value.leftBtns===!1)return[];const S=[],T=[];if((o.value.leftBtns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F)).forEach(F=>{F.visible!=!1&&S.push(F),T.push(F.name),F.name=="delBatch"&&!k.value&&(F.visible=!1)}),!T.includes("add")){const F={visible:!0,title:"新增",icon:"PlusOutlined",size:"small",index:0,type:"primary",props:{danger:!1,block:!1,ghost:!1},name:"add"};S.splice(0,0,F)}if(!T.includes("delBatch")&&k.value){const F={visible:!0,title:"批量删除",icon:"DeleteOutlined",size:"small",index:1,type:"primary",props:{danger:!0,block:!1,ghost:!1},name:"delBatch"};S.splice(1,0,F)}if(l.editor&&l.editor.type.value!="code"){const F=S.filter($=>$.name=="add")[0];if(F.visible&&(F.action||(F.action={}),F.action.type||(F.action.type="route"),!F.action.href)){const $=(l.editor.sn().endsWith(":list")?l.editor.sn().substring(0,l.editor.sn().length-5):l.editor.sn())+":form",D=l.editor.model.value;F.action.link=n.addPageUrl+"?psn="+$+"&model="+D}}return S});function m({btn:S,event:T}){if(n.isDebug&&console.log("unione table left btn click",S,T),S.name=="delBatch"){if(!u.value.selectedRowKeys.length){X.Modal.info({title:"提示信息",content:"请选择要删除的记录!"});return}if(c.value){c.value.deleteByIds(u.value.selectedRowKeys).then(()=>{R(),B(!0)});return}X.Modal.confirm({title:"确认信息",content:"请确认是否要删除选中的("+u.value.selectedRowKeys.length+")数据",onOk:()=>{M("delBatch",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("leftBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}});return}M(S.name,{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("leftBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}const b=i.computed(()=>{if(o.value.rightBtns===!1)return[];const S=[],T=[];if((o.value.rightBtns||[]).map(F=>(typeof F=="string"&&(F={name:F,visible:!1}),F)).forEach(F=>{F.visible!=!1&&S.push(F),T.push(F.name)}),!T.includes("impData")){const F={visible:!0,title:"导入",icon:"CloudUploadOutlined",size:"small",index:1,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"impData"};S.splice(1,0,F)}if(!T.includes("expData")){const F={visible:!0,title:"导出",icon:"CloudUploadOutlined",size:"small",index:2,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"expData"};S.splice(2,0,F)}if(!T.includes("downTmpl")){const F={visible:!0,icon:"CloudDownloadOutlined",size:"small",title:"模版",index:3,type:"default",props:{danger:!1,block:!1,ghost:!1},name:"downTmpl"};S.splice(3,0,F)}return S});function y({btn:S,event:T}){n.isDebug&&console.log("unione table right btn click",S,T),M(S.name,{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("rightBtnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}const A=i.computed(()=>({bordered:!0,size:"small",...o.value.attrs||{}})),x=i.ref({}),w=i.ref(null),V=i.computed(()=>Y.utils.obj.ext(l.pagination||o.value.pagination,{showTotal:S=>"共"+S+"记录",pageSize:l.pagination?.pageSize||c.value?.data()?.pageSize||10,current:l.pagination?.current||c.value?.data()?.page||1,total:l.pagination?.total||c.value?.data()?.total||0,position:["bottomCenter"]})),k=i.computed(()=>typeof o.value.selection<"u"?o.value.selection:!0),u=i.ref({selectedRowKeys:[],selectedRowList:[],onChange:(S,T)=>{u.value.selectedRowKeys=S,u.value.selectedRowList=T},getCheckboxProps:S=>({disabled:S.checkable})}),N=["edit","view","add","delete","delBatch","impData","expData","downTmpl"],M=t;function v({btn:S,event:T},O){if(n.isDebug&&console.log("unione table opt btn click",S,T),S.name=="delete"){if(c.value){c.value.deleteByIds([O[r.value]]).then(()=>{R(),u.value.selectedRowKeys=u.value.selectedRowKeys.filter(F=>F!=O[r.value]),u.value.selectedRowList=u.value.selectedRowList.filter(F=>F[r.value]!=O[r.value])});return}X.Modal.confirm({title:"确认信息",content:"请确认是否要删除该记录?",onOk:()=>{M(S.name,{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("optBtnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}});return}M(S.name,{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("optBtnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}),M("btnClick",{btn:S,event:T,row:O,keys:u.value.selectedRowKeys,rows:u.value.selectedRowList})}function C(S,T,O,F){console.log("tableChanged",S,T,O,F),w.value={page:S.current,pageSize:S.pageSize},O&&(Array.isArray(O)?(w.value.sorts=[],O.forEach($=>{w.value.sorts.push({name:$.column.name,asc:$.order=="ascend"})})):O.column&&(w.value.sorts=[{name:O.column.name,asc:O.order=="ascend"}])),R(),M("change",{pagination:S,filters:T,sorter:O,event:F})}function B(S=!1){S?(u.value.selectedRowKeys=[],u.value.selectedRowList=[]):X.Modal.confirm({title:"确认信息",content:`确定要清除当前选中的(${u.value.selectedRowKeys.length})条数据?`,centered:!0,onOk:()=>{u.value.selectedRowKeys=[],u.value.selectedRowList=[]}})}function R(){if(c.value){const S={page:V.value.current,pageSize:V.value.pageSize,keywords:x.value.keywords,body:x.value.params||{}};w.value?.page&&(S.page=w.value.page),w.value?.pageSize&&(S.pageSize=w.value.pageSize),w.value?.sorts&&(S.sorts=w.value.sorts),console.log("dataStorage find params",S),c.value.find(S)}}i.onMounted(()=>{d.value?.forEach(S=>{S.sort?.enable&&S.sort.defoult&&(w.value||(w.value={},w.value.sorts||(w.value.sorts=[]),w.value.sorts.push({name:S.name,asc:S.sort.asc==!0})))}),l.editor?.ebus.$on("table-list-search",S=>{console.log("table-list-search",S),x.value=S||{},R()}),l.editor?.ebus.$on("table-list-reset",()=>{console.log("table-list-reset"),x.value={},R(),B(!0)}),l.editor?.ebus.$on("table-list-reload",()=>{console.log("table-list-reload"),R()})});function g(){return{keys:u.value.selectedRowKeys,rows:u.value.selectedRowList}}return e({getSelected:g,clearSelected:B}),(S,T)=>{const O=i.resolveComponent("unione-btn"),F=i.resolveComponent("DownOutlined"),$=i.resolveComponent("a-button"),D=i.resolveComponent("a-dropdown"),Q=i.resolveComponent("a-table");return i.openBlock(),i.createBlock(lt,{class:"unione-table-list",model:l.editor?.model.value,"setting-title":"列表设置"},i.createSlots({default:i.withCtx(()=>[i.createElementVNode("div",Nr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(p.value,U=>(i.openBlock(),i.createBlock(O,{key:U.name,class:"btn",widget:U,editor:a.editor,onClick:m,preset:N,ctx:{sltKeys:u.value.selectedRowKeys,sltRows:u.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128)),u.value.selectedRowKeys.length?(i.openBlock(),i.createElementBlock("span",{key:0,class:"selected-info",onClick:T[0]||(T[0]=U=>B())},"当前选中记录("+i.toDisplayString(u.value.selectedRowKeys.length)+")",1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.value,U=>(i.openBlock(),i.createBlock(O,{key:U.name,class:"btn right",widget:U,editor:a.editor,onClick:y,preset:N,ctx:{sltKeys:u.value.selectedRowKeys,sltRows:u.value.selectedRowList}},null,8,["widget","editor","ctx"]))),128))]),i.createElementVNode("div",Vr,[d.value&&d.value.length?(i.openBlock(),i.createBlock(Q,i.mergeProps({key:0,columns:d.value,rowKey:r.value,"data-source":h.value,"row-selection":k.value?u.value:null,scroll:{x:s.value.scrollX||"max-content",y:s.value.scrollY},pagination:V.value,onChange:C},A.value),{bodyCell:i.withCtx(({column:U,record:E})=>[U.name==="operation"?(i.openBlock(),i.createElementBlock("div",Rr,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.btns,P=>(i.openBlock(),i.createBlock(O,{key:P.name,class:"opt",widget:P,editor:a.editor,onClick:I=>v(I,E),preset:N,ctx:{row:E}},null,8,["widget","editor","onClick","ctx"]))),128)),f.value.more?.visible!=!1&&f.value.more.items?.length?(i.openBlock(),i.createBlock(D,{key:0,trigger:[f.value.more.trigger||"hover"],class:i.normalizeClass(["opt-more",f.value.more.size||"small"])},{overlay:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["opt-more-overlay",f.value.more.layout])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(f.value.more.items,P=>(i.openBlock(),i.createBlock(O,{key:P.name,class:"item",widget:P,editor:a.editor,onClick:I=>v(I,E),type:"text",preset:N,ctx:{row:E}},null,8,["widget","editor","onClick","ctx"]))),128))],2)]),default:i.withCtx(()=>[i.createVNode($,null,{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.value.more.title)+" ",1),i.createVNode(F)]),_:1})]),_:2},1032,["trigger","class"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),_:1},16,["columns","rowKey","data-source","row-selection","scroll","pagination"])):i.createCommentVNode("",!0)])]),_:2},[l.editor&&l.wid?{name:"widget-setting",fn:i.withCtx(()=>[i.createVNode(Br,{editor:l.editor,wid:l.wid},null,8,["editor","wid"])]),key:"0"}:void 0]),1032,["model"])}}}),[["__scopeId","data-v-a168b83b"]]);class De{options;mask;container;inputList;constructor(e){this.options=e,this.mask=null,this.container=null,this.inputList=[],this._render()}_render(){const{title:e,data:t,onClose:n,onCancel:l,onConfirm:o}=this.options,s=document.createElement("div");s.classList.add("dialog-mask"),s.setAttribute(re.EDITOR_COMPONENT,re.EditorComponent.COMPONENT),document.body.append(s);const r=document.createElement("div");r.classList.add("dialog-container"),r.setAttribute(re.EDITOR_COMPONENT,re.EditorComponent.COMPONENT);const c=document.createElement("div");c.classList.add("dialog"),r.append(c);const h=document.createElement("div");h.classList.add("dialog-title");const f=document.createElement("span");f.append(document.createTextNode(e));const d=document.createElement("i");d.onclick=()=>{n&&n(),this._dispose()},h.append(f),h.append(d),c.append(h);const p=document.createElement("div");p.classList.add("dialog-option");for(let A=0;A<t.length;A++){const x=t[A],w=document.createElement("div");if(w.classList.add("dialog-option__item"),x.label){const k=document.createElement("span");k.append(document.createTextNode(x.label)),w.append(k),x.required&&k.classList.add("dialog-option__item--require")}let V;x.type==="select"?(V=document.createElement("select"),x.options?.forEach(k=>{const u=document.createElement("option");u.value=k.value,u.label=k.label,V.append(u)})):x.type==="textarea"?V=document.createElement("textarea"):(V=document.createElement("input"),V.type=x.type),x.width&&(V.style.width=`${x.width}px`),x.height&&(V.style.height=`${x.height}px`),V.name=x.name,V.value=x.value||"",V instanceof HTMLSelectElement||(V.placeholder=x.placeholder||""),w.append(V),p.append(w),this.inputList.push(V)}c.append(p);const m=document.createElement("div");m.classList.add("dialog-menu");const b=document.createElement("button");b.classList.add("dialog-menu__cancel"),b.append(document.createTextNode("取消")),b.type="button",b.onclick=()=>{l&&l(),this._dispose()},m.append(b);const y=document.createElement("button");y.append(document.createTextNode("确定")),y.type="submit",y.onclick=()=>{if(o){const A=this.inputList.map(x=>({name:x.name,value:x.value}));o(A)}this._dispose()},m.append(y),c.append(m),document.body.append(r),this.container=r,this.mask=s}_dispose(){this.mask?.remove(),this.container?.remove()}}function Er(a){switch(a){case"comment":case"prolog":case"doctype":case"cdata":return{color:"#008000",italic:!0};case"namespace":return{opacity:.7};case"string":return{color:"#A31515"};case"punctuation":case"operator":return{color:"#393A34"};case"url":case"symbol":case"number":case"boolean":case"variable":case"constant":case"inserted":return{color:"#36acaa"};case"atrule":case"keyword":case"attr-value":return{color:"#0000ff"};case"function":return{color:"#b9a40a"};case"deleted":case"tag":return{color:"#9a050f"};case"selector":return{color:"#00009f"};case"important":return{color:"#e90",bold:!0};case"italic":return{italic:!0};case"class-name":case"property":return{color:"#2B91AF"};case"attr-name":case"regex":case"entity":return{color:"#ff0000"};default:return null}}function Or(a){const e=[];function t(n){for(let l=0;l<n.length;l++){const o=n[l];if(typeof o=="string")e.push({content:o});else if(Array.isArray(o.content))t(o.content);else{const{type:s,content:r}=o;typeof r=="string"&&e.push({type:s,content:r,...Er(s)})}}}return t(a),e}const Mr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAVFBMVEUAAABAQGA7Tk43SVs8S1pDQ1E7RVhASVtARlc8R1c8R1k8Rlc8RlY9RlY8SFc9R1Y8R1c9R1c9R1c9R1c9R1c9R1c+Rlc9R1g9R1c9R1c9R1f///9drmTRAAAAGnRSTlMACA0OERMaHCwvSExNUFWFvr/B0dji5Ozy9AbGsiEAAAABYktHRBsCYNSkAAAAS0lEQVQYGY3BRxKAIAAEwVEw56z7/4daggfkZDc/JXzZmY98EaFykwhkh5xravHqUwLSbh3wql087NbgFQtOP/IyOOYkIiIiIn64AbuqAxNq8qL8AAAAAElFTkSuQmCC",Tr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAUVBMVEUAAAAzTU1GRl07Tk45R1U9SVVASlU5TFVARlk9SVU8SFU/R1Y9R1c9R1Y+R1Y9Rlg+Rlc9R1c9R1c9R1c9R1c9R1c9R1c9R1c9R1c9R1f///+KO8ZgAAAAGXRSTlMACgsNEhUYGygqPEFPU4jAx87f4u3v8/T7caJ5nAAAAAFiS0dEGnVn5DIAAABMSURBVBgZlcFHEoAgFAXBMecs+t/9L2qBbmBnN3/kJLaGmO0tEdPZ8xqXW5JJrsKbj6kATG7AG48Sz/aOYJkI1prXVRBkfERCJMQ/D6VYAuykMtaLAAAAAElFTkSuQmCC",Ir="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAABJSUk+Rlg8R1c9R1c9Rlc+R1c9R1Y9R1c9R1g9R1f///+2NgyDAA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jQ/QVaDlZmP22y3giPDk7bQ2Hkqlz58G/dcv9Q2n32hulF2TowAAAABJRU5ErkJggg==",Wr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAElBMVEUAAAA8R1c9R1g9R1c9R1f////4xTreAAAABHRSTlMAwsPFKmGWBgAAAAFiS0dEBfhv6ccAAAAxSURBVAjXY2CAAWYXMFBgYIHwHbAyXFhcXKAiLAyoDBcXFpy6XOC6UKWYIJYKwF0BAHOuCQoquY55AAAAAElFTkSuQmCC",Yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AGI9sLgcTI6GI2FwQCGQSwAADUiFAamiQmpAAAAAElFTkSuQmCC",Hr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAL0lEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AEwnEHIK4PH6TAwGguDAQyDWAAA9RMUBrWQGpQAAAAASUVORK5CYII=",Kr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AFwOoOQlwahF0ZjYQDBMIgFALUTFAbTYirrAAAAAElFTkSuQmCC",Gr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QA/wD/AP+gvaeTAAAAJ0lEQVQ4jWNgoBAwwhi27uH/SdF4eOdKRsKq6AFGvTAYwKgXBgMAAPBTFAZ3qmVkAAAAAElFTkSuQmCC",Jr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAAzM2YrVV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AAAgDQdh/aFigmiDu5KsmrQIAAAAA/unQ5nwFF9LXAAAAAHy14HMBAug6NlQAAAAASUVORK5CYII=",mc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAANklEQVRoge3UsQkAQAgDQN1/6HcBa3n0rkwVCCQCAAAAAPhPNtkbb8GEbmvgBFd/h6sHAIBVCqg8AgOBAhyrAAAAAElFTkSuQmCC",Ol="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMElEQVRoge3RQQ0AAAgDMfAvGgxMACTt87LfqgAAAACAezq0CRvtf0tfAwAAAHDVAlQQGAInOy4AAAAAAElFTkSuQmCC",Ml="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAJUlEQVRoge3FQREAAAwCIPuX3nLowYcEAAAAAOhwnhwAAACAJg/gLTrGTJMeQQAAAABJRU5ErkJggg==",gc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAdklEQVRoge3JMVLCABRF0YMuAcu00LIGop29K5QdsBD3ADUtLU2KjONoazL3VO//S5IkSZIkWYrnH34v+MABV9zrq+rg6ds94AuveJv2OOtjfdF97xe72T7igk+cpn2sL7oPsPG3Ld6nfcatvqqeJEmSJEn+uQdnL6BXV6mCJAAAAABJRU5ErkJggg==",kc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAALUlEQVRoge3KwQ0AAAQEQfovmgrEl2TmeXsRAAAAAMA9Oey1/PTfHQAAAIDrGqi1DwIKMqgNAAAAAElFTkSuQmCC",bc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMElEQVRoge3LsQ0AAAjDMPj/aHiAgREke4zaCAAAAADgnhxaLba16L43vwAAAAB80GuiEAKxygkwAAAAAElFTkSuQmCC",yc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAH4AAAAUCAYAAABLTIm0AAAABmJLR0QA/wD/AP+gvaeTAAAAMUlEQVRoge3LwQkAMAgDQN1/aLtAEZ8Kd7+EJAIAAAAA2Cc/XTW7GmbfvV8AAAAALnj0XRgCL0bySQAAAABJRU5ErkJggg==",wc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAQAAACFbCRbAAAAAmJLR0QA/4ePzL8AAAAwSURBVAjXY2AAAcb8DiCZy56/Iv8/Q6FQ/uH8/0BG/jYQBRbJOwRmwNWAQANTfj8ArFYW+qKsr5kAAAAASUVORK5CYII=",Ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAHCAQAAACFbCRbAAAAAmJLR0QA/4ePzL8AAAApSURBVAjXY8if2MDEAAL5//PXp3FBGP/zT5SIQRj/87ehiEDV9EN0AQD+gxekoNbgEwAAAABJRU5ErkJggg==",xc=["title"],Cc=["title"],vc={class:"options"},Sc=["title"],Bc={class:"options"},Nc={class:"options"},Vc=["title"],Rc=["title"],Ec=["title"],Oc=["title"],Mc=["title"],Tc={class:"options"},Ic={class:"options"},Fc={class:"options"},Dc={class:"options"},_c={class:"options"},Pc={class:"menu-item__search__collapse__search"},$c={class:"arrow-left"},Lc={class:"arrow-right"},Uc=te(i.defineComponent({__name:"toolbar",props:{items:{type:Array,default(){return["simple"]}},editor:{type:Object}},setup(a,{expose:e}){const t=a,n=i.ref(),l=i.computed(()=>{let R=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Watermark","Codeblock","PageBreak","Control","Checkbox","Radio","Latex","Date","Block","Divider","Search","SearchCollapse","Print"];return t.items&&(t.items.length>1?R=t.items:t.items[0]=="simple"&&(R=["Undo","Redo","Painter","Format","Divider","Font","Size","SizeAdd","SizeMinus","Bold","Italic","Underline","Strikeout","Superscript","Subscript","Color","Highlight","Divider","Title","RowFlexLeft","RowFlexCenter","RowFlexRight","RowFlexAlignment","RowFlexJustify","RowMargin","List","Divider","Table","Image","Hyperlink","Separator","Codeblock","Divider","Search","SearchCollapse","Print"])),R});function o(){return n.value?.clientHeight}function s(){return n.value?.clientWidth}const r=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent);function c(R,g){console.log("exec cmd "+R+",params:",g),R!="Separator"&&Array.isArray(g)?t.editor?.command["execute"+R](g[0],g[1]):t.editor?.command["execute"+R](g)}function h(R,g){const S=g.target.getBoundingClientRect(),T=n.value.querySelector("."+R+" .options");T.classList.toggle("visible"),T.style.top=S.height+S.top+"px"}let f=!0,d;function p(){f?(f=!1,d=window.setTimeout(()=>{f=!0,t.editor?.command.executePainter({isDblclick:!1})},200)):window.clearTimeout(d)}function m(){f=!0,window.clearTimeout(d),t.editor?.command.executePainter({isDblclick:!0})}function b(){new De({title:"LaTeX",data:[{type:"textarea",height:100,name:"value",placeholder:"请输入LaTeX文本"}],onConfirm:R=>{const g=R.find(S=>S.name==="value")?.value;g&&t.editor?.command.executeInsertElementList([{type:re.ElementType.LATEX,value:g}])}})}function y(R){t.editor?.command.executeInsertElementList([{type:R,checkbox:{value:!1},value:""}])}function A(R,g){const S=g.target.getBoundingClientRect(),T=n.value.querySelector("."+R+" .options");T.classList.toggle("visible"),T.style.top=S.height+S.top+"px";const O=ua();T.firstChild.childNodes.forEach(F=>{const $=F.attributes.getNamedItem("label-format").value;F.innerText=O.format($),F.onclick=()=>{t.editor?.command.executeInsertElementList([{type:re.ElementType.DATE,dateFormat:F.attributes.getNamedItem("data-format").value,valueList:[{value:F.innerText.trim()}]}])}})}function x(){new De({title:"内容块",data:[{type:"select",label:"类型",name:"type",value:"iframe",required:!0,options:[{label:"网址",value:"iframe"},{label:"视频",value:"video"}]},{type:"number",label:"宽度",name:"width",placeholder:"请输入宽度(默认页面内宽度)"},{type:"number",label:"高度",name:"height",required:!0,placeholder:"请输入高度"},{type:"input",label:"地址",name:"src",required:!1,placeholder:"请输入地址"},{type:"textarea",label:"HTML",height:100,name:"srcdoc",required:!1,placeholder:"请输入HTML代码(仅网址类型有效)"}],onConfirm:R=>{const g=R.find(Q=>Q.name==="type")?.value;if(!g)return;const S=R.find(Q=>Q.name==="width")?.value,T=R.find(Q=>Q.name==="height")?.value;if(!T)return;const O=R.find(Q=>Q.name==="src")?.value,F=R.find(Q=>Q.name==="srcdoc")?.value,$={type:g};if($.type===re.BlockType.IFRAME){if(!O&&!F)return;$.iframeBlock={src:O,srcdoc:F}}else if($.type===re.BlockType.VIDEO){if(!O)return;$.videoBlock={src:O}}const D={type:re.ElementType.BLOCK,value:"",height:Number(T),block:$};S&&(D.width=Number(S)),t.editor?.command.executeInsertElementList([D])}})}function w(R){const g=R.target.getBoundingClientRect(),S=n.value.querySelector(".menu-item__table__collapse");S.style.display="block",S.style.top=g.height+g.top+"px",S.style.left=g.left-270/2+"px";const T=n.value.querySelector(".menu-item__table__collapse .table-close"),O=n.value.querySelector(".menu-item__table__collapse .table-select"),F=n.value.querySelector(".menu-item__table__collapse .table-panel"),$=[];n.value.querySelector(".menu-item__table__collapse .table-panel table").firstChild.childNodes.forEach(U=>{$.push(U.childNodes)});let D=0,Q=0;F.onmousemove=U=>{const{offsetX:_,offsetY:z}=U;$.forEach(K=>{K.forEach(L=>{L.classList.remove("active")})}),D=Math.ceil(_/22)||1,Q=Math.ceil(z/26)||1,$.forEach((K,L)=>{K.forEach((J,ee)=>{ee<D&&L<Q&&J.classList.add("active")})}),O.innerText=`${Q}×${D}`},F.onclick=()=>{S.style.display="none",t.editor?.command.executeInsertTable(Q,D)},T.onclick=U=>{U.stopPropagation(),S.style.display="none"}}function V(){const R=n.value.querySelector(".menu-item__image .image");R.click(),R.onchange=function(){const g=R.files[0],S=new FileReader;S.readAsDataURL(g),S.onload=function(){const T=new Image,O=S.result;T.src=O,T.onload=function(){t.editor?.command.executeImage({value:O,width:T.width,height:T.height}),R.value=""}}}}function k(){new De({title:"超链接",data:[{type:"text",label:"文本",name:"name",required:!0,placeholder:"请输入文本",value:t.editor?.command.getRangeText()},{type:"text",label:"链接",name:"url",required:!0,placeholder:"请输入链接"}],onConfirm:R=>{const g=R.find(T=>T.name==="name")?.value;if(!g)return;const S=R.find(T=>T.name==="url")?.value;S&&t.editor?.command.executeHyperlink({type:re.ElementType.HYPERLINK,value:"",url:S,valueList:re.splitText(g).map(T=>({value:T,size:16}))})}})}function u(R){R==="add"?new De({title:"水印",data:[{type:"text",label:"内容",name:"data",required:!0,placeholder:"请输入内容"},{type:"color",label:"颜色",name:"color",required:!0,value:"#AEB5C0"},{type:"number",label:"字体大小",name:"size",required:!0,value:"120"},{type:"number",label:"透明度",name:"opacity",required:!0,value:"0.3"},{type:"select",label:"重复",name:"repeat",value:"0",required:!1,options:[{label:"不重复",value:"0"},{label:"重复",value:"1"}]},{type:"number",label:"水平间隔",name:"horizontalGap",required:!1,value:"10"},{type:"number",label:"垂直间隔",name:"verticalGap",required:!1,value:"10"}],onConfirm:g=>{if(~g.findIndex(F=>!F.value))return;const T=g.reduce((F,$)=>(F[$.name]=$.value,F),{}),O=T.repeat==="1";t.editor?.command.executeAddWatermark({data:T.data,color:T.color,size:Number(T.size),opacity:Number(T.opacity),repeat:O,gap:O&&T.horizontalGap&&T.verticalGap?[Number(T.horizontalGap),Number(T.verticalGap)]:void 0})}}):t.editor?.command.executeDeleteWatermark()}function N(){new De({title:"代码块",data:[{type:"textarea",name:"codeblock",placeholder:"请输入代码",width:500,height:300}],onConfirm:R=>{const g=R.find(F=>F.name==="codeblock")?.value;if(!g)return;const S=xl.tokenize(g,xl.languages.javascript),T=Or(S),O=[];for(let F=0;F<T.length;F++){const $=T[F],D=re.splitText($.content);for(let Q=0;Q<D.length;Q++){const E={value:D[Q]};$.color&&(E.color=$.color),$.bold&&(E.bold=!0),$.italic&&(E.italic=!0),O.push(E)}}O.unshift({value:`
|
|
2
2
|
`}),t.editor?.command.executeInsertElementList(O)}})}function M(R){const g=R.target.getBoundingClientRect(),S=n.value.querySelector(".menu-item__search__collapse");S.style.display="block",S.style.top=g.height+g.top+"px",S.style.left=g.left-260/2+"px";const T=n.value.querySelector(".menu-item__search__collapse__search input"),O=n.value.querySelector(".menu-item__search__collapse__replace input"),F=S.querySelector(".search-result");T.focus();const $=()=>{const D=t.editor?.command.getSearchNavigateInfo();if(D){const{index:Q,count:U}=D;F.innerText=`${Q}/${U}`}else F.innerText=""};S.querySelector("span").onclick=()=>{S.style.display="none",T.value="",O.value="",t.editor?.command.executeSearch(null),$()},T.oninput=()=>{t.editor?.command.executeSearch(T.value||null),$()},T.onkeydown=D=>{D.key==="Enter"&&(t.editor?.command.executeSearch(T.value||null),$())},S.querySelector("button").onclick=()=>{const D=T.value,Q=O.value;D&&Q&&D!==Q&&t.editor?.command.executeReplace(Q)},S.querySelector(".arrow-left").onclick=()=>{t.editor?.command.executeSearchNavigatePre(),$()},S.querySelector(".arrow-right").onclick=()=>{t.editor?.command.executeSearchNavigateNext(),$()}}function v(){const R=n.value.querySelector(".menu-item__color .input-color");R.oninput=function(){t.editor?.command.executeColor(R.value)},R.click()}function C(){const R=n.value.querySelector(".menu-item__highlight .input-highlight");R.oninput=function(){t.editor?.command.executeHighlight(R.value)},R.click()}function B(R){switch(R){case re.ControlType.TEXT:new De({title:"文本控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"}],onConfirm:g=>{const S=g.find(O=>O.name==="placeholder")?.value;if(!S)return;const T=g.find(O=>O.name==="value")?.value||"";t.editor?.command.executeInsertControl({type:re.ElementType.CONTROL,value:"",control:{type:R,value:T?[{value:T}]:null,placeholder:S}})}});break;case re.ControlType.SELECT:new De({title:"列举控件",data:[{type:"text",label:"占位符",name:"placeholder",required:!0,placeholder:"请输入占位符"},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
|
|
3
3
|
[{
|
|
4
4
|
"value":"有",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.0.
|
|
1
|
+
declare const _default: "0.0.20";
|
|
2
2
|
export default _default;
|