12345678910111213141516 |
- var Rn=Object.defineProperty,Ln=Object.defineProperties;var Mn=Object.getOwnPropertyDescriptors;var Ae=Object.getOwnPropertySymbols;var Un=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable;var Ne=(h,y,l)=>y in h?Rn(h,y,{enumerable:!0,configurable:!0,writable:!0,value:l}):h[y]=l,O=(h,y)=>{for(var l in y||(y={}))Un.call(y,l)&&Ne(h,l,y[l]);if(Ae)for(var l of Ae(y))wn.call(y,l)&&Ne(h,l,y[l]);return h},Pe=(h,y)=>Ln(h,Mn(y));var u=(h,y,l)=>new Promise((M,v)=>{var U=E=>{try{A(l.next(E))}catch(N){v(N)}},w=E=>{try{A(l.throw(E))}catch(N){v(N)}},A=E=>E.done?M(E.value):Promise.resolve(E.value).then(U,w);A((l=l.apply(h,y)).next())});import{F as I,a4 as K,D as Z,cI as _n,cJ as ee,b1 as Fn,__tla as Dn}from"./index-b5895273.js";import{B as i,D as ke,N as ve,a as On,F as ne,M as Re,b as xn,I as Bn,c as x,d as B,A as H,R as Hn,e as Vn,E as Jn,T as qn,f as Yn,g as Gn,h as Qn,C as Wn,i as jn,j as $n,k as Xn,P as zn}from"./workflowEnum-a2efed5c.js";import{b as Le,__tla as Kn}from"./designHelper-fedad396.js";import{g as Me,__tla as Zn}from"./design-f3e25317.js";let Ue,we,te,_e,se,Fe,oe,De,re,Oe,xe,Be,ie,He,Ve,Je,qe,Ye,ae,Ge,Qe,We,je,$e,Xe,ze,Ke,Ze,en,nn,tn,sn,on,V,rn,an,fn,fe,dn,ln,mn,cn,un,pn,T,m,L,de,le,g,gn,hn,k,yn,Cn,J,In,et=Promise.all([(()=>{try{return Dn}catch(h){}})(),(()=>{try{return Kn}catch(h){}})(),(()=>{try{return Zn}catch(h){}})()]).then(()=>u(void 0,null,function*(){pn=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/template/list",params:e},{errorMessageMode:n})})},en=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/template/enabled-page",params:e},{errorMessageMode:n})})},Cn=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/template/page",params:e},{errorMessageMode:n})})},un=function(e,n="modal"){return u(this,null,function*(){return I.delete({url:"/form/template",data:e},{errorMessageMode:n})})},V=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/template/info",params:{id:e}},{errorMessageMode:n})})},cn=function(e,n,t="modal"){return u(this,null,function*(){return I.put({url:"/form/template/status",data:{id:e,enabledMark:n}},{errorMessageMode:t})})},hn=function(e,n="modal"){return u(this,null,function*(){return I.put({url:"/form/template/data-first",data:e},{errorMessageMode:n})})},rn=function(e,n="modal"){return u(this,null,function*(){return I.post({url:"/form/template/data-first",data:e},{errorMessageMode:n})})},dn=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/history/list",params:{formId:e}},{errorMessageMode:n})})},ln=function(e,n="modal"){return u(this,null,function*(){return I.get({url:"/form/history/info",params:{id:e}},{errorMessageMode:n})})},mn=function(e,n="modal"){return u(this,null,function*(){return I.put({url:"/form/history/set-version",data:e},{errorMessageMode:n})})},an=function(e,n="modal"){return u(this,null,function*(){return I.post({url:"/form/template/code-first",data:e},{errorMessageMode:n})})},fn=function(e,n="modal"){return u(this,null,function*(){return I.put({url:"/form/template/code-first",data:e},{errorMessageMode:n})})};function h(e){return u(this,null,function*(){try{const n=yield V(e),t=JSON.parse(n.formJson).formJson;return n.formJson?Le(t,!1):null}catch(n){return null}})}function y(e){return u(this,null,function*(){try{const n=yield V(e),t=JSON.parse(n.formJson).formJson;return n.formJson?Le(t,!1):null}catch(n){return null}})}Be=function(){return Math.random().toString(36).slice(-8)},In=function(){return Math.random().toString(36).slice(-4)},J=function(){return new Date().getTime()},Oe=function(){const e=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];let n="";for(let t=0;t<8;t++)n+=e[Math.floor(Math.random()*26)];return n+J()};let l,M,v,U,w,A,E,N,me,ce,ue,pe,ge,q,Y,he,ye,Ce,G,P;({t:l}=K()),M={processId:"",type:i.PROCESS,code:"",name:"",parentId:"",category:void 0,nameRule:"",nameRuleConfigs:[],autoAgreeRule:[],isPrevChooseNext:ke.NOT_SPECIFIED,noHandler:ve.ADMIN,appShow:!1,defaultFormList:[],remark:"",content:"",authConfig:{authType:On.ALL,authMemberConfigs:[]},menuConfig:{enabled:!1,code:"",name:"",system:void 0,parentId:void 0,icon:"",order:void 0,remark:""},formInitConfig:{enabled:!1,formType:ne.CUSTOM,formId:"",formName:""},timeoutRemidConfig:{enabled:!1,hour:void 0,interval:void 0,pushHits:void 0,pushMemberConfigs:[]},relationProcessConfigs:[],processParamConfigs:[],xmlContent:"",styleType:"0"},v={id:"",type:i.EVENT,name:"",parentId:"",remark:""},U={id:"",type:i.START,name:"",parentId:"",remark:"",formConfigs:[],subProcessInitiator:"",assignmentConfig:{formAssignmentConfigs:[],paramAssignmentConfigs:[]},startEventConfigs:[],endEventConfigs:[]},w={id:"",type:i.END,name:"",parentId:"",remark:"",noticePolicyConfigs:[],startEventConfigs:[],endEventConfigs:[]},A={id:"",type:i.USER,currentProgress:void 0,name:"",parentId:"",remark:"",formConfigs:[],noticePolicyConfigs:[],approverConfigs:[],circulateConfigs:[],autoAgreeRule:[],isPrevChooseNext:ke.NOT_SPECIFIED,provisionalApprover:!1,noHandler:ve.ADMIN,countersignConfig:{multipleInstancesType:Re.NONE,addOrRemove:xn.ALLOW,finishType:Bn.ALL,percentage:0,countersignList:[]},buttonConfigs:[{buttonType:x.DEFAULT,buttonName:l("\u540C\u610F"),buttonCode:B.AGREE,approveType:H.AGREE,checked:!0},{buttonType:x.DEFAULT,buttonName:l("\u62D2\u7EDD"),buttonCode:B.DISAGREE,approveType:H.DISAGREE,checked:!0},{buttonType:x.DEFAULT,buttonName:l("\u9A73\u56DE"),buttonCode:B.REJECT,approveType:H.REJECT,checked:!0,buttonOpera:Hn.ALL},{buttonType:x.DEFAULT,buttonName:l("\u7ED3\u675F"),buttonCode:B.FINISH,approveType:H.FINISH,checked:!0}],opinionConfig:{enabled:!1,showType:Vn.ALL,signature:Jn.NO_PASSWORD_REQUIRED,component:[]},assignmentConfig:{formAssignmentConfigs:[],paramAssignmentConfigs:[]},timeOutHandle:{isHandle:qn.NO,rule:Yn.MAX,type:Gn.AGREE,user:1,auto:1},startEventConfigs:[],endEventConfigs:[]},E={id:"",type:i.SCRIPT,name:"",parentId:"",remark:"",recordInfo:Qn.RECORD,noticePolicyConfigs:[],script:{enabled:!1,scriptFormat:"JavaScript",scriptContent:" var a = 1"},api:{enabled:!1,apiConfig:{id:"",name:"",method:"",requestParamsConfigs:[],requestHeaderConfigs:[],requestBodyConfigs:[]}},assignmentConfig:{formAssignmentConfigs:[],paramAssignmentConfigs:[]},startEventConfigs:[],endEventConfigs:[]},N={id:"",type:i.SEQUENCEFLOW,name:"",parentId:"",remark:"",conditionConfigs:[],startEventConfigs:[],endEventConfigs:[]},me={id:"",type:i.SUB_PROCESS,name:"",parentId:"",remark:"",startEventConfigs:[],endEventConfigs:[]},ce={id:"",type:i.CALLACTIVITY,name:"",parentId:"",remark:"",schemaId:"",schemaName:"",callActivityType:Wn.SINGLE,finishType:jn.ALL,percentOf:void 0,executionType:$n.SEQUENCE,originatorNode:"",originatorType:Xn.FORM_FIELD,originatorConfig:"",inParams:[],outParams:[],startEventConfigs:[],endEventConfigs:[]},ue={id:"",type:i.EXCLUSIVE,name:"",parentId:"",remark:"",startEventConfigs:[],endEventConfigs:[]},pe={id:"",type:i.INCLUSIVE,name:"",parentId:"",remark:"",startEventConfigs:[],endEventConfigs:[]},ge={id:"",type:i.PARALLEL,name:"",parentId:"",remark:"",startEventConfigs:[],endEventConfigs:[]},q=new Map([[i.START,U],[i.END,w],[i.USER,A],[i.SCRIPT,E],[i.EXCLUSIVE,ue],[i.INCLUSIVE,pe],[i.PARALLEL,ge],[i.SUB_PROCESS,me],[i.CALLACTIVITY,ce],[i.SEQUENCEFLOW,N]]),Y=new Map([[i.START,l("\u5F00\u59CB\u8282\u70B9")],[i.END,l("\u7ED3\u675F\u8282\u70B9")],[i.USER,l("\u7528\u6237\u8282\u70B9")],[i.SCRIPT,l("\u811A\u672C\u8282\u70B9")],[i.EXCLUSIVE,l("\u4E92\u65A5\u7F51\u5173")],[i.INCLUSIVE,l("\u76F8\u5BB9\u7F51\u5173")],[i.PARALLEL,l("\u5E76\u884C\u7F51\u5173")],[i.SUB_PROCESS,l("\u5B50\u6D41\u7A0B")],[i.CALLACTIVITY,l("\u5916\u90E8\u6D41\u7A0B")],[i.SEQUENCEFLOW,l("\u6D41\u7A0B\u7EBF")],[i.PROCESS,l("\u6D41\u7A0B\u6A21\u677F")]]),{t:he}=K(),ie=M,ye=function(e){return q.has(e)?q.get(e):v},L=e=>Y.has(e)?Y.get(e):"",Ye=e=>L(e),Ve=()=>{const e=m();ae(T,i.START,he("\u5F00\u59CB\u8282\u70B9"),e.processInfo.processId)},He=e=>u(void 0,null,function*(){const n=m();if(e.defaultFormList.length>0){const t=yield oe(e.defaultFormList);G(t)}n.setProcessInfo(e),n.setInfoId(e.processId)}),qe=e=>!Ce(e),Ce=e=>m().hasProperties(e),k=(e,n)=>{m().setProperties(e,n)},ae=(e,n,t,s)=>{const o=m(),{defaultFormList:r,processInfo:a}=o,f=Z(ye(n));f.id=e,f.name=t,f.type=n,f.parentId=s,(n==i.START||n==i.USER)&&(f.formConfigs=Z(r)),n==i.USER&&(f.autoAgreeRule=a.autoAgreeRule,f.noHandler=a.noHandler,f.isPrevChooseNext=a.isPrevChooseNext),k(e,f)},Ge=e=>{const n=m();n.hasProperties(e)&&n.deleteProperties(e)},Qe=(e,n)=>{const t=m();if(t.hasProperties(e)){const s=t.getProperties(e);s&&(s.parentId=n,k(e,s))}},G=e=>{m().setDefaultFormList(e)},ze=e=>{const n=m();G(e);const{info:t}=n;for(const[s,o]of t)if(o.type==i.START||o.type==i.USER){const r=n.getProperties(s);r&&(r.formConfigs=[...r.formConfigs,...e],k(s,r))}},Je=e=>{const n=m();e.length>0&&e.forEach(t=>{t.id&&!n.hasProperties(t.id)&&k(t.id,t)})},We=()=>{const e=m(),{info:n,processInfo:t}=e;return{childNodeConfig:[...n.values()],processConfig:t}},T="Event_start_node",je=e=>`
- <?xml version="1.0" encoding="UTF-8"?>
- <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1u51epq" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.2.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.17.0">
- <bpmn:process id="${e}" name="${e}" isExecutable="true">
- <bpmn:startEvent id="${T}" name="\u5F00\u59CB\u8282\u70B9" />
- </bpmn:process>
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1m1pmsz">
- <bpmndi:BPMNShape id="${T}_di" bpmnElement="${T}">
- <dc:Bounds x="159" y="359" width="36" height="36" />
- </bpmndi:BPMNShape>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
- </bpmn:definitions>
- `,m=_n({id:"bpmn-store",state:()=>({modelId:"",info:new Map,infoId:"",processInfo:Z(ie),defaultFormList:[]}),getters:{isMainStartNode:e=>e.infoId===T},actions:{setProcessInfo(e){this.processInfo=e},setProperties(e,n){this.info.set(e,n)},hasProperties(e){return this.info.has(e)},getProperties(e){return this.info.has(e)?this.info.get(e):null},deleteProperties(e){this.infoId="",this.info.has(e)&&this.info.delete(e)},setInfoId(e){this.infoId=e},setDefaultFormList(e){this.defaultFormList=e}}}),{t:P}=K(),g="___",Xe=function(e){const n=[];return e&&e.length>0&&e.forEach(t=>{const s=[];t.children&&t.children.length>0&&t.children.forEach(o=>{if(o.type==R){const r=t.key+g+o.key;s.push({title:o.fieldName,key:r,formId:t.formId,formField:o.key,disabled:!1,children:[]})}}),n.push({title:t.formName,key:t.formId,formId:t.formId,formField:"",disabled:!0,children:s})}),n},re=function(e,n="",t="",s=!1,o=!1,r=!0){const a=m(),{infoId:f}=a;n=n||f;const p=[];return e&&e.length>0&&e.forEach(c=>{const C=[];c.children&&c.children.length>0&&c.children.forEach(d=>{if(d.isSubTable){if(o){const b=[],kn=n+g+c.key+g+d.fieldId;d.children.forEach(S=>{if(!X.includes(S.type)&&S.type!==""){const vn=n+g+c.key+g+d.fieldId+g+S.fieldId;S.fieldId&&b.push({title:S.fieldName,label:t+"-"+c.formName+"-"+d.fieldName+"-"+S.fieldName,key:vn,formId:c.formId,formField:S.fieldId,disabled:!1,children:[]})}}),C.push({title:d.fieldName,label:t+"-"+c.formName+"-"+d.fieldName,key:kn,formId:c.formId,formField:d.fieldId,disabled:!0,children:b})}}else if(r&&!X.includes(d.type))if(d.type===""){if(s){const b=n+g+c.key+g+d.fieldId;C.push({title:d.fieldName,label:t+"-"+c.formName+"-"+d.fieldName,key:b,formId:c.formId,formField:d.fieldId,disabled:!1,children:[]})}}else{const b=n+g+c.key+g+d.fieldId;d.fieldId&&C.push({title:d.fieldName,label:t+"-"+c.formName+"-"+d.fieldName,key:b,formId:c.formId,formField:d.fieldId,disabled:!1,children:[]})}}),p.push({title:c.formName,label:t+"-"+c.formName,key:n+g+c.key,formId:c.formId,formField:"",disabled:!0,children:C})}),p},on=function(e){const n=O({needUserNodeButton:!1,needHideComponents:!1,needSubTable:!1,needMainTable:!0},e),t=[],s=m(),{info:o,processInfo:r}=s,a=Q(o.values(),r.processId,n);return t.push(...a),t},Ke=function(){const e={needUserNodeButton:!1,needHideComponents:!1,needSubTable:!0,needMainTable:!1},n=[],t=m(),{info:s,processInfo:o}=t,r=Q(s.values(),o.processId,e);return n.push(...r),n};function Q(e,n,t){const s=[];for(const o of e)if([i.START,i.USER,i.CALLACTIVITY].includes(o.type)&&o.parentId==n){const r=o.name?o.name:o.type,a=o.id,f=re(o.formConfigs,a,r,t.needHideComponents,t.needSubTable,t.needMainTable),p={title:r,label:r,key:a,disabled:!0,children:f};if(o.type==i.USER&&t.needUserNodeButton){const c=[];o.buttonConfigs.forEach(d=>{d.checked&&c.push({title:d.buttonName,key:d.buttonCode,disabled:!1,children:[],buttons:[]})});const C=En(a,r,c);p.children.push(C)}o.type==i.USER&&o.countersignConfig.multipleInstancesType!==Re.NONE&&p.children.push({title:P("\u6309\u94AE\u7EC4"),label:r+"-"+P("\u5BA1\u6279\u7ED3\u679C"),key:a+g+"button"+g+"result",disabled:!1,children:[]}),s.push(p)}return s}const En=(e,n,t)=>{const s=[];return t.forEach(o=>{s.push({title:o.title,key:o.key,disabled:!1,children:[]})}),{title:P("\u6309\u94AE\u7EC4"),label:n+"-"+P("\u6309\u94AE\u7EC4"),key:e+g+"button",disabled:!1,children:[],buttons:s}};De=function(){const e=[],n=m(),{info:t}=n;for(const s of t.values())if([i.START,i.USER].includes(s.type)){const o=s.name?s.name:L(s.type);e.push(Pe(O({},s),{name:o}))}return e},$e=function(){const e=[],n=m(),{info:t,processInfo:s}=n,o=s.processId;for(const r of t.values())if([i.START,i.USER].includes(r.type)&&r.parentId==o){const a=r.name?r.name:L(r.type);e.push({id:r.id,name:a})}return e},de=function(){return m().processInfo.processParamConfigs};function bn(e){const n=[{title:P("\u6D41\u7A0B\u53C2\u6570"),key:"processParameter",disabled:!0,children:[]}];return e.forEach(t=>{n&&n[0]&&n[0].children&&n[0].children.push({title:t.name,key:t.id,disabled:!1,children:[]})}),n}function _(e,n,t){const s=O({needUserNodeButton:!1,needHideComponents:!1,needSubTable:!1,needMainTable:!0},t),o=de(),r=bn(o),a=Q(e,n.processId,s);return r.push(...a),r}nn=function(){const e=m(),{info:n,processInfo:t}=e;return _(n.values(),t)},Ze=function(){const e=m(),{info:n,processInfo:t}=e;return _(n.values(),t,{needUserNodeButton:!1,needHideComponents:!0,needSubTable:!1})},Ue=function(){const e=m(),{info:n,processInfo:t}=e;return _(n.values(),t,{needUserNodeButton:!1,needHideComponents:!0,needSubTable:!0})},tn=function(e){return u(this,null,function*(){const n=yield Me(e),t=JSON.parse(n==null?void 0:n.jsonContent);return _(t.childNodeConfig,t.processConfig)})},sn=function(e){return u(this,null,function*(){const n=yield Me(e),t=JSON.parse(n==null?void 0:n.jsonContent),s=n==null?void 0:n.xmlContent;return{json:t,xml:s}})},yn=function(){const e={},n={},t=m(),{info:s,infoId:o,getProperties:r}=t;let a=[];const f=r(o);f&&f.formConfigs&&f.formConfigs.length>0&&(a=f.formConfigs.map(C=>C.formId));for(const C of s.values())[i.START,i.USER].includes(C.type)&&C.formConfigs.length>0&&C.formConfigs.forEach(d=>{e[d.key]?e[d.key].nodeIds&&e[d.key].nodeIds.push(C.id):(e[d.key]=d,e[d.key].nodeIds=[C.id]),n[d.formId]?n[d.formId]&&!a.includes(d.formId)&&n[d.formId].push(d.key):a.includes(d.formId)||(n[d.formId]=[d.key])});const p=[],c={};for(const[C,d]of Object.entries(n))if(d&&Array.isArray(d)){const b=[...new Set(d)];b.length==1?p.push(b[0]):c[C]=b}return{formKeyList:e,repeatedList:c,notRepeatedList:p}},we=function(){const e=[],n=m(),{info:t}=n;for(const s of t.values())[i.START,i.USER].includes(s.type)&&s.formConfigs.length>0&&s.formConfigs.forEach(o=>{o.formId&&e.push(o.formId)});return[...new Set(e)]},xe=function(e){const n=m(),{info:t}=ee(n);for(const[s,o]of t.value)if(o.type==i.START||o.type==i.USER||o.type==i.SCRIPT){const r=Tn(e,o);r&&n.setProperties(s,r)}else if(o.type==i.CALLACTIVITY){const r=W(e,o);r&&n.setProperties(s,r)}},Fe=function(e){const n=m(),{info:t}=ee(n);for(const[s,o]of t.value)if(o.type==i.START||o.type==i.USER){const r=Ie(e,o);r&&n.setProperties(s,r)}else if(o.type==i.SEQUENCEFLOW){const r=Ee(e,o);r&&n.setProperties(s,r)}else if(o.type==i.CALLACTIVITY){const r=W(e,o);r&&n.setProperties(s,r)}};function Sn(e,n){const t=m(),{info:s}=ee(t);for(const[o,r]of s.value){const a=r.id+g+e+g+n;if(r.type==i.START||r.type==i.USER){const f=Ie(a,r);f&&t.setProperties(o,f)}else if(r.type==i.SEQUENCEFLOW){const f=Ee(a,r);f&&t.setProperties(o,f)}else if(r.type==i.CALLACTIVITY){const f=W(a,r);f&&t.setProperties(o,f)}}}function Tn(e,n){let t=!1;return n.assignmentConfig&&n.assignmentConfig.formAssignmentConfigs&&n.assignmentConfig.formAssignmentConfigs.length>0&&(n.assignmentConfig.formAssignmentConfigs=n.assignmentConfig.formAssignmentConfigs.filter(s=>s.source===e?(t=!0,!1):!0)),n.assignmentConfig&&n.assignmentConfig.paramAssignmentConfigs&&n.assignmentConfig.paramAssignmentConfigs.length>0&&(n.assignmentConfig.paramAssignmentConfigs=n.assignmentConfig.paramAssignmentConfigs.filter(s=>s.target===e?(t=!0,!1):!0)),t?n:null}function Ie(e,n){let t=!1;return n.assignmentConfig&&n.assignmentConfig.formAssignmentConfigs&&n.assignmentConfig.formAssignmentConfigs.length>0&&(n.assignmentConfig.formAssignmentConfigs=n.assignmentConfig.formAssignmentConfigs.filter(s=>s.target.key.includes(e)?(t=!0,!1):!0)),n.assignmentConfig&&n.assignmentConfig.paramAssignmentConfigs&&n.assignmentConfig.paramAssignmentConfigs.length>0&&(n.assignmentConfig.paramAssignmentConfigs=n.assignmentConfig.paramAssignmentConfigs.filter(s=>s.type===zn.FORM_DATA&&s.formConfig.key.includes(e)?(t=!0,!1):!0)),t?n:null}function Ee(e,n){let t=!1;return n.conditionConfigs&&n.conditionConfigs.length>0&&(n.conditionConfigs=n.conditionConfigs.filter(s=>s.value.includes(e)?(t=!0,!1):!0)),t&&(n.conditionConfigs=[]),t?n:null}function W(e,n){let t=!1;return n.inParams&&n.inParams.length>0&&(n.inParams=n.inParams.filter(s=>s.source&&s.source.includes(e)||s.target&&s.target.includes(e)?(t=!0,!1):!0)),n.outParams&&n.outParams.length>0&&(n.outParams=n.outParams.filter(s=>s.source&&s.source.includes(e)||s.target&&s.target.includes(e)?(t=!0,!1):!0)),t?n:null}let R,F,D,j,$,be,Se,X;R="opinion",te="hiddenComponent",F="title",D="divider",j="info",$="auto-code",be="button",Se=[R,F,D,j,$,"qrcode"],se=[R,F,D,j,$,be,"switch","slider","rate","picker-color","image"],_e=["qrcode"],X=[R,F,D,"image","qrcode"],oe=function(e){return u(this,null,function*(){const n=[];if(e.length>0)for(let t=0;t<e.length;t++){const s=yield le(e[t]);n.push(s)}return n})},le=function(e){return u(this,null,function*(){const n=e.formId,t=e.formType,s=e.formName,o=e.name?e.name:e.formName,r={key:e.key?e.key:"form_"+e.formId+"_"+J(),formType:t,formId:n,formName:s,name:o,showChildren:!1,requiredAll:!0,viewAll:!0,editAll:!0,children:[]},a=yield fe(n,t);return a.length>0&&(r.children=z(a)),r})};function An(e,n,t){const s=e.key,o=e.children,r=new Map,a=t.children;a&&Array.isArray(a)&&a.forEach(f=>{f.children.length>0&&f.children.forEach(p=>{r.set(p.tableName+p.key,p)}),r.set(f.key,f)}),o&&Array.isArray(o)&&o.forEach(f=>{n.has(f.key)&&!r.has(f.key)&&Sn(s,f.key)})}gn=function(e,n){const t=new Map,s=e.children;s&&Array.isArray(s)&&s.forEach(a=>{a.children.length>0&&a.children.forEach(f=>{t.set(f.tableName+f.key,f)}),t.set(a.key,a)});const o=n.children,r=[];return An(e,t,n),o&&Array.isArray(o)&&o.forEach(a=>{const f=[];a.children.length>0&&a.children.forEach(p=>{f.push(t.has(p.tableName+p.key)?t.get(p.tableName+p.key):p)}),a.children=f,a=t.has(a.key)?t.get(a.key).type=="form"?a:t.get(a.key):a,r.push(a)}),n.children=r,n},fe=function(e,n){return u(this,null,function*(){try{if(n==ne.CUSTOM){const t=yield y(e);if(t&&t.schemas)return t.schemas}else if(n==ne.SYSTEM){const t=yield h(e);return t&&(t!=null&&t.schemas)?t.schemas:(Fn.error("\u8BFB\u53D6\u7CFB\u7EDF\u8868\u5355\u5931\u8D25"),[])}else return[]}catch(t){return[]}})};function z(e){const n=[];return e&&e.length>0&&e.forEach(t=>{var s;if(["Card","Grid","Tab"].includes(t.component))t.children&&t.children.length>0&&t.children.forEach(o=>{o.list&&o.list.length>0&&n.push(...z(o.list))});else if(t.component=="SubForm")n.push(Nn(t));else if(t.component==="OneForOne"){const o=Te(t);o.isSubTable=!0,o.showChildren=!1;const r=((s=t.componentProps)==null?void 0:s.childSchemas)||[];o.children.push(...z(r)),n.push(o)}else n.push(Te(t))}),n}function Te(e){const n=[];let t=!0,s=!0,o=!0,r=!1,a=!1;const f=e.type;return Se.includes(e.type)&&(t=!1,s=!0,o=!1,r=!0),se.includes(e.type)&&(t=!1),e.type===te&&(t=!1,s=!1,o=!1,r=!0),e.type==="input"&&e.componentProps.isSave&&(t=!1,s=!0,o=!1,r=!0,a=!0),{required:t,view:s,edit:o,disabled:r,isSaveTable:a,tableName:"",fieldName:e.label,fieldId:e.field,isSubTable:!1,showChildren:!0,type:f,key:e.key,children:n}}function Nn(e){const n=[];return e.componentProps&&e.componentProps.columns&&e.componentProps.columns.length>0&&e.componentProps.columns.forEach(t=>{t.dataIndex&&n.push(Pn(e.field,t))}),{required:!0,view:!0,edit:!0,disabled:!1,isSubTable:!0,showChildren:!1,tableName:e.field,fieldName:e.label,fieldId:e.field,type:e.type,key:e.key,children:n}}function Pn(e,n){let t=!1;return n.type==="input"&&n.componentProps.isSave&&(t=!0),{required:!0,view:!0,edit:!0,disabled:!1,isSubTable:!0,isSaveTable:t,showChildren:!1,tableName:e,fieldName:n.title,fieldId:n.dataIndex,type:n.type,key:n.key,children:[]}}}));export{Ue as $,we as A,te as B,_e as C,se as D,Fe as E,oe as F,De as G,re as H,Oe as I,xe as J,Be as K,ie as L,He as M,Ve as N,Je as O,qe as P,Ye as Q,ae as R,Ge as S,Qe as T,We as U,je as V,$e as W,Xe as X,ze as Y,Ke as Z,Ze as _,et as __tla,en as a,nn as a0,tn as a1,sn as a2,on as b,V as c,rn as d,an as e,fn as f,fe as g,dn as h,ln as i,mn as j,cn as k,un as l,pn as m,T as n,m as o,L as p,de as q,le as r,g as s,gn as t,hn as u,k as v,yn as w,Cn as x,J as y,In as z};
|