oeos-components 0.2.25 → 0.2.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oeos-components",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/oeos-components-es.js",
@@ -1,10 +0,0 @@
1
- import { defineComponent as s, computed as l, createElementBlock as a, openBlock as n, mergeProps as A, unref as r, createBlock as i, renderSlot as g, createElementVNode as p } from "vue";
2
- import m from "./index-E4jh-RZ6.js";
3
- import { p as y, _ as b, w as d } from "./index-DkSTvVGB.js";
4
- const h = { key: 0, src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAqJJREFUWEftl0tPE2EUht/TGW90oKWlJhqXeI0ujIQF0b9gXIhJt0oKM1VD2Lhi5cqNIQpTWi9bEnFh/AsaFo3GhXdhqya0UyhM8UJnjk5bDHTaudQqG77dZM457zPvOedLhrDNh7ZZHzsAOw607MCi0tUrsnEPBBYgJELqykIrA90ygCZLN0G4URFl3Iqm9PH/BqANSycg4CWAvTXR7zBwJprW3/mF8O3AlwQ69ojBOwBd2SrGD36US9cPZrDmB8I3QEEJxhmUAhCqEyoSWI6opZl/BsCDEAr7g3Ng6m8oQpyNLJYGaBaGVwjPDlTEY8GrAE04F+fRSK406RXCM0BO7jxKxDMEnLYACFgA8/0KDNEQA73VhcArZorHUqsfvbjgGUBLSmkwEpuKPjfL5iXrOSAGHgE4++cdIROd0ofbBpBXpOMEZAFIngAAnYH+HlV/7wbh6sCyHOo2yXjIwIW6Ys0dqLboSYCFy+FUcckJwhVAU6SLAKxe16+dIwCAIoChqKo/bhlAuxbpgvHzBYDDtiLEWRMsV2bAuhcar+Y8hN190buFlWYQjg7kZSlJhMkmyasAPtXeHQHQ2SiOgGRE1VXfALnhUJ8gGDMb6+U2TA4CC4YhxGPpouWk3chmiXmla4pgjlQcbnzmwTxduwesOHubqnkmIzDdo64kPQNoSucAwM8cxK1abkO4Wc8E6FxUXZ2rh7DNwNJoOGyulzNgDLrY/gGg29UYHgNwzDGeMBvYJSa6J5aXN8fZAAqyNMIEq/C+VvveJO8bMcYiKb3attqxAWiK9BrAyTaLb5R7+/te2FLbBpBXgk8JOAUEXC8pf5CmycCbHrV03tGBXKLjAIniIZjt/WkRmcx1Xv8cy6x9dQTw91V/H91mm/0D7QD8AkUR3SFsA4XSAAAAAElFTkSuQmCC", class: "icon" }, u = s({ name: "OWarning" }), C = d(b(s({ ...u, props: { content: { type: String, required: !0 }, type: { type: String, default: "" }, width: { type: [String, Number], default: "100%" }, dangerouslyUseHTMLString: { type: Boolean, default: !1 } }, setup(e) {
5
- const t = e, c = l(() => t.dangerouslyUseHTMLString ? { innerHTML: t.content } : { textContent: t.content });
6
- return (o, E) => (n(), a("div", A({ class: [e.type === "icon" ? "icon-box" : e.type === "info" ? "info-box" : "warning-box", "base-box"], style: { ...r(y)(t.width) } }, o.$attrs), [e.type === "" ? (n(), a("img", h)) : (n(), i(r(m), A({ key: 1, name: "warning", color: "var(--45)" }, o.$attrs, { class: "icon", size: "16" }), null, 16, ["color"])), g(o.$slots, "content", {}, () => [p("span", A({ class: ["warning-box__content", e.type === "icon" && "cl-45 fs-14"] }, c.value), null, 16)], !0)], 16));
7
- } }), [["__scopeId", "data-v-5146fae0"]]));
8
- export {
9
- C as default
10
- };
@@ -1,16 +0,0 @@
1
- import { defineComponent as u, computed as f, createElementBlock as n, openBlock as p, mergeProps as d, createElementVNode as c, createCommentVNode as h, renderSlot as m, normalizeStyle as y, normalizeClass as w, toDisplayString as g } from "vue";
2
- import { p as s, _ as b, w as S } from "./index-DkSTvVGB.js";
3
- const _ = { class: "o-title__top" }, x = { key: 0, src: "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1742261310954'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='12261'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M800.512%20474.944h-377.6a24.256%2024.256%200%200%200-24.32%2024.32c0%2013.504%2010.816%2024.32%2024.32%2024.32h377.6c13.504%200%2024.32-10.816%2024.32-24.32a24.576%2024.576%200%200%200-24.32-24.32z%20m-377.6%20203.776a24.256%2024.256%200%200%200-24.32%2024.32c0%2013.504%2010.816%2024.32%2024.32%2024.32h377.6c13.504%200%2024.32-10.816%2024.32-24.32a24.576%2024.576%200%200%200-24.32-24.32h-377.6z'%20fill='%23101317'%20p-id='12262'%3e%3c/path%3e%3cpath%20d='M928.064%20209.6h-252.736l-5.376-15.68c-37.824-104.832-110.272-129.728-164.288-132.416h-409.728a62.592%2062.592%200%200%200-62.72%2062.144v776.704c0%2034.048%2028.096%2062.144%2062.72%2062.144h832.128a62.72%2062.72%200%200%200%2062.72-62.144v-628.608a62.272%2062.272%200%200%200-62.72-62.144z%20m-848.384-56.256c0-48.128%2017.856-41.6%2090.816-41.6h261.056c110.784%200%20139.456%2023.808%20160.512%2061.056l15.68%2036.736h-528.064v-56.192z%20m773.248%20759.424H170.496c-74.56%200-86.464-5.952-86.464-85.952v-566.464h784.576c78.912%200%2070.784%2030.784%2070.784%2085.952v492.928c0.064%2072.448-25.344%2073.536-86.464%2073.536z'%20fill='%23101317'%20p-id='12263'%3e%3c/path%3e%3cpath%20d='M196.992%20536.576h78.912v-78.912h-78.912v78.912z%20m0%20205.952h78.912v-78.912h-78.912v78.912z'%20fill='%23101317'%20p-id='12264'%3e%3c/path%3e%3c/svg%3e", width: "14", height: "14", alt: "Logo", class: "m-r-4" }, z = { class: "title-text" }, T = u({ name: "OTitle" }), k = S(b(u({ ...T, props: { title: { type: String, default: "" }, size: { type: String, default: "" }, subTitle: { type: String, default: "" }, subAttrs: { type: Object, default: () => ({}) }, inner: { type: Boolean, defalut: !1 }, t: { type: [String, Number], default: "" }, b: { type: [String, Number], default: "" }, l: { type: [String, Number], default: "" }, tb: { type: [String, Number] }, type: { type: String, default: "icon" } }, setup(e) {
4
- const o = e, v = f(() => {
5
- const { t, b: i, l: r, tb: l } = o;
6
- if (t || i || r || l) {
7
- let a = {};
8
- return l && (a.marginTop = s(l, !0), a.marginBottom = s(l, !0)), t && (a.marginTop = s(t, !0)), i && (a.marginBottom = s(i, !0)), r && (a.marginLeft = s(r, !0)), a;
9
- }
10
- return {};
11
- });
12
- return (t, i) => (p(), n("div", d({ class: "o-title", style: { ...v.value } }, t.$attrs), [c("div", _, [c("div", { class: w(e.type === "simple" || e.type === "icon" ? "o-title__top-simple-left" : "o-title__top-left"), style: y({ marginLeft: o.inner ? "8px" : 0 }) }, [m(t.$slots, "icon", {}, () => [o.type === "icon" ? (p(), n("img", x)) : h("", !0)], !0), c("span", z, g(e.title), 1), m(t.$slots, "default", {}, void 0, !0)], 6), m(t.$slots, "right", {}, void 0, !0)]), e.subTitle ? (p(), n("div", d({ key: 0, class: "o-title__subTitle" }, e.subAttrs), g(e.subTitle), 17)) : h("", !0)], 16));
13
- } }), [["__scopeId", "data-v-eae10c67"]]));
14
- export {
15
- k as default
16
- };
@@ -1,19 +0,0 @@
1
- import { defineComponent as u, useSlots as m, ref as p, onMounted as d, h as v, resolveComponent as C, createBlock as g, openBlock as h, mergeProps as y, withModifiers as x, withCtx as b, renderSlot as P } from "vue";
2
- import { q as i, w as k } from "./index-DkSTvVGB.js";
3
- const w = u({ name: "OText" }), $ = k(u({ ...w, props: { lineClamp: { type: [String, Number] }, tippyProps: { type: Object, default: () => ({}) } }, setup(a) {
4
- const s = a, o = m(), n = p(), l = p(), r = () => ({ content: v(o.content || o.default), ...s.tippyProps });
5
- function c(e) {
6
- var t;
7
- t = e.target, (s.lineClamp ? t.scrollHeight > t.clientHeight : t.scrollWidth > t.clientWidth) ? (l.value.setProps(r()), l.value.enable()) : l.value.disable();
8
- }
9
- return d(() => {
10
- var e;
11
- console.log("89 useTippy", i), l.value = i((e = n.value) == null ? void 0 : e.$el, r());
12
- }), (e, t) => {
13
- const f = C("el-text");
14
- return h(), g(f, y({ truncated: !a.lineClamp, lineClamp: a.lineClamp, ...e.$attrs }, { ref_key: "textRef", ref: n, onMouseover: x(c, ["self"]) }), { default: b(() => [P(e.$slots, "default")]), _: 3 }, 16);
15
- };
16
- } }));
17
- export {
18
- $ as default
19
- };
@@ -1,50 +0,0 @@
1
- import { defineComponent as m, useAttrs as p, computed as l, resolveComponent as d, createElementBlock as T, openBlock as v, normalizeStyle as x, createVNode as D, unref as i, mergeProps as h } from "vue";
2
- import { p as f, _ as Y, w as y } from "./index-DkSTvVGB.js";
3
- import M from "./index-Bhz66Ovv.js";
4
- const S = m({ name: "ODateRange" }), z = y(Y(m({ ...S, props: { title: { type: String, default: "" }, width: { type: [String, Number], default: "300px" } }, setup(u) {
5
- const r = p(), s = u, n = 864e5, w = l(() => o.value.type === "daterange" || o.value.type === "datetimerange" ? [{ text: "今天", value: () => {
6
- const e = new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime();
7
- return [new Date(e), new Date(e + n - 1)];
8
- } }, { text: "昨天", value: () => [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - n), new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 1)] }, { text: "最近7天", value: () => {
9
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
10
- return t.setTime(t.getTime() - 5184e5), [t, e];
11
- } }, { text: "本周", value: () => {
12
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date(), a = t.getDay() || 7;
13
- return t.setTime(t.getTime() - 864e5 * (a - 1)), [t, e];
14
- } }, { text: "上周", value: () => {
15
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date(), a = t.getDay() || 7;
16
- return console.log("63 nows", a), t.setTime(t.getTime() - 864e5 * (a - 1 + 7)), e.setTime(e.getTime() - 864e5 * a), [t, e];
17
- } }, { text: "本月", value: () => {
18
- (/* @__PURE__ */ new Date()).getTime(), (/* @__PURE__ */ new Date()).getDate();
19
- const e = /* @__PURE__ */ new Date();
20
- return [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).setDate(1)), e];
21
- } }, { text: "上月", value: () => {
22
- const e = /* @__PURE__ */ new Date(), t = new Date(e);
23
- return t.setMonth(e.getMonth()), e.setMonth(e.getMonth() - 1), t.setDate(0), e.setDate(1), [e, t];
24
- } }, { text: "最近30天", value: () => {
25
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
26
- return t.setTime(t.getTime() - 2592e6), [t, e];
27
- } }, { text: "最近90天", value: () => {
28
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
29
- return t.setTime(t.getTime() - 7776e6), [t, e];
30
- } }, { text: "最近1年", value: () => {
31
- const e = /* @__PURE__ */ new Date(), t = /* @__PURE__ */ new Date();
32
- return t.setTime(t.getTime() - 31536e6), [t, e];
33
- } }, { text: "一月以前30天", value: () => [new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 60 * n), new Date(new Date((/* @__PURE__ */ new Date()).toLocaleDateString()).getTime() - 30 * n)] }] : [{ text: "今天", value: /* @__PURE__ */ new Date() }, { text: "昨天", value: () => {
34
- const e = /* @__PURE__ */ new Date();
35
- return e.setTime(e.getTime() - 864e5), e;
36
- } }, { text: "一周前", value: () => {
37
- const e = /* @__PURE__ */ new Date();
38
- return e.setTime(e.getTime() - 6048e5), e;
39
- } }]), c = () => s.width ? { width: f(s.width, !0) } : {}, o = l(() => {
40
- const e = { "value-format": "YYYY-MM-DD HH:mm:ss", format: r.type !== "datetime" ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm:ss", type: "daterange", placeholder: "请选择日期", "start-placeholder": "开始日期", "end-placeholder": "结束日期", "range-separator": "-", ...Object.entries(r).reduce((t, [a, g]) => (a !== "class" && a !== "style" && (t[a] = g), t), {}) };
41
- return console.log("66 merged", e), e;
42
- });
43
- return (e, t) => {
44
- const a = d("el-date-picker");
45
- return v(), T("span", { class: "o-date-range", style: x({ ...c() }) }, [D(i(M), { title: s.title, size: i(r).size, titleAttrs: e.$attrs.titleAttrs ?? {} }, null, 8, ["title", "size", "titleAttrs"]), D(a, h({ shortcuts: w.value }, o.value, { class: "o-date-range__picker" }), null, 16, ["shortcuts"])], 4);
46
- };
47
- } }), [["__scopeId", "data-v-f01c46a3"]]));
48
- export {
49
- z as default
50
- };
@@ -1,68 +0,0 @@
1
- import { getCurrentInstance as J, ref as j, watch as B, nextTick as M, computed as x, defineComponent as G, useAttrs as U, resolveComponent as V, createElementBlock as q, openBlock as h, mergeProps as w, createVNode as F, createBlock as C, createCommentVNode as E, unref as O, withCtx as u, createElementVNode as W, isRef as L, createSlots as T, normalizeStyle as I, toDisplayString as z, renderSlot as b } from "vue";
2
- import { m as R, p as D, _ as H, w as K } from "./index-DkSTvVGB.js";
3
- function Q(n, o, a, y = {}) {
4
- var f, r, $;
5
- const { clone: v = !1, passive: g = !1, eventName: k, deep: A = !1, defaultValue: N, shouldEmit: S } = y, i = J(), _ = (i == null ? void 0 : i.emit) || ((f = i == null ? void 0 : i.$emit) == null ? void 0 : f.bind(i)) || (($ = (r = i == null ? void 0 : i.proxy) == null ? void 0 : r.$emit) == null ? void 0 : $.bind(i == null ? void 0 : i.proxy));
6
- let p = k;
7
- o || (o = "modelValue"), p = p || `update:${o.toString()}`;
8
- const e = (s) => {
9
- return v ? typeof v == "function" ? v(s) : (d = s, JSON.parse(JSON.stringify(d))) : s;
10
- var d;
11
- }, t = () => n[o] !== void 0 ? e(n[o]) : N, m = (s) => {
12
- S ? S(s) && _(p, s) : _(p, s);
13
- };
14
- if (g) {
15
- const s = t(), d = j(s);
16
- let c = !1;
17
- return B(() => n[o], (l) => {
18
- c || (c = !0, d.value = e(l), M(() => c = !1));
19
- }), B(d, (l) => {
20
- c || l === n[o] && !A || m(l);
21
- }, { deep: A }), d;
22
- }
23
- return x({ get: () => t(), set(s) {
24
- m(s);
25
- } });
26
- }
27
- const X = G({ name: "OInput" }), ee = K(H(G({ ...X, props: { modelValue: { required: !0 }, titleAttrs: { type: Object, default: () => {
28
- } }, width: { type: [String, Number], default: "100%" }, showWordLimit: { type: [Boolean, String], default: "" }, block: { type: Boolean, default: !1 }, disPlaceholder: { type: String, default: "" }, subAttrs: { type: Object, default: () => ({}) }, tooltipAttrs: { type: Object, default: () => ({}) }, iconAttrs: { type: Object, default: () => ({}) }, hideTooltip: { type: Boolean, default: !1 }, options: { type: Array }, content: { type: String, default: "" } }, setup(n) {
29
- const o = U(), a = n, y = j([]), f = j(!0), r = Q(a), $ = x(() => o.type === "textarea" ? o.maxlength || 1e3 : o.maxlength || "");
30
- B(() => a.options, (e) => {
31
- e && (y.value = e.map((t) => R(t) === "object" ? t : { value: t }));
32
- }, { deep: !0, immediate: !0 });
33
- const v = x(() => {
34
- var e;
35
- if ((e = a.titleAttrs) != null && e.width) {
36
- let t = parseInt(a.titleAttrs.width) - 8 + "px";
37
- return { ...a.titleAttrs, width: D(t, !0) };
38
- }
39
- return a.titleAttrs;
40
- });
41
- function g() {
42
- return o.disabled === "" || o.disabled ? a.disPlaceholder : o.placeholder || "请输入";
43
- }
44
- function k(e) {
45
- const t = e.target;
46
- t.offsetWidth + 4 < t.scrollWidth ? f.value = !1 : f.value = !0;
47
- }
48
- const A = () => {
49
- if (!a.width)
50
- return {};
51
- let e = D(a.width, !0);
52
- return a.content && e && (e = `calc(${e} - 32px)`), { width: e };
53
- }, N = () => {
54
- r.value = "";
55
- }, S = x(() => o.type === "password" && o.showPassword !== !1), i = (e, t) => {
56
- t(e ? y.value.filter(_(e)) : y.value);
57
- }, _ = (e) => (t) => t.value.toLowerCase().indexOf(e.toLowerCase()) === 0, p = x(() => ({ resize: "none", rows: 2, clearable: !0, ...Object.entries(o).reduce((e, [t, m]) => (t !== "class" && t !== "style" && (e[t] = m), e), {}) }));
58
- return (e, t) => {
59
- const m = V("el-autocomplete"), s = V("el-input"), d = V("el-tooltip"), c = V("o-icon");
60
- return h(), q("div", w({ class: "o-input" }, n.subAttrs, { style: { ...A() } }), [F(d, w({ content: "" + O(r), disabled: f.value || n.hideTooltip }, n.tooltipAttrs), { default: u(() => [W("div", null, [a.options ? (h(), C(m, w({ key: 0, modelValue: O(r), "onUpdate:modelValue": t[0] || (t[0] = (l) => L(r) ? r.value = l : null), "fetch-suggestions": i, placeholder: g(), clearable: e.$attrs.clearable !== !1, onMouseover: t[1] || (t[1] = (l) => k(l)) }, p.value), T({ _: 2 }, [e.$attrs.title ? { name: "prepend", fn: u(() => [W("div", { style: I({ ...v.value }), class: "o-input__title" }, z(e.$attrs.title), 5)]), key: "0" } : void 0]), 1040, ["modelValue", "placeholder", "clearable"])) : (h(), C(s, w({ key: 1, modelValue: O(r), "onUpdate:modelValue": t[2] || (t[2] = (l) => L(r) ? r.value = l : null), placeholder: g(), class: ["kd-ipt", { "kd-textarea": e.$attrs.type === "textarea" }], showPassword: S.value, maxlength: $.value }, p.value, { "show-word-limit": typeof a.showWordLimit == "boolean" ? a.showWordLimit : o.type === "textarea", onFocus: t[3] || (t[3] = (l) => {
61
- return P = l, void (o.type === "password" && P.currentTarget.select());
62
- var P;
63
- }), onMouseover: t[4] || (t[4] = (l) => k(l)) }), T({ default: u(() => [b(e.$slots, "default", {}, void 0, !0)]), _: 2 }, [e.$attrs.title ? { name: "prepend", fn: u(() => [W("div", { style: I({ ...v.value }), class: "o-input__title" }, z(e.$attrs.title), 5)]), key: "0" } : void 0, e.$slots.prefix ? { name: "prefix", fn: u(() => [b(e.$slots, "prefix", {}, void 0, !0)]), key: "1" } : void 0, e.$slots.suffix ? { name: "suffix", fn: u(() => [b(e.$slots, "suffix", {}, void 0, !0)]), key: "2" } : void 0, e.$slots.append ? { name: "append", fn: u(() => [b(e.$slots, "append", {}, void 0, !0)]), key: "3" } : void 0, e.$slots.prepend ? { name: "prepend", fn: u(() => [b(e.$slots, "prepend", {}, void 0, !0)]), key: "4" } : void 0]), 1040, ["modelValue", "placeholder", "showPassword", "class", "maxlength", "show-word-limit"]))])]), _: 3 }, 16, ["content", "disabled"]), n.content ? (h(), C(c, w({ key: 0, class: "o-input__icon" }, { name: "warning", color: "#DCDEE0", size: "16px", ...a.iconAttrs }, { content: n.content }), null, 16, ["content"])) : E("", !0), e.$attrs.type === "textarea" && O(r) && e.$attrs.disabled !== !0 && e.$attrs.disabled !== "" ? (h(), C(c, { key: 1, name: "circle-close", class: "o-input__clear", onClick: N })) : E("", !0)], 16);
64
- };
65
- } }), [["__scopeId", "data-v-fa217d2f"]]));
66
- export {
67
- ee as default
68
- };
@@ -1,37 +0,0 @@
1
- import { defineComponent as S, useCssVars as _, ref as v, useAttrs as F, computed as h, watch as $, onMounted as E, onBeforeUnmount as O, resolveComponent as T, createElementBlock as D, openBlock as l, createBlock as i, resolveDynamicComponent as j, mergeProps as d, createSlots as N, withCtx as n, createElementVNode as k, normalizeClass as L, renderSlot as m, toDisplayString as u, createCommentVNode as w, createTextVNode as x } from "vue";
2
- import { m as M, _ as z, w as I } from "./index-DkSTvVGB.js";
3
- const P = { class: "o-dialog" }, U = S({ name: "ODialog" }), H = I(z(S({ ...U, props: { type: { type: String, default: "" }, title: { type: String, default: "提示" }, theme: { type: String, default: "" }, cancel: { type: [Function, String], default: "" }, cancelText: { type: String, default: "取消" }, confirmText: { type: String, default: "确认" }, showFooter: { type: Boolean, default: !0 }, showCancel: { type: Boolean, default: !0 }, showConfirm: { type: Boolean, default: !0 }, confirmAttrs: { type: Object, default: () => ({}) }, cancelAttrs: { type: Object, default: () => ({}) }, enableConfirm: { type: Boolean, default: !0 }, confirm: { type: Function } }, emits: ["update:modelValue"], setup(t, { emit: b }) {
4
- _((o) => ({ "9b0d9700": s.value }));
5
- const a = F(), f = b, e = t, B = h(() => e.theme === "norm" ? "kd-norm-dialog" : e.theme === "norm16" ? "kd-norm16-dialog" : e.theme === "simple" ? "kd-simple-dialog" : ""), s = v("calc(100vh - 124px)");
6
- $(() => e.showFooter, (o) => {
7
- a.fullscreen !== !0 && a.fullscreen !== "" || (e.showFooter === !1 ? s.value = "calc(100vh - 74px)" : s.value = "calc(100vh - 124px)");
8
- }, { immediate: !0 });
9
- const r = v(!1);
10
- async function p() {
11
- e.confirm && M(e.confirm) === "function" ? (r.value = !0, await e.confirm().finally(() => {
12
- r.value = !1;
13
- })) : a.onConfirm ? a.onConfirm() : y();
14
- }
15
- function A() {
16
- a.onCancel ? a.onCancel() : f("update:modelValue", !1);
17
- }
18
- function y() {
19
- f("update:modelValue", !1);
20
- }
21
- function C({ code: o }) {
22
- var c;
23
- a.modelValue === !0 && o === "Enter" && e.enableConfirm && ((c = e.confirmAttrs) == null ? void 0 : c.loading) !== !0 && p();
24
- }
25
- const V = h(() => e.type === "" ? "el-dialog" : e.type === "drawer" ? "el-drawer" : void 0);
26
- return E(() => {
27
- document.addEventListener("keypress", C);
28
- }), O(() => {
29
- document.removeEventListener("keypress", C);
30
- }), (o, c) => {
31
- const g = T("el-button");
32
- return l(), D("div", P, [(l(), i(j(V.value), d({ "custom-class": B.value }, { width: "640px", closeOnClickModal: !0, destroyOnClose: !0, draggable: !0, ...o.$attrs }, { onClose: y }), N({ header: n(() => [m(o.$slots, "header", {}, () => [k("span", null, u(t.title), 1)], !0)]), default: n(() => [k("div", { class: L(o.$attrs.fullscreen === !0 || o.$attrs.fullscreen === "" ? "dialog_fullscreen " : "dialog_slot_box") }, [m(o.$slots, "default", {}, void 0, !0)], 2)]), _: 2 }, [t.showFooter ? { name: "footer", fn: n(() => [m(o.$slots, "footer", {}, () => [t.showCancel ? (l(), i(g, d({ key: 0, type: t.cancelAttrs.type || "" }, t.cancelAttrs, { onClick: A }), { default: n(() => [x(u(t.cancelText), 1)]), _: 1 }, 16, ["type"])) : w("", !0), t.showConfirm ? (l(), i(g, d({ key: 1, loading: r.value, id: "kdDialogConfirmBtn", type: t.confirmAttrs.type || "primary" }, t.confirmAttrs, { onClick: p }), { default: n(() => [x(u(t.confirmText), 1)]), _: 1 }, 16, ["loading", "type"])) : w("", !0)], !0)]), key: "0" } : void 0]), 1040, ["custom-class"]))]);
33
- };
34
- } }), [["__scopeId", "data-v-9272cec5"]]));
35
- export {
36
- H as default
37
- };
@@ -1,12 +0,0 @@
1
- import { defineComponent as l, getCurrentInstance as d, useAttrs as u, computed as i, createElementBlock as h, createCommentVNode as f, openBlock as g, mergeProps as v, toDisplayString as y } from "vue";
2
- import { _ as A, w as _ } from "./index-DkSTvVGB.js";
3
- const w = l({ name: "OCompTitle" }), k = _(A(l({ ...w, props: { title: { type: String, default: "" }, titleAttrs: { type: Object, default: () => ({}) } }, setup(o) {
4
- const { proxy: r } = d(), s = u(), t = o, p = ["small", "large"], n = i(() => {
5
- var e, a;
6
- return (e = t.titleAttrs) != null && e.width ? { ...t.titleAttrs, width: r.processWidth((a = t.titleAttrs) == null ? void 0 : a.width, !0) } : t.titleAttrs;
7
- }), c = i(() => s.size ? `el-input--${s.size}` : "o-comp-title__base-size"), m = i(() => ({ height: !p.includes(s.size) && "32px" }));
8
- return (e, a) => t.title ? (g(), h("div", v({ key: 0, class: ["o-comp-title", c.value], style: { ...m.value, ...n.value } }, e.$attrs), y(t.title), 17)) : f("", !0);
9
- } }), [["__scopeId", "data-v-47a44559"]]));
10
- export {
11
- k as default
12
- };
@@ -1,33 +0,0 @@
1
- import { defineComponent as x, ref as i, watch as $, computed as j, resolveComponent as b, createElementBlock as y, openBlock as c, createBlock as h, createCommentVNode as A, createVNode as B, mergeProps as r, withCtx as m, createTextVNode as k, renderSlot as V, Fragment as O, renderList as F, resolveDynamicComponent as N, normalizeProps as P, guardReactiveProps as T, toDisplayString as U } from "vue";
2
- import { i as g, _ as z, w as E } from "./index-DkSTvVGB.js";
3
- const I = { class: "checkbox" }, R = x({ name: "OCheckbox" }), H = E(z(x({ ...R, props: { type: { type: String, default: "" }, options: { type: Object, default: () => [] }, showType: { type: String, validator: (u) => ["check", "button"].includes(u), default: "check" }, modelValue: { type: Array, defalut: () => [] }, label: { type: String, default: "label" }, value: { type: String, default: "value" }, showAll: { type: Boolean, default: !0 }, attrs: { type: Object, default: () => {
4
- } }, customDisabled: { type: Function, default: () => {
5
- } }, customLabel: { type: [Function, String], default: "" } }, emits: ["update:modelValue"], setup(u, { emit: w }) {
6
- const e = u, o = i(!1), s = i(!1), v = i([]);
7
- $(() => e.modelValue, (a) => {
8
- let l = [];
9
- l = g(a) || typeof a != "object" ? [] : a.filter((d) => e.options.some((n) => e.type === "simple" ? n === d : n[e.value])), g(l) ? (s.value = !1, o.value = !1) : l.length === e.options.length ? (s.value = !1, o.value = !0) : (s.value = !0, o.value = !1);
10
- }, { deep: !0, immediate: !0 });
11
- const C = w;
12
- function S() {
13
- const a = e.options.map((l) => e.type === "simple" ? l : l[e.value]);
14
- s.value || o.value === !1 && s.value === !0 || o.value === !0 && s.value === !1 ? p(a) : o.value === !1 && s.value === !1 && p([]);
15
- }
16
- const _ = j(() => ({ check: "el-checkbox", button: "el-checkbox-button" })[e.showType] ?? "el-checkbox");
17
- function D(a, l) {
18
- p(a);
19
- }
20
- function p(a) {
21
- v.value = a, C("update:modelValue", v.value);
22
- }
23
- function L(a, l) {
24
- return typeof e.customLabel == "function" ? e.customLabel(a, l) : e.type === "simple" ? a : a[e.label];
25
- }
26
- return (a, l) => {
27
- const d = b("el-checkbox"), n = b("el-checkbox-group");
28
- return c(), y("div", I, [u.showAll ? (c(), h(d, r({ key: 0, modelValue: o.value, "onUpdate:modelValue": l[0] || (l[0] = (t) => o.value = t), class: "checkbox__all", indeterminate: s.value, onChange: S }, a.$attrs), { default: m(() => [k(" 全选 ")]), _: 1 }, 16, ["modelValue", "indeterminate"])) : A("", !0), B(n, r({ modelValue: e.modelValue, "onUpdate:modelValue": l[1] || (l[1] = (t) => e.modelValue = t), onChange: D }, a.$attrs), { default: m(() => [V(a.$slots, "default", {}, () => [(c(!0), y(O, null, F(e.options, (t, f) => (c(), h(N(_.value), r(u.attrs, { key: f, value: e.type === "simple" ? t : t[e.value], label: e.type === "simple" ? t : t[e.label], disabled: e.customDisabled(t) }), { default: m(() => [V(a.$slots, e.type === "simple" ? t : t.slot, P(T(e.type === "simple" ? {} : t)), () => [k(U(L(t, f)), 1)], !0)]), _: 2 }, 1040, ["value", "label", "disabled"]))), 128))], !0)]), _: 3 }, 16, ["modelValue"])]);
29
- };
30
- } }), [["__scopeId", "data-v-e6ef015c"]]));
31
- export {
32
- H as default
33
- };
@@ -1,12 +0,0 @@
1
- import { defineComponent as s, getCurrentInstance as o, resolveComponent as a, createBlock as r, openBlock as n, mergeProps as c } from "vue";
2
- import { _ as p, w as m } from "./index-DkSTvVGB.js";
3
- const l = s({ name: "OSwitch" }), h = m(p(s({ ...l, setup(u) {
4
- const { proxy: i } = o();
5
- return (t, f) => {
6
- const e = a("el-switch");
7
- return n(), r(e, c(t.$attrs, { class: "o-custom-switch" }), null, 16);
8
- };
9
- } }), [["__scopeId", "data-v-ef67cc48"]]));
10
- export {
11
- h as default
12
- };
@@ -1,18 +0,0 @@
1
- import { defineComponent as i, computed as V, resolveComponent as d, createElementBlock as n, openBlock as l, createVNode as y, mergeProps as p, withCtx as s, Fragment as g, renderList as _, createBlock as S, renderSlot as m, createTextVNode as k, toDisplayString as x } from "vue";
2
- import { _ as A, w as B } from "./index-DkSTvVGB.js";
3
- const C = { class: "tabs-box" }, $ = i({ name: "OTabs" }), O = B(A(i({ ...$, props: { modelValue: { type: String }, options: { type: Array, default: () => [] }, label: { type: String, default: "label" }, value: { type: String, default: "value" }, subAttrs: { type: Object, default: () => {
4
- } } }, emits: ["update:modelValue"], setup(o, { emit: b }) {
5
- const e = o, c = b, u = V({ get: () => {
6
- var a;
7
- return e.modelValue || ((a = e.options[0]) == null ? void 0 : a[e.value]);
8
- }, set(a) {
9
- c("update:modelValue", a);
10
- } });
11
- return (a, r) => {
12
- const f = d("el-tab-pane"), v = d("el-tabs");
13
- return l(), n("div", C, [y(v, p(a.$attrs, { modelValue: u.value, "onUpdate:modelValue": r[0] || (r[0] = (t) => u.value = t) }), { default: s(() => [(l(!0), n(g, null, _(e.options, (t) => (l(), S(f, p({ key: t[e.value], name: t[e.value], label: t[e.label] }, o.subAttrs), { label: s(() => [m(a.$slots, t[e.value] + "-label", {}, () => [k(x(t[e.label]), 1)], !0)]), default: s(() => [m(a.$slots, t[e.value], {}, void 0, !0)]), _: 2 }, 1040, ["name", "label"]))), 128))]), _: 3 }, 16, ["modelValue"])]);
14
- };
15
- } }), [["__scopeId", "data-v-d3af55d7"]]));
16
- export {
17
- O as default
18
- };
@@ -1,35 +0,0 @@
1
- import { defineComponent as v, ref as u, computed as y, onMounted as b, onUnmounted as x, resolveComponent as p, createElementBlock as N, openBlock as f, createVNode as k, createBlock as h, createCommentVNode as _, mergeProps as m, withCtx as $, createElementVNode as o, normalizeStyle as C, toDisplayString as S, renderSlot as z } from "vue";
2
- import { r as B, s as E, _ as q, w as V } from "./index-DkSTvVGB.js";
3
- const j = { class: "f-st-ct w-100%" }, A = { class: "percentage-value" }, L = { class: "" }, O = v({ name: "OCapacityProgress" }), D = V(q(v({ ...O, props: { total: { type: [String, Number], required: !0 }, used: { type: [String, Number], required: !0 }, iconAttrs: { type: Object, default: () => {
4
- } } }, setup(l) {
5
- const t = u(null), i = u(null), c = l;
6
- function d() {
7
- return `${s.value}%`;
8
- }
9
- const s = y(() => {
10
- let e = 100 * Number((c.used || 0) / (c.total || 0)) || 0;
11
- return isNaN(e) ? 0 : Number(e.toFixed(2));
12
- });
13
- function g(e) {
14
- return B(e < 90 ? "--blue" : "--red");
15
- }
16
- const a = async () => {
17
- var e, n;
18
- if (await E(), t.value && ((n = (e = t.value) == null ? void 0 : e.$el) == null ? void 0 : n.offsetWidth)) {
19
- let r = t.value.$el.offsetWidth - 16 + "px";
20
- return i.value.style.width = r, { width: r };
21
- }
22
- return { width: "200px" };
23
- };
24
- return b(() => {
25
- window.addEventListener("resize", a);
26
- }), x(() => {
27
- window.removeEventListener("resize", a);
28
- }), (e, n) => {
29
- const r = p("o-progress"), w = p("o-icon");
30
- return f(), N("div", j, [k(r, m({ ref_key: "progressBoxRef", ref: t, class: "progress-box", percentage: s.value, type: "line", "stroke-width": 20, "text-inside": "", format: d, color: g }, e.$attrs), { default: $(({ percentage: P }) => [o("div", { ref_key: "percentageRef", ref: i, class: "f-bt-ct", style: C({ ...a() }) }, [o("div", A, S(d()), 1), o("div", L, [z(e.$slots, "default", {}, void 0, !0)])], 4)]), _: 3 }, 16, ["percentage"]), s.value > 100 ? (f(), h(w, m({ key: 0, name: "warning", content: "已用容量远超总容量, 请扩容 ", class: "ml" }, l.iconAttrs), null, 16)) : _("", !0)]);
31
- };
32
- } }), [["__scopeId", "data-v-56fcbcdd"]]));
33
- export {
34
- D as default
35
- };
@@ -1,12 +0,0 @@
1
- import { defineComponent as p, computed as r, resolveComponent as v, createBlock as s, openBlock as t, normalizeProps as n, guardReactiveProps as d, withCtx as u, renderSlot as i, createElementBlock as f, Fragment as g, renderList as S, resolveDynamicComponent as B, mergeProps as h, createTextVNode as k, toDisplayString as w } from "vue";
2
- import { w as C } from "./index-DkSTvVGB.js";
3
- const x = p({ name: "ORadio" }), T = C(p({ ...x, props: { type: { type: String, validator: (a) => ["boolean", "simple", ""].includes(a), default: "" }, showType: { type: String, validator: (a) => ["radio", "button"].includes(a), default: "radio" }, options: { type: Array, default: () => [] }, border: { type: Boolean, default: !1 }, value: { type: [String, Number, Boolean], default: "value" }, label: { type: [String, Number, Boolean], default: "label" }, subAttrs: { type: Object, default: () => ({}) } }, setup(a) {
4
- const e = a, b = r(() => ({ radio: "el-radio", button: "el-radio-button" })[e.showType] ?? "el-radio"), m = r(() => e.type === "boolean" ? [{ label: !0, value: !0 }, { label: !1, value: !1 }] : e.type === "simple" && e.options.length > 0 ? e.options.map((o) => ({ label: o, value: o })) : e.options);
5
- return (o, A) => {
6
- const c = v("el-radio-group");
7
- return t(), s(c, n(d(o.$attrs)), { default: u(() => [i(o.$slots, "default", {}, () => [(t(!0), f(g, null, S(m.value, (l, y) => (t(), s(B(b.value), h(l, { key: y, label: l[e.label], value: l[e.value], border: a.border, disabled: l[a.subAttrs.disabled] }), { default: u(() => [i(o.$slots, l.slot, n(d(l)), () => [k(w(l[e.label]), 1)])]), _: 2 }, 1040, ["label", "value", "border", "disabled"]))), 128))])]), _: 3 }, 16);
8
- };
9
- } }));
10
- export {
11
- T as default
12
- };
@@ -1,13 +0,0 @@
1
- import { defineComponent as n, resolveComponent as d, createBlock as l, openBlock as c, normalizeProps as m, guardReactiveProps as g, withCtx as a, renderSlot as r, createTextVNode as u, toDisplayString as h, createElementVNode as y, normalizeStyle as f, unref as o } from "vue";
2
- import { p as i, n as S, _ as w, w as v } from "./index-DkSTvVGB.js";
3
- const N = ["src"], _ = n({ name: "OEmpty" }), C = v(w(n({ ..._, props: { description: { type: String, default: "暂无数据" }, width: { type: [String, Number], default: 60 }, height: { type: [String, Number] }, imgAttrs: { type: Object, default: () => {
4
- } }, src: { type: String, default: () => S } }, setup(s) {
5
- const t = s;
6
- return (e, $) => {
7
- const p = d("el-empty");
8
- return c(), l(p, m(g({ ...e.$attrs, ...t })), { image: a(() => [r(e.$slots, "image", {}, () => [y("img", { src: s.src, style: f({ width: o(i)(t.width, !0), height: o(i)(t.height, !0), ...t.imgAttrs }) }, null, 12, N)], !0)]), description: a(() => [r(e.$slots, "description", {}, () => [u(h(s.description), 1)], !0)]), default: a(() => [r(e.$slots, "default", {}, void 0, !0)]), _: 3 }, 16);
9
- };
10
- } }), [["__scopeId", "data-v-73fd1aa7"]]));
11
- export {
12
- C as default
13
- };
@@ -1,45 +0,0 @@
1
- import { defineComponent as f, ref as c, watch as b, createElementBlock as n, openBlock as u, createElementVNode as d, createBlock as C, createCommentVNode as w, createVNode as _, Fragment as A, renderList as B, normalizeClass as D, toDisplayString as K, unref as m, withKeys as j, withModifiers as E } from "vue";
2
- import I from "./index-BVxV3IZX.js";
3
- import N from "./index-E4jh-RZ6.js";
4
- import { o as p, $ as v, _ as O, w as L } from "./index-DkSTvVGB.js";
5
- const S = { class: "o-input-box cl-blue" }, $ = { class: "o-input-box__content" }, z = { key: 0, class: "spanclose", style: { cursor: "not-allowed" } }, F = ["onClick"], M = f({ name: "OInputLabel" }), P = L(O(f({ ...M, props: { modelValue: { type: Array, default: () => [] }, isComplex: { type: Boolean, default: !1 }, regexp: { tupe: RegExp, default: "" }, message: { tupe: String, default: "输入有误" }, inputAttrs: { type: Object, default: () => ({}) } }, emits: ["update:modelValue"], setup(g, { expose: x, emit: h }) {
6
- const t = c(""), l = c([]), o = g, r = h;
7
- function y() {
8
- var s;
9
- if (console.log("props.regexp", o.regexp), console.log("currentval.value", t.value), o.regexp && !o.regexp.test(t.value))
10
- return v(o.message, "e");
11
- if (!t.value)
12
- return !1;
13
- let a = !1;
14
- for (let e = 0; e < l.value.length; e++)
15
- if (o.isComplex) {
16
- if (((s = l.value[e]) == null ? void 0 : s.name) == t.value) {
17
- a = !0;
18
- break;
19
- }
20
- } else if (l.value[e] == t.value) {
21
- a = !0;
22
- break;
23
- }
24
- a ? v("重复项不允许添加", "e") : (typeof t.value == "string" && o.isComplex ? l.value.push({ name: t.value }) : l.value.push(t.value), t.value = "", r("update:modelValue", l.value));
25
- }
26
- function V() {
27
- r("update:modelValue", []);
28
- }
29
- return b(() => o.modelValue, (a) => {
30
- var s;
31
- if (a && a.length > 0) {
32
- l.value = [];
33
- for (let e = 0; e < a.length; e++)
34
- (!o.isComplex && p(a[e]) || p(a[e]) && p((s = a[e]) == null ? void 0 : s.name)) && l.value.push(a[e]);
35
- } else
36
- l.value = [];
37
- }, { immediate: !0 }), x({ $getValue: function() {
38
- return l.value;
39
- } }), (a, s) => (u(), n("div", S, [d("div", $, [(u(!0), n(A, null, B(l.value, (e, i) => (u(), n("div", { key: i, class: D(e.isDelete === 0 ? "disbox" : "spanbox") }, [d("span", null, K(e.name || e), 1), e.isDelete === 0 ? (u(), n("i", z)) : (u(), n("i", { key: 1, class: "spanclose", onClick: (R) => function(k, U) {
40
- l.value.splice(k, 1), r("update:modelValue", l.value);
41
- }(i) }, null, 8, F))], 2))), 128)), _(m(I), { placeholder: o.inputAttrs.placeholder || "输入后回车", width: o.inputAttrs.width || 120, modelValue: t.value, "onUpdate:modelValue": s[0] || (s[0] = (e) => t.value = e), onKeyup: j(E(y, ["stop"]), ["enter"]), clearable: "", type: "text" }, null, 8, ["placeholder", "width", "modelValue", "onKeyup"])]), l.value.length > 0 ? (u(), C(m(N), { key: 0, name: "circle-close", class: "o-input-label__clear", onClick: V })) : w("", !0)]));
42
- } }), [["__scopeId", "data-v-5c5c95f2"]]));
43
- export {
44
- P as default
45
- };
@@ -1,22 +0,0 @@
1
- import { defineComponent as h, ref as p, watch as b, createElementBlock as y, openBlock as w, createVNode as x, createElementVNode as a, unref as n, toDisplayString as m, pushScopeId as S, popScopeId as k } from "vue";
2
- import { E as O } from "./useEcharts-BuT3eL3E.js";
3
- import { y as f, x as z, z as r, r as v, _ as N, w as _ } from "./index-DkSTvVGB.js";
4
- const g = (t) => (S("data-v-fb6d6aa7"), t = t(), k(), t), $ = { class: "box" }, E = { class: "f w-100% list-container" }, I = { class: "list" }, j = g(() => a("div", null, "使用量", -1)), B = { class: "num" }, C = { class: "list" }, L = g(() => a("div", null, "总量", -1)), V = { class: "num" }, A = h({ name: "OUsedPie" }), R = _(N(h({ ...A, props: { used: { type: [Number, String], default: 0 }, total: { type: [Number, String], default: 0 }, options: { type: Object, default: () => {
5
- } } }, setup(t) {
6
- const d = t, u = p(), c = p("0%");
7
- let o = { tooltip: { trigger: "item", show: !1 }, series: [{ type: "pie", center: ["50%", "50%"], radius: ["65%", "85%"], clockwise: !0, avoidLabelOverlap: !0, hoverOffset: 15, itemStyle: { color: function(e) {
8
- return e.name === "使用量" ? v("--blue") : v("--green");
9
- } }, label: { show: !1, position: "outside", formatter: function(e) {
10
- e.name, e.value;
11
- let { value: i, name: l } = e.data, s = r(i);
12
- return `${l}: ${s}
13
- 占比: (${e.percent}%)`;
14
- }, rich: { hr: { backgroundColor: "t", borderRadius: 3, width: 3, height: 3, padding: [3, 3, 0, -12] }, a: { padding: [-30, 15, -20, 15] } } }, labelLine: { normal: { length: 20, length2: 30, lineStyle: { width: 1 } } }, data: [] }], graphic: [{ type: "text", left: "center", top: "center", style: { text: "", textAlign: "center", fontSize: 34, fontWeight: "bold", fill: "#333" } }] };
15
- return b(() => [d.used, d.total], ([e, i]) => {
16
- let l = f(e), s = f(i);
17
- s != 0 && (c.value = (l / s * 100).toFixed(2) + "%"), o.series[0].data = [{ name: "使用量", value: l }, { name: "剩余量", value: s - l }], o.graphic[0].style.text = c.value, u.value = z(o);
18
- }, { deep: !0, immediate: !0 }), (e, i) => (w(), y("div", $, [x(n(O), { class: "calc-height", option: u.value, autoresize: "" }, null, 8, ["option"]), a("div", E, [a("div", I, [j, a("div", B, m(n(r)(t.used)), 1)]), a("div", C, [L, a("div", V, m(n(r)(t.total)), 1)])])]));
19
- } }), [["__scopeId", "data-v-fb6d6aa7"]]));
20
- export {
21
- R as default
22
- };
@@ -1,67 +0,0 @@
1
- import { defineComponent as Q, getCurrentInstance as W, useAttrs as _, useSlots as z, computed as m, ref as w, watch as q, resolveComponent as v, createElementBlock as p, openBlock as u, normalizeStyle as H, normalizeClass as Z, unref as g, createVNode as b, createCommentVNode as F, mergeProps as L, createSlots as M, withCtx as c, withModifiers as $, createTextVNode as ee, Fragment as le, renderList as x, createBlock as te, renderSlot as k, toDisplayString as V, createElementVNode as I, pushScopeId as ae, popScopeId as oe } from "vue";
2
- import { i as S, p as se, _ as ie, w as ne } from "./index-DkSTvVGB.js";
3
- import ue from "./index-Bhz66Ovv.js";
4
- const re = { key: 0 }, de = { key: 1 }, pe = { key: 0, class: "po-r" }, ce = ((o) => (ae("data-v-d3a669d0"), o = o(), oe(), o))(() => I("div", { class: "mt" }, "全选", -1)), me = ["src"], ge = Q({ name: "OSelect" }), ye = ne(ie(Q({ ...ge, props: { modelValue: { type: [Array, String, Number] }, value: { type: String, default: "value" }, label: { type: [String, Array], default: "label" }, options: { type: Array, default: () => [] }, type: { type: String, default: "" }, multiple: { type: Boolean, default: !1 }, showAll: { type: Boolean, default: !0 }, showPrefix: { type: Boolean, default: !1 }, showQuick: { type: Boolean, default: !0 }, title: { type: String, default: "" }, connect: { type: String, default: "/" }, customLabel: { type: [Function, String], default: "" }, width: { type: [String, Number], default: "" }, disPlaceholder: { type: String, default: "" }, optionDisabled: { type: Function, default: () => {
5
- } }, url: { type: [String, Function], default: "" }, urlParams: { type: Object, default: () => {
6
- } }, optionsExpression: { type: String, default: "" }, emptyColor: { type: Boolean, default: !1 } }, emits: ["changeSelect", "update:modelValue", "change"], setup(o, { emit: N }) {
7
- const { proxy: U } = W(), i = _(), f = N, P = z(), O = m(() => {
8
- const e = U.clone(P);
9
- return delete e.default, e;
10
- }), l = o, r = w(l.options);
11
- q(() => l.options, (e) => {
12
- r.value = e;
13
- }, { deep: !0, immediate: !0 });
14
- const A = w(null), h = m({ get: () => S(l.modelValue) && l.multiple ? [] : l.modelValue, set(e) {
15
- f("update:modelValue", e);
16
- } }), B = m(() => i.disabled === "" || !!i.disabled), Y = m({ get() {
17
- const e = l.modelValue;
18
- return !!e && (e == null ? void 0 : e.length) !== l.options.length && (e == null ? void 0 : e.length) !== 0;
19
- }, set: (e) => (e == null ? void 0 : e.length) !== l.options.length && (e == null ? void 0 : e.length) !== 0 }), E = m({ get() {
20
- const e = l.modelValue;
21
- return (e == null ? void 0 : e.length) === l.options.length;
22
- }, set: (e) => (e == null ? void 0 : e.length) === l.options.length }), K = (e) => {
23
- y(e ? l.options.map((t) => t[l.value]) : []);
24
- }, X = () => {
25
- y(l.options.filter((e) => !l.modelValue.includes(e[l.value])).map((e) => e[l.value]));
26
- };
27
- function j(e) {
28
- if (typeof l.customLabel == "function")
29
- return l.customLabel(e);
30
- if (Array.isArray(l.label)) {
31
- let t = "";
32
- return l.label.forEach((s) => {
33
- t += e[s] + l.connect;
34
- }), t.slice(0, -1);
35
- }
36
- return e[l.label];
37
- }
38
- const D = () => {
39
- if (l.options.length === 0 || i.disabled === "" || i.disabled)
40
- return;
41
- let e = 0;
42
- S(l.modelValue) || l.multiple === !0 && l.modelValue.length > 1 ? e = 0 : (e = l.options.findIndex((t) => l.type === "simple" ? t === l.modelValue : l.multiple === !0 ? t[l.value] === l.modelValue[0] : t[l.value] === l.modelValue) + 1, e === l.options.length && (e = 0)), l.type === "simple" ? A.value.$emit("change", l.options[e]) : l.multiple === !0 ? A.value.$emit("change", [l.options[e][l.value]]) : A.value.$emit("change", l.options[e][l.value]);
43
- };
44
- function y(e) {
45
- let t = [];
46
- const s = r.value.filter((n) => !!e.includes(n[l.value]) && (t.push(n[l.label]), !0));
47
- C(e, t, s);
48
- }
49
- function T(e) {
50
- if (Array.isArray(e))
51
- return void y(e);
52
- if (!e)
53
- return void C("", "", "");
54
- let t = r.value.filter((n) => l.type === "simple" ? n === e : n[l.value] === e)[0], s = t[l.label];
55
- C(e, s, t);
56
- }
57
- function C(e, t, s) {
58
- f("changeSelect", e, t, s), f("update:modelValue", e), f("change", e);
59
- }
60
- return (e, t) => {
61
- const s = v("el-checkbox"), n = v("el-button"), G = v("el-option"), J = v("el-select");
62
- return u(), p("div", { class: Z(["o-select", { "has-title": l.title, "has-quick": l.showQuick && !B.value && l.options.length > 0 }]), style: H({ ...g(se)(l.width) }) }, [b(g(ue), { title: l.title, size: g(i).size, titleAttrs: e.$attrs.titleAttrs ?? {} }, null, 8, ["title", "size", "titleAttrs"]), b(J, L({ ref_key: "selectRef", ref: A, class: ["o-select__select", g(S)(r.value) && o.emptyColor ? "o-select__empty" : ""], modelValue: h.value, "onUpdate:modelValue": t[1] || (t[1] = (a) => h.value = a), placeholder: i.disabled ? l.disPlaceholder : i.placeholder || "请选择", "popper-class": "o-select__multiple-checkbox", multiple: o.multiple, onChange: T }, { clearable: !0, filterable: !0, ...Object.entries(e.$attrs).reduce((a, [d, R]) => (d !== "class" && d !== "style" && (a[d] = R), a), {}) }), M({ default: c(() => [o.multiple && l.showAll ? (u(), p("div", pe, [b(s, { indeterminate: Y.value, modelValue: E.value, "onUpdate:modelValue": t[0] || (t[0] = (a) => E.value = a), onChange: K, class: "o-select__all-select f-st-ct" }, { default: c(() => [ce]), _: 1 }, 8, ["indeterminate", "modelValue"]), b(n, { type: "primary", onClick: $(X, ["stop"]), size: "small", class: "reverse-select" }, { default: c(() => [ee("反选")]), _: 1 })])) : F("", !0), (u(!0), p(le, null, x(r.value, (a) => (u(), te(G, { key: o.type === "simple" ? a : a[l.value], label: o.type === "simple" ? a : j(a), value: o.type === "simple" ? a : a[l.value], disabled: o.optionDisabled(a) }, { default: c(() => [k(e.$slots, "default", { options: r.value, item: a }, void 0, !0)]), _: 2 }, 1032, ["label", "value", "disabled"]))), 128))]), _: 2 }, [l.showPrefix ? { name: "prefix", fn: c(() => [k(e.$slots, "prefix", {}, () => [Array.isArray(h.value) ? (u(), p("span", re, V(h.value.length) + "/" + V(l.options.length), 1)) : (u(), p("span", de, V(l.options.length) + "个", 1))], !0)]), key: "0" } : void 0, x(O.value, (a, d) => ({ name: d, fn: c(() => [k(e.$slots, d, {}, void 0, !0)]) }))]), 1040, ["class", "modelValue", "placeholder", "multiple"]), o.showQuick && !B.value && l.options.length > 0 ? (u(), p("div", { key: 0, class: "o-select__select-box", onClick: D }, [I("img", { src: g("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAA3tJREFUWEfFlzFo1GAUx/8vd4iCQ0eHigoOdetgwcFBQVC3ghVbcEhySSbFQYcWlLYotEMdRKckl3yD0IoVuqkg6OAg1MHNDoIVO3TsULDIXZ79ksslud6lufZssxyX+/K93/d/7/7vhXDIF+0lvmEY/bWArgA4ioA+CWGv7GUf+UxhAFU3VRCugjEcBk6uLeE5x3oCoJrmIOo0XFYC13XdNbmpahgXECjzAJ9OByGiTWZeA+iV8OypVgCtYj5kpvIOsBIvCcf5Ft/PKKDq1hTAkwBNCM+e1XRjjkH3m5sQFijgN77vLuadWKtYd5j5efs1NJ0GbgtARC6Y+xgYCTchWkAJ08IulmtVt8YBnmmekqgGQAD8q0QsYnV31ECsABHVmLkcfQaPhOfOdpPjGICAHyA6He4FLPqec7N1nw4pkIemGis8lM5XUYimAkTvoPAEBbQcQfBT33MfZGop/SWpgVCcdRDCYiFgrUTBdFq6PJg0gKja11XdGAdoRh6KGJc9z/7cqQgzucsEIYyJqrNQRAW1Yo6CMS9rya/apnxG083XjZpaEZ5zrj2AqvZR6chtZhzPBuJ14TmiSPB4jfSNssIfYtWkedVZ+SlTgdRhChtRN8E7rdUqlrPtHUZamQMFiFMDoOmeBwoQOqtusvwsK3xSpucwAP40eokm6yoEkD1A/lfBwbPW/2kvcp/eQ9OtZQafJ6K7ftV+EQLE3k2gr75nD/U6aBbAmAMp92KTixSQrRbw08XxPyF2OGFjwPgtfxCec6B10Qym6mZUHF04Xi9UagK0M4leBNhtj0SBxL9rJQrOpC1Uzn97sWKATmTyTdjk+t+XQoiNDs3I/A5gIN27Y2W6SU3K8doIEE1bbQF03brIhI9hwwBPyEFErVhvwXwtHtN2k1T+3mg8kwz0h+sZgwA31MgZyaK2Gc2B8UCCgGa6BUhDxiYXHUpeuwBEEFHvlhBgXmXgbDcKJC3ZGCdSHifjnYTIAYikIxWgU9KfEuqQPJO7vFSoljWAOibBPBo+CSyCaEO24lyA7EiWDRF7d15gTTNGWKEbYISBo+DRHJhMynljeePFpDUIEdf8qvOk9X4D+Nb2gNHPzC1TFK1CCcaE636JC7MWKAbyXkyKVHimwGL3TG5ugbAExvuivrEv31dVawAKX5JNLD3/dXOQfQF0E6jT2n+839ww67q/YQAAAABJRU5ErkJggg=="), alt: "", width: "12px" }, null, 8, me)])) : F("", !0)], 6);
63
- };
64
- } }), [["__scopeId", "data-v-d3a669d0"]]));
65
- export {
66
- ye as default
67
- };