yahee-components 0.0.107 → 0.0.109

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.
Files changed (66) hide show
  1. package/es/annex-upload/annex-upload.vue.js +51 -154
  2. package/es/annex-upload/annex-upload.vue2.js +119 -2
  3. package/es/annex-upload/index.js +3 -3
  4. package/es/border-wrap/border-wrap.vue.js +64 -95
  5. package/es/border-wrap/border-wrap.vue2.js +46 -2
  6. package/es/common-import/common-import.vue.js +369 -693
  7. package/es/common-import/common-import.vue2.js +364 -2
  8. package/es/common-import/index.js +3 -3
  9. package/es/complex-search/batch-search-dialog.vue.js +116 -4
  10. package/es/complex-search/batch-search-dialog.vue2.js +27 -136
  11. package/es/complex-search/complex-search.vue.js +14 -14
  12. package/es/copy/copy.vue.js +37 -55
  13. package/es/copy/copy.vue2.js +34 -2
  14. package/es/copy/index.js +3 -3
  15. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +114 -213
  16. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
  17. package/es/drop-down-condition/drop-down-condition.vue.js +123 -5
  18. package/es/drop-down-condition/drop-down-condition.vue2.js +103 -259
  19. package/es/echart-gauge/echart-gauge.vue.js +12 -140
  20. package/es/echart-gauge/echart-gauge.vue2.js +147 -2
  21. package/es/echart-gauge/index.js +3 -3
  22. package/es/file-download-wrapper/file-download-wrapper.vue.js +143 -244
  23. package/es/file-download-wrapper/file-download-wrapper.vue2.js +113 -2
  24. package/es/file-download-wrapper/index.js +4 -4
  25. package/es/filter-container/filter-container.vue.js +18 -66
  26. package/es/filter-container/filter-container.vue2.js +59 -2
  27. package/es/filter-container/index.js +4 -4
  28. package/es/filter-wrapper/filter-wrapper.vue.js +16 -4
  29. package/es/filter-wrapper/filter-wrapper.vue2.js +40 -45
  30. package/es/height-collapse/height-collapse.vue.js +24 -51
  31. package/es/height-collapse/height-collapse.vue2.js +42 -2
  32. package/es/height-collapse/index.js +4 -4
  33. package/es/help-tag/help-tag.vue.js +44 -78
  34. package/es/help-tag/help-tag.vue2.js +49 -2
  35. package/es/help-tag/index.js +3 -3
  36. package/es/image-upload/image-upload.vue.js +109 -170
  37. package/es/image-upload/image-upload.vue2.js +91 -2
  38. package/es/image-upload/index.js +3 -3
  39. package/es/left-condition/index.js +3 -3
  40. package/es/left-condition/left-condition-sub.vue.js +32 -91
  41. package/es/left-condition/left-condition-sub.vue2.js +76 -2
  42. package/es/left-condition/left-condition.vue.js +70 -218
  43. package/es/left-condition/left-condition.vue2.js +160 -2
  44. package/es/left-condition-enum/index.js +3 -3
  45. package/es/left-condition-enum/left-condition-enum.vue.js +20 -49
  46. package/es/left-condition-enum/left-condition-enum.vue2.js +40 -2
  47. package/es/operation-log/operation-log-content.vue.js +71 -92
  48. package/es/operation-log/operation-log-content.vue2.js +39 -2
  49. package/es/operation-log/operation-log-dialog.vue.js +45 -67
  50. package/es/operation-log/operation-log-dialog.vue2.js +38 -2
  51. package/es/operation-log/operation-log-form.vue.js +108 -183
  52. package/es/operation-log/operation-log-form.vue2.js +104 -2
  53. package/es/operation-log/operation-log.vue.js +119 -228
  54. package/es/operation-log/operation-log.vue2.js +135 -2
  55. package/es/packages/components/api/log-server.js +6 -6
  56. package/es/packages/components/api/upload-server.js +1 -1
  57. package/es/packages/components/hooks/useEcharts.js +19 -19
  58. package/es/packages/components/hooks/useImg.js +8 -8
  59. package/es/scale-screen/index.js +4 -4
  60. package/es/scale-screen/scale-screen.vue.js +19 -126
  61. package/es/scale-screen/scale-screen.vue2.js +125 -2
  62. package/es/yahee-components.css +1 -1
  63. package/package.json +1 -1
  64. package/types/src/drop-down-condition/drop-down-condition.vue.d.ts +15 -27
  65. package/types/src/drop-down-condition/index.d.ts +25 -25
  66. package/types/src/installs.d.ts +25 -25
