act-plus 1.1.56 → 1.1.58

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.
@@ -0,0 +1,378 @@
1
+ import { watch as C, defineComponent as U, toRefs as j, ref as A, nextTick as k, onMounted as B, onBeforeUnmount as z, onActivated as L, onDeactivated as N, h as x, reactive as R, computed as q, openBlock as K, createElementBlock as F, createVNode as T, unref as G } from "vue";
2
+ import _ from "tinymce/tinymce";
3
+ import "tinymce/icons/default/icons";
4
+ import "tinymce/models/dom";
5
+ import "tinymce/themes/silver";
6
+ import "tinymce/plugins/image";
7
+ import "tinymce/plugins/table";
8
+ import "tinymce/plugins/lists";
9
+ import "tinymce/plugins/wordcount";
10
+ import "tinymce/plugins/preview";
11
+ import "tinymce/plugins/emoticons";
12
+ import "tinymce/plugins/emoticons/js/emojis.js";
13
+ import "tinymce/plugins/code";
14
+ import "tinymce/plugins/link";
15
+ import "tinymce/plugins/advlist";
16
+ import "tinymce/plugins/codesample";
17
+ import "tinymce/plugins/autoresize";
18
+ import "tinymce/plugins/quickbars";
19
+ import "tinymce/plugins/nonbreaking";
20
+ import "tinymce/plugins/searchreplace";
21
+ import "tinymce/plugins/autolink";
22
+ import "tinymce/plugins/directionality";
23
+ import "tinymce/plugins/visualblocks";
24
+ import "tinymce/plugins/visualchars";
25
+ import "tinymce/plugins/charmap";
26
+ import "tinymce/plugins/insertdatetime";
27
+ import "tinymce/plugins/importcss";
28
+ import "tinymce/plugins/accordion";
29
+ import "tinymce/plugins/anchor";
30
+ import "tinymce/plugins/fullscreen";
31
+ var H = [
32
+ "onActivate",
33
+ "onAddUndo",
34
+ "onBeforeAddUndo",
35
+ "onBeforeExecCommand",
36
+ "onBeforeGetContent",
37
+ "onBeforeRenderUI",
38
+ "onBeforeSetContent",
39
+ "onBeforePaste",
40
+ "onBlur",
41
+ "onChange",
42
+ "onClearUndos",
43
+ "onClick",
44
+ "onContextMenu",
45
+ "onCommentChange",
46
+ "onCompositionEnd",
47
+ "onCompositionStart",
48
+ "onCompositionUpdate",
49
+ "onCopy",
50
+ "onCut",
51
+ "onDblclick",
52
+ "onDeactivate",
53
+ "onDirty",
54
+ "onDrag",
55
+ "onDragDrop",
56
+ "onDragEnd",
57
+ "onDragGesture",
58
+ "onDragOver",
59
+ "onDrop",
60
+ "onExecCommand",
61
+ "onFocus",
62
+ "onFocusIn",
63
+ "onFocusOut",
64
+ "onGetContent",
65
+ "onHide",
66
+ "onInit",
67
+ "onInput",
68
+ "onKeyDown",
69
+ "onKeyPress",
70
+ "onKeyUp",
71
+ "onLoadContent",
72
+ "onMouseDown",
73
+ "onMouseEnter",
74
+ "onMouseLeave",
75
+ "onMouseMove",
76
+ "onMouseOut",
77
+ "onMouseOver",
78
+ "onMouseUp",
79
+ "onNodeChange",
80
+ "onObjectResizeStart",
81
+ "onObjectResized",
82
+ "onObjectSelected",
83
+ "onPaste",
84
+ "onPostProcess",
85
+ "onPostRender",
86
+ "onPreProcess",
87
+ "onProgressState",
88
+ "onRedo",
89
+ "onRemove",
90
+ "onReset",
91
+ "onSaveContent",
92
+ "onSelectionChange",
93
+ "onSetAttrib",
94
+ "onSetContent",
95
+ "onShow",
96
+ "onSubmit",
97
+ "onUndo",
98
+ "onVisualAid"
99
+ ], W = function(e) {
100
+ return H.map(function(n) {
101
+ return n.toLowerCase();
102
+ }).indexOf(e.toLowerCase()) !== -1;
103
+ }, Y = function(e, n, t) {
104
+ Object.keys(n).filter(W).forEach(function(i) {
105
+ var o = n[i];
106
+ typeof o == "function" && (i === "onInit" ? o(e, t) : t.on(i.substring(2), function(r) {
107
+ return o(r, t);
108
+ }));
109
+ });
110
+ }, J = function(e, n, t, i) {
111
+ var o = e.modelEvents ? e.modelEvents : null, r = Array.isArray(o) ? o.join(" ") : o;
112
+ C(i, function(c, l) {
113
+ t && typeof c == "string" && c !== l && c !== t.getContent({ format: e.outputFormat }) && t.setContent(c);
114
+ }), t.on(r || "change input undo redo", function() {
115
+ n.emit("update:modelValue", t.getContent({ format: e.outputFormat }));
116
+ });
117
+ }, Q = function(e, n, t, i, o, r) {
118
+ i.setContent(r()), t.attrs["onUpdate:modelValue"] && J(n, t, i, o), Y(e, t.attrs, i);
119
+ }, E = 0, D = function(e) {
120
+ var n = Date.now(), t = Math.floor(Math.random() * 1e9);
121
+ return E++, e + "_" + t + E + String(n);
122
+ }, X = function(e) {
123
+ return e !== null && e.tagName.toLowerCase() === "textarea";
124
+ }, w = function(e) {
125
+ return typeof e > "u" || e === "" ? [] : Array.isArray(e) ? e : e.split(" ");
126
+ }, Z = function(e, n) {
127
+ return w(e).concat(w(n));
128
+ }, $ = function(e) {
129
+ return e == null;
130
+ }, V = function() {
131
+ return {
132
+ listeners: [],
133
+ scriptId: D("tiny-script"),
134
+ scriptLoaded: !1
135
+ };
136
+ }, ee = function() {
137
+ var e = V(), n = function(o, r, c, l) {
138
+ var a = r.createElement("script");
139
+ a.referrerPolicy = "origin", a.type = "application/javascript", a.id = o, a.src = c;
140
+ var p = function() {
141
+ a.removeEventListener("load", p), l();
142
+ };
143
+ a.addEventListener("load", p), r.head && r.head.appendChild(a);
144
+ }, t = function(o, r, c) {
145
+ e.scriptLoaded ? c() : (e.listeners.push(c), o.getElementById(e.scriptId) || n(e.scriptId, o, r, function() {
146
+ e.listeners.forEach(function(l) {
147
+ return l();
148
+ }), e.scriptLoaded = !0;
149
+ }));
150
+ }, i = function() {
151
+ e = V();
152
+ };
153
+ return {
154
+ load: t,
155
+ reinitialize: i
156
+ };
157
+ }, te = ee(), ne = function() {
158
+ return typeof window < "u" ? window : global;
159
+ }, v = function() {
160
+ var e = ne();
161
+ return e && e.tinymce ? e.tinymce : null;
162
+ }, oe = {
163
+ apiKey: String,
164
+ licenseKey: String,
165
+ cloudChannel: String,
166
+ id: String,
167
+ init: Object,
168
+ initialValue: String,
169
+ inline: Boolean,
170
+ modelEvents: [String, Array],
171
+ plugins: [String, Array],
172
+ tagName: String,
173
+ toolbar: [String, Array],
174
+ modelValue: String,
175
+ disabled: Boolean,
176
+ tinymceScriptSrc: String,
177
+ outputFormat: {
178
+ type: String,
179
+ validator: function(e) {
180
+ return e === "html" || e === "text";
181
+ }
182
+ }
183
+ }, s = globalThis && globalThis.__assign || function() {
184
+ return s = Object.assign || function(e) {
185
+ for (var n, t = 1, i = arguments.length; t < i; t++) {
186
+ n = arguments[t];
187
+ for (var o in n)
188
+ Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]);
189
+ }
190
+ return e;
191
+ }, s.apply(this, arguments);
192
+ }, ie = function(e, n, t, i) {
193
+ return e(i || "div", {
194
+ id: n,
195
+ ref: t
196
+ });
197
+ }, ae = function(e, n, t) {
198
+ return e("textarea", {
199
+ id: n,
200
+ visibility: "hidden",
201
+ ref: t
202
+ });
203
+ }, S = { selector: void 0, target: void 0 }, re = U({
204
+ props: oe,
205
+ setup: function(e, n) {
206
+ var t = e.init ? s(s({}, e.init), S) : s({}, S), i = j(e), o = i.disabled, r = i.modelValue, c = i.tagName, l = A(null), a = null, p = e.id || D("tiny-vue"), m = e.init && e.init.inline || e.inline, f = !!n.attrs["onUpdate:modelValue"], y = !0, I = e.initialValue ? e.initialValue : "", b = "", M = function(u) {
207
+ return f ? function() {
208
+ return r != null && r.value ? r.value : "";
209
+ } : function() {
210
+ return u ? I : b;
211
+ };
212
+ }, h = function() {
213
+ var u = M(y), d = s(s({}, t), { readonly: e.disabled, target: l.value, plugins: Z(t.plugins, e.plugins), toolbar: e.toolbar || t.toolbar, inline: m, license_key: e.licenseKey, setup: function(g) {
214
+ a = g, g.on("init", function(P) {
215
+ return Q(P, e, n, g, r, u);
216
+ }), typeof t.setup == "function" && t.setup(g);
217
+ } });
218
+ X(l.value) && (l.value.style.visibility = ""), v().init(d), y = !1;
219
+ };
220
+ C(o, function(u) {
221
+ var d;
222
+ a !== null && (typeof ((d = a.mode) === null || d === void 0 ? void 0 : d.set) == "function" ? a.mode.set(u ? "readonly" : "design") : a.setMode(u ? "readonly" : "design"));
223
+ }), C(c, function(u) {
224
+ var d;
225
+ f || (b = a.getContent()), (d = v()) === null || d === void 0 || d.remove(a), k(function() {
226
+ return h();
227
+ });
228
+ }), B(function() {
229
+ if (v() !== null)
230
+ h();
231
+ else if (l.value && l.value.ownerDocument) {
232
+ var u = e.cloudChannel ? e.cloudChannel : "7", d = e.apiKey ? e.apiKey : "no-api-key", g = $(e.tinymceScriptSrc) ? "https://cdn.tiny.cloud/1/".concat(d, "/tinymce/").concat(u, "/tinymce.min.js") : e.tinymceScriptSrc;
233
+ te.load(l.value.ownerDocument, g, h);
234
+ }
235
+ }), z(function() {
236
+ v() !== null && v().remove(a);
237
+ }), m || (L(function() {
238
+ y || h();
239
+ }), N(function() {
240
+ var u;
241
+ f || (b = a.getContent()), (u = v()) === null || u === void 0 || u.remove(a);
242
+ }));
243
+ var O = function(u) {
244
+ var d;
245
+ b = a.getContent(), (d = v()) === null || d === void 0 || d.remove(a), t = s(s(s({}, t), u), S), k(function() {
246
+ return h();
247
+ });
248
+ };
249
+ return n.expose({
250
+ rerender: O,
251
+ getEditor: function() {
252
+ return a;
253
+ }
254
+ }), function() {
255
+ return m ? ie(x, p, l, e.tagName) : ae(x, p, l);
256
+ };
257
+ }
258
+ });
259
+ const le = { style: { height: "100%", overflow: "hidden" } }, Le = {
260
+ __name: "index",
261
+ props: {
262
+ modelValue: { type: String, default: "" },
263
+ value: { type: String, default: "" },
264
+ baseUrl: { type: String, default: "" },
265
+ width: { type: [Number, String], default: "100%" },
266
+ height: { type: Number, default: 500 },
267
+ disabled: { type: Boolean, default: !1 },
268
+ editableRoot: { type: Boolean, default: !0 },
269
+ placeholder: { type: String, default: "请输入" },
270
+ plugins: {
271
+ type: [String, Array],
272
+ default: "importcss autoresize searchreplace autolink directionality code visualblocks visualchars fullscreen image link codesample table charmap nonbreaking anchor insertdatetime advlist lists wordcount charmap quickbars emoticons accordion"
273
+ },
274
+ toolbar: {
275
+ type: [String, Array, Boolean],
276
+ default: "undo redo | accordion accordionremove | blocks fontfamily fontsize| bold italic underline strikethrough ltr rtl | align numlist bullist | link image | table | lineheight outdent indent| forecolor backcolor removeformat | charmap emoticons | anchor codesample"
277
+ }
278
+ },
279
+ emits: ["update:modelValue", "setHtml"],
280
+ setup(e, { expose: n, emit: t }) {
281
+ const i = t, o = e, r = A("vue-tinymce-" + +/* @__PURE__ */ new Date() + ((Math.random() * 1e3).toFixed(0) + "")), c = R({
282
+ selector: "#" + r.value,
283
+ //富文本编辑器的id,
284
+ language_url: "/tinymce/langs/zh_CN.js",
285
+ // 语言包的路径,具体路径看自己的项目
286
+ language: "zh_CN",
287
+ skin_url: "/tinymce/skins/ui/oxide",
288
+ // skin路径,具体路径看自己的项目
289
+ content_css: "/tinymce/skins/content/default/content.css",
290
+ //以css文件方式自定义可编辑区域的css样式,css文件需自己创建并引入
291
+ editable_root: o.editableRoot,
292
+ width: o.width,
293
+ height: o.height,
294
+ min_height: o.height,
295
+ branding: !1,
296
+ // 是否禁用“Powered by TinyMCE”
297
+ promotion: !1,
298
+ //去掉 upgrade
299
+ menubar: "edit view insert format tools table",
300
+ paste_data_images: !0,
301
+ //允许粘贴图像
302
+ image_dimensions: !1,
303
+ //去除宽高属性
304
+ plugins: o.plugins,
305
+ //这里的数据是在props里面就定义好了的
306
+ toolbar: o.toolbar,
307
+ //这里的数据是在props里面就定义好了的
308
+ // 取消图片资源路径转换
309
+ convert_urls: !1,
310
+ link_default_target: "_blank",
311
+ link_context_toolbar: !0,
312
+ // 默认快捷菜单
313
+ quickbars_insert_toolbar: "",
314
+ // 选中图片的快捷提示
315
+ quickbars_image_toolbar: "alignleft aligncenter alignright | rotateleft rotateright | imageoptions",
316
+ editimage_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
317
+ // 文字样式
318
+ font_family_formats: "Arial=arial,helvetica,sans-serif; 宋体=SimSun; 微软雅黑=Microsoft Yahei; Impact=impact,chicago;",
319
+ //字体
320
+ font_size_formats: "11px 12px 14px 16px 18px 24px 36px 48px 64px 72px",
321
+ //文字大小
322
+ image_caption: !0,
323
+ editimage_cors_hosts: ["picsum.photos"],
324
+ noneditable_class: "mceNonEditable",
325
+ toolbar_mode: "wrap",
326
+ // 工具栏模式 floating / sliding / scrolling / wrap
327
+ // 默认样式
328
+ content_style: "body {margin:12px; font-family:sans-serif; font-size:14px }p {margin:3px; line-height:24px;}",
329
+ image_advtab: !0,
330
+ importcss_append: !0,
331
+ paste_webkit_styles: "all",
332
+ paste_merge_formats: !0,
333
+ nonbreaking_force_tab: !1,
334
+ paste_auto_cleanup_on_paste: !1,
335
+ file_picker_types: "file",
336
+ // 选中文字的快捷提示
337
+ quickbars_selection_toolbar: "bold italic | quicklink h2 h3 blockquote quickimage quicktable",
338
+ // 编辑器高度自适应
339
+ // autoresize_bottom_margin: 12,
340
+ // autoresize_overflow_padding: 16,
341
+ //图片上传 -实列 具体请根据官网补充-
342
+ images_upload_handler: function(m, f) {
343
+ }
344
+ }), l = q({
345
+ get() {
346
+ return o.modelValue;
347
+ },
348
+ set(m) {
349
+ i("update:modelValue", m);
350
+ }
351
+ });
352
+ return C(
353
+ () => l.value,
354
+ () => {
355
+ i("setHtml", _.activeEditor.getContent({ format: "text" }), l.value);
356
+ }
357
+ ), B(() => {
358
+ _.init({});
359
+ }), n({
360
+ onGetContent: () => _.activeEditor.getContent(),
361
+ onSetContent: (m) => {
362
+ _.activeEditor.setContent(m);
363
+ }
364
+ }), (m, f) => (K(), F("div", le, [
365
+ T(G(re), {
366
+ modelValue: l.value,
367
+ "onUpdate:modelValue": f[0] || (f[0] = (y) => l.value = y),
368
+ init: c,
369
+ disabled: e.disabled,
370
+ placeholder: e.placeholder,
371
+ id: r.value
372
+ }, null, 8, ["modelValue", "init", "disabled", "placeholder", "id"])
373
+ ]));
374
+ }
375
+ };
376
+ export {
377
+ Le as default
378
+ };
@@ -0,0 +1,65 @@
1
+ import { reactive as m, watch as b, resolveComponent as s, openBlock as v, createBlock as g, withCtx as o, createElementVNode as i, createVNode as x, createTextVNode as y, toDisplayString as h, unref as C } from "vue";
2
+ import { _ as k, u as w } from "./index-c7522ec4.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const V = ["innerHTML"], B = { class: "dialog-footer" }, D = {
6
+ __name: "index",
7
+ props: {
8
+ visible: { type: Boolean, default: !1 },
9
+ title: { type: String, default: "" },
10
+ data: { type: Object, default: () => ({}) }
11
+ },
12
+ emits: ["update:visible", "refresh"],
13
+ setup(l, { emit: c }) {
14
+ const { t: d } = w(), r = c, t = l;
15
+ let a = m((() => ({
16
+ loading: !1
17
+ }))());
18
+ b(
19
+ () => t.visible,
20
+ async (e, p) => {
21
+ e && (a.loading = !0, a.loading = !1);
22
+ }
23
+ );
24
+ const _ = (e) => {
25
+ n(), e();
26
+ }, n = () => {
27
+ r("update:visible", !1);
28
+ };
29
+ return (e, p) => {
30
+ const f = s("el-button"), u = s("el-dialog");
31
+ return v(), g(u, {
32
+ "model-value": t.visible,
33
+ title: t.title,
34
+ top: "5vh",
35
+ width: 800,
36
+ "append-to-body": "",
37
+ "destroy-on-close": "",
38
+ draggable: "",
39
+ overflow: "",
40
+ "close-on-click-modal": !1,
41
+ "before-close": _
42
+ }, {
43
+ footer: o(() => [
44
+ i("span", B, [
45
+ x(f, { onClick: n }, {
46
+ default: o(() => [
47
+ y(h(C(d)("act.cancel")), 1)
48
+ ]),
49
+ _: 1
50
+ })
51
+ ])
52
+ ]),
53
+ default: o(() => [
54
+ i("div", {
55
+ innerHTML: l.data.editorContent
56
+ }, null, 8, V)
57
+ ]),
58
+ _: 1
59
+ }, 8, ["model-value", "title"]);
60
+ };
61
+ }
62
+ }, M = /* @__PURE__ */ k(D, [["__scopeId", "data-v-be1c5be6"]]);
63
+ export {
64
+ M as default
65
+ };
@@ -0,0 +1,106 @@
1
+ import { ref as R, inject as l, watch as j, resolveComponent as y, resolveDirective as q, openBlock as r, createElementBlock as u, Fragment as f, renderList as E, unref as d, createBlock as i, resolveDynamicComponent as H, withCtx as b, withDirectives as C, createCommentVNode as _, createTextVNode as k, toDisplayString as B } from "vue";
2
+ import { _ as M, u as z } from "./index-c7522ec4.js";
3
+ import "vue-router";
4
+ import "element-plus";
5
+ const G = { class: "header-operate-container" }, J = {
6
+ __name: "index",
7
+ props: {
8
+ data: { type: Object, default: () => ({}) }
9
+ },
10
+ emits: ["onOperate"],
11
+ setup(w, { emit: x }) {
12
+ const N = x, T = w, { t: D } = z();
13
+ let h = R([]);
14
+ const V = l("globalProps"), v = l("menuPermissionBtns"), F = l("stringToBoolean"), $ = l("matchCondition"), S = l("getTableData"), P = l("tableBtnRefs"), A = (s) => {
15
+ if (!s.matchFields.length)
16
+ return !0;
17
+ const t = s.matchFields.filter((o) => o.matchType != "default"), a = (o) => V.matchData[o.matchType][o.matchFieldName];
18
+ let c = t.reduce((o, n, m) => {
19
+ const L = a(n);
20
+ return o += $(
21
+ n.matchCondition,
22
+ L,
23
+ n.fieldValue == "" ? null : n.fieldValue == "true" || n.fieldValue == "false" ? F(n.fieldValue) : n.fieldValue
24
+ ), m !== t.length - 1 && (o += n.spliceCondition || "&&"), o;
25
+ }, "").split("||"), e = c.reduce((o, n, m) => (o += `(${n})`, m < c.length - 1 && (o += "||"), o), "");
26
+ return new Function(`return ${e}`)();
27
+ }, I = (s) => v.value.some((t) => t.unique == s.permissionCode) && A(s), O = (s) => {
28
+ h.value = (s || []).filter((t) => t.permissionCode !== 1001 && t.btnPostion.includes("header")).sort((t, a) => t.sort - a.sort).map((t) => (t.btnAlias && (t.btnName = t.btnAlias), t));
29
+ };
30
+ j(
31
+ () => T.data,
32
+ (s, t) => {
33
+ O(s.buttons);
34
+ },
35
+ { immediate: !0 }
36
+ );
37
+ const g = (s) => {
38
+ N("onOperate", s, {});
39
+ };
40
+ return (s, t) => {
41
+ const a = y("a-svg-icon"), p = y("el-button"), c = q("debounce");
42
+ return r(), u("div", G, [
43
+ (r(!0), u(f, null, E(d(h), (e, o) => (r(), u(f, { key: o }, [
44
+ I(e) ? (r(), u(f, { key: 0 }, [
45
+ e.isCustomBtn && e.customType == "component" ? (r(), i(H(e[e.customComponentName]), {
46
+ key: 0,
47
+ class: "custom-btn",
48
+ ref_for: !0,
49
+ ref: (n) => d(P)[`${e.customComponentName}-${e.permissionCode}`] = n,
50
+ buttonData: e,
51
+ onRefresh: t[0] || (t[0] = (n) => d(S)())
52
+ }, {
53
+ default: b(() => [
54
+ C((r(), i(p, {
55
+ class: "el-btn",
56
+ type: e.btnColor,
57
+ onClick: (n) => g(e)
58
+ }, {
59
+ default: b(() => [
60
+ e.btnIcon ? (r(), i(a, {
61
+ key: 0,
62
+ class: "mr4",
63
+ name: e.btnIcon,
64
+ width: "12",
65
+ height: "12",
66
+ color: "#fff"
67
+ }, null, 8, ["name"])) : _("", !0),
68
+ k(" " + B(e.btnName), 1)
69
+ ]),
70
+ _: 2
71
+ }, 1032, ["type", "onClick"])), [
72
+ [c]
73
+ ])
74
+ ]),
75
+ _: 2
76
+ }, 1064, ["buttonData"])) : C((r(), i(p, {
77
+ key: 1,
78
+ class: "el-btn",
79
+ type: e.btnColor,
80
+ loading: e.opeateLoading,
81
+ onClick: (n) => g(e)
82
+ }, {
83
+ default: b(() => [
84
+ e.btnIcon ? (r(), i(a, {
85
+ key: 0,
86
+ class: "mr4",
87
+ name: e.btnIcon,
88
+ width: "12",
89
+ height: "12",
90
+ color: "#fff"
91
+ }, null, 8, ["name"])) : _("", !0),
92
+ k(" " + B(e.opeateLoading ? e.btnName + d(D)("act.loading") + "..." : e.btnName), 1)
93
+ ]),
94
+ _: 2
95
+ }, 1032, ["type", "loading", "onClick"])), [
96
+ [c]
97
+ ])
98
+ ], 64)) : _("", !0)
99
+ ], 64))), 128))
100
+ ]);
101
+ };
102
+ }
103
+ }, X = /* @__PURE__ */ M(J, [["__scopeId", "data-v-6477fb97"]]);
104
+ export {
105
+ X as default
106
+ };