yahee-components 0.0.83 → 0.0.85

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 (89) hide show
  1. package/es/annex-upload/annex-upload.vue.js +154 -51
  2. package/es/annex-upload/annex-upload.vue2.js +2 -119
  3. package/es/annex-upload/index.js +3 -3
  4. package/es/border-wrap/border-wrap.vue.js +95 -64
  5. package/es/border-wrap/border-wrap.vue2.js +2 -46
  6. package/es/common-import/common-import.vue.js +665 -369
  7. package/es/common-import/common-import.vue2.js +2 -334
  8. package/es/common-import/index.js +3 -3
  9. package/es/complex-search/complex-search.vue.js +15 -15
  10. package/es/copy/copy.vue.js +55 -37
  11. package/es/copy/copy.vue2.js +2 -34
  12. package/es/copy/index.js +3 -3
  13. package/es/country-platform-shop-condition/country-platform-shop-condition.vue.js +213 -114
  14. package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +2 -125
  15. package/es/drop-down-condition/drop-down-condition.vue.js +213 -113
  16. package/es/drop-down-condition/drop-down-condition.vue2.js +2 -127
  17. package/es/echart-gauge/echart-gauge.vue.js +140 -12
  18. package/es/echart-gauge/echart-gauge.vue2.js +2 -147
  19. package/es/echart-gauge/index.js +3 -3
  20. package/es/filter-container/filter-container.vue.js +67 -0
  21. package/es/filter-container/filter-container.vue2.js +4 -0
  22. package/es/filter-container/index.js +7 -0
  23. package/es/filter-container/style/index.css +17 -0
  24. package/es/filter-wrapper/filter-wrapper.vue.js +7 -0
  25. package/es/filter-wrapper/filter-wrapper.vue2.js +59 -0
  26. package/es/filter-wrapper/index.js +7 -0
  27. package/es/filter-wrapper/style/index.css +3 -0
  28. package/es/image-upload/image-upload.vue.js +170 -109
  29. package/es/image-upload/image-upload.vue2.js +2 -91
  30. package/es/image-upload/index.js +3 -3
  31. package/es/input/index.js +3 -3
  32. package/es/input/input.vue.js +38 -17
  33. package/es/input/input.vue2.js +2 -33
  34. package/es/installs.js +12 -8
  35. package/es/left-condition/index.js +3 -3
  36. package/es/left-condition/left-condition-sub.vue.js +91 -32
  37. package/es/left-condition/left-condition-sub.vue2.js +2 -76
  38. package/es/left-condition/left-condition.vue.js +218 -70
  39. package/es/left-condition/left-condition.vue2.js +2 -160
  40. package/es/left-condition-enum/index.js +3 -3
  41. package/es/left-condition-enum/left-condition-enum.vue.js +49 -20
  42. package/es/left-condition-enum/left-condition-enum.vue2.js +2 -40
  43. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -0
  44. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +10 -0
  45. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +8 -0
  46. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -0
  47. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +15 -0
  48. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +7 -0
  49. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +5 -0
  50. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +9 -0
  51. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +54 -0
  52. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +7 -0
  53. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +6 -0
  54. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +9 -0
  55. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +7 -0
  56. package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +22 -0
  57. package/es/operation-log/operation-log-content.vue.js +92 -71
  58. package/es/operation-log/operation-log-content.vue2.js +2 -39
  59. package/es/operation-log/operation-log-dialog.vue.js +68 -46
  60. package/es/operation-log/operation-log-dialog.vue2.js +2 -38
  61. package/es/operation-log/operation-log-form.vue.js +183 -108
  62. package/es/operation-log/operation-log-form.vue2.js +2 -104
  63. package/es/operation-log/operation-log.vue.js +228 -119
  64. package/es/operation-log/operation-log.vue2.js +2 -135
  65. package/es/packages/components/api/log-server.js +6 -6
  66. package/es/packages/components/api/upload-server.js +1 -1
  67. package/es/packages/components/hooks/useEcharts.js +19 -19
  68. package/es/packages/components/hooks/useImg.js +8 -8
  69. package/es/scale-screen/index.js +4 -4
  70. package/es/scale-screen/scale-screen.vue.js +126 -19
  71. package/es/scale-screen/scale-screen.vue2.js +2 -125
  72. package/es/style.css +22 -0
  73. package/es/utils/translate.js +27 -47
  74. package/es/yahee-components.css +1 -1
  75. package/lib/filter-container/style/index.css +17 -0
  76. package/lib/filter-wrapper/style/index.css +3 -0
  77. package/lib/style.css +22 -0
  78. package/package.json +46 -46
  79. package/readme.md +249 -249
  80. package/types/src/filter-container/filter-container.d.ts +5 -0
  81. package/types/src/filter-container/filter-container.vue.d.ts +49 -0
  82. package/types/src/filter-container/props.d.ts +45 -0
  83. package/types/src/filter-wrapper/filter-wrapper.d.ts +5 -0
  84. package/types/src/filter-wrapper/filter-wrapper.vue.d.ts +49 -0
  85. package/types/src/filter-wrapper/props.d.ts +45 -0
  86. package/types/src/utils/translate.d.ts +0 -3
  87. package/es/api/server.js +0 -35
  88. package/es/api/tool.js +0 -71
  89. package/types/src/installs.d.ts +0 -2649
@@ -1,149 +1,4 @@
1
- import { defineComponent as c, ref as m, watch 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__ */ c({
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(f, { expose: V }) {
17
- V();
18
- const u = m(null), i = b(u), e = f;
19
- let t = [], r = 0;
20
- const s = () => e.rangeValue.reverse ? [
21
- [r / 100, t[0]],
22
- [0.5, t[1]],
23
- [1, t[2]]
24
- ] : [
25
- [0.5, t[0]],
26
- [r / 100, t[1]],
27
- [1, t[2]]
28
- ], g = () => {
29
- let a = 0;
30
- if (e.rangeValue.reverse)
31
- if (e.data >= 0 && e.data < e.rangeValue.low)
32
- a = l(e.data, 0, e.rangeValue.low, 0, r);
33
- else if (e.data >= e.rangeValue.low && e.data < e.rangeValue.high)
34
- a = l(e.data, e.rangeValue.low, e.rangeValue.high, r, 50);
35
- else if (e.data >= e.rangeValue.high && e.data <= 100)
36
- a = l(e.data, e.rangeValue.high, 100, 50, 100);
37
- else
38
- throw new Error("Input value must be between 0 and 100");
39
- else if (e.data >= 0 && e.data < e.rangeValue.low)
40
- a = l(e.data, 0, e.rangeValue.low, 0, 50);
41
- else if (e.data >= e.rangeValue.low && e.data < e.rangeValue.high)
42
- a = l(
43
- e.data,
44
- e.rangeValue.low,
45
- e.rangeValue.high,
46
- 50,
47
- r
48
- );
49
- else if (e.data >= e.rangeValue.high && e.data <= 100)
50
- a = l(e.data, e.rangeValue.high, 100, r, 100);
51
- else
52
- throw new Error("Input value must be between 0 and 100");
53
- return y(a);
54
- }, o = (a) => `<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:${a};"></span>`, d = () => {
55
- const a = {
56
- tooltip: {
57
- trigger: "item",
58
- formatter: () => {
59
- let n = "";
60
- 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;
61
- }
62
- },
63
- series: [
64
- {
65
- type: "gauge",
66
- radius: "100%",
67
- axisLine: {
68
- lineStyle: {
69
- width: 8,
70
- color: s()
71
- }
72
- },
73
- pointer: {
74
- width: 3,
75
- itemStyle: {
76
- color: "auto"
77
- }
78
- },
79
- axisTick: {
80
- show: !0,
81
- splitNumber: 2,
82
- distance: 3,
83
- lineStyle: {
84
- opacity: 0.4
85
- }
86
- },
87
- splitLine: {
88
- show: !1
89
- },
90
- axisLabel: {
91
- show: !1,
92
- color: "#666",
93
- distance: 0,
94
- fontSize: 10
95
- },
96
- // "{value}%"
97
- detail: {
98
- fontSize: 16,
99
- valueAnimation: !0,
100
- formatter: () => `${e.data}%`,
101
- color: "inherit",
102
- offsetCenter: [0, 44]
103
- },
104
- data: [
105
- {
106
- value: g()
107
- }
108
- ]
109
- }
110
- ]
111
- };
112
- i.setOption(a);
113
- }, h = () => {
114
- e.rangeValue.reverse ? (t = ["#008b48", "#fadd1d", "#ffaa01"], r = l(
115
- e.rangeValue.low,
116
- 0,
117
- e.rangeValue.high,
118
- 0,
119
- 50
120
- )) : (t = ["#ffaa01", "#fadd1d", "#008b48"], r = l(
121
- e.rangeValue.high,
122
- e.rangeValue.low,
123
- 100,
124
- 50,
125
- 100
126
- ));
127
- };
128
- w(
129
- () => e.data,
130
- (a) => {
131
- h(), d();
132
- },
133
- { immediate: !0 }
134
- );
135
- const p = { gaugeChart: u, myChart: i, props: e, get color() {
136
- return t;
137
- }, set color(a) {
138
- t = a;
139
- }, get mappedValue() {
140
- return r;
141
- }, set mappedValue(a) {
142
- r = a;
143
- }, getColorRange: s, getMappedValue: g, getMarker: o, drawChart: d, getRangeData: h };
144
- return Object.defineProperty(p, "__isScriptSetup", { enumerable: !1, value: !0 }), p;
145
- }
146
- });
1
+ import f from "./echart-gauge.vue.js";
147
2
  export {
148
- $ as default
3
+ f as default
149
4
  };
@@ -1,7 +1,7 @@
1
1
  import { withInstall as t } from "../utils/install.js";
2
2
  import a from "./echart-gauge.vue.js";
3
- const o = t(a);
3
+ const e = t(a);
4
4
  export {
5
- o as YaheeEchartGauge,
6
- o as default
5
+ e as YaheeEchartGauge,
6
+ e as default
7
7
  };
@@ -0,0 +1,67 @@
1
+ import { defineComponent as K, ref as v, computed as p, useSlots as S, provide as M, onMounted as V, onUnmounted as j, createElementBlock as i, openBlock as u, createCommentVNode as g, renderSlot as y } from "vue";
2
+ import I from "../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js";
3
+ const x = { class: "yahee-filter-container" }, N = {
4
+ key: 0,
5
+ class: "filter-section"
6
+ }, O = {
7
+ key: 1,
8
+ class: "search-section"
9
+ }, G = /* @__PURE__ */ K({
10
+ __name: "filter-container",
11
+ props: {
12
+ debounceInterval: { default: 300 },
13
+ immediate: { type: Boolean, default: !1 },
14
+ initialSearchItem: { default: () => ({}) },
15
+ showSearchSection: { type: Boolean, default: !1 }
16
+ },
17
+ emits: ["change", "search"],
18
+ setup(C, { expose: _, emit: b }) {
19
+ const A = Symbol("filterContainer"), r = C, c = b, t = v({ ...r.initialSearchItem }), s = v(/* @__PURE__ */ new Map()), k = p(() => s.value.size > 0 || !!S().filters), w = p(() => r.showSearchSection || Array.from(s.value.values()).some((e) => e.type === "search") || !!S().search), h = I((e) => {
20
+ c("change", e);
21
+ }, r.debounceInterval), m = I((e) => {
22
+ c("search", e);
23
+ }, r.debounceInterval), E = (e, o, n = "filter") => {
24
+ console.log(`注册组件: ${e}, 类型: ${n}`), s.value.set(e, { methods: o, type: n });
25
+ }, $ = (e) => {
26
+ console.log(`注销组件: ${e}`), s.value.delete(e);
27
+ }, d = (e) => {
28
+ const o = Array.isArray(e) ? e : [e], n = { ...t.value };
29
+ o.forEach((z) => {
30
+ const { filterKey: l, checkedValues: a } = z;
31
+ a.length === 0 || a[0] === "" || a[0] === null || a[0] === void 0 ? delete n[l] : a.length === 1 ? n[l] = a[0] : n[l] = a;
32
+ }), t.value = n, h({ ...n });
33
+ }, B = (e) => {
34
+ const o = { ...t.value, ...e };
35
+ t.value = o, m({ ...o });
36
+ }, F = () => {
37
+ t.value = { ...r.initialSearchItem }, s.value.forEach((e) => {
38
+ e.methods.reset && e.methods.reset();
39
+ }), c("change", { ...t.value });
40
+ }, f = () => ({ ...t.value });
41
+ return M(A, {
42
+ registerComponent: E,
43
+ unregisterComponent: $,
44
+ updateSearchItem: d,
45
+ handleSearch: B,
46
+ getCurrentSearchItem: f
47
+ }), _({
48
+ resetAllFilters: F,
49
+ getCurrentSearchItem: f,
50
+ updateSearchItem: d
51
+ }), V(() => {
52
+ console.log("FilterContainer 已挂载,注册组件数量:", s.value.size), r.immediate && Object.keys(t.value).length > 0 && c("change", { ...t.value });
53
+ }), j(() => {
54
+ h.cancel(), m.cancel();
55
+ }), (e, o) => (u(), i("div", x, [
56
+ k.value ? (u(), i("div", N, [
57
+ y(e.$slots, "filters")
58
+ ])) : g("", !0),
59
+ w.value ? (u(), i("div", O, [
60
+ y(e.$slots, "search")
61
+ ])) : g("", !0)
62
+ ]));
63
+ }
64
+ });
65
+ export {
66
+ G as default
67
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./filter-container.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as t } from "../utils/install.js";
2
+ import o from "./filter-container.vue.js";
3
+ const e = t(o);
4
+ export {
5
+ e as YaheeFilterContainer,
6
+ e as default
7
+ };
@@ -0,0 +1,17 @@
1
+ .yahee-filter-container {
2
+ display: flex;
3
+ width: 100%;
4
+ }
5
+ .yahee-filter-container .filter-section {
6
+ min-width: 200px;
7
+ }
8
+ .yahee-filter-container .search-section {
9
+ min-height: 60px;
10
+ position: fixed;
11
+ right: -50px;
12
+ }
13
+ .yahee-filter-container .content-section {
14
+ flex: 1;
15
+ padding: 16px;
16
+ overflow: auto;
17
+ }
@@ -0,0 +1,7 @@
1
+ import r from "./filter-wrapper.vue2.js";
2
+ /* empty css */
3
+ import o from "../_virtual/_plugin-vue_export-helper.js";
4
+ const e = /* @__PURE__ */ o(r, [["__scopeId", "data-v-841c990f"]]);
5
+ export {
6
+ e as default
7
+ };
@@ -0,0 +1,59 @@
1
+ import { defineComponent as f, inject as m, onMounted as d, onUnmounted as h, createElementBlock as y, openBlock as S, renderSlot as g } from "vue";
2
+ const I = { class: "filter-wrapper yahee-filter-wrapper" }, K = /* @__PURE__ */ f({
3
+ name: "YaheeFilterWrapper",
4
+ __name: "filter-wrapper",
5
+ props: {
6
+ id: {},
7
+ filterKey: {},
8
+ type: { default: "filter" },
9
+ reset: {},
10
+ immediate: { type: Boolean, default: !1 }
11
+ },
12
+ setup(p, { expose: l }) {
13
+ const u = Symbol("filterContainer"), r = p, e = m(u), n = (t = {}) => {
14
+ e && e.registerComponent(
15
+ r.id,
16
+ {
17
+ reset: r.reset || t.reset,
18
+ ...t
19
+ },
20
+ r.type
21
+ );
22
+ }, a = (t) => {
23
+ if (!e) return;
24
+ const c = Array.isArray(t) ? t : [t];
25
+ e.updateSearchItem({
26
+ filterKey: r.filterKey,
27
+ checkedValues: c
28
+ });
29
+ }, s = () => e != null && e.getCurrentSearchItem ? e.getCurrentSearchItem() : {}, o = (t) => {
30
+ e != null && e.handleSearch && e.handleSearch(t);
31
+ }, i = () => {
32
+ r.reset && r.reset();
33
+ };
34
+ return l({
35
+ register: n,
36
+ updateFilter: a,
37
+ getCurrentSearchItem: s,
38
+ handleSearch: o,
39
+ reset: i
40
+ }), d(() => {
41
+ if (n({ reset: i }), r.immediate && (e != null && e.getCurrentSearchItem)) {
42
+ const t = e.getCurrentSearchItem();
43
+ t[r.filterKey] && a(t[r.filterKey]);
44
+ }
45
+ }), h(() => {
46
+ e && e.unregisterComponent(r.id);
47
+ }), (t, c) => (S(), y("div", I, [
48
+ g(t.$slots, "default", {
49
+ register: n,
50
+ update: a,
51
+ getCurrentSearchItem: s,
52
+ handleSearch: o
53
+ }, void 0, !0)
54
+ ]));
55
+ }
56
+ });
57
+ export {
58
+ K as default
59
+ };
@@ -0,0 +1,7 @@
1
+ import { withInstall as r } from "../utils/install.js";
2
+ import t from "./filter-wrapper.vue.js";
3
+ const a = r(t);
4
+ export {
5
+ a as YaheeFilterWrapper,
6
+ a as default
7
+ };
@@ -0,0 +1,3 @@
1
+ .yahee-filter-wrapper {
2
+ font-size: 20px;
3
+ }
@@ -1,116 +1,177 @@
1
- import f from "./image-upload.vue2.js";
2
- import { createElementBlock as s, openBlock as t, Fragment as h, withDirectives as u, createVNode as a, normalizeStyle as _, withCtx as i, renderSlot as w, createBlock as V, createElementVNode as n, createTextVNode as v, withModifiers as c, createCommentVNode as y } from "vue";
3
- import I from "../_virtual/_plugin-vue_export-helper.js";
4
- const k = { class: "yahee-image-upload" }, p = {
1
+ import { defineComponent as U, ref as g, onMounted as B, getCurrentInstance as N, createElementBlock as p, openBlock as d, Fragment as F, withDirectives as D, createVNode as a, unref as t, normalizeStyle as L, withCtx as o, renderSlot as M, createBlock as $, createElementVNode as n, createTextVNode as b, withModifiers as I, createCommentVNode as P } from "vue";
2
+ import w from "../packages/components/hooks/useImg.js";
3
+ import { useIsImg as T, useUpload as j } from "../packages/components/hooks/useUpload.js";
4
+ import { vLoading as S, ElUpload as A, ElImage as G, ElIcon as c, ElDialog as x, ElMessage as h } from "element-plus";
5
+ import "element-plus/theme-chalk/src/base.scss";
6
+ import "element-plus/theme-chalk/src/upload.scss";
7
+ import "element-plus/theme-chalk/src/progress.scss";
8
+ import "element-plus/theme-chalk/src/dialog.scss";
9
+ import "element-plus/theme-chalk/src/overlay.scss";
10
+ import "element-plus/theme-chalk/src/image.scss";
11
+ import "element-plus/theme-chalk/src/image-viewer.scss";
12
+ import "element-plus/theme-chalk/src/badge.scss";
13
+ import "element-plus/theme-chalk/src/message.scss";
14
+ import { Delete as R, Plus as Y, CircleCloseFilled as _ } from "@element-plus/icons-vue";
15
+ const q = { class: "yahee-image-upload" }, H = {
5
16
  key: 0,
6
17
  style: { width: "100%", height: "100%" }
7
- }, z = ["src"];
8
- function C(g, l, o, e, E, x) {
9
- return t(), s(h, null, [
10
- u((t(), s("div", k, [
11
- a(e.ElUpload, {
12
- class: "picture-uploader",
13
- action: "#",
14
- style: _({ width: o.imgSize.width * o.zoom + "px", height: o.imgSize.height * o.zoom + "px" }),
15
- "show-file-list": !1,
16
- multiple: !1,
17
- "auto-upload": !1,
18
- accept: "image/jpeg,image/jpg,image/gif,image/png",
19
- "on-change": e.handleUploadChange
20
- }, {
21
- default: i(() => {
22
- var d;
23
- return [
24
- w(g.$slots, "default", {
25
- value: (d = o.modelValue) == null ? void 0 : d.fileId
26
- }, () => {
27
- var m, r;
28
- return [
29
- (m = o.modelValue) != null && m.fileId ? (t(), s("div", p, [
30
- a(e.ElImage, {
31
- class: "picture",
32
- src: e.useImage((r = o.modelValue) == null ? void 0 : r.fileId)
18
+ }, J = ["src"], de = /* @__PURE__ */ U({
19
+ name: "YaheeImageUpload",
20
+ __name: "image-upload",
21
+ props: {
22
+ modelValue: { default: () => ({ index: 0, fileId: "", fileName: "" }) },
23
+ showDelete: { type: Boolean, default: !0 },
24
+ zoom: { default: 1 },
25
+ imgSize: { default: () => ({ width: 80, height: 80 }) },
26
+ limitImgSize: { type: Boolean, default: !0 },
27
+ limitFileSize: { type: Boolean, default: !0 },
28
+ fileSize: { default: 50 },
29
+ fileSizeUnit: { default: "kb" },
30
+ fileType: { default: "105" }
31
+ },
32
+ emits: ["update:modelValue", "change"],
33
+ setup(y, { emit: V }) {
34
+ const s = y, f = V, u = g(!1), C = (e) => {
35
+ if (!T(e.raw)) {
36
+ h.error("只能选择图片格式文件!");
37
+ return;
38
+ }
39
+ if (s.limitFileSize) {
40
+ let l = e.size;
41
+ if (s.fileSizeUnit.toLowerCase() == "kb" ? l = e.size / 1024 : l = e.size / 1024 / 1024, !(l < s.fileSize)) {
42
+ h.error(`图片大小不能超过 ${s.fileSize}${s.fileSizeUnit}!`);
43
+ return;
44
+ }
45
+ }
46
+ u.value = !0, j(s.fileType, e.raw).then((l) => {
47
+ const r = {
48
+ fileName: e.name,
49
+ fileId: l[0],
50
+ index: 0
51
+ };
52
+ f("update:modelValue", r), f("change", {
53
+ fileName: e.name,
54
+ fileId: l[0],
55
+ index: 0
56
+ }), u.value = !1;
57
+ }).catch((l) => {
58
+ h.error("update image error", l), u.value = !1;
59
+ });
60
+ }, k = () => {
61
+ f("update:modelValue", "");
62
+ }, z = g(""), m = g(!1), E = () => {
63
+ var e;
64
+ z.value = w((e = s.modelValue) == null ? void 0 : e.fileId, !0), m.value = !0;
65
+ };
66
+ return B(() => {
67
+ var i;
68
+ const e = (i = N()) == null ? void 0 : i.appContext.app;
69
+ e && e.directive("loading", S);
70
+ }), (e, i) => (d(), p(F, null, [
71
+ D((d(), p("div", q, [
72
+ a(t(A), {
73
+ class: "picture-uploader",
74
+ action: "#",
75
+ style: L({ width: e.imgSize.width * e.zoom + "px", height: e.imgSize.height * e.zoom + "px" }),
76
+ "show-file-list": !1,
77
+ multiple: !1,
78
+ "auto-upload": !1,
79
+ accept: "image/jpeg,image/jpg,image/gif,image/png",
80
+ "on-change": C
81
+ }, {
82
+ default: o(() => {
83
+ var l;
84
+ return [
85
+ M(e.$slots, "default", {
86
+ value: (l = e.modelValue) == null ? void 0 : l.fileId
87
+ }, () => {
88
+ var r, v;
89
+ return [
90
+ (r = e.modelValue) != null && r.fileId ? (d(), p("div", H, [
91
+ a(t(G), {
92
+ class: "picture",
93
+ src: t(w)((v = e.modelValue) == null ? void 0 : v.fileId)
94
+ }, {
95
+ error: o(() => i[2] || (i[2] = [
96
+ n("div", { style: { display: "none" } }, null, -1)
97
+ ])),
98
+ placeholder: o(() => i[3] || (i[3] = [
99
+ n("div", { class: "image-slot" }, [
100
+ b("Loading"),
101
+ n("span", { class: "dot" }, "...")
102
+ ], -1)
103
+ ])),
104
+ _: 1
105
+ }, 8, ["src"]),
106
+ n("span", {
107
+ class: "upload-actions",
108
+ onClick: I(E, ["stop"])
109
+ }, [
110
+ e.showDelete ? (d(), p("span", {
111
+ key: 0,
112
+ class: "upload-delete",
113
+ onClick: I(k, ["stop"])
114
+ }, [
115
+ a(t(c), {
116
+ size: 20,
117
+ color: "#ff1e1e"
118
+ }, {
119
+ default: o(() => [
120
+ a(t(R))
121
+ ]),
122
+ _: 1
123
+ })
124
+ ])) : P("", !0)
125
+ ])
126
+ ])) : (d(), $(t(c), {
127
+ key: 1,
128
+ class: "picture-uploader-icon",
129
+ size: 20
33
130
  }, {
34
- error: i(() => l[2] || (l[2] = [
35
- n("div", { style: { display: "none" } }, null, -1)
36
- ])),
37
- placeholder: i(() => l[3] || (l[3] = [
38
- n("div", { class: "image-slot" }, [
39
- v("Loading"),
40
- n("span", { class: "dot" }, "...")
41
- ], -1)
42
- ])),
131
+ default: o(() => [
132
+ a(t(Y))
133
+ ]),
43
134
  _: 1
44
- }, 8, ["src"]),
45
- n("span", {
46
- class: "upload-actions",
47
- onClick: c(e.handleFilePreview, ["stop"])
48
- }, [
49
- o.showDelete ? (t(), s("span", {
50
- key: 0,
51
- class: "upload-delete",
52
- onClick: c(e.handleFileRemove, ["stop"])
53
- }, [
54
- a(e.ElIcon, {
55
- size: 20,
56
- color: "#ff1e1e"
57
- }, {
58
- default: i(() => [
59
- a(e.Delete)
60
- ]),
61
- _: 1
62
- })
63
- ])) : y("", !0)
64
- ])
65
- ])) : (t(), V(e.ElIcon, {
66
- key: 1,
67
- class: "picture-uploader-icon",
68
- size: 20
69
- }, {
70
- default: i(() => [
71
- a(e.Plus)
72
- ]),
73
- _: 1
74
- }))
75
- ];
76
- })
77
- ];
78
- }),
79
- _: 3
80
- }, 8, ["style"])
81
- ])), [
82
- [e.vLoading, e.loading]
83
- ]),
84
- a(e.ElDialog, {
85
- modelValue: e.dialogVisible,
86
- "onUpdate:modelValue": l[1] || (l[1] = (d) => e.dialogVisible = d),
87
- "show-close": !1
88
- }, {
89
- header: i(() => [
90
- a(e.ElIcon, {
91
- size: 40,
92
- color: "#a4a4a4",
93
- class: "pull-right marginB6",
94
- onClick: l[0] || (l[0] = (d) => e.dialogVisible = !1)
95
- }, {
96
- default: i(() => [
97
- a(e.CircleCloseFilled)
98
- ]),
99
- _: 1
100
- })
101
- ]),
102
- default: i(() => [
103
- n("img", {
104
- style: { width: "100%" },
105
- src: e.dialogImageUrl,
106
- alt: "Preview Image"
107
- }, null, 8, z)
135
+ }))
136
+ ];
137
+ })
138
+ ];
139
+ }),
140
+ _: 3
141
+ }, 8, ["style"])
142
+ ])), [
143
+ [t(S), u.value]
108
144
  ]),
109
- _: 1
110
- }, 8, ["modelValue"])
111
- ], 64);
112
- }
113
- const B = /* @__PURE__ */ I(f, [["render", C], ["__file", "D:/projects/frontend/common/common_componentsweb/packages/components/src/image-upload/image-upload.vue"]]);
145
+ a(t(x), {
146
+ modelValue: m.value,
147
+ "onUpdate:modelValue": i[1] || (i[1] = (l) => m.value = l),
148
+ "show-close": !1
149
+ }, {
150
+ header: o(() => [
151
+ a(t(c), {
152
+ size: 40,
153
+ color: "#a4a4a4",
154
+ class: "pull-right marginB6",
155
+ onClick: i[0] || (i[0] = (l) => m.value = !1)
156
+ }, {
157
+ default: o(() => [
158
+ a(t(_))
159
+ ]),
160
+ _: 1
161
+ })
162
+ ]),
163
+ default: o(() => [
164
+ n("img", {
165
+ style: { width: "100%" },
166
+ src: z.value,
167
+ alt: "Preview Image"
168
+ }, null, 8, J)
169
+ ]),
170
+ _: 1
171
+ }, 8, ["modelValue"])
172
+ ], 64));
173
+ }
174
+ });
114
175
  export {
115
- B as default
176
+ de as default
116
177
  };