ss-component-new 1.1.164 → 1.1.166

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.
Files changed (68) hide show
  1. package/dist/{array-jR-WStUM.cjs → array-CIOBvBsr.cjs} +1 -1
  2. package/dist/{array-Ci6eXFKY.js → array-CnBDdPwL.js} +9 -9
  3. package/dist/{cloneDeep-DqZ7vz8g.cjs → cloneDeep-DER--uPX.cjs} +1 -1
  4. package/dist/{cloneDeep-CtBjgcpB.js → cloneDeep-DMsBqhn5.js} +1 -1
  5. package/dist/{formToTable-onAmzVvu.js → formToTable-BprbRq5I.js} +1 -1
  6. package/dist/{formToTable-56xI7i3Y.cjs → formToTable-CPTKd-HF.cjs} +1 -1
  7. package/dist/{index-BwGEUSpL.cjs → index--ytG3uBV.cjs} +1 -1
  8. package/dist/{index-B3bEmnU0.js → index-B3AXhk6a.js} +7 -7
  9. package/dist/{index-DZBNbrIF.cjs → index-BO5yvJdI.cjs} +1 -1
  10. package/dist/{index-OSlsRln2.cjs → index-BOy1bSzZ.cjs} +1 -1
  11. package/dist/{index-DBHZzTLc.cjs → index-BYJinY8s.cjs} +1 -1
  12. package/dist/{index-Ci2xKRX4.cjs → index-BZRBLz0M.cjs} +1 -1
  13. package/dist/{index-CORLgKVr.cjs → index-Bd5g9LEC.cjs} +1 -1
  14. package/dist/{index-DMrvCMF9.js → index-BfHrf1hL.js} +1 -1
  15. package/dist/{index-Ds_GjEDa.js → index-BmybC1PC.js} +4 -4
  16. package/dist/{index-fu0h1_ni.cjs → index-Bo2sy1wW.cjs} +1 -1
  17. package/dist/{index-DFzX1RK_.cjs → index-BqfAMO-Q.cjs} +1 -1
  18. package/dist/{index-CqHY2J0U.cjs → index-BtZGSmE4.cjs} +173 -173
  19. package/dist/{index-DTPyngs2.cjs → index-BuQvkTC_.cjs} +1 -1
  20. package/dist/{index-73rIUJUQ.js → index-BxBYHLiW.js} +7 -7
  21. package/dist/{index-2SPwxf_d.js → index-CFL6MQle.js} +4 -4
  22. package/dist/{index-DNw1ScH3.cjs → index-CN2ZUKVm.cjs} +1 -1
  23. package/dist/{index-DEC1RcSA.cjs → index-CYAB6IVO.cjs} +1 -1
  24. package/dist/{index-B2nxlcI_.cjs → index-CfIwdKoW.cjs} +1 -1
  25. package/dist/{index-BecJMgVd.js → index-CoXgajIp.js} +1 -1
  26. package/dist/{index-D7LCH2B4.js → index-CsjzuSwd.js} +6 -6
  27. package/dist/{index-BSPYod0d.cjs → index-DFCAJ9Vo.cjs} +1 -1
  28. package/dist/{index-Dmt_YJ-1.cjs → index-DJd5gmh4.cjs} +1 -1
  29. package/dist/{index-D8yyJ4ij.cjs → index-DLKFHZHb.cjs} +1 -1
  30. package/dist/{index-D9rcnCGb.js → index-DMiJKhwz.js} +12 -12
  31. package/dist/{index-D_fwjS3z.js → index-DP3w07QU.js} +6 -6
  32. package/dist/{index-Dlqzwxr_.cjs → index-DU0GCFYu.cjs} +1 -1
  33. package/dist/{index-DG_CHlTj.cjs → index-DXihJydq.cjs} +1 -1
  34. package/dist/{index-D4svf93S.js → index-Dh422bH4.js} +5 -5
  35. package/dist/{index-BPloVtg3.js → index-DirLeh5R.js} +1 -1
  36. package/dist/{index-CziQLmHE.js → index-DlI_21OF.js} +11 -11
  37. package/dist/{index-cEOEpnKF.cjs → index-Doa6hpwh.cjs} +1 -1
  38. package/dist/{index-B5pn4_ea.js → index-DuqflGdi.js} +7 -7
  39. package/dist/{index-BxepHo5i.js → index-FHEhYs1w.js} +7 -7
  40. package/dist/{index-C9dGaAQO.js → index-Q7uuScWY.js} +1 -1
  41. package/dist/{index-tGUdrgeK.js → index-RPUNFmDf.js} +6 -6
  42. package/dist/{index-CwZRdwOR.js → index-d4ishmsH.js} +1 -1
  43. package/dist/{index-CfwqNQ75.js → index-lndc-1oJ.js} +6 -6
  44. package/dist/{index-Btu_-lir.js → index-mCQ6tP78.js} +7 -7
  45. package/dist/{index-D9bMhrzO.cjs → index-t_aIEfXB.cjs} +1 -1
  46. package/dist/{index-DVmX1hed.js → index-xQOBDZGG.js} +1 -1
  47. package/dist/{index.vue_vue_type_script_setup_true_lang-DT3NTRN-.cjs → index.vue_vue_type_script_setup_true_lang-CXer2HjG.cjs} +1 -1
  48. package/dist/{index.vue_vue_type_script_setup_true_lang-iarHIbVB.js → index.vue_vue_type_script_setup_true_lang-za18XehF.js} +6 -6
  49. package/dist/{index.vue_vue_type_style_index_0_scoped_baf99455_lang-DZ_ULnx2.cjs → index.vue_vue_type_style_index_0_scoped_baf99455_lang-Bm0jQQqv.cjs} +1 -1
  50. package/dist/{index.vue_vue_type_style_index_0_scoped_baf99455_lang-CohOVVBU.js → index.vue_vue_type_style_index_0_scoped_baf99455_lang-CV4aFeR1.js} +6 -6
  51. package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-COwlVzFK.cjs → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-Dn-j2icF.cjs} +1 -1
  52. package/dist/{index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-DPpt3VZM.js → index.vue_vue_type_style_index_0_scoped_bbb8ace9_lang-ndUp7SCU.js} +6 -6
  53. package/dist/{login-CCZDJWfU.cjs → login-BuwvcSrn.cjs} +1 -1
  54. package/dist/{login-l3-TQ4Nv.js → login-DnO6sJwP.js} +3 -3
  55. package/dist/{main-CTnl0Xy9.js → main-CHqAouMK.js} +6 -6
  56. package/dist/{main-CyMc3Ucn.cjs → main-CcF1b8Di.cjs} +1 -1
  57. package/dist/{menu-C5E_B2Yb.js → menu-C1zU-rc-.js} +1 -1
  58. package/dist/{menu-DUn9J6ja.cjs → menu-CwoHmZYg.cjs} +1 -1
  59. package/dist/{modelComp-DV6uSzBz.js → modelComp-CUZjjNBE.js} +1 -1
  60. package/dist/{modelComp-C4S5aP2f.cjs → modelComp-DH63MmzP.cjs} +1 -1
  61. package/dist/{request-DYjZLCB4.cjs → request-DRcIFNRO.cjs} +1 -1
  62. package/dist/{request-Dx56pt7_.js → request-EMSstqMr.js} +1 -1
  63. package/dist/ss-component.cjs +1 -1
  64. package/dist/ss-component.css +1 -1
  65. package/dist/ss-component.js +7 -7
  66. package/dist/ss-component2.cjs +1 -1
  67. package/dist/ss-component2.js +1 -1
  68. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";const c=require("vue"),$=require("./request-DYjZLCB4.cjs"),H=require("./index-Dmt_YJ-1.cjs"),K=require("./formToTable-56xI7i3Y.cjs"),P=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),p=require("./cloneDeep-DqZ7vz8g.cjs"),ee=require("./index-DNw1ScH3.cjs"),X=require("./menu-DUn9J6ja.cjs"),L=[{key:"单选",value:"Select"},{key:"日期",value:"Date"},{key:"长文本",value:"TextArea"},{key:"上传",value:"Upload"}],ae={class:"form-content"},ne={__name:"index",props:{itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number},emits:["change","contentChange"],setup(w,{emit:T}){const u=w,R=T,M=c.ref([]),g=c.ref(!1),I=c.ref([]),D=K.useFormToTableComp($.pinia),Q=c.ref(),Y=n=>{var s,r,a,b;const i=(r=(s=p.cloneDeep(u.itemData))==null?void 0:s.find(d=>(d==null?void 0:d.key)==="formContent"))==null?void 0:r.contents,t=p.cloneDeep(n.content);let m={};t&&((a=Object.values(t))==null?void 0:a.length)>0&&((b=Object.values(t))==null||b.forEach((d,A)=>{m[i[A].key]=d}));const f={content:m,index:u==null?void 0:u.index,buttonName:n==null?void 0:n.buttonName};R("change",f)},Z=n=>{var m,f;if(!n)return;if(((m=Object.values(p.cloneDeep(n)))==null?void 0:m.length)>0){const s=(f=Object.values(p.cloneDeep(n)))==null?void 0:f.map(a=>a);let r="";s==null||s.forEach(a=>{a!==""&&a!==void 0&&(r=r===""?a:r+"/"+a)}),D.setSelectArray(s),D.setSelectString(r)}const i=p.cloneDeep(u.itemData),t=i==null?void 0:i.map(s=>{var r;return(s==null?void 0:s.key)==="formContent"&&((r=s.contents)==null||r.map((a,b)=>{var d,A,N,F,J,o,l,h,e,x,V,_,W,E,S,z,B,G,U;return a.type=a!=null&&a.type?a.type:(F=(N=(A=(d=a==null?void 0:a.key)==null?void 0:d.split("$"))==null?void 0:A[1])==null?void 0:N.split("("))!=null&&F[0]?(J=L==null?void 0:L.find(k=>{var v,C,y,q;return(k==null?void 0:k.key)===((q=(y=(C=(v=a==null?void 0:a.key)==null?void 0:v.split("$"))==null?void 0:C[1])==null?void 0:y.split("("))==null?void 0:q[0])}))==null?void 0:J.value:"Input",a.options=a!=null&&a.options?a.options:((h=(l=(o=a==null?void 0:a.key)==null?void 0:o.split("$"))==null?void 0:l[1])==null?void 0:h.length)>0?(_=(V=H.formGetOptions((x=(e=a==null?void 0:a.key)==null?void 0:e.split("$"))==null?void 0:x[1]))==null?void 0:V.split(","))==null?void 0:_.map(k=>({label:k,value:k})):[],(W=a==null?void 0:a.key)!=null&&W.includes("$")&&(a.key=(S=(E=a==null?void 0:a.key)==null?void 0:E.split("$"))==null?void 0:S[0]),a.value=Array.isArray((z=Object.values(n))==null?void 0:z[b])?(G=(B=Object.values(n))==null?void 0:B[b])==null?void 0:G[0]:(U=Object.values(n))==null?void 0:U[b],a})),s});R("contentChange",{contents:t,index:u.index})};return c.watch(()=>u.itemData,()=>{var f,s,r,a,b,d,A,N,F,J;const n=(f=p.cloneDeep(u.itemData))==null?void 0:f.find(o=>(o==null?void 0:o.key)==="formContent"),i=(s=p.cloneDeep(u.itemData))==null?void 0:s.find(o=>(o==null?void 0:o.key)==="formButton"),t=(r=p.cloneDeep(u.itemData))==null?void 0:r.find(o=>(o==null?void 0:o.key)==="formFlex"),m=(a=p.cloneDeep(u.itemData))==null?void 0:a.find(o=>(o==null?void 0:o.key)==="formWrap");if((m==null?void 0:m.contents)==="纵向"?g.value=!1:g.value=!0,Q.value=typeof(t==null?void 0:t.contents)!="boolean"?!(!(t!=null&&t.contents)===""||((b=t==null?void 0:t.contents)==null?void 0:b.toUpperCase())==="VERTICAL"):t==null?void 0:t.contents,((d=n==null?void 0:n.contents)==null?void 0:d.length)>0&&Array.isArray(n==null?void 0:n.contents)){const o=[];(A=n==null?void 0:n.contents)==null||A.forEach((e,x)=>{var V,_,W,E,S,z,B,G,U,k;if((e==null?void 0:e.label)!==""){let v=(e==null?void 0:e.key)??"",C=(e==null?void 0:e.type)??"",y=(e==null?void 0:e.options)??[];if((V=e==null?void 0:e.key)!=null&&V.includes("$")&&(v=(_=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:_[0],((E=(W=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:W[1])==null?void 0:E.length)>0)){const[q,j]=(z=(S=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:S[1])==null?void 0:z.split(/[()]/);C=((B=L.find(O=>(O==null?void 0:O.key)===q))==null?void 0:B.value)??"",((G=j==null?void 0:j.split(","))==null?void 0:G.length)>0&&(y=(U=j==null?void 0:j.split(","))==null?void 0:U.map(O=>({label:O,value:O})))}o.push({label:v??"",name:"t"+x,type:C===""?"Input":C,value:e!=null&&e.value?e.value:(y==null?void 0:y.length)>0?(k=y==null?void 0:y[0])==null?void 0:k.value:(e==null?void 0:e.value)??"",id:(e==null?void 0:e.id)??x,contents:y??[],width:(e==null?void 0:e.width)??1})}});const l=(N=p.cloneDeep(o))==null?void 0:N.map(e=>e.value);let h="";l==null||l.forEach(e=>{e!==""&&e!==void 0&&(h=h===""?e:h+"/"+e)}),D.setSelectArray(l),D.setSelectString(h),M.value=o}else M.value=[];if(((F=i==null?void 0:i.contents)==null?void 0:F.length)>0){const o=[];(J=i==null?void 0:i.contents)==null||J.forEach((l,h)=>{(l==null?void 0:l.label)!==""&&o.push({label:(l==null?void 0:l.label)??"",id:(l==null?void 0:l.id)??h,type:(l==null?void 0:l.type)??"",background:l==null?void 0:l.background})}),I.value=o}else I.value=[]},{deep:!0,immediate:!0}),(n,i)=>(c.openBlock(),c.createElementBlock("div",ae,[c.createVNode(H.ssForm,{rowContents:M.value,buttonValue:I.value,isRowFlex:Q.value,isEnableWrap:!1,onOnButtonClick:Y,onChange:Z,isButtonRow:g.value},null,8,["rowContents","buttonValue","isRowFlex","isButtonRow"])]))}},oe=P._export_sfc(ne,[["__scopeId","data-v-3775f389"]]);function le(w){return $.service({url:"/api/sysFile/uploadAvatar",method:"post",data:w,headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjEzMDAwMDAwMDAxMDEsIlRlbmFudElkIjoxMzAwMDAwMDAwMDAxLCJBY2NvdW50Ijoic3VwZXJhZG1pbiIsIlJlYWxOYW1lIjoi6LaF57qn566h55CG5ZGYIiwiQWNjb3VudFR5cGUiOjk5OSwiT3JnSWQiOjAsIk9yZ05hbWUiOm51bGwsIk9yZ1R5cGUiOm51bGwsImlhdCI6MTc0OTcwOTM0NCwibmJmIjoxNzQ5NzA5MzQ0LCJleHAiOjE3NTAzMTQxNDQsImlzcyI6IkFkbWluLk5FVCIsImF1ZCI6IkFkbWluLk5FVCJ9.ITuVhBJHidiyS-D-3suoiot2YtjgKbj6x_YcN1NquW4","Content-Type":"multipart/form-data"}})}function te(w){return $.service({url:"/api/sysFile/downloadFile",method:"post",data:w,headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjEzMDAwMDAwMDAxMDEsIlRlbmFudElkIjoxMzAwMDAwMDAwMDAxLCJBY2NvdW50Ijoic3VwZXJhZG1pbiIsIlJlYWxOYW1lIjoi6LaF57qn566h55CG5ZGYIiwiQWNjb3VudFR5cGUiOjk5OSwiT3JnSWQiOjAsIk9yZ05hbWUiOm51bGwsIk9yZ1R5cGUiOm51bGwsImlhdCI6MTc0OTcwOTM0NCwibmJmIjoxNzQ5NzA5MzQ0LCJleHAiOjE3NTAzMTQxNDQsImlzcyI6IkFkbWluLk5FVCIsImF1ZCI6IkFkbWluLk5FVCJ9.ITuVhBJHidiyS-D-3suoiot2YtjgKbj6x_YcN1NquW4",Accept:"application/octet-stream"},responseType:"blob"})}const re=c.defineComponent({__name:"index",props:{avatarUrl:{type:String,default:""},avatarDefault:{type:String,default:""}},emits:["submitImage","deleteImage"],setup(w,{emit:T}){const u=w,R=T,M=c.computed(()=>"http://139.196.154.85:20013"),g=c.ref(""),I=c.ref(""),D=c.ref();c.watch(()=>u.avatarUrl,n=>{I.value=n},{immediate:!0});const Q=async()=>{try{const n=await te({url:g.value});if(n.status!==200)throw new Error(`HTTP error! status: ${n.status}`);const i=new Blob([n.data],{type:n.headers["content-type"]});D.value=i}catch(n){throw new Error(n)}},Y=async n=>{var i,t,m,f,s;try{const r=await le(n);((i=r==null?void 0:r.data)==null?void 0:i.code)===200&&(I.value=M.value+"/"+((m=(t=r.data)==null?void 0:t.result)==null?void 0:m.url),g.value=(s=(f=r.data)==null?void 0:f.result)==null?void 0:s.url,R("submitImage",I.value))}catch(r){X.ElMessage.error(r)}},Z=async()=>{try{if(!I.value)return}catch(n){X.ElMessage.error(n)}};return(n,i)=>(c.openBlock(),c.createBlock(ee.default,{avatarUrl:I.value,avatarBlob:D.value,onClickAvatar:Q,onSubmitImage:Y,onDeleteImage:Z},{avatarDefault:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(w.avatarDefault??"未知"),1)]),_:1},8,["avatarUrl","avatarBlob"]))}});exports._sfc_main=re;exports.ssForm=oe;
1
+ "use strict";const c=require("vue"),$=require("./request-DRcIFNRO.cjs"),H=require("./index-DJd5gmh4.cjs"),K=require("./formToTable-CPTKd-HF.cjs"),P=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),p=require("./cloneDeep-DER--uPX.cjs"),ee=require("./index-CN2ZUKVm.cjs"),X=require("./menu-CwoHmZYg.cjs"),L=[{key:"单选",value:"Select"},{key:"日期",value:"Date"},{key:"长文本",value:"TextArea"},{key:"上传",value:"Upload"}],ae={class:"form-content"},ne={__name:"index",props:{itemData:{type:Array,default:()=>[]},childItemData:{type:Array,default:()=>[]},index:Number},emits:["change","contentChange"],setup(w,{emit:T}){const u=w,R=T,M=c.ref([]),g=c.ref(!1),I=c.ref([]),D=K.useFormToTableComp($.pinia),Q=c.ref(),Y=n=>{var s,r,a,b;const i=(r=(s=p.cloneDeep(u.itemData))==null?void 0:s.find(d=>(d==null?void 0:d.key)==="formContent"))==null?void 0:r.contents,t=p.cloneDeep(n.content);let m={};t&&((a=Object.values(t))==null?void 0:a.length)>0&&((b=Object.values(t))==null||b.forEach((d,A)=>{m[i[A].key]=d}));const f={content:m,index:u==null?void 0:u.index,buttonName:n==null?void 0:n.buttonName};R("change",f)},Z=n=>{var m,f;if(!n)return;if(((m=Object.values(p.cloneDeep(n)))==null?void 0:m.length)>0){const s=(f=Object.values(p.cloneDeep(n)))==null?void 0:f.map(a=>a);let r="";s==null||s.forEach(a=>{a!==""&&a!==void 0&&(r=r===""?a:r+"/"+a)}),D.setSelectArray(s),D.setSelectString(r)}const i=p.cloneDeep(u.itemData),t=i==null?void 0:i.map(s=>{var r;return(s==null?void 0:s.key)==="formContent"&&((r=s.contents)==null||r.map((a,b)=>{var d,A,N,F,J,o,l,h,e,x,V,_,W,E,S,z,B,G,U;return a.type=a!=null&&a.type?a.type:(F=(N=(A=(d=a==null?void 0:a.key)==null?void 0:d.split("$"))==null?void 0:A[1])==null?void 0:N.split("("))!=null&&F[0]?(J=L==null?void 0:L.find(k=>{var v,C,y,q;return(k==null?void 0:k.key)===((q=(y=(C=(v=a==null?void 0:a.key)==null?void 0:v.split("$"))==null?void 0:C[1])==null?void 0:y.split("("))==null?void 0:q[0])}))==null?void 0:J.value:"Input",a.options=a!=null&&a.options?a.options:((h=(l=(o=a==null?void 0:a.key)==null?void 0:o.split("$"))==null?void 0:l[1])==null?void 0:h.length)>0?(_=(V=H.formGetOptions((x=(e=a==null?void 0:a.key)==null?void 0:e.split("$"))==null?void 0:x[1]))==null?void 0:V.split(","))==null?void 0:_.map(k=>({label:k,value:k})):[],(W=a==null?void 0:a.key)!=null&&W.includes("$")&&(a.key=(S=(E=a==null?void 0:a.key)==null?void 0:E.split("$"))==null?void 0:S[0]),a.value=Array.isArray((z=Object.values(n))==null?void 0:z[b])?(G=(B=Object.values(n))==null?void 0:B[b])==null?void 0:G[0]:(U=Object.values(n))==null?void 0:U[b],a})),s});R("contentChange",{contents:t,index:u.index})};return c.watch(()=>u.itemData,()=>{var f,s,r,a,b,d,A,N,F,J;const n=(f=p.cloneDeep(u.itemData))==null?void 0:f.find(o=>(o==null?void 0:o.key)==="formContent"),i=(s=p.cloneDeep(u.itemData))==null?void 0:s.find(o=>(o==null?void 0:o.key)==="formButton"),t=(r=p.cloneDeep(u.itemData))==null?void 0:r.find(o=>(o==null?void 0:o.key)==="formFlex"),m=(a=p.cloneDeep(u.itemData))==null?void 0:a.find(o=>(o==null?void 0:o.key)==="formWrap");if((m==null?void 0:m.contents)==="纵向"?g.value=!1:g.value=!0,Q.value=typeof(t==null?void 0:t.contents)!="boolean"?!(!(t!=null&&t.contents)===""||((b=t==null?void 0:t.contents)==null?void 0:b.toUpperCase())==="VERTICAL"):t==null?void 0:t.contents,((d=n==null?void 0:n.contents)==null?void 0:d.length)>0&&Array.isArray(n==null?void 0:n.contents)){const o=[];(A=n==null?void 0:n.contents)==null||A.forEach((e,x)=>{var V,_,W,E,S,z,B,G,U,k;if((e==null?void 0:e.label)!==""){let v=(e==null?void 0:e.key)??"",C=(e==null?void 0:e.type)??"",y=(e==null?void 0:e.options)??[];if((V=e==null?void 0:e.key)!=null&&V.includes("$")&&(v=(_=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:_[0],((E=(W=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:W[1])==null?void 0:E.length)>0)){const[q,j]=(z=(S=p.cloneDeep(e==null?void 0:e.key).split("$"))==null?void 0:S[1])==null?void 0:z.split(/[()]/);C=((B=L.find(O=>(O==null?void 0:O.key)===q))==null?void 0:B.value)??"",((G=j==null?void 0:j.split(","))==null?void 0:G.length)>0&&(y=(U=j==null?void 0:j.split(","))==null?void 0:U.map(O=>({label:O,value:O})))}o.push({label:v??"",name:"t"+x,type:C===""?"Input":C,value:e!=null&&e.value?e.value:(y==null?void 0:y.length)>0?(k=y==null?void 0:y[0])==null?void 0:k.value:(e==null?void 0:e.value)??"",id:(e==null?void 0:e.id)??x,contents:y??[],width:(e==null?void 0:e.width)??1})}});const l=(N=p.cloneDeep(o))==null?void 0:N.map(e=>e.value);let h="";l==null||l.forEach(e=>{e!==""&&e!==void 0&&(h=h===""?e:h+"/"+e)}),D.setSelectArray(l),D.setSelectString(h),M.value=o}else M.value=[];if(((F=i==null?void 0:i.contents)==null?void 0:F.length)>0){const o=[];(J=i==null?void 0:i.contents)==null||J.forEach((l,h)=>{(l==null?void 0:l.label)!==""&&o.push({label:(l==null?void 0:l.label)??"",id:(l==null?void 0:l.id)??h,type:(l==null?void 0:l.type)??"",background:l==null?void 0:l.background})}),I.value=o}else I.value=[]},{deep:!0,immediate:!0}),(n,i)=>(c.openBlock(),c.createElementBlock("div",ae,[c.createVNode(H.ssForm,{rowContents:M.value,buttonValue:I.value,isRowFlex:Q.value,isEnableWrap:!1,onOnButtonClick:Y,onChange:Z,isButtonRow:g.value},null,8,["rowContents","buttonValue","isRowFlex","isButtonRow"])]))}},oe=P._export_sfc(ne,[["__scopeId","data-v-3775f389"]]);function le(w){return $.service({url:"/api/sysFile/uploadAvatar",method:"post",data:w,headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjEzMDAwMDAwMDAxMDEsIlRlbmFudElkIjoxMzAwMDAwMDAwMDAxLCJBY2NvdW50Ijoic3VwZXJhZG1pbiIsIlJlYWxOYW1lIjoi6LaF57qn566h55CG5ZGYIiwiQWNjb3VudFR5cGUiOjk5OSwiT3JnSWQiOjAsIk9yZ05hbWUiOm51bGwsIk9yZ1R5cGUiOm51bGwsImlhdCI6MTc0OTcwOTM0NCwibmJmIjoxNzQ5NzA5MzQ0LCJleHAiOjE3NTAzMTQxNDQsImlzcyI6IkFkbWluLk5FVCIsImF1ZCI6IkFkbWluLk5FVCJ9.ITuVhBJHidiyS-D-3suoiot2YtjgKbj6x_YcN1NquW4","Content-Type":"multipart/form-data"}})}function te(w){return $.service({url:"/api/sysFile/downloadFile",method:"post",data:w,headers:{Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJVc2VySWQiOjEzMDAwMDAwMDAxMDEsIlRlbmFudElkIjoxMzAwMDAwMDAwMDAxLCJBY2NvdW50Ijoic3VwZXJhZG1pbiIsIlJlYWxOYW1lIjoi6LaF57qn566h55CG5ZGYIiwiQWNjb3VudFR5cGUiOjk5OSwiT3JnSWQiOjAsIk9yZ05hbWUiOm51bGwsIk9yZ1R5cGUiOm51bGwsImlhdCI6MTc0OTcwOTM0NCwibmJmIjoxNzQ5NzA5MzQ0LCJleHAiOjE3NTAzMTQxNDQsImlzcyI6IkFkbWluLk5FVCIsImF1ZCI6IkFkbWluLk5FVCJ9.ITuVhBJHidiyS-D-3suoiot2YtjgKbj6x_YcN1NquW4",Accept:"application/octet-stream"},responseType:"blob"})}const re=c.defineComponent({__name:"index",props:{avatarUrl:{type:String,default:""},avatarDefault:{type:String,default:""}},emits:["submitImage","deleteImage"],setup(w,{emit:T}){const u=w,R=T,M=c.computed(()=>"http://139.196.154.85:20013"),g=c.ref(""),I=c.ref(""),D=c.ref();c.watch(()=>u.avatarUrl,n=>{I.value=n},{immediate:!0});const Q=async()=>{try{const n=await te({url:g.value});if(n.status!==200)throw new Error(`HTTP error! status: ${n.status}`);const i=new Blob([n.data],{type:n.headers["content-type"]});D.value=i}catch(n){throw new Error(n)}},Y=async n=>{var i,t,m,f,s;try{const r=await le(n);((i=r==null?void 0:r.data)==null?void 0:i.code)===200&&(I.value=M.value+"/"+((m=(t=r.data)==null?void 0:t.result)==null?void 0:m.url),g.value=(s=(f=r.data)==null?void 0:f.result)==null?void 0:s.url,R("submitImage",I.value))}catch(r){X.ElMessage.error(r)}},Z=async()=>{try{if(!I.value)return}catch(n){X.ElMessage.error(n)}};return(n,i)=>(c.openBlock(),c.createBlock(ee.default,{avatarUrl:I.value,avatarBlob:D.value,onClickAvatar:Q,onSubmitImage:Y,onDeleteImage:Z},{avatarDefault:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(w.avatarDefault??"未知"),1)]),_:1},8,["avatarUrl","avatarBlob"]))}});exports._sfc_main=re;exports.ssForm=oe;
@@ -1,11 +1,11 @@
1
1
  import { ref as D, watch as q, createElementBlock as P, openBlock as X, createVNode as ee, defineComponent as ae, computed as oe, createBlock as te, withCtx as ie, createTextVNode as le, toDisplayString as re } from "vue";
