yahee-components 0.0.43 → 0.0.44
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as $, ref as d, reactive as j, onMounted as G, createElementBlock as
|
|
1
|
+
import { defineComponent as $, ref as d, reactive as j, onMounted as G, createElementBlock as u, openBlock as f, createVNode as n, withDirectives as A, createElementVNode as i, unref as a, normalizeStyle as J, withCtx as x, createCommentVNode as w, Fragment as b, renderList as Q, normalizeClass as R, toDisplayString as m, vModelText as q, createTextVNode as W } from "vue";
|
|
2
2
|
import { CaretRight as X, CaretLeft as Z } from "@element-plus/icons-vue";
|
|
3
3
|
import { ElScrollbar as ee, ElIcon as B, ElButton as te, ElMessage as p } from "element-plus";
|
|
4
4
|
import "element-plus/theme-chalk/src/base.scss";
|
|
@@ -7,8 +7,8 @@ import "element-plus/theme-chalk/src/message.scss";
|
|
|
7
7
|
import "element-plus/theme-chalk/src/scrollbar.scss";
|
|
8
8
|
import "element-plus/theme-chalk/src/button.scss";
|
|
9
9
|
import { useUpload as se } from "../packages/components/hooks/useUpload.js";
|
|
10
|
-
import { useFile as
|
|
11
|
-
import
|
|
10
|
+
import { useFile as oe } from "../packages/components/hooks/useImg.js";
|
|
11
|
+
import ae from "./operation-log-form.vue.js";
|
|
12
12
|
import E from "./operation-log-content.vue.js";
|
|
13
13
|
import ne from "./operation-log-dialog.vue.js";
|
|
14
14
|
import O from "../_virtual/dayjs.min.js";
|
|
@@ -28,13 +28,14 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
28
28
|
__name: "operation-log",
|
|
29
29
|
props: {
|
|
30
30
|
businessKey: { default: "" },
|
|
31
|
-
businessName: { default: "" }
|
|
31
|
+
businessName: { default: "" },
|
|
32
|
+
topHeight: { default: 90 }
|
|
32
33
|
},
|
|
33
34
|
setup(U) {
|
|
34
|
-
const
|
|
35
|
+
const c = U, g = d(!1), L = d(!1), _ = d(!1), I = d({}), l = j({
|
|
35
36
|
List: [],
|
|
36
37
|
LoginId: 0
|
|
37
|
-
}), v = d(""), h = d([]),
|
|
38
|
+
}), v = d(""), h = d([]), o = {
|
|
38
39
|
PageIndex: -1,
|
|
39
40
|
StartOn: "",
|
|
40
41
|
EndOn: "",
|
|
@@ -47,46 +48,46 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
47
48
|
e.append(
|
|
48
49
|
"filter",
|
|
49
50
|
JSON.stringify({
|
|
50
|
-
BusinessKey:
|
|
51
|
-
BusinessName:
|
|
52
|
-
PageIndex:
|
|
53
|
-
StartOn:
|
|
54
|
-
EndOn:
|
|
55
|
-
UserIds:
|
|
56
|
-
Notes:
|
|
57
|
-
Mark:
|
|
51
|
+
BusinessKey: c.businessKey,
|
|
52
|
+
BusinessName: c.businessName,
|
|
53
|
+
PageIndex: o.PageIndex,
|
|
54
|
+
StartOn: o.StartOn,
|
|
55
|
+
EndOn: o.EndOn,
|
|
56
|
+
UserIds: o.UserIds,
|
|
57
|
+
Notes: o.Notes,
|
|
58
|
+
Mark: o.Mark
|
|
58
59
|
})
|
|
59
60
|
), re(e).then((t) => {
|
|
60
61
|
var s;
|
|
61
|
-
l.LoginId = t.LoginId,
|
|
62
|
+
l.LoginId = t.LoginId, o.PageIndex === 0 ? l.List = t.List || [] : l.List = [...l.List || [], ...t.List || []], ((s = t == null ? void 0 : t.List) == null ? void 0 : s.length) === 0 && (L.value = !0);
|
|
62
63
|
}).finally(() => {
|
|
63
64
|
g.value = !1;
|
|
64
65
|
});
|
|
65
66
|
}, N = () => {
|
|
66
|
-
g.value || (g.value = !0,
|
|
67
|
-
},
|
|
68
|
-
l.List = [],
|
|
69
|
-
},
|
|
67
|
+
g.value || (g.value = !0, o.PageIndex += 1, y());
|
|
68
|
+
}, H = (e) => {
|
|
69
|
+
l.List = [], o.PageIndex = 0, o.StartOn = e.timeValue ? e.timeValue[0] : "", o.EndOn = e.timeValue ? e.timeValue[1] : "", o.UserIds = e.CreatedBy ? [e.CreatedBy] : [], o.Notes = e.search, o.Mark = e.Mark, y();
|
|
70
|
+
}, P = () => {
|
|
70
71
|
h.value.length > 0 && C(h.value[0]).then(async () => {
|
|
71
|
-
p.success(r("上传文件成功!")),
|
|
72
|
+
p.success(r("上传文件成功!")), o.PageIndex = 0, h.value = [], await y(), V();
|
|
72
73
|
});
|
|
73
|
-
},
|
|
74
|
+
}, F = (e) => {
|
|
74
75
|
C(e).then(() => {
|
|
75
|
-
p.success(r("上传文件成功!")), _.value = !1,
|
|
76
|
+
p.success(r("上传文件成功!")), _.value = !1, o.PageIndex = 0, y();
|
|
76
77
|
});
|
|
77
78
|
}, C = (e) => {
|
|
78
79
|
const t = new FormData();
|
|
79
|
-
return t.append("BusinessKey",
|
|
80
|
-
},
|
|
80
|
+
return t.append("BusinessKey", c.businessKey), t.append("BusinessName", c.businessName), t.append("notes", e.fileUrl), t.append("ViewTitle", e.fileName), S(t);
|
|
81
|
+
}, T = () => {
|
|
81
82
|
if (!v.value) {
|
|
82
83
|
p.info(r("备注不能为空!"));
|
|
83
84
|
return;
|
|
84
85
|
}
|
|
85
86
|
const e = new FormData();
|
|
86
|
-
e.append("BusinessKey",
|
|
87
|
-
p.success(r("添加备注成功!")),
|
|
87
|
+
e.append("BusinessKey", c.businessKey), e.append("BusinessName", c.businessName), e.append("notes", v.value), e.append("ViewTitle", "备注"), S(e).then(async () => {
|
|
88
|
+
p.success(r("添加备注成功!")), o.PageIndex = 0, v.value = "", await y(), V();
|
|
88
89
|
});
|
|
89
|
-
},
|
|
90
|
+
}, Y = (e) => {
|
|
90
91
|
if (e.clipboardData || e.originalEvent) {
|
|
91
92
|
if (e.clipboardData.items.length === 0) {
|
|
92
93
|
p.error(r("复制文件到剪切板失败,请点击按钮上传!"));
|
|
@@ -100,7 +101,7 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
100
101
|
se("115", e.clipboardData.files[t]).then((K) => {
|
|
101
102
|
I.value = {
|
|
102
103
|
fileName: z || "",
|
|
103
|
-
fileUrl:
|
|
104
|
+
fileUrl: oe({ fileId: K[0] })
|
|
104
105
|
};
|
|
105
106
|
}).catch(() => {
|
|
106
107
|
});
|
|
@@ -113,27 +114,27 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
113
114
|
return G(() => {
|
|
114
115
|
var t;
|
|
115
116
|
const e = (t = document.getElementsByClassName("log-form")[0]) == null ? void 0 : t.clientHeight;
|
|
116
|
-
k.value = window.innerHeight - e - D.value.offsetHeight -
|
|
117
|
-
}), (e, t) => (
|
|
118
|
-
n(
|
|
117
|
+
k.value = window.innerHeight - e - D.value.offsetHeight - c.topHeight, N();
|
|
118
|
+
}), (e, t) => (f(), u("div", de, [
|
|
119
|
+
n(ae, {
|
|
119
120
|
ref: "logForm",
|
|
120
121
|
class: "text-right log-form",
|
|
121
122
|
"business-key": e.businessKey,
|
|
122
123
|
"business-name": e.businessName,
|
|
123
|
-
onFilterChange:
|
|
124
|
+
onFilterChange: H
|
|
124
125
|
}, null, 8, ["business-key", "business-name"]),
|
|
125
|
-
n(
|
|
126
|
+
n(a(ee), {
|
|
126
127
|
ref_key: "infiniteList",
|
|
127
128
|
ref: M,
|
|
128
129
|
class: "infinite-list-wrapper",
|
|
129
130
|
style: J({ height: k.value + "px" })
|
|
130
131
|
}, {
|
|
131
132
|
default: x(() => [
|
|
132
|
-
(
|
|
133
|
+
(f(!0), u(b, null, Q(l.List, (s) => (f(), u("div", {
|
|
133
134
|
key: s.Id,
|
|
134
135
|
class: R(l.LoginId == s.CreatedBy ? "list-item-right" : "list-item-left")
|
|
135
136
|
}, [
|
|
136
|
-
l.LoginId == s.CreatedBy ? (
|
|
137
|
+
l.LoginId == s.CreatedBy ? (f(), u(b, { key: 0 }, [
|
|
137
138
|
i("div", null, [
|
|
138
139
|
i("div", ce, [
|
|
139
140
|
i("div", ue, [
|
|
@@ -142,29 +143,29 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
142
143
|
info: s
|
|
143
144
|
}, null, 8, ["id", "info"])
|
|
144
145
|
]),
|
|
145
|
-
n(
|
|
146
|
+
n(a(B), {
|
|
146
147
|
color: "#f1f1f1",
|
|
147
148
|
size: "20"
|
|
148
149
|
}, {
|
|
149
150
|
default: x(() => [
|
|
150
|
-
n(
|
|
151
|
+
n(a(X))
|
|
151
152
|
]),
|
|
152
153
|
_: 1
|
|
153
154
|
})
|
|
154
155
|
]),
|
|
155
|
-
i("div", fe,
|
|
156
|
+
i("div", fe, m(a(O)(s.CreatedOnStr).format("YYYY-MM-DD HH: mm: ss")), 1)
|
|
156
157
|
]),
|
|
157
|
-
i("div", me,
|
|
158
|
-
], 64)) : (
|
|
159
|
-
i("div", pe,
|
|
158
|
+
i("div", me, m(s.CreatedName), 1)
|
|
159
|
+
], 64)) : (f(), u(b, { key: 1 }, [
|
|
160
|
+
i("div", pe, m(s.CreatedName), 1),
|
|
160
161
|
i("div", null, [
|
|
161
162
|
i("div", ge, [
|
|
162
|
-
n(
|
|
163
|
+
n(a(B), {
|
|
163
164
|
color: "#ccc",
|
|
164
165
|
size: "20"
|
|
165
166
|
}, {
|
|
166
167
|
default: x(() => [
|
|
167
|
-
n(
|
|
168
|
+
n(a(Z))
|
|
168
169
|
]),
|
|
169
170
|
_: 1
|
|
170
171
|
}),
|
|
@@ -175,16 +176,16 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
175
176
|
}, null, 8, ["id", "info"])
|
|
176
177
|
])
|
|
177
178
|
]),
|
|
178
|
-
i("div", he,
|
|
179
|
+
i("div", he, m(a(O)(s.CreatedOnStr).format("YYYY-MM-DD HH:mm:ss")), 1)
|
|
179
180
|
])
|
|
180
181
|
], 64))
|
|
181
182
|
], 2))), 128)),
|
|
182
|
-
n(
|
|
183
|
+
n(a(le), {
|
|
183
184
|
distance: 10,
|
|
184
185
|
onInfinite: N
|
|
185
186
|
}),
|
|
186
|
-
g.value ? (
|
|
187
|
-
L.value ? (
|
|
187
|
+
g.value ? (f(), u("div", ye, m(a(r)("加载中...")), 1)) : w("", !0),
|
|
188
|
+
L.value ? (f(), u("div", _e, m(a(r)("没有更多了!")), 1)) : w("", !0)
|
|
188
189
|
]),
|
|
189
190
|
_: 1
|
|
190
191
|
}, 8, ["style"]),
|
|
@@ -193,9 +194,9 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
193
194
|
ref: D,
|
|
194
195
|
"onUpdate:modelValue": t[0] || (t[0] = (s) => v.value = s),
|
|
195
196
|
class: "content-div",
|
|
196
|
-
placeholder:
|
|
197
|
+
placeholder: a(r)("可通过 Ctrl+V 直接上传图片/文件"),
|
|
197
198
|
contenteditable: "true",
|
|
198
|
-
onPaste:
|
|
199
|
+
onPaste: Y
|
|
199
200
|
}, null, 40, xe), [
|
|
200
201
|
[q, v.value]
|
|
201
202
|
]),
|
|
@@ -206,16 +207,16 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
206
207
|
"show-tips": !1,
|
|
207
208
|
"show-list": !1,
|
|
208
209
|
accept: ".gif,.jpg,.png,.doc,.docx,.pdf,.xls,.xlsx,.ppt,.txt",
|
|
209
|
-
onChange:
|
|
210
|
+
onChange: P
|
|
210
211
|
}, null, 8, ["modelValue"]),
|
|
211
|
-
n(
|
|
212
|
+
n(a(te), {
|
|
212
213
|
type: "success",
|
|
213
214
|
size: "small",
|
|
214
215
|
class: "marginL6",
|
|
215
|
-
onClick: t[2] || (t[2] = (s) =>
|
|
216
|
+
onClick: t[2] || (t[2] = (s) => T())
|
|
216
217
|
}, {
|
|
217
218
|
default: x(() => [
|
|
218
|
-
W(
|
|
219
|
+
W(m(a(r)("添加备注")), 1)
|
|
219
220
|
]),
|
|
220
221
|
_: 1
|
|
221
222
|
})
|
|
@@ -224,7 +225,7 @@ const de = { class: "yahee-operation-log" }, ce = { class: "d-flex jc-end" }, ue
|
|
|
224
225
|
modelValue: _.value,
|
|
225
226
|
"onUpdate:modelValue": t[3] || (t[3] = (s) => _.value = s),
|
|
226
227
|
"doc-info": I.value,
|
|
227
|
-
onConfirmUpload:
|
|
228
|
+
onConfirmUpload: F
|
|
228
229
|
}, null, 8, ["modelValue", "doc-info"])
|
|
229
230
|
]));
|
|
230
231
|
}
|
package/package.json
CHANGED
package/types/src/installs.d.ts
CHANGED
|
@@ -145,6 +145,7 @@ declare const _default: (( SFCWithInstall<DefineComponent<InputProps, {
|
|
|
145
145
|
})> & Record<string, any>) | ( SFCWithInstall<DefineComponent<OperationLogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< OperationLogProps> & Readonly<{}>, {
|
|
146
146
|
businessKey: string;
|
|
147
147
|
businessName: string;
|
|
148
|
+
topHeight: number;
|
|
148
149
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>> & Record<string, any>) | ( SFCWithInstall<{
|
|
149
150
|
new (...args: any[]): CreateComponentPublicInstanceWithMixins<Readonly< AnnexUploadProps> & Readonly<{
|
|
150
151
|
onChange?: (...args: any[]) => any;
|
|
@@ -4,6 +4,7 @@ import { OperationLogProps } from './operation-log';
|
|
|
4
4
|
export declare const YaheeOperationLog: SFCWithInstall<DefineComponent<OperationLogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< OperationLogProps> & Readonly<{}>, {
|
|
5
5
|
businessKey: string;
|
|
6
6
|
businessName: string;
|
|
7
|
+
topHeight: number;
|
|
7
8
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>> & Record<string, any>;
|
|
8
9
|
export default YaheeOperationLog;
|
|
9
10
|
export * from './operation-log.vue';
|
|
@@ -3,5 +3,6 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
|
|
|
3
3
|
declare const _default: DefineComponent<OperationLogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<OperationLogProps> & Readonly<{}>, {
|
|
4
4
|
businessKey: string;
|
|
5
5
|
businessName: string;
|
|
6
|
+
topHeight: number;
|
|
6
7
|
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
7
8
|
export default _default;
|