zjyw-ui
Version:
## 安装
1,221 lines (1,212 loc) • 39.8 kB
JavaScript
import { h as Te, nextTick as lt, createVNode as c, defineComponent as qe, ref as q, resolveComponent as C, openBlock as k, createElementBlock as U, createElementVNode as D, withCtx as m, unref as A, toDisplayString as X, Fragment as ue, renderList as Ee, createBlock as I, createCommentVNode as N, createTextVNode as Q } from "vue";
function w(e, n) {
ut(e) && (e = "100%");
var t = ct(e);
return e = n === 360 ? e : Math.min(n, Math.max(0, parseFloat(e))), t && (e = parseInt(String(e * n), 10) / 100), Math.abs(e - n) < 1e-6 ? 1 : (n === 360 ? e = (e < 0 ? e % n + n : e % n) / parseFloat(String(n)) : e = e % n / parseFloat(String(n)), e);
}
function ut(e) {
return typeof e == "string" && e.indexOf(".") !== -1 && parseFloat(e) === 1;
}
function ct(e) {
return typeof e == "string" && e.indexOf("%") !== -1;
}
function ft(e) {
return e = parseFloat(e), (isNaN(e) || e < 0 || e > 1) && (e = 1), e;
}
function Y(e) {
return e <= 1 ? "".concat(Number(e) * 100, "%") : e;
}
function ce(e) {
return e.length === 1 ? "0" + e : String(e);
}
function st(e, n, t) {
return {
r: w(e, 255) * 255,
g: w(n, 255) * 255,
b: w(t, 255) * 255
};
}
function fe(e, n, t) {
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? e + (n - e) * (6 * t) : t < 1 / 2 ? n : t < 2 / 3 ? e + (n - e) * (2 / 3 - t) * 6 : e;
}
function dt(e, n, t) {
var r, a, o;
if (e = w(e, 360), n = w(n, 100), t = w(t, 100), n === 0)
a = t, o = t, r = t;
else {
var l = t < 0.5 ? t * (1 + n) : t + n - t * n, i = 2 * t - l;
r = fe(i, l, e + 1 / 3), a = fe(i, l, e), o = fe(i, l, e - 1 / 3);
}
return { r: r * 255, g: a * 255, b: o * 255 };
}
function pt(e, n, t) {
e = w(e, 255), n = w(n, 255), t = w(t, 255);
var r = Math.max(e, n, t), a = Math.min(e, n, t), o = 0, l = r, i = r - a, f = r === 0 ? 0 : i / r;
if (r === a)
o = 0;
else {
switch (r) {
case e:
o = (n - t) / i + (n < t ? 6 : 0);
break;
case n:
o = (t - e) / i + 2;
break;
case t:
o = (e - n) / i + 4;
break;
}
o /= 6;
}
return { h: o, s: f, v: l };
}
function gt(e, n, t) {
e = w(e, 360) * 6, n = w(n, 100), t = w(t, 100);
var r = Math.floor(e), a = e - r, o = t * (1 - n), l = t * (1 - a * n), i = t * (1 - (1 - a) * n), f = r % 6, b = [t, l, o, o, i, t][f], S = [i, t, t, l, o, o][f], E = [o, o, i, t, t, l][f];
return { r: b * 255, g: S * 255, b: E * 255 };
}
function bt(e, n, t, r) {
var a = [
ce(Math.round(e).toString(16)),
ce(Math.round(n).toString(16)),
ce(Math.round(t).toString(16))
];
return r && a[0].startsWith(a[0].charAt(1)) && a[1].startsWith(a[1].charAt(1)) && a[2].startsWith(a[2].charAt(1)) ? a[0].charAt(0) + a[1].charAt(0) + a[2].charAt(0) : a.join("");
}
function je(e) {
return _(e) / 255;
}
function _(e) {
return parseInt(e, 16);
}
var Pe = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function L(e) {
var n = { r: 0, g: 0, b: 0 }, t = 1, r = null, a = null, o = null, l = !1, i = !1;
return typeof e == "string" && (e = mt(e)), typeof e == "object" && (T(e.r) && T(e.g) && T(e.b) ? (n = st(e.r, e.g, e.b), l = !0, i = String(e.r).substr(-1) === "%" ? "prgb" : "rgb") : T(e.h) && T(e.s) && T(e.v) ? (r = Y(e.s), a = Y(e.v), n = gt(e.h, r, a), l = !0, i = "hsv") : T(e.h) && T(e.s) && T(e.l) && (r = Y(e.s), o = Y(e.l), n = dt(e.h, r, o), l = !0, i = "hsl"), Object.prototype.hasOwnProperty.call(e, "a") && (t = e.a)), t = ft(t), {
ok: l,
format: e.format || i,
r: Math.min(255, Math.max(n.r, 0)),
g: Math.min(255, Math.max(n.g, 0)),
b: Math.min(255, Math.max(n.b, 0)),
a: t
};
}
var yt = "[-\\+]?\\d+%?", vt = "[-\\+]?\\d*\\.\\d+%?", P = "(?:".concat(vt, ")|(?:").concat(yt, ")"), se = "[\\s|\\(]+(".concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")\\s*\\)?"), de = "[\\s|\\(]+(".concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")[,|\\s]+(").concat(P, ")\\s*\\)?"), x = {
CSS_UNIT: new RegExp(P),
rgb: new RegExp("rgb" + se),
rgba: new RegExp("rgba" + de),
hsl: new RegExp("hsl" + se),
hsla: new RegExp("hsla" + de),
hsv: new RegExp("hsv" + se),
hsva: new RegExp("hsva" + de),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function mt(e) {
if (e = e.trim().toLowerCase(), e.length === 0)
return !1;
var n = !1;
if (Pe[e])
e = Pe[e], n = !0;
else if (e === "transparent")
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
var t = x.rgb.exec(e);
return t ? { r: t[1], g: t[2], b: t[3] } : (t = x.rgba.exec(e), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = x.hsl.exec(e), t ? { h: t[1], s: t[2], l: t[3] } : (t = x.hsla.exec(e), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = x.hsv.exec(e), t ? { h: t[1], s: t[2], v: t[3] } : (t = x.hsva.exec(e), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = x.hex8.exec(e), t ? {
r: _(t[1]),
g: _(t[2]),
b: _(t[3]),
a: je(t[4]),
format: n ? "name" : "hex8"
} : (t = x.hex6.exec(e), t ? {
r: _(t[1]),
g: _(t[2]),
b: _(t[3]),
format: n ? "name" : "hex"
} : (t = x.hex4.exec(e), t ? {
r: _(t[1] + t[1]),
g: _(t[2] + t[2]),
b: _(t[3] + t[3]),
a: je(t[4] + t[4]),
format: n ? "name" : "hex8"
} : (t = x.hex3.exec(e), t ? {
r: _(t[1] + t[1]),
g: _(t[2] + t[2]),
b: _(t[3] + t[3]),
format: n ? "name" : "hex"
} : !1)))))))));
}
function T(e) {
return Boolean(x.CSS_UNIT.exec(String(e)));
}
var G = 2, Fe = 0.16, ht = 0.05, _t = 0.05, Ct = 0.15, Qe = 5, Ye = 4, wt = [{
index: 7,
opacity: 0.15
}, {
index: 6,
opacity: 0.25
}, {
index: 5,
opacity: 0.3
}, {
index: 5,
opacity: 0.45
}, {
index: 5,
opacity: 0.65
}, {
index: 5,
opacity: 0.85
}, {
index: 4,
opacity: 0.9
}, {
index: 3,
opacity: 0.95
}, {
index: 2,
opacity: 0.97
}, {
index: 1,
opacity: 0.98
}];
function De(e) {
var n = e.r, t = e.g, r = e.b, a = pt(n, t, r);
return {
h: a.h * 360,
s: a.s,
v: a.v
};
}
function Z(e) {
var n = e.r, t = e.g, r = e.b;
return "#".concat(bt(n, t, r, !1));
}
function Ot(e, n, t) {
var r = t / 100, a = {
r: (n.r - e.r) * r + e.r,
g: (n.g - e.g) * r + e.g,
b: (n.b - e.b) * r + e.b
};
return a;
}
function Ie(e, n, t) {
var r;
return Math.round(e.h) >= 60 && Math.round(e.h) <= 240 ? r = t ? Math.round(e.h) - G * n : Math.round(e.h) + G * n : r = t ? Math.round(e.h) + G * n : Math.round(e.h) - G * n, r < 0 ? r += 360 : r >= 360 && (r -= 360), r;
}
function Be(e, n, t) {
if (e.h === 0 && e.s === 0)
return e.s;
var r;
return t ? r = e.s - Fe * n : n === Ye ? r = e.s + Fe : r = e.s + ht * n, r > 1 && (r = 1), t && n === Qe && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Number(r.toFixed(2));
}
function Me(e, n, t) {
var r;
return t ? r = e.v + _t * n : r = e.v - Ct * n, r > 1 && (r = 1), Number(r.toFixed(2));
}
function me(e) {
for (var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = [], r = L(e), a = Qe; a > 0; a -= 1) {
var o = De(r), l = Z(L({
h: Ie(o, a, !0),
s: Be(o, a, !0),
v: Me(o, a, !0)
}));
t.push(l);
}
t.push(Z(r));
for (var i = 1; i <= Ye; i += 1) {
var f = De(r), b = Z(L({
h: Ie(f, i),
s: Be(f, i),
v: Me(f, i)
}));
t.push(b);
}
return n.theme === "dark" ? wt.map(function(S) {
var E = S.index, F = S.opacity, $ = Z(Ot(L(n.backgroundColor || "#141414"), L(t[E]), F * 100));
return $;
}) : t;
}
var pe = {
red: "#F5222D",
volcano: "#FA541C",
orange: "#FA8C16",
gold: "#FAAD14",
yellow: "#FADB14",
lime: "#A0D911",
green: "#52C41A",
cyan: "#13C2C2",
blue: "#1890FF",
geekblue: "#2F54EB",
purple: "#722ED1",
magenta: "#EB2F96",
grey: "#666666"
}, ge = {}, be = {};
Object.keys(pe).forEach(function(e) {
ge[e] = me(pe[e]), ge[e].primary = ge[e][5], be[e] = me(pe[e], {
theme: "dark",
backgroundColor: "#141414"
}), be[e].primary = be[e][5];
});
var $e = [], V = [], kt = "insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";
function xt() {
var e = document.createElement("style");
return e.setAttribute("type", "text/css"), e;
}
function St(e, n) {
if (n = n || {}, e === void 0)
throw new Error(kt);
var t = n.prepend === !0 ? "prepend" : "append", r = n.container !== void 0 ? n.container : document.querySelector("head"), a = $e.indexOf(r);
a === -1 && (a = $e.push(r) - 1, V[a] = {});
var o;
return V[a] !== void 0 && V[a][t] !== void 0 ? o = V[a][t] : (o = V[a][t] = xt(), t === "prepend" ? r.insertBefore(o, r.childNodes[0]) : r.appendChild(o)), e.charCodeAt(0) === 65279 && (e = e.substr(1, e.length)), o.styleSheet ? o.styleSheet.cssText += e : o.textContent += e, o;
}
function Re(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
At(e, a, t[a]);
});
}
return e;
}
function At(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
function Tt(e, n) {
process.env.NODE_ENV !== "production" && !e && console !== void 0 && console.error("Warning: ".concat(n));
}
function Et(e, n) {
Tt(e, "[@ant-design/icons-vue] ".concat(n));
}
function Ne(e) {
return typeof e == "object" && typeof e.name == "string" && typeof e.theme == "string" && (typeof e.icon == "object" || typeof e.icon == "function");
}
function he(e, n, t) {
return t ? Te(e.tag, Re({
key: n
}, t, e.attrs), (e.children || []).map(function(r, a) {
return he(r, "".concat(n, "-").concat(e.tag, "-").concat(a));
})) : Te(e.tag, Re({
key: n
}, e.attrs), (e.children || []).map(function(r, a) {
return he(r, "".concat(n, "-").concat(e.tag, "-").concat(a));
}));
}
function Ge(e) {
return me(e)[0];
}
function Ze(e) {
return e ? Array.isArray(e) ? e : [e] : [];
}
var jt = `
.anticon {
display: inline-block;
color: inherit;
font-style: normal;
line-height: 0;
text-align: center;
text-transform: none;
vertical-align: -0.125em;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.anticon > * {
line-height: 1;
}
.anticon svg {
display: inline-block;
}
.anticon::before {
display: none;
}
.anticon .anticon-icon {
display: block;
}
.anticon[tabindex] {
cursor: pointer;
}
.anticon-spin::before,
.anticon-spin {
display: inline-block;
-webkit-animation: loadingCircle 1s infinite linear;
animation: loadingCircle 1s infinite linear;
}
@-webkit-keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes loadingCircle {
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
`, Le = !1, Pt = function() {
var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : jt;
lt(function() {
Le || (typeof window < "u" && window.document && window.document.documentElement && St(n, {
prepend: !0
}), Le = !0);
});
}, Ft = ["icon", "primaryColor", "secondaryColor"];
function Dt(e, n) {
if (e == null)
return {};
var t = It(e, n), r, a;
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
for (a = 0; a < o.length; a++)
r = o[a], !(n.indexOf(r) >= 0) && (!Object.prototype.propertyIsEnumerable.call(e, r) || (t[r] = e[r]));
}
return t;
}
function It(e, n) {
if (e == null)
return {};
var t = {}, r = Object.keys(e), a, o;
for (o = 0; o < r.length; o++)
a = r[o], !(n.indexOf(a) >= 0) && (t[a] = e[a]);
return t;
}
function ee(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
Bt(e, a, t[a]);
});
}
return e;
}
function Bt(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
var H = {
primaryColor: "#333",
secondaryColor: "#E6E6E6",
calculated: !1
};
function Mt(e) {
var n = e.primaryColor, t = e.secondaryColor;
H.primaryColor = n, H.secondaryColor = t || Ge(n), H.calculated = !!t;
}
function $t() {
return ee({}, H);
}
var B = function(n, t) {
var r = ee({}, n, t.attrs), a = r.icon, o = r.primaryColor, l = r.secondaryColor, i = Dt(r, Ft), f = H;
if (o && (f = {
primaryColor: o,
secondaryColor: l || Ge(o)
}), Pt(), Et(Ne(a), "icon should be icon definiton, but got ".concat(a)), !Ne(a))
return null;
var b = a;
return b && typeof b.icon == "function" && (b = ee({}, b, {
icon: b.icon(f.primaryColor, f.secondaryColor)
})), he(b.icon, "svg-".concat(b.name), ee({}, i, {
"data-icon": b.name,
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true"
}));
};
B.props = {
icon: Object,
primaryColor: String,
secondaryColor: String,
focusable: String
};
B.inheritAttrs = !1;
B.displayName = "IconBase";
B.getTwoToneColors = $t;
B.setTwoToneColors = Mt;
const Ce = B;
function Rt(e, n) {
return Ut(e) || Vt(e, n) || Lt(e, n) || Nt();
}
function Nt() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Lt(e, n) {
if (!!e) {
if (typeof e == "string")
return Ve(e, n);
var t = Object.prototype.toString.call(e).slice(8, -1);
if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
return Array.from(e);
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
return Ve(e, n);
}
}
function Ve(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = new Array(n); t < n; t++)
r[t] = e[t];
return r;
}
function Vt(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r = [], a = !0, o = !1, l, i;
try {
for (t = t.call(e); !(a = (l = t.next()).done) && (r.push(l.value), !(n && r.length === n)); a = !0)
;
} catch (f) {
o = !0, i = f;
} finally {
try {
!a && t.return != null && t.return();
} finally {
if (o)
throw i;
}
}
return r;
}
}
function Ut(e) {
if (Array.isArray(e))
return e;
}
function Xe(e) {
var n = Ze(e), t = Rt(n, 2), r = t[0], a = t[1];
return Ce.setTwoToneColors({
primaryColor: r,
secondaryColor: a
});
}
function Ht() {
var e = Ce.getTwoToneColors();
return e.calculated ? [e.primaryColor, e.secondaryColor] : e.primaryColor;
}
var zt = ["class", "icon", "spin", "rotate", "tabindex", "twoToneColor", "onClick"];
function Jt(e, n) {
return Qt(e) || qt(e, n) || Wt(e, n) || Kt();
}
function Kt() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Wt(e, n) {
if (!!e) {
if (typeof e == "string")
return Ue(e, n);
var t = Object.prototype.toString.call(e).slice(8, -1);
if (t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set")
return Array.from(e);
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))
return Ue(e, n);
}
}
function Ue(e, n) {
(n == null || n > e.length) && (n = e.length);
for (var t = 0, r = new Array(n); t < n; t++)
r[t] = e[t];
return r;
}
function qt(e, n) {
var t = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (t != null) {
var r = [], a = !0, o = !1, l, i;
try {
for (t = t.call(e); !(a = (l = t.next()).done) && (r.push(l.value), !(n && r.length === n)); a = !0)
;
} catch (f) {
o = !0, i = f;
} finally {
try {
!a && t.return != null && t.return();
} finally {
if (o)
throw i;
}
}
return r;
}
}
function Qt(e) {
if (Array.isArray(e))
return e;
}
function He(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
_e(e, a, t[a]);
});
}
return e;
}
function _e(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
function Yt(e, n) {
if (e == null)
return {};
var t = Gt(e, n), r, a;
if (Object.getOwnPropertySymbols) {
var o = Object.getOwnPropertySymbols(e);
for (a = 0; a < o.length; a++)
r = o[a], !(n.indexOf(r) >= 0) && (!Object.prototype.propertyIsEnumerable.call(e, r) || (t[r] = e[r]));
}
return t;
}
function Gt(e, n) {
if (e == null)
return {};
var t = {}, r = Object.keys(e), a, o;
for (o = 0; o < r.length; o++)
a = r[o], !(n.indexOf(a) >= 0) && (t[a] = e[a]);
return t;
}
Xe("#1890ff");
var M = function(n, t) {
var r, a = He({}, n, t.attrs), o = a.class, l = a.icon, i = a.spin, f = a.rotate, b = a.tabindex, S = a.twoToneColor, E = a.onClick, F = Yt(a, zt), $ = (r = {
anticon: !0
}, _e(r, "anticon-".concat(l.name), Boolean(l.name)), _e(r, o, o), r), z = i === "" || !!i || l.name === "loading" ? "anticon-spin" : "", R = b;
R === void 0 && E && (R = -1, F.tabindex = R);
var re = f ? {
msTransform: "rotate(".concat(f, "deg)"),
transform: "rotate(".concat(f, "deg)")
} : void 0, ae = Ze(S), J = Jt(ae, 2), oe = J[0], ie = J[1];
return c("span", He({
role: "img",
"aria-label": l.name
}, F, {
onClick: E,
class: $
}), [c(Ce, {
class: z,
icon: l,
primaryColor: oe,
secondaryColor: ie,
style: re
}, null)]);
};
M.props = {
spin: Boolean,
rotate: Number,
icon: Object,
twoToneColor: String
};
M.displayName = "AntdIcon";
M.inheritAttrs = !1;
M.getTwoToneColor = Ht;
M.setTwoToneColor = Xe;
const we = M;
var Zt = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M624 706.3h-74.1V464c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v242.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.7a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9z" } }, { tag: "path", attrs: { d: "M811.4 366.7C765.6 245.9 648.9 160 512.2 160S258.8 245.8 213 366.6C127.3 389.1 64 467.2 64 560c0 110.5 89.5 200 199.9 200H304c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8h-40.1c-33.7 0-65.4-13.4-89-37.7-23.5-24.2-36-56.8-34.9-90.6.9-26.4 9.9-51.2 26.2-72.1 16.7-21.3 40.1-36.8 66.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10C846.1 454.5 884 503.8 884 560c0 33.1-12.9 64.3-36.3 87.7a123.07 123.07 0 01-87.6 36.3H720c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h40.1C870.5 760 960 670.5 960 560c0-92.7-63.1-170.7-148.6-193.3z" } }] }, name: "cloud-download", theme: "outlined" };
const Xt = Zt;
function ze(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
en(e, a, t[a]);
});
}
return e;
}
function en(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
var Oe = function(n, t) {
var r = ze({}, n, t.attrs);
return c(we, ze({}, r, {
icon: Xt
}), null);
};
Oe.displayName = "CloudDownloadOutlined";
Oe.inheritAttrs = !1;
const tn = Oe;
var nn = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z" } }] }, name: "download", theme: "outlined" };
const rn = nn;
function Je(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
an(e, a, t[a]);
});
}
return e;
}
function an(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
var ke = function(n, t) {
var r = Je({}, n, t.attrs);
return c(we, Je({}, r, {
icon: rn
}), null);
};
ke.displayName = "DownloadOutlined";
ke.inheritAttrs = !1;
const on = ke;
var ln = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }, { tag: "path", attrs: { d: "M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z" } }] }, name: "question-circle", theme: "outlined" };
const un = ln;
function Ke(e) {
for (var n = 1; n < arguments.length; n++) {
var t = arguments[n] != null ? Object(arguments[n]) : {}, r = Object.keys(t);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(t).filter(function(a) {
return Object.getOwnPropertyDescriptor(t, a).enumerable;
}))), r.forEach(function(a) {
cn(e, a, t[a]);
});
}
return e;
}
function cn(e, n, t) {
return n in e ? Object.defineProperty(e, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = t, e;
}
var xe = function(n, t) {
var r = Ke({}, n, t.attrs);
return c(we, Ke({}, r, {
icon: un
}), null);
};
xe.displayName = "QuestionCircleOutlined";
xe.inheritAttrs = !1;
const fn = xe, sn = [
{
value: "static",
label: "\u9759\u6001"
},
{
value: "dynamic",
label: "\u52A8\u6001"
},
{
value: "mixed",
label: "\u52A8\u9759\u7ED3\u5408"
}
];
var te = /* @__PURE__ */ ((e) => (e.INPUT = "INPUT", e.ARRAY = "ARRAY", e.TABLE = "TBALE", e.OBJECT = "OBJECT", e))(te || {});
function ye(e) {
switch (e) {
case "number":
case "string":
return "INPUT";
case "list":
return "ARRAY";
case "object":
return "OBJECT";
case "TABLE":
return "TBALE";
default:
return "INPUT";
}
}
function We(e, n) {
const t = document.createElement("a");
t.download = e, t.style.display = "none";
const r = new Blob([JSON.stringify(n)]);
t.href = URL.createObjectURL(r), document.body.appendChild(t), t.click(), document.body.removeChild(t);
}
const dn = { class: "cockpit-container" }, pn = { class: "left-box" }, gn = { class: "tree-box" }, bn = { class: "dom-box" }, yn = { class: "flex mb-5" }, vn = { class: "m-5" }, mn = {
name: "CockpitData"
}, hn = /* @__PURE__ */ qe({
...mn,
props: {
treeData: null,
expandAll: { type: Boolean }
},
emits: ["handleSubmit", "getNowModule", "getRuleJson"],
setup(e, { emit: n }) {
const t = e, r = q([]), a = q({}), o = q([]), l = q({
pageKey: "",
moduleKey: ""
});
function i() {
n("handleSubmit", a.value, b);
}
function f(u, d) {
var O;
const { moduleKey: v, parent: p } = d.node;
p ? (l.value = {
pageKey: (O = p.node) == null ? void 0 : O.pageKey,
moduleKey: v
}, b()) : a.value = {};
}
function b() {
console.log("\u6211\u6267\u884C\u4E86"), n("getNowModule", l.value, (u) => {
a.value = u;
});
}
function S(u, d = !1) {
const v = E().indexOf(u.key), { pageKey: p, moduleKey: O } = a.value;
let s = o.value[p][O][v];
return s = [...new Set(s)], d || (s.push({
key: "handle",
title: "\u64CD\u4F5C"
}), s = s.filter((h) => h.key !== "id")), s;
}
function E() {
const u = ["number", "string"];
return a.value.kvList.filter((d) => !u.includes(d.dataType)).map((d) => d.key);
}
function F(u, d) {
const v = S(u, !0), p = {};
v.forEach((O) => {
p[O.key] = "";
}), p.id = new Date().getTime(), a.value.kvList[d].staticValue || (a.value.kvList[d].staticValue = []), a.value.kvList[d].staticValue.push(p);
}
function $(u, d, v) {
a.value.kvList[d].staticValue.splice(v, 1);
}
function z(u) {
return sn.filter((d) => {
if (u.dynamicValue || !u.dynamicValue && d.value == "static")
return !0;
});
}
function R(u) {
return u == "string" ? "text" : "number";
}
function re() {
We("exampleRule.json", {
tips: "id \u4E3A\u5FC5\u987B\u9879\uFF0C\u5220\u9664\u65F6\u9700\u8981\u7528\u5230,key\u3001title\u4E3A\u5BF9\u8C61\u5FC5\u987B\u5B57\u6BB5",
homePage: {
serviceSupervision: {
0: [
{
key: "\u63D0\u4EA4\u81F3\u540E\u53F0\uFF0C\u7528\u4E8E\u9875\u9762\u6E32\u67D3\u4F7F\u7528\u7684\u5B57\u6BB5\u540D\u79F0",
title: "\u8868\u5934\u663E\u793A\u6587\u5B57"
},
{
key: "id",
title: "id"
}
]
}
}
});
}
async function ae() {
n("getRuleJson", (u) => {
console.log("ruleJson-->", u), J(u);
});
}
function J(u) {
const d = ["list", "table"], v = t.treeData, p = {};
v.forEach((s) => {
(!p[s.pageKey] || !Object.keys(p[s.pageKey]).length) && (p[s.pageKey] = {}), s.moduleList && s.moduleList.forEach((h) => {
const j = h.kvList.filter(
(K) => d.includes(K.dataType)
);
j.length && j.forEach((K, W) => {
(!p[s.pageKey][h.moduleKey] || !Object.keys(p[s.pageKey][h.moduleKey]).length) && (p[s.pageKey][h.moduleKey] = {}), p[s.pageKey][h.moduleKey][W] = [];
});
});
});
const O = {};
for (const s in p) {
const h = p[s], j = u[s];
u[s] && Object.assign(h, j), Object.keys(h).length && (O[s] = h);
}
We("rule.json", O);
}
oe();
function oe() {
let u = {};
n("getRuleJson", (d) => {
u = d, console.log("ruleData->>", u), o.value = u;
});
}
function ie() {
window.open("https://www.bejson.com/zhuanyi/");
}
return (u, d) => {
const v = C("a-button"), p = C("a-popover"), O = C("di"), s = C("a-tree"), h = C("a-divider"), j = C("a-input"), K = C("a-select"), W = C("a-col"), nt = C("a-radio"), rt = C("a-radio-group"), at = C("a-table"), ot = C("a-row");
return k(), U("div", dn, [
D("div", pn, [
c(O, { class: "btn-box" }, {
default: m(() => [
c(p, {
placement: "topLeft",
content: "\u9ED8\u8BA4\u89C4\u5219\u4E0B\u8F7D"
}, {
default: m(() => [
c(v, {
type: "primary",
class: "mb-5",
onClick: ae
}, {
default: m(() => [
c(A(tn))
]),
_: 1
})
]),
_: 1
}),
c(p, {
placement: "topLeft",
content: "\u89C4\u5219\u793A\u4F8B\u4E0B\u8F7D"
}, {
default: m(() => [
c(v, {
type: "success",
class: "mb-5 ml-3",
style: { background: "#4aca80", "border-color": "#4aca80", color: "#fff" },
onClick: re
}, {
default: m(() => [
c(A(on))
]),
_: 1
})
]),
_: 1
}),
c(p, {
placement: "topLeft",
content: "\u8F6C\u4E49\u89C4\u5219\u5730\u5740"
}, {
default: m(() => [
c(v, {
type: "warning",
class: "mb-5 ml-3",
style: { background: "#f3c671", "border-color": "#f3c671", color: "#fff" },
onClick: ie
}, {
default: m(() => [
c(A(fn))
]),
_: 1
})
]),
_: 1
})
]),
_: 1
}),
D("div", gn, [
c(s, {
selectedKeys: r.value,
"onUpdate:selectedKeys": d[0] || (d[0] = (g) => r.value = g),
"tree-data": e.treeData,
"default-expand-all": e.expandAll,
onSelect: f
}, null, 8, ["selectedKeys", "tree-data", "default-expand-all"])
])
]),
D("div", bn, [
D("div", null, X(a.value.pageName) + " - " + X(a.value.moduleName), 1),
c(h),
c(ot, null, {
default: m(() => [
(k(!0), U(ue, null, Ee(a.value.kvList, (g, Se) => (k(), U(ue, {
key: g.key
}, [
A(ye)(g.dataType) == A(te).INPUT ? (k(), I(W, {
key: 0,
span: 12
}, {
default: m(() => [
D("div", yn, [
c(j, {
disabled: "",
value: g.name,
"onUpdate:value": (y) => g.name = y,
class: "custom-input"
}, null, 8, ["value", "onUpdate:value"]),
c(j, {
value: g.staticValue,
"onUpdate:value": (y) => g.staticValue = y,
type: R(g.dataType),
style: { width: "200px", "margin-right": "10px" }
}, null, 8, ["value", "onUpdate:value", "type"]),
c(K, {
value: g.valuePolicy,
"onUpdate:value": (y) => g.valuePolicy = y,
style: { width: "150px" },
options: z(g)
}, null, 8, ["value", "onUpdate:value", "options"])
])
]),
_: 2
}, 1024)) : N("", !0),
A(ye)(g.dataType) == A(te).ARRAY || A(ye)(g.dataType) == A(te).TABLE ? (k(), I(W, {
key: 1,
span: 24
}, {
default: m(() => [
D("div", vn, [
c(v, {
type: "primary",
class: "mb-5 mr-5",
onClick: (y) => F(g, Se)
}, {
default: m(() => [
Q(" \u6DFB\u52A0 ")
]),
_: 2
}, 1032, ["onClick"]),
c(rt, {
value: g.valuePolicy,
"onUpdate:value": (y) => g.valuePolicy = y
}, {
default: m(() => [
(k(!0), U(ue, null, Ee(z(g), (y) => (k(), I(nt, {
value: y.value,
key: y.value
}, {
default: m(() => [
Q(X(y.label), 1)
]),
_: 2
}, 1032, ["value"]))), 128))
]),
_: 2
}, 1032, ["value", "onUpdate:value"]),
c(at, {
dataSource: g.staticValue,
columns: S(g),
style: { width: "100%" },
bordered: "",
pagination: !1,
height: "200px"
}, {
bodyCell: m(({ column: y, text: le, index: it }) => [
y.key != "handle" ? (k(), I(j, {
key: 0,
value: le[y.key],
"onUpdate:value": (Ae) => le[y.key] = Ae,
style: { width: "200px", "margin-right": "10px" }
}, null, 8, ["value", "onUpdate:value"])) : N("", !0),
y.key == "handle" ? (k(), I(v, {
key: 1,
type: "text",
danger: "",
onClick: (Ae) => $(le, Se, it)
}, {
default: m(() => [
Q("\u5220\u9664")
]),
_: 2
}, 1032, ["onClick"])) : N("", !0)
]),
_: 2
}, 1032, ["dataSource", "columns"])
])
]),
_: 2
}, 1024)) : N("", !0)
], 64))), 128))
]),
_: 1
}),
a.value.kvList && a.value.kvList.length ? (k(), I(v, {
key: 0,
type: "primary",
style: { background: "#ff8c4a", "border-color": "#ff8c4a", float: "right", "./util\n margin-right": "20px" },
onClick: i
}, {
default: m(() => [
Q("\u63D0\u4EA4")
]),
_: 1
})) : N("", !0)
])
]);
};
}
});
const et = (e, n) => {
const t = e.__vccOpts || e;
for (const [r, a] of n)
t[r] = a;
return t;
}, ne = /* @__PURE__ */ et(hn, [["__scopeId", "data-v-fb27af9f"]]);
ne.install = function(e) {
e.component(ne.name, ne);
};
const _n = /* @__PURE__ */ qe({
__name: "index",
props: {
msg: null
},
setup(e) {
return (n, t) => (k(), U("h1", null, "Hello " + X(e.msg) + "!", 1));
}
});
const ve = /* @__PURE__ */ et(_n, [["__scopeId", "data-v-3a00677c"]]);
ve.install = function(e) {
e.component(ve.name, ve);
};
const Cn = {
CockpitData: ne
}, tt = function(e) {
Object.values(Cn).forEach((n) => {
console.log(n), e.component(n.name, n);
});
};
typeof window < "u" && window.Vue && tt(window.Vue);
const On = { install: tt };
export {
ve as CockpitData,
On as default
};