yahee-components 0.0.30 → 0.0.32
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/_virtual/_plugin-vue_export-helper.js +9 -0
- package/es/annex-upload/annex-upload.vue.js +69 -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/complex-search/complex-search.vue.js +228 -282
- package/es/complex-search/complex-search.vue2.js +130 -2
- package/es/complex-search/index.js +5 -5
- package/es/copy/copy.vue.js +39 -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 +158 -204
- package/es/country-platform-shop-condition/country-platform-shop-condition.vue2.js +125 -2
- package/es/country-platform-shop-condition/style/index.css +3 -4
- package/es/drop-down-condition/drop-down-condition.vue.js +193 -211
- package/es/drop-down-condition/drop-down-condition.vue2.js +127 -2
- package/es/drop-down-condition/style/index.css +21 -12
- package/es/image-upload/image-upload.vue.js +76 -113
- 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 +5 -5
- package/es/left-condition/left-condition-sub.vue.js +55 -86
- package/es/left-condition/left-condition-sub.vue2.js +76 -2
- package/es/left-condition/left-condition.vue.js +91 -209
- package/es/left-condition/left-condition.vue2.js +152 -2
- package/es/left-condition-enum/index.js +3 -3
- package/es/left-condition-enum/left-condition-enum.vue.js +19 -77
- package/es/left-condition-enum/left-condition-enum.vue2.js +69 -2
- package/es/operation-log/operation-log-content.vue.js +78 -88
- package/es/operation-log/operation-log-content.vue2.js +35 -2
- package/es/operation-log/operation-log-dialog.vue.js +57 -68
- package/es/operation-log/operation-log-dialog.vue2.js +38 -2
- package/es/operation-log/operation-log-form.vue.js +132 -179
- package/es/operation-log/operation-log-form.vue2.js +100 -2
- package/es/operation-log/operation-log.vue.js +183 -221
- package/es/operation-log/operation-log.vue2.js +133 -2
- package/es/packages/components/api/log-server.js +4 -4
- package/es/packages/components/api/upload-server.js +5 -5
- package/es/packages/components/hooks/useImg.js +8 -8
- package/es/style.css +24 -16
- package/es/utils/translate.js +13 -13
- package/lib/country-platform-shop-condition/style/index.css +3 -4
- package/lib/drop-down-condition/style/index.css +21 -12
- package/lib/style.css +24 -16
- package/package.json +1 -1
- package/types/src/installs.d.ts +2 -1
- package/types/src/operation-log/index.d.ts +2 -1
- package/types/src/operation-log/operation-log-form.vue.d.ts +3 -3
- package/types/src/operation-log/operation-log.d.ts +2 -1
- package/types/src/operation-log/operation-log.vue.d.ts +2 -1
|
@@ -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 { ElButton as J, ElCheckbox as Q, ElCheckboxGroup as X, ElDropdown 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 J;
|
|
117
|
+
}, get ElCheckbox() {
|
|
118
|
+
return Q;
|
|
119
|
+
}, get ElCheckboxGroup() {
|
|
120
|
+
return X;
|
|
121
|
+
}, get ElDropdown() {
|
|
122
|
+
return Z;
|
|
123
|
+
} };
|
|
124
|
+
return Object.defineProperty(D, "__isScriptSetup", { enumerable: !1, value: !0 }), D;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
2
127
|
export {
|
|
3
|
-
|
|
128
|
+
de as default
|
|
4
129
|
};
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
|
-
.yahee-drop-down-condition {
|
|
3
|
-
/* 滚动槽 */
|
|
4
|
-
/* 滚动条滑块 */
|
|
5
|
-
}
|
|
6
2
|
.yahee-drop-down-condition .checkbox {
|
|
7
3
|
margin-top: 5px;
|
|
8
4
|
}
|
|
9
5
|
.yahee-drop-down-condition .custom-total-button {
|
|
10
|
-
margin-right:
|
|
6
|
+
margin-right: 5px;
|
|
11
7
|
padding: 1px 4px;
|
|
12
8
|
height: 22px;
|
|
13
9
|
}
|
|
@@ -15,35 +11,48 @@
|
|
|
15
11
|
display: flex;
|
|
16
12
|
flex-direction: column;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
|
|
15
|
+
.scrollable-container {
|
|
19
16
|
max-height: 700px;
|
|
20
17
|
overflow-y: auto;
|
|
21
18
|
display: flex;
|
|
22
19
|
flex-direction: column;
|
|
23
20
|
}
|
|
24
|
-
|
|
21
|
+
|
|
22
|
+
.scrollable-container::-webkit-scrollbar {
|
|
25
23
|
width: 5px;
|
|
26
24
|
}
|
|
27
|
-
|
|
25
|
+
|
|
26
|
+
/* 滚动槽 */
|
|
27
|
+
.scrollable-container::-webkit-scrollbar-track {
|
|
28
28
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
29
29
|
border-radius: 10px;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
|
|
32
|
+
/* 滚动条滑块 */
|
|
33
|
+
.scrollable-container::-webkit-scrollbar-thumb {
|
|
32
34
|
border-radius: 10px;
|
|
33
35
|
background: rgba(0, 0, 0, 0.1);
|
|
34
36
|
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);
|
|
35
37
|
}
|
|
36
38
|
|
|
39
|
+
.el-button + .el-button.custom-dropdown-button {
|
|
40
|
+
margin-left: 5px;
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
.custom-dropdown .checkbox {
|
|
38
44
|
margin-top: 5px;
|
|
39
45
|
}
|
|
40
|
-
.custom-dropdown .custom-button {
|
|
46
|
+
.custom-dropdown .custom-dropdown-button {
|
|
41
47
|
margin-right: 0;
|
|
42
48
|
padding: 1px 4px;
|
|
43
49
|
min-height: 22px;
|
|
44
50
|
height: 22px;
|
|
45
|
-
margin-left: 5px;
|
|
46
51
|
}
|
|
47
|
-
.custom-dropdown .custom-button.inner-el-button {
|
|
52
|
+
.custom-dropdown .custom-dropdown-button.inner-el-button {
|
|
48
53
|
margin-top: 5px;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.custom-dropdown-checkbox-group {
|
|
57
|
+
margin-right: 10px;
|
|
49
58
|
}
|
|
@@ -1,177 +1,140 @@
|
|
|
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 { openBlock as t, createElementBlock as s, Fragment as u, withDirectives as h, createVNode as o, normalizeStyle as E, withCtx as i, renderSlot as _, createElementVNode as n, createTextVNode as v, withModifiers as c, createCommentVNode as w, createBlock as V } from "vue";
|
|
3
|
+
import y from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const I = { class: "yahee-image-upload" }, k = {
|
|
16
5
|
key: 0,
|
|
17
6
|
style: { width: "100%", height: "100%" }
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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), {
|
|
7
|
+
}, C = ["src"];
|
|
8
|
+
function p(g, l, a, e, z, x) {
|
|
9
|
+
return t(), s(
|
|
10
|
+
u,
|
|
11
|
+
null,
|
|
12
|
+
[
|
|
13
|
+
h((t(), s("div", I, [
|
|
14
|
+
o(e.ElUpload, {
|
|
73
15
|
class: "picture-uploader",
|
|
74
16
|
action: "#",
|
|
75
|
-
style:
|
|
17
|
+
style: E({ width: a.imgSize.width * a.zoom + "px", height: a.imgSize.height * a.zoom + "px" }),
|
|
76
18
|
"show-file-list": !1,
|
|
77
19
|
multiple: !1,
|
|
78
20
|
"auto-upload": !1,
|
|
79
21
|
accept: "image/jpeg,image/jpg,image/gif,image/png",
|
|
80
|
-
"on-change":
|
|
22
|
+
"on-change": e.handleUploadChange
|
|
81
23
|
}, {
|
|
82
|
-
default:
|
|
83
|
-
var
|
|
24
|
+
default: i(() => {
|
|
25
|
+
var d;
|
|
84
26
|
return [
|
|
85
|
-
|
|
86
|
-
value: (
|
|
27
|
+
_(g.$slots, "default", {
|
|
28
|
+
value: (d = a.modelValue) == null ? void 0 : d.fileId
|
|
87
29
|
}, () => {
|
|
88
|
-
var
|
|
30
|
+
var m, r;
|
|
89
31
|
return [
|
|
90
|
-
(
|
|
91
|
-
|
|
32
|
+
(m = a.modelValue) != null && m.fileId ? (t(), s("div", k, [
|
|
33
|
+
o(e.ElImage, {
|
|
92
34
|
class: "picture",
|
|
93
|
-
src:
|
|
35
|
+
src: e.useImage((r = a.modelValue) == null ? void 0 : r.fileId)
|
|
94
36
|
}, {
|
|
95
|
-
error:
|
|
96
|
-
n(
|
|
37
|
+
error: i(() => l[2] || (l[2] = [
|
|
38
|
+
n(
|
|
39
|
+
"div",
|
|
40
|
+
{ style: { display: "none" } },
|
|
41
|
+
null,
|
|
42
|
+
-1
|
|
43
|
+
/* HOISTED */
|
|
44
|
+
)
|
|
97
45
|
])),
|
|
98
|
-
placeholder:
|
|
99
|
-
n(
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
46
|
+
placeholder: i(() => l[3] || (l[3] = [
|
|
47
|
+
n(
|
|
48
|
+
"div",
|
|
49
|
+
{ class: "image-slot" },
|
|
50
|
+
[
|
|
51
|
+
v("Loading"),
|
|
52
|
+
n("span", { class: "dot" }, "...")
|
|
53
|
+
],
|
|
54
|
+
-1
|
|
55
|
+
/* HOISTED */
|
|
56
|
+
)
|
|
103
57
|
])),
|
|
104
58
|
_: 1
|
|
59
|
+
/* STABLE */
|
|
105
60
|
}, 8, ["src"]),
|
|
106
61
|
n("span", {
|
|
107
62
|
class: "upload-actions",
|
|
108
|
-
onClick:
|
|
63
|
+
onClick: c(e.handleFilePreview, ["stop"])
|
|
109
64
|
}, [
|
|
110
|
-
|
|
65
|
+
a.showDelete ? (t(), s("span", {
|
|
111
66
|
key: 0,
|
|
112
67
|
class: "upload-delete",
|
|
113
|
-
onClick:
|
|
68
|
+
onClick: c(e.handleFileRemove, ["stop"])
|
|
114
69
|
}, [
|
|
115
|
-
|
|
70
|
+
o(e.ElIcon, {
|
|
116
71
|
size: 20,
|
|
117
72
|
color: "#ff1e1e"
|
|
118
73
|
}, {
|
|
119
|
-
default:
|
|
120
|
-
|
|
74
|
+
default: i(() => [
|
|
75
|
+
o(e.Delete)
|
|
121
76
|
]),
|
|
122
77
|
_: 1
|
|
78
|
+
/* STABLE */
|
|
123
79
|
})
|
|
124
|
-
])) :
|
|
80
|
+
])) : w("v-if", !0)
|
|
125
81
|
])
|
|
126
|
-
])) : (
|
|
82
|
+
])) : (t(), V(e.ElIcon, {
|
|
127
83
|
key: 1,
|
|
128
84
|
class: "picture-uploader-icon",
|
|
129
85
|
size: 20
|
|
130
86
|
}, {
|
|
131
|
-
default:
|
|
132
|
-
|
|
87
|
+
default: i(() => [
|
|
88
|
+
o(e.Plus)
|
|
133
89
|
]),
|
|
134
90
|
_: 1
|
|
91
|
+
/* STABLE */
|
|
135
92
|
}))
|
|
136
93
|
];
|
|
137
94
|
})
|
|
138
95
|
];
|
|
139
96
|
}),
|
|
140
97
|
_: 3
|
|
98
|
+
/* FORWARDED */
|
|
141
99
|
}, 8, ["style"])
|
|
142
100
|
])), [
|
|
143
|
-
[
|
|
101
|
+
[e.vLoading, e.loading]
|
|
144
102
|
]),
|
|
145
|
-
|
|
146
|
-
modelValue:
|
|
147
|
-
"onUpdate:modelValue":
|
|
103
|
+
o(e.ElDialog, {
|
|
104
|
+
modelValue: e.dialogVisible,
|
|
105
|
+
"onUpdate:modelValue": l[1] || (l[1] = (d) => e.dialogVisible = d),
|
|
148
106
|
"show-close": !1
|
|
149
107
|
}, {
|
|
150
|
-
header:
|
|
151
|
-
|
|
108
|
+
header: i(() => [
|
|
109
|
+
o(e.ElIcon, {
|
|
152
110
|
size: 40,
|
|
153
111
|
color: "#a4a4a4",
|
|
154
112
|
class: "pull-right marginB6",
|
|
155
|
-
onClick:
|
|
113
|
+
onClick: l[0] || (l[0] = (d) => e.dialogVisible = !1)
|
|
156
114
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
|
|
115
|
+
default: i(() => [
|
|
116
|
+
o(e.CircleCloseFilled)
|
|
159
117
|
]),
|
|
160
118
|
_: 1
|
|
119
|
+
/* STABLE */
|
|
161
120
|
})
|
|
162
121
|
]),
|
|
163
|
-
default:
|
|
122
|
+
default: i(() => [
|
|
164
123
|
n("img", {
|
|
165
124
|
style: { width: "100%" },
|
|
166
|
-
src:
|
|
125
|
+
src: e.dialogImageUrl,
|
|
167
126
|
alt: "Preview Image"
|
|
168
|
-
}, null, 8,
|
|
127
|
+
}, null, 8, C)
|
|
169
128
|
]),
|
|
170
129
|
_: 1
|
|
130
|
+
/* STABLE */
|
|
171
131
|
}, 8, ["modelValue"])
|
|
172
|
-
],
|
|
173
|
-
|
|
174
|
-
|
|
132
|
+
],
|
|
133
|
+
64
|
|
134
|
+
/* STABLE_FRAGMENT */
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
const b = /* @__PURE__ */ y(f, [["render", p], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/image-upload/image-upload.vue"]]);
|
|
175
138
|
export {
|
|
176
|
-
|
|
139
|
+
b as default
|
|
177
140
|
};
|
|
@@ -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, ElUpload as q, ElDialog as C, ElIcon as U, ElImage as w, ElMessage as u } 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 x, Plus as F, CircleCloseFilled 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 q;
|
|
73
|
+
}, get ElDialog() {
|
|
74
|
+
return C;
|
|
75
|
+
}, get ElIcon() {
|
|
76
|
+
return U;
|
|
77
|
+
}, get ElImage() {
|
|
78
|
+
return w;
|
|
79
|
+
}, get vLoading() {
|
|
80
|
+
return f;
|
|
81
|
+
}, get Delete() {
|
|
82
|
+
return x;
|
|
83
|
+
}, get Plus() {
|
|
84
|
+
return F;
|
|
85
|
+
}, get CircleCloseFilled() {
|
|
86
|
+
return V;
|
|
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) => (c(), V("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 { openBlock as r, createElementBlock 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(u, o, i, e, c, m) {
|
|
6
|
+
return r(), a("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 b = /* @__PURE__ */ l(n, [["render", d], ["__file", "E:/工作/项目代码/common_componentsweb/packages/components/src/input/input.vue"]]);
|
|
38
17
|
export {
|
|
39
|
-
|
|
18
|
+
b 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
|
};
|