ss-component-new 1.3.478 → 1.3.479
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-JW1bo4Ef.js → index-BFxv4IR-.js} +27 -27
- package/dist/{index-4dupsHwD.js → index-Bi1oVfaF.js} +2 -2
- package/dist/index-Bx4_opNC.cjs +1 -0
- package/dist/{index-DIukLdKX.cjs → index-DYm_0Gjd.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +1 -1
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/package.json +1 -1
- package/dist/index-D8TN_LEZ.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineAsyncComponent as gt, computed as we, onMounted as Qe, resolveComponent as Q, createBlock as Le, openBlock as F, withCtx as
|
|
1
|
+
import { defineAsyncComponent as gt, computed as we, onMounted as Qe, resolveComponent as Q, createBlock as Le, openBlock as F, withCtx as q, resolveDynamicComponent as Xe, defineComponent as Ct, defineProps as kt, ref as O, watch as Ke, reactive as _t, nextTick as Dt, createElementBlock as K, Fragment as Be, createVNode as $, createCommentVNode as Te, normalizeStyle as It, toDisplayString as $e, createElementVNode as Me, renderList as ze, createTextVNode as xe } from "vue";
|
|
2
2
|
import { u as St, a as bt, p as Je, b as Tt, s as Ee, c as je, v as Fe } from "./index-CwJwXVns.js";
|
|
3
3
|
import { S as Mt } from "./index-BHtNKL1L.js";
|
|
4
4
|
import "./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-CxgD2Ymu.js";
|
|
@@ -28,7 +28,7 @@ const qt = {
|
|
|
28
28
|
}), (f, a) => {
|
|
29
29
|
const l = Q("el-icon");
|
|
30
30
|
return F(), Le(l, null, {
|
|
31
|
-
default:
|
|
31
|
+
default: q(() => [
|
|
32
32
|
(F(), Le(Xe(S.value)))
|
|
33
33
|
]),
|
|
34
34
|
_: 1
|
|
@@ -101,7 +101,7 @@ function Ve(i = "menu") {
|
|
|
101
101
|
operateType: "修改菜单名",
|
|
102
102
|
operateIcon: "FixedMenu"
|
|
103
103
|
}
|
|
104
|
-
]), l = St(), r = bt(Je), I = Tt(Je), { loginUserInfo: w } = Ee(I), M = O(0), y = Bt(), u = O(), { asideMenus: R, menuTriggerType: o, platform: Ie, jumpMenuInform:
|
|
104
|
+
]), l = St(), r = bt(Je), I = Tt(Je), { loginUserInfo: w } = Ee(I), M = O(0), y = Bt(), u = O(), { asideMenus: R, menuTriggerType: o, platform: Ie, jumpMenuInform: z } = Ee(l), { fixMenuStatus: Se } = Ee(r), { isSuperAdmin: be } = xt(), B = we(() => f == null ? void 0 : f.mode), ue = (t) => t == null ? void 0 : t.map((e) => {
|
|
105
105
|
var p, d;
|
|
106
106
|
return !(e != null && e.children) || ((p = e == null ? void 0 : e.children) == null ? void 0 : p.length) === 0 ? e.config = a.value : e != null && e.children && ((d = e == null ? void 0 : e.children) == null ? void 0 : d.length) > 0 && (e.children = ue(e.children)), e;
|
|
107
107
|
}), Oe = we(() => {
|
|
@@ -117,7 +117,7 @@ function Ve(i = "menu") {
|
|
|
117
117
|
r.setRouteToChildPath(""), l.setMenuTriggerType("click"), l.setActiveMenuPath(t == null ? void 0 : t.path), l.setActiveAsideMenu(t), t.isRouter ? y.push(t.path) : y.push("/"), S("node-click", t, s);
|
|
118
118
|
}, me = async (t) => {
|
|
119
119
|
const s = $t(Oe.value, "path", t);
|
|
120
|
-
l.setActiveAsideMenu(s), r.setRouteToChildPath(""), Se.value ? r.setFixMenuStatus(!1) : (Z.value && (o.value = "open"), o.value === "click" ? l.setActiveMenuPath(t) : Z.value || (l.setMenuTriggerType("click"),
|
|
120
|
+
l.setActiveAsideMenu(s), r.setRouteToChildPath(""), Se.value ? r.setFixMenuStatus(!1) : (Z.value && (o.value = "open"), o.value === "click" ? z.value || l.setActiveMenuPath(t) : Z.value || (l.setMenuTriggerType("click"), z.value || l.setActiveMenuPath(t))), t != null && t.startsWith("/") ? y.push(t) : y.push("/"), M.value++;
|
|
121
121
|
}, et = (t) => {
|
|
122
122
|
Z.value || l.setActiveMenuPath(t);
|
|
123
123
|
}, X = (t) => {
|
|
@@ -142,7 +142,7 @@ function Ve(i = "menu") {
|
|
|
142
142
|
);
|
|
143
143
|
const lt = (t, s) => ({
|
|
144
144
|
isFlag: !0
|
|
145
|
-
}),
|
|
145
|
+
}), x = _t({
|
|
146
146
|
show: !1,
|
|
147
147
|
title: "菜单配置",
|
|
148
148
|
width: "30%",
|
|
@@ -158,7 +158,7 @@ function Ve(i = "menu") {
|
|
|
158
158
|
}
|
|
159
159
|
}, Re = O({}), rt = (t) => {
|
|
160
160
|
l.setCacheInputMenu({
|
|
161
|
-
type:
|
|
161
|
+
type: x.type,
|
|
162
162
|
data: t
|
|
163
163
|
}), l.setIsRefreshMenus(!0);
|
|
164
164
|
}, nt = async (t, s, e) => {
|
|
@@ -182,19 +182,19 @@ function Ve(i = "menu") {
|
|
|
182
182
|
(D) => (D == null ? void 0 : D.key) === "tableContents"
|
|
183
183
|
)) == null ? void 0 : oe.contents, G;
|
|
184
184
|
T == null || T.forEach((D) => {
|
|
185
|
-
var N,
|
|
185
|
+
var N, J;
|
|
186
186
|
if (D.length === 1)
|
|
187
187
|
((N = D == null ? void 0 : D[0]) == null ? void 0 : N[k]) === (e == null ? void 0 : e.title) && (G = D == null ? void 0 : D[0], G[k] = U);
|
|
188
188
|
else {
|
|
189
|
-
let c = (
|
|
189
|
+
let c = (J = v == null ? void 0 : v.filter((h) => h !== "操作")) == null ? void 0 : J.map((h) => h == null ? void 0 : h.prop), E = D == null ? void 0 : D.filter((h) => !(h != null && h.id)), A = Ne(E, c);
|
|
190
190
|
A[k] = U, G = A;
|
|
191
191
|
}
|
|
192
192
|
}), await Ot({
|
|
193
193
|
key: {
|
|
194
194
|
type: "data",
|
|
195
195
|
pageKey: (re = (ie = (ae = e == null ? void 0 : e.path) == null ? void 0 : ae.split("/")) == null ? void 0 : ie.filter((D, N) => {
|
|
196
|
-
var
|
|
197
|
-
return N !== ((c = (
|
|
196
|
+
var J, c;
|
|
197
|
+
return N !== ((c = (J = e == null ? void 0 : e.path) == null ? void 0 : J.split("/")) == null ? void 0 : c.length) - 1;
|
|
198
198
|
})) == null ? void 0 : re.join("/"),
|
|
199
199
|
tableId: _ == null ? void 0 : _.id,
|
|
200
200
|
systemKey: sessionStorage.getItem("systemKey"),
|
|
@@ -227,7 +227,7 @@ function Ve(i = "menu") {
|
|
|
227
227
|
), l.setActiveTopMenuPath((De = (_e = e == null ? void 0 : e.path) == null ? void 0 : _e.split("/")) == null ? void 0 : De[0]), l.setIsRefreshMenus(!1), l.setIsRefreshMenus(!0);
|
|
228
228
|
}
|
|
229
229
|
}, pt = async (t, s) => {
|
|
230
|
-
var te, le, se, oe, ae, ie, re, ne, pe, ce, fe, he, de, ve, ye, ge, Ce, ke, _e, De, U, P, j, _, v, k, T, G, D, N,
|
|
230
|
+
var te, le, se, oe, ae, ie, re, ne, pe, ce, fe, he, de, ve, ye, ge, Ce, ke, _e, De, U, P, j, _, v, k, T, G, D, N, J;
|
|
231
231
|
let e = await qe({
|
|
232
232
|
key: {
|
|
233
233
|
systemKey: sessionStorage.getItem("systemKey"),
|
|
@@ -290,15 +290,15 @@ function Ve(i = "menu") {
|
|
|
290
290
|
var A, h;
|
|
291
291
|
return E !== ((h = (A = s == null ? void 0 : s.path) == null ? void 0 : A.split("/")) == null ? void 0 : h.length) - 1;
|
|
292
292
|
})) == null ? void 0 : D.join("/")
|
|
293
|
-
), l.setActiveTopMenuPath((
|
|
293
|
+
), l.setActiveTopMenuPath((J = (N = s == null ? void 0 : s.path) == null ? void 0 : N.split("/")) == null ? void 0 : J[0]), l.setIsRefreshMenus(!1), l.setIsRefreshMenus(!0), u.value = void 0;
|
|
294
294
|
}, ct = async (t, s) => {
|
|
295
|
-
|
|
295
|
+
x.type = it(s == null ? void 0 : s.operateType), await nt(s, x.type, t), Y.value = t, Re.value = s;
|
|
296
296
|
}, ft = () => {
|
|
297
|
-
|
|
297
|
+
x.show = !1;
|
|
298
298
|
}, ht = (t) => t == null ? void 0 : t.filter((s) => s.allowInherit), dt = () => {
|
|
299
299
|
var e, p, d, C, W;
|
|
300
300
|
let t;
|
|
301
|
-
|
|
301
|
+
x.type === "create" && (t = ((e = Y.value) == null ? void 0 : e.path) + "/" + ee.value[(p = ee.value) == null ? void 0 : p.prop]), x.type === "update" && (t = (d = Y.value) == null ? void 0 : d.path);
|
|
302
302
|
const s = {
|
|
303
303
|
...Y.value,
|
|
304
304
|
//是否继承父菜单的配置
|
|
@@ -308,7 +308,7 @@ function Ve(i = "menu") {
|
|
|
308
308
|
title: ee.value[(W = ee.value) == null ? void 0 : W.prop],
|
|
309
309
|
path: t
|
|
310
310
|
};
|
|
311
|
-
console.log("clickSubmitForm", Re.value, Y.value, s), rt(s),
|
|
311
|
+
console.log("clickSubmitForm", Re.value, Y.value, s), rt(s), x.show = !1;
|
|
312
312
|
}, vt = (t) => {
|
|
313
313
|
var e, p;
|
|
314
314
|
const s = (e = t == null ? void 0 : t.contents) == null ? void 0 : e.find((d) => d.key === "formContent");
|
|
@@ -328,7 +328,7 @@ function Ve(i = "menu") {
|
|
|
328
328
|
const d = p == null ? void 0 : p.path;
|
|
329
329
|
Ae.value && ((e = Ae.value) == null || e.openMenuRefByIndex(d));
|
|
330
330
|
} else
|
|
331
|
-
|
|
331
|
+
z != null && z.value ? l.setJumpMenuInform(!1) : l.setActiveMenuPath((p == null ? void 0 : p.path) ?? "");
|
|
332
332
|
}
|
|
333
333
|
}, { immediate: !0 }), {
|
|
334
334
|
menuRef: Ae,
|
|
@@ -339,7 +339,7 @@ function Ve(i = "menu") {
|
|
|
339
339
|
dialogRenderComps: at,
|
|
340
340
|
getComponents: st,
|
|
341
341
|
clickSubmitForm: dt,
|
|
342
|
-
dialogInfo:
|
|
342
|
+
dialogInfo: x,
|
|
343
343
|
beforeDialogDestroy: ft,
|
|
344
344
|
clickMenuIcon: ct,
|
|
345
345
|
mode: B,
|
|
@@ -378,14 +378,14 @@ function Vt(i, n, S, f, a, l) {
|
|
|
378
378
|
onOpenMenu: i.openMenu,
|
|
379
379
|
onCloseMenu: i.closeMenu
|
|
380
380
|
}, {
|
|
381
|
-
title:
|
|
382
|
-
var Ie,
|
|
381
|
+
title: q(({ menu: o }) => {
|
|
382
|
+
var Ie, z, Se, be;
|
|
383
383
|
return [
|
|
384
384
|
!i.fixElement || (o == null ? void 0 : o.path) !== ((Ie = i.fixElement) == null ? void 0 : Ie.path) ? (F(), K("span", {
|
|
385
385
|
key: 0,
|
|
386
386
|
title: o.title,
|
|
387
387
|
class: "menu-title",
|
|
388
|
-
style: It({ marginRight: o != null && o.config && ((
|
|
388
|
+
style: It({ marginRight: o != null && o.config && ((z = o == null ? void 0 : o.config) == null ? void 0 : z.length) > 0 ? "25px" : "1px" })
|
|
389
389
|
}, $e(o.title ?? ""), 13, Gt)) : Te("", !0),
|
|
390
390
|
i.fixElement && (o == null ? void 0 : o.path) === ((Se = i.fixElement) == null ? void 0 : Se.path) ? (F(), K("span", Nt, [
|
|
391
391
|
$(r, {
|
|
@@ -400,13 +400,13 @@ function Vt(i, n, S, f, a, l) {
|
|
|
400
400
|
trigger: "hover",
|
|
401
401
|
"popper-class": "menu-operate-popover"
|
|
402
402
|
}, {
|
|
403
|
-
reference:
|
|
403
|
+
reference: q(() => [
|
|
404
404
|
$(I, {
|
|
405
405
|
name: "more",
|
|
406
406
|
style: { cursor: "pointer", width: "15px", height: "15px" }
|
|
407
407
|
})
|
|
408
408
|
]),
|
|
409
|
-
default:
|
|
409
|
+
default: q(() => [
|
|
410
410
|
Me("div", Xt, [
|
|
411
411
|
(F(!0), K(Be, null, ze(o == null ? void 0 : o.config, (B) => (F(), K("div", {
|
|
412
412
|
class: "menu-config-item",
|
|
@@ -445,7 +445,7 @@ function Vt(i, n, S, f, a, l) {
|
|
|
445
445
|
width: i.dialogInfo.width,
|
|
446
446
|
onBeforeDestroy: i.beforeDialogDestroy
|
|
447
447
|
}, {
|
|
448
|
-
default:
|
|
448
|
+
default: q(() => [
|
|
449
449
|
Me("div", Zt, [
|
|
450
450
|
(F(!0), K(Be, null, ze(i.dialogRenderComps, (o) => (F(), K("div", {
|
|
451
451
|
key: o.id
|
|
@@ -460,13 +460,13 @@ function Vt(i, n, S, f, a, l) {
|
|
|
460
460
|
]))), 128))
|
|
461
461
|
])
|
|
462
462
|
]),
|
|
463
|
-
footer:
|
|
463
|
+
footer: q(() => [
|
|
464
464
|
Me("div", null, [
|
|
465
465
|
$(y, {
|
|
466
466
|
id: "themeBorderButton",
|
|
467
467
|
onClick: i.beforeDialogDestroy
|
|
468
468
|
}, {
|
|
469
|
-
default:
|
|
469
|
+
default: q(() => n[1] || (n[1] = [
|
|
470
470
|
xe("取消")
|
|
471
471
|
])),
|
|
472
472
|
_: 1,
|
|
@@ -476,7 +476,7 @@ function Vt(i, n, S, f, a, l) {
|
|
|
476
476
|
id: "themeButton",
|
|
477
477
|
onClick: i.clickSubmitForm
|
|
478
478
|
}, {
|
|
479
|
-
default:
|
|
479
|
+
default: q(() => n[2] || (n[2] = [
|
|
480
480
|
xe(" 确认 ")
|
|
481
481
|
])),
|
|
482
482
|
_: 1,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as wl, defineComponent as _l, defineProps as jt, ref as D, watch as vl, onMounted as Kl, onUnmounted as tt, resolveComponent as te, createBlock as ve, openBlock as p, withCtx as o, createElementVNode as L, toDisplayString as ol, createElementBlock as ae, Fragment as al, renderList as ul, createCommentVNode as xe, normalizeStyle as El, createVNode as s, unref as n, resolveDynamicComponent as oa, provide as Ga, shallowRef as cs, resolveDirective as nt, withDirectives as ql, vShow as pa, createTextVNode as rl, renderSlot as Nl, normalizeClass as Ol, createSlots as gt, mergeProps as Bn, withModifiers as xl, defineAsyncComponent as pn, reactive as Rl, nextTick as Wl, withKeys as us } from "vue";
|
|
2
2
|
import { m as Ot, a as Lt, b as Qt, c as ds } from "./array-CdymP2Bv.js";
|
|
3
3
|
import { u as Vl, p as bl, s as gl, c as kl, a as ea, b as Fl, i as Ea, d as yt, l as ps, j as ga, e as Sa, E as ya, k as St, m as Za, v as $a, n as En, o as fs, q as Dn, h as vs, r as bt, t as ra, w as fn, x as hs, y as Pn, z as gs, A as ys, B as Rn, C as vn, D as bs, F as Cs } from "./index-CwJwXVns.js";
|
|
4
|
-
import { _ as st, s as Nt, a as ms } from "./index-
|
|
4
|
+
import { _ as st, s as Nt, a as ms } from "./index-BFxv4IR-.js";
|
|
5
5
|
import { useRouter as Da } from "vue-router";
|
|
6
6
|
import { a as ot, d as Kt, e as it, f as rt, g as ct, h as ut, t as ws, c as ks, b as As } from "./index-ChNfRlIP.js";
|
|
7
7
|
import { g as Ba, s as Is, a as hn, _ as Tt, b as Ms, u as _s, c as xn, X as Ss, Q as Ts } from "./index-CeP6fhJc.js";
|
|
@@ -6773,7 +6773,7 @@ function os(l = "menu") {
|
|
|
6773
6773
|
S.setRouteToChildPath(""), j.setMenuTriggerType("click"), j.setActiveMenuPath(a == null ? void 0 : a.path), j.setActiveAsideMenu(a), a.isRouter ? le.push(a.path) : le.push("/"), c("node-click", a, f);
|
|
6774
6774
|
}, Re = async (a) => {
|
|
6775
6775
|
const f = jl(C.value, "path", a);
|
|
6776
|
-
j.setActiveAsideMenu(f), S.setRouteToChildPath(""), oe.value ? S.setFixMenuStatus(!1) : (qe.value && (B.value = "open"), B.value === "click" ? j.setActiveMenuPath(a) : qe.value || (j.setMenuTriggerType("click"), u.value || j.setActiveMenuPath(a))), a != null && a.startsWith("/") ? le.push(a) : le.push("/"), P.value++;
|
|
6776
|
+
j.setActiveAsideMenu(f), S.setRouteToChildPath(""), oe.value ? S.setFixMenuStatus(!1) : (qe.value && (B.value = "open"), B.value === "click" ? u.value || j.setActiveMenuPath(a) : qe.value || (j.setMenuTriggerType("click"), u.value || j.setActiveMenuPath(a))), a != null && a.startsWith("/") ? le.push(a) : le.push("/"), P.value++;
|
|
6777
6777
|
}, ie = (a) => {
|
|
6778
6778
|
qe.value || j.setActiveMenuPath(a);
|
|
6779
6779
|
}, K = (a) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),w=require("./index-CMUsYepp.cjs"),He=require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-Byr5bNn8.cjs");const me=require("./request-Dl8yi2iS.cjs"),et=require("./index-B-pflqKE.cjs"),tt=require("./index-BAsHBLV9.cjs"),ot=require("vue-router"),ke=require("./index-DKh4EyHV.cjs"),z=require("./index-DmwxzDGW.cjs"),lt=require("./index-C1kHWH8t.cjs"),st=require("./menuIndex-CBqMx085.cjs"),ue=require("./index-B7964G2F.cjs"),it=require("./index-DXiuTpL6.cjs"),at=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Se=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BAsHBLV9.cjs")).then(r=>r.index));Se.install=r=>{r.component("ssMenu",Se)};const Ee={__name:"index",props:{name:String},setup(r){const c=r,S=t.computed(()=>me.Icons[c.name]);return t.onMounted(()=>{}),(h,a)=>{const l=t.resolveComponent("el-icon");return t.openBlock(),t.createBlock(l,null,{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(S.value)))]),_:1})}}},xe=(r,c,S=0)=>{let h=r;return h!=null&&h.every(a=>Array.isArray(a))&&(h!=null&&h.every(a=>Array.isArray(a)&&a.length===1)?h=h==null?void 0:h.filter(a=>(a==null?void 0:a[0])!==(c==null?void 0:c[S])):h=h==null?void 0:h.map(a=>{if(a!=null&&a.find(l=>l===(c==null?void 0:c[S]))&&(c==null?void 0:c.length)!==1){let l=w.cloneDeep(c),n=a==null?void 0:a.filter(C=>C!==(l==null?void 0:l[S])),I=S+1,M=xe(n,l,I),b=[];b.push(a==null?void 0:a[0]),M==null||M.forEach(C=>{b.push(C)}),a=b}return a})),h},qe=(r,c,S,h=0)=>{let a=r;return a!=null&&a.every(l=>Array.isArray(l))&&(a!=null&&a.every(l=>Array.isArray(l)&&l.length===1)?a.push([S]):a=a==null?void 0:a.map(l=>{if(l!=null&&l.find(n=>n===(c==null?void 0:c[h]))&&(c==null?void 0:c.length)!==1){let n=w.cloneDeep(c),I=l==null?void 0:l.filter(E=>E!==(n==null?void 0:n[h])),M=h+1,b=qe(I,n,S,M),C=[];C.push(l==null?void 0:l[0]),b==null||b.forEach(E=>{C.push(E)}),l=C}return l})),a},be=(r,c,S,h,a=0)=>{let l=r;return l!=null&&l.every(n=>Array.isArray(n))&&(l!=null&&l.every(n=>Array.isArray(n)&&n.length===1)?l=l==null?void 0:l.map(n=>((n==null?void 0:n[0])===S&&(n=[h]),n)):l=l==null?void 0:l.map(n=>{if(n!=null&&n.find(I=>I===(c==null?void 0:c[a]))&&(c==null?void 0:c.length)!==1){let I=w.cloneDeep(c),M=n==null?void 0:n.filter(L=>L!==(I==null?void 0:I[a])),b=a+1,C=be(M,I,S,h,b),E=[];E.push(n==null?void 0:n[0]),C==null||C.forEach(L=>{E.push(L)}),n=E}return n})),l};function Ve(r="menu"){return{name:r,components:{SvgIcon:He.SvgIcon,ssMenu:Se,DynamicIcon:Ee,ssDialog:et.ssDialog,ssInput:tt.ssInput},setup(c,{emit:S}){const h=t.defineProps({mode:{type:String,default:"vertical"}}),a=t.ref([{allowInherit:!1,operateType:"复制新增",operateIcon:"CopyAddMenu"},{allowInherit:!1,operateType:"删除",operateIcon:"DeleteMenu"},{allowInherit:!1,operateType:"修改菜单名",operateIcon:"FixedMenu"}]),l=w.useMenuState(),n=w.useModelComp(w.pinia),I=w.useLoginState(w.pinia),{loginUserInfo:M}=w.storeToRefs(I),b=t.ref(0),C=ot.useRouter(),E=t.ref(),{asideMenus:L,menuTriggerType:i,platform:De,jumpMenuInform:U}=w.storeToRefs(l),{fixMenuStatus:_e}=w.storeToRefs(n),{isSuperAdmin:Ie}=it.useRole(),q=t.computed(()=>h==null?void 0:h.mode),Be=o=>o==null?void 0:o.map(e=>{var p,v;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=a.value:e!=null&&e.children&&((v=e==null?void 0:e.children)==null?void 0:v.length)>0&&(e.children=Be(e.children)),e}),we=t.computed(()=>{let o=[...L.value];if((o==null?void 0:o.length)===0)return C.push("/"),[];const s=Ue(o,Le.value);return s.isFlag||(o=s==null?void 0:s.data),o=o==null?void 0:o.map(e=>{var p,v;return!(e!=null&&e.children)||((p=e==null?void 0:e.children)==null?void 0:p.length)===0?e.config=a.value:e!=null&&e.children&&((v=e==null?void 0:e.children)==null?void 0:v.length)>0&&(e.children=Be(e.children)),e}),o}),Fe=async(o,s)=>{n.setRouteToChildPath(""),l.setMenuTriggerType("click"),l.setActiveMenuPath(o==null?void 0:o.path),l.setActiveAsideMenu(o),o.isRouter?C.push(o.path):C.push("/"),S("node-click",o,s)},Ne=async o=>{const s=st.findNodeByPropInTree(we.value,"path",o);l.setActiveAsideMenu(s),n.setRouteToChildPath(""),_e.value?n.setFixMenuStatus(!1):(G.value&&(i.value="open"),i.value==="click"?U.value||l.setActiveMenuPath(o):G.value||(l.setMenuTriggerType("click"),U.value||l.setActiveMenuPath(o))),o!=null&&o.startsWith("/")?C.push(o):C.push("/"),b.value++},$e=o=>{G.value||l.setActiveMenuPath(o)},J=o=>{const s=document.documentElement;o==null||o.forEach(e=>{s.style.setProperty(e.name,e.value)})};t.onMounted(()=>{b.value=1});const Le=t.computed(()=>{const o=sessionStorage.getItem("authority");return o?JSON.parse(o):[]});t.watch(()=>De.value,o=>{o==="browser"?J(ke.browserVerticalMenuClasses):o==="client"?(J(ke.clientHorizontalMenuClasses),J(ke.clientVerticalMenuClasses)):o==="three"&&(J(ke.threeHorizontalMenuClasses),J(ke.threeVerticalMenuClasses))},{immediate:!0});const Ue=(o,s)=>({isFlag:!0}),R=t.reactive({show:!1,title:"菜单配置",width:"30%",type:"create"}),Re=o=>lt.getComponent(o),je=t.ref({}),Pe=t.ref([]),Z=t.ref({}),W=t.ref({}),Oe=o=>{switch(o){case"复制新增":return"create";case"修改菜单名":return"update";case"删除":return"delete"}},Me=t.ref({}),Ke=o=>{l.setCacheInputMenu({type:R.type,data:o}),l.setIsRefreshMenus(!0)},ze=async(o,s,e)=>{var p,v,k,P,B,Q,A,H,m,ee,te,oe,le,se,ie,ae,re,ne,ce,pe,de,he,fe,ve,ye,Ce,ge;if(s==="create"){let F=(e==null?void 0:e.title)+"(1)",$=(v=(p=e==null?void 0:e.path)==null?void 0:p.split("/"))==null?void 0:v.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}),N=await ue.getItemData((B=(P=(k=e==null?void 0:e.path)==null?void 0:k.split("/"))==null?void 0:P.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}))==null?void 0:B.join("/"),sessionStorage.getItem("systemKey"),"");if($.push(F),$=$==null?void 0:$.join("/"),(N==null?void 0:N.length)>0){let D=N==null?void 0:N[0],y=(A=(Q=D==null?void 0:D.compData)==null?void 0:Q.find(u=>(u==null?void 0:u.key)==="header"))==null?void 0:A.contents;if(((H=y==null?void 0:y[0])==null?void 0:H.directiveLabel)==="#isMain"){let u=(m=y==null?void 0:y[0])==null?void 0:m.prop,T=(te=(ee=D==null?void 0:D.compData)==null?void 0:ee.find(_=>(_==null?void 0:_.key)==="tableContents"))==null?void 0:te.contents,O;T==null||T.forEach(_=>{var K,j;if(_.length===1)((K=_==null?void 0:_[0])==null?void 0:K[u])===(e==null?void 0:e.title)&&(O=_==null?void 0:_[0],O[u]=F);else{let d=(j=y==null?void 0:y.filter(f=>f!=="操作"))==null?void 0:j.map(f=>f==null?void 0:f.prop),V=_==null?void 0:_.filter(f=>!(f!=null&&f.id)),x=ue.getValueToObjectValue(V,d);x[u]=F,O=x}}),await z.createInsofDataApi({key:{type:"data",pageKey:(se=(le=(oe=e==null?void 0:e.path)==null?void 0:oe.split("/"))==null?void 0:le.filter((_,K)=>{var j,d;return K!==((d=(j=e==null?void 0:e.path)==null?void 0:j.split("/"))==null?void 0:d.length)-1}))==null?void 0:se.join("/"),tableId:D==null?void 0:D.id,systemKey:sessionStorage.getItem("systemKey"),createUserId:(ie=M.value)==null?void 0:ie.id,createUserLayer:((ae=M.value)==null?void 0:ae.dept)||((re=M.value)==null?void 0:re.部门名称)},value:{tableData:O}})}}await ue.newLoadingConstruct(e==null?void 0:e.path,$),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((pe=(ce=(ne=e==null?void 0:e.path)==null?void 0:ne.split("/"))==null?void 0:ce.filter((D,y)=>{var u,T;return y!==((T=(u=e==null?void 0:e.path)==null?void 0:u.split("/"))==null?void 0:T.length)-1}))==null?void 0:pe.join("/")),l.setActiveTopMenuPath((he=(de=e==null?void 0:e.path)==null?void 0:de.split("/"))==null?void 0:he[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0)}else if(s==="update")E.value=e;else if(s==="delete"){let F=[];(F==null?void 0:F.length)>0&&await z.batchDeleteInsofDataApi({ids:F}),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((ye=(ve=(fe=e==null?void 0:e.path)==null?void 0:fe.split("/"))==null?void 0:ve.filter(($,N)=>{var D,y;return N!==((y=(D=e==null?void 0:e.path)==null?void 0:D.split("/"))==null?void 0:y.length)-1}))==null?void 0:ye.join("/")),l.setActiveTopMenuPath((ge=(Ce=e==null?void 0:e.path)==null?void 0:Ce.split("/"))==null?void 0:ge[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0)}},Je=async(o,s)=>{var H,m,ee,te,oe,le,se,ie,ae,re,ne,ce,pe,de,he,fe,ve,ye,Ce,ge,F,$,N,D,y,u,T,O,_,K,j;let e=await z.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:"menu"}}),p=(m=(H=e==null?void 0:e.data)==null?void 0:H.result)==null?void 0:m[0],v=(ee=p==null?void 0:p.value)==null?void 0:ee.pageData;v.compData=(te=v.compData)==null?void 0:te.map(d=>{var V,x;return(d==null?void 0:d.key)==="menuContents"&&(d.contents=be(d.contents,(V=s==null?void 0:s.path)==null?void 0:V.split("/"),s==null?void 0:s.title,(x=o==null?void 0:o.target)==null?void 0:x.value)),d}),p!=null&&p.id&&await z.updateInsofDataApi({id:p==null?void 0:p.id,value:{pageData:v}});let k=(le=(oe=s==null?void 0:s.path)==null?void 0:oe.split("/"))==null?void 0:le.filter((d,V)=>{var x,f;return V!==((f=(x=s==null?void 0:s.path)==null?void 0:x.split("/"))==null?void 0:f.length)-1}),P=k==null?void 0:k.join("/");k.push((se=o==null?void 0:o.target)==null?void 0:se.value),k=k==null?void 0:k.join("/");let B=await ue.getItemData(P,sessionStorage.getItem("systemKey"),"");if(((ce=(ne=(re=(ae=(ie=B==null?void 0:B[0])==null?void 0:ie.compData)==null?void 0:ae.find(d=>(d==null?void 0:d.key)==="header"))==null?void 0:re.contents)==null?void 0:ne[0])==null?void 0:ce.directiveLabel)==="#isMain"){let d=(ve=(fe=(he=(de=(pe=B==null?void 0:B[0])==null?void 0:pe.compData)==null?void 0:de.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:he.contents)==null?void 0:fe[0])==null?void 0:ve.prop,V=(ge=(Ce=(ye=B==null?void 0:B[0])==null?void 0:ye.compData)==null?void 0:Ce.find(g=>(g==null?void 0:g.key)==="tableContents"))==null?void 0:ge.contents,x=(D=(N=($=(F=B==null?void 0:B[0])==null?void 0:F.compData)==null?void 0:$.find(g=>(g==null?void 0:g.key)==="header"))==null?void 0:N.contents)==null?void 0:D.map(g=>g==null?void 0:g.prop),f;if(V==null||V.forEach(g=>{var Y;let X=ue.getValueToObjectValue(g,x);(X==null?void 0:X[d])===s.title&&(f=X,f[d]=(Y=o==null?void 0:o.target)==null?void 0:Y.value)}),f){let g={};for(let Y in f)Y!=="id"&&(g[Y]=f==null?void 0:f[Y]);let X=[{id:f==null?void 0:f.id,value:{tableData:g}}];await z.batchUpdateInsofDataApi({dataList:X})}}let Q=await z.getInsofDataApi({key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:s==null?void 0:s.path}}),A=(u=(y=Q==null?void 0:Q.data)==null?void 0:y.result)==null?void 0:u.map(d=>({id:d==null?void 0:d.id,key:d==null?void 0:d.key}));A=A==null?void 0:A.map(d=>(d.key.pageKey=k,d)),(A==null?void 0:A.length)>0&&await z.batchUpdateInsofDataApi({dataList:A}),l.setUpdateMenuStatus(!1),await w.verifyStructureDataToStore(),l.setActiveMenuPath((_=(O=(T=s==null?void 0:s.path)==null?void 0:T.split("/"))==null?void 0:O.filter((d,V)=>{var x,f;return V!==((f=(x=s==null?void 0:s.path)==null?void 0:x.split("/"))==null?void 0:f.length)-1}))==null?void 0:_.join("/")),l.setActiveTopMenuPath((j=(K=s==null?void 0:s.path)==null?void 0:K.split("/"))==null?void 0:j[0]),l.setIsRefreshMenus(!1),l.setIsRefreshMenus(!0),E.value=void 0},We=async(o,s)=>{R.type=Oe(s==null?void 0:s.operateType),await ze(s,R.type,o),W.value=o,Me.value=s},Ge=()=>{R.show=!1},Qe=o=>o==null?void 0:o.filter(s=>s.allowInherit),Xe=()=>{var e,p,v,k,P;let o;R.type==="create"&&(o=((e=W.value)==null?void 0:e.path)+"/"+Z.value[(p=Z.value)==null?void 0:p.prop]),R.type==="update"&&(o=(v=W.value)==null?void 0:v.path);const s={...W.value,config:Qe((k=W.value)==null?void 0:k.config),children:[],childMenus:[],title:Z.value[(P=Z.value)==null?void 0:P.prop],path:o};console.log("clickSubmitForm",Me.value,W.value,s),Ke(s),R.show=!1},Ye=o=>{var e,p;const s=(e=o==null?void 0:o.contents)==null?void 0:e.find(v=>v.key==="formContent");s&&(Z.value=(p=s==null?void 0:s.contents)==null?void 0:p.reduce((v,k)=>(v[k.key]=k.value,v.prop=k.key,v),{}))},G=t.ref(!1),Ze=()=>{G.value=!G.value},Te=t.ref(null);return t.watch(()=>L.value,async o=>{var s,e;if(o){await t.nextTick();const p=o==null?void 0:o[0];if(((s=p==null?void 0:p.children)==null?void 0:s.length)>0){const v=p==null?void 0:p.path;Te.value&&((e=Te.value)==null||e.openMenuRefByIndex(v))}else U!=null&&U.value?l.setJumpMenuInform(!1):l.setActiveMenuPath((p==null?void 0:p.path)??"")}},{immediate:!0}),{menuRef:Te,isCollapse:G,handleMenuCollapse:Ze,handleCompChange:Ye,dialogForm:je,dialogRenderComps:Pe,getComponents:Re,clickSubmitForm:Xe,dialogInfo:R,beforeDialogDestroy:Ge,clickMenuIcon:We,mode:q,renderMenuList:we,clickMenu:Fe,openMenu:Ne,closeMenu:$e,changeMenuStyle:J,fixElement:E,onBlur:Je,isSuperAdmin:Ie}}}}const rt=t.defineComponent(Ve()),nt=["title"],ct={key:1,class:"menu-title",style:{display:"flex",width:"100px"}},pt={key:2,class:"menu-operate-icon"},dt={class:"menu-config-wrap"},ht=["onClick"],ft={class:"module-dialog-content"};function vt(r,c,S,h,a,l){var L;const n=t.resolveComponent("ss-input"),I=t.resolveComponent("svg-icon"),M=t.resolveComponent("el-popover"),b=t.resolveComponent("ss-menu"),C=t.resolveComponent("el-button"),E=t.resolveComponent("ss-dialog");return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(b,{ref:"menuRef",class:"vertical-menu",mode:r.mode,menuList:r.renderMenuList,isCollapse:r.isCollapse,uniqueOpened:!0,onClickMenu:r.clickMenu,onOpenMenu:r.openMenu,onCloseMenu:r.closeMenu},{title:t.withCtx(({menu:i})=>{var De,U,_e,Ie;return[!r.fixElement||(i==null?void 0:i.path)!==((De=r.fixElement)==null?void 0:De.path)?(t.openBlock(),t.createElementBlock("span",{key:0,title:i.title,class:"menu-title",style:t.normalizeStyle({marginRight:i!=null&&i.config&&((U=i==null?void 0:i.config)==null?void 0:U.length)>0?"25px":"1px"})},t.toDisplayString(i.title??""),13,nt)):t.createCommentVNode("",!0),r.fixElement&&(i==null?void 0:i.path)===((_e=r.fixElement)==null?void 0:_e.path)?(t.openBlock(),t.createElementBlock("span",ct,[t.createVNode(n,{value:i.title,onBlur:q=>r.onBlur(q,i)},null,8,["value","onBlur"])])):t.createCommentVNode("",!0),i!=null&&i.config&&((Ie=i==null?void 0:i.config)==null?void 0:Ie.length)>0&&r.isSuperAdmin?(t.openBlock(),t.createElementBlock("span",pt,[t.createVNode(M,{title:"",placement:"bottom-start",trigger:"hover","popper-class":"menu-operate-popover"},{reference:t.withCtx(()=>[t.createVNode(I,{name:"more",style:{cursor:"pointer",width:"15px",height:"15px"}})]),default:t.withCtx(()=>[t.createElementVNode("div",dt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i==null?void 0:i.config,q=>(t.openBlock(),t.createElementBlock("div",{class:"menu-config-item",key:q.id,onClick:Be=>r.clickMenuIcon(i,q)},[t.createVNode(I,{name:q==null?void 0:q.operateIcon,style:{width:"15px",height:"15px","margin-right":"8px"}},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(q==null?void 0:q.operateType),1)],8,ht))),128))])]),_:2},1024)])):t.createCommentVNode("",!0)]}),_:1},8,["mode","menuList","isCollapse","onClickMenu","onOpenMenu","onCloseMenu"]),((L=r.renderMenuList)==null?void 0:L.length)>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"fold-icon",onClick:c[0]||(c[0]=(...i)=>r.handleMenuCollapse&&r.handleMenuCollapse(...i))},[t.createVNode(I,{name:r.isCollapse?"expand":"pack",style:{width:"15px",height:"15px"}},null,8,["name"])])):t.createCommentVNode("",!0),t.createVNode(E,{class:"module-dialog",title:r.dialogInfo.title,visible:r.dialogInfo.show,width:r.dialogInfo.width,onBeforeDestroy:r.beforeDialogDestroy},{default:t.withCtx(()=>[t.createElementVNode("div",ft,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.dialogRenderComps,i=>(t.openBlock(),t.createElementBlock("div",{key:i.id},[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.getComponents((i==null?void 0:i.comp)??"Input")),{itemData:i==null?void 0:i.compData,key:i==null?void 0:i.id,content:(i==null?void 0:i.contents)??[],config:i==null?void 0:i.config,onContentChange:r.handleCompChange},null,40,["itemData","content","config","onContentChange"]))]))),128))])]),footer:t.withCtx(()=>[t.createElementVNode("div",null,[t.createVNode(C,{id:"themeBorderButton",onClick:r.beforeDialogDestroy},{default:t.withCtx(()=>c[1]||(c[1]=[t.createTextVNode("取消")])),_:1,__:[1]},8,["onClick"]),t.createVNode(C,{id:"themeButton",onClick:r.clickSubmitForm},{default:t.withCtx(()=>c[2]||(c[2]=[t.createTextVNode(" 确认 ")])),_:1,__:[2]},8,["onClick"])])]),_:1},8,["title","visible","width","onBeforeDestroy"])],64)}const Ae=at._export_sfc(rt,[["render",vt],["__scopeId","data-v-a385ba2f"]]),yt=Object.freeze(Object.defineProperty({__proto__:null,addSelectMenu:qe,default:Ae,deleteSelectMenu:xe,fixSelectMenu:be,setComponent:Ve},Symbol.toStringTag,{value:"Module"}));exports._sfc_main=Ee;exports.index=yt;exports.ssMenu=Se;exports.ssVMenu=Ae;
|