ss-component-new 1.1.270 → 1.1.271
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-DmpPM-Xx.js → array-BfnpXiM-.js} +2 -2
- package/dist/{array-Db10KHto.cjs → array-CAAZj70g.cjs} +1 -1
- package/dist/{cloneDeep-DkeOgjCh.cjs → cloneDeep-CHtsEohg.cjs} +1 -1
- package/dist/{cloneDeep-B4MHj5FZ.js → cloneDeep-SOoqD36w.js} +1 -1
- package/dist/{index-BZJLq_fH.cjs → index--1AcPtxr.cjs} +1 -1
- package/dist/{index-CDIPdZ_Y.js → index--Lkq8v3T.js} +8 -8
- package/dist/{index-zj0Hrw7t.js → index-2QYqjej5.js} +4 -4
- package/dist/{index-CMq96f-O.js → index-5LDLWHIy.js} +6 -6
- package/dist/{index-DIuZqFBZ.cjs → index-B1Chq5ou.cjs} +1 -1
- package/dist/{index-lp_G1uue.js → index-B6JYEmYH.js} +1 -1
- package/dist/{index-BkMiLEFK.cjs → index-B6UxWPf2.cjs} +1 -1
- package/dist/{index-Bb5x8AbH.cjs → index-B9MjTDBR.cjs} +3 -3
- package/dist/{index-BaElqGTx.js → index-BLUdgcs7.js} +4 -4
- package/dist/{index-55xYKcwl.js → index-BU_jy_oC.js} +4 -4
- package/dist/{index-CL1YKeuq.js → index-BZL2gPxk.js} +4 -4
- package/dist/{index-Cy8RHv5K.cjs → index-B_IOZlFF.cjs} +1 -1
- package/dist/{index-znOvK_AO.js → index-BiSiEi_V.js} +3 -3
- package/dist/{index-B6nT5wYe.js → index-BlraVBSm.js} +23 -17
- package/dist/{index-DaQZy16M.js → index-BrpCYKbJ.js} +3 -3
- package/dist/{index-PoQf0dIg.js → index-Bs_7jqc_.js} +4 -4
- package/dist/{index-C_iJIvVg.cjs → index-BtJs7zPy.cjs} +1 -1
- package/dist/{index-BvDfxOOy.js → index-Bv6C9j_1.js} +521 -519
- package/dist/{index-BYYo3eOD.js → index-CCG2WirR.js} +1 -1
- package/dist/{index-D79v5m65.js → index-CKr4swuH.js} +9 -9
- package/dist/{index-Bx1fzqvj.js → index-CMWo86wg.js} +6 -6
- package/dist/index-CT3w9uTX.cjs +1 -0
- package/dist/{index-BuichhBb.js → index-CTszrMtm.js} +1 -1
- package/dist/{index-PTS5PKTF.js → index-CV7IzaaJ.js} +1 -1
- package/dist/{index-PArL7spP.cjs → index-CWaLFgqI.cjs} +1 -1
- package/dist/{index-CXKFe21P.js → index-CY2ru0Sv.js} +6 -6
- package/dist/index-Ce42bIEI.cjs +1 -0
- package/dist/index-Cfo509W-.js +3699 -0
- package/dist/{index-DfL2avGj.js → index-Cfpx04I5.js} +5 -5
- package/dist/{index-YtcerPFO.js → index-Cn49cw0q.js} +3 -3
- package/dist/{index-DpS537wP.js → index-Ctv9BG9O.js} +5 -5
- package/dist/{index-Bd7gfI2v.js → index-D1gy0J05.js} +3 -3
- package/dist/index-D4VrAzy3.cjs +1 -0
- package/dist/{index-CBX-QmpE.cjs → index-D5DKfZge.cjs} +1 -1
- package/dist/{index-D_A6Fc0g.js → index-D8QUeWKa.js} +1 -1
- package/dist/{index-CFq1umIl.js → index-DD_rYKjc.js} +8 -8
- package/dist/{index-D66XoONa.cjs → index-DEBg_dvX.cjs} +1 -1
- package/dist/{index-BijggyAn.cjs → index-DGr6my-U.cjs} +1 -1
- package/dist/{index-D9PYtasT.cjs → index-DK3M5DNe.cjs} +1 -1
- package/dist/{index-Bw7gQ5uU.cjs → index-DPLoeqeZ.cjs} +1 -1
- package/dist/{index-e8O5n_hi.cjs → index-DRb5FND5.cjs} +1 -1
- package/dist/index-DVFD8nf7.js +720 -0
- package/dist/{index-BRrSmgDK.cjs → index-DVW3KqV7.cjs} +1 -1
- package/dist/{index-D-o0jcw9.cjs → index-DZiAN8C7.cjs} +1 -1
- package/dist/{index-PyfD9lQ8.cjs → index-DfsnGXGA.cjs} +1 -1
- package/dist/{index-lebc06DS.cjs → index-DpP0IpCV.cjs} +1 -1
- package/dist/{index-D4DsMBX6.cjs → index-Dp_b_DSL.cjs} +1 -1
- package/dist/{index-Cd702xPf.cjs → index-Dwsro7ML.cjs} +1 -1
- package/dist/{index-DnUm8SW3.js → index-H5uD67Jw.js} +8 -8
- package/dist/{index-CA-UQstP.cjs → index-KLWVgTQ4.cjs} +1 -1
- package/dist/{index-hTI4i8Pv.cjs → index-LVzE8vfl.cjs} +1 -1
- package/dist/{index-ClKqfaLg.js → index-UhoWjM51.js} +5 -5
- package/dist/{index-P_CmFusE.cjs → index-Uhv08fCW.cjs} +1 -1
- package/dist/{index-Bo8ScQ4u.cjs → index-cDR84dKn.cjs} +1 -1
- package/dist/{index-BRK6jNLF.cjs → index-uETWWPW0.cjs} +1 -1
- package/dist/{index-ChRZzUOg.cjs → index-y8UDVF_A.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-XBnvjf7F.js → index.vue_vue_type_script_setup_true_lang-5qTUg_kH.js} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-enez9t9L.cjs → index.vue_vue_type_script_setup_true_lang-rzTbe237.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-CRIFPWMG.js → index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-CJo8jVD1.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-BCmVnMkH.cjs → index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-CQLr1-WM.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_486b9e58_lang-D6l2J4zq.js → index.vue_vue_type_style_index_0_scoped_486b9e58_lang-DXhNv58U.js} +11 -11
- package/dist/{index.vue_vue_type_style_index_0_scoped_486b9e58_lang-I5TP4GD0.cjs → index.vue_vue_type_style_index_0_scoped_486b9e58_lang-fRjw_tf5.cjs} +1 -1
- package/dist/{login-BNsCdkNe.js → login-DHpGcqep.js} +2 -2
- package/dist/{login-Icl_CIYY.cjs → login-l_owbUQv.cjs} +1 -1
- package/dist/{main-BnGJ5061.js → main-B9XdzVwC.js} +7 -7
- package/dist/{main-CYWteBtf.cjs → main-D7g6IJOQ.cjs} +1 -1
- package/dist/{menu-BSnQCYha.js → menu-Ba_aVwCo.js} +1 -1
- package/dist/{menu-GGU1ld5H.cjs → menu-DHduXY8b.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +7 -7
- package/dist/ss-component3.cjs +1 -1
- package/dist/ss-component3.js +1 -1
- package/package.json +1 -1
- package/dist/index-4hO2HiRD.js +0 -3661
- package/dist/index-CMAqeGeT.cjs +0 -1
- package/dist/index-D4gX4eTX.js +0 -709
- package/dist/index-QSeosYrd.cjs +0 -1
- package/dist/index-sPXZdMVR.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const G=require("vue"),j=require("./menu-GGU1ld5H.cjs"),V=require("./index-Cy8RHv5K.cjs"),C=require("./cloneDeep-DkeOgjCh.cjs"),ne=require("./crypto-CRbcEKIz.cjs"),te=require("./index-Bo8ScQ4u.cjs"),le=require("./index-BRK6jNLF.cjs"),oe=require("./index-BRrSmgDK.cjs"),ue=require("./index-D4DsMBX6.cjs"),pe=require("./index-BijggyAn.cjs"),B=require("./array-Db10KHto.cjs"),H=require("./index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-BCmVnMkH.cjs"),ce=require("vue-router"),fe=require("./login-Icl_CIYY.cjs");G.ref([]);const Z=async s=>{let a=[];s==null||s.forEach(r=>{var n;(n=r.compData)==null||n.forEach(i=>{var t;(t=i.contents)==null||t.forEach(l=>{var o,y,h,S;const u=(y=(o=l==null?void 0:l.compData)==null?void 0:o.find(T=>(T==null?void 0:T.key)==="extra"))==null?void 0:y.value;(S=(h=l.compData)==null?void 0:h.filter(T=>(T==null?void 0:T.key)!=="extra"))==null||S.forEach(T=>{var R;(R=V.tableEveryContents(C.cloneDeep(T)))==null||R.forEach(async N=>{var k,O,q,A,c,L,g,_;if(N.comp==="Table"){const b=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"method",version:1,methodName:(q=(k=r.name)==null?void 0:k.split("/"))==null?void 0:q[((O=r.name)==null?void 0:O.split("/").length)-1],methodKey:(A=Object.values(u[0]))==null?void 0:A[0],parentTable:(N==null?void 0:N.parentTableContents)??""},value:{pageData:{comp:(c=V.tableToStruct(C.cloneDeep(N)))==null?void 0:c.comp,compData:(L=V.tableToStruct(C.cloneDeep(N)))==null?void 0:L.compData,name:(g=V.tableToStruct(C.cloneDeep(N)))==null?void 0:g.name}}}),f=b.data.result,$=await((_=V.tableToContents(C.cloneDeep(N)))==null?void 0:_.map(async J=>{var E,e;let P;J.length!==0&&(P=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"methodData",methodKey:(E=Object.values(u[0]))==null?void 0:E[0],tableId:f},value:{tableData:J}}));const F=(e=(await j.getInsofDataApi({key:{parentTable:J,systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"method"}})).data.result)==null?void 0:e.map(async p=>await j.updateInsofDataApi({id:p.id,key:{systemKey:p.key.systemKey,pageKey:p.key.pageKey,type:p.key.type,methodKey:p.key.methodKey,parentTable:P.data.result}}));return a.push(F),P}));a.push(b),a.push($)}})})})})}),await Promise.all(a)},ye=j.useMenuState(),W=s=>s==null?void 0:s.map(a=>(a.contents&&(a.contents=a.contents.filter(r=>{var n;return((n=r.comp)==null?void 0:n.toUpperCase())!=="CALCULATOR"})),a.compData&&(a.compData=W(a.compData)),a)),m=async s=>{var a,r,n,i,t,l,u,o,y,h,S,T,R,N,k,O,q,A,c,L;if(!s){const g=await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});if(((a=g==null?void 0:g.data)==null?void 0:a.code)===200&&(i=(n=(r=g==null?void 0:g.data)==null?void 0:r.result)==null?void 0:n[0])!=null&&i.id){const _=(l=(t=g==null?void 0:g.data)==null?void 0:t.result)==null?void 0:l[0],b=(y=(o=(u=g==null?void 0:g.data)==null?void 0:u.result)==null?void 0:o[0])==null?void 0:y.key;b.type="管理系统",await j.updateInsofDataApi({id:_==null?void 0:_.id,key:b})}return}try{const g=await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});if(((h=g==null?void 0:g.data)==null?void 0:h.code)===200&&(R=(T=(S=g==null?void 0:g.data)==null?void 0:S.result)==null?void 0:T[0])!=null&&R.id){const _=(k=(N=g==null?void 0:g.data)==null?void 0:N.result)==null?void 0:k[0],b=(A=(q=(O=g==null?void 0:g.data)==null?void 0:O.result)==null?void 0:q[0])==null?void 0:A.key;b.type=(L=(c=s==null?void 0:s[0])==null?void 0:c.contents)==null?void 0:L[0],await j.updateInsofDataApi({id:_==null?void 0:_.id,key:b})}}catch(g){return Promise.reject(g)}},re=s=>s==null?void 0:s.map(a=>(a.contents&&(a.contents=a.contents.filter(r=>{var n;return((n=r.comp)==null?void 0:n.toUpperCase())==="CALCULATOR"})),a.compData&&(a.compData=re(a.compData)),a)),I=s=>{const a=re(s);let r=[];return a==null||a.forEach(n=>{var i;(i=n.compData)!=null&&i.find(t=>{var l;return(l=t==null?void 0:t.contents)==null?void 0:l.find(u=>(u==null?void 0:u.comp)==="calculator")})&&r.push(n)}),r},ee=async s=>{var a,r,n,i;try{const t=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu",type:"structure"},value:{pageData:s}});if(((a=t==null?void 0:t.data)==null?void 0:a.code)===200){const l=(n=(r=s==null?void 0:s.compData)==null?void 0:r[0])==null?void 0:n.contents;ye.setRawMenus(l??[])}return(i=t==null?void 0:t.data)==null?void 0:i.code}catch(t){return Promise.reject(t)}},se=async()=>{var s;try{const a=ne.generateKeyPair(),r=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"},value:{cryptoInfo:{publicKey:a.publicKey,privateKey:a.privateKey}}});return((s=r==null?void 0:r.data)==null?void 0:s.code)===200}catch(a){throw a}},ie=async s=>{var i,t,l,u,o,y,h,S;let a=C.cloneDeep(s);a=[...a,te.tempUserPageData,le.tempRolePageData,oe.tempDeptPageData,ue.tempPostPageData];const{menuExist:r,structureExist:n}=await pe.verifyStructureDataToStore();if(sessionStorage.getItem("systemKey")&&!r&&!n){const T=(i=W(a))==null?void 0:i.filter(k=>{var O,q,A;return((O=k==null?void 0:k.comp)==null?void 0:O.toUpperCase())!=="MENU"&&((q=k==null?void 0:k.comp)==null?void 0:q.toUpperCase())!=="MENUTOP"&&((A=k==null?void 0:k.comp)==null?void 0:A.toUpperCase())!=="SYSTEM"}),R=a==null?void 0:a.find(k=>k.comp==="Menu"),N=(t=a==null?void 0:a.find(k=>k.comp==="System"))==null?void 0:t.compData;await ee(R),await m(N),se(),await V.conStructContents(T),await Z((l=I(C.cloneDeep(s)))==null?void 0:l.filter(k=>{var O;return((O=k==null?void 0:k.comp)==null?void 0:O.toUpperCase())!=="MENU"}))}else{const R=(o=(u=(await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:u.filter(A=>{var c;return((c=A==null?void 0:A.key)==null?void 0:c.layer)!=="superAdmin"}))==null?void 0:o.map(A=>A.id),N=R==null?void 0:R.map(async A=>await j.deleteInsofDataApi({id:A}));await Promise.all(N);const k=(y=W(a))==null?void 0:y.filter(A=>{var c,L,g;return((c=A==null?void 0:A.comp)==null?void 0:c.toUpperCase())!=="MENU"&&((L=A==null?void 0:A.comp)==null?void 0:L.toUpperCase())!=="MENUTOP"&&((g=A==null?void 0:A.comp)==null?void 0:g.toUpperCase())!=="SYSTEM"}),O=a==null?void 0:a.find(A=>A.comp==="Menu"),q=(h=a==null?void 0:a.find(A=>A.comp==="System"))==null?void 0:h.compData;await ee(O),await m(q),se(),await V.conStructContents(k),await Z((S=I(C.cloneDeep(s)))==null?void 0:S.filter(A=>{var c;return((c=A==null?void 0:A.comp)==null?void 0:c.toUpperCase())!=="MENU"}))}},ae=G.ref(0),Y=s=>{const a=[];let r=0,n="";for(;r<s.length;){const i=s[r];n=n+i,n[n.length-1]==="]"&&n[n.length-2]==="}"&&(a.push(n),n=""),r++}return a},ge=s=>{const a=[];let r=0,n="";for(;r<s.length;){const i=s[r];n=n+i,n[n.length]!=="["&&n[n.length-1]===","&&n[n.length-2]==="]"&&n[n.length-3]==="}"&&n[n.length-4]==="]"?(a.push(n),n=""):r===s.length-1&&a.push(n),r++}return a},he=s=>{let a="";return s==null||s.forEach((r,n)=>{n!==0&&(a=a+r)}),a},De=s=>(s==null?void 0:s.map(r=>{var n,i;return((n=B.contentTransArray(r))==null?void 0:n.length)!==0||((i=B.contentTransArray(r.slice(1,r.length)))==null?void 0:i.length)!==0})).every(r=>r===!0),Ae=(s,a)=>{var i;const r=[],n=a.length;return(i=C.cloneDeep(a))==null||i.forEach((t,l)=>{let u=[];t==null||t.forEach(o=>{var y,h,S,T,R,N,k,O,q,A,c,L,g,_;if(V.IsJson(s.replaceAll("'",'"')))(y=JSON.parse(s.replaceAll("'",'"')))==null||y.forEach(b=>{r.push([{key:o==null?void 0:o.key,value:(o==null?void 0:o.value)+"/"+b}])});else{u.push(o);let b;if(De(Y(s)))C.cloneDeep(Y(s)).length===1?b=C.cloneDeep(Y(s)):b=(h=C.cloneDeep(Y(s)))==null?void 0:h.map(f=>f.slice(1,f.length)),b=b==null?void 0:b.map(f=>{var F,E,e,p,D,M,K;const $=C.cloneDeep(f).slice(1,f.length-1),J=(F=C.cloneDeep($).split(":"))==null?void 0:F[0];let P="{"+((E=$.split("{"))==null?void 0:E[1]);P=C.cloneDeep(P).slice(1,P.length-1);let v=he(P.split(":"));if(V.IsJson(v.slice(0,v.length-1).replaceAll("'",'"'))||V.IsJson(v.replaceAll("'",'"'))){let d=V.IsJson(v.replaceAll("'",'"'))?JSON.parse(v.replaceAll("'",'"')):JSON.parse(v.slice(0,v.length-1).replaceAll("'",'"'));return{groupName:J.slice(1,J.length-1).includes("[")?"":J.slice(1,J.length-1),tableColumn:JSON.parse(((e=P.split(":"))==null?void 0:e[0]).replaceAll("'",'"')),tableContents:d}}else{const d=C.cloneDeep(f).slice(2,f.length-2),x=(p=d==null?void 0:d.replace(":","$S"))==null?void 0:p.split("$S"),w=(D=x==null?void 0:x[0])==null?void 0:D.replaceAll("'",'"'),U=(K=(M=x==null?void 0:x[1])==null?void 0:M.replaceAll("'",'"'))==null?void 0:K.replace(/\\/g,"\\\\");if(V.IsJson(w)&&V.IsJson(U))return{groupName:"",tableColumn:JSON.parse(w),tableContents:JSON.parse(U)}}}),n>1&&b.length===1?(u.push({key:"groupName",value:(S=b==null?void 0:b[0])==null?void 0:S.groupName}),u.push({key:"tableColumn",value:(T=b==null?void 0:b[0])==null?void 0:T.tableColumn}),u.push({key:"tableContents",value:[(N=(R=b==null?void 0:b[0])==null?void 0:R.tableContents)==null?void 0:N[l]]})):b==null||b.forEach(f=>{var J,P,v,F,E,e,p;let $;a.length===1?Array.isArray(f==null?void 0:f.tableContents)&&($=(J=f==null?void 0:f.tableContents)!=null&&J.every(D=>Array.isArray(D))?f==null?void 0:f.tableContents:[f==null?void 0:f.tableContents]):Array.isArray((P=f==null?void 0:f.tableContents)==null?void 0:P[l])?$=(F=(v=f==null?void 0:f.tableContents)==null?void 0:v[l])!=null&&F.every(D=>Array.isArray(D))?(E=f==null?void 0:f.tableContents)==null?void 0:E[l]:[(e=f==null?void 0:f.tableContents)==null?void 0:e[l]]:$=[[(p=f==null?void 0:f.tableContents)==null?void 0:p[l]]],u.push({key:"groupName",value:f==null?void 0:f.groupName}),u.push({key:"tableColumn",value:f==null?void 0:f.tableColumn}),u.push({key:"tableContents",value:$})});else{const f=s==null?void 0:s.slice(1,s.length-1),$=(O=(k=C.cloneDeep(f))==null?void 0:k.split(":"))==null?void 0:O[0],J=(L=(c=(A=(q=C.cloneDeep(f))==null?void 0:q.replace(":","$R"))==null?void 0:A.split("$R"))==null?void 0:c[1])==null?void 0:L.replaceAll("'",'"');V.IsJson(J==null?void 0:J.slice(1,J.length-1))?(u.push({key:"groupName",value:$==null?void 0:$.slice(1,$.length-1)}),u.push({key:"formContent",value:(g=JSON.parse(J==null?void 0:J.slice(1,J.length-1)))==null?void 0:g[l]})):(_=ge(f))==null||_.forEach(P=>{var e,p,D,M,K,d,x,w;const v=P.slice(1,P.length-2),F=(p=(e=C.cloneDeep(v))==null?void 0:e.split(":"))==null?void 0:p[0],E=(d=(K=(M=(D=C.cloneDeep(v))==null?void 0:D.replace(":","$R"))==null?void 0:M.split("$R"))==null?void 0:K[1])==null?void 0:d.replaceAll("'",'"');V.IsJson(E==null?void 0:E.slice(1,E.length-1))?(u.push({key:"groupName",value:F==null?void 0:F.slice(1,F.length-1)}),u.push({key:"formContent",value:(x=JSON.parse(E==null?void 0:E.slice(1,E.length-1)))==null?void 0:x[l]})):V.IsJson(E==null?void 0:E.slice(1,E.length))&&(u.push({key:"groupName",value:F==null?void 0:F.slice(1,F.length-1)}),u.push({key:"formContent",value:(w=JSON.parse(E==null?void 0:E.slice(1,E.length)))==null?void 0:w[l]}))})}r.push(u)}})}),r},Q=s=>{const a=[];let r=!1;return s.forEach(n=>{Array.isArray(n)&&(r=!0,n.forEach(i=>{const t=s.map(l=>l===n?i:l);a.push(...Q(t))}))}),r?a:[s]},be=s=>{var i,t;const a=(i=s.map(l=>{var o,y;let u=(y=(o=l.key.split("("))==null?void 0:o[1])==null?void 0:y.trim();return u==null?void 0:u.slice(0,u.length-1)}))==null?void 0:i.filter(l=>l),r=[];a==null||a.forEach(l=>{var y;const u=C.cloneDeep(l).replaceAll("{","").replaceAll("}","").trim();let o=[];u.split(":").forEach(h=>{var S;if(h.includes("[")){const T=(S=h.slice(1,h.length-1))==null?void 0:S.split(",");o.push(T)}else o.push(h)}),(y=Q(o))==null||y.forEach(h=>{r.push(h)})});const n=(t=r==null?void 0:r.filter(l=>l.length!==0))==null?void 0:t.map(l=>{let u="";return l.forEach(o=>{o.includes("{")||(u=u===""?u+C.cloneDeep(o):u+"/"+C.cloneDeep(o))}),u});return B.menuArray([...new Set(n)])},ke=s=>{var l,u;if(!s)return;let a=[];const r=B.getContentValue(s),n=C.cloneDeep(r).replaceAll("{","").replaceAll("}","").trim();let i=[];return n.split(":").forEach(o=>{var y;if(o.includes("[")){const h=(y=o.slice(1,o.length-1))==null?void 0:y.split(",");i.push(h)}else i.push(o)}),(l=Q(i))==null||l.forEach(o=>{a.push(o)}),(u=a==null?void 0:a.filter(o=>o.length!==0))==null?void 0:u.map(o=>{let y="";return o.forEach(h=>{h.includes("{")||(y=y===""?y+C.cloneDeep(h):y+"/"+C.cloneDeep(h))}),y})},Ce=s=>({comp:"MenuTop",compData:[{key:"menuContents",contents:JSON.parse(s==null?void 0:s.value.trim().replaceAll("'",'"'))}],name:""}),Me=s=>{const a=[],r=ke(s==null?void 0:s.key);return r&&(r==null?void 0:r.length)>0&&(r==null||r.forEach(i=>{a.push([{key:"contentPath",value:i}])})),Ae(s==null?void 0:s.value,a)},Se=s=>{const a=[];let r=[];return s==null||s.forEach((n,i)=>{var t;(r==null?void 0:r.length)===0?r.push(n):(r.push(n),((t=s[i+1])==null?void 0:t.key)==="groupName"&&(a.push(r),r=[]))}),a.push(r),a},de=s=>{var r;return(r=C.cloneDeep(s))==null?void 0:r.map(n=>{var l,u;let i=[];return(l=Se(n==null?void 0:n.filter(o=>(o==null?void 0:o.key)!=="contentPath")))==null||l.forEach(o=>{var S,T,R,N,k,O,q,A;let y=[];if(o.length===0)return;let h=Array.isArray((S=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:S.value)?(R=(T=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:T.value)==null?void 0:R.map(c=>({label:c})):[(N=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:N.value].map(c=>({label:c}));if(h=h==null?void 0:h.filter(c=>(c==null?void 0:c.label)!==void 0),h.length!==0&&h.push({label:"操作"}),o!=null&&o.find(c=>(c==null?void 0:c.key)==="formContent")){const c=(k=o.find(g=>(g==null?void 0:g.key)==="formContent"))==null?void 0:k.value;let L=[];c.forEach(g=>{g.forEach(_=>{var b,f;ae.value++,L.push({id:ae.value,key:(b=Object.keys(_))==null?void 0:b[0],value:(f=Object.values(_))==null?void 0:f[0],width:g.length})})}),y.push({key:"formFlex",contents:""}),y.push({key:"formContent",contents:L}),i.push({comp:"Form",compData:C.cloneDeep(y),name:(O=o.find(g=>(g==null?void 0:g.key)==="groupName"))==null?void 0:O.value})}h.length!==0&&(y.push({key:"header",contents:h}),y.push({key:"tableContents",contents:(q=o.find(c=>(c==null?void 0:c.key)==="tableContents"))==null?void 0:q.value}),y.push({key:"extraButton",contents:[{label:"新增"}]}),y.push({key:"rowButton",contents:[{label:"查看"},{label:"编辑"},{label:"删除"}]}),i.push({comp:"Table",compData:y,name:(A=o.find(c=>(c==null?void 0:c.key)==="groupName"))==null?void 0:A.value}))}),{comp:"Group",compData:[{key:"groupContents",contents:i}],name:(u=n==null?void 0:n.find(o=>(o==null?void 0:o.key)==="contentPath"))==null?void 0:u.value}})},Ee=s=>{var i;let a=[];a.push({comp:"Menu",compData:[{contents:be(C.cloneDeep(s)),key:"menuContents"}],name:""}),s!=null&&s.find(t=>{var l;return!((l=t==null?void 0:t.key)!=null&&l.includes("("))})&&((i=s==null?void 0:s.filter(t=>{var l;return!((l=t==null?void 0:t.key)!=null&&l.includes("("))}))==null||i.forEach(t=>{V.IsJson(t.value.replaceAll("'",'"'))&&Array.isArray(JSON.parse(t.value.replaceAll("'",'"')))?a.push(Ce(t)):a.push({comp:"System",compData:[{key:"type",contents:[t.value]}]})}));const r=s==null?void 0:s.filter(t=>{var l;return(l=t==null?void 0:t.key)==null?void 0:l.includes("(")}).map(t=>Me(t)).filter(t=>(t==null?void 0:t.length)!==0);let n=[];return r==null||r.forEach(t=>{t==null||t.forEach(l=>{n!=null&&n.find(u=>{var o,y;return((o=u==null?void 0:u.find(h=>(h==null?void 0:h.key)==="contentPath"))==null?void 0:o.value)===((y=l==null?void 0:l.find(h=>(h==null?void 0:h.key)==="contentPath"))==null?void 0:y.value)})?n=n==null?void 0:n.map(u=>{var y,h;return((y=u==null?void 0:u.find(S=>(S==null?void 0:S.key)==="contentPath"))==null?void 0:y.value)===((h=l==null?void 0:l.find(S=>(S==null?void 0:S.key)==="contentPath"))==null?void 0:h.value)&&(u=[...u,...l.filter(S=>(S==null?void 0:S.key)!=="contentPath")]),u}):n.push(l)})}),a=[...a,...de(n)],a},we=s=>{var i,t,l,u,o;const a=(l=B.contentTransArray((t=(i=C.cloneDeep(s))==null?void 0:i.replace("(","("))==null?void 0:t.replace(")",")")))==null?void 0:l.filter(y=>y!==""),r=(o=(u=C.cloneDeep(a))==null?void 0:u.filter(y=>!y.includes("/*")))==null?void 0:o.map(y=>B.parseGroupValue(y));return Ee(r)},Te=G.defineComponent({name:"menu",components:{ssMenu:H.ssMenu,DynamicIcon:H._sfc_main$1},setup(){const s=G.defineProps({mode:{type:String,default:"vertical"}}),a=G.ref("sub-menu-more"),r=j.useMenuState(),n=V.useModelComp(),i=G.ref(0),t=ce.useRouter(),{rawMenus:l,menuTriggerType:u,permissionSideMenus:o,platform:y}=j.storeToRefs(r);j.storeToRefs(n);const h=fe.useLoginState(),{structureData:S}=j.storeToRefs(h),T=G.ref([]),R=G.computed(()=>s==null?void 0:s.mode);let N;(e=>{e[e.Menu=0]="Menu",e[e.FolderOpened=1]="FolderOpened"})(N||(N={}));const k=e=>{let p=[],D=[];return e==null||e.forEach(M=>{p=O(M,D)}),p},O=(e,p)=>{const D=p,M=[];e==null||e.forEach(d=>{Array.isArray(d)?M.push({children:O(d,[])}):M.push({title:d})});let K=M.reduce((d,x)=>(Object.entries(x).forEach(([w,U])=>{d[w]===void 0?U!=null&&U.title?d[w]=[U]:d[w]=U:(Array.isArray(d[w])||(d[w]=[{title:d[w]}]),U!=null&&U.title||Array.isArray(U)?d[w].push(U):d[w].push({title:U}))}),d),{});return K=q(C.cloneDeep(K)),D.push(K),Array.isArray(D)&&(D==null?void 0:D.length)>1?D:D==null?void 0:D[0]},q=e=>{var p,D,M;return Array.isArray(e==null?void 0:e.title)&&((p=e==null?void 0:e.title)==null?void 0:p.length)===((M=(D=e==null?void 0:e.title)==null?void 0:D.filter(K=>K.title))==null?void 0:M.length)?e==null?void 0:e.title:Array.isArray(e==null?void 0:e.children)?A(e):e},A=e=>{var D;const p=e;return p.children=(D=p.children)==null?void 0:D.map(M=>{var K;return(K=M==null?void 0:M.title)!=null&&K.children?M==null?void 0:M.title:M}),p},c=e=>e==null?void 0:e.map(p=>p.children&&p.children.length>0?{...p,children:p.level===0?[]:p.children,childMenus:c(p.children)}:p),L=G.ref(["gongjianku","shebeiku","fangfaku","guocheng","Fold","Fold"]),g=(e,p)=>e===0?L.value[p]??"Fold":e===1?"wenjianjia":(console.log(123,e),"wenjian"),_=(e,p="",D=0)=>{var x;let M,K=C.cloneDeep(e);const d=(x=S.value)==null?void 0:x.map(w=>{var U;return(U=w==null?void 0:w.key)==null?void 0:U.pageKey});return Array.isArray(K)||(K=[K]),M=K==null?void 0:K.map((w,U)=>{const z=p?`${p}/${w.title}`:w.title,X={...w,path:z,level:D,show:!0,icon:g(D,U),carryData:d==null?void 0:d.includes(z),isPenultimate:!w.children};return w.children&&w.children.length>0&&(X.children=_(w.children,z,D+1)),X}),M},b=G.computed(()=>{let e=_(T.value);if(e=[...e,...o.value],(e==null?void 0:e.length)===0)return t.push("/"),[];const p=E(e,v.value);p.isFlag||(e=p==null?void 0:p.data);const D=c(e);return y.value==="client"?(r.setMenus(D),D):e}),f=async e=>{r.setMenuTriggerType("click"),y.value==="client"&&(e!=null&&e.childMenus)&&r.setAsideMenus(e==null?void 0:e.childMenus),e.isRouter?t.push(e.path):t.push("/")},$=e=>{u.value==="click"?i.value===1?r.setActiveMenuPath(sessionStorage.getItem("pageKey")):e!==a.value&&r.setActiveMenuPath(e):r.setMenuTriggerType("click"),e!=null&&e.startsWith("/")?t.push(e):t.push("/"),i.value++},J=e=>{e!==a.value&&r.setActiveMenuPath(e)},P=e=>{const p=document.documentElement;e==null||e.forEach(D=>{p.style.setProperty(D.name,D.value)})};G.onMounted(()=>{i.value=1});const v=G.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});G.watch(()=>y.value,e=>{e==="browser"?P(H.browserVerticalMenuClasses):e==="client"&&(P(H.clientHorizontalMenuClasses),P(H.clientVerticalMenuClasses))},{immediate:!0}),G.watch(()=>l.value,e=>{if(e){const p=e;T.value=k(p)}else r.setActiveMenuPath("")},{immediate:!0});const F=(e,p)=>{function D(M){M==null||M.forEach(K=>{K.show=p==null?void 0:p.some(d=>d==null?void 0:d.includes(K.path)),K.children&&D(K.children)})}return D(e),e},E=(e,p)=>{if(Array.isArray(p)){const D=Array.from(new Set(p==null?void 0:p.map(M=>M.substring(0,M.lastIndexOf("/")))));return{data:F(e,D),isFlag:!1}}else return{isFlag:(p==null?void 0:p.toUpperCase())==="SUPERADMIN"}};return{mode:R,renderMenuList:b,clickMenu:f,openMenu:$,closeMenu:J,changeMenuStyle:P}}});exports._sfc_main=Te;exports.expandToNewContents=we;exports.savePageDataAsync=ie;
|
|
1
|
+
"use strict";const G=require("vue"),j=require("./menu-DHduXY8b.cjs"),V=require("./index-B_IOZlFF.cjs"),C=require("./cloneDeep-CHtsEohg.cjs"),ne=require("./crypto-CRbcEKIz.cjs"),te=require("./index-cDR84dKn.cjs"),le=require("./index-uETWWPW0.cjs"),oe=require("./index-DVW3KqV7.cjs"),ue=require("./index-Dp_b_DSL.cjs"),pe=require("./index-DGr6my-U.cjs"),B=require("./array-CAAZj70g.cjs"),H=require("./index.vue_vue_type_style_index_0_scoped_0b9c1c43_lang-CQLr1-WM.cjs"),ce=require("vue-router"),fe=require("./login-l_owbUQv.cjs");G.ref([]);const Z=async s=>{let a=[];s==null||s.forEach(r=>{var n;(n=r.compData)==null||n.forEach(i=>{var t;(t=i.contents)==null||t.forEach(l=>{var o,y,h,S;const u=(y=(o=l==null?void 0:l.compData)==null?void 0:o.find(T=>(T==null?void 0:T.key)==="extra"))==null?void 0:y.value;(S=(h=l.compData)==null?void 0:h.filter(T=>(T==null?void 0:T.key)!=="extra"))==null||S.forEach(T=>{var R;(R=V.tableEveryContents(C.cloneDeep(T)))==null||R.forEach(async N=>{var k,O,q,A,c,L,g,_;if(N.comp==="Table"){const b=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"method",version:1,methodName:(q=(k=r.name)==null?void 0:k.split("/"))==null?void 0:q[((O=r.name)==null?void 0:O.split("/").length)-1],methodKey:(A=Object.values(u[0]))==null?void 0:A[0],parentTable:(N==null?void 0:N.parentTableContents)??""},value:{pageData:{comp:(c=V.tableToStruct(C.cloneDeep(N)))==null?void 0:c.comp,compData:(L=V.tableToStruct(C.cloneDeep(N)))==null?void 0:L.compData,name:(g=V.tableToStruct(C.cloneDeep(N)))==null?void 0:g.name}}}),f=b.data.result,$=await((_=V.tableToContents(C.cloneDeep(N)))==null?void 0:_.map(async J=>{var E,e;let P;J.length!==0&&(P=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"methodData",methodKey:(E=Object.values(u[0]))==null?void 0:E[0],tableId:f},value:{tableData:J}}));const F=(e=(await j.getInsofDataApi({key:{parentTable:J,systemKey:sessionStorage.getItem("systemKey"),pageKey:r.name,type:"method"}})).data.result)==null?void 0:e.map(async p=>await j.updateInsofDataApi({id:p.id,key:{systemKey:p.key.systemKey,pageKey:p.key.pageKey,type:p.key.type,methodKey:p.key.methodKey,parentTable:P.data.result}}));return a.push(F),P}));a.push(b),a.push($)}})})})})}),await Promise.all(a)},ye=j.useMenuState(),W=s=>s==null?void 0:s.map(a=>(a.contents&&(a.contents=a.contents.filter(r=>{var n;return((n=r.comp)==null?void 0:n.toUpperCase())!=="CALCULATOR"})),a.compData&&(a.compData=W(a.compData)),a)),m=async s=>{var a,r,n,i,t,l,u,o,y,h,S,T,R,N,k,O,q,A,c,L;if(!s){const g=await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});if(((a=g==null?void 0:g.data)==null?void 0:a.code)===200&&(i=(n=(r=g==null?void 0:g.data)==null?void 0:r.result)==null?void 0:n[0])!=null&&i.id){const _=(l=(t=g==null?void 0:g.data)==null?void 0:t.result)==null?void 0:l[0],b=(y=(o=(u=g==null?void 0:g.data)==null?void 0:u.result)==null?void 0:o[0])==null?void 0:y.key;b.type="管理系统",await j.updateInsofDataApi({id:_==null?void 0:_.id,key:b})}return}try{const g=await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),layer:"superAdmin"}});if(((h=g==null?void 0:g.data)==null?void 0:h.code)===200&&(R=(T=(S=g==null?void 0:g.data)==null?void 0:S.result)==null?void 0:T[0])!=null&&R.id){const _=(k=(N=g==null?void 0:g.data)==null?void 0:N.result)==null?void 0:k[0],b=(A=(q=(O=g==null?void 0:g.data)==null?void 0:O.result)==null?void 0:q[0])==null?void 0:A.key;b.type=(L=(c=s==null?void 0:s[0])==null?void 0:c.contents)==null?void 0:L[0],await j.updateInsofDataApi({id:_==null?void 0:_.id,key:b})}}catch(g){return Promise.reject(g)}},re=s=>s==null?void 0:s.map(a=>(a.contents&&(a.contents=a.contents.filter(r=>{var n;return((n=r.comp)==null?void 0:n.toUpperCase())==="CALCULATOR"})),a.compData&&(a.compData=re(a.compData)),a)),I=s=>{const a=re(s);let r=[];return a==null||a.forEach(n=>{var i;(i=n.compData)!=null&&i.find(t=>{var l;return(l=t==null?void 0:t.contents)==null?void 0:l.find(u=>(u==null?void 0:u.comp)==="calculator")})&&r.push(n)}),r},ee=async s=>{var a,r,n,i;try{const t=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu",type:"structure"},value:{pageData:s}});if(((a=t==null?void 0:t.data)==null?void 0:a.code)===200){const l=(n=(r=s==null?void 0:s.compData)==null?void 0:r[0])==null?void 0:n.contents;ye.setRawMenus(l??[])}return(i=t==null?void 0:t.data)==null?void 0:i.code}catch(t){return Promise.reject(t)}},se=async()=>{var s;try{const a=ne.generateKeyPair(),r=await j.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"},value:{cryptoInfo:{publicKey:a.publicKey,privateKey:a.privateKey}}});return((s=r==null?void 0:r.data)==null?void 0:s.code)===200}catch(a){throw a}},ie=async s=>{var i,t,l,u,o,y,h,S;let a=C.cloneDeep(s);a=[...a,te.tempUserPageData,le.tempRolePageData,oe.tempDeptPageData,ue.tempPostPageData];const{menuExist:r,structureExist:n}=await pe.verifyStructureDataToStore();if(sessionStorage.getItem("systemKey")&&!r&&!n){const T=(i=W(a))==null?void 0:i.filter(k=>{var O,q,A;return((O=k==null?void 0:k.comp)==null?void 0:O.toUpperCase())!=="MENU"&&((q=k==null?void 0:k.comp)==null?void 0:q.toUpperCase())!=="MENUTOP"&&((A=k==null?void 0:k.comp)==null?void 0:A.toUpperCase())!=="SYSTEM"}),R=a==null?void 0:a.find(k=>k.comp==="Menu"),N=(t=a==null?void 0:a.find(k=>k.comp==="System"))==null?void 0:t.compData;await ee(R),await m(N),se(),await V.conStructContents(T),await Z((l=I(C.cloneDeep(s)))==null?void 0:l.filter(k=>{var O;return((O=k==null?void 0:k.comp)==null?void 0:O.toUpperCase())!=="MENU"}))}else{const R=(o=(u=(await j.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey")}})).data.result)==null?void 0:u.filter(A=>{var c;return((c=A==null?void 0:A.key)==null?void 0:c.layer)!=="superAdmin"}))==null?void 0:o.map(A=>A.id),N=R==null?void 0:R.map(async A=>await j.deleteInsofDataApi({id:A}));await Promise.all(N);const k=(y=W(a))==null?void 0:y.filter(A=>{var c,L,g;return((c=A==null?void 0:A.comp)==null?void 0:c.toUpperCase())!=="MENU"&&((L=A==null?void 0:A.comp)==null?void 0:L.toUpperCase())!=="MENUTOP"&&((g=A==null?void 0:A.comp)==null?void 0:g.toUpperCase())!=="SYSTEM"}),O=a==null?void 0:a.find(A=>A.comp==="Menu"),q=(h=a==null?void 0:a.find(A=>A.comp==="System"))==null?void 0:h.compData;await ee(O),await m(q),se(),await V.conStructContents(k),await Z((S=I(C.cloneDeep(s)))==null?void 0:S.filter(A=>{var c;return((c=A==null?void 0:A.comp)==null?void 0:c.toUpperCase())!=="MENU"}))}},ae=G.ref(0),Y=s=>{const a=[];let r=0,n="";for(;r<s.length;){const i=s[r];n=n+i,n[n.length-1]==="]"&&n[n.length-2]==="}"&&(a.push(n),n=""),r++}return a},ge=s=>{const a=[];let r=0,n="";for(;r<s.length;){const i=s[r];n=n+i,n[n.length]!=="["&&n[n.length-1]===","&&n[n.length-2]==="]"&&n[n.length-3]==="}"&&n[n.length-4]==="]"?(a.push(n),n=""):r===s.length-1&&a.push(n),r++}return a},he=s=>{let a="";return s==null||s.forEach((r,n)=>{n!==0&&(a=a+r)}),a},De=s=>(s==null?void 0:s.map(r=>{var n,i;return((n=B.contentTransArray(r))==null?void 0:n.length)!==0||((i=B.contentTransArray(r.slice(1,r.length)))==null?void 0:i.length)!==0})).every(r=>r===!0),Ae=(s,a)=>{var i;const r=[],n=a.length;return(i=C.cloneDeep(a))==null||i.forEach((t,l)=>{let u=[];t==null||t.forEach(o=>{var y,h,S,T,R,N,k,O,q,A,c,L,g,_;if(V.IsJson(s.replaceAll("'",'"')))(y=JSON.parse(s.replaceAll("'",'"')))==null||y.forEach(b=>{r.push([{key:o==null?void 0:o.key,value:(o==null?void 0:o.value)+"/"+b}])});else{u.push(o);let b;if(De(Y(s)))C.cloneDeep(Y(s)).length===1?b=C.cloneDeep(Y(s)):b=(h=C.cloneDeep(Y(s)))==null?void 0:h.map(f=>f.slice(1,f.length)),b=b==null?void 0:b.map(f=>{var F,E,e,p,D,M,K;const $=C.cloneDeep(f).slice(1,f.length-1),J=(F=C.cloneDeep($).split(":"))==null?void 0:F[0];let P="{"+((E=$.split("{"))==null?void 0:E[1]);P=C.cloneDeep(P).slice(1,P.length-1);let v=he(P.split(":"));if(V.IsJson(v.slice(0,v.length-1).replaceAll("'",'"'))||V.IsJson(v.replaceAll("'",'"'))){let d=V.IsJson(v.replaceAll("'",'"'))?JSON.parse(v.replaceAll("'",'"')):JSON.parse(v.slice(0,v.length-1).replaceAll("'",'"'));return{groupName:J.slice(1,J.length-1).includes("[")?"":J.slice(1,J.length-1),tableColumn:JSON.parse(((e=P.split(":"))==null?void 0:e[0]).replaceAll("'",'"')),tableContents:d}}else{const d=C.cloneDeep(f).slice(2,f.length-2),x=(p=d==null?void 0:d.replace(":","$S"))==null?void 0:p.split("$S"),w=(D=x==null?void 0:x[0])==null?void 0:D.replaceAll("'",'"'),U=(K=(M=x==null?void 0:x[1])==null?void 0:M.replaceAll("'",'"'))==null?void 0:K.replace(/\\/g,"\\\\");if(V.IsJson(w)&&V.IsJson(U))return{groupName:"",tableColumn:JSON.parse(w),tableContents:JSON.parse(U)}}}),n>1&&b.length===1?(u.push({key:"groupName",value:(S=b==null?void 0:b[0])==null?void 0:S.groupName}),u.push({key:"tableColumn",value:(T=b==null?void 0:b[0])==null?void 0:T.tableColumn}),u.push({key:"tableContents",value:[(N=(R=b==null?void 0:b[0])==null?void 0:R.tableContents)==null?void 0:N[l]]})):b==null||b.forEach(f=>{var J,P,v,F,E,e,p;let $;a.length===1?Array.isArray(f==null?void 0:f.tableContents)&&($=(J=f==null?void 0:f.tableContents)!=null&&J.every(D=>Array.isArray(D))?f==null?void 0:f.tableContents:[f==null?void 0:f.tableContents]):Array.isArray((P=f==null?void 0:f.tableContents)==null?void 0:P[l])?$=(F=(v=f==null?void 0:f.tableContents)==null?void 0:v[l])!=null&&F.every(D=>Array.isArray(D))?(E=f==null?void 0:f.tableContents)==null?void 0:E[l]:[(e=f==null?void 0:f.tableContents)==null?void 0:e[l]]:$=[[(p=f==null?void 0:f.tableContents)==null?void 0:p[l]]],u.push({key:"groupName",value:f==null?void 0:f.groupName}),u.push({key:"tableColumn",value:f==null?void 0:f.tableColumn}),u.push({key:"tableContents",value:$})});else{const f=s==null?void 0:s.slice(1,s.length-1),$=(O=(k=C.cloneDeep(f))==null?void 0:k.split(":"))==null?void 0:O[0],J=(L=(c=(A=(q=C.cloneDeep(f))==null?void 0:q.replace(":","$R"))==null?void 0:A.split("$R"))==null?void 0:c[1])==null?void 0:L.replaceAll("'",'"');V.IsJson(J==null?void 0:J.slice(1,J.length-1))?(u.push({key:"groupName",value:$==null?void 0:$.slice(1,$.length-1)}),u.push({key:"formContent",value:(g=JSON.parse(J==null?void 0:J.slice(1,J.length-1)))==null?void 0:g[l]})):(_=ge(f))==null||_.forEach(P=>{var e,p,D,M,K,d,x,w;const v=P.slice(1,P.length-2),F=(p=(e=C.cloneDeep(v))==null?void 0:e.split(":"))==null?void 0:p[0],E=(d=(K=(M=(D=C.cloneDeep(v))==null?void 0:D.replace(":","$R"))==null?void 0:M.split("$R"))==null?void 0:K[1])==null?void 0:d.replaceAll("'",'"');V.IsJson(E==null?void 0:E.slice(1,E.length-1))?(u.push({key:"groupName",value:F==null?void 0:F.slice(1,F.length-1)}),u.push({key:"formContent",value:(x=JSON.parse(E==null?void 0:E.slice(1,E.length-1)))==null?void 0:x[l]})):V.IsJson(E==null?void 0:E.slice(1,E.length))&&(u.push({key:"groupName",value:F==null?void 0:F.slice(1,F.length-1)}),u.push({key:"formContent",value:(w=JSON.parse(E==null?void 0:E.slice(1,E.length)))==null?void 0:w[l]}))})}r.push(u)}})}),r},Q=s=>{const a=[];let r=!1;return s.forEach(n=>{Array.isArray(n)&&(r=!0,n.forEach(i=>{const t=s.map(l=>l===n?i:l);a.push(...Q(t))}))}),r?a:[s]},be=s=>{var i,t;const a=(i=s.map(l=>{var o,y;let u=(y=(o=l.key.split("("))==null?void 0:o[1])==null?void 0:y.trim();return u==null?void 0:u.slice(0,u.length-1)}))==null?void 0:i.filter(l=>l),r=[];a==null||a.forEach(l=>{var y;const u=C.cloneDeep(l).replaceAll("{","").replaceAll("}","").trim();let o=[];u.split(":").forEach(h=>{var S;if(h.includes("[")){const T=(S=h.slice(1,h.length-1))==null?void 0:S.split(",");o.push(T)}else o.push(h)}),(y=Q(o))==null||y.forEach(h=>{r.push(h)})});const n=(t=r==null?void 0:r.filter(l=>l.length!==0))==null?void 0:t.map(l=>{let u="";return l.forEach(o=>{o.includes("{")||(u=u===""?u+C.cloneDeep(o):u+"/"+C.cloneDeep(o))}),u});return B.menuArray([...new Set(n)])},ke=s=>{var l,u;if(!s)return;let a=[];const r=B.getContentValue(s),n=C.cloneDeep(r).replaceAll("{","").replaceAll("}","").trim();let i=[];return n.split(":").forEach(o=>{var y;if(o.includes("[")){const h=(y=o.slice(1,o.length-1))==null?void 0:y.split(",");i.push(h)}else i.push(o)}),(l=Q(i))==null||l.forEach(o=>{a.push(o)}),(u=a==null?void 0:a.filter(o=>o.length!==0))==null?void 0:u.map(o=>{let y="";return o.forEach(h=>{h.includes("{")||(y=y===""?y+C.cloneDeep(h):y+"/"+C.cloneDeep(h))}),y})},Ce=s=>({comp:"MenuTop",compData:[{key:"menuContents",contents:JSON.parse(s==null?void 0:s.value.trim().replaceAll("'",'"'))}],name:""}),Me=s=>{const a=[],r=ke(s==null?void 0:s.key);return r&&(r==null?void 0:r.length)>0&&(r==null||r.forEach(i=>{a.push([{key:"contentPath",value:i}])})),Ae(s==null?void 0:s.value,a)},Se=s=>{const a=[];let r=[];return s==null||s.forEach((n,i)=>{var t;(r==null?void 0:r.length)===0?r.push(n):(r.push(n),((t=s[i+1])==null?void 0:t.key)==="groupName"&&(a.push(r),r=[]))}),a.push(r),a},de=s=>{var r;return(r=C.cloneDeep(s))==null?void 0:r.map(n=>{var l,u;let i=[];return(l=Se(n==null?void 0:n.filter(o=>(o==null?void 0:o.key)!=="contentPath")))==null||l.forEach(o=>{var S,T,R,N,k,O,q,A;let y=[];if(o.length===0)return;let h=Array.isArray((S=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:S.value)?(R=(T=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:T.value)==null?void 0:R.map(c=>({label:c})):[(N=o.find(c=>(c==null?void 0:c.key)==="tableColumn"))==null?void 0:N.value].map(c=>({label:c}));if(h=h==null?void 0:h.filter(c=>(c==null?void 0:c.label)!==void 0),h.length!==0&&h.push({label:"操作"}),o!=null&&o.find(c=>(c==null?void 0:c.key)==="formContent")){const c=(k=o.find(g=>(g==null?void 0:g.key)==="formContent"))==null?void 0:k.value;let L=[];c.forEach(g=>{g.forEach(_=>{var b,f;ae.value++,L.push({id:ae.value,key:(b=Object.keys(_))==null?void 0:b[0],value:(f=Object.values(_))==null?void 0:f[0],width:g.length})})}),y.push({key:"formFlex",contents:""}),y.push({key:"formContent",contents:L}),i.push({comp:"Form",compData:C.cloneDeep(y),name:(O=o.find(g=>(g==null?void 0:g.key)==="groupName"))==null?void 0:O.value})}h.length!==0&&(y.push({key:"header",contents:h}),y.push({key:"tableContents",contents:(q=o.find(c=>(c==null?void 0:c.key)==="tableContents"))==null?void 0:q.value}),y.push({key:"extraButton",contents:[{label:"新增"}]}),y.push({key:"rowButton",contents:[{label:"查看"},{label:"编辑"},{label:"删除"}]}),i.push({comp:"Table",compData:y,name:(A=o.find(c=>(c==null?void 0:c.key)==="groupName"))==null?void 0:A.value}))}),{comp:"Group",compData:[{key:"groupContents",contents:i}],name:(u=n==null?void 0:n.find(o=>(o==null?void 0:o.key)==="contentPath"))==null?void 0:u.value}})},Ee=s=>{var i;let a=[];a.push({comp:"Menu",compData:[{contents:be(C.cloneDeep(s)),key:"menuContents"}],name:""}),s!=null&&s.find(t=>{var l;return!((l=t==null?void 0:t.key)!=null&&l.includes("("))})&&((i=s==null?void 0:s.filter(t=>{var l;return!((l=t==null?void 0:t.key)!=null&&l.includes("("))}))==null||i.forEach(t=>{V.IsJson(t.value.replaceAll("'",'"'))&&Array.isArray(JSON.parse(t.value.replaceAll("'",'"')))?a.push(Ce(t)):a.push({comp:"System",compData:[{key:"type",contents:[t.value]}]})}));const r=s==null?void 0:s.filter(t=>{var l;return(l=t==null?void 0:t.key)==null?void 0:l.includes("(")}).map(t=>Me(t)).filter(t=>(t==null?void 0:t.length)!==0);let n=[];return r==null||r.forEach(t=>{t==null||t.forEach(l=>{n!=null&&n.find(u=>{var o,y;return((o=u==null?void 0:u.find(h=>(h==null?void 0:h.key)==="contentPath"))==null?void 0:o.value)===((y=l==null?void 0:l.find(h=>(h==null?void 0:h.key)==="contentPath"))==null?void 0:y.value)})?n=n==null?void 0:n.map(u=>{var y,h;return((y=u==null?void 0:u.find(S=>(S==null?void 0:S.key)==="contentPath"))==null?void 0:y.value)===((h=l==null?void 0:l.find(S=>(S==null?void 0:S.key)==="contentPath"))==null?void 0:h.value)&&(u=[...u,...l.filter(S=>(S==null?void 0:S.key)!=="contentPath")]),u}):n.push(l)})}),a=[...a,...de(n)],a},we=s=>{var i,t,l,u,o;const a=(l=B.contentTransArray((t=(i=C.cloneDeep(s))==null?void 0:i.replace("(","("))==null?void 0:t.replace(")",")")))==null?void 0:l.filter(y=>y!==""),r=(o=(u=C.cloneDeep(a))==null?void 0:u.filter(y=>!y.includes("/*")))==null?void 0:o.map(y=>B.parseGroupValue(y));return Ee(r)},Te=G.defineComponent({name:"menu",components:{ssMenu:H.ssMenu,DynamicIcon:H._sfc_main$1},setup(){const s=G.defineProps({mode:{type:String,default:"vertical"}}),a=G.ref("sub-menu-more"),r=j.useMenuState(),n=V.useModelComp(),i=G.ref(0),t=ce.useRouter(),{rawMenus:l,menuTriggerType:u,permissionSideMenus:o,platform:y}=j.storeToRefs(r);j.storeToRefs(n);const h=fe.useLoginState(),{structureData:S}=j.storeToRefs(h),T=G.ref([]),R=G.computed(()=>s==null?void 0:s.mode);let N;(e=>{e[e.Menu=0]="Menu",e[e.FolderOpened=1]="FolderOpened"})(N||(N={}));const k=e=>{let p=[],D=[];return e==null||e.forEach(M=>{p=O(M,D)}),p},O=(e,p)=>{const D=p,M=[];e==null||e.forEach(d=>{Array.isArray(d)?M.push({children:O(d,[])}):M.push({title:d})});let K=M.reduce((d,x)=>(Object.entries(x).forEach(([w,U])=>{d[w]===void 0?U!=null&&U.title?d[w]=[U]:d[w]=U:(Array.isArray(d[w])||(d[w]=[{title:d[w]}]),U!=null&&U.title||Array.isArray(U)?d[w].push(U):d[w].push({title:U}))}),d),{});return K=q(C.cloneDeep(K)),D.push(K),Array.isArray(D)&&(D==null?void 0:D.length)>1?D:D==null?void 0:D[0]},q=e=>{var p,D,M;return Array.isArray(e==null?void 0:e.title)&&((p=e==null?void 0:e.title)==null?void 0:p.length)===((M=(D=e==null?void 0:e.title)==null?void 0:D.filter(K=>K.title))==null?void 0:M.length)?e==null?void 0:e.title:Array.isArray(e==null?void 0:e.children)?A(e):e},A=e=>{var D;const p=e;return p.children=(D=p.children)==null?void 0:D.map(M=>{var K;return(K=M==null?void 0:M.title)!=null&&K.children?M==null?void 0:M.title:M}),p},c=e=>e==null?void 0:e.map(p=>p.children&&p.children.length>0?{...p,children:p.level===0?[]:p.children,childMenus:c(p.children)}:p),L=G.ref(["gongjianku","shebeiku","fangfaku","guocheng","Fold","Fold"]),g=(e,p)=>e===0?L.value[p]??"Fold":e===1?"wenjianjia":(console.log(123,e),"wenjian"),_=(e,p="",D=0)=>{var x;let M,K=C.cloneDeep(e);const d=(x=S.value)==null?void 0:x.map(w=>{var U;return(U=w==null?void 0:w.key)==null?void 0:U.pageKey});return Array.isArray(K)||(K=[K]),M=K==null?void 0:K.map((w,U)=>{const z=p?`${p}/${w.title}`:w.title,X={...w,path:z,level:D,show:!0,icon:g(D,U),carryData:d==null?void 0:d.includes(z),isPenultimate:!w.children};return w.children&&w.children.length>0&&(X.children=_(w.children,z,D+1)),X}),M},b=G.computed(()=>{let e=_(T.value);if(e=[...e,...o.value],(e==null?void 0:e.length)===0)return t.push("/"),[];const p=E(e,v.value);p.isFlag||(e=p==null?void 0:p.data);const D=c(e);return y.value==="client"?(r.setMenus(D),D):e}),f=async e=>{r.setMenuTriggerType("click"),y.value==="client"&&(e!=null&&e.childMenus)&&r.setAsideMenus(e==null?void 0:e.childMenus),e.isRouter?t.push(e.path):t.push("/")},$=e=>{u.value==="click"?i.value===1?r.setActiveMenuPath(sessionStorage.getItem("pageKey")):e!==a.value&&r.setActiveMenuPath(e):r.setMenuTriggerType("click"),e!=null&&e.startsWith("/")?t.push(e):t.push("/"),i.value++},J=e=>{e!==a.value&&r.setActiveMenuPath(e)},P=e=>{const p=document.documentElement;e==null||e.forEach(D=>{p.style.setProperty(D.name,D.value)})};G.onMounted(()=>{i.value=1});const v=G.computed(()=>{const e=sessionStorage.getItem("authority");return e?JSON.parse(e):[]});G.watch(()=>y.value,e=>{e==="browser"?P(H.browserVerticalMenuClasses):e==="client"&&(P(H.clientHorizontalMenuClasses),P(H.clientVerticalMenuClasses))},{immediate:!0}),G.watch(()=>l.value,e=>{if(e){const p=e;T.value=k(p)}else r.setActiveMenuPath("")},{immediate:!0});const F=(e,p)=>{function D(M){M==null||M.forEach(K=>{K.show=p==null?void 0:p.some(d=>d==null?void 0:d.includes(K.path)),K.children&&D(K.children)})}return D(e),e},E=(e,p)=>{if(Array.isArray(p)){const D=Array.from(new Set(p==null?void 0:p.map(M=>M.substring(0,M.lastIndexOf("/")))));return{data:F(e,D),isFlag:!1}}else return{isFlag:(p==null?void 0:p.toUpperCase())==="SUPERADMIN"}};return{mode:R,renderMenuList:b,clickMenu:f,openMenu:$,closeMenu:J,changeMenuStyle:P}}});exports._sfc_main=Te;exports.expandToNewContents=we;exports.savePageDataAsync=ie;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as S, s as m, c as h, E as I, g as K, u as A } from "./menu-
|
|
2
|
-
import { p as v } from "./index-
|
|
1
|
+
import { f as S, s as m, c as h, E as I, g as K, u as A } from "./menu-Ba_aVwCo.js";
|
|
2
|
+
import { p as v } from "./index-D8QUeWKa.js";
|
|
3
3
|
function g(e, t, o) {
|
|
4
4
|
for (const n of e) {
|
|
5
5
|
if (n[t] === o)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./menu-
|
|
1
|
+
"use strict";const i=require("./menu-DHduXY8b.cjs"),h=require("./index-D5DKfZge.cjs");function S(e,t,r){for(const n of e){if(n[t]===r)return n;if(n.children&&n.children.length>0){const o=S(n.children,t,r);if(o)return o}}return null}function m(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),n=String(e.getDate()).padStart(2,"0"),o=String(e.getHours()).padStart(2,"0"),s=String(e.getMinutes()).padStart(2,"0"),a=String(e.getSeconds()).padStart(2,"0");return`${t}-${r}-${n} ${o}:${s}:${a}`}function I(e,t){const r=t.split("/");let n=e,o=null;for(let s of r){const a=n.find(c=>c.title===s);if(!a)return null;o||(o=a),n=a.children??[]}return o}const K=i.useMenuState(h.pinia),{menus:A}=i.storeToRefs(K),v=i.defineStore("loginState",{state:()=>({superAdminInfo:{},cryptoInfo:{publicKey:"",privateKey:""},loginUserInfo:{},structureData:[],isStructureExist:!1}),actions:{setSuperAdminInfo(e){this.superAdminInfo=e},setLoginUserInfo(e){this.loginUserInfo=e},setStructureData(e){this.structureData=e},setIsStructureExist(e){this.isStructureExist=e},async getModelSecretAsync(e){var r,n,o,s,a,c,u,y,l,p,d,f,g;const t=await i.getInsofDataApi({key:{systemKey:e?e.systemKey:sessionStorage.getItem("systemKey"),pageKey:"secret",type:"system"}});return((r=t==null?void 0:t.data)==null?void 0:r.code)===200&&(n=t==null?void 0:t.data)!=null&&n.result&&Array.isArray((o=t==null?void 0:t.data)==null?void 0:o.result)&&((a=(s=t==null?void 0:t.data)==null?void 0:s.result)==null?void 0:a.length)>0&&(this.cryptoInfo.publicKey=(l=(y=(u=(c=t.data)==null?void 0:c.result[0])==null?void 0:u.value)==null?void 0:y.cryptoInfo)==null?void 0:l.publicKey,this.cryptoInfo.privateKey=(g=(f=(d=(p=t.data)==null?void 0:p.result[0])==null?void 0:d.value)==null?void 0:f.cryptoInfo)==null?void 0:g.privateKey),{publicKey:this.cryptoInfo.publicKey,privateKey:this.cryptoInfo.privateKey}},async setLogRecordAsync(e,t,r="operate"){var n;try{const o=S(A.value,"path",t),s=await i.createInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"/log",type:"system",logType:r},value:{module:o?o.title:t,timeStamp:m(),detail:{...e}}});return((n=s==null?void 0:s.data)==null?void 0:n.code)===200}catch(o){i.ElMessage.error(o)}}},persist:[{key:"loginState",storage:localStorage,pick:["superAdminInfo"]}]});exports.findRootNodeByPath=I;exports.useLoginState=v;
|
|
@@ -1,12 +1,12 @@
|
|
|
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-
|
|
3
|
-
import { p as E } from "./index-
|
|
4
|
-
import { u as ee } from "./index-
|
|
5
|
-
import { s as te, u as fe } from "./menu-
|
|
6
|
-
import { g as ye } from "./index-
|
|
7
|
-
import { e as ge, a as he } from "./array-
|
|
2
|
+
import { m as ie, a as me, b as de } from "./index-H5uD67Jw.js";
|
|
3
|
+
import { p as E } from "./index-D8QUeWKa.js";
|
|
4
|
+
import { u as ee } from "./index-CMWo86wg.js";
|
|
5
|
+
import { s as te, u as fe } from "./menu-Ba_aVwCo.js";
|
|
6
|
+
import { g as ye } from "./index-Cfo509W-.js";
|
|
7
|
+
import { e as ge, a as he } from "./array-BfnpXiM-.js";
|
|
8
8
|
import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
-
import { c as k } from "./cloneDeep-
|
|
9
|
+
import { c as k } from "./cloneDeep-SOoqD36w.js";
|
|
10
10
|
const x = [
|
|
11
11
|
{
|
|
12
12
|
key: "FormName",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./index-y8UDVF_A.cjs"),T=require("./index-D5DKfZge.cjs"),Q=require("./index-B_IOZlFF.cjs"),I=require("./menu-DHduXY8b.cjs"),ee=require("./index-D4VrAzy3.cjs"),U=require("./array-CAAZj70g.cjs"),X=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./cloneDeep-CHtsEohg.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"}],te={key:0,class:"show-content"},ne={class:"item-view-group"},oe={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(j,{emit:x}){const t=j,E=x,g=Q.useModelComp(T.pinia),{itemData:p}=I.storeToRefs(g),_=e.ref([]),C=e.ref([]),F=c=>{E("change",{wholeValue:_.value,editValue:c})},D=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=U.expandStringToJson(t==null?void 0:t.content);g.setOriginalData(c),g.setItemData(c)},{deep:!0,immediate:!0});const N=c=>ee.getComponent(c);return(c,k)=>{var V;return((V=C.value)==null?void 0:V.length)>0?(e.openBlock(),e.createElementBlock("div",te,[(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",ne,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:F,index:B,onContentChange:D},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ae=X._export_sfc(oe,[["__scopeId","data-v-1c04adc8"]]),re={class:"add-model-content"},le={key:0,class:"model-import-data"},ce={class:"import-button"},se={key:0},ue={key:1,class:"model-operate"},ie={class:"model-select"},de={class:"model-fill"},me={key:2,class:"model-view ssComponent"},fe={__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:x}){const t=j,E=x,g=e.ref(""),p=e.ref([]),_=e.ref(0),C=Q.useModelComp(T.pinia);I.useMenuState(T.pinia);const{itemData:F,originalData:D}=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=U.arrayToNumberArray(y==null?void 0:y.contents)),y))),o});E("change",{originalContents:D.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;if(s!=null&&s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))if(!(($=n==null?void 0:n.contents)!=null&&$.length))a.push(((q=s==null?void 0:s.find(d=>(d==null?void 0:d.value)===(n==null?void 0:n.key)))==null?void 0:q.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let d=(J=n==null?void 0:n.contents)==null?void 0:J[0];if(!d)return;if(Object.keys(d).includes("label")&&Object.keys(d).includes("key")&&Object.keys(d).includes("width"))if(((M=(A=n.contents)==null?void 0:A.filter(m=>m.width!==1))==null?void 0:M.length)===0){const m=(R=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:R.map(l=>({[l.label]:l.value}));a.push(((L=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:L.key)+"="+JSON.stringify(m)+"/r/n")}else{let m=[];(z=h.cloneDeep(n==null?void 0:n.contents))==null||z.reduce((l,S)=>{var K;return l[S.label]=S.key,((K=Object.keys(h.cloneDeep(l)))==null?void 0:K.length)>=S.width&&(m.push(h.cloneDeep(l)),l={}),l},{}),a.push(((W=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:W.key)+"="+JSON.stringify(m)+"/r/n")}else if(Object.keys(d).includes("label")){const m=(H=h.cloneDeep(n==null?void 0:n.contents))==null?void 0:H.map(l=>l.label);a.push(((P=s==null?void 0:s.find(l=>(l==null?void 0:l.value)===(n==null?void 0:n.key)))==null?void 0:P.key)+"="+JSON.stringify(m)+"/r/n")}else a.push(((G=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:G.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",re,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",le,[e.createElementVNode("div",ce,[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",se,e.toDisplayString(k.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",ie,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",de,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",me,[(e.openBlock(),e.createBlock(ae,{content:g.value,onChange:i,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},ye=X._export_sfc(fe,[["__scopeId","data-v-ceaf6f81"]]);exports.default=ye;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as nt, computed as Y, createElementBlock as qt, openBlock as le, normalizeClass as ce, unref as D, renderSlot as vt, createVNode as mn, Transition as co, withCtx as lt, withDirectives as fo, createElementVNode as Wt, normalizeStyle as po, createTextVNode as Ms, toDisplayString as ho, vShow as _o, watch as Tt, shallowReactive as $s, ref as ge, onMounted as js, createBlock as He, createCommentVNode as it, resolveDynamicComponent as Hs, Fragment as zs, withModifiers as Ks, nextTick as Gt, isVNode as mo, render as Fn, effectScope as Eo, markRaw as ye, toRaw as Pe, isRef as Ne, isReactive as Ct, toRef as ct, hasInjectionContext as qs, inject as Ws, getCurrentInstance as Gs, reactive as Js, getCurrentScope as Ys, onScopeDispose as Xs, toRefs as Vn } from "vue";
|
|
2
|
-
import { k as En, n as fe, B as Zs, j as Je, P as Un, _ as go, J as Qs, af as ei, p as ti, ag as ni, h as yo, o as ri, Z as oi, $ as Ln, y as si, F as ii, G as Bn, Y as ai, ah as ui, K as li, m as Mn, A as Jt, z as ci, q as fi, ai as $n, aj as di } from "./index-
|
|
2
|
+
import { k as En, n as fe, B as Zs, j as Je, P as Un, _ as go, J as Qs, af as ei, p as ti, ag as ni, h as yo, o as ri, Z as oi, $ as Ln, y as si, F as ii, G as Bn, Y as ai, ah as ui, K as li, m as Mn, A as Jt, z as ci, q as fi, ai as $n, aj as di } from "./index-CKr4swuH.js";
|
|
3
3
|
import { m as pi } from "./typescript-BpuhIBuJ.js";
|
|
4
4
|
const hi = En({
|
|
5
5
|
value: {
|