@@ -1,285 +1,129 @@
1
- import { defineComponent as he, ref as k, reactive as j, toRefs as ee, watch as I, onMounted as pe, resolveComponent as F, createElementBlock as p, openBlock as i, createVNode as K, normalizeStyle as M, withCtx as b, createTextVNode as N, createCommentVNode as T, toDisplayString as g, unref as h, createElementVNode as B, Fragment as E, renderList as q, createBlock as V } from "vue";
2
- import r from "../_virtual/lodash.js";
3
- import { stylesUtils as w } from "../utils/style.js";
4
- import { storage as te } from "../utils/storage.js";
5
- import { M2 as m } from "../utils/translate.js";
6
- const be = { class: "yahee-drop-down-condition" }, ge = { key: 0 }, xe = { style: { display: "flex", "align-items": "center", outline: "none" } }, ke = { key: 0 }, me = { style: { display: "flex", width: "auto", padding: "10px" } }, ye = ["onClick", "disabled"], _e = { class: "scrollable-container" }, Ce = { key: 0 }, Se = /* @__PURE__ */ he({
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({
7
16
  name: "YaheeDropDownCondition",
8
17
  __name: "drop-down-condition",
9
18
  props: {
10
- max: {},
11
- filterList: {},
12
- totalCount: {},
13
- level1Count: {},
14
- level2Count: {},
15
- filterKey: {},
16
- enumEntity: {},
17
- noNeedRefreshNumFilterName: {},
18
- initFilters: { type: Function }
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 }
19
27
  },
20
28
  emits: ["filterChange", "setNoNeedRefreshNumFilterName"],
21
- setup(le, { emit: oe }) {
22
- const ne = k(), t = j({}), W = j({}), u = j({}), d = j({}), y = k(!0), f = k([]), x = le, { max: v = 1 / 0 } = ee(x), P = oe, { filterKey: D, filterList: O, totalCount: A, level1Count: Y, level2Count: G, noNeedRefreshNumFilterName: H } = ee(x), J = k(r.get(A, "value", 0)), R = k(r.get(Y, "value", [])), z = k(r.get(G, "value", []));
23
- function ae() {
24
- return Object.values(t).flat().length;
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();
25
38
  }
26
- function _(e) {
27
- return v.value === 1 / 0 || ae() < v.value ? !1 : !Object.values(t).flat().includes(e);
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());
28
42
  }
29
- function Q() {
30
- if (v.value === 1 / 0) return;
31
- const e = Object.values(t).flat();
32
- if (e.length > v.value) {
33
- const l = e.slice(0, v.value);
34
- Object.keys(t).forEach((o) => {
35
- t[o] = [], u[o] = {}, d[o] = !1;
36
- }), l.forEach((o) => {
37
- var s;
38
- for (const a of f.value)
39
- if (a.value === o) {
40
- t[a.text] = [o], u[a.text] = w.getBackgroundColor(!0), d[a.text] = !0;
41
- break;
42
- } else if ((s = a.subs) != null && s.some((C) => C.value === o)) {
43
- t[a.text] || (t[a.text] = []), t[a.text].push(o);
44
- const C = t[a.text].length, n = a.subs.length;
45
- C === n ? (u[a.text] = w.getBackgroundColor(!0), d[a.text] = !0) : u[a.text] = {
46
- backgroundColor: "#0F7535",
47
- color: "#fff",
48
- borderColor: "#0F7535"
49
- };
50
- break;
51
- }
52
- });
53
- }
54
- }
55
- function se() {
56
- if (O.value && O.value.length > 0) {
57
- f.value = [...O.value];
58
- return;
59
- }
60
- const e = `filter-key-${x.enumEntity}`, l = te.getWithExpireTime(e);
61
- l ? f.value = l : x.initFilters && x.initFilters(x.enumEntity).then((o) => {
62
- f.value = o.data, te.setWithExpireTime(e, f.value, 1200 * 1e3);
63
- }).catch((o) => {
64
- console.error(`获取${x.enumEntity}筛选列表失败:`, o);
65
- });
66
- }
67
- function X(e) {
68
- const { text: l, value: o } = e, s = t[l];
69
- v.value === 1 && Object.keys(t).forEach((a) => {
70
- t[a] = [], u[a] = {}, d[a] = !1;
71
- }), r.isNil(s) || r.isEmpty(s) ? t[l] = [o] : t[l] = [], d[l] = !d[l], d[l] ? (de(l), u[l] = w.getBackgroundColor(!0)) : (fe(l), u[e.text] = {}), y.value = L(), U();
72
- }
73
- function L() {
74
- if (!f.value.length) return !0;
75
- const e = f.value.filter((s) => !r.isEmpty(s.subs)).flatMap((s) => s.subs).length, l = f.value.filter((s) => r.isEmpty(s.subs)).length, o = Object.values(t).flat().length;
76
- return o === e + l || o === 0;
77
- }
78
- function ue(e) {
79
- if (v.value === 1) {
80
- const s = t[e.text].slice(-1)[0];
81
- Object.keys(t).forEach((a) => {
82
- t[a] = [], u[a] = {}, d[a] = !1;
83
- }), s && (t[e.text] = [s]);
84
- }
85
- Q();
86
- const l = t[e.text] || [], o = r.get(e, "subs.length", 1);
87
- r.isEmpty(l) ? (u[e.text] = {}, d[e.text] = !1) : l.length === o ? (u[e.text] = w.getBackgroundColor(!0), d[e.text] = !0) : u[e.text] = {
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] = {
88
45
  backgroundColor: "#0F7535",
89
46
  color: "#fff",
90
47
  borderColor: "#0F7535"
91
- }, y.value = L(), U();
48
+ }, a.value = h(), y();
92
49
  }
93
- function ce() {
94
- if (v.value === 1) {
95
- let e;
96
- for (const l in t)
97
- if (t[l].length > 0) {
98
- e = t[l][0];
99
- break;
100
- }
101
- e && Object.keys(t).forEach((l) => {
102
- t[l] = t[l].filter((o) => o === e);
103
- });
104
- }
105
- Q(), y.value = L(), U();
50
+ function I() {
51
+ a.value = h(), y();
106
52
  }
107
- function U() {
108
- P("setNoNeedRefreshNumFilterName", D.value);
53
+ function y() {
54
+ N("setNoNeedRefreshNumFilterName", p.value);
109
55
  }
110
- function $() {
111
- y.value = !0, Object.keys(u).forEach((e) => {
112
- u[e] = {};
113
- }), Object.keys(t).forEach((e) => {
114
- delete t[e];
115
- }), Object.keys(d).forEach((e) => {
116
- delete d[e];
117
- }), Z();
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();
118
65
  }
119
- const re = (e) => w.getBackgroundColor(e);
120
- function ie(e) {
121
- e ? Object.assign(W, r.cloneDeep(t)) : r.isEqual(W, t) || Z();
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
+ }
122
75
  }
123
- function Z() {
124
- P("filterChange", [
76
+ function E() {
77
+ N("filterChange", [
125
78
  {
126
- filterKey: D.value,
127
- checkedValues: Object.values(t).flat()
79
+ filterKey: p.value,
80
+ checkedValues: Object.values(l).flat()
128
81
  }
129
82
  ]);
130
83
  }
131
- function de(e) {
132
- const l = f.value.find((o) => o.text === e);
133
- l != null && l.subs && (v.value === 1 ? t[e] = [l.subs[0].value] : t[e] = l.subs.map((o) => o.value));
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));
134
87
  }
135
- function fe(e) {
136
- t[e] = [];
88
+ function j(e) {
89
+ l[e] = [];
137
90
  }
138
- return I(
139
- () => O.value,
140
- (e) => {
141
- e && e.length > 0 && (f.value = [...e], $());
142
- },
143
- { deep: !0 }
144
- ), I(
145
- () => v.value,
146
- () => {
147
- $();
148
- }
149
- ), I(
150
- [() => A.value, () => Y.value, () => G.value],
151
- ([e, l, o]) => {
152
- (!H.value || !r.eq(H.value, D.value)) && (J.value = e, R.value = l, z.value = o);
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);
153
103
  }
154
- ), pe(() => {
155
- se();
156
- }), (e, l) => {
157
- const o = F("el-button"), s = F("el-checkbox"), a = F("el-checkbox-group"), C = F("el-dropdown");
158
- return i(), p("div", be, [
159
- K(o, {
160
- size: "small",
161
- class: "el-button el-button--small custom-total-button",
162
- style: M(re(y.value)),
163
- onClick: $
164
- }, {
165
- default: b(() => [
166
- N(g(h(m)("全部")) + " ", 1),
167
- h(A) ? (i(), p("span", ge, "(" + g(J.value) + ")", 1)) : T("", !0)
168
- ]),
169
- _: 1
170
- }, 8, ["style"]),
171
- K(C, {
172
- ref_key: "dropdown1",
173
- ref: ne,
174
- "popper-class": "custom-dropdown",
175
- onVisibleChange: ie
176
- }, {
177
- dropdown: b(() => [
178
- B("div", me, [
179
- (i(!0), p(E, null, q(f.value, (n) => (i(), V(a, {
180
- key: n.value,
181
- modelValue: t[n.text],
182
- "onUpdate:modelValue": (c) => t[n.text] = c,
183
- size: "small",
184
- class: "checkbox-group inner-checkbox-group custom-dropdown-checkbox-group",
185
- onChange: (c) => ue(n)
186
- }, {
187
- default: b(() => [
188
- h(r).isNil(n.subs) ? (i(), V(s, {
189
- key: 1,
190
- value: n.value,
191
- class: "checkbox custom-dropdown-button",
192
- border: "",
193
- disabled: _(n.value)
194
- }, {
195
- default: b(() => [
196
- N(g(h(m)(n.text)), 1)
197
- ]),
198
- _: 2
199
- }, 1032, ["value", "disabled"])) : (i(), p(E, { key: 0 }, [
200
- B("span", {
201
- class: "el-button custom-dropdown-button el-button--small inner-el-button",
202
- style: M(u[n.text]),
203
- onClick: (c) => X(n),
204
- disabled: _(n.value)
205
- }, g(h(m)(n.text)), 13, ye),
206
- B("div", _e, [
207
- (i(!0), p(E, null, q(n.subs, (c) => (i(), V(s, {
208
- key: c.value,
209
- class: "checkbox custom-dropdown-button",
210
- value: c.value,
211
- border: "",
212
- disabled: _(c.value)
213
- }, {
214
- default: b(() => {
215
- var S;
216
- return [
217
- N(g(h(m)(c.text)), 1),
218
- h(r).isEmpty(z.value) ? T("", !0) : (i(), p("span", Ce, "(" + g((S = z.value.filter((ve) => ve.value == c.value)[0]) == null ? void 0 : S.count) + ")", 1))
219
- ];
220
- }),
221
- _: 2
222
- }, 1032, ["value", "disabled"]))), 128))
223
- ])
224
- ], 64))
225
- ]),
226
- _: 2
227
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]))), 128))
228
- ])
229
- ]),
230
- default: b(() => [
231
- B("div", xe, [
232
- (i(!0), p(E, null, q(f.value, (n) => (i(), p(E, {
233
- key: n.value
234
- }, [
235
- n.isCheckbox ? (i(), V(a, {
236
- key: 0,
237
- modelValue: t[n.text],
238
- "onUpdate:modelValue": (c) => t[n.text] = c,
239
- class: "checkbox-group",
240
- size: "small",
241
- onChange: ce
242
- }, {
243
- default: b(() => [
244
- K(s, {
245
- class: "custom-dropdown-button",
246
- value: n.value,
247
- border: "",
248
- disabled: _(n.value)
249
- }, {
250
- default: b(() => [
251
- N(g(h(m)(n.text)), 1)
252
- ]),
253
- _: 2
254
- }, 1032, ["value", "disabled"])
255
- ]),
256
- _: 2
257
- }, 1032, ["modelValue", "onUpdate:modelValue"])) : (i(), V(o, {
258
- key: 1,
259
- style: M(u[n.text]),
260
- class: "custom-dropdown-button",
261
- size: "small",
262
- onClick: (c) => X(n),
263
- disabled: _(n.value)
264
- }, {
265
- default: b(() => {
266
- var c;
267
- return [
268
- N(g(h(m)(n.text)) + " ", 1),
269
- h(r).isEmpty(R.value) ? T("", !0) : (i(), p("span", ke, "(" + g((c = R.value.filter((S) => S.value == n.value)[0]) == null ? void 0 : c.count) + ")", 1))
270
- ];
271
- }),
272
- _: 2
273
- }, 1032, ["style", "onClick", "disabled"]))
274
- ], 64))), 128))
275
- ])
276
- ]),
277
- _: 1
278
- }, 512)
279
- ]);
280
- };
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;
281
125
  }
282
126
  });
283
127
  export {
284
- Se as default
128
+ de as default
285
129
  };
@@ -1,142 +1,14 @@
1
- import { defineComponent as f, ref as p, watch as V, createElementBlock as m, openBlock as w } from "vue";
2
- import { useEcharts as b } from "../packages/components/hooks/useEcharts.js";
3
- import { mapValue as l, numberToFixed as y } from "../utils/charts.js";
4
- const $ = /* @__PURE__ */ f({
5
- __name: "echart-gauge",
6
- props: {
7
- data: {
8
- type: Number,
9
- default: 0
10
- },
11
- rangeValue: {
12
- type: Object,
13
- default: () => ({ low: 0, high: 0, reverse: !1 })
14
- }
15
- },
16
- setup(u) {
17
- const i = p(null), g = b(i), e = u;
18
- let t = [], r = 0;
19
- const s = () => e.rangeValue.reverse ? [
20
- [r / 100, t[0]],
21
- [0.5, t[1]],
22
- [1, t[2]]
23
- ] : [
24
- [0.5, t[0]],
25
- [r / 100, t[1]],
26
- [1, t[2]]
27
- ], d = () => {
28
- let a = 0;
29
- if (e.rangeValue.reverse)
30
- if (e.data >= 0 && e.data < e.rangeValue.low)
31
- a = l(e.data, 0, e.rangeValue.low, 0, r);
32
- else if (e.data >= e.rangeValue.low && e.data < e.rangeValue.high)
33
- a = l(e.data, e.rangeValue.low, e.rangeValue.high, r, 50);
34
- else if (e.data >= e.rangeValue.high && e.data <= 100)
35
- a = l(e.data, e.rangeValue.high, 100, 50, 100);
36
- else
37
- throw new Error("Input value must be between 0 and 100");
38
- else if (e.data >= 0 && e.data < e.rangeValue.low)
39
- a = l(e.data, 0, e.rangeValue.low, 0, 50);
40
- else if (e.data >= e.rangeValue.low && e.data < e.rangeValue.high)
41
- a = l(
42
- e.data,
43
- e.rangeValue.low,
44
- e.rangeValue.high,
45
- 50,
46
- r
47
- );
48
- else if (e.data >= e.rangeValue.high && e.data <= 100)
49
- a = l(e.data, e.rangeValue.high, 100, r, 100);
50
- else
51
- throw new Error("Input value must be between 0 and 100");
52
- return y(a);
53
- }, o = (a) => `<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${a};"></span>`, h = () => {
54
- const a = {
55
- tooltip: {
56
- trigger: "item",
57
- formatter: () => {
58
- let n = "";
59
- return n += `${o(t[0])} 0~${e.rangeValue.low}%<br>`, n += `${o(t[1])} ${e.rangeValue.low}%~${e.rangeValue.high}%<br>`, n += `${o(t[2])} ${e.rangeValue.high}%~100%`, n;
60
- }
61
- },
62
- series: [
63
- {
64
- type: "gauge",
65
- radius: "100%",
66
- axisLine: {
67
- lineStyle: {
68
- width: 8,
69
- color: s()
70
- }
71
- },
72
- pointer: {
73
- width: 3,
74
- itemStyle: {
75
- color: "auto"
76
- }
77
- },
78
- axisTick: {
79
- show: !0,
80
- splitNumber: 2,
81
- distance: 3,
82
- lineStyle: {
83
- opacity: 0.4
84
- }
85
- },
86
- splitLine: {
87
- show: !1
88
- },
89
- axisLabel: {
90
- show: !1,
91
- color: "#666",
92
- distance: 0,
93
- fontSize: 10
94
- },
95
- // "{value}%"
96
- detail: {
97
- fontSize: 16,
98
- valueAnimation: !0,
99
- formatter: () => `${e.data}%`,
100
- color: "inherit",
101
- offsetCenter: [0, 44]
102
- },
103
- data: [
104
- {
105
- value: d()
106
- }
107
- ]
108
- }
109
- ]
110
- };
111
- g.setOption(a);
112
- }, c = () => {
113
- e.rangeValue.reverse ? (t = ["#008b48", "#fadd1d", "#ffaa01"], r = l(
114
- e.rangeValue.low,
115
- 0,
116
- e.rangeValue.high,
117
- 0,
118
- 50
119
- )) : (t = ["#ffaa01", "#fadd1d", "#008b48"], r = l(
120
- e.rangeValue.high,
121
- e.rangeValue.low,
122
- 100,
123
- 50,
124
- 100
125
- ));
126
- };
127
- return V(
128
- () => e.data,
129
- (a) => {
130
- c(), h();
131
- },
132
- { immediate: !0 }
133
- ), (a, n) => (w(), m("div", {
134
- ref_key: "gaugeChart",
135
- ref: i,
136
- class: "yahee-echart-gauge"
137
- }, null, 512));
138
- }
139
- });
1
+ import e from "./echart-gauge.vue2.js";
2
+ import { createElementBlock as o, openBlock as t } from "vue";
3
+ import r from "../_virtual/_plugin-vue_export-helper.js";
4
+ const c = {
5
+ ref: "gaugeChart",
6
+ class: "yahee-echart-gauge"
7
+ };
8
+ function a(n, s, p, _, m, u) {
9
+ return t(), o("div", c, null, 512);
10
+ }
11
+ const h = /* @__PURE__ */ r(e, [["render", a], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/echart-gauge/echart-gauge.vue"]]);
140
12
  export {
141
- $ as default
13
+ h as default
142
14
  };