yahee-components 0.0.71 → 0.0.72
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/es/annex-upload/annex-upload.vue.js +51 -154
- package/es/annex-upload/annex-upload.vue2.js +119 -2
- package/es/annex-upload/index.js +3 -3
- package/es/api/tool.js +1 -1
- package/es/border-wrap/border-wrap.vue.js +64 -95
- package/es/border-wrap/border-wrap.vue2.js +46 -2
- package/es/common-import/common-import.vue.js +384 -4
- package/es/common-import/common-import.vue2.js +90 -434
- package/es/complex-search/complex-search.vue.js +17 -17
- package/es/copy/copy.vue.js +37 -55
- package/es/copy/copy.vue2.js +34 -2
- package/es/copy/index.js +3 -3
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +114 -213
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
- package/es/drop-down-condition/drop-down-condition.vue.js +115 -215
- package/es/drop-down-condition/drop-down-condition.vue2.js +127 -2
- package/es/echart-gauge/echart-gauge.vue.js +12 -140
- package/es/echart-gauge/echart-gauge.vue2.js +147 -2
- package/es/echart-gauge/index.js +3 -3
- package/es/image-upload/image-upload.vue.js +109 -170
- package/es/image-upload/image-upload.vue2.js +91 -2
- package/es/image-upload/index.js +3 -3
- package/es/input/index.js +3 -3
- package/es/input/input.vue.js +17 -38
- package/es/input/input.vue2.js +33 -2
- package/es/left-condition/index.js +3 -3
- package/es/left-condition/left-condition-sub.vue.js +32 -91
- package/es/left-condition/left-condition-sub.vue2.js +76 -2
- package/es/left-condition/left-condition.vue.js +70 -218
- package/es/left-condition/left-condition.vue2.js +160 -2
- package/es/left-condition-enum/index.js +3 -3
- package/es/left-condition-enum/left-condition-enum.vue.js +20 -49
- package/es/left-condition-enum/left-condition-enum.vue2.js +40 -2
- package/es/operation-log/operation-log-content.vue.js +71 -92
- package/es/operation-log/operation-log-content.vue2.js +39 -2
- package/es/operation-log/operation-log-dialog.vue.js +45 -67
- package/es/operation-log/operation-log-dialog.vue2.js +38 -2
- package/es/operation-log/operation-log-form.vue.js +108 -183
- package/es/operation-log/operation-log-form.vue2.js +104 -2
- package/es/operation-log/operation-log.vue.js +119 -228
- package/es/operation-log/operation-log.vue2.js +135 -2
- package/es/packages/components/api/log-server.js +6 -6
- package/es/packages/components/api/upload-server.js +1 -1
- package/es/packages/components/hooks/useEcharts.js +19 -19
- package/es/packages/components/hooks/useImg.js +8 -8
- package/es/scale-screen/index.js +4 -4
- package/es/scale-screen/scale-screen.vue.js +19 -126
- package/es/scale-screen/scale-screen.vue2.js +125 -2
- package/es/utils/translate.js +18 -18
- package/es/yahee-components.css +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,127 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as R, toRefs as D, reactive as _, ref as c, watch as M } from "vue";
|
|
2
|
+
import { stylesUtils as T } from "../utils/style.js";
|
|
3
|
+
import { M2 as H } from "../utils/translate.js";
|
|
4
|
+
import L from "../_virtual/lodash.js";
|
|
5
|
+
import { ElPopover as U, ElCheckboxGroup as Y, ElCheckbox as z, ElButton as I } from "element-plus";
|
|
6
|
+
import "element-plus/theme-chalk/src/base.scss";
|
|
7
|
+
import "element-plus/theme-chalk/src/button.scss";
|
|
8
|
+
import "element-plus/theme-chalk/src/checkbox.scss";
|
|
9
|
+
import "element-plus/theme-chalk/src/checkbox-group.scss";
|
|
10
|
+
import "element-plus/theme-chalk/src/popper.scss";
|
|
11
|
+
import "element-plus/theme-chalk/src/popover.scss";
|
|
12
|
+
const ae = /* @__PURE__ */ R({
|
|
13
|
+
name: "YaheeCountryPlatformShopCondition",
|
|
14
|
+
__name: "country-platform-shop-condition",
|
|
15
|
+
props: {
|
|
16
|
+
xyFilters: { type: Object, required: !1 },
|
|
17
|
+
filterKey: { type: String, required: !0 }
|
|
18
|
+
},
|
|
19
|
+
emits: ["filterChange"],
|
|
20
|
+
setup(j, { expose: K, emit: O }) {
|
|
21
|
+
K();
|
|
22
|
+
const G = j, { filterKey: m, xyFilters: a } = D(G), d = O, t = _({});
|
|
23
|
+
let f = _({});
|
|
24
|
+
const p = c({}), v = c({}), i = c(!0), y = c({}), h = c({}), x = c();
|
|
25
|
+
a.value && (x.value = [...a.value.xGroup]);
|
|
26
|
+
function A(e, o) {
|
|
27
|
+
var u;
|
|
28
|
+
return (u = a.value) == null ? void 0 : u.items.filter((l) => l.xGroupValue === e && l.yGroupValue === o);
|
|
29
|
+
}
|
|
30
|
+
function F(e) {
|
|
31
|
+
var u;
|
|
32
|
+
const o = e.xGroupValue;
|
|
33
|
+
if (y.value[o]) {
|
|
34
|
+
for (const l in t)
|
|
35
|
+
l.startsWith(o) && delete t[l];
|
|
36
|
+
y.value[o] = !1;
|
|
37
|
+
} else {
|
|
38
|
+
for (const l of (u = a.value) == null ? void 0 : u.items)
|
|
39
|
+
if (l.xGroupValue === o) {
|
|
40
|
+
let n = t[`${l.xGroupValue}-${l.yGroupValue}`];
|
|
41
|
+
n ? (n.push(l.value), n = [...new Set(n)]) : n = [l.value], t[`${l.xGroupValue}-${l.yGroupValue}`] = n;
|
|
42
|
+
}
|
|
43
|
+
y.value[o] = !0;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const P = (e) => T.getBackgroundColor(e), W = () => {
|
|
47
|
+
L.isEqual(f, t) || d("filterChange", [
|
|
48
|
+
{
|
|
49
|
+
filterKey: m.value,
|
|
50
|
+
checkedValues: Object.values(Object.values(t)).flat()
|
|
51
|
+
}
|
|
52
|
+
]);
|
|
53
|
+
}, q = () => {
|
|
54
|
+
f = L.cloneDeep(t);
|
|
55
|
+
};
|
|
56
|
+
function w() {
|
|
57
|
+
if (i.value)
|
|
58
|
+
i.value = !1, Object.keys(t).forEach((e) => {
|
|
59
|
+
delete t[e];
|
|
60
|
+
});
|
|
61
|
+
else {
|
|
62
|
+
i.value = !0;
|
|
63
|
+
for (const e of a.value.items) {
|
|
64
|
+
let o = t[`${e.xGroupValue}-${e.yGroupValue}`];
|
|
65
|
+
o ? o.push(e.value) : o = [e.value], t[`${e.xGroupValue}-${e.yGroupValue}`] = o;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
console.log(t);
|
|
69
|
+
}
|
|
70
|
+
function B(e) {
|
|
71
|
+
const o = e.yGroupValue;
|
|
72
|
+
if (h.value[o]) {
|
|
73
|
+
for (const u in t)
|
|
74
|
+
u.endsWith(o) && delete t[u];
|
|
75
|
+
h.value[o] = !1;
|
|
76
|
+
} else {
|
|
77
|
+
for (const u of a.value.items)
|
|
78
|
+
if (u.yGroupValue === o) {
|
|
79
|
+
let l = t[`${u.xGroupValue}-${u.yGroupValue}`];
|
|
80
|
+
l ? (l.push(u.value), l = [...new Set(l)]) : l = [u.value], t[`${u.xGroupValue}-${u.yGroupValue}`] = l;
|
|
81
|
+
}
|
|
82
|
+
h.value[o] = !0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
M(
|
|
86
|
+
t,
|
|
87
|
+
(e, o) => {
|
|
88
|
+
var S, k, E, $;
|
|
89
|
+
Object.keys(e).forEach((r) => {
|
|
90
|
+
Array.isArray(e[r]) && e[r].length === 0 && delete e[r];
|
|
91
|
+
}), console.log("新的数组:", e), console.log("旧的数组:", o);
|
|
92
|
+
const u = { backgroundColor: "#3366CC", color: "#fff", borderColor: "#3366CC" }, l = { backgroundColor: "#00bfff", borderColor: "#00bfff" }, n = {}, V = (S = a.value) == null ? void 0 : S.xGroup.length, b = (k = a.value) == null ? void 0 : k.yGroup.length;
|
|
93
|
+
(E = a.value) == null || E.xGroup.forEach((r) => {
|
|
94
|
+
let s = 0;
|
|
95
|
+
for (const g in t)
|
|
96
|
+
g.startsWith(r.xGroupValue) && s++;
|
|
97
|
+
s === 0 ? p.value[r.xGroupValue] = n : s === b ? p.value[r.xGroupValue] = u : p.value[r.xGroupValue] = l;
|
|
98
|
+
}), ($ = a.value) == null || $.yGroup.forEach((r) => {
|
|
99
|
+
let s = 0;
|
|
100
|
+
for (const g in t)
|
|
101
|
+
g.endsWith(r.yGroupValue) && s++;
|
|
102
|
+
s === 0 ? v.value[r.yGroupValue] = n : s === V ? v.value[r.yGroupValue] = u : v.value[r.yGroupValue] = l;
|
|
103
|
+
}), i.value = Object.keys(e).length === V * b;
|
|
104
|
+
},
|
|
105
|
+
{ deep: !0 }
|
|
106
|
+
);
|
|
107
|
+
const C = { props: G, filterKey: m, xyFilters: a, emit: d, checkList: t, get backupCheckList() {
|
|
108
|
+
return f;
|
|
109
|
+
}, set backupCheckList(e) {
|
|
110
|
+
f = e;
|
|
111
|
+
}, rowTitleStyle: p, columnTitleStyle: v, isSelectedAll: i, toggleRowSelectionFlags: y, toggleColumnSelectionFlags: h, selectList: x, getContentForCell: A, toggleRowSelection: F, getDefaultSelectedAllStyle: P, handleHide: W, handleShow: q, selectAll: w, toggleColumnSelection: B, get M2() {
|
|
112
|
+
return H;
|
|
113
|
+
}, get ElButton() {
|
|
114
|
+
return I;
|
|
115
|
+
}, get ElCheckbox() {
|
|
116
|
+
return z;
|
|
117
|
+
}, get ElCheckboxGroup() {
|
|
118
|
+
return Y;
|
|
119
|
+
}, get ElPopover() {
|
|
120
|
+
return U;
|
|
121
|
+
} };
|
|
122
|
+
return Object.defineProperty(C, "__isScriptSetup", { enumerable: !1, value: !0 }), C;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
2
125
|
export {
|
|
3
|
-
|
|
126
|
+
ae as default
|
|
4
127
|
};
|
|
@@ -1,225 +1,125 @@
|
|
|
1
|
-
import
|
|
2
|
-
import s from "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
function oe(t) {
|
|
84
|
-
const o = r.value.find((e) => e.text === t);
|
|
85
|
-
o && o.subs && (n[t] = o.subs.map((e) => e.value));
|
|
86
|
-
}
|
|
87
|
-
function ne(t) {
|
|
88
|
-
n[t] = [];
|
|
89
|
-
}
|
|
90
|
-
function ue() {
|
|
91
|
-
const t = `filter-key-${x.enumEntity}`, o = G.getWithExpireTime(t);
|
|
92
|
-
o ? r.value = o : (console.log(x.enumEntity), x.initFilters(x.enumEntity).then((e) => {
|
|
93
|
-
console.log(e), r.value = e.data, G.setWithExpireTime(t, r.value, 1200 * 1e3), console.log(r.value);
|
|
94
|
-
}).catch((e) => {
|
|
95
|
-
console.log(e);
|
|
96
|
-
}));
|
|
97
|
-
}
|
|
98
|
-
return re(
|
|
99
|
-
[() => C.value, () => V.value, () => F.value],
|
|
100
|
-
([t, o, e], [l, f, A]) => {
|
|
101
|
-
console.log(t, o, e), console.log(l, f, A), (!O.value || !s.eq(O.value, w.value)) && (T.value = C.value, S.value = V.value, B.value = F.value);
|
|
102
|
-
}
|
|
103
|
-
), ce(() => {
|
|
104
|
-
ue();
|
|
105
|
-
}), (t, o) => (a(), i("div", de, [
|
|
106
|
-
W(u(P), {
|
|
107
|
-
size: "small",
|
|
108
|
-
class: "el-button el-button--small custom-total-button",
|
|
109
|
-
style: R(te(h.value)),
|
|
110
|
-
onClick: ee
|
|
111
|
-
}, {
|
|
112
|
-
default: d(() => [
|
|
113
|
-
k(v(u(y)("全部")) + " ", 1),
|
|
114
|
-
u(C) ? (a(), i("span", ve, "(" + v(T.value) + ")", 1)) : N("", !0)
|
|
115
|
-
]),
|
|
116
|
-
_: 1
|
|
117
|
-
}, 8, ["style"]),
|
|
118
|
-
W(u(ie), {
|
|
119
|
-
ref_key: "dropdown1",
|
|
120
|
-
ref: Q,
|
|
121
|
-
"popper-class": "custom-dropdown",
|
|
122
|
-
onVisibleChange: le
|
|
123
|
-
}, {
|
|
124
|
-
dropdown: d(() => [
|
|
125
|
-
E("div", he, [
|
|
126
|
-
(a(!0), i(b, null, z(r.value, (e) => (a(), g(u(Y), {
|
|
127
|
-
key: e.value,
|
|
128
|
-
modelValue: n[e.text],
|
|
129
|
-
"onUpdate:modelValue": (l) => n[e.text] = l,
|
|
1
|
+
import C from "./drop-down-condition.vue2.js";
|
|
2
|
+
import { createElementBlock as n, openBlock as l, createVNode as _, normalizeStyle as x, withCtx as a, createTextVNode as r, createCommentVNode as i, toDisplayString as c, createElementVNode as k, Fragment as s, renderList as h, createBlock as d } from "vue";
|
|
3
|
+
import v from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const y = { class: "yahee-drop-down-condition" }, m = { key: 0 }, f = { style: { display: "flex", "align-items": "center", outline: "none" } }, g = { key: 0 }, w = { style: { display: "flex", width: "auto", padding: "10px" } }, V = ["onClick"], E = { class: "scrollable-container" }, p = { key: 0 };
|
|
5
|
+
function S(N, B, M, e, z, D) {
|
|
6
|
+
return l(), n("div", y, [
|
|
7
|
+
_(e.ElButton, {
|
|
8
|
+
size: "small",
|
|
9
|
+
class: "el-button el-button--small custom-total-button",
|
|
10
|
+
style: x(e.getDefaultSelectedAllStyle(e.isSelectedAll)),
|
|
11
|
+
onClick: e.selectAll
|
|
12
|
+
}, {
|
|
13
|
+
default: a(() => [
|
|
14
|
+
r(c(e.M2("全部")) + " ", 1),
|
|
15
|
+
e.totalCount ? (l(), n("span", m, "(" + c(e.totalNum) + ")", 1)) : i("", !0)
|
|
16
|
+
]),
|
|
17
|
+
_: 1
|
|
18
|
+
}, 8, ["style"]),
|
|
19
|
+
_(e.ElDropdown, {
|
|
20
|
+
ref: "dropdown1",
|
|
21
|
+
"popper-class": "custom-dropdown",
|
|
22
|
+
onVisibleChange: e.handleVisible
|
|
23
|
+
}, {
|
|
24
|
+
dropdown: a(() => [
|
|
25
|
+
k("div", w, [
|
|
26
|
+
(l(!0), n(s, null, h(e.selectList, (o) => (l(), d(e.ElCheckboxGroup, {
|
|
27
|
+
key: o.value,
|
|
28
|
+
modelValue: e.totalCheckBoxStatus[o.text],
|
|
29
|
+
"onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
|
|
30
|
+
size: "small",
|
|
31
|
+
class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
|
|
32
|
+
onChange: (t) => e.changeCheckbox(o)
|
|
33
|
+
}, {
|
|
34
|
+
default: a(() => [
|
|
35
|
+
e._.isNil(o.subs) ? (l(), d(e.ElCheckbox, {
|
|
36
|
+
key: 1,
|
|
37
|
+
value: o.value,
|
|
38
|
+
class: "checkbox custom-dropdown-button",
|
|
39
|
+
border: ""
|
|
40
|
+
}, {
|
|
41
|
+
default: a(() => [
|
|
42
|
+
r(c(e.M2(o.text)), 1)
|
|
43
|
+
]),
|
|
44
|
+
_: 2
|
|
45
|
+
}, 1032, ["value"])) : (l(), n(s, { key: 0 }, [
|
|
46
|
+
k("span", {
|
|
47
|
+
class: "el-button custom-dropdown-button el-button--small inner-el-button",
|
|
48
|
+
style: x(e.selectedStyles[o.text]),
|
|
49
|
+
onClick: (t) => e.onClick(o)
|
|
50
|
+
}, c(e.M2(o.text)), 13, V),
|
|
51
|
+
k("div", E, [
|
|
52
|
+
(l(!0), n(s, null, h(o.subs, (t) => (l(), d(e.ElCheckbox, {
|
|
53
|
+
key: t.value,
|
|
54
|
+
class: "checkbox custom-dropdown-button",
|
|
55
|
+
value: t.value,
|
|
56
|
+
border: ""
|
|
57
|
+
}, {
|
|
58
|
+
default: a(() => {
|
|
59
|
+
var u;
|
|
60
|
+
return [
|
|
61
|
+
r(c(e.M2(t.text)), 1),
|
|
62
|
+
e._.isEmpty(e.level2Num) ? i("", !0) : (l(), n("span", p, "(" + c((u = e.level2Num.filter((b) => b.value == t.value)[0]) == null ? void 0 : u.count) + ")", 1))
|
|
63
|
+
];
|
|
64
|
+
}),
|
|
65
|
+
_: 2
|
|
66
|
+
}, 1032, ["value"]))), 128))
|
|
67
|
+
])
|
|
68
|
+
], 64))
|
|
69
|
+
]),
|
|
70
|
+
_: 2
|
|
71
|
+
}, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
|
|
72
|
+
])
|
|
73
|
+
]),
|
|
74
|
+
default: a(() => [
|
|
75
|
+
k("div", f, [
|
|
76
|
+
(l(!0), n(s, null, h(e.selectList, (o) => (l(), n(s, null, [
|
|
77
|
+
o.isCheckbox ? (l(), d(e.ElCheckboxGroup, {
|
|
78
|
+
key: o.value,
|
|
79
|
+
modelValue: e.totalCheckBoxStatus[o.text],
|
|
80
|
+
"onUpdate:modelValue": (t) => e.totalCheckBoxStatus[o.text] = t,
|
|
81
|
+
class: "checkbox-group",
|
|
130
82
|
size: "small",
|
|
131
|
-
|
|
132
|
-
onChange: (l) => X(e)
|
|
83
|
+
onChange: e.singleChangeCheckbox
|
|
133
84
|
}, {
|
|
134
|
-
default:
|
|
135
|
-
|
|
136
|
-
key:
|
|
137
|
-
|
|
138
|
-
|
|
85
|
+
default: a(() => [
|
|
86
|
+
o.isCheckbox ? (l(), d(e.ElCheckbox, {
|
|
87
|
+
key: 0,
|
|
88
|
+
class: "custom-dropdown-button",
|
|
89
|
+
value: o.value,
|
|
139
90
|
border: ""
|
|
140
91
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
|
|
92
|
+
default: a(() => [
|
|
93
|
+
r(c(e.M2(o.text)), 1)
|
|
143
94
|
]),
|
|
144
95
|
_: 2
|
|
145
|
-
}, 1032, ["value"])) :
|
|
146
|
-
E("span", {
|
|
147
|
-
class: "el-button custom-dropdown-button el-button--small inner-el-button",
|
|
148
|
-
style: R(c[e.text]),
|
|
149
|
-
onClick: (l) => q(e)
|
|
150
|
-
}, v(u(y)(e.text)), 13, me),
|
|
151
|
-
E("div", ge, [
|
|
152
|
-
(a(!0), i(b, null, z(e.subs, (l) => (a(), g(u(j), {
|
|
153
|
-
key: l.value,
|
|
154
|
-
class: "checkbox custom-dropdown-button",
|
|
155
|
-
value: l.value,
|
|
156
|
-
border: ""
|
|
157
|
-
}, {
|
|
158
|
-
default: d(() => {
|
|
159
|
-
var f;
|
|
160
|
-
return [
|
|
161
|
-
k(v(u(y)(l.text)), 1),
|
|
162
|
-
u(s).isEmpty(B.value) ? N("", !0) : (a(), i("span", ye, "(" + v((f = B.value.filter((A) => A.value == l.value)[0]) == null ? void 0 : f.count) + ")", 1))
|
|
163
|
-
];
|
|
164
|
-
}),
|
|
165
|
-
_: 2
|
|
166
|
-
}, 1032, ["value"]))), 128))
|
|
167
|
-
])
|
|
168
|
-
], 64))
|
|
96
|
+
}, 1032, ["value"])) : i("", !0)
|
|
169
97
|
]),
|
|
170
98
|
_: 2
|
|
171
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
_: 2
|
|
196
|
-
}, 1032, ["value"])) : N("", !0)
|
|
197
|
-
]),
|
|
198
|
-
_: 2
|
|
199
|
-
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (a(), g(u(P), {
|
|
200
|
-
key: e.text,
|
|
201
|
-
style: R(c[e.text]),
|
|
202
|
-
class: "custom-dropdown-button",
|
|
203
|
-
size: "small",
|
|
204
|
-
onClick: (l) => q(e)
|
|
205
|
-
}, {
|
|
206
|
-
default: d(() => {
|
|
207
|
-
var l;
|
|
208
|
-
return [
|
|
209
|
-
k(v(u(y)(e.text)) + " ", 1),
|
|
210
|
-
u(s).isEmpty(S.value) ? N("", !0) : (a(), i("span", pe, "(" + v((l = S.value.filter((f) => f.value == e.value)[0]) == null ? void 0 : l.count) + ")", 1))
|
|
211
|
-
];
|
|
212
|
-
}),
|
|
213
|
-
_: 2
|
|
214
|
-
}, 1032, ["style", "onClick"]))
|
|
215
|
-
], 64))), 256))
|
|
216
|
-
])
|
|
217
|
-
]),
|
|
218
|
-
_: 1
|
|
219
|
-
}, 512)
|
|
220
|
-
]));
|
|
221
|
-
}
|
|
222
|
-
});
|
|
99
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : (l(), d(e.ElButton, {
|
|
100
|
+
key: o.text,
|
|
101
|
+
style: x(e.selectedStyles[o.text]),
|
|
102
|
+
class: "custom-dropdown-button",
|
|
103
|
+
size: "small",
|
|
104
|
+
onClick: (t) => e.onClick(o)
|
|
105
|
+
}, {
|
|
106
|
+
default: a(() => {
|
|
107
|
+
var t;
|
|
108
|
+
return [
|
|
109
|
+
r(c(e.M2(o.text)) + " ", 1),
|
|
110
|
+
e._.isEmpty(e.level1Num) ? i("", !0) : (l(), n("span", g, "(" + c((t = e.level1Num.filter((u) => u.value == o.value)[0]) == null ? void 0 : t.count) + ")", 1))
|
|
111
|
+
];
|
|
112
|
+
}),
|
|
113
|
+
_: 2
|
|
114
|
+
}, 1032, ["style", "onClick"]))
|
|
115
|
+
], 64))), 256))
|
|
116
|
+
])
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
}, 512)
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
const G = /* @__PURE__ */ v(C, [["render", S], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/drop-down-condition/drop-down-condition.vue"]]);
|
|
223
123
|
export {
|
|
224
|
-
|
|
124
|
+
G as default
|
|
225
125
|
};
|
|
@@ -1,4 +1,129 @@
|
|
|
1
|
-
import f from "
|
|
1
|
+
import { defineComponent as U, ref as f, reactive as C, toRefs as Y, watch as $, onMounted as z } from "vue";
|
|
2
|
+
import n from "../_virtual/lodash.js";
|
|
3
|
+
import { stylesUtils as S } from "../utils/style.js";
|
|
4
|
+
import { storage as L } from "../utils/storage.js";
|
|
5
|
+
import { M2 as H } from "../utils/translate.js";
|
|
6
|
+
import { ElDropdown as J, ElCheckboxGroup as Q, ElCheckbox as X, ElButton as Z } from "element-plus";
|
|
7
|
+
import "element-plus/theme-chalk/src/base.scss";
|
|
8
|
+
import "element-plus/theme-chalk/src/button.scss";
|
|
9
|
+
import "element-plus/theme-chalk/src/checkbox.scss";
|
|
10
|
+
import "element-plus/theme-chalk/src/checkbox-group.scss";
|
|
11
|
+
import "element-plus/theme-chalk/src/button-group.scss";
|
|
12
|
+
import "element-plus/theme-chalk/src/popper.scss";
|
|
13
|
+
import "element-plus/theme-chalk/src/scrollbar.scss";
|
|
14
|
+
import "element-plus/theme-chalk/src/dropdown.scss";
|
|
15
|
+
const de = /* @__PURE__ */ U({
|
|
16
|
+
name: "YaheeDropDownCondition",
|
|
17
|
+
__name: "drop-down-condition",
|
|
18
|
+
props: {
|
|
19
|
+
filterList: { type: Array, required: !1 },
|
|
20
|
+
totalCount: { type: Number, required: !1 },
|
|
21
|
+
level1Count: { type: Array, required: !1 },
|
|
22
|
+
level2Count: { type: Array, required: !1 },
|
|
23
|
+
filterKey: { type: String, required: !0 },
|
|
24
|
+
enumEntity: { type: String, required: !0 },
|
|
25
|
+
noNeedRefreshNumFilterName: { type: String, required: !1 },
|
|
26
|
+
initFilters: { type: Function, required: !1 }
|
|
27
|
+
},
|
|
28
|
+
emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
|
|
29
|
+
setup(B, { expose: R, emit: K }) {
|
|
30
|
+
R();
|
|
31
|
+
const M = f(), l = C({});
|
|
32
|
+
let g = C({});
|
|
33
|
+
const s = C({}), i = C({}), a = f(!0), c = B, N = K, { filterKey: p, filterList: b, totalCount: d, level1Count: m, level2Count: v, noNeedRefreshNumFilterName: x } = Y(c), _ = f(n.get(d, "value", 0)), F = f(n.get(m, "value", [])), q = f(n.get(v, "value", [])), u = f();
|
|
34
|
+
b.value && (u.value = [...b.value]);
|
|
35
|
+
function O(e) {
|
|
36
|
+
const { text: t, value: r } = e, o = l[t];
|
|
37
|
+
n.isNil(o) || n.isEmpty(o) ? l[t] = [r] : l[t] = [], i[t] = !i[t], i[t] ? (A(t), s[t] = S.getBackgroundColor(!0), a.value = !1) : (j(t), s[e.text] = {}, a.value = !0), a.value = h(), y();
|
|
38
|
+
}
|
|
39
|
+
function h() {
|
|
40
|
+
const e = u.value.filter((o) => !n.isEmpty(o.subs)).flatMap((o) => o.subs).length, t = u.value.filter((o) => n.isEmpty(o.subs)).length;
|
|
41
|
+
return Object.values(l).map((o) => o.length).reduce((o, k) => o + k, 0) === e + t || n.isEmpty(Object.values(l).flat());
|
|
42
|
+
}
|
|
43
|
+
function G(e) {
|
|
44
|
+
n.isEmpty(l[e.text]) ? (s[e.text] = {}, i[e.text] = !1) : l[e.text].length === n.get(e, "subs.length", 1) ? (s[e.text] = S.getBackgroundColor(!0), i[e.text] = !0) : s[e.text] = {
|
|
45
|
+
backgroundColor: "#0F7535",
|
|
46
|
+
color: "#fff",
|
|
47
|
+
borderColor: "#0F7535"
|
|
48
|
+
}, a.value = h(), y();
|
|
49
|
+
}
|
|
50
|
+
function I() {
|
|
51
|
+
a.value = h(), y();
|
|
52
|
+
}
|
|
53
|
+
function y() {
|
|
54
|
+
N("setNoNeedRefreshNumFilterName", p.value);
|
|
55
|
+
}
|
|
56
|
+
function P() {
|
|
57
|
+
a.value = !0;
|
|
58
|
+
for (const e in s)
|
|
59
|
+
s[e] = {};
|
|
60
|
+
for (const e in l)
|
|
61
|
+
delete l[e];
|
|
62
|
+
for (const e in i)
|
|
63
|
+
delete i[e];
|
|
64
|
+
E();
|
|
65
|
+
}
|
|
66
|
+
const T = (e) => S.getBackgroundColor(e);
|
|
67
|
+
function V(e) {
|
|
68
|
+
if (e)
|
|
69
|
+
g = n.cloneDeep(l);
|
|
70
|
+
else {
|
|
71
|
+
if (n.isEqual(g, l))
|
|
72
|
+
return;
|
|
73
|
+
E();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function E() {
|
|
77
|
+
N("filterChange", [
|
|
78
|
+
{
|
|
79
|
+
filterKey: p.value,
|
|
80
|
+
checkedValues: Object.values(l).flat()
|
|
81
|
+
}
|
|
82
|
+
]);
|
|
83
|
+
}
|
|
84
|
+
function A(e) {
|
|
85
|
+
const t = u.value.find((r) => r.text === e);
|
|
86
|
+
t && t.subs && (l[e] = t.subs.map((r) => r.value));
|
|
87
|
+
}
|
|
88
|
+
function j(e) {
|
|
89
|
+
l[e] = [];
|
|
90
|
+
}
|
|
91
|
+
function w() {
|
|
92
|
+
const e = `filter-key-${c.enumEntity}`, t = L.getWithExpireTime(e);
|
|
93
|
+
t ? u.value = t : (console.log(c.enumEntity), c.initFilters(c.enumEntity).then((r) => {
|
|
94
|
+
console.log(r), u.value = r.data, L.setWithExpireTime(e, u.value, 1200 * 1e3), console.log(u.value);
|
|
95
|
+
}).catch((r) => {
|
|
96
|
+
console.log(r);
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
$(
|
|
100
|
+
[() => d.value, () => m.value, () => v.value],
|
|
101
|
+
([e, t, r], [o, k, W]) => {
|
|
102
|
+
console.log(e, t, r), console.log(o, k, W), (!x.value || !n.eq(x.value, p.value)) && (_.value = d.value, F.value = m.value, q.value = v.value);
|
|
103
|
+
}
|
|
104
|
+
), z(() => {
|
|
105
|
+
w();
|
|
106
|
+
});
|
|
107
|
+
const D = { dropdown1: M, totalCheckBoxStatus: l, get judgeChange() {
|
|
108
|
+
return g;
|
|
109
|
+
}, set judgeChange(e) {
|
|
110
|
+
g = e;
|
|
111
|
+
}, selectedStyles: s, selectedAllStatus: i, isSelectedAll: a, props: c, emit: N, filterKey: p, filterList: b, totalCount: d, level1Count: m, level2Count: v, noNeedRefreshNumFilterName: x, totalNum: _, level1Num: F, level2Num: q, selectList: u, onClick: O, getIsNeedSelectAll: h, changeCheckbox: G, singleChangeCheckbox: I, setNoNeedRefreshNumFilterName: y, selectAll: P, getDefaultSelectedAllStyle: T, handleVisible: V, updateParentForm: E, selectAllCheckboxes: A, deSelectCheckboxes: j, initData: w, get _() {
|
|
112
|
+
return n;
|
|
113
|
+
}, get M2() {
|
|
114
|
+
return H;
|
|
115
|
+
}, get ElButton() {
|
|
116
|
+
return Z;
|
|
117
|
+
}, get ElCheckbox() {
|
|
118
|
+
return X;
|
|
119
|
+
}, get ElCheckboxGroup() {
|
|
120
|
+
return Q;
|
|
121
|
+
}, get ElDropdown() {
|
|
122
|
+
return J;
|
|
123
|
+
} };
|
|
124
|
+
return Object.defineProperty(D, "__isScriptSetup", { enumerable: !1, value: !0 }), D;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
2
127
|
export {
|
|
3
|
-
|
|
128
|
+
de as default
|
|
4
129
|
};
|