2
- import { p as se, s as K } from "./request-Dx56pt7_.js";
3
- import { a as ne, f as ce } from "./index-D4svf93S.js";
4
- import { u as ue } from "./formToTable-onAmzVvu.js";
2
+ import { p as se, s as K } from "./request-EMSstqMr.js";
3
+ import { a as ne, f as ce } from "./index-Dh422bH4.js";
4
+ import { u as ue } from "./formToTable-BprbRq5I.js";
5
5
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
- import { c as u } from "./cloneDeep-CtBjgcpB.js";
7
- import pe from "./index-C9dGaAQO.js";
8
- import { E as H } from "./menu-C5E_B2Yb.js";
6
+ import { c as u } from "./cloneDeep-DMsBqhn5.js";
7
+ import pe from "./index-Q7uuScWY.js";
8
+ import { E as H } from "./menu-C1zU-rc-.js";
9
9
  const L = [
10
10
  {
11
11
  key: "单选",
@@ -1 +1 @@
1
- "use strict";const te=require("vue"),K=require("./index-D9bMhrzO.cjs"),R=require("./menu-DUn9J6ja.cjs"),ne=require("./login-CCZDJWfU.cjs"),re=require("./request-DYjZLCB4.cjs"),Q=require("./array-jR-WStUM.cjs"),h=require("./cloneDeep-DqZ7vz8g.cjs"),se=require("./crypto-CRbcEKIz.cjs");te.ref([]);const q=y=>{var t,s,c,f;const a=y;let n=[];a.compData=(t=a.compData)==null?void 0:t.filter(r=>(r==null?void 0:r.key)!=="tableContents"&&(r==null?void 0:r.key)!=="tableIndex");const e=(c=(s=h.cloneDeep(a.compData))==null?void 0:s.find(r=>(r==null?void 0:r.key)==="tableIndexColumn"))==null?void 0:c.contents;return(f=h.cloneDeep(a.compData))==null||f.forEach(r=>{if((r==null?void 0:r.key)!=="tableIndexColumn"&&(r==null?void 0:r.key)!=="header")n.push(r);else if((r==null?void 0:r.key)==="header"){let p=r.contents;e&&(p!=null&&p.every(o=>Array.isArray(o))?p==null||p[0].unshift({label:e}):p.unshift({label:e})),n.push({key:"header",contents:p})}}),a.compData=n,a},G=y=>{var s,c,f,r,p;const a=(s=y.compData)==null?void 0:s.filter(o=>(o==null?void 0:o.key)==="tableContents"||(o==null?void 0:o.key)==="tableIndex"),n=(f=(c=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableIndex"))==null?void 0:c.contents)==null?void 0:f.map(o=>o.label),e=(r=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableContents"))==null?void 0:r.contents;let t=[];return(n==null?void 0:n.length)>0&&(e!=null&&e.every(o=>Array.isArray(o)))?t=n==null?void 0:n.map((o,D)=>e[D]?[o,...e[D]]:[o]):Array.isArray(e==null?void 0:e[0])&&((p=e==null?void 0:e[0])!=null&&p.every(o=>Array.isArray(o)))?t=e==null?void 0:e[0]:Array.isArray(e==null?void 0:e[0])?t=e:t.push(e),t},oe=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>({label:t.label}))),e==null||e.forEach(t=>{t!=null&&t.children&&(t==null?void 0:t.children.length)>0&&n(t==null?void 0:t.children)}))}return n(y),a},ye=y=>{const a=[];function n(e,t=[]){!e||e.length===0||(a.push({key:t==null?void 0:t.filter(s=>!Array.isArray(s)),value:e}),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)),s)}))}return n(y),a},ce=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>t==null?void 0:t.filter(s=>!Array.isArray(s)))),e==null||e.forEach(t=>{t!=null&&t.some(s=>Array.isArray(s))&&n(t.find(s=>Array.isArray(s)))}))}return n(y),a},pe=y=>{const a=[];function n(e){var t;!e||e.length===0||(e!=null&&e.every(s=>!Array.isArray(s))?a.push(e):(a.push((t=e==null?void 0:e.map(s=>s==null?void 0:s.filter(c=>!Array.isArray(c))))==null?void 0:t[0]),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)))})))}return n(y),a},le=(y,a)=>{let n;function e(t,s,c=1){var r;if(!t||t.length===0)return;const f=(r=h.cloneDeep(s))==null?void 0:r.map(p=>p==null?void 0:p.filter(o=>!Array.isArray(o)));return f!=null&&f.find(p=>Q.equalArrays(p,t==null?void 0:t.key))?(s==null||s.forEach(p=>{!e(t,p.find(D=>Array.isArray(D)))&&Q.equalArrays(p.filter(D=>!Array.isArray(D)),t==null?void 0:t.key)&&(n={type:c,contents:p.filter(D=>!Array.isArray(D))})}),!0):!1}return e(y,a,0),n},W=(y,a)=>{function n(e,t){return!e||e.length===0||e==null?void 0:e.map((c,f)=>{var p,o;let r=c;return r.unshift((p=t==null?void 0:t[f])==null?void 0:p.label),r.some(D=>Array.isArray(D))&&(r[r.length-1]=n(r.find(D=>Array.isArray(D)),(o=t==null?void 0:t[f])==null?void 0:o.children)),r})}return n(y,a)},z=y=>{var n,e,t,s,c,f,r,p,o,D,g,A,k,u,m,E,x,S,V,b,M,T,d,L,I;const a=y;if((y==null?void 0:y.comp)==="Table"){if((t=(e=(n=y.compData)==null?void 0:n.find(l=>(l==null?void 0:l.key)==="tableIndex"))==null?void 0:e.contents)!=null&&t.every(l=>!(l!=null&&l.children))||!((s=y.compData)!=null&&s.find(l=>(l==null?void 0:l.key)==="tableIndex")))return((r=(f=(c=a.compData)==null?void 0:c.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:r.length)===1&&((g=(D=(o=(p=a.compData)==null?void 0:p.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:D[0])!=null&&g.every(l=>Array.isArray(l)))?(a.compData=(A=a.compData)==null?void 0:A.map(l=>{var C;return(l==null?void 0:l.key)==="tableContents"&&(l.contents=(C=l.contents)==null?void 0:C[0]),l}),[a]):[a];{let l=[];const C=a.compData,O=(k=h.cloneDeep(C))==null?void 0:k.find(i=>(i==null?void 0:i.key)==="tableIndexColumn"),N=(u=h.cloneDeep(C))==null?void 0:u.find(i=>(i==null?void 0:i.key)==="extraButton"),P=(m=h.cloneDeep(C))==null?void 0:m.find(i=>(i==null?void 0:i.key)==="rowButton"),w=pe((x=(E=h.cloneDeep(C))==null?void 0:E.find(i=>(i==null?void 0:i.key)==="header"))==null?void 0:x.contents),U=(S=h.cloneDeep(C))==null?void 0:S.find(i=>(i==null?void 0:i.key)==="tableIndex"),v=ce((b=(V=h.cloneDeep(C))==null?void 0:V.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:b.contents),ee=W((T=(M=h.cloneDeep(C))==null?void 0:M.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:T.contents,U==null?void 0:U.contents),ae=ye(W((L=(d=h.cloneDeep(C))==null?void 0:d.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:L.contents,U==null?void 0:U.contents));if(U)return(I=oe(U.contents))==null||I.forEach((i,j)=>{var J;let B=[];B.push({key:"tableIndex",contents:i}),B.push(O),B.push(N),B.push(P),B.push({key:"tableContents",contents:v[j]}),B.push({key:"header",contents:w!=null&&w[j]?[w==null?void 0:w[j]]:[w==null?void 0:w[0]]}),l.push({comp:"Table",compData:B,name:"",parentTableContents:((J=le(ae[j],ee))==null?void 0:J.contents)??""})}),l}}else return[a]},X=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var f;Array.isArray(c)?c==null||c.forEach(r=>{var p;(p=z(h.cloneDeep(r)))==null||p.forEach(async o=>{var D,g,A,k;if(r.comp==="Table"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:{comp:(D=q(h.cloneDeep(o)))==null?void 0:D.comp,compData:(g=q(h.cloneDeep(o)))==null?void 0:g.compData,name:(A=q(h.cloneDeep(o)))==null?void 0:A.name}}}),m=u.data.result,E=await((k=G(h.cloneDeep(o)))==null?void 0:k.map(async x=>{var M;const S=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:m},value:{tableData:x}}),b=await((M=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",parentTable:x}})).data.result)==null?void 0:M.map(async T=>await K.updateInsofDataApi({id:T.id,key:{systemKey:T.key.systemKey,pageKey:T.key.pageKey,type:T.key.type,version:T.key.version,parentTable:S.data.result}})));return a.push(b),S}));a.push(u),a.push(E)}else if((o==null?void 0:o.key)==="extraButton"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:o.value}});a.push(u)}else{const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:o}});a.push(u)}})}):(f=z(h.cloneDeep(c)))==null||f.forEach(async r=>{var p,o,D,g;if(c.comp==="Table"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:{comp:(p=q(h.cloneDeep(r)))==null?void 0:p.comp,compData:(o=q(h.cloneDeep(r)))==null?void 0:o.compData,name:(D=q(h.cloneDeep(r)))==null?void 0:D.name}}}),k=A.data.result,u=await((g=G(h.cloneDeep(r)))==null?void 0:g.map(async m=>{var V;const E=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:k},value:{tableData:m}}),S=await((V=(await K.getInsofDataApi({key:{parentTable:m,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure"}})).data.result)==null?void 0:V.map(async b=>await K.updateInsofDataApi({id:b.id,key:{systemKey:b.key.systemKey,pageKey:b.key.pageKey,type:b.key.type,version:b.key.version,parentTable:E.data.result}})));return a.push(S),E}));a.push(A),a.push(u)}else if((r==null?void 0:r.key)==="extraButton"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:r.value}});a.push(A)}else{const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:r}});a.push(A)}})})})}),await Promise.all(a)},Y=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var r,p,o,D;const f=(p=(r=c==null?void 0:c.compData)==null?void 0:r.find(g=>(g==null?void 0:g.key)==="extra"))==null?void 0:p.value;(D=(o=c.compData)==null?void 0:o.filter(g=>(g==null?void 0:g.key)!=="extra"))==null||D.forEach(g=>{var A;(A=z(h.cloneDeep(g)))==null||A.forEach(async k=>{var u,m,E,x,S,V,b,M;if(k.comp==="Table"){const T=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method",version:1,methodName:(E=(u=n.name)==null?void 0:u.split("/"))==null?void 0:E[((m=n.name)==null?void 0:m.split("/").length)-1],methodKey:(x=Object.values(f[0]))==null?void 0:x[0],parentTable:(k==null?void 0:k.parentTableContents)??""},value:{pageData:{comp:(S=q(h.cloneDeep(k)))==null?void 0:S.comp,compData:(V=q(h.cloneDeep(k)))==null?void 0:V.compData,name:(b=q(h.cloneDeep(k)))==null?void 0:b.name}}}),d=T.data.result,L=await((M=G(h.cloneDeep(k)))==null?void 0:M.map(async I=>{var N,P;const l=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"methodData",methodKey:(N=Object.values(f[0]))==null?void 0:N[0],tableId:d},value:{tableData:I}}),O=(P=(await K.getInsofDataApi({key:{parentTable:I,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method"}})).data.result)==null?void 0:P.map(async w=>await K.updateInsofDataApi({id:w.id,key:{systemKey:w.key.systemKey,pageKey:w.key.pageKey,type:w.key.type,methodKey:w.key.methodKey,parentTable:l.data.result}}));return a.push(O),l}));a.push(T),a.push(L)}})})})})}),await Promise.all(a)},ie=ne.useLoginState(re.pinia),{isStructureExist:ue}=R.storeToRefs(ie),fe=R.useMenuState(),F=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())!=="CALCULATOR"})),a.compData&&(a.compData=F(a.compData)),a)),H=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())==="CALCULATOR"})),a.compData&&(a.compData=H(a.compData)),a)),Z=y=>{const a=H(y);let n=[];return a==null||a.forEach(e=>{var t;(t=e.compData)!=null&&t.find(s=>{var c;return(c=s==null?void 0:s.contents)==null?void 0:c.find(f=>(f==null?void 0:f.comp)==="calculator")})&&n.push(e)}),n},_=async y=>{var a,n,e,t;try{const s=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu",type:"structure"},value:{pageData:y}});if(((a=s==null?void 0:s.data)==null?void 0:a.code)===200){const c=(e=(n=y==null?void 0:y.compData)==null?void 0:n[0])==null?void 0:e.contents;fe.setRawMenus(c??[])}return(t=s==null?void 0:s.data)==null?void 0:t.code}catch(s){return Promise.reject(s)}},De=async()=>{var s,c,f,r,p,o;const y=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),a=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),n=await Promise.all([y,a]),e=n==null?void 0:n[0],t=n==null?void 0:n[1];return{menuExist:((s=e==null?void 0:e.data)==null?void 0:s.result)&&((f=(c=e==null?void 0:e.data)==null?void 0:c.result)==null?void 0:f.length)>0,structureExist:((r=t==null?void 0:t.data)==null?void 0:r.result)&&((o=(p=t==null?void 0:t.data)==null?void 0:p.result)==null?void 0:o.length)>0}},$=async()=>{var y;try{const a=se.generateKeyPair(),n=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"},value:{cryptoInfo:{publicKey:a.publicKey,privateKey:a.privateKey}}});return((y=n==null?void 0:n.data)==null?void 0:y.code)===200}catch(a){throw a}},ge=async y=>{var t,s,c,f,r,p;const a=h.cloneDeep(y);console.log("savePageDataAsync",y,ue.value);const{menuExist:n,structureExist:e}=await De();if(console.log("promises",n,e),sessionStorage.getItem("systemKey")&&!n&&!e){const o=(t=F(a))==null?void 0:t.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}),D=a==null?void 0:a.find(g=>g.comp==="Menu");await _(D),$(),await X(o),await Y((s=Z(h.cloneDeep(y)))==null?void 0:s.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}))}else{const D=(f=(c=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.filter(u=>{var m;return((m=u==null?void 0:u.key)==null?void 0:m.layer)!=="superAdmin"}))==null?void 0:f.map(u=>u.id),g=D==null?void 0:D.map(async u=>await K.deleteInsofDataApi({id:u}));await Promise.all(g);const A=(r=F(a))==null?void 0:r.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}),k=a==null?void 0:a.find(u=>u.comp==="Menu");await _(k),$(),await X(A),await Y((p=Z(h.cloneDeep(y)))==null?void 0:p.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}))}};exports.savePageDataAsync=ge;
1
+ "use strict";const te=require("vue"),K=require("./index-t_aIEfXB.cjs"),R=require("./menu-CwoHmZYg.cjs"),ne=require("./login-BuwvcSrn.cjs"),re=require("./request-DRcIFNRO.cjs"),Q=require("./array-CIOBvBsr.cjs"),h=require("./cloneDeep-DER--uPX.cjs"),se=require("./crypto-CRbcEKIz.cjs");te.ref([]);const q=y=>{var t,s,c,f;const a=y;let n=[];a.compData=(t=a.compData)==null?void 0:t.filter(r=>(r==null?void 0:r.key)!=="tableContents"&&(r==null?void 0:r.key)!=="tableIndex");const e=(c=(s=h.cloneDeep(a.compData))==null?void 0:s.find(r=>(r==null?void 0:r.key)==="tableIndexColumn"))==null?void 0:c.contents;return(f=h.cloneDeep(a.compData))==null||f.forEach(r=>{if((r==null?void 0:r.key)!=="tableIndexColumn"&&(r==null?void 0:r.key)!=="header")n.push(r);else if((r==null?void 0:r.key)==="header"){let p=r.contents;e&&(p!=null&&p.every(o=>Array.isArray(o))?p==null||p[0].unshift({label:e}):p.unshift({label:e})),n.push({key:"header",contents:p})}}),a.compData=n,a},G=y=>{var s,c,f,r,p;const a=(s=y.compData)==null?void 0:s.filter(o=>(o==null?void 0:o.key)==="tableContents"||(o==null?void 0:o.key)==="tableIndex"),n=(f=(c=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableIndex"))==null?void 0:c.contents)==null?void 0:f.map(o=>o.label),e=(r=a==null?void 0:a.find(o=>(o==null?void 0:o.key)==="tableContents"))==null?void 0:r.contents;let t=[];return(n==null?void 0:n.length)>0&&(e!=null&&e.every(o=>Array.isArray(o)))?t=n==null?void 0:n.map((o,D)=>e[D]?[o,...e[D]]:[o]):Array.isArray(e==null?void 0:e[0])&&((p=e==null?void 0:e[0])!=null&&p.every(o=>Array.isArray(o)))?t=e==null?void 0:e[0]:Array.isArray(e==null?void 0:e[0])?t=e:t.push(e),t},oe=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>({label:t.label}))),e==null||e.forEach(t=>{t!=null&&t.children&&(t==null?void 0:t.children.length)>0&&n(t==null?void 0:t.children)}))}return n(y),a},ye=y=>{const a=[];function n(e,t=[]){!e||e.length===0||(a.push({key:t==null?void 0:t.filter(s=>!Array.isArray(s)),value:e}),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)),s)}))}return n(y),a},ce=y=>{const a=[];function n(e){!e||e.length===0||(a.push(e==null?void 0:e.map(t=>t==null?void 0:t.filter(s=>!Array.isArray(s)))),e==null||e.forEach(t=>{t!=null&&t.some(s=>Array.isArray(s))&&n(t.find(s=>Array.isArray(s)))}))}return n(y),a},pe=y=>{const a=[];function n(e){var t;!e||e.length===0||(e!=null&&e.every(s=>!Array.isArray(s))?a.push(e):(a.push((t=e==null?void 0:e.map(s=>s==null?void 0:s.filter(c=>!Array.isArray(c))))==null?void 0:t[0]),e==null||e.forEach(s=>{s!=null&&s.some(c=>Array.isArray(c))&&n(s.find(c=>Array.isArray(c)))})))}return n(y),a},le=(y,a)=>{let n;function e(t,s,c=1){var r;if(!t||t.length===0)return;const f=(r=h.cloneDeep(s))==null?void 0:r.map(p=>p==null?void 0:p.filter(o=>!Array.isArray(o)));return f!=null&&f.find(p=>Q.equalArrays(p,t==null?void 0:t.key))?(s==null||s.forEach(p=>{!e(t,p.find(D=>Array.isArray(D)))&&Q.equalArrays(p.filter(D=>!Array.isArray(D)),t==null?void 0:t.key)&&(n={type:c,contents:p.filter(D=>!Array.isArray(D))})}),!0):!1}return e(y,a,0),n},W=(y,a)=>{function n(e,t){return!e||e.length===0||e==null?void 0:e.map((c,f)=>{var p,o;let r=c;return r.unshift((p=t==null?void 0:t[f])==null?void 0:p.label),r.some(D=>Array.isArray(D))&&(r[r.length-1]=n(r.find(D=>Array.isArray(D)),(o=t==null?void 0:t[f])==null?void 0:o.children)),r})}return n(y,a)},z=y=>{var n,e,t,s,c,f,r,p,o,D,g,A,k,u,m,E,x,S,V,b,M,T,d,L,I;const a=y;if((y==null?void 0:y.comp)==="Table"){if((t=(e=(n=y.compData)==null?void 0:n.find(l=>(l==null?void 0:l.key)==="tableIndex"))==null?void 0:e.contents)!=null&&t.every(l=>!(l!=null&&l.children))||!((s=y.compData)!=null&&s.find(l=>(l==null?void 0:l.key)==="tableIndex")))return((r=(f=(c=a.compData)==null?void 0:c.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:f.contents)==null?void 0:r.length)===1&&((g=(D=(o=(p=a.compData)==null?void 0:p.find(l=>(l==null?void 0:l.key)==="tableContents"))==null?void 0:o.contents)==null?void 0:D[0])!=null&&g.every(l=>Array.isArray(l)))?(a.compData=(A=a.compData)==null?void 0:A.map(l=>{var C;return(l==null?void 0:l.key)==="tableContents"&&(l.contents=(C=l.contents)==null?void 0:C[0]),l}),[a]):[a];{let l=[];const C=a.compData,O=(k=h.cloneDeep(C))==null?void 0:k.find(i=>(i==null?void 0:i.key)==="tableIndexColumn"),N=(u=h.cloneDeep(C))==null?void 0:u.find(i=>(i==null?void 0:i.key)==="extraButton"),P=(m=h.cloneDeep(C))==null?void 0:m.find(i=>(i==null?void 0:i.key)==="rowButton"),w=pe((x=(E=h.cloneDeep(C))==null?void 0:E.find(i=>(i==null?void 0:i.key)==="header"))==null?void 0:x.contents),U=(S=h.cloneDeep(C))==null?void 0:S.find(i=>(i==null?void 0:i.key)==="tableIndex"),v=ce((b=(V=h.cloneDeep(C))==null?void 0:V.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:b.contents),ee=W((T=(M=h.cloneDeep(C))==null?void 0:M.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:T.contents,U==null?void 0:U.contents),ae=ye(W((L=(d=h.cloneDeep(C))==null?void 0:d.find(i=>(i==null?void 0:i.key)==="tableContents"))==null?void 0:L.contents,U==null?void 0:U.contents));if(U)return(I=oe(U.contents))==null||I.forEach((i,j)=>{var J;let B=[];B.push({key:"tableIndex",contents:i}),B.push(O),B.push(N),B.push(P),B.push({key:"tableContents",contents:v[j]}),B.push({key:"header",contents:w!=null&&w[j]?[w==null?void 0:w[j]]:[w==null?void 0:w[0]]}),l.push({comp:"Table",compData:B,name:"",parentTableContents:((J=le(ae[j],ee))==null?void 0:J.contents)??""})}),l}}else return[a]},X=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var f;Array.isArray(c)?c==null||c.forEach(r=>{var p;(p=z(h.cloneDeep(r)))==null||p.forEach(async o=>{var D,g,A,k;if(r.comp==="Table"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:{comp:(D=q(h.cloneDeep(o)))==null?void 0:D.comp,compData:(g=q(h.cloneDeep(o)))==null?void 0:g.compData,name:(A=q(h.cloneDeep(o)))==null?void 0:A.name}}}),m=u.data.result,E=await((k=G(h.cloneDeep(o)))==null?void 0:k.map(async x=>{var M;const S=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:m},value:{tableData:x}}),b=await((M=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",parentTable:x}})).data.result)==null?void 0:M.map(async T=>await K.updateInsofDataApi({id:T.id,key:{systemKey:T.key.systemKey,pageKey:T.key.pageKey,type:T.key.type,version:T.key.version,parentTable:S.data.result}})));return a.push(b),S}));a.push(u),a.push(E)}else if((o==null?void 0:o.key)==="extraButton"){const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:o.value}});a.push(u)}else{const u=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(o==null?void 0:o.parentTableContents)??""},value:{pageData:o}});a.push(u)}})}):(f=z(h.cloneDeep(c)))==null||f.forEach(async r=>{var p,o,D,g;if(c.comp==="Table"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:{comp:(p=q(h.cloneDeep(r)))==null?void 0:p.comp,compData:(o=q(h.cloneDeep(r)))==null?void 0:o.compData,name:(D=q(h.cloneDeep(r)))==null?void 0:D.name}}}),k=A.data.result,u=await((g=G(h.cloneDeep(r)))==null?void 0:g.map(async m=>{var V;const E=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"data",tableId:k},value:{tableData:m}}),S=await((V=(await K.getInsofDataApi({key:{parentTable:m,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure"}})).data.result)==null?void 0:V.map(async b=>await K.updateInsofDataApi({id:b.id,key:{systemKey:b.key.systemKey,pageKey:b.key.pageKey,type:b.key.type,version:b.key.version,parentTable:E.data.result}})));return a.push(S),E}));a.push(A),a.push(u)}else if((r==null?void 0:r.key)==="extraButton"){const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structureMethod",version:1},value:{pageData:r.value}});a.push(A)}else{const A=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"structure",version:1,parentTable:(r==null?void 0:r.parentTableContents)??""},value:{pageData:r}});a.push(A)}})})})}),await Promise.all(a)},Y=async y=>{let a=[];y==null||y.forEach(n=>{var e;(e=n.compData)==null||e.forEach(t=>{var s;(s=t.contents)==null||s.forEach(c=>{var r,p,o,D;const f=(p=(r=c==null?void 0:c.compData)==null?void 0:r.find(g=>(g==null?void 0:g.key)==="extra"))==null?void 0:p.value;(D=(o=c.compData)==null?void 0:o.filter(g=>(g==null?void 0:g.key)!=="extra"))==null||D.forEach(g=>{var A;(A=z(h.cloneDeep(g)))==null||A.forEach(async k=>{var u,m,E,x,S,V,b,M;if(k.comp==="Table"){const T=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method",version:1,methodName:(E=(u=n.name)==null?void 0:u.split("/"))==null?void 0:E[((m=n.name)==null?void 0:m.split("/").length)-1],methodKey:(x=Object.values(f[0]))==null?void 0:x[0],parentTable:(k==null?void 0:k.parentTableContents)??""},value:{pageData:{comp:(S=q(h.cloneDeep(k)))==null?void 0:S.comp,compData:(V=q(h.cloneDeep(k)))==null?void 0:V.compData,name:(b=q(h.cloneDeep(k)))==null?void 0:b.name}}}),d=T.data.result,L=await((M=G(h.cloneDeep(k)))==null?void 0:M.map(async I=>{var N,P;const l=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"methodData",methodKey:(N=Object.values(f[0]))==null?void 0:N[0],tableId:d},value:{tableData:I}}),O=(P=(await K.getInsofDataApi({key:{parentTable:I,systemKey:sessionStorage.getItem("systemKey"),pageKey:n.name,type:"method"}})).data.result)==null?void 0:P.map(async w=>await K.updateInsofDataApi({id:w.id,key:{systemKey:w.key.systemKey,pageKey:w.key.pageKey,type:w.key.type,methodKey:w.key.methodKey,parentTable:l.data.result}}));return a.push(O),l}));a.push(T),a.push(L)}})})})})}),await Promise.all(a)},ie=ne.useLoginState(re.pinia),{isStructureExist:ue}=R.storeToRefs(ie),fe=R.useMenuState(),F=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())!=="CALCULATOR"})),a.compData&&(a.compData=F(a.compData)),a)),H=y=>y==null?void 0:y.map(a=>(a.contents&&(a.contents=a.contents.filter(n=>{var e;return((e=n.comp)==null?void 0:e.toUpperCase())==="CALCULATOR"})),a.compData&&(a.compData=H(a.compData)),a)),Z=y=>{const a=H(y);let n=[];return a==null||a.forEach(e=>{var t;(t=e.compData)!=null&&t.find(s=>{var c;return(c=s==null?void 0:s.contents)==null?void 0:c.find(f=>(f==null?void 0:f.comp)==="calculator")})&&n.push(e)}),n},_=async y=>{var a,n,e,t;try{const s=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu",type:"structure"},value:{pageData:y}});if(((a=s==null?void 0:s.data)==null?void 0:a.code)===200){const c=(e=(n=y==null?void 0:y.compData)==null?void 0:n[0])==null?void 0:e.contents;fe.setRawMenus(c??[])}return(t=s==null?void 0:s.data)==null?void 0:t.code}catch(s){return Promise.reject(s)}},De=async()=>{var s,c,f,r,p,o;const y=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),a=K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),type:"structure"}}),n=await Promise.all([y,a]),e=n==null?void 0:n[0],t=n==null?void 0:n[1];return{menuExist:((s=e==null?void 0:e.data)==null?void 0:s.result)&&((f=(c=e==null?void 0:e.data)==null?void 0:c.result)==null?void 0:f.length)>0,structureExist:((r=t==null?void 0:t.data)==null?void 0:r.result)&&((o=(p=t==null?void 0:t.data)==null?void 0:p.result)==null?void 0:o.length)>0}},$=async()=>{var y;try{const a=se.generateKeyPair(),n=await K.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"},value:{cryptoInfo:{publicKey:a.publicKey,privateKey:a.privateKey}}});return((y=n==null?void 0:n.data)==null?void 0:y.code)===200}catch(a){throw a}},ge=async y=>{var t,s,c,f,r,p;const a=h.cloneDeep(y);console.log("savePageDataAsync",y,ue.value);const{menuExist:n,structureExist:e}=await De();if(console.log("promises",n,e),sessionStorage.getItem("systemKey")&&!n&&!e){const o=(t=F(a))==null?void 0:t.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}),D=a==null?void 0:a.find(g=>g.comp==="Menu");await _(D),$(),await X(o),await Y((s=Z(h.cloneDeep(y)))==null?void 0:s.filter(g=>{var A;return((A=g==null?void 0:g.comp)==null?void 0:A.toUpperCase())!=="MENU"}))}else{const D=(f=(c=(await K.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:c.filter(u=>{var m;return((m=u==null?void 0:u.key)==null?void 0:m.layer)!=="superAdmin"}))==null?void 0:f.map(u=>u.id),g=D==null?void 0:D.map(async u=>await K.deleteInsofDataApi({id:u}));await Promise.all(g);const A=(r=F(a))==null?void 0:r.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}),k=a==null?void 0:a.find(u=>u.comp==="Menu");await _(k),$(),await X(A),await Y((p=Z(h.cloneDeep(y)))==null?void 0:p.filter(u=>{var m;return((m=u==null?void 0:u.comp)==null?void 0:m.toUpperCase())!=="MENU"}))}};exports.savePageDataAsync=ge;
@@ -1,10 +1,10 @@
1
1
  import { ref as re } from "vue";
2
- import { c as C, g as N, u as F, d as ne } from "./index-CwZRdwOR.js";
3
- import { s as se, u as oe } from "./menu-C5E_B2Yb.js";
4
- import { u as ye } from "./login-l3-TQ4Nv.js";
5
- import { p as ce } from "./request-Dx56pt7_.js";
6
- import { d as Y } from "./array-Ci6eXFKY.js";
7
- import { c as m } from "./cloneDeep-CtBjgcpB.js";
2
+ import { c as C, g as N, u as F, d as ne } from "./index-d4ishmsH.js";
3
+ import { s as se, u as oe } from "./menu-C1zU-rc-.js";
4
+ import { u as ye } from "./login-DnO6sJwP.js";
5
+ import { p as ce } from "./request-EMSstqMr.js";
6
+ import { d as Y } from "./array-CnBDdPwL.js";
7
+ import { c as m } from "./cloneDeep-DMsBqhn5.js";
8
8
  import { g as le } from "./crypto-BRyGpjGR.js";
9
9
  re([]);
10
10
  const B = (y) => {
@@ -1 +1 @@
1
- "use strict";const o=require("vue"),L=require("./index-CORLgKVr.cjs"),m=require("./menu-DUn9J6ja.cjs"),U=require("./modelComp-C4S5aP2f.cjs"),j=require("vue-router"),k=require("./login-CCZDJWfU.cjs"),S=require("./cloneDeep-DqZ7vz8g.cjs"),g=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-OSlsRln2.cjs")));g.install=c=>{c.component("ssMenu",g)};const J={__name:"index",props:{name:String},setup(c){const d=c,a=o.computed(()=>L.ElIcons[d.name]);return o.onMounted(()=>{}),(M,A)=>{const f=o.resolveComponent("el-icon");return o.openBlock(),o.createBlock(f,null,{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(a.value)))]),_:1})}}},K=o.defineComponent({name:"menu",components:{ssMenu:g,DynamicIcon:J},setup(){const c=m.useMenuState(),d=U.useModelComp(),a=j.useRouter(),{rawMenus:M,menuTriggerType:A,permissionSideMenus:f}=m.storeToRefs(c);m.storeToRefs(d);const C=k.useLoginState(),{structureData:T}=m.storeToRefs(C),b=o.ref([]);let h;(e=>{e[e.Menu=0]="Menu",e[e.FolderOpened=1]="FolderOpened"})(h||(h={}));const D=e=>{let s=[],r=[];return e==null||e.forEach(n=>{s=v(n,r)}),s},v=(e,s)=>{const r=s,n=[];e==null||e.forEach(l=>{Array.isArray(l)?n.push({children:v(l,[])}):n.push({title:l})});let u=n.reduce((l,p)=>(Object.entries(p).forEach(([t,i])=>{l[t]===void 0?i!=null&&i.title?l[t]=[i]:l[t]=i:(Array.isArray(l[t])||(l[t]=[{title:l[t]}]),i!=null&&i.title||Array.isArray(i)?l[t].push(i):l[t].push({title:i}))}),l),{});return u=R(S.cloneDeep(u)),r.push(u),Array.isArray(r)&&(r==null?void 0:r.length)>1?r:r==null?void 0:r[0]},R=e=>{var s,r,n;return Array.isArray(e==null?void 0:e.title)&&((s=e==null?void 0:e.title)==null?void 0:s.length)===((n=(r=e==null?void 0:e.title)==null?void 0:r.filter(u=>u.title))==null?void 0:n.length)?e==null?void 0:e.title:Array.isArray(e==null?void 0:e.children)?q(e):e},q=e=>{var r;const s=e;return s.children=(r=s.children)==null?void 0:r.map(n=>{var u;return(u=n==null?void 0:n.title)!=null&&u.children?n==null?void 0:n.title:n}),s},_=(e,s="",r=0)=>{var p;let n,u=S.cloneDeep(e);const l=(p=T.value)==null?void 0:p.map(t=>{var i;return(i=t==null?void 0:t.key)==null?void 0:i.pageKey});return Array.isArray(u)||(u=[u]),n=u==null?void 0:u.map(t=>{const i=s?`${s}/${t.title}`:t.title,y={...t,path:i,level:r,show:!0,icon:h[`${r}`],carryData:l==null?void 0:l.includes(i),isPenultimate:!t.children};return t.children&&t.children.length>0&&(y.children=_(t.children,i,r+1)),y}),n},E=o.computed(()=>{let e=_(b.value);if((e==null?void 0:e.length)===0)return a.push("/"),[];const s=N(e,$.value);return s.isFlag?e=[...e,...f.value]:e=s==null?void 0:s.data,c.setMenus(e),e}),F=e=>{c.setMenuTriggerType("click"),c.setActiveMenuPath(e==null?void 0:e.path),e.isRouter?a.push(e.path):a.push("/")},P=e=>{A.value==="click"?c.setActiveMenuPath(e):c.setMenuTriggerType("click"),e!=null&&e.startsWith("/")?a.push(e):a.push("/")},B=e=>{c.setActiveMenuPath(e)},O=o.ref([{name:"--ssComponent-menu-bg",value:"#426ec4"},{name:"--ssComponent-submenu-hover-bg",value:"#00000033"},{name:"--ssComponent-submenu-open-bg",value:"#2DA0FF"},{name:"--ssComponent-submenu-open-inline-bg",value:"#1C4275"},{name:"--ssComponent-menuitem-hover-bg",value:"#1d7bef"},{name:"--ssComponent-menuitem-active-bg",value:"#1d7bef"}]),w=()=>{var s;const e=document.documentElement;(s=O.value)==null||s.forEach(r=>{e.style.setProperty(r.name,r.value)})};o.onMounted(()=>{});const $=o.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});o.watch(()=>M.value,e=>{if(e){const s=e;b.value=D(s)}else c.setActiveMenuPath("")},{immediate:!0});const I=(e,s)=>{function r(n){n==null||n.forEach(u=>{u.show=s==null?void 0:s.some(l=>l==null?void 0:l.includes(u.path)),u.children&&r(u.children)})}return r(e),e},N=(e,s)=>{if(Array.isArray(s)){const r=Array.from(new Set(s==null?void 0:s.map(n=>n.substring(0,n.lastIndexOf("/")))));return{data:I(e,r),isFlag:!1}}else return{isFlag:(s==null?void 0:s.toUpperCase())==="SUPERADMIN"}};return{renderMenuList:E,clickMenu:F,openMenu:P,closeMenu:B,changeMenuStyle:w}}});exports._sfc_main=K;
1
+ "use strict";const o=require("vue"),L=require("./index-Bd5g9LEC.cjs"),m=require("./menu-CwoHmZYg.cjs"),U=require("./modelComp-DH63MmzP.cjs"),j=require("vue-router"),k=require("./login-BuwvcSrn.cjs"),S=require("./cloneDeep-DER--uPX.cjs"),g=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BOy1bSzZ.cjs")));g.install=c=>{c.component("ssMenu",g)};const J={__name:"index",props:{name:String},setup(c){const d=c,a=o.computed(()=>L.ElIcons[d.name]);return o.onMounted(()=>{}),(M,A)=>{const f=o.resolveComponent("el-icon");return o.openBlock(),o.createBlock(f,null,{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(a.value)))]),_:1})}}},K=o.defineComponent({name:"menu",components:{ssMenu:g,DynamicIcon:J},setup(){const c=m.useMenuState(),d=U.useModelComp(),a=j.useRouter(),{rawMenus:M,menuTriggerType:A,permissionSideMenus:f}=m.storeToRefs(c);m.storeToRefs(d);const C=k.useLoginState(),{structureData:T}=m.storeToRefs(C),b=o.ref([]);let h;(e=>{e[e.Menu=0]="Menu",e[e.FolderOpened=1]="FolderOpened"})(h||(h={}));const D=e=>{let s=[],r=[];return e==null||e.forEach(n=>{s=v(n,r)}),s},v=(e,s)=>{const r=s,n=[];e==null||e.forEach(l=>{Array.isArray(l)?n.push({children:v(l,[])}):n.push({title:l})});let u=n.reduce((l,p)=>(Object.entries(p).forEach(([t,i])=>{l[t]===void 0?i!=null&&i.title?l[t]=[i]:l[t]=i:(Array.isArray(l[t])||(l[t]=[{title:l[t]}]),i!=null&&i.title||Array.isArray(i)?l[t].push(i):l[t].push({title:i}))}),l),{});return u=R(S.cloneDeep(u)),r.push(u),Array.isArray(r)&&(r==null?void 0:r.length)>1?r:r==null?void 0:r[0]},R=e=>{var s,r,n;return Array.isArray(e==null?void 0:e.title)&&((s=e==null?void 0:e.title)==null?void 0:s.length)===((n=(r=e==null?void 0:e.title)==null?void 0:r.filter(u=>u.title))==null?void 0:n.length)?e==null?void 0:e.title:Array.isArray(e==null?void 0:e.children)?q(e):e},q=e=>{var r;const s=e;return s.children=(r=s.children)==null?void 0:r.map(n=>{var u;return(u=n==null?void 0:n.title)!=null&&u.children?n==null?void 0:n.title:n}),s},_=(e,s="",r=0)=>{var p;let n,u=S.cloneDeep(e);const l=(p=T.value)==null?void 0:p.map(t=>{var i;return(i=t==null?void 0:t.key)==null?void 0:i.pageKey});return Array.isArray(u)||(u=[u]),n=u==null?void 0:u.map(t=>{const i=s?`${s}/${t.title}`:t.title,y={...t,path:i,level:r,show:!0,icon:h[`${r}`],carryData:l==null?void 0:l.includes(i),isPenultimate:!t.children};return t.children&&t.children.length>0&&(y.children=_(t.children,i,r+1)),y}),n},E=o.computed(()=>{let e=_(b.value);if((e==null?void 0:e.length)===0)return a.push("/"),[];const s=N(e,$.value);return s.isFlag?e=[...e,...f.value]:e=s==null?void 0:s.data,c.setMenus(e),e}),F=e=>{c.setMenuTriggerType("click"),c.setActiveMenuPath(e==null?void 0:e.path),e.isRouter?a.push(e.path):a.push("/")},P=e=>{A.value==="click"?c.setActiveMenuPath(e):c.setMenuTriggerType("click"),e!=null&&e.startsWith("/")?a.push(e):a.push("/")},B=e=>{c.setActiveMenuPath(e)},O=o.ref([{name:"--ssComponent-menu-bg",value:"#426ec4"},{name:"--ssComponent-submenu-hover-bg",value:"#00000033"},{name:"--ssComponent-submenu-open-bg",value:"#2DA0FF"},{name:"--ssComponent-submenu-open-inline-bg",value:"#1C4275"},{name:"--ssComponent-menuitem-hover-bg",value:"#1d7bef"},{name:"--ssComponent-menuitem-active-bg",value:"#1d7bef"}]),w=()=>{var s;const e=document.documentElement;(s=O.value)==null||s.forEach(r=>{e.style.setProperty(r.name,r.value)})};o.onMounted(()=>{});const $=o.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});o.watch(()=>M.value,e=>{if(e){const s=e;b.value=D(s)}else c.setActiveMenuPath("")},{immediate:!0});const I=(e,s)=>{function r(n){n==null||n.forEach(u=>{u.show=s==null?void 0:s.some(l=>l==null?void 0:l.includes(u.path)),u.children&&r(u.children)})}return r(e),e},N=(e,s)=>{if(Array.isArray(s)){const r=Array.from(new Set(s==null?void 0:s.map(n=>n.substring(0,n.lastIndexOf("/")))));return{data:I(e,r),isFlag:!1}}else return{isFlag:(s==null?void 0:s.toUpperCase())==="SUPERADMIN"}};return{renderMenuList:E,clickMenu:F,openMenu:P,closeMenu:B,changeMenuStyle:w}}});exports._sfc_main=K;
@@ -1,11 +1,11 @@
1
1
  import { defineAsyncComponent as W, computed as h, onMounted as T, resolveComponent as q, createBlock as v, openBlock as C, withCtx as z, resolveDynamicComponent as G, defineComponent as H, ref as E, watch as Q } from "vue";
2
- import { a as X } from "./index-B5pn4_ea.js";
3
- import { u as Y, s as d } from "./menu-C5E_B2Yb.js";
4
- import { u as Z } from "./modelComp-DV6uSzBz.js";
2
+ import { a as X } from "./index-DuqflGdi.js";
3
+ import { u as Y, s as d } from "./menu-C1zU-rc-.js";
4
+ import { u as Z } from "./modelComp-CUZjjNBE.js";
5
5
  import { useRouter as k } from "vue-router";
6
- import { u as V } from "./login-l3-TQ4Nv.js";
7
- import { c as F } from "./cloneDeep-CtBjgcpB.js";
8
- const g = W(() => import("./index-DVmX1hed.js"));
6
+ import { u as V } from "./login-DnO6sJwP.js";
7
+ import { c as F } from "./cloneDeep-DMsBqhn5.js";
8
+ const g = W(() => import("./index-xQOBDZGG.js"));
9
9
  g.install = (u) => {
10
10
  u.component("ssMenu", g);
11
11
  };
@@ -1 +1 @@
1
- "use strict";const i=require("./menu-DUn9J6ja.cjs"),c=require("./index-D9bMhrzO.cjs"),g=require("./request-DYjZLCB4.cjs");function a(t,s,r){for(const e of t){if(e[s]===r)return e;if(e.children&&e.children.length>0){const n=a(e.children,s,r);if(n)return n}}return null}function S(){const t=new Date,s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),e=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),u=String(t.getSeconds()).padStart(2,"0");return`${s}-${r}-${e} ${n}:${o}:${u}`}const d=i.useMenuState(g.pinia),{menus:f}=i.storeToRefs(d),p=i.defineStore("loginState",{state:()=>({superAdminInfo:{},loginUserInfo:{},structureData:[],isStructureExist:!1}),actions:{setSuperAdminInfo(t){this.superAdminInfo=t},setLoginUserInfo(t){this.loginUserInfo=t},setStructureData(t){this.structureData=t},setIsStructureExist(t){this.isStructureExist=t},async setLogRecordAsync(t,s,r="operate"){var e;try{const n=a(f.value,"path",s),o=await c.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"/log",type:"system",logType:r},value:{module:n?n.title:s,timeStamp:S(),data:t}});return((e=o==null?void 0:o.data)==null?void 0:e.code)===200}catch(n){i.ElMessage.error(n)}}},persist:[{key:"loginState",storage:localStorage,pick:["superAdminInfo"]}]});exports.useLoginState=p;
1
+ "use strict";const i=require("./menu-CwoHmZYg.cjs"),c=require("./index-t_aIEfXB.cjs"),g=require("./request-DRcIFNRO.cjs");function a(t,s,r){for(const e of t){if(e[s]===r)return e;if(e.children&&e.children.length>0){const n=a(e.children,s,r);if(n)return n}}return null}function S(){const t=new Date,s=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),e=String(t.getDate()).padStart(2,"0"),n=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),u=String(t.getSeconds()).padStart(2,"0");return`${s}-${r}-${e} ${n}:${o}:${u}`}const d=i.useMenuState(g.pinia),{menus:f}=i.storeToRefs(d),p=i.defineStore("loginState",{state:()=>({superAdminInfo:{},loginUserInfo:{},structureData:[],isStructureExist:!1}),actions:{setSuperAdminInfo(t){this.superAdminInfo=t},setLoginUserInfo(t){this.loginUserInfo=t},setStructureData(t){this.structureData=t},setIsStructureExist(t){this.isStructureExist=t},async setLogRecordAsync(t,s,r="operate"){var e;try{const n=a(f.value,"path",s),o=await c.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"/log",type:"system",logType:r},value:{module:n?n.title:s,timeStamp:S(),data:t}});return((e=o==null?void 0:o.data)==null?void 0:e.code)===200}catch(n){i.ElMessage.error(n)}}},persist:[{key:"loginState",storage:localStorage,pick:["superAdminInfo"]}]});exports.useLoginState=p;
@@ -1,6 +1,6 @@
1
- import { d as u, s as c, E as g, u as S } from "./menu-C5E_B2Yb.js";
2
- import { c as p } from "./index-CwZRdwOR.js";
3
- import { p as d } from "./request-Dx56pt7_.js";
1
+ import { d as u, s as c, E as g, u as S } from "./menu-C1zU-rc-.js";
2
+ import { c as p } from "./index-d4ishmsH.js";
3
+ import { p as d } from "./request-EMSstqMr.js";
4
4
  function a(t, n, r) {
5
5
  for (const e of t) {
6
6
  if (e[n] === r)
@@ -1,11 +1,11 @@
1
1
  import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as y, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, createVNode as A } from "vue";
2
- import { m as ie, a as me, b as de } from "./index-D_fwjS3z.js";
3
- import { p as E } from "./request-Dx56pt7_.js";
4
- import { u as ee } from "./modelComp-DV6uSzBz.js";
5
- import { s as te, u as fe } from "./menu-C5E_B2Yb.js";
6
- import { e as ye, g as ge, a as he } from "./array-Ci6eXFKY.js";
2
+ import { m as ie, a as me, b as de } from "./index-DP3w07QU.js";
3
+ import { p as E } from "./request-EMSstqMr.js";
4
+ import { u as ee } from "./modelComp-CUZjjNBE.js";
5
+ import { s as te, u as fe } from "./menu-C1zU-rc-.js";
6
+ import { e as ye, g as ge, a as he } from "./array-CnBDdPwL.js";
7
7
  import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- import { c as k } from "./cloneDeep-CtBjgcpB.js";
8
+ import { c as k } from "./cloneDeep-DMsBqhn5.js";
9
9
  const x = [
10
10
  {
11
11
  key: "FormName",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-BwGEUSpL.cjs"),T=require("./request-DYjZLCB4.cjs"),U=require("./modelComp-C4S5aP2f.cjs"),I=require("./menu-DUn9J6ja.cjs"),F=require("./array-jR-WStUM.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./cloneDeep-DqZ7vz8g.cjs"),b=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],ee={key:0,class:"show-content"},te={class:"item-view-group"},ne={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(j,{emit:E}){const t=j,D=E,g=U.useModelComp(T.pinia),{itemData:p}=I.storeToRefs(g),_=e.ref([]),C=e.ref([]),$=c=>{D("change",{wholeValue:_.value,editValue:c})},S=c=>{const k=h.cloneDeep(_.value),V=k==null?void 0:k.map((i,B)=>(B===(c==null?void 0:c.index)&&(i.compData=c==null?void 0:c.contents),i));_.value=V};e.watch(()=>p.value,()=>{var c;!p.value||((c=p.value)==null?void 0:c.length)===0||(C.value=p.value,_.value=p.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var k;if(((k=t==null?void 0:t.jsonContents)==null?void 0:k.length)>0){g.setOriginalData(t==null?void 0:t.jsonContents),g.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=F.expandStringToJson(t==null?void 0:t.content);g.setOriginalData(c),g.setItemData(c)},{deep:!0,immediate:!0});const N=c=>F.getComponent(c);return(c,k)=>{var V;return((V=C.value)==null?void 0:V.length)>0?(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(i,B)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:B},[e.createElementVNode("div",te,e.toDisplayString(i.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(i.comp)),{itemData:i==null?void 0:i.compData,childItemData:i==null?void 0:i.itemChildData,key:B,onChange:$,index:B,onContentChange:S},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},oe=X._export_sfc(ne,[["__scopeId","data-v-869e6e20"]]),ae={class:"add-model-content"},re={key:0,class:"model-import-data"},le={class:"import-button"},ce={key:0},se={key:1,class:"model-operate"},ue={class:"model-select"},ie={class:"model-fill"},de={key:2,class:"model-view ssComponent"},me={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(j,{emit:E}){const t=j,D=E,g=e.ref(""),p=e.ref([]),_=e.ref(0),C=U.useModelComp(T.pinia);I.useMenuState(T.pinia);const{itemData:$,originalData:S}=I.storeToRefs(C),N=e.ref(null),c=e.ref(0),k=e.ref(""),V=()=>{_.value=window.innerWidth},i=async r=>{var u;const a=(u=h.cloneDeep(r==null?void 0:r.wholeValue))==null?void 0:u.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(y=>((y==null?void 0:y.key)==="formContent"&&(y.contents=F.arrayToNumberArray(y==null?void 0:y.contents)),y))),o});D("change",{originalContents:S.value,currentContents:r==null?void 0:r.wholeValue,editContent:r==null?void 0:r.editValue,stringContent:B(h.cloneDeep(r==null?void 0:r.wholeValue)),arrayToContents:a})},B=r=>{var u;let a=[];return(u=h.cloneDeep(r))==null||u.forEach(o=>{var f,y;b!=null&&b.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=b==null?void 0:b.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(y=o==null?void 0:o.compData)==null||y.forEach(n=>{var q,J,A,M,R,L,z,W,H,P,G,K;if(s!=null&&s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))if(!((q=n==null?void 0:n.contents)!=null&&q.length))a.push(((J=s==null?void 0:s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))==null?void 0:J.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let d=(A=n==null?void 0:n.contents)==null?void 0:A[0];if(!d)return;if(Object.keys(d).includes("label")&&Object.keys(d).includes("key")&&Object.keys(d).includes("width"))if(((R=(M=n.contents)==null?void 0:M.filter(m=>m.width!==1))==null?void 0:R.length)===0){const m=(L=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:L.map(l=>({[l.label]:l.value}));a.push(((z=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:z.key)+"="+JSON.stringify(m)+"/r/n")}else{let m=[];(W=h.cloneDeep(n==null?void 0:n.contents))==null||W.reduce((l,x)=>{var Q;return l[x.label]=x.key,((Q=Object.keys(h.cloneDeep(l)))==null?void 0:Q.length)>=x.width&&(m.push(h.cloneDeep(l)),l={}),l},{}),a.push(((H=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(m)+"/r/n")}else if(Object.keys(d).includes("label")){const m=(P=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:P.map(l=>l.label);a.push(((G=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:G.key)+"="+JSON.stringify(m)+"/r/n")}else a.push(((K=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:K.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},w=e.ref([]),Y=()=>{N.value.click()},Z=r=>{const a=r.target.files[0];if(!a)return;const u=new FileReader;u.onload=o=>{try{g.value=o.target.result,w.value=v(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},u.onerror=o=>{console.error("文件读取错误:",o)},u.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",V)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{g.value=t==null?void 0:t.content,p.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var r;((r=w.value)==null?void 0:r.length)!==0&&(C.setOriginalData(w.value),C.setItemData(w.value))},{deep:!0,immediate:!0});const v=r=>{let a=r.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(u){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${u}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(r,a)=>{var u;return e.openBlock(),e.createElementBlock("div",ae,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",le,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:N,accept:".txt",onChange:Z,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:Y,class:"import-button-content"},"导入文件"),k.value?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(k.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",ue,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ie,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe,{content:g.value,onChange:i,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},fe=X._export_sfc(me,[["__scopeId","data-v-ceaf6f81"]]);exports.default=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index--ytG3uBV.cjs"),T=require("./request-DRcIFNRO.cjs"),U=require("./modelComp-DH63MmzP.cjs"),I=require("./menu-CwoHmZYg.cjs"),F=require("./array-CIOBvBsr.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./cloneDeep-DER--uPX.cjs"),b=[{key:"FormName",value:"Form"},{key:"TableName",value:"Table"}],s=[{key:"FormDirect",value:"formFlex"},{key:"Form",value:"formContent"},{key:"FormButton",value:"formButton"},{key:"TableColumns",value:"header"},{key:"TableButton",value:"extraButton"},{key:"LineButton",value:"rowButton"},{key:"Table",value:"tableContents"},{key:"TableIndex",value:"tableIndex"}],ee={key:0,class:"show-content"},te={class:"item-view-group"},ne={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(j,{emit:E}){const t=j,D=E,g=U.useModelComp(T.pinia),{itemData:p}=I.storeToRefs(g),_=e.ref([]),C=e.ref([]),$=c=>{D("change",{wholeValue:_.value,editValue:c})},S=c=>{const k=h.cloneDeep(_.value),V=k==null?void 0:k.map((i,B)=>(B===(c==null?void 0:c.index)&&(i.compData=c==null?void 0:c.contents),i));_.value=V};e.watch(()=>p.value,()=>{var c;!p.value||((c=p.value)==null?void 0:c.length)===0||(C.value=p.value,_.value=p.value)},{deep:!0,immediate:!0}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{var k;if(((k=t==null?void 0:t.jsonContents)==null?void 0:k.length)>0){g.setOriginalData(t==null?void 0:t.jsonContents),g.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=F.expandStringToJson(t==null?void 0:t.content);g.setOriginalData(c),g.setItemData(c)},{deep:!0,immediate:!0});const N=c=>F.getComponent(c);return(c,k)=>{var V;return((V=C.value)==null?void 0:V.length)>0?(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(i,B)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:B},[e.createElementVNode("div",te,e.toDisplayString(i.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(N(i.comp)),{itemData:i==null?void 0:i.compData,childItemData:i==null?void 0:i.itemChildData,key:B,onChange:$,index:B,onContentChange:S},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},oe=X._export_sfc(ne,[["__scopeId","data-v-869e6e20"]]),ae={class:"add-model-content"},re={key:0,class:"model-import-data"},le={class:"import-button"},ce={key:0},se={key:1,class:"model-operate"},ue={class:"model-select"},ie={class:"model-fill"},de={key:2,class:"model-view ssComponent"},me={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(j,{emit:E}){const t=j,D=E,g=e.ref(""),p=e.ref([]),_=e.ref(0),C=U.useModelComp(T.pinia);I.useMenuState(T.pinia);const{itemData:$,originalData:S}=I.storeToRefs(C),N=e.ref(null),c=e.ref(0),k=e.ref(""),V=()=>{_.value=window.innerWidth},i=async r=>{var u;const a=(u=h.cloneDeep(r==null?void 0:r.wholeValue))==null?void 0:u.map(o=>{var f;return(o==null?void 0:o.comp)==="Form"&&(o.compData=(f=o.compData)==null?void 0:f.map(y=>((y==null?void 0:y.key)==="formContent"&&(y.contents=F.arrayToNumberArray(y==null?void 0:y.contents)),y))),o});D("change",{originalContents:S.value,currentContents:r==null?void 0:r.wholeValue,editContent:r==null?void 0:r.editValue,stringContent:B(h.cloneDeep(r==null?void 0:r.wholeValue)),arrayToContents:a})},B=r=>{var u;let a=[];return(u=h.cloneDeep(r))==null||u.forEach(o=>{var f,y;b!=null&&b.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=b==null?void 0:b.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(y=o==null?void 0:o.compData)==null||y.forEach(n=>{var q,J,A,M,R,L,z,W,H,P,G,K;if(s!=null&&s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))if(!((q=n==null?void 0:n.contents)!=null&&q.length))a.push(((J=s==null?void 0:s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))==null?void 0:J.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let d=(A=n==null?void 0:n.contents)==null?void 0:A[0];if(!d)return;if(Object.keys(d).includes("label")&&Object.keys(d).includes("key")&&Object.keys(d).includes("width"))if(((R=(M=n.contents)==null?void 0:M.filter(m=>m.width!==1))==null?void 0:R.length)===0){const m=(L=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:L.map(l=>({[l.label]:l.value}));a.push(((z=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:z.key)+"="+JSON.stringify(m)+"/r/n")}else{let m=[];(W=h.cloneDeep(n==null?void 0:n.contents))==null||W.reduce((l,x)=>{var Q;return l[x.label]=x.key,((Q=Object.keys(h.cloneDeep(l)))==null?void 0:Q.length)>=x.width&&(m.push(h.cloneDeep(l)),l={}),l},{}),a.push(((H=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:H.key)+"="+JSON.stringify(m)+"/r/n")}else if(Object.keys(d).includes("label")){const m=(P=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:P.map(l=>l.label);a.push(((G=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:G.key)+"="+JSON.stringify(m)+"/r/n")}else a.push(((K=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:K.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},w=e.ref([]),Y=()=>{N.value.click()},Z=r=>{const a=r.target.files[0];if(!a)return;const u=new FileReader;u.onload=o=>{try{g.value=o.target.result,w.value=v(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},u.onerror=o=>{console.error("文件读取错误:",o)},u.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",V)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{g.value=t==null?void 0:t.content,p.value=t==null?void 0:t.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>c.value,()=>{var r;((r=w.value)==null?void 0:r.length)!==0&&(C.setOriginalData(w.value),C.setItemData(w.value))},{deep:!0,immediate:!0});const v=r=>{let a=r.replace(/,/g,",").replace(/;/g,";").replace(/:/g,":");a=a.replace(/(\w+)\s*:/g,"$1:"),a=a.replace(/\r\n/g,"").replace(/\n/g,"").replace(/\t/g,"").replace(/\s+/g," ").trim(),a=a.replace(/,\s*([}\]])/g,"$1"),a=a.replace(/:(\s*)([^"{}\[\],\s]+)(\s*)([,}])/g,": $2$4");try{return JSON.parse(a)}catch(u){try{const f=new Function(`return ${a}`)();if(Array.isArray(f)||typeof f=="object")return f;throw new Error(`解析结果不是有效的数组或对象: ${u}`)}catch(o){throw new Error(`无法解析JSON: ${o.message}`)}}};return(r,a)=>{var u;return e.openBlock(),e.createElementBlock("div",ae,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("div",le,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:N,accept:".txt",onChange:Z,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:Y,class:"import-button-content"},"导入文件"),k.value?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(k.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",se,[e.createElementVNode("div",ue,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ie,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(),e.createBlock(oe,{content:g.value,onChange:i,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},fe=X._export_sfc(me,[["__scopeId","data-v-ceaf6f81"]]);exports.default=fe;
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as Le, computed as z, createElementBlock as ct, openBlock as te, normalizeClass as ne, unref as T, renderSlot as Ze, createVNode as St, Transition as oo, withCtx as je, withDirectives as ro, createElementVNode as ft, normalizeStyle as so, createTextVNode as ir, toDisplayString as uo, vShow as io, watch as Qe, shallowReactive as ar, ref as le, onMounted as lr, createBlock as Ie, createCommentVNode as Me, resolveDynamicComponent as cr, Fragment as fr, withModifiers as dr, nextTick as dt, isVNode as ao, render as $t, effectScope as lo, markRaw as ce, toRaw as ve, isRef as ye, isReactive as et, toRef as He, hasInjectionContext as _r, inject as pr, getCurrentInstance as Er, reactive as hr, getCurrentScope as gr, onScopeDispose as mr, toRefs as jt } from "vue";
2
- import { j as Tt, m as Q, _ as co, A as vr, h as Ne, P as Ht, I as yr, a5 as Or, o as Ar, a6 as br, g as fo, n as Cr, Z as Sr, $ as zt, x as Tr, D as Dr, F as Kt, Y as Ir, a7 as kr, J as wr, k as Gt, z as _t, y as Pr, p as Nr, a8 as st, a9 as Rr } from "./index-B5pn4_ea.js";
2
+ import { j as Tt, m as Q, _ as co, A as vr, h as Ne, P as Ht, I as yr, a5 as Or, o as Ar, a6 as br, g as fo, n as Cr, Z as Sr, $ as zt, x as Tr, D as Dr, F as Kt, Y as Ir, a7 as kr, J as wr, k as Gt, z as _t, y as Pr, p as Nr, a8 as st, a9 as Rr } from "./index-DuqflGdi.js";
3
3
  import { m as Vr } from "./typescript-BpuhIBuJ.js";
4
4
  const xr = Tt({
5
5
  value: {