super-page-runtime 2.3.43-sit2 → 2.3.44-sit1
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/dist/es/components/runtime/utils/events/standard-event.js +188 -187
- package/dist/es/components/runtime/utils/events/validator-util.js +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.d.ts +1 -1
- package/dist/es/components/runtime/views/assemblys/chart/table/chart-table-util.js +26 -17
- package/dist/es/components/runtime/views/assemblys/chart/table/table-runtime.vue2.js +74 -72
- package/dist/es/components/runtime/views/assemblys/data/table/sub-table-runtime.vue.js +167 -165
- package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js +63 -48
- package/dist/es/components/runtime/views/assemblys/form/image-upload/imageupload-runtime.vue2.js +11 -11
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue.js +1 -1
- package/dist/es/components/runtime/views/assemblys/form/rich-text/richtext-runtime.vue2.js +91 -72
- package/dist/es/components/runtime/views/super-page.vue.js +1 -1
- package/dist/es/components/runtime/views/super-page.vue2.js +130 -138
- package/dist/es/style.css +130 -130
- package/package.json +2 -2
package/dist/es/components/runtime/views/assemblys/form/file-upload/fileupload-runtime.vue2.js
CHANGED
|
@@ -1,91 +1,106 @@
|
|
|
1
|
-
import { defineComponent as e, ref as
|
|
1
|
+
import { defineComponent as e, ref as t, watch as l, onMounted as o, nextTick as a, onUnmounted as i, resolveComponent as n, createBlock as u, createCommentVNode as r, openBlock as p, normalizeStyle as s, normalizeClass as f, unref as d, createSlots as m, withCtx as c, createElementVNode as v, toDisplayString as g } from "vue";
|
|
2
2
|
import { getVariableValue as h, setVariableValue as y } from "../../../../utils/page-helper-util.js";
|
|
3
3
|
import { handleAfterInitEvent as C, fileUploadBeforeUpload as w, fileUploadBeforeDelete as b, fileUploadUploaded as x, fileUploadDeleted as k } from "../../../../utils/events/event-util.js";
|
|
4
4
|
import I from "agilebuilder-ui/src/utils/request";
|
|
5
5
|
import { FsUploadNew as P } from "agilebuilder-ui";
|
|
6
|
-
import
|
|
7
|
-
import { $t as
|
|
8
|
-
import { addRequiredClassUtil as
|
|
9
|
-
import { getRelativeBaseUrl as
|
|
6
|
+
import N from "../../../../utils/eventBus.js";
|
|
7
|
+
import { $t as S } from "../../../../utils/i18n-util.js";
|
|
8
|
+
import { addRequiredClassUtil as j } from "../../../../utils/common-util.js";
|
|
9
|
+
import { getRelativeBaseUrl as D } from "agilebuilder-ui/src/utils/common-util";
|
|
10
|
+
import { getDefaultValue as T } from "../../../../utils/page-init-util.js";
|
|
10
11
|
const _ = e({ __name: "fileupload-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: _2 }) {
|
|
11
12
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
12
|
-
const z = e2, R =
|
|
13
|
-
let G =
|
|
14
|
-
G.value.isShowWatermark = void 0 === ((_b = (_a = z.configure.props) == null ? void 0 : _a.watermark) == null ? void 0 : _b.isShowWatermark) ? "true" : ((_c = z.configure.props) == null ? void 0 : _c.watermark.isShowWatermark) + "", G.value.content = ((_e = (_d = z.configure.props) == null ? void 0 : _d.watermark) == null ? void 0 : _e.content) ? (_g = (_f = z.configure.props) == null ? void 0 : _f.watermark) == null ? void 0 : _g.content : "", U && U.length > 1 &&
|
|
15
|
-
|
|
13
|
+
const z = e2, R = t(null), F = z.configure.runtime ? z.configure.runtime : {}, O = t(F.props ? F.props : {}), q = F.style, W = F.class, V = F.headerStyle, $ = F.titleExceedStyle, A = z.pageContext.entity ? z.pageContext.entity : {}, E = z.configure.props.base ? z.configure.props.base : {}, U = Z(E.prop), B = Z(E.propName);
|
|
14
|
+
let G = t({});
|
|
15
|
+
G.value.isShowWatermark = void 0 === ((_b = (_a = z.configure.props) == null ? void 0 : _a.watermark) == null ? void 0 : _b.isShowWatermark) ? "true" : ((_c = z.configure.props) == null ? void 0 : _c.watermark.isShowWatermark) + "", G.value.content = ((_e = (_d = z.configure.props) == null ? void 0 : _d.watermark) == null ? void 0 : _e.content) ? (_g = (_f = z.configure.props) == null ? void 0 : _f.watermark) == null ? void 0 : _g.content : "", U && U.length > 1 && l(() => z.pageContext.entity[U[0]][U[1]], (e3) => {
|
|
16
|
+
Y(h(A, U));
|
|
16
17
|
});
|
|
17
|
-
const H = z.pageContext.code, J =
|
|
18
|
-
function
|
|
18
|
+
const H = z.pageContext.code, J = t(U ? H + "__" + U.join("__") : null), K = h(A, U), L = t(null), M = t(false), Q = t([]), X = t({});
|
|
19
|
+
function Y(e3) {
|
|
19
20
|
if (e3) {
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
const e4 =
|
|
23
|
-
I.post(e4,
|
|
21
|
+
const t2 = e3.split(",");
|
|
22
|
+
if (t2.length > 0) {
|
|
23
|
+
const e4 = D(window.$vueApp.config.globalProperties.baseAPI) + "/component/fs-upload/search-file-metadata";
|
|
24
|
+
I.post(e4, t2).then((e5) => {
|
|
24
25
|
Q.value = [];
|
|
25
|
-
const
|
|
26
|
+
const l2 = [], o2 = {};
|
|
26
27
|
e5.forEach((e6) => {
|
|
27
28
|
o2[e6.uuid] = e6;
|
|
28
29
|
});
|
|
29
|
-
for (let e6 = 0; e6 <
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
for (let e6 = 0; e6 < t2.length; e6++) {
|
|
31
|
+
const a2 = t2[e6];
|
|
32
|
+
l2.push(o2[a2].fileName), Q.value.push({ showName: o2[a2].fileName, serverPath: a2, fileSize: o2[a2].fileSize });
|
|
32
33
|
}
|
|
33
|
-
"input" === O.value.displayType && (
|
|
34
|
+
"input" === O.value.displayType && (X.value.showName = l2.join(","), X.value.serverPath = t2.join(","));
|
|
34
35
|
}).finally(() => {
|
|
35
36
|
M.value = true;
|
|
36
37
|
});
|
|
37
38
|
} else M.value = true;
|
|
38
|
-
} else Q.value = [],
|
|
39
|
+
} else Q.value = [], X.value = {}, M.value = true;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function Z(e3) {
|
|
41
42
|
return e3 ? (e3.startsWith("${") && (e3 = e3.substring(2, e3.length - 1)), e3.split(".")) : [];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function ee(e3) {
|
|
44
45
|
z.pageContext.fileuploadInfo || (z.pageContext.fileuploadInfo = []);
|
|
45
|
-
return -1 === z.pageContext.fileuploadInfo.findIndex((e4) => e4.uuid === z.configure.uuid) && z.pageContext.fileuploadInfo.push({ uuid: z.configure.uuid, label:
|
|
46
|
+
return -1 === z.pageContext.fileuploadInfo.findIndex((e4) => e4.uuid === z.configure.uuid) && z.pageContext.fileuploadInfo.push({ uuid: z.configure.uuid, label: S(O.value.title) }), e3.pageContext || (e3.pageContext = z.pageContext), e3.configure || (e3.configureObj = z.configure), w(e3);
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function te() {
|
|
48
49
|
if (z.pageContext.fileuploadInfo && z.configure.uuid) {
|
|
49
50
|
const e3 = z.pageContext.fileuploadInfo.findIndex((e4) => e4.uuid === z.configure.uuid);
|
|
50
51
|
-1 !== e3 && z.pageContext.fileuploadInfo.splice(e3, 1);
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
function le(e3) {
|
|
54
|
-
|
|
55
|
+
te();
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function oe(e3) {
|
|
57
58
|
return b(z.pageContext, z.configure, e3);
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
const
|
|
60
|
+
Y(K);
|
|
61
|
+
const ae = (e3, t2, l2) => {
|
|
61
62
|
var o2;
|
|
62
|
-
|
|
63
|
+
te(), ne(), o2 = { response: e3, uploadFile: t2, uploadFiles: l2 }, x(z.pageContext, z.configure, o2);
|
|
63
64
|
}, ie = (e3) => {
|
|
64
|
-
var
|
|
65
|
-
|
|
66
|
-
},
|
|
67
|
-
const e3 = [],
|
|
65
|
+
var t2;
|
|
66
|
+
ne(), t2 = { file: e3 }, k(z.pageContext, z.configure, t2);
|
|
67
|
+
}, ne = () => {
|
|
68
|
+
const e3 = [], t2 = [];
|
|
68
69
|
if (O.value.limit && Q.value.length > O.value.limit) {
|
|
69
70
|
const e4 = Q.value.length - O.value.limit;
|
|
70
|
-
for (let
|
|
71
|
+
for (let t3 = 0; t3 < e4; t3++) Q.value.shift();
|
|
71
72
|
}
|
|
72
|
-
for (let
|
|
73
|
-
y(z.pageContext.entity, U,
|
|
74
|
-
},
|
|
73
|
+
for (let l2 = 0; l2 < Q.value.length; l2++) e3.push(Q.value[l2].showName), t2.push(Q.value[l2].serverPath);
|
|
74
|
+
y(z.pageContext.entity, U, t2.join(",")), y(z.pageContext.entity, B, e3.join(",")), t2.length > 0 && (R.value = "");
|
|
75
|
+
}, ue = t(null), re = t(null);
|
|
75
76
|
return o(() => {
|
|
76
|
-
|
|
77
|
+
N.$on(J.value + "-pickFileDone", (e3) => {
|
|
77
78
|
L.value.pickFileDone(e3);
|
|
78
|
-
}),
|
|
79
|
-
const e3 =
|
|
80
|
-
|
|
79
|
+
}), a(() => {
|
|
80
|
+
const e3 = (e4, t3, l3) => {
|
|
81
|
+
if (!t3) return;
|
|
82
|
+
const o2 = [t3, ...l3 || []];
|
|
83
|
+
for (const t4 of o2) try {
|
|
84
|
+
const l4 = T(z.pageContext, t4, "", false);
|
|
85
|
+
if (null != l4 && "" !== l4) {
|
|
86
|
+
y(z.pageContext.entity, e4, l4);
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
} catch (e5) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
null == A.data.ID && null == A.data.id && (e3(U, E.propDefaultValue, E.morePropDefaultValue), e3(B, E.propNameDefaultValue, E.morePropNameDefaultValue));
|
|
94
|
+
const t2 = h(A, U), l2 = { showName: h(A, B), serverPath: t2 };
|
|
95
|
+
C(l2, z.pageContext, z.configure, { formItemRef: ue.value, componentRef: L.value, titleRef: re.value, value: l2, entity: z.pageContext.entity.data, pageData: z.pageContext.entity.page });
|
|
81
96
|
});
|
|
82
|
-
}),
|
|
83
|
-
|
|
97
|
+
}), i(() => {
|
|
98
|
+
N.$off(J.value + "-pickFileDone");
|
|
84
99
|
}), _2({ addRequiredClass: function() {
|
|
85
|
-
R.value =
|
|
86
|
-
} }), (e3,
|
|
87
|
-
const
|
|
88
|
-
return O.value.tittleShow ? (
|
|
100
|
+
R.value = j();
|
|
101
|
+
} }), (e3, t2) => {
|
|
102
|
+
const l2 = n("el-form-item");
|
|
103
|
+
return O.value.tittleShow ? (p(), u(l2, { key: 0, ref_key: "formItemRef", ref: ue, required: O.value.required, class: f(d(W) + (R.value ? " " + R.value : "")), "label-width": O.value.labelWidth, style: s(d(q)) }, m({ default: c(() => [M.value ? (p(), u(d(P), { key: 0, ref_key: "fileUploadRef", ref: L, style: { width: "100%" }, disabled: "disabled" === O.value.state, displayType: O.value.displayType, accept: O.value.accept, multiple: O.value.multiple, placeholder: O.value.placeholder, limit: O.value.limit, "limit-file-size": O.value.limitFileSize, "disabled-no-preview": O.value.disabledNoPreview, "disabled-no-download": O.value.disabledNoDownload, openCameraOrChoosePhoto: O.value.openCameraOrChoosePhoto, "sort-type": O.value.sortType, "file-info": X.value, "file-list": Q.value, "system-code": e3.pageContext.systemCode, componentId: J.value, watermark: d(G), "on-success": ae, "on-remove": ie, "before-upload": ee, "on-error": le, "before-remove": oe, pageContext: e3.pageContext, "file-show-type": O.value.fileShowType }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "disabled-no-preview", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : r("", true)]), _: 2 }, [O.value.tittleShow ? { name: "label", fn: c(() => [v("div", { ref_key: "titleRef", ref: re, style: s({ ...d(V), ...d($) }), class: "amb-form-item-label" }, g(d(S)(O.value.title)), 5)]), key: "0" } : void 0]), 1032, ["required", "class", "label-width", "style"])) : M.value ? (p(), u(d(P), { key: 1, ref_key: "fileUploadRef", ref: L, style: { width: "100%" }, disabled: "disabled" === O.value.state, displayType: O.value.displayType, accept: O.value.accept, multiple: O.value.multiple, placeholder: O.value.placeholder, limit: O.value.limit, "limit-file-size": O.value.limitFileSize, "disabled-no-preview": O.value.disabledNoPreview, "disabled-no-download": O.value.disabledNoDownload, openCameraOrChoosePhoto: O.value.openCameraOrChoosePhoto, "sort-type": O.value.sortType, "file-info": X.value, "file-list": Q.value, "system-code": e3.pageContext.systemCode, componentId: J.value, watermark: d(G), "on-success": ae, "on-remove": ie, "before-upload": ee, "on-error": le, "before-remove": oe, pageContext: e3.pageContext, "file-show-type": O.value.fileShowType }, null, 8, ["disabled", "displayType", "accept", "multiple", "placeholder", "limit", "limit-file-size", "disabled-no-preview", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : r("", true);
|
|
89
104
|
};
|
|
90
105
|
} });
|
|
91
106
|
export {
|
package/dist/es/components/runtime/views/assemblys/form/image-upload/imageupload-runtime.vue2.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, onMounted as l, nextTick as o, onUnmounted as a, resolveComponent as i, createBlock as n, createCommentVNode as u, openBlock as r, normalizeStyle as p, normalizeClass as s, unref as f, createSlots as d, withCtx as
|
|
2
|
-
import { getVariableValue as g, setVariableValue as
|
|
3
|
-
import { handleAfterInitEvent as
|
|
1
|
+
import { defineComponent as e, ref as t, onMounted as l, nextTick as o, onUnmounted as a, resolveComponent as i, createBlock as n, createCommentVNode as u, openBlock as r, normalizeStyle as p, normalizeClass as s, unref as f, createSlots as d, withCtx as m, createElementVNode as c, toDisplayString as v } from "vue";
|
|
2
|
+
import { getVariableValue as g, setVariableValue as y } from "../../../../utils/page-helper-util.js";
|
|
3
|
+
import { handleAfterInitEvent as h, fileUploadBeforeUpload as C, fileUploadBeforeDelete as x, fileUploadUploaded as w, fileUploadDeleted as b } from "../../../../utils/events/event-util.js";
|
|
4
4
|
import k from "agilebuilder-ui/src/utils/request";
|
|
5
5
|
import { FsImageUpload as I } from "agilebuilder-ui";
|
|
6
6
|
import j from "../../../../utils/eventBus.js";
|
|
@@ -9,7 +9,7 @@ import { addRequiredClassUtil as P } from "../../../../utils/common-util.js";
|
|
|
9
9
|
import { getRelativeBaseUrl as T } from "agilebuilder-ui/src/utils/common-util";
|
|
10
10
|
const _ = e({ __name: "imageupload-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: _2 }) {
|
|
11
11
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
12
|
-
const N = e2, O = t(null), z = N.configure.runtime ? N.configure.runtime : {},
|
|
12
|
+
const N = e2, O = t(null), z = N.configure.runtime ? N.configure.runtime : {}, D = t(z.props ? z.props : {}), R = z.style, F = z.class, q = z.headerStyle, W = z.titleExceedStyle, $ = N.pageContext.entity ? N.pageContext.entity : {}, A = N.configure.props.base ? N.configure.props.base : {}, E = V(A.prop), U = V(A.propName);
|
|
13
13
|
let B = t({});
|
|
14
14
|
B.value.isShowWatermark = void 0 === ((_b = (_a = N.configure.props) == null ? void 0 : _a.watermark) == null ? void 0 : _b.isShowWatermark) ? "true" : ((_c = N.configure.props) == null ? void 0 : _c.watermark.isShowWatermark) + "", B.value.content = ((_e = (_d = N.configure.props) == null ? void 0 : _d.watermark) == null ? void 0 : _e.content) ? (_g = (_f = N.configure.props) == null ? void 0 : _f.watermark) == null ? void 0 : _g.content : "";
|
|
15
15
|
const G = N.pageContext.code, H = t(E ? G + "__" + E.join("__") : null), J = g($, E), K = t(null), L = t(false), M = t([]), Q = t({});
|
|
@@ -18,7 +18,7 @@ const _ = e({ __name: "imageupload-runtime", props: { pageContext: {}, configure
|
|
|
18
18
|
}
|
|
19
19
|
function X(e3) {
|
|
20
20
|
N.pageContext.fileuploadInfo || (N.pageContext.fileuploadInfo = []);
|
|
21
|
-
return -1 === N.pageContext.fileuploadInfo.findIndex((e4) => e4.uuid === N.configure.uuid) && N.pageContext.fileuploadInfo.push({ uuid: N.configure.uuid, label: S(
|
|
21
|
+
return -1 === N.pageContext.fileuploadInfo.findIndex((e4) => e4.uuid === N.configure.uuid) && N.pageContext.fileuploadInfo.push({ uuid: N.configure.uuid, label: S(D.value.title) }), e3.pageContext || (e3.pageContext = N.pageContext), e3.configure || (e3.configureObj = N.configure), C(e3);
|
|
22
22
|
}
|
|
23
23
|
function Y() {
|
|
24
24
|
if (N.pageContext.fileuploadInfo && N.configure.uuid) {
|
|
@@ -47,7 +47,7 @@ const _ = e({ __name: "imageupload-runtime", props: { pageContext: {}, configure
|
|
|
47
47
|
const a2 = t2[e6];
|
|
48
48
|
l2.push(o2[a2].fileName), M.value.push({ showName: o2[a2].fileName, serverPath: a2, fileSize: o2[a2].fileSize });
|
|
49
49
|
}
|
|
50
|
-
"input" ===
|
|
50
|
+
"input" === D.value.displayType && (Q.value.showName = l2.join(","), Q.value.serverPath = t2.join(","));
|
|
51
51
|
}).finally(() => {
|
|
52
52
|
L.value = true;
|
|
53
53
|
});
|
|
@@ -62,19 +62,19 @@ const _ = e({ __name: "imageupload-runtime", props: { pageContext: {}, configure
|
|
|
62
62
|
oe(), t2 = { file: e3 }, b(N.pageContext, N.configure, t2);
|
|
63
63
|
}, oe = () => {
|
|
64
64
|
const e3 = [], t2 = [];
|
|
65
|
-
if (
|
|
66
|
-
const e4 = M.value.length -
|
|
65
|
+
if (D.value.limit && M.value.length > D.value.limit) {
|
|
66
|
+
const e4 = M.value.length - D.value.limit;
|
|
67
67
|
for (let t3 = 0; t3 < e4; t3++) M.value.shift();
|
|
68
68
|
}
|
|
69
69
|
for (let l2 = 0; l2 < M.value.length; l2++) e3.push(M.value[l2].showName), t2.push(M.value[l2].serverPath);
|
|
70
|
-
|
|
70
|
+
y(N.pageContext.entity, E, t2.join(",")), y(N.pageContext.entity, U, e3.join(",")), t2.length > 0 && (O.value = "");
|
|
71
71
|
}, ae = t(null), ie = t(null);
|
|
72
72
|
return l(() => {
|
|
73
73
|
j.$on(H.value + "-pickFileDone", (e3) => {
|
|
74
74
|
K.value.pickFileDone(e3);
|
|
75
75
|
}), o(() => {
|
|
76
76
|
const e3 = g($, E), t2 = { showName: g($, U), serverPath: e3 };
|
|
77
|
-
|
|
77
|
+
h(t2, N.pageContext, N.configure, { formItemRef: ae.value, componentRef: K.value, titleRef: ie.value, value: t2, entity: N.pageContext.entity.data, pageData: N.pageContext.entity.page });
|
|
78
78
|
});
|
|
79
79
|
}), a(() => {
|
|
80
80
|
j.$off(H.value + "-pickFileDone");
|
|
@@ -82,7 +82,7 @@ const _ = e({ __name: "imageupload-runtime", props: { pageContext: {}, configure
|
|
|
82
82
|
O.value = P();
|
|
83
83
|
} }), (e3, t2) => {
|
|
84
84
|
const l2 = i("el-form-item");
|
|
85
|
-
return
|
|
85
|
+
return D.value.tittleShow ? (r(), n(l2, { key: 0, ref_key: "formItemRef", ref: ae, required: D.value.required, class: s(f(F) + (O.value ? " " + O.value : "")), "label-width": D.value.labelWidth, style: p(f(R)) }, d({ default: m(() => [L.value ? (r(), n(f(I), { key: 0, ref_key: "fileUploadRef", ref: K, style: { width: "100%" }, accept: D.value.accept && Object.keys(D.value.accept).length > 0 ? D.value.accept : "image/*", disabled: "disabled" === D.value.state, displayType: D.value.displayType, multiple: D.value.multiple, placeholder: D.value.placeholder, limit: D.value.limit, "limit-file-size": D.value.limitFileSize, "max-display-count": D.value.maxDisplayCount, "disabled-no-download": D.value.disabledNoDownload, openCameraOrChoosePhoto: D.value.openCameraOrChoosePhoto, "sort-type": D.value.sortType, "file-info": Q.value, "file-list": M.value, "system-code": e3.pageContext.systemCode, componentId: H.value, watermark: f(B), "on-success": te, "on-remove": le, "before-upload": X, "before-remove": ee, "on-error": Z, pageContext: e3.pageContext, "file-show-type": D.value.fileShowType }, null, 8, ["accept", "disabled", "displayType", "multiple", "placeholder", "limit", "limit-file-size", "max-display-count", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : u("", true)]), _: 2 }, [D.value.tittleShow ? { name: "label", fn: m(() => [c("div", { ref_key: "titleRef", ref: ie, style: p({ ...f(q), ...f(W) }), class: "amb-form-item-label" }, v(f(S)(D.value.title)), 5)]), key: "0" } : void 0]), 1032, ["required", "class", "label-width", "style"])) : L.value ? (r(), n(f(I), { key: 1, ref_key: "fileUploadRef", ref: K, style: { width: "100%" }, accept: D.value.accept, disabled: "disabled" === D.value.state, displayType: D.value.displayType, multiple: D.value.multiple, placeholder: D.value.placeholder, limit: D.value.limit, "limit-file-size": D.value.limitFileSize, "max-display-count": D.value.maxDisplayCount, "disabled-no-download": D.value.disabledNoDownload, openCameraOrChoosePhoto: D.value.openCameraOrChoosePhoto, "sort-type": D.value.sortType, "file-info": Q.value, "file-list": M.value, "system-code": e3.pageContext.systemCode, componentId: H.value, watermark: f(B), "on-success": te, "on-remove": le, "before-upload": X, "before-remove": ee, "on-error": Z, pageContext: e3.pageContext, "file-show-type": D.value.fileShowType }, null, 8, ["accept", "disabled", "displayType", "multiple", "placeholder", "limit", "limit-file-size", "max-display-count", "disabled-no-download", "openCameraOrChoosePhoto", "sort-type", "file-info", "file-list", "system-code", "componentId", "watermark", "pageContext", "file-show-type"])) : u("", true);
|
|
86
86
|
};
|
|
87
87
|
} });
|
|
88
88
|
export {
|
|
@@ -2,7 +2,7 @@ import t from "./richtext-runtime.vue2.js";
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import e from "../../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const r = e(t, [["__scopeId", "data-v-
|
|
5
|
+
const r = e(t, [["__scopeId", "data-v-69991d69"]]);
|
|
6
6
|
export {
|
|
7
7
|
r as default
|
|
8
8
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as e, ref as t, watch as l, onMounted as n, nextTick as o, onBeforeUnmount as
|
|
1
|
+
import { defineComponent as e, ref as t, watch as l, onMounted as n, nextTick as o, onBeforeUnmount as r, resolveComponent as i, createElementBlock as a, openBlock as u, Fragment as s, createVNode as c, createBlock as d, createCommentVNode as f, normalizeStyle as p, normalizeClass as m, unref as g, createSlots as v, withCtx as h, createElementVNode as b, toDisplayString as y } from "vue";
|
|
2
2
|
import { getFormModelFields as x } from "../../../../utils/page-init-util.js";
|
|
3
|
-
import { getSizeConfig as k, formatVariableValue as
|
|
4
|
-
import { handleAfterInitEvent as
|
|
3
|
+
import { getSizeConfig as k, formatVariableValue as q, getVariableValue as w, setVariableValue as C } from "../../../../utils/page-helper-util.js";
|
|
4
|
+
import { handleAfterInitEvent as S, handleFormEvent as A } from "../../../../utils/events/event-util.js";
|
|
5
5
|
import E from "agilebuilder-ui/src/utils/request";
|
|
6
|
-
import { $t as
|
|
6
|
+
import { $t as T } from "../../../../utils/i18n-util.js";
|
|
7
7
|
import { getBaseUrl as L, addRequiredClassUtil as H } from "../../../../utils/common-util.js";
|
|
8
8
|
import M from "quill";
|
|
9
9
|
import "quill/dist/quill.snow.css";
|
|
10
10
|
import { ElMessage as N } from "element-plus";
|
|
11
|
-
const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext-statusbar" },
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
const P = e2,
|
|
11
|
+
const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext-statusbar" }, F = { class: "word-count" }, V = { key: 0, class: "upload-loading" }, W = ["innerHTML"], z = e({ __name: "richtext-runtime", props: { pageContext: {}, configure: {} }, setup(e2, { expose: z2 }) {
|
|
12
|
+
const B = ["12px", "14px", "16px", "18px", "20px", "24px", "28px", "32px", "36px", "48px"], D = M.import("attributors/style/size");
|
|
13
|
+
D.whitelist = B, M.register(D, true);
|
|
14
|
+
const U = [false, "Source Han Sans CN", "SimSun", "SimHei", "Microsoft YaHei", "KaiTi", "FangSong", "Arial", "Times New Roman", "Verdana", "Georgia", "Courier New"], $ = M.import("attributors/style/font");
|
|
15
|
+
$.whitelist = U, M.register($, true);
|
|
16
|
+
const P = e2, O = t(""), G = P.pageContext.entity ? P.pageContext.entity : {}, I = x(P.pageContext, P.configure), K = P.configure.runtime ? P.configure.runtime : {}, Y = K.style, J = K.class, Q = K.headerStyle, X = K.titleExceedStyle, Z = t(K.props ? K.props : {});
|
|
17
17
|
let ee = k(P.pageContext, P.configure);
|
|
18
18
|
ee && ee.fixHeight && (Y.height || (Y.height = ee.fixHeight + "px"));
|
|
19
19
|
let te = Z.value.value;
|
|
20
|
-
const le =
|
|
20
|
+
const le = q(P.pageContext, te), ne = t(null);
|
|
21
21
|
let oe = null;
|
|
22
|
-
const
|
|
22
|
+
const re = t(false), ie = t(0), ae = t(false), ue = t(false), se = t("");
|
|
23
23
|
let ce = null, de = Z.value.state;
|
|
24
|
-
function
|
|
24
|
+
function fe(e3) {
|
|
25
25
|
return "readonly" == e3 || "disabled" == e3;
|
|
26
26
|
}
|
|
27
|
-
const
|
|
28
|
-
function
|
|
27
|
+
const pe = fe(de), me = t({ modules: { toolbar: [["bold", "italic", "underline", "strike"], ["blockquote", "code-block"], [{ list: "ordered" }, { list: "bullet" }], [{ script: "sub" }, { script: "super" }], [{ indent: "-1" }, { indent: "+1" }], [{ direction: "rtl" }], [{ size: B }], [{ header: [1, 2, 3, 4, 5, 6, false] }], [{ color: [] }, { background: [] }], [{ font: U }], [{ align: [] }], ["clean"], ["link", "image"]] }, theme: "snow", placeholder: pe ? "" : Z.value.placeholder, readOnly: pe });
|
|
28
|
+
function ge() {
|
|
29
29
|
if (!(oe == null ? void 0 : oe.container)) return;
|
|
30
30
|
const e3 = oe.container.parentNode;
|
|
31
31
|
if (!e3) return;
|
|
@@ -37,80 +37,99 @@ const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext
|
|
|
37
37
|
const e3 = Z.value.state;
|
|
38
38
|
if (null != e3 && e3 !== de) {
|
|
39
39
|
de = e3;
|
|
40
|
-
const t2 =
|
|
40
|
+
const t2 = fe(de);
|
|
41
41
|
oe && (oe.enable(!t2), oe.root.dataset.placeholder = t2 ? "" : Z.value.placeholder);
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
const
|
|
44
|
+
const ve = t([]), he = t(false), be = t(null), ye = t(null), xe = t(null);
|
|
45
45
|
let ke = null;
|
|
46
|
-
function
|
|
46
|
+
function qe(e3) {
|
|
47
47
|
const t2 = e3.match(/serverPath=([^&"]+)/);
|
|
48
48
|
return t2 ? t2[1] : "";
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function we(e3) {
|
|
51
51
|
if (!oe) return;
|
|
52
52
|
const t2 = function(e4) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
if (!e4) return e4;
|
|
54
|
+
const t3 = new DOMParser().parseFromString(e4, "text/html"), l3 = P.pageContext.backendUrl, n2 = L(l3, P.pageContext.isTest);
|
|
55
|
+
t3.querySelectorAll("th").forEach((e5) => {
|
|
56
|
+
const l4 = t3.createElement("td");
|
|
57
|
+
for (const t4 of Array.from(e5.attributes)) l4.setAttribute(t4.name, t4.value);
|
|
58
|
+
l4.style.fontWeight = "bold", l4.innerHTML = e5.innerHTML, e5.replaceWith(l4);
|
|
59
|
+
}), t3.querySelectorAll("img[data-uuid]").forEach((e5) => {
|
|
60
|
+
const t4 = e5, l4 = t4.getAttribute("data-uuid");
|
|
61
|
+
l4 && t4.setAttribute("src", `${n2}/common/fs-upload/download?serverPath=${l4}&isShowWatermark=false`);
|
|
56
62
|
});
|
|
57
|
-
|
|
63
|
+
let o2 = t3.body.innerHTML;
|
|
64
|
+
return o2 = o2.replace(/\t/g, " "), o2 = o2.replace(/ {2}/g, " "), o2;
|
|
58
65
|
}(e3), l2 = oe.clipboard.convertHTML(t2);
|
|
59
66
|
oe.setContents(l2.ops), o(() => {
|
|
60
67
|
if (!oe) return;
|
|
61
68
|
oe.root.querySelectorAll("img").forEach((e4) => {
|
|
62
69
|
if (!e4.getAttribute("data-uuid")) {
|
|
63
|
-
const t3 =
|
|
64
|
-
e4.setAttribute("data-uuid", t3);
|
|
70
|
+
const t3 = qe(e4.src);
|
|
71
|
+
t3 && e4.setAttribute("data-uuid", t3);
|
|
65
72
|
}
|
|
73
|
+
}), oe && oe.root.querySelectorAll("table").forEach((e4) => {
|
|
74
|
+
const t3 = e4.querySelector("tr");
|
|
75
|
+
t3 && t3.querySelectorAll("td").forEach((e5) => {
|
|
76
|
+
e5.querySelector("strong, b") && (e5.style.backgroundColor = "#f5f7fa");
|
|
77
|
+
});
|
|
66
78
|
});
|
|
67
79
|
});
|
|
68
80
|
}
|
|
69
|
-
const
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
!
|
|
81
|
+
const Ce = { bold: "加粗", italic: "斜体", underline: "下划线", strike: "删除线", blockquote: "引用", "code-block": "代码块", 'list[value="ordered"]': "有序列表", 'list[value="bullet"]': "无序列表", 'script[value="sub"]': "下标", 'script[value="super"]': "上标", 'indent[value="-1"]': "减少缩进", 'indent[value="+1"]': "增加缩进", 'direction[value="rtl"]': "文字方向", size: "字体大小", header: "标题", color: "字体颜色", background: "背景颜色", font: "字体", align: "对齐方式", clean: "清除格式", link: "链接", image: "图片" };
|
|
82
|
+
function Se() {
|
|
83
|
+
re.value = !re.value, o(() => {
|
|
84
|
+
!re.value && (oe == null ? void 0 : oe.container) && (oe.container.style.height = ""), ge();
|
|
73
85
|
});
|
|
74
86
|
}
|
|
75
|
-
function
|
|
87
|
+
function Ae() {
|
|
76
88
|
oe && (se.value = oe.root.innerHTML, ue.value = true);
|
|
77
89
|
}
|
|
78
90
|
function Ee() {
|
|
79
|
-
if (!oe) return void (
|
|
91
|
+
if (!oe) return void (ie.value = 0);
|
|
80
92
|
const e3 = oe.getText().trim();
|
|
81
|
-
|
|
93
|
+
ie.value = e3.length;
|
|
82
94
|
}
|
|
83
|
-
function
|
|
95
|
+
function Te() {
|
|
96
|
+
if (!oe) return "";
|
|
97
|
+
const e3 = oe.root.cloneNode(true);
|
|
98
|
+
return e3.querySelectorAll("img[data-uuid]").forEach((e4) => {
|
|
99
|
+
e4.getAttribute("data-uuid") && e4.removeAttribute("src");
|
|
100
|
+
}), e3.innerHTML;
|
|
101
|
+
}
|
|
102
|
+
function Le() {
|
|
84
103
|
N.error({ message: "图片上传失败,请重试", duration: 3e3 });
|
|
85
104
|
}
|
|
86
|
-
function
|
|
87
|
-
"Escape" === e3.key &&
|
|
88
|
-
(oe == null ? void 0 : oe.container) && (oe.container.style.height = ""),
|
|
105
|
+
function He(e3) {
|
|
106
|
+
"Escape" === e3.key && re.value && (re.value = false, o(() => {
|
|
107
|
+
(oe == null ? void 0 : oe.container) && (oe.container.style.height = ""), ge();
|
|
89
108
|
}));
|
|
90
109
|
}
|
|
91
|
-
function
|
|
110
|
+
function Me(e3) {
|
|
92
111
|
var _a;
|
|
93
|
-
oe && (null !== e3.relatedTarget && ((_a = ne.value) == null ? void 0 : _a.contains(e3.relatedTarget)) ||
|
|
112
|
+
oe && (null !== e3.relatedTarget && ((_a = ne.value) == null ? void 0 : _a.contains(e3.relatedTarget)) || A(Te(), P.pageContext, P.configure, "change", { entity: G }));
|
|
94
113
|
}
|
|
95
|
-
function
|
|
114
|
+
function Ne(e3) {
|
|
96
115
|
if ("img" === e3.target.localName) {
|
|
97
|
-
|
|
116
|
+
ve.value = [];
|
|
98
117
|
let t2 = e3.target.src;
|
|
99
|
-
|
|
118
|
+
ve.value.push(t2), he.value = true;
|
|
100
119
|
}
|
|
101
120
|
}
|
|
102
|
-
function
|
|
121
|
+
function Re(e3) {
|
|
103
122
|
const t2 = new FormData();
|
|
104
123
|
t2.append("file", e3);
|
|
105
124
|
const l2 = P.pageContext.backendUrl, n2 = L(l2, P.pageContext.isTest);
|
|
106
125
|
return E.post(n2 + "/common/fs-upload/rich-editor-image", t2, { headers: { "Content-Type": "multipart/form-data" } });
|
|
107
126
|
}
|
|
108
|
-
function
|
|
109
|
-
const l2 = e3.split(","), n2 = l2[0].match(/:(.*?);/), o2 = n2 ? n2[1] : "image/png",
|
|
110
|
-
let
|
|
111
|
-
const
|
|
112
|
-
for (;
|
|
113
|
-
return new File([
|
|
127
|
+
function _e(e3, t2) {
|
|
128
|
+
const l2 = e3.split(","), n2 = l2[0].match(/:(.*?);/), o2 = n2 ? n2[1] : "image/png", r2 = atob(l2[1]);
|
|
129
|
+
let i2 = r2.length;
|
|
130
|
+
const a2 = new Uint8Array(i2);
|
|
131
|
+
for (; i2--; ) a2[i2] = r2.charCodeAt(i2);
|
|
132
|
+
return new File([a2], t2, { type: o2 });
|
|
114
133
|
}
|
|
115
134
|
return n(() => {
|
|
116
135
|
var _a;
|
|
@@ -122,15 +141,15 @@ const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext
|
|
|
122
141
|
const t2 = e4.className.match(/ql-([\w-]+)/);
|
|
123
142
|
if (t2) {
|
|
124
143
|
const l2 = t2[1], n2 = `${l2}[value="${e4.value}"]`;
|
|
125
|
-
|
|
144
|
+
Ce[n2] ? e4.setAttribute("data-tooltip", Ce[n2]) : Ce[l2] && e4.setAttribute("data-tooltip", Ce[l2]);
|
|
126
145
|
}
|
|
127
146
|
}), e3.querySelectorAll(".ql-picker").forEach((e4) => {
|
|
128
147
|
const t2 = e4.className.match(/ql-(\w+)/);
|
|
129
148
|
if (t2) {
|
|
130
149
|
const l2 = t2[1];
|
|
131
|
-
if (
|
|
150
|
+
if (Ce[l2]) {
|
|
132
151
|
const t3 = e4.querySelector(".ql-picker-label");
|
|
133
|
-
t3 && t3.setAttribute("data-tooltip",
|
|
152
|
+
t3 && t3.setAttribute("data-tooltip", Ce[l2]);
|
|
134
153
|
}
|
|
135
154
|
}
|
|
136
155
|
});
|
|
@@ -140,11 +159,11 @@ const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext
|
|
|
140
159
|
e3 && e3.addEventListener("mousedown", (e4) => {
|
|
141
160
|
e4.preventDefault();
|
|
142
161
|
});
|
|
143
|
-
}(),
|
|
162
|
+
}(), we(le), (_a = ne.value) == null ? void 0 : _a.addEventListener("focusout", Me), oe.on("text-change", async function(e3) {
|
|
144
163
|
if (!oe) return;
|
|
145
164
|
const t2 = oe.root.getElementsByTagName("img");
|
|
146
165
|
for (const e4 of t2) if (!e4.getAttribute("data-uuid")) {
|
|
147
|
-
const t3 =
|
|
166
|
+
const t3 = qe(e4.src);
|
|
148
167
|
e4.setAttribute("data-uuid", t3);
|
|
149
168
|
}
|
|
150
169
|
if (e3.ops && e3.ops.length > 0) for (const t3 of e3.ops) {
|
|
@@ -153,15 +172,15 @@ const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext
|
|
|
153
172
|
const t4 = e4.image;
|
|
154
173
|
if (!t4.startsWith("data:image")) continue;
|
|
155
174
|
try {
|
|
156
|
-
|
|
157
|
-
const e5 =
|
|
175
|
+
ae.value = true;
|
|
176
|
+
const e5 = _e(t4, "image.png"), l2 = await Re(e5);
|
|
158
177
|
if (!oe) return;
|
|
159
178
|
const n2 = oe.root.getElementsByTagName("img");
|
|
160
179
|
for (const e6 of n2) e6.src === t4 && (e6.width = 300, e6.src = l2.url, e6.setAttribute("data-uuid", l2.uuid));
|
|
161
180
|
} catch (e5) {
|
|
162
|
-
|
|
181
|
+
Le();
|
|
163
182
|
} finally {
|
|
164
|
-
|
|
183
|
+
ae.value = false;
|
|
165
184
|
}
|
|
166
185
|
}
|
|
167
186
|
}
|
|
@@ -169,31 +188,31 @@ const R = { class: "toolbar-right-btns" }, _ = ["title"], j = { class: "richtext
|
|
|
169
188
|
ce && clearTimeout(ce);
|
|
170
189
|
ce = setTimeout(() => {
|
|
171
190
|
if (!oe) return;
|
|
172
|
-
const e4 =
|
|
173
|
-
|
|
191
|
+
const e4 = Te();
|
|
192
|
+
C(G, I, e4), e4 && (O.value = "");
|
|
174
193
|
}, 300);
|
|
175
194
|
}(), Ee();
|
|
176
|
-
}), Ee(), ke = oe.container, ke.addEventListener("click",
|
|
177
|
-
const e3 =
|
|
178
|
-
|
|
195
|
+
}), Ee(), ke = oe.container, ke.addEventListener("click", Ne), ge(), o(() => {
|
|
196
|
+
const e3 = w(G, I);
|
|
197
|
+
S(e3, P.pageContext, P.configure, { formItemRef: be.value, componentRef: ye.value, titleRef: xe.value, value: e3, entity: P.pageContext.entity.data, pageData: P.pageContext.entity.page });
|
|
179
198
|
}));
|
|
180
199
|
}), n(() => {
|
|
181
|
-
document.addEventListener("keydown",
|
|
182
|
-
}),
|
|
183
|
-
document.removeEventListener("keydown",
|
|
184
|
-
}),
|
|
185
|
-
|
|
200
|
+
document.addEventListener("keydown", He);
|
|
201
|
+
}), r(() => {
|
|
202
|
+
document.removeEventListener("keydown", He), ce && clearTimeout(ce), ne.value && ne.value.removeEventListener("focusout", Me), ke && ke.removeEventListener("click", Ne);
|
|
203
|
+
}), z2({ addRequiredClass: function() {
|
|
204
|
+
O.value = H();
|
|
186
205
|
}, setContent: function(e3) {
|
|
187
|
-
|
|
206
|
+
we(e3), Ee();
|
|
188
207
|
}, getContent: function() {
|
|
189
208
|
return oe ? oe.root.innerHTML : "";
|
|
190
209
|
} }), (e3, t2) => {
|
|
191
|
-
const l2 =
|
|
192
|
-
return u(),
|
|
210
|
+
const l2 = i("View"), n2 = i("el-icon"), o2 = i("FullScreen"), r2 = i("Close"), x2 = i("el-form-item"), k2 = i("el-image-viewer"), q2 = i("el-dialog");
|
|
211
|
+
return u(), a(s, null, [c(x2, { required: Z.value.required, class: m(g(J) + (O.value ? " " + O.value : "")), "label-width": Z.value.labelWidth, style: p(g(Y)) }, v({ default: h(() => [b("div", { class: m(["richtext-wrapper", { "is-fullscreen": re.value }]) }, [b("div", { ref_key: "quillEditorRef", ref: ne, style: { width: "100%" } }, null, 512), b("div", R, [b("button", { type: "button", class: "toolbar-btn", onClick: Ae, title: "预览" }, [c(n2, null, { default: h(() => [c(l2)]), _: 1 })]), b("button", { type: "button", class: "toolbar-btn", onClick: Se, title: re.value ? "退出全屏" : "全屏编辑" }, [re.value ? (u(), d(n2, { key: 1 }, { default: h(() => [c(r2)]), _: 1 })) : (u(), d(n2, { key: 0 }, { default: h(() => [c(o2)]), _: 1 }))], 8, _)]), b("div", j, [b("span", F, "字数:" + y(ie.value), 1)]), ae.value ? (u(), a("div", V, t2[2] || (t2[2] = [b("div", { class: "loading-spinner" }, null, -1), b("span", null, "图片上传中...", -1)]))) : f("", true)], 2)]), _: 2 }, [Z.value.tittleShow ? { name: "label", fn: h(() => [b("div", { style: p({ ...g(Q), ...g(X) }), class: "amb-form-item-label" }, y(g(T)(Z.value.title)), 5)]), key: "0" } : void 0]), 1032, ["required", "class", "label-width", "style"]), he.value ? (u(), d(k2, { key: 0, "hide-on-click-modal": "", onClose: t2[0] || (t2[0] = () => {
|
|
193
212
|
he.value = false;
|
|
194
|
-
}), "url-list":
|
|
213
|
+
}), "url-list": ve.value }, null, 8, ["url-list"])) : f("", true), c(q2, { modelValue: ue.value, "onUpdate:modelValue": t2[1] || (t2[1] = (e4) => ue.value = e4), title: "内容预览", width: "80%", "close-on-click-modal": true, "append-to-body": true, class: "richtext-preview-dialog" }, { default: h(() => [b("div", { class: "richtext-preview-content ql-editor", innerHTML: se.value }, null, 8, W)]), _: 1 }, 8, ["modelValue"])], 64);
|
|
195
214
|
};
|
|
196
215
|
} });
|
|
197
216
|
export {
|
|
198
|
-
|
|
217
|
+
z as default
|
|
199
218
|
};
|