ss-component-new 1.2.157 → 1.2.158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-BI189L9f.js +12451 -0
- package/dist/{index-D-KmkWON.js → index-BN6q1mp6.js} +2 -2
- package/dist/{index-BZ8dVq9e.js → index-BuGSZUdn.js} +5 -5
- package/dist/{index-0VmT6NTQ.cjs → index-CCv3E1hu.cjs} +1 -1
- package/dist/{index-ChEYPVLw.js → index-CTdsm8Ah.js} +3 -3
- package/dist/{index-Be46NApR.cjs → index-DnR6vlBp.cjs} +1 -1
- package/dist/{index-3ObhKDQk.cjs → index-Dt8SqpFR.cjs} +1 -1
- package/dist/index-dEOKYtTi.cjs +1 -0
- package/dist/{index-BDnkp7Dt.js → index-fPZS6D_6.js} +1 -1
- package/dist/{index-BMDI-P3d.cjs → index-hVoewZt8.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BE3hooPx.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BJy6SUjH.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-3Rjpklkh.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CCTfS1Zw.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-CaBx_tsr.js → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-B-zgpxeQ.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-3cwCIRaO.cjs → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-BP0Tacbw.cjs} +1 -1
- package/dist/{main-BBuE_qnM.js → main-ClisO4tc.js} +2 -2
- package/dist/{main-y7xxaKyn.cjs → main-Eaaucypj.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +3 -3
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/package.json +1 -1
- package/dist/index-HKpbTQLq.js +0 -12381
- package/dist/index-rC0ZXewZ.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { K as Nu, L as $a, M as Qk, _ as om, N as sm, O as ew } from "./index-
|
|
1
|
+
import { K as Nu, L as $a, M as Qk, _ as om, N as sm, O as ew } from "./index-BI189L9f.js";
|
|
2
2
|
import { defineComponent as Q, shallowRef as gn, ref as B, computed as C, watch as Se, onMounted as Ct, watchEffect as Kl, createElementBlock as q, openBlock as M, normalizeStyle as Ze, normalizeClass as R, unref as o, createElementVNode as X, renderSlot as re, nextTick as je, useSlots as jn, toRef as jt, createBlock as be, Transition as Ll, withCtx as le, withDirectives as ht, createCommentVNode as ve, resolveDynamicComponent as St, createTextVNode as Nt, toDisplayString as Oe, Fragment as nt, createVNode as J, vShow as zt, inject as qe, onBeforeUnmount as un, withModifiers as rt, provide as $t, reactive as Qt, onActivated as id, onUpdated as Wa, cloneVNode as tw, Comment as Mo, Text as nw, mergeProps as yt, getCurrentInstance as _t, Teleport as lw, onBeforeMount as ud, readonly as rm, onDeactivated as aw, useAttrs as vo, createSlots as xl, renderList as bt, normalizeProps as oa, guardReactiveProps as xa, h as tt, triggerRef as Gr, isVNode as Qn, toRaw as Ni, isRef as ka, vModelCheckbox as im, toRefs as al, vModelRadio as um, onBeforeUpdate as cm, withKeys as Dn, vModelText as Qi, toHandlers as ow, resolveComponent as Ft, TransitionGroup as dm, markRaw as Js, effectScope as sw, resolveDirective as eu, toHandlerKey as rw, render as Oi, onUnmounted as tu, createApp as iw, defineProps as fm } from "vue";
|
|
3
3
|
import { i as uw, j as cw, k as cd, l as dw, C as kt, m as dd, n as Nl, o as nh, p as io, q as wr, s as fd, t as pm, v as $l, I as Xn, U as ot, w as nu, x as uo, y as rl, z as El, A as vm, B as ll, D as ys, F as il, G as Wn, H as ea, J as Ba, K as fw, L as pd, M as Xr, N as hm, O as lu, P as ho, T as js, Q as vd, R as pw, S as vw, V as hw, W as gw, X as gm, Y as mm, Z as mw, _ as au, $ as Jr, a0 as lh, a1 as ts, a2 as Ro, a3 as to, a4 as ah, a5 as yw, a6 as bw, a7 as kw, a8 as oh, a9 as ww, aa as sh, E as Sw, u as ou, ab as Cw, a as ym } from "./index-AIq5wzuR.js";
|
|
4
4
|
import { i as hd, j as bm, S as Ew, k as km, l as wm, m as Sm, n as Cm, t as gd, o as Fn, q as Em, r as $m, v as Nm, w as Om, x as $w, y as Nw, z as Ou, A as Tm, B as Ow, C as Tw, D as Iw, F as Ut, G as Je, H as Ne, I as te, _ as Te, J as Ce, K as md, L as rh, M as Ln, N as zn, O as Rn, P as vt, Q as Mw, R as Rt, T as yd, U as Ti, V as yn, W as He, X as Rw, Y as Tn, Z as Mt, $ as Gt, a0 as Jn, a1 as su, a2 as wa, a3 as Hn, a4 as tc, a5 as ru, a6 as $e, a7 as ja, a8 as Tt, a9 as Fe, aa as Gn, ab as rn, ac as _w, ad as nc, ae as bd, af as dt, ag as iu, ah as bs, ai as nn, aj as go, ak as Im, al as Pw, am as It, an as Cn, ao as Cl, ap as ns, aq as kd, ar as Fa, d as ml, as as el, at as Hl, au as In, av as Sr, c as ge, aw as Na, ax as ks, ay as Fo, az as Cr, aA as Ia, aB as lr, aC as Aw, aD as _n, aE as Wl, aF as Dw, aG as Lw, aH as Mm, aI as xw, aJ as Rm, aK as uu, aL as ya, aM as co, aN as fo, aO as _m, aP as Bw, aQ as ar, aR as Pm, aS as ih, aT as Vw, aU as Zs, aV as Fw, aW as zw, aX as Kw, aY as Am, aZ as Hw, a_ as Ww, a$ as Dm, b0 as jw, b1 as Yw, b2 as Lm, b3 as qw, b4 as Uw, b5 as Gw, b6 as wd, b7 as Da, b8 as sa, b9 as Xw, ba as Jw, bb as Zw, bc as lc, bd as ac, be as xm, bf as uh, bg as Qw, bh as eS, bi as tS, bj as Bm, bk as Vm, bl as Br, bm as nS, bn as ch, bo as lS, bp as aS, bq as oS, br as Fm, bs as sS, bt as rS, bu as iS, bv as uS, bw as cS, bx as oc, by as dS, bz as zm, bA as fS, bB as pS, bC as vS, bD as Km, bE as hS, bF as gS, bG as mS, bH as yS, E as Sd, g as Xl, f as bS, bI as ls, bJ as sc, bK as Cd, h as Ed, e as rc, bL as kS, p as Er, s as _o, u as Hm, bM as Wm } from "./index-DIUrwul5.js";
|
|
@@ -12,7 +12,7 @@ import { u as LS, a as xS, g as uc, b as BS } from "./index-YXcguIZz.js";
|
|
|
12
12
|
import { t as VS } from "./index-5wWdb2WK.js";
|
|
13
13
|
import { t as FS } from "./index-zHH5odRp.js";
|
|
14
14
|
import { q as ey, r as zS, u as KS, v as HS, w as WS } from "./array-NKj1u0mH.js";
|
|
15
|
-
import { a as jS } from "./index.vue_vue_type_style_index_0_scoped_140f5e74_lang-
|
|
15
|
+
import { a as jS } from "./index.vue_vue_type_style_index_0_scoped_140f5e74_lang-B-zgpxeQ.js";
|
|
16
16
|
function YS() {
|
|
17
17
|
}
|
|
18
18
|
function ty(e, t, n, l) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as ka, N as Ia, g as ba } from "./index-
|
|
1
|
+
import { _ as ka, N as Ia, g as ba } from "./index-BI189L9f.js";
|
|
2
2
|
import { defineComponent as na, defineProps as Ca, ref as B, computed as Ee, onMounted as Ta, watch as Ka, reactive as wa } from "vue";
|
|
3
3
|
import { u as _a, a as Ua } from "./index-AIq5wzuR.js";
|
|
4
4
|
import { s as Fa } from "./index-HTNXPcKy.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const Me=require("./index-rC0ZXewZ.cjs"),C=require("vue"),Ge=require("./index-DOCHgBta.cjs"),ya=require("./index-GDtT6HPL.cjs"),na=require("./index-BNUNEmtk.cjs"),D=require("./index-C8qRkCgn.cjs"),Da=require("vue-router"),Ue=require("./index-9hspBVrQ.cjs"),ga=require("./index-BpPyaNFa.cjs"),Z=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CttArv-I.cjs"),je=require("./index-D_tbgi5B.cjs"),qe=(z,d,E=0)=>{let y=z;return y!=null&&y.every(i=>Array.isArray(i))&&(y!=null&&y.every(i=>Array.isArray(i)&&i.length===1)?y=y==null?void 0:y.filter(i=>(i==null?void 0:i[0])!==(d==null?void 0:d[E])):y=y==null?void 0:y.map(i=>{if(i!=null&&i.find(s=>s===(d==null?void 0:d[E]))&&(d==null?void 0:d.length)!==1){let s=D.cloneDeep(d),o=i==null?void 0:i.filter(b=>b!==(s==null?void 0:s[E])),M=E+1,q=qe(o,s,M),K=[];K.push(i==null?void 0:i[0]),q==null||q.forEach(b=>{K.push(b)}),i=K}return i})),y},Pe=(z,d,E,y=0)=>{let i=z;return i!=null&&i.every(s=>Array.isArray(s))&&(i!=null&&i.every(s=>Array.isArray(s)&&s.length===1)?i.push([E]):i=i==null?void 0:i.map(s=>{if(s!=null&&s.find(o=>o===(d==null?void 0:d[y]))&&(d==null?void 0:d.length)!==1){let o=D.cloneDeep(d),M=s==null?void 0:s.filter(P=>P!==(o==null?void 0:o[y])),q=y+1,K=Pe(M,o,E,q),b=[];b.push(s==null?void 0:s[0]),K==null||K.forEach(P=>{b.push(P)}),s=b}return s})),i},Le=(z,d,E,y,i=0)=>{let s=z;return s!=null&&s.every(o=>Array.isArray(o))&&(s!=null&&s.every(o=>Array.isArray(o)&&o.length===1)?s=s==null?void 0:s.map(o=>((o==null?void 0:o[0])===E&&(o=[y]),o)):s=s==null?void 0:s.map(o=>{if(o!=null&&o.find(M=>M===(d==null?void 0:d[i]))&&(d==null?void 0:d.length)!==1){let M=D.cloneDeep(d),q=o==null?void 0:o.filter(H=>H!==(M==null?void 0:M[i])),K=i+1,b=Le(q,M,E,y,K),P=[];P.push(o==null?void 0:o[0]),b==null||b.forEach(H=>{P.push(H)}),o=P}return o})),s};function Qe(z="menu"){return{name:z,components:{SvgIcon:ga.SvgIcon,ssMenu:Me.ssMenu,DynamicIcon:Me._sfc_main,ssDialog:ya.ssDialog,ssInput:na._sfc_main$3},setup(d,{emit:E}){const y=C.defineProps({mode:{type:String,default:"vertical"}}),i=C.ref([{allowInherit:!1,operateType:"复制新增",operateIcon:"CopyAddMenu"},{allowInherit:!1,operateType:"删除",operateIcon:"DeleteMenu"},{allowInherit:!1,operateType:"修改菜单名",operateIcon:"FixedMenu"}]),s=Ge.useMenuState(),o=Ge.useModelComp(D.pinia),M=D.useLoginState(D.pinia),{loginUserInfo:q}=D.storeToRefs(M),K=C.ref(0),b=Da.useRouter(),P=C.ref(),{asideMenus:H,menuTriggerType:Xe,platform:Ye}=D.storeToRefs(s),{fixMenuStatus:Ze}=D.storeToRefs(o),He=C.computed(()=>y==null?void 0:y.mode),$e=a=>a==null?void 0:a.map(e=>{var p,c;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=i.value:e!=null&&e.children&&((c=e==null?void 0:e.children)==null?void 0:c.length)>0&&(e.children=$e(e.children)),e}),Re=C.computed(()=>{let a=[...H.value];if((a==null?void 0:a.length)===0)return b.push("/"),[];const t=aa(a,me.value);return t.isFlag||(a=t==null?void 0:t.data),a=a==null?void 0:a.map(e=>{var p,c;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=i.value:e!=null&&e.children&&((c=e==null?void 0:e.children)==null?void 0:c.length)>0&&(e.children=$e(e.children)),e}),a}),Ne=async(a,t)=>{o.setRouteToChildPath(""),s.setMenuTriggerType("click"),s.setActiveMenuPath(a==null?void 0:a.path),s.setActiveAsideMenu(a),a.isRouter?b.push(a.path):b.push("/"),E("node-click",a,t)},Ve=async a=>{const t=D.findNodeByPropInTree(Re.value,"path",a);s.setActiveAsideMenu(t),o.setRouteToChildPath(""),Ze.value?o.setFixMenuStatus(!1):Xe.value==="click"?K.value===1?s.setActiveMenuPath(sessionStorage.getItem("pageKey")):s.setActiveMenuPath(a):(s.setMenuTriggerType("click"),s.setActiveMenuPath(a)),a!=null&&a.startsWith("/")?b.push(a):b.push("/"),K.value++},ue=a=>{s.setActiveMenuPath(a)},X=a=>{const t=document.documentElement;a==null||a.forEach(e=>{t.style.setProperty(e.name,e.value)})};C.onMounted(()=>{K.value=1});const me=C.computed(()=>{const a=sessionStorage.getItem("authority");return a?JSON.parse(a):[]});C.watch(()=>Ye.value,a=>{a==="browser"?X(Ue.browserVerticalMenuClasses):a==="client"?(X(Ue.clientHorizontalMenuClasses),X(Ue.clientVerticalMenuClasses)):a==="three"&&(X(Ue.threeHorizontalMenuClasses),X(Ue.threeVerticalMenuClasses))},{immediate:!0});const ea=(a,t)=>{function e(p){p==null||p.forEach(c=>{var $,T;const g=($=c==null?void 0:c.path)!=null&&$.startsWith("/")?(T=c==null?void 0:c.path)==null?void 0:T.substring(1):c==null?void 0:c.path;c.show=t==null?void 0:t.some(R=>R==null?void 0:R.includes(g)),c.children&&e(c.children)})}return e(a),a},aa=(a,t)=>{if(Array.isArray(t)){const e=Array.from(new Set(t==null?void 0:t.map(p=>p.substring(0,p.lastIndexOf("/")))));return{data:ea(a,e),isFlag:!1}}else return{isFlag:(t==null?void 0:t.toUpperCase())==="SUPERADMIN"}},B=C.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),ta=a=>Me.getComponent(a),sa=C.ref({}),la=C.ref([]),N=C.ref({}),Y=C.ref({}),ia=a=>{switch(a){case"复制新增":return"create";case"修改菜单名":return"update";case"删除":return"delete"}},Be=C.ref({}),oa=a=>{s.setCacheInputMenu({type:B.type,data:a}),s.setIsRefreshMenus(!0)},ca=async(a,t,e)=>{var p,c,g,$,T,R,L,V,u,m,ee,ae,te,se,le,ie,oe,ce,re,pe,fe,he,de,ve,ye,ne,De,ge,Ie,Se,ke,Te,_e,be,Ce,Ae,Ke,we,h,w,x,k;if(t==="create"){let r=(e==null?void 0:e.title)+"(1)",A=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),S=(c=(p=A==null?void 0:A.data)==null?void 0:p.result)==null?void 0:c[0],W=(g=S==null?void 0:S.value)==null?void 0:g.pageData;W.compData=($=W.compData)==null?void 0:$.map(l=>{var f;return(l==null?void 0:l.key)==="menuContents"&&(l.contents=Pe(l.contents,(f=e==null?void 0:e.path)==null?void 0:f.split("/"),r)),l}),await D.updateInsofDataApi({id:S==null?void 0:S.id,value:{pageData:W}});let U=(R=(T=e==null?void 0:e.path)==null?void 0:T.split("/"))==null?void 0:R.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}),F=await Z.getItemData((u=(V=(L=e==null?void 0:e.path)==null?void 0:L.split("/"))==null?void 0:V.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:u.join("/"),sessionStorage.getItem("systemKey"),"");if(U.push(r),U=U==null?void 0:U.join("/"),(F==null?void 0:F.length)>0){let l=F==null?void 0:F[0],f=(ee=(m=l==null?void 0:l.compData)==null?void 0:m.find(n=>(n==null?void 0:n.key)==="header"))==null?void 0:ee.contents;if(((ae=f==null?void 0:f[0])==null?void 0:ae.directiveLabel)==="#isMain"){let n=(te=f==null?void 0:f[0])==null?void 0:te.prop,I=(le=(se=l==null?void 0:l.compData)==null?void 0:se.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:le.contents,J;I==null||I.forEach(_=>{var G,O;if(_.length===1)((G=_==null?void 0:_[0])==null?void 0:G[n])===(e==null?void 0:e.title)&&(J=_==null?void 0:_[0],J[n]=r);else{let Q=(O=f==null?void 0:f.filter(j=>j!=="操作"))==null?void 0:O.map(j=>j==null?void 0:j.prop),Fe=_==null?void 0:_.filter(j=>!(j!=null&&j.id)),xe=Z.getValueToObjectValue(Fe,Q);xe[n]=r,J=xe}}),await D.createInsofDataApi({key:{type:"data",pageKey:(ce=(oe=(ie=e==null?void 0:e.path)==null?void 0:ie.split("/"))==null?void 0:oe.filter((_,G)=>{var O,Q;return G!==((Q=(O=e==null?void 0:e.path)==null?void 0:O.split("/"))==null?void 0:Q.length)-1}))==null?void 0:ce.join("/"),tableId:l==null?void 0:l.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(re=q.value)==null?void 0:re.id,createUserLayer:((pe=q.value)==null?void 0:pe.dept)||((fe=q.value)==null?void 0:fe.部门名称)},value:{tableData:J}})}}await Z.newLoadingConstruct(e==null?void 0:e.path,U),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((ve=(de=(he=e==null?void 0:e.path)==null?void 0:he.split("/"))==null?void 0:de.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:ve.join("/")),s.setActiveTopMenuPath((ne=(ye=e==null?void 0:e.path)==null?void 0:ye.split("/"))==null?void 0:ne[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0)}else if(t==="update")P.value=e;else if(t==="delete"){let r=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:e==null?void 0:e.path}}),A=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),S=(ge=(De=A==null?void 0:A.data)==null?void 0:De.result)==null?void 0:ge[0],W=(Ie=S==null?void 0:S.value)==null?void 0:Ie.pageData;if(W.compData=(Se=W.compData)==null?void 0:Se.map(l=>{var f;return(l==null?void 0:l.key)==="menuContents"&&(l.contents=qe(l.contents,(f=e==null?void 0:e.path)==null?void 0:f.split("/"))),l}),await D.updateInsofDataApi({id:S==null?void 0:S.id,value:{pageData:W}}),((Te=(ke=r==null?void 0:r.data)==null?void 0:ke.result)==null?void 0:Te.length)>0){let l=(be=(_e=r==null?void 0:r.data)==null?void 0:_e.result)==null?void 0:be.map(f=>f==null?void 0:f.id);(l==null?void 0:l.length)>0&&await D.batchDeleteInsofDataApi({ids:l})}let U=await Z.getItemData((Ke=(Ae=(Ce=e==null?void 0:e.path)==null?void 0:Ce.split("/"))==null?void 0:Ae.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:Ke.join("/"),sessionStorage.getItem("systemKey"),""),F=[];(U==null?void 0:U.length)>0&&(U==null||U.forEach(l=>{var n,I,J,_,G,O,Q,Fe,xe,j,Oe;let f=(_=(J=(I=(n=l==null?void 0:l.compData)==null?void 0:n.find(v=>(v==null?void 0:v.key)==="header"))==null?void 0:I.contents)==null?void 0:J[0])==null?void 0:_.prop;((Fe=(Q=(O=(G=l==null?void 0:l.compData)==null?void 0:G.find(v=>(v==null?void 0:v.key)==="header"))==null?void 0:O.contents)==null?void 0:Q[0])==null?void 0:Fe.directiveLabel)==="#isMain"&&((Oe=(j=(xe=l==null?void 0:l.compData)==null?void 0:xe.find(v=>(v==null?void 0:v.key)==="tableContents"))==null?void 0:j.contents)==null||Oe.forEach(v=>{var ze,We,Je;(v==null?void 0:v.length)>1?(v==null?void 0:v[1])===(e==null?void 0:e.title)&&F.push((ze=v==null?void 0:v[0])==null?void 0:ze.id):((We=v==null?void 0:v[0])==null?void 0:We[f])===(e==null?void 0:e.title)&&F.push((Je=v==null?void 0:v[0])==null?void 0:Je.id)}))})),(F==null?void 0:F.length)>0&&await D.batchDeleteInsofDataApi({ids:F}),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((w=(h=(we=e==null?void 0:e.path)==null?void 0:we.split("/"))==null?void 0:h.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:w.join("/")),s.setActiveTopMenuPath((k=(x=e==null?void 0:e.path)==null?void 0:x.split("/"))==null?void 0:k[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0)}},ra=async(a,t)=>{var V,u,m,ee,ae,te,se,le,ie,oe,ce,re,pe,fe,he,de,ve,ye,ne,De,ge,Ie,Se,ke,Te,_e,be,Ce,Ae,Ke,we;let e=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),p=(u=(V=e==null?void 0:e.data)==null?void 0:V.result)==null?void 0:u[0],c=(m=p==null?void 0:p.value)==null?void 0:m.pageData;c.compData=(ee=c.compData)==null?void 0:ee.map(h=>{var w,x;return(h==null?void 0:h.key)==="menuContents"&&(h.contents=Le(h.contents,(w=t==null?void 0:t.path)==null?void 0:w.split("/"),t==null?void 0:t.title,(x=a==null?void 0:a.target)==null?void 0:x.value)),h}),p!=null&&p.id&&await D.updateInsofDataApi({id:p==null?void 0:p.id,value:{pageData:c}});let g=(te=(ae=t==null?void 0:t.path)==null?void 0:ae.split("/"))==null?void 0:te.filter((h,w)=>{var x,k;return w!==((k=(x=t==null?void 0:t.path)==null?void 0:x.split("/"))==null?void 0:k.length)-1}),$=g==null?void 0:g.join("/");g.push((se=a==null?void 0:a.target)==null?void 0:se.value),g=g==null?void 0:g.join("/");let T=await Z.getItemData($,sessionStorage.getItem("systemKey"),"");if(((re=(ce=(oe=(ie=(le=T==null?void 0:T[0])==null?void 0:le.compData)==null?void 0:ie.find(h=>(h==null?void 0:h.key)==="header"))==null?void 0:oe.contents)==null?void 0:ce[0])==null?void 0:re.directiveLabel)==="#isMain"){let h=(ve=(de=(he=(fe=(pe=T==null?void 0:T[0])==null?void 0:pe.compData)==null?void 0:fe.find(r=>(r==null?void 0:r.key)==="header"))==null?void 0:he.contents)==null?void 0:de[0])==null?void 0:ve.prop,w=(De=(ne=(ye=T==null?void 0:T[0])==null?void 0:ye.compData)==null?void 0:ne.find(r=>(r==null?void 0:r.key)==="tableContents"))==null?void 0:De.contents,x=(ke=(Se=(Ie=(ge=T==null?void 0:T[0])==null?void 0:ge.compData)==null?void 0:Ie.find(r=>(r==null?void 0:r.key)==="header"))==null?void 0:Se.contents)==null?void 0:ke.map(r=>r==null?void 0:r.prop),k;if(w==null||w.forEach(r=>{var S;let A=Z.getValueToObjectValue(r,x);(A==null?void 0:A[h])===t.title&&(k=A,k[h]=(S=a==null?void 0:a.target)==null?void 0:S.value)}),k){let r={};for(let S in k)S!=="id"&&(r[S]=k==null?void 0:k[S]);let A=[{id:k==null?void 0:k.id,value:{tableData:r}}];await D.batchUpdateInsofDataApi({dataList:A})}}let R=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:t==null?void 0:t.path}}),L=(_e=(Te=R==null?void 0:R.data)==null?void 0:Te.result)==null?void 0:_e.map(h=>({id:h==null?void 0:h.id,key:h==null?void 0:h.key}));L=L==null?void 0:L.map(h=>(h.key.pageKey=g,h)),(L==null?void 0:L.length)>0&&await D.batchUpdateInsofDataApi({dataList:L}),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((Ae=(Ce=(be=t==null?void 0:t.path)==null?void 0:be.split("/"))==null?void 0:Ce.filter((h,w)=>{var x,k;return w!==((k=(x=t==null?void 0:t.path)==null?void 0:x.split("/"))==null?void 0:k.length)-1}))==null?void 0:Ae.join("/")),s.setActiveTopMenuPath((we=(Ke=t==null?void 0:t.path)==null?void 0:Ke.split("/"))==null?void 0:we[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0),P.value=void 0},pa=async(a,t)=>{B.type=ia(t==null?void 0:t.operateType),await ca(t,B.type,a),Y.value=a,Be.value=t},fa=()=>{B.show=!1},ha=a=>a==null?void 0:a.filter(t=>t.allowInherit),da=()=>{var e,p,c,g,$;let a;B.type==="create"&&(a=((e=Y.value)==null?void 0:e.path)+"/"+N.value[(p=N.value)==null?void 0:p.prop]),B.type==="update"&&(a=(c=Y.value)==null?void 0:c.path);const t={...Y.value,config:ha((g=Y.value)==null?void 0:g.config),children:[],childMenus:[],title:N.value[($=N.value)==null?void 0:$.prop],path:a};console.log("clickSubmitForm",Be.value,Y.value,t),oa(t),B.show=!1},va=a=>{var e,p;const t=(e=a==null?void 0:a.contents)==null?void 0:e.find(c=>c.key==="formContent");t&&(N.value=(p=t==null?void 0:t.contents)==null?void 0:p.reduce((c,g)=>(c[g.key]=g.value,c.prop=g.key,c),{}))},Ee=C.ref(!1);return{isCollapse:Ee,handleMenuCollapse:()=>{Ee.value=!Ee.value},handleCompChange:va,dialogForm:sa,dialogRenderComps:la,getComponents:ta,clickSubmitForm:da,dialogInfo:B,beforeDialogDestroy:fa,clickMenuIcon:pa,mode:He,renderMenuList:Re,clickMenu:Ne,openMenu:Ve,closeMenu:ue,changeMenuStyle:X,fixElement:P,onBlur:ra}}}}const Ia=C.defineComponent(Qe());exports._sfc_main=Ia;exports.addSelectMenu=Pe;exports.deleteSelectMenu=qe;exports.fixSelectMenu=Le;exports.setComponent=Qe;
|
|
1
|
+
"use strict";const Me=require("./index-dEOKYtTi.cjs"),C=require("vue"),Ge=require("./index-DOCHgBta.cjs"),ya=require("./index-GDtT6HPL.cjs"),na=require("./index-BNUNEmtk.cjs"),D=require("./index-C8qRkCgn.cjs"),Da=require("vue-router"),Ue=require("./index-9hspBVrQ.cjs"),ga=require("./index-BpPyaNFa.cjs"),Z=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CttArv-I.cjs"),je=require("./index-D_tbgi5B.cjs"),qe=(z,d,E=0)=>{let y=z;return y!=null&&y.every(i=>Array.isArray(i))&&(y!=null&&y.every(i=>Array.isArray(i)&&i.length===1)?y=y==null?void 0:y.filter(i=>(i==null?void 0:i[0])!==(d==null?void 0:d[E])):y=y==null?void 0:y.map(i=>{if(i!=null&&i.find(s=>s===(d==null?void 0:d[E]))&&(d==null?void 0:d.length)!==1){let s=D.cloneDeep(d),o=i==null?void 0:i.filter(b=>b!==(s==null?void 0:s[E])),M=E+1,q=qe(o,s,M),K=[];K.push(i==null?void 0:i[0]),q==null||q.forEach(b=>{K.push(b)}),i=K}return i})),y},Pe=(z,d,E,y=0)=>{let i=z;return i!=null&&i.every(s=>Array.isArray(s))&&(i!=null&&i.every(s=>Array.isArray(s)&&s.length===1)?i.push([E]):i=i==null?void 0:i.map(s=>{if(s!=null&&s.find(o=>o===(d==null?void 0:d[y]))&&(d==null?void 0:d.length)!==1){let o=D.cloneDeep(d),M=s==null?void 0:s.filter(P=>P!==(o==null?void 0:o[y])),q=y+1,K=Pe(M,o,E,q),b=[];b.push(s==null?void 0:s[0]),K==null||K.forEach(P=>{b.push(P)}),s=b}return s})),i},Le=(z,d,E,y,i=0)=>{let s=z;return s!=null&&s.every(o=>Array.isArray(o))&&(s!=null&&s.every(o=>Array.isArray(o)&&o.length===1)?s=s==null?void 0:s.map(o=>((o==null?void 0:o[0])===E&&(o=[y]),o)):s=s==null?void 0:s.map(o=>{if(o!=null&&o.find(M=>M===(d==null?void 0:d[i]))&&(d==null?void 0:d.length)!==1){let M=D.cloneDeep(d),q=o==null?void 0:o.filter(H=>H!==(M==null?void 0:M[i])),K=i+1,b=Le(q,M,E,y,K),P=[];P.push(o==null?void 0:o[0]),b==null||b.forEach(H=>{P.push(H)}),o=P}return o})),s};function Qe(z="menu"){return{name:z,components:{SvgIcon:ga.SvgIcon,ssMenu:Me.ssMenu,DynamicIcon:Me._sfc_main,ssDialog:ya.ssDialog,ssInput:na._sfc_main$3},setup(d,{emit:E}){const y=C.defineProps({mode:{type:String,default:"vertical"}}),i=C.ref([{allowInherit:!1,operateType:"复制新增",operateIcon:"CopyAddMenu"},{allowInherit:!1,operateType:"删除",operateIcon:"DeleteMenu"},{allowInherit:!1,operateType:"修改菜单名",operateIcon:"FixedMenu"}]),s=Ge.useMenuState(),o=Ge.useModelComp(D.pinia),M=D.useLoginState(D.pinia),{loginUserInfo:q}=D.storeToRefs(M),K=C.ref(0),b=Da.useRouter(),P=C.ref(),{asideMenus:H,menuTriggerType:Xe,platform:Ye}=D.storeToRefs(s),{fixMenuStatus:Ze}=D.storeToRefs(o),He=C.computed(()=>y==null?void 0:y.mode),$e=a=>a==null?void 0:a.map(e=>{var p,c;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=i.value:e!=null&&e.children&&((c=e==null?void 0:e.children)==null?void 0:c.length)>0&&(e.children=$e(e.children)),e}),Re=C.computed(()=>{let a=[...H.value];if((a==null?void 0:a.length)===0)return b.push("/"),[];const t=aa(a,me.value);return t.isFlag||(a=t==null?void 0:t.data),a=a==null?void 0:a.map(e=>{var p,c;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=i.value:e!=null&&e.children&&((c=e==null?void 0:e.children)==null?void 0:c.length)>0&&(e.children=$e(e.children)),e}),a}),Ne=async(a,t)=>{o.setRouteToChildPath(""),s.setMenuTriggerType("click"),s.setActiveMenuPath(a==null?void 0:a.path),s.setActiveAsideMenu(a),a.isRouter?b.push(a.path):b.push("/"),E("node-click",a,t)},Ve=async a=>{const t=D.findNodeByPropInTree(Re.value,"path",a);s.setActiveAsideMenu(t),o.setRouteToChildPath(""),Ze.value?o.setFixMenuStatus(!1):Xe.value==="click"?K.value===1?s.setActiveMenuPath(sessionStorage.getItem("pageKey")):s.setActiveMenuPath(a):(s.setMenuTriggerType("click"),s.setActiveMenuPath(a)),a!=null&&a.startsWith("/")?b.push(a):b.push("/"),K.value++},ue=a=>{s.setActiveMenuPath(a)},X=a=>{const t=document.documentElement;a==null||a.forEach(e=>{t.style.setProperty(e.name,e.value)})};C.onMounted(()=>{K.value=1});const me=C.computed(()=>{const a=sessionStorage.getItem("authority");return a?JSON.parse(a):[]});C.watch(()=>Ye.value,a=>{a==="browser"?X(Ue.browserVerticalMenuClasses):a==="client"?(X(Ue.clientHorizontalMenuClasses),X(Ue.clientVerticalMenuClasses)):a==="three"&&(X(Ue.threeHorizontalMenuClasses),X(Ue.threeVerticalMenuClasses))},{immediate:!0});const ea=(a,t)=>{function e(p){p==null||p.forEach(c=>{var $,T;const g=($=c==null?void 0:c.path)!=null&&$.startsWith("/")?(T=c==null?void 0:c.path)==null?void 0:T.substring(1):c==null?void 0:c.path;c.show=t==null?void 0:t.some(R=>R==null?void 0:R.includes(g)),c.children&&e(c.children)})}return e(a),a},aa=(a,t)=>{if(Array.isArray(t)){const e=Array.from(new Set(t==null?void 0:t.map(p=>p.substring(0,p.lastIndexOf("/")))));return{data:ea(a,e),isFlag:!1}}else return{isFlag:(t==null?void 0:t.toUpperCase())==="SUPERADMIN"}},B=C.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),ta=a=>Me.getComponent(a),sa=C.ref({}),la=C.ref([]),N=C.ref({}),Y=C.ref({}),ia=a=>{switch(a){case"复制新增":return"create";case"修改菜单名":return"update";case"删除":return"delete"}},Be=C.ref({}),oa=a=>{s.setCacheInputMenu({type:B.type,data:a}),s.setIsRefreshMenus(!0)},ca=async(a,t,e)=>{var p,c,g,$,T,R,L,V,u,m,ee,ae,te,se,le,ie,oe,ce,re,pe,fe,he,de,ve,ye,ne,De,ge,Ie,Se,ke,Te,_e,be,Ce,Ae,Ke,we,h,w,x,k;if(t==="create"){let r=(e==null?void 0:e.title)+"(1)",A=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),S=(c=(p=A==null?void 0:A.data)==null?void 0:p.result)==null?void 0:c[0],W=(g=S==null?void 0:S.value)==null?void 0:g.pageData;W.compData=($=W.compData)==null?void 0:$.map(l=>{var f;return(l==null?void 0:l.key)==="menuContents"&&(l.contents=Pe(l.contents,(f=e==null?void 0:e.path)==null?void 0:f.split("/"),r)),l}),await D.updateInsofDataApi({id:S==null?void 0:S.id,value:{pageData:W}});let U=(R=(T=e==null?void 0:e.path)==null?void 0:T.split("/"))==null?void 0:R.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}),F=await Z.getItemData((u=(V=(L=e==null?void 0:e.path)==null?void 0:L.split("/"))==null?void 0:V.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:u.join("/"),sessionStorage.getItem("systemKey"),"");if(U.push(r),U=U==null?void 0:U.join("/"),(F==null?void 0:F.length)>0){let l=F==null?void 0:F[0],f=(ee=(m=l==null?void 0:l.compData)==null?void 0:m.find(n=>(n==null?void 0:n.key)==="header"))==null?void 0:ee.contents;if(((ae=f==null?void 0:f[0])==null?void 0:ae.directiveLabel)==="#isMain"){let n=(te=f==null?void 0:f[0])==null?void 0:te.prop,I=(le=(se=l==null?void 0:l.compData)==null?void 0:se.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:le.contents,J;I==null||I.forEach(_=>{var G,O;if(_.length===1)((G=_==null?void 0:_[0])==null?void 0:G[n])===(e==null?void 0:e.title)&&(J=_==null?void 0:_[0],J[n]=r);else{let Q=(O=f==null?void 0:f.filter(j=>j!=="操作"))==null?void 0:O.map(j=>j==null?void 0:j.prop),Fe=_==null?void 0:_.filter(j=>!(j!=null&&j.id)),xe=Z.getValueToObjectValue(Fe,Q);xe[n]=r,J=xe}}),await D.createInsofDataApi({key:{type:"data",pageKey:(ce=(oe=(ie=e==null?void 0:e.path)==null?void 0:ie.split("/"))==null?void 0:oe.filter((_,G)=>{var O,Q;return G!==((Q=(O=e==null?void 0:e.path)==null?void 0:O.split("/"))==null?void 0:Q.length)-1}))==null?void 0:ce.join("/"),tableId:l==null?void 0:l.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(re=q.value)==null?void 0:re.id,createUserLayer:((pe=q.value)==null?void 0:pe.dept)||((fe=q.value)==null?void 0:fe.部门名称)},value:{tableData:J}})}}await Z.newLoadingConstruct(e==null?void 0:e.path,U),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((ve=(de=(he=e==null?void 0:e.path)==null?void 0:he.split("/"))==null?void 0:de.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:ve.join("/")),s.setActiveTopMenuPath((ne=(ye=e==null?void 0:e.path)==null?void 0:ye.split("/"))==null?void 0:ne[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0)}else if(t==="update")P.value=e;else if(t==="delete"){let r=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:e==null?void 0:e.path}}),A=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),S=(ge=(De=A==null?void 0:A.data)==null?void 0:De.result)==null?void 0:ge[0],W=(Ie=S==null?void 0:S.value)==null?void 0:Ie.pageData;if(W.compData=(Se=W.compData)==null?void 0:Se.map(l=>{var f;return(l==null?void 0:l.key)==="menuContents"&&(l.contents=qe(l.contents,(f=e==null?void 0:e.path)==null?void 0:f.split("/"))),l}),await D.updateInsofDataApi({id:S==null?void 0:S.id,value:{pageData:W}}),((Te=(ke=r==null?void 0:r.data)==null?void 0:ke.result)==null?void 0:Te.length)>0){let l=(be=(_e=r==null?void 0:r.data)==null?void 0:_e.result)==null?void 0:be.map(f=>f==null?void 0:f.id);(l==null?void 0:l.length)>0&&await D.batchDeleteInsofDataApi({ids:l})}let U=await Z.getItemData((Ke=(Ae=(Ce=e==null?void 0:e.path)==null?void 0:Ce.split("/"))==null?void 0:Ae.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:Ke.join("/"),sessionStorage.getItem("systemKey"),""),F=[];(U==null?void 0:U.length)>0&&(U==null||U.forEach(l=>{var n,I,J,_,G,O,Q,Fe,xe,j,Oe;let f=(_=(J=(I=(n=l==null?void 0:l.compData)==null?void 0:n.find(v=>(v==null?void 0:v.key)==="header"))==null?void 0:I.contents)==null?void 0:J[0])==null?void 0:_.prop;((Fe=(Q=(O=(G=l==null?void 0:l.compData)==null?void 0:G.find(v=>(v==null?void 0:v.key)==="header"))==null?void 0:O.contents)==null?void 0:Q[0])==null?void 0:Fe.directiveLabel)==="#isMain"&&((Oe=(j=(xe=l==null?void 0:l.compData)==null?void 0:xe.find(v=>(v==null?void 0:v.key)==="tableContents"))==null?void 0:j.contents)==null||Oe.forEach(v=>{var ze,We,Je;(v==null?void 0:v.length)>1?(v==null?void 0:v[1])===(e==null?void 0:e.title)&&F.push((ze=v==null?void 0:v[0])==null?void 0:ze.id):((We=v==null?void 0:v[0])==null?void 0:We[f])===(e==null?void 0:e.title)&&F.push((Je=v==null?void 0:v[0])==null?void 0:Je.id)}))})),(F==null?void 0:F.length)>0&&await D.batchDeleteInsofDataApi({ids:F}),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((w=(h=(we=e==null?void 0:e.path)==null?void 0:we.split("/"))==null?void 0:h.filter((l,f)=>{var n,I;return f!==((I=(n=e==null?void 0:e.path)==null?void 0:n.split("/"))==null?void 0:I.length)-1}))==null?void 0:w.join("/")),s.setActiveTopMenuPath((k=(x=e==null?void 0:e.path)==null?void 0:x.split("/"))==null?void 0:k[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0)}},ra=async(a,t)=>{var V,u,m,ee,ae,te,se,le,ie,oe,ce,re,pe,fe,he,de,ve,ye,ne,De,ge,Ie,Se,ke,Te,_e,be,Ce,Ae,Ke,we;let e=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),p=(u=(V=e==null?void 0:e.data)==null?void 0:V.result)==null?void 0:u[0],c=(m=p==null?void 0:p.value)==null?void 0:m.pageData;c.compData=(ee=c.compData)==null?void 0:ee.map(h=>{var w,x;return(h==null?void 0:h.key)==="menuContents"&&(h.contents=Le(h.contents,(w=t==null?void 0:t.path)==null?void 0:w.split("/"),t==null?void 0:t.title,(x=a==null?void 0:a.target)==null?void 0:x.value)),h}),p!=null&&p.id&&await D.updateInsofDataApi({id:p==null?void 0:p.id,value:{pageData:c}});let g=(te=(ae=t==null?void 0:t.path)==null?void 0:ae.split("/"))==null?void 0:te.filter((h,w)=>{var x,k;return w!==((k=(x=t==null?void 0:t.path)==null?void 0:x.split("/"))==null?void 0:k.length)-1}),$=g==null?void 0:g.join("/");g.push((se=a==null?void 0:a.target)==null?void 0:se.value),g=g==null?void 0:g.join("/");let T=await Z.getItemData($,sessionStorage.getItem("systemKey"),"");if(((re=(ce=(oe=(ie=(le=T==null?void 0:T[0])==null?void 0:le.compData)==null?void 0:ie.find(h=>(h==null?void 0:h.key)==="header"))==null?void 0:oe.contents)==null?void 0:ce[0])==null?void 0:re.directiveLabel)==="#isMain"){let h=(ve=(de=(he=(fe=(pe=T==null?void 0:T[0])==null?void 0:pe.compData)==null?void 0:fe.find(r=>(r==null?void 0:r.key)==="header"))==null?void 0:he.contents)==null?void 0:de[0])==null?void 0:ve.prop,w=(De=(ne=(ye=T==null?void 0:T[0])==null?void 0:ye.compData)==null?void 0:ne.find(r=>(r==null?void 0:r.key)==="tableContents"))==null?void 0:De.contents,x=(ke=(Se=(Ie=(ge=T==null?void 0:T[0])==null?void 0:ge.compData)==null?void 0:Ie.find(r=>(r==null?void 0:r.key)==="header"))==null?void 0:Se.contents)==null?void 0:ke.map(r=>r==null?void 0:r.prop),k;if(w==null||w.forEach(r=>{var S;let A=Z.getValueToObjectValue(r,x);(A==null?void 0:A[h])===t.title&&(k=A,k[h]=(S=a==null?void 0:a.target)==null?void 0:S.value)}),k){let r={};for(let S in k)S!=="id"&&(r[S]=k==null?void 0:k[S]);let A=[{id:k==null?void 0:k.id,value:{tableData:r}}];await D.batchUpdateInsofDataApi({dataList:A})}}let R=await D.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:t==null?void 0:t.path}}),L=(_e=(Te=R==null?void 0:R.data)==null?void 0:Te.result)==null?void 0:_e.map(h=>({id:h==null?void 0:h.id,key:h==null?void 0:h.key}));L=L==null?void 0:L.map(h=>(h.key.pageKey=g,h)),(L==null?void 0:L.length)>0&&await D.batchUpdateInsofDataApi({dataList:L}),s.setUpdateMenuStatus(!1),await je.verifyStructureDataToStore(),s.setActiveMenuPath((Ae=(Ce=(be=t==null?void 0:t.path)==null?void 0:be.split("/"))==null?void 0:Ce.filter((h,w)=>{var x,k;return w!==((k=(x=t==null?void 0:t.path)==null?void 0:x.split("/"))==null?void 0:k.length)-1}))==null?void 0:Ae.join("/")),s.setActiveTopMenuPath((we=(Ke=t==null?void 0:t.path)==null?void 0:Ke.split("/"))==null?void 0:we[0]),s.setIsRefreshMenus(!1),s.setIsRefreshMenus(!0),P.value=void 0},pa=async(a,t)=>{B.type=ia(t==null?void 0:t.operateType),await ca(t,B.type,a),Y.value=a,Be.value=t},fa=()=>{B.show=!1},ha=a=>a==null?void 0:a.filter(t=>t.allowInherit),da=()=>{var e,p,c,g,$;let a;B.type==="create"&&(a=((e=Y.value)==null?void 0:e.path)+"/"+N.value[(p=N.value)==null?void 0:p.prop]),B.type==="update"&&(a=(c=Y.value)==null?void 0:c.path);const t={...Y.value,config:ha((g=Y.value)==null?void 0:g.config),children:[],childMenus:[],title:N.value[($=N.value)==null?void 0:$.prop],path:a};console.log("clickSubmitForm",Be.value,Y.value,t),oa(t),B.show=!1},va=a=>{var e,p;const t=(e=a==null?void 0:a.contents)==null?void 0:e.find(c=>c.key==="formContent");t&&(N.value=(p=t==null?void 0:t.contents)==null?void 0:p.reduce((c,g)=>(c[g.key]=g.value,c.prop=g.key,c),{}))},Ee=C.ref(!1);return{isCollapse:Ee,handleMenuCollapse:()=>{Ee.value=!Ee.value},handleCompChange:va,dialogForm:sa,dialogRenderComps:la,getComponents:ta,clickSubmitForm:da,dialogInfo:B,beforeDialogDestroy:fa,clickMenuIcon:pa,mode:He,renderMenuList:Re,clickMenu:Ne,openMenu:Ve,closeMenu:ue,changeMenuStyle:X,fixElement:P,onBlur:ra}}}}const Ia=C.defineComponent(Qe());exports._sfc_main=Ia;exports.addSelectMenu=Pe;exports.deleteSelectMenu=qe;exports.fixSelectMenu=Le;exports.setComponent=Qe;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ref as _, watch as V, createElementBlock as C, createCommentVNode as I, openBlock as f, Fragment as le, renderList as se, createElementVNode as O, createBlock as Z, toDisplayString as v, resolveDynamicComponent as ue, onMounted as ce, onUnmounted as ie, createVNode as A } from "vue";
|
|
2
|
-
import { m as me, a as de, b as ye } from "./index-
|
|
2
|
+
import { m as me, a as de, b as ye } from "./index-fPZS6D_6.js";
|
|
3
3
|
import { p as E, s as ee, c as k } from "./index-DIUrwul5.js";
|
|
4
4
|
import { a as te, u as fe } from "./index-AIq5wzuR.js";
|
|
5
|
-
import { g as ge } from "./index-
|
|
5
|
+
import { g as ge } from "./index-BI189L9f.js";
|
|
6
6
|
import { e as he, a as ke } from "./array-NKj1u0mH.js";
|
|
7
7
|
import { _ as ne } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const x = [
|
|
@@ -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-hVoewZt8.cjs"),i=require("./index-C8qRkCgn.cjs"),T=require("./index-DOCHgBta.cjs"),Z=require("./index-dEOKYtTi.cjs"),G=require("./array-B7tQHAQO.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=[{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"}],v={key:0,class:"show-content"},ee={class:"item-view-group"},te={__name:"index",props:{content:String,jsonContents:Array},emits:["change"],setup(E,{emit:j}){const t=E,x=j,h=T.useModelComp(i.pinia),{itemData:p}=i.storeToRefs(h),_=e.ref([]),C=e.ref([]),I=c=>{x("change",{wholeValue:_.value,editValue:c})},S=c=>{const g=i.cloneDeep(_.value),B=g==null?void 0:g.map((d,b)=>(b===(c==null?void 0:c.index)&&(d.compData=c==null?void 0:c.contents),d));_.value=B};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 g;if(((g=t==null?void 0:t.jsonContents)==null?void 0:g.length)>0){h.setOriginalData(t==null?void 0:t.jsonContents),h.setItemData(t==null?void 0:t.jsonContents);return}if(!(t!=null&&t.content)||(t==null?void 0:t.content)==="")return;const c=G.expandStringToJson(t==null?void 0:t.content);h.setOriginalData(c),h.setItemData(c)},{deep:!0,immediate:!0});const w=c=>Z.getComponent(c);return(c,g)=>{var B;return((B=C.value)==null?void 0:B.length)>0?(e.openBlock(),e.createElementBlock("div",v,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(d,b)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:b},[e.createElementVNode("div",ee,e.toDisplayString(d.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w(d.comp)),{itemData:d==null?void 0:d.compData,childItemData:d==null?void 0:d.itemChildData,key:b,onChange:I,index:b,onContentChange:S},null,40,["itemData","childItemData","index"]))]))),128))])):e.createCommentVNode("",!0)}}},ne=K._export_sfc(te,[["__scopeId","data-v-1c04adc8"]]),oe={class:"add-model-content"},ae={key:0,class:"model-import-data"},re={class:"import-button"},le={key:0},ce={key:1,class:"model-operate"},se={class:"model-select"},ue={class:"model-fill"},ie={key:2,class:"model-view ssComponent"},de={__name:"main",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change"],setup(E,{emit:j}){const t=E,x=j,h=e.ref(""),p=e.ref([]),_=e.ref(0),C=T.useModelComp(i.pinia);T.useMenuState(i.pinia);const{itemData:I,originalData:S}=i.storeToRefs(C),w=e.ref(null),c=e.ref(0),g=e.ref(""),B=()=>{_.value=window.innerWidth},d=async r=>{var u;const a=(u=i.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(k=>((k==null?void 0:k.key)==="formContent"&&(k.contents=G.arrayToNumberArray(k==null?void 0:k.contents)),k))),o});x("change",{originalContents:S.value,currentContents:r==null?void 0:r.wholeValue,editContent:r==null?void 0:r.editValue,stringContent:b(i.cloneDeep(r==null?void 0:r.wholeValue)),arrayToContents:a})},b=r=>{var u;let a=[];return(u=i.cloneDeep(r))==null||u.forEach(o=>{var f,k;V!=null&&V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp))&&a.push(((f=V==null?void 0:V.find(n=>(n==null?void 0:n.value)===(o==null?void 0:o.comp)))==null?void 0:f.key)+"="+o.name+"/r/n"),(k=o==null?void 0:o.compData)==null||k.forEach(n=>{var F,$,J,A,q,M,L,R,z,W,H,P;if(s!=null&&s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))if(!((F=n==null?void 0:n.contents)!=null&&F.length))a.push((($=s==null?void 0:s.find(m=>(m==null?void 0:m.value)===(n==null?void 0:n.key)))==null?void 0:$.key)+"="+(n.contents===!0?'""':"Vertical")+"/r/n");else{let m=(J=n==null?void 0:n.contents)==null?void 0:J[0];if(!m)return;if(Object.keys(m).includes("label")&&Object.keys(m).includes("key")&&Object.keys(m).includes("width"))if(((q=(A=n.contents)==null?void 0:A.filter(y=>y.width!==1))==null?void 0:q.length)===0){const y=(M=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:M.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(y)+"/r/n")}else{let y=[];(R=i.cloneDeep(n==null?void 0:n.contents))==null||R.reduce((l,D)=>{var U;return l[D.label]=D.key,((U=Object.keys(i.cloneDeep(l)))==null?void 0:U.length)>=D.width&&(y.push(i.cloneDeep(l)),l={}),l},{}),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(y)+"/r/n")}else if(Object.keys(m).includes("label")){const y=(W=i.cloneDeep(n==null?void 0:n.contents))==null?void 0:W.map(l=>l.label);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(y)+"/r/n")}else a.push(((P=s==null?void 0:s.find(y=>(y==null?void 0:y.value)===(n==null?void 0:n.key)))==null?void 0:P.key)+"="+JSON.stringify(n==null?void 0:n.contents)+"/r/n")}})}),JSON.stringify(a)},N=e.ref([]),Q=()=>{w.value.click()},X=r=>{const a=r.target.files[0];if(!a)return;const u=new FileReader;u.onload=o=>{try{h.value=o.target.result,N.value=Y(o.target.result),c.value++}catch(f){console.error("解析失败:",f)}},u.onerror=o=>{console.error("文件读取错误:",o)},u.readAsText(a)};e.onMounted(()=>{window.addEventListener("resize",B)}),e.onUnmounted(()=>{window.removeEventListener("resize",B)}),e.watch(()=>[t==null?void 0:t.content,t==null?void 0:t.jsonContents],()=>{h.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=N.value)==null?void 0:r.length)!==0&&(C.setOriginalData(N.value),C.setItemData(N.value))},{deep:!0,immediate:!0});const Y=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",oe,[((u=t==null?void 0:t.jsonContents)==null?void 0:u.length)===0?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:w,accept:".txt",onChange:X,style:{display:"none"}},null,544),e.createElementVNode("button",{onClick:Q,class:"import-button-content"},"导入文件"),g.value?(e.openBlock(),e.createElementBlock("span",le,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",se,[e.createVNode(O.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:_.value},[e.createVNode(O.modelShow)])),e.createElementVNode("div",ue,[e.createVNode(O.modelFill)])])):e.createCommentVNode("",!0),(t==null?void 0:t.mode)==="view"?(e.openBlock(),e.createElementBlock("div",ie,[(e.openBlock(),e.createBlock(ne,{content:h.value,onChange:d,jsonContents:p.value,key:_.value},null,8,["content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},me=K._export_sfc(de,[["__scopeId","data-v-91ce80be"]]);exports.default=me;
|
package/dist/ss-component.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),C=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CttArv-I.cjs");require("./index-C8qRkCgn.cjs");const s=require("./ss-component2.cjs"),v=require("./index-DOCHgBta.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),C=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CttArv-I.cjs");require("./index-C8qRkCgn.cjs");const s=require("./ss-component2.cjs"),v=require("./index-DOCHgBta.cjs"),t=require("./index-9hspBVrQ.cjs"),r=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-Eaaucypj.cjs")));r.install=e=>{e.component("ssComponent",r)};const i=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BNUNEmtk.cjs")).then(e=>e.index$1));i.install=e=>{e.component("ssTab",i)};const c=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CCv3E1hu.cjs")));c.install=e=>{e.component("ssMenu",c)};const l=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-DnR6vlBp.cjs")));l.install=e=>{e.component("ssMenuComponent",l)};const m=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-TGiBKb6v.cjs")));m.install=e=>{e.component("ssCanvas",m)};const u=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BVaHwt5f.cjs")));u.install=e=>{e.component("ssFold",u)};const a=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-w0NOZSwp.cjs")).then(e=>e.index));a.install=e=>{e.component("ssAvatar",a)};const h=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-DQ0V145w.cjs")));h.install=e=>{e.component("ssThree",h)};const f=n.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-Drc-zri7.cjs")).then(e=>e.threeViewerHost));f.install=e=>{e.component("threeViewerHost",f)};const p=v.useMenuState(),P=[r,i,c,l,m,u,a,h,f],q=e=>{P.forEach(o=>{e.use(o)}),e.use(s),e.config.globalProperties.$router=s},g=e=>{switch(e){case"browser":return t.browserThemeConfig;case"client":return t.clientThemeConfig;case"three":return t.threeThemeConfig}},y=e=>{const o=document.documentElement;e==null||e.forEach(d=>{o.style.setProperty(d.name,d.value)})},A=e=>{p.setPlatform(e);const o=g(e);y(o)},T={getPlatform:p.getPlatform,setPlatform:p.setPlatform,initPlatform:A};exports.SvgIcon=C.SvgIcon;exports.router=s;exports.default=q;exports.platformApi=T;
|
package/dist/ss-component.js
CHANGED
|
@@ -5,7 +5,7 @@ import "./index-DIUrwul5.js";
|
|
|
5
5
|
import u from "./ss-component2.js";
|
|
6
6
|
import { u as C } from "./index-AIq5wzuR.js";
|
|
7
7
|
import { t as g, c as T, b as P } from "./index-CAPx0_D4.js";
|
|
8
|
-
const n = o(() => import("./main-
|
|
8
|
+
const n = o(() => import("./main-ClisO4tc.js"));
|
|
9
9
|
n.install = (t) => {
|
|
10
10
|
t.component("ssComponent", n);
|
|
11
11
|
};
|
|
@@ -13,11 +13,11 @@ const s = o(() => import("./index-Dv0vEhwk.js").then((t) => t.k));
|
|
|
13
13
|
s.install = (t) => {
|
|
14
14
|
t.component("ssTab", s);
|
|
15
15
|
};
|
|
16
|
-
const r = o(() => import("./index-
|
|
16
|
+
const r = o(() => import("./index-BN6q1mp6.js"));
|
|
17
17
|
r.install = (t) => {
|
|
18
18
|
t.component("ssMenu", r);
|
|
19
19
|
};
|
|
20
|
-
const m = o(() => import("./index-
|
|
20
|
+
const m = o(() => import("./index-CTdsm8Ah.js"));
|
|
21
21
|
m.install = (t) => {
|
|
22
22
|
t.component("ssMenuComponent", m);
|
|
23
23
|
};
|
package/dist/ss-component2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-Z3NUprRN.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CcS5ZULi.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-Z3NUprRN.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-CcS5ZULi.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-Dt8SqpFR.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-WPSxI7w5.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CHX8jQ1H.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BHphPH8W.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-GxvfLkVZ.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-B9RguO5-.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-DR3ue0zQ.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-DzG6zsw5.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-C2vmfHa1.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-Cnus_1Kj.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
|
package/dist/ss-component2.js
CHANGED
|
@@ -13,7 +13,7 @@ const a = [
|
|
|
13
13
|
{
|
|
14
14
|
path: "/",
|
|
15
15
|
name: "Model",
|
|
16
|
-
component: async () => import("./index-
|
|
16
|
+
component: async () => import("./index-BuGSZUdn.js"),
|
|
17
17
|
// component: async ()=>import('@/components/views/model/component/main.vue'),
|
|
18
18
|
// component: async ()=>import('@/components/views/canvas/index.vue'),
|
|
19
19
|
// component: async ()=>import('@/components/views/test/index.vue'),
|