yahee-components 0.0.86 → 0.0.88
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/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 +369 -666
- package/es/common-import/common-import.vue2.js +337 -2
- package/es/common-import/index.js +3 -3
- 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/installs.js +10 -12
- 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/yahee-components.css +1 -1
- package/package.json +1 -1
- package/types/src/installs.d.ts +2649 -0
- package/es/filter-container/filter-container.vue.js +0 -67
- package/es/filter-container/filter-container.vue2.js +0 -4
- package/es/filter-container/index.js +0 -7
- package/es/filter-wrapper/filter-wrapper.vue.js +0 -7
- package/es/filter-wrapper/filter-wrapper.vue2.js +0 -59
- package/es/filter-wrapper/index.js +0 -7
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +0 -5
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +0 -10
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseTrim.js +0 -8
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +0 -4
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +0 -15
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +0 -7
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +0 -5
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_trimmedEndIndex.js +0 -9
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/debounce.js +0 -54
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +0 -7
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObjectLike.js +0 -6
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isSymbol.js +0 -9
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/now.js +0 -7
- package/es/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/toNumber.js +0 -22
|
@@ -1,4 +1,149 @@
|
|
|
1
|
-
import
|
|
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
|
+
});
|
|
2
147
|
export {
|
|
3
|
-
|
|
148
|
+
$ as default
|
|
4
149
|
};
|
package/es/echart-gauge/index.js
CHANGED
|
@@ -1,177 +1,116 @@
|
|
|
1
|
-
import
|
|
2
|
-
import w from "
|
|
3
|
-
import
|
|
4
|
-
|
|
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 = {
|
|
1
|
+
import f from "./image-upload.vue2.js";
|
|
2
|
+
import { createElementBlock as s, openBlock as t, Fragment as h, withDirectives as u, createVNode as o, 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" }, E = {
|
|
16
5
|
key: 0,
|
|
17
6
|
style: { width: "100%", height: "100%" }
|
|
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
|
-
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
|
|
7
|
+
}, p = ["src"];
|
|
8
|
+
function z(g, l, a, e, C, x) {
|
|
9
|
+
return t(), s(h, null, [
|
|
10
|
+
u((t(), s("div", k, [
|
|
11
|
+
o(e.ElUpload, {
|
|
12
|
+
class: "picture-uploader",
|
|
13
|
+
action: "#",
|
|
14
|
+
style: _({ width: a.imgSize.width * a.zoom + "px", height: a.imgSize.height * a.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 = a.modelValue) == null ? void 0 : d.fileId
|
|
26
|
+
}, () => {
|
|
27
|
+
var m, r;
|
|
28
|
+
return [
|
|
29
|
+
(m = a.modelValue) != null && m.fileId ? (t(), s("div", E, [
|
|
30
|
+
o(e.ElImage, {
|
|
31
|
+
class: "picture",
|
|
32
|
+
src: e.useImage((r = a.modelValue) == null ? void 0 : r.fileId)
|
|
130
33
|
}, {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
]),
|
|
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
|
+
])),
|
|
134
43
|
_: 1
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
44
|
+
}, 8, ["src"]),
|
|
45
|
+
n("span", {
|
|
46
|
+
class: "upload-actions",
|
|
47
|
+
onClick: c(e.handleFilePreview, ["stop"])
|
|
48
|
+
}, [
|
|
49
|
+
a.showDelete ? (t(), s("span", {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: "upload-delete",
|
|
52
|
+
onClick: c(e.handleFileRemove, ["stop"])
|
|
53
|
+
}, [
|
|
54
|
+
o(e.ElIcon, {
|
|
55
|
+
size: 20,
|
|
56
|
+
color: "#ff1e1e"
|
|
57
|
+
}, {
|
|
58
|
+
default: i(() => [
|
|
59
|
+
o(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
|
+
o(e.Plus)
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}))
|
|
75
|
+
];
|
|
76
|
+
})
|
|
77
|
+
];
|
|
78
|
+
}),
|
|
79
|
+
_: 3
|
|
80
|
+
}, 8, ["style"])
|
|
81
|
+
])), [
|
|
82
|
+
[e.vLoading, e.loading]
|
|
83
|
+
]),
|
|
84
|
+
o(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
|
+
o(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
|
+
o(e.CircleCloseFilled)
|
|
98
|
+
]),
|
|
99
|
+
_: 1
|
|
100
|
+
})
|
|
144
101
|
]),
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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
|
-
});
|
|
102
|
+
default: i(() => [
|
|
103
|
+
n("img", {
|
|
104
|
+
style: { width: "100%" },
|
|
105
|
+
src: e.dialogImageUrl,
|
|
106
|
+
alt: "Preview Image"
|
|
107
|
+
}, null, 8, p)
|
|
108
|
+
]),
|
|
109
|
+
_: 1
|
|
110
|
+
}, 8, ["modelValue"])
|
|
111
|
+
], 64);
|
|
112
|
+
}
|
|
113
|
+
const D = /* @__PURE__ */ I(f, [["render", z], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/image-upload/image-upload.vue"]]);
|
|
175
114
|
export {
|
|
176
|
-
|
|
115
|
+
D as default
|
|
177
116
|
};
|
|
@@ -1,4 +1,93 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as y, ref as o, onMounted as v, getCurrentInstance as E } from "vue";
|
|
2
|
+
import p from "../packages/components/hooks/useImg.js";
|
|
3
|
+
import { useIsImg as _, useUpload as b } from "../packages/components/hooks/useUpload.js";
|
|
4
|
+
import { vLoading as f, ElMessage as u, ElImage as q, ElIcon as C, ElDialog as U, ElUpload as w } 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 { CircleCloseFilled as x, Plus as F, Delete as V } from "@element-plus/icons-vue";
|
|
15
|
+
const Y = /* @__PURE__ */ y({
|
|
16
|
+
name: "YaheeImageUpload",
|
|
17
|
+
__name: "image-upload",
|
|
18
|
+
props: {
|
|
19
|
+
modelValue: { type: Object, required: !0, default: () => ({ index: 0, fileId: "", fileName: "" }) },
|
|
20
|
+
showDelete: { type: Boolean, required: !1, default: !0 },
|
|
21
|
+
zoom: { type: Number, required: !1, default: 1 },
|
|
22
|
+
imgSize: { type: Object, required: !1, default: () => ({ width: 80, height: 80 }) },
|
|
23
|
+
limitImgSize: { type: Boolean, required: !1, default: !0 },
|
|
24
|
+
limitFileSize: { type: Boolean, required: !1, default: !0 },
|
|
25
|
+
fileSize: { type: Number, required: !1, default: 50 },
|
|
26
|
+
fileSizeUnit: { type: String, required: !1, default: "kb" },
|
|
27
|
+
fileType: { type: String, required: !1, default: "105" }
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:modelValue", "change"],
|
|
30
|
+
setup(g, { expose: c, emit: I }) {
|
|
31
|
+
c();
|
|
32
|
+
const t = g, r = I, l = o(!1), z = (e) => {
|
|
33
|
+
if (!_(e.raw)) {
|
|
34
|
+
u.error("只能选择图片格式文件!");
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (t.limitFileSize) {
|
|
38
|
+
let i = e.size;
|
|
39
|
+
if (t.fileSizeUnit.toLowerCase() == "kb" ? i = e.size / 1024 : i = e.size / 1024 / 1024, !(i < t.fileSize)) {
|
|
40
|
+
u.error(`图片大小不能超过 ${t.fileSize}${t.fileSizeUnit}!`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
l.value = !0, b(t.fileType, e.raw).then((i) => {
|
|
45
|
+
const m = {
|
|
46
|
+
fileName: e.name,
|
|
47
|
+
fileId: i[0],
|
|
48
|
+
index: 0
|
|
49
|
+
};
|
|
50
|
+
r("update:modelValue", m), r("change", {
|
|
51
|
+
fileName: e.name,
|
|
52
|
+
fileId: i[0],
|
|
53
|
+
index: 0
|
|
54
|
+
}), l.value = !1;
|
|
55
|
+
}).catch((i) => {
|
|
56
|
+
u.error("update image error", i), l.value = !1;
|
|
57
|
+
});
|
|
58
|
+
}, S = () => {
|
|
59
|
+
r("update:modelValue", "");
|
|
60
|
+
}, n = o(""), s = o(!1), h = () => {
|
|
61
|
+
var e;
|
|
62
|
+
n.value = p((e = t.modelValue) == null ? void 0 : e.fileId, !0), s.value = !0;
|
|
63
|
+
};
|
|
64
|
+
v(() => {
|
|
65
|
+
var a;
|
|
66
|
+
const e = (a = E()) == null ? void 0 : a.appContext.app;
|
|
67
|
+
e && e.directive("loading", f);
|
|
68
|
+
});
|
|
69
|
+
const d = { props: t, emits: r, loading: l, handleUploadChange: z, handleFileRemove: S, dialogImageUrl: n, dialogVisible: s, handleFilePreview: h, get useImage() {
|
|
70
|
+
return p;
|
|
71
|
+
}, get ElUpload() {
|
|
72
|
+
return w;
|
|
73
|
+
}, get ElDialog() {
|
|
74
|
+
return U;
|
|
75
|
+
}, get ElIcon() {
|
|
76
|
+
return C;
|
|
77
|
+
}, get ElImage() {
|
|
78
|
+
return q;
|
|
79
|
+
}, get vLoading() {
|
|
80
|
+
return f;
|
|
81
|
+
}, get Delete() {
|
|
82
|
+
return V;
|
|
83
|
+
}, get Plus() {
|
|
84
|
+
return F;
|
|
85
|
+
}, get CircleCloseFilled() {
|
|
86
|
+
return x;
|
|
87
|
+
} };
|
|
88
|
+
return Object.defineProperty(d, "__isScriptSetup", { enumerable: !1, value: !0 }), d;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
2
91
|
export {
|
|
3
|
-
|
|
92
|
+
Y as default
|
|
4
93
|
};
|
package/es/image-upload/index.js
CHANGED
package/es/input/index.js
CHANGED
package/es/input/input.vue.js
CHANGED
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
p("update:modelValue", e);
|
|
18
|
-
}
|
|
19
|
-
}), l = f();
|
|
20
|
-
function s() {
|
|
21
|
-
var e;
|
|
22
|
-
(e = l.value) == null || e.focus();
|
|
23
|
-
}
|
|
24
|
-
return n({
|
|
25
|
-
focus: s
|
|
26
|
-
}), (e, a) => (V(), c("div", x, [
|
|
27
|
-
_(b(v), {
|
|
28
|
-
ref_key: "inputRef",
|
|
29
|
-
ref: l,
|
|
30
|
-
modelValue: o.value,
|
|
31
|
-
"onUpdate:modelValue": a[0] || (a[0] = (m) => o.value = m),
|
|
32
|
-
type: "text",
|
|
33
|
-
disabled: t.disabled
|
|
34
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
35
|
-
]));
|
|
36
|
-
}
|
|
37
|
-
});
|
|
1
|
+
import n from "./input.vue2.js";
|
|
2
|
+
import { createElementBlock as r, openBlock as a, createVNode as p } from "vue";
|
|
3
|
+
import l from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const s = { class: "yahee-input" };
|
|
5
|
+
function d(i, o, c, e, m, f) {
|
|
6
|
+
return a(), r("div", s, [
|
|
7
|
+
p(e.ElInput, {
|
|
8
|
+
ref: "inputRef",
|
|
9
|
+
modelValue: e.state,
|
|
10
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => e.state = t),
|
|
11
|
+
type: "text",
|
|
12
|
+
disabled: e.props.disabled
|
|
13
|
+
}, null, 8, ["modelValue", "disabled"])
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
const x = /* @__PURE__ */ l(n, [["render", d], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/input/input.vue"]]);
|
|
38
17
|
export {
|
|
39
|
-
|
|
18
|
+
x as default
|
|
40
19
|
};
|
package/es/input/input.vue2.js
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as i, computed as m, ref as d } from "vue";
|
|
2
|
+
import { ElInput as f } from "element-plus";
|
|
3
|
+
import "element-plus/theme-chalk/src/base.scss";
|
|
4
|
+
import "element-plus/theme-chalk/src/input.scss";
|
|
5
|
+
const g = /* @__PURE__ */ i({
|
|
6
|
+
name: "YaheeInput",
|
|
7
|
+
__name: "input",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: { type: String, required: !0, default: "" },
|
|
10
|
+
disabled: { type: Boolean, required: !1, default: !1 }
|
|
11
|
+
},
|
|
12
|
+
emits: ["update:modelValue"],
|
|
13
|
+
setup(p, { expose: a, emit: s }) {
|
|
14
|
+
const t = s, u = p, l = m({
|
|
15
|
+
get: () => u.modelValue,
|
|
16
|
+
set: (e) => {
|
|
17
|
+
t("update:modelValue", e);
|
|
18
|
+
}
|
|
19
|
+
}), o = d();
|
|
20
|
+
function r() {
|
|
21
|
+
var e;
|
|
22
|
+
(e = o.value) == null || e.focus();
|
|
23
|
+
}
|
|
24
|
+
a({
|
|
25
|
+
focus: r
|
|
26
|
+
});
|
|
27
|
+
const n = { emit: t, props: u, state: l, inputRef: o, focus: r, get ElInput() {
|
|
28
|
+
return f;
|
|
29
|
+
} };
|
|
30
|
+
return Object.defineProperty(n, "__isScriptSetup", { enumerable: !1, value: !0 }), n;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
2
33
|
export {
|
|
3
|
-
|
|
34
|
+
g as default
|
|
4
35
|
};
|