super-page-designer 2.3.12-sit1-design1 → 2.3.12-sit1-design2
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/design/utils/page-table-util.js +9 -14
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue.js +1 -1
- package/dist/es/components/design/views/assemblys/data/component/data-origin.vue2.js +1 -1
- package/dist/es/components/design/views/assemblys/form/common/data-format.vue.js +1 -1
- package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue.js +2 -26
- package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue2.js +26 -2
- package/dist/es/components/design/views/design/page-event/config.vue2.js +5 -76
- package/dist/es/components/design/views/design/page-event/config.vue3.js +78 -0
- package/dist/es/components/design/views/design/page-event/page-event-content.vue.js +1 -1
- package/dist/es/components/design/views/design/view/view-design-display.vue.js +1 -1
- package/package.json +2 -2
- package/dist/es/components/design/views/design/page-event/config.vue.js +0 -7
- /package/dist/es/components/design/views/assemblys/common/{common-variable-bind.vue3.js → common-variable-bind.vue2.js} +0 -0
|
@@ -57,17 +57,14 @@ function l(e2) {
|
|
|
57
57
|
function u(e2, t2, r2) {
|
|
58
58
|
if (!e2) return;
|
|
59
59
|
const a2 = e2.props;
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (!o2 && a2.dataOrigin && a2.dataOrigin.optionValueSetType) {
|
|
69
|
-
const o3 = a2.dataOrigin.optionValueSetType, n2 = a2.dataOrigin;
|
|
70
|
-
if ("dynamicData" === o3) return JSON.stringify({ type: "dynamicData", dynamicDataSourceCode: n2.dynamicDataSourceCode, filterType: n2.filterType, valueSetOptions: c(n2), valueLabelSwitch: !!n2.valueLabelSwitch });
|
|
60
|
+
if ("inputNumber" === e2.name) {
|
|
61
|
+
const e3 = { step: a2.base.step, precision: a2.base.precision };
|
|
62
|
+
return e3.min = a2.base.min || 0 === a2.base.min ? a2.base.min : null, e3.max = a2.base.max || 0 === a2.base.max ? a2.base.max : null, JSON.stringify(e3);
|
|
63
|
+
}
|
|
64
|
+
if ("switch" === e2.name) return JSON.stringify({ activeText: a2.base.activeText, activeValue: a2.base.activeValue, inactiveText: a2.base.inactiveText, inactiveValue: a2.base.inactiveValue, offColor: a2.base.offColor, onColor: a2.base.onColor });
|
|
65
|
+
if (a2.dataOrigin && a2.dataOrigin.optionValueSetType) {
|
|
66
|
+
const o2 = a2.dataOrigin.optionValueSetType, n2 = a2.dataOrigin;
|
|
67
|
+
if ("dynamicData" === o2) return JSON.stringify({ type: "dynamicData", dynamicDataSourceCode: n2.dynamicDataSourceCode, filterType: n2.filterType, valueSetOptions: c(n2), valueLabelSwitch: !!n2.valueLabelSwitch });
|
|
71
68
|
{
|
|
72
69
|
const a3 = i(e2, t2, r2);
|
|
73
70
|
return a3 ? (a3.valueSetOptions = c(n2), JSON.stringify(a3)) : null;
|
|
@@ -227,9 +224,7 @@ function C(e2, t2) {
|
|
|
227
224
|
if (t4) {
|
|
228
225
|
e4.format = b(t4), e4.defaultValue = (_b = (_a = t4.props) == null ? void 0 : _a.base) == null ? void 0 : _b.defaultValue, e4.controlName = m(t4), e4.controlConfig = g(t4), e4.eventType = S(t4), e4.fileSet = d(t4), e4.orgTreeSet = f(t4), e4.required = (_d = (_c = t4.props) == null ? void 0 : _c.verification) == null ? void 0 : _d.required, e4.pattern = (_f = (_e = t4.props) == null ? void 0 : _e.verification) == null ? void 0 : _f.verifyRegex, e4.checkType = T(t4.props.verification.type);
|
|
229
226
|
const r3 = l(t4);
|
|
230
|
-
e4.valueSet = r3;
|
|
231
|
-
let a3 = u(t4, null, null);
|
|
232
|
-
a3 || (a3 = e4.valueSetOptions), e4.valueSetOptions = a3, e4.functionCodes && e4.functionCodes.length > 0 ? e4.functionCode = e4.functionCodes.join(",") : e4.functionCode = "";
|
|
227
|
+
e4.valueSet = r3, e4.functionCodes && e4.functionCodes.length > 0 ? e4.functionCode = e4.functionCodes.join(",") : e4.functionCode = "";
|
|
233
228
|
} else e4.format = null, e4.defaultValue = null, e4.controlName = null, e4.controlConfig = null, e4.eventType = null, e4.fileSet = null, e4.orgTreeSet = null, e4.required = null, e4.pattern = null, e4.checkType = null, e4.valueSet = null;
|
|
234
229
|
let r2 = u(t4, null, null);
|
|
235
230
|
r2 || (r2 = e4.valueSetOptions), e4.valueSetOptions = r2;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as e, ref as a, computed as l, resolveComponent as i, createBlock as o, openBlock as t, withCtx as n, createElementVNode as r, createVNode as s, createCommentVNode as u, withDirectives as d, renderSlot as p, createTextVNode as c, unref as g, vShow as f, createElementBlock as m, Fragment as v, renderList as y, normalizeClass as b, toDisplayString as V } from "vue";
|
|
2
|
-
import O from "../../form/common/dataorigin-input-table.
|
|
2
|
+
import O from "../../form/common/dataorigin-input-table.vue2.js";
|
|
3
3
|
import { Codemirror as _ } from "vue-codemirror";
|
|
4
4
|
import C from "../../workflow/component/combination.vue.js";
|
|
5
5
|
import S from "./return-set-table.vue.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as e, ref as l, onMounted as a, resolveComponent as t, createBlock as o, openBlock as u, withCtx as i, createElementVNode as n, createVNode as s, createCommentVNode as d, withDirectives as r, unref as m, createElementBlock as p, Fragment as c, renderList as b, createTextVNode as f, vShow as y, normalizeClass as v } from "vue";
|
|
2
|
-
import V from "./dataorigin-input-table.
|
|
2
|
+
import V from "./dataorigin-input-table.vue2.js";
|
|
3
3
|
import g from "./condition.vue.js";
|
|
4
4
|
import S from "./row-ul-li.vue.js";
|
|
5
5
|
import "uuid";
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Search as p } from "@element-plus/icons-vue";
|
|
3
|
-
const f = { class: "dialog-footer" }, v = e({ __name: "dataorigin-input-table", props: { modelValue: { type: String, default: "" } }, emits: ["update:modelValue"], setup(e2, { emit: v2 }) {
|
|
4
|
-
const c = e2, g = l(c.modelValue), V = v2, h = [{ id: 1, date: "2016-05-03", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 2, date: "2016-05-02", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 3, date: "2016-05-04", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 4, date: "2016-05-01", name: "Tom", address: "No. 189, Grove St, Los Angeles" }], b = l(false), _ = l([]);
|
|
5
|
-
function y() {
|
|
6
|
-
if (_.value.length > 0) {
|
|
7
|
-
let e3 = "";
|
|
8
|
-
_.value.forEach((l2) => {
|
|
9
|
-
e3 = e3 + l2.name + ",";
|
|
10
|
-
}), e3 = e3.substring(0, e3.length - 1), V("update:modelValue", e3), b.value = false;
|
|
11
|
-
} else b.value = false;
|
|
12
|
-
}
|
|
13
|
-
function S(e3) {
|
|
14
|
-
_.value = e3;
|
|
15
|
-
}
|
|
16
|
-
function w() {
|
|
17
|
-
b.value = true;
|
|
18
|
-
}
|
|
19
|
-
return a(() => c.modelValue, (e3) => {
|
|
20
|
-
g.value = e3;
|
|
21
|
-
}), (e3, l2) => {
|
|
22
|
-
const a2 = t("el-icon"), v3 = t("el-input"), c2 = t("el-table-column"), V2 = t("el-table"), _2 = t("el-button"), A = t("el-dialog");
|
|
23
|
-
return d(), o(u, null, [n(v3, { modelValue: g.value, "onUpdate:modelValue": l2[0] || (l2[0] = (e4) => g.value = e4), placeholder: "请选择", onClick: w }, { suffix: i(() => [n(a2, { onClick: w }, { default: i(() => [n(s(p))]), _: 1 })]), _: 1 }, 8, ["modelValue"]), n(A, { modelValue: b.value, "onUpdate:modelValue": l2[2] || (l2[2] = (e4) => b.value = e4), title: "Tips", width: "500" }, { footer: i(() => [m("div", f, [n(_2, { type: "default", onClick: l2[1] || (l2[1] = (e4) => b.value = false) }, { default: i(() => l2[3] || (l2[3] = [r("取消")])), _: 1 }), n(_2, { type: "primary", onClick: y }, { default: i(() => l2[4] || (l2[4] = [r(" 确定 ")])), _: 1 })])]), default: i(() => [n(V2, { data: h, style: { width: "100%" }, onSelectionChange: S }, { default: i(() => [n(c2, { type: "selection", width: "55" }), n(c2, { prop: "date", label: "Date", width: "180" }), n(c2, { prop: "name", label: "Name", width: "180" }), n(c2, { prop: "address", label: "Address" })]), _: 1 })]), _: 1 }, 8, ["modelValue"])], 64);
|
|
24
|
-
};
|
|
25
|
-
} });
|
|
1
|
+
import t from "./dataorigin-input-table.vue2.js";
|
|
26
2
|
export {
|
|
27
|
-
|
|
3
|
+
t as default
|
|
28
4
|
};
|
package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue2.js
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
|
-
import t from "
|
|
1
|
+
import { defineComponent as e, ref as l, watch as a, resolveComponent as t, createElementBlock as o, openBlock as d, Fragment as u, createVNode as n, withCtx as i, unref as s, createElementVNode as m, createTextVNode as r } from "vue";
|
|
2
|
+
import { Search as p } from "@element-plus/icons-vue";
|
|
3
|
+
const f = { class: "dialog-footer" }, v = e({ __name: "dataorigin-input-table", props: { modelValue: { type: String, default: "" } }, emits: ["update:modelValue"], setup(e2, { emit: v2 }) {
|
|
4
|
+
const c = e2, g = l(c.modelValue), V = v2, h = [{ id: 1, date: "2016-05-03", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 2, date: "2016-05-02", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 3, date: "2016-05-04", name: "Tom", address: "No. 189, Grove St, Los Angeles" }, { id: 4, date: "2016-05-01", name: "Tom", address: "No. 189, Grove St, Los Angeles" }], b = l(false), _ = l([]);
|
|
5
|
+
function y() {
|
|
6
|
+
if (_.value.length > 0) {
|
|
7
|
+
let e3 = "";
|
|
8
|
+
_.value.forEach((l2) => {
|
|
9
|
+
e3 = e3 + l2.name + ",";
|
|
10
|
+
}), e3 = e3.substring(0, e3.length - 1), V("update:modelValue", e3), b.value = false;
|
|
11
|
+
} else b.value = false;
|
|
12
|
+
}
|
|
13
|
+
function S(e3) {
|
|
14
|
+
_.value = e3;
|
|
15
|
+
}
|
|
16
|
+
function w() {
|
|
17
|
+
b.value = true;
|
|
18
|
+
}
|
|
19
|
+
return a(() => c.modelValue, (e3) => {
|
|
20
|
+
g.value = e3;
|
|
21
|
+
}), (e3, l2) => {
|
|
22
|
+
const a2 = t("el-icon"), v3 = t("el-input"), c2 = t("el-table-column"), V2 = t("el-table"), _2 = t("el-button"), A = t("el-dialog");
|
|
23
|
+
return d(), o(u, null, [n(v3, { modelValue: g.value, "onUpdate:modelValue": l2[0] || (l2[0] = (e4) => g.value = e4), placeholder: "请选择", onClick: w }, { suffix: i(() => [n(a2, { onClick: w }, { default: i(() => [n(s(p))]), _: 1 })]), _: 1 }, 8, ["modelValue"]), n(A, { modelValue: b.value, "onUpdate:modelValue": l2[2] || (l2[2] = (e4) => b.value = e4), title: "Tips", width: "500" }, { footer: i(() => [m("div", f, [n(_2, { type: "default", onClick: l2[1] || (l2[1] = (e4) => b.value = false) }, { default: i(() => l2[3] || (l2[3] = [r("取消")])), _: 1 }), n(_2, { type: "primary", onClick: y }, { default: i(() => l2[4] || (l2[4] = [r(" 确定 ")])), _: 1 })])]), default: i(() => [n(V2, { data: h, style: { width: "100%" }, onSelectionChange: S }, { default: i(() => [n(c2, { type: "selection", width: "55" }), n(c2, { prop: "date", label: "Date", width: "180" }), n(c2, { prop: "name", label: "Name", width: "180" }), n(c2, { prop: "address", label: "Address" })]), _: 1 })]), _: 1 }, 8, ["modelValue"])], 64);
|
|
24
|
+
};
|
|
25
|
+
} });
|
|
2
26
|
export {
|
|
3
|
-
|
|
27
|
+
v as default
|
|
4
28
|
};
|
|
@@ -1,78 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import { javascriptLanguage as b, javascript as _ } from "@codemirror/lang-javascript";
|
|
6
|
-
import { EditorState as x } from "@codemirror/state";
|
|
7
|
-
import "@codemirror/autocomplete";
|
|
8
|
-
import "@codemirror/language";
|
|
9
|
-
import { openSearchPanel as y } from "@codemirror/search";
|
|
10
|
-
import k from "js-beautify";
|
|
11
|
-
import w from "./completion-data.js";
|
|
12
|
-
const j = { style: { padding: "8px 16px", margin: "10px 0px", "background-color": "#f4f4f5" }, class: "pppp" }, C = { style: { color: "#909399", "font-size": "14px" } }, z = { key: 0 }, F = { key: 1 }, S = { class: "editorTool" }, O = e({ __name: "config", props: { eventForm: { type: Object, default: () => ({}) } }, emits: ["fullScreen"], setup(e2, { expose: O2, emit: V }) {
|
|
13
|
-
const D = e2;
|
|
14
|
-
t(false);
|
|
15
|
-
const L = t({ theme: "default", fontSize: 14, searchOpen: false }), T = t(null), W = t(null), $ = t(null), B = t({ backgroundColor: "#fff", color: "#333", border: "1px solid #ddd", overflow: "auto" });
|
|
16
|
-
let R;
|
|
17
|
-
l(() => {
|
|
18
|
-
let e3 = f("editorStyle", "").value;
|
|
19
|
-
e3 && (e3 = JSON.parse(e3), L.value.theme = e3.theme || "default", L.value.fontSize = e3.fontSize || 14), G();
|
|
20
|
-
}), o(() => {
|
|
21
|
-
R && clearTimeout(R);
|
|
22
|
-
});
|
|
23
|
-
const U = b.data.of({ autocomplete: function(e3) {
|
|
24
|
-
const t2 = e3.matchBefore(/(?:window\.[\w$\.]*|logicContext\.[\w$\.]*)/);
|
|
25
|
-
if (!t2 || "" === t2.text) return null;
|
|
26
|
-
const l2 = t2.text;
|
|
27
|
-
if (w[l2]) return { from: t2.from, options: w[l2], filter: true };
|
|
28
|
-
let o2 = null;
|
|
29
|
-
for (const e4 of Object.keys(w)) l2.startsWith(e4) && (!o2 || e4.length > o2.length) && (o2 = e4);
|
|
30
|
-
if (!o2) for (const e4 of Object.keys(w)) e4.startsWith(l2) && (!o2 || e4.length > o2.length) && (o2 = e4);
|
|
31
|
-
if (o2) {
|
|
32
|
-
let e4 = w[o2];
|
|
33
|
-
return (l2.length > o2.length || l2 !== o2) && (e4 = e4.filter((e5) => e5.label.startsWith(l2))), { from: t2.from, options: e4, filter: false };
|
|
34
|
-
}
|
|
35
|
-
if ("window.$" === l2) return { from: t2.from, options: w["window."].filter((e4) => e4.label.startsWith("window.$")), filter: false };
|
|
36
|
-
return null;
|
|
37
|
-
} });
|
|
38
|
-
function q() {
|
|
39
|
-
f("editorStyle", L.value).value = L.value, T.value && (T.value && T.value.destroy(), G());
|
|
40
|
-
}
|
|
41
|
-
function E() {
|
|
42
|
-
const e3 = h.theme({}), t2 = h.theme({ ".cm-content, .cm-gutter": { minHeight: "400px" }, "&": { fontSize: L.value.fontSize + "px" } });
|
|
43
|
-
return x.create({ doc: D.eventForm.jsContent, extensions: [x.tabSize.of(16), g, _(), U, e3, t2, h.updateListener.of(function(e4) {
|
|
44
|
-
D.eventForm.jsContent = e4.state.doc.toString();
|
|
45
|
-
})] });
|
|
46
|
-
}
|
|
47
|
-
function G() {
|
|
48
|
-
const e3 = E();
|
|
49
|
-
T.value = new h({ state: e3, parent: document.getElementById("cf-codemirror") || void 0 });
|
|
50
|
-
}
|
|
51
|
-
function H() {
|
|
52
|
-
if (T.value) {
|
|
53
|
-
T.value.focus(), y(T.value) && T.value.update([]);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function J() {
|
|
57
|
-
if (T.value) {
|
|
58
|
-
const e3 = k.js(D.eventForm.jsContent, { indent_level: 0, indent_size: 2, space_in_empty_paren: false, max_preserve_newlines: 2, preserve_newlines: true, jslint_happy: false, keep_array_indentation: false, keep_function_indentation: false, space_before_conditional: true, break_chained_methods: false, eval_code: false, unescape_strings: false, wrap_line_length: 0, end_with_newline: false });
|
|
59
|
-
T.value.dispatch({ changes: { from: 0, to: D.eventForm.jsContent.length, insert: e3 } });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return O2({ resize: function() {
|
|
63
|
-
R && clearTimeout(R), W.value && (R = setTimeout(() => {
|
|
64
|
-
const e3 = W.value.getBoundingClientRect(), t2 = window.innerHeight - e3.y - 30 + "px";
|
|
65
|
-
T.value && T.value.dom && (T.value.dom.style.height = t2);
|
|
66
|
-
}, 10));
|
|
67
|
-
}, updateJsContent: function(e3) {
|
|
68
|
-
var _a;
|
|
69
|
-
const t2 = D.eventForm.jsContent ? D.eventForm.jsContent : "";
|
|
70
|
-
e3 && D.eventForm && (e3.jsContent || (e3.jsContent = ""), Object.assign(D.eventForm, e3), (_a = T.value) == null ? void 0 : _a.dispatch({ changes: { from: 0, to: t2.length, insert: D.eventForm.jsContent } }));
|
|
71
|
-
} }), (t2, l2) => {
|
|
72
|
-
const o2 = n("el-input"), f2 = n("el-option"), h2 = n("el-select"), g2 = n("el-tooltip"), b2 = n("el-icon");
|
|
73
|
-
return r(), a("div", { style: { "padding-right": "20px" }, ref_key: "editorContentRef", ref: $ }, [i("div", j, [i("span", C, [l2[6] || (l2[6] = u(" function ")), "customFunc" === e2.eventForm.name ? (r(), a("span", z, [l2[3] || (l2[3] = u(" ( ")), l2[4] || (l2[4] = i("span", { class: "is_req" }, [i("span", { class: "cell--span required__label" })], -1)), s(o2, { size: "small", modelValue: e2.eventForm.funcParam, "onUpdate:modelValue": l2[0] || (l2[0] = (t3) => e2.eventForm.funcParam = t3), style: { width: "300px" }, title: "方法参数" }, null, 8, ["modelValue"]), l2[5] || (l2[5] = u(" ) "))])) : (r(), a("span", F, " ( params ) ")), l2[7] || (l2[7] = u("{ "))]), i("span", S, [s(g2, { class: "box-item", effect: "dark", content: "切换主题", placement: "top" }, { default: c(() => [s(h2, { class: "editorOption", onChange: q, modelValue: L.value.theme, "onUpdate:modelValue": l2[1] || (l2[1] = (e3) => L.value.theme = e3), placeholder: "", size: "small", style: { width: "120px" } }, { default: c(() => [s(f2, { label: "默认", value: "default" }), s(f2, { label: "VScodeDark", value: "vscodeDark" }), s(f2, { label: "Dracula", value: "dracula" }), s(f2, { label: "GithubLight", value: "githubLight" }), s(f2, { label: "GithubDark", value: "githubDark" }), s(f2, { label: "Eclipse", value: "eclipse" }), s(f2, { label: "XcodeLight", value: "xcodeLight" }), s(f2, { label: "XcodeDark", value: "xcodeDark" })]), _: 1 }, 8, ["modelValue"])]), _: 1 }), s(g2, { class: "box-item", effect: "dark", content: "切换字体大小", placement: "top" }, { default: c(() => [s(h2, { class: "editorOption", modelValue: L.value.fontSize, "onUpdate:modelValue": l2[2] || (l2[2] = (e3) => L.value.fontSize = e3), placeholder: "", onChange: q, size: "small", style: { width: "80px" } }, { default: c(() => [s(f2, { label: "12", value: 12 }), s(f2, { label: "14", value: 14 }), s(f2, { label: "16", value: 16 }), s(f2, { label: "18", value: 18 }), s(f2, { label: "20", value: 20 }), s(f2, { label: "22", value: 22 }), s(f2, { label: "24", value: 24 }), s(f2, { label: "26", value: 26 }), s(f2, { label: "28", value: 28 })]), _: 1 }, 8, ["modelValue"])]), _: 1 })]), s(g2, { class: "box-item", effect: "dark", content: "打开搜索", placement: "top" }, { default: c(() => [s(b2, { class: "editorOption", onClick: H }, { default: c(() => [s(d(p))]), _: 1 })]), _: 1 }), s(g2, { class: "box-item", effect: "dark", content: "格式化代码", placement: "top" }, { default: c(() => [s(b2, { class: "editorOption", onClick: J }, { default: c(() => [s(d(v))]), _: 1 })]), _: 1 })]), i("div", { style: m(B.value), id: "cf-codemirror", ref_key: "codemirrorRef", ref: W }, null, 4), l2[8] || (l2[8] = i("span", { style: { color: "gray" } }, " }", -1))], 512);
|
|
74
|
-
};
|
|
75
|
-
} });
|
|
1
|
+
import o from "./config.vue3.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import e from "../../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const r = e(o, [["__scopeId", "data-v-c8908117"]]);
|
|
76
5
|
export {
|
|
77
|
-
|
|
6
|
+
r as default
|
|
78
7
|
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent as e, ref as t, onMounted as l, onUnmounted as o, resolveComponent as n, createElementBlock as a, openBlock as r, createElementVNode as i, createVNode as s, createTextVNode as u, withCtx as c, unref as d, normalizeStyle as m } from "vue";
|
|
2
|
+
import { useLocalStorage as f } from "@vueuse/core";
|
|
3
|
+
import { Search as p, MagicStick as v } from "@element-plus/icons-vue";
|
|
4
|
+
import { EditorView as h, basicSetup as g } from "codemirror";
|
|
5
|
+
import { javascriptLanguage as b, javascript as _ } from "@codemirror/lang-javascript";
|
|
6
|
+
import { EditorState as x } from "@codemirror/state";
|
|
7
|
+
import "@codemirror/autocomplete";
|
|
8
|
+
import "@codemirror/language";
|
|
9
|
+
import { openSearchPanel as y } from "@codemirror/search";
|
|
10
|
+
import k from "js-beautify";
|
|
11
|
+
import w from "./completion-data.js";
|
|
12
|
+
const j = { style: { padding: "8px 16px", margin: "10px 0px", "background-color": "#f4f4f5" }, class: "pppp" }, C = { style: { color: "#909399", "font-size": "14px" } }, z = { key: 0 }, F = { key: 1 }, S = { class: "editorTool" }, O = e({ __name: "config", props: { eventForm: { type: Object, default: () => ({}) } }, emits: ["fullScreen"], setup(e2, { expose: O2, emit: V }) {
|
|
13
|
+
const D = e2;
|
|
14
|
+
t(false);
|
|
15
|
+
const L = t({ theme: "default", fontSize: 14, searchOpen: false }), T = t(null), W = t(null), $ = t(null), B = t({ backgroundColor: "#fff", color: "#333", border: "1px solid #ddd", overflow: "auto" });
|
|
16
|
+
let R;
|
|
17
|
+
l(() => {
|
|
18
|
+
let e3 = f("editorStyle", "").value;
|
|
19
|
+
e3 && (e3 = JSON.parse(e3), L.value.theme = e3.theme || "default", L.value.fontSize = e3.fontSize || 14), G();
|
|
20
|
+
}), o(() => {
|
|
21
|
+
R && clearTimeout(R);
|
|
22
|
+
});
|
|
23
|
+
const U = b.data.of({ autocomplete: function(e3) {
|
|
24
|
+
const t2 = e3.matchBefore(/(?:window\.[\w$\.]*|logicContext\.[\w$\.]*)/);
|
|
25
|
+
if (!t2 || "" === t2.text) return null;
|
|
26
|
+
const l2 = t2.text;
|
|
27
|
+
if (w[l2]) return { from: t2.from, options: w[l2], filter: true };
|
|
28
|
+
let o2 = null;
|
|
29
|
+
for (const e4 of Object.keys(w)) l2.startsWith(e4) && (!o2 || e4.length > o2.length) && (o2 = e4);
|
|
30
|
+
if (!o2) for (const e4 of Object.keys(w)) e4.startsWith(l2) && (!o2 || e4.length > o2.length) && (o2 = e4);
|
|
31
|
+
if (o2) {
|
|
32
|
+
let e4 = w[o2];
|
|
33
|
+
return (l2.length > o2.length || l2 !== o2) && (e4 = e4.filter((e5) => e5.label.startsWith(l2))), { from: t2.from, options: e4, filter: false };
|
|
34
|
+
}
|
|
35
|
+
if ("window.$" === l2) return { from: t2.from, options: w["window."].filter((e4) => e4.label.startsWith("window.$")), filter: false };
|
|
36
|
+
return null;
|
|
37
|
+
} });
|
|
38
|
+
function q() {
|
|
39
|
+
f("editorStyle", L.value).value = L.value, T.value && (T.value && T.value.destroy(), G());
|
|
40
|
+
}
|
|
41
|
+
function E() {
|
|
42
|
+
const e3 = h.theme({}), t2 = h.theme({ ".cm-content, .cm-gutter": { minHeight: "400px" }, "&": { fontSize: L.value.fontSize + "px" } });
|
|
43
|
+
return x.create({ doc: D.eventForm.jsContent, extensions: [x.tabSize.of(16), g, _(), U, e3, t2, h.updateListener.of(function(e4) {
|
|
44
|
+
D.eventForm.jsContent = e4.state.doc.toString();
|
|
45
|
+
})] });
|
|
46
|
+
}
|
|
47
|
+
function G() {
|
|
48
|
+
const e3 = E();
|
|
49
|
+
T.value = new h({ state: e3, parent: document.getElementById("cf-codemirror") || void 0 });
|
|
50
|
+
}
|
|
51
|
+
function H() {
|
|
52
|
+
if (T.value) {
|
|
53
|
+
T.value.focus(), y(T.value) && T.value.update([]);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function J() {
|
|
57
|
+
if (T.value) {
|
|
58
|
+
const e3 = k.js(D.eventForm.jsContent, { indent_level: 0, indent_size: 2, space_in_empty_paren: false, max_preserve_newlines: 2, preserve_newlines: true, jslint_happy: false, keep_array_indentation: false, keep_function_indentation: false, space_before_conditional: true, break_chained_methods: false, eval_code: false, unescape_strings: false, wrap_line_length: 0, end_with_newline: false });
|
|
59
|
+
T.value.dispatch({ changes: { from: 0, to: D.eventForm.jsContent.length, insert: e3 } });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return O2({ resize: function() {
|
|
63
|
+
R && clearTimeout(R), W.value && (R = setTimeout(() => {
|
|
64
|
+
const e3 = W.value.getBoundingClientRect(), t2 = window.innerHeight - e3.y - 30 + "px";
|
|
65
|
+
T.value && T.value.dom && (T.value.dom.style.height = t2);
|
|
66
|
+
}, 10));
|
|
67
|
+
}, updateJsContent: function(e3) {
|
|
68
|
+
var _a;
|
|
69
|
+
const t2 = D.eventForm.jsContent ? D.eventForm.jsContent : "";
|
|
70
|
+
e3 && D.eventForm && (e3.jsContent || (e3.jsContent = ""), Object.assign(D.eventForm, e3), (_a = T.value) == null ? void 0 : _a.dispatch({ changes: { from: 0, to: t2.length, insert: D.eventForm.jsContent } }));
|
|
71
|
+
} }), (t2, l2) => {
|
|
72
|
+
const o2 = n("el-input"), f2 = n("el-option"), h2 = n("el-select"), g2 = n("el-tooltip"), b2 = n("el-icon");
|
|
73
|
+
return r(), a("div", { style: { "padding-right": "20px" }, ref_key: "editorContentRef", ref: $ }, [i("div", j, [i("span", C, [l2[6] || (l2[6] = u(" function ")), "customFunc" === e2.eventForm.name ? (r(), a("span", z, [l2[3] || (l2[3] = u(" ( ")), l2[4] || (l2[4] = i("span", { class: "is_req" }, [i("span", { class: "cell--span required__label" })], -1)), s(o2, { size: "small", modelValue: e2.eventForm.funcParam, "onUpdate:modelValue": l2[0] || (l2[0] = (t3) => e2.eventForm.funcParam = t3), style: { width: "300px" }, title: "方法参数" }, null, 8, ["modelValue"]), l2[5] || (l2[5] = u(" ) "))])) : (r(), a("span", F, " ( params ) ")), l2[7] || (l2[7] = u("{ "))]), i("span", S, [s(g2, { class: "box-item", effect: "dark", content: "切换主题", placement: "top" }, { default: c(() => [s(h2, { class: "editorOption", onChange: q, modelValue: L.value.theme, "onUpdate:modelValue": l2[1] || (l2[1] = (e3) => L.value.theme = e3), placeholder: "", size: "small", style: { width: "120px" } }, { default: c(() => [s(f2, { label: "默认", value: "default" }), s(f2, { label: "VScodeDark", value: "vscodeDark" }), s(f2, { label: "Dracula", value: "dracula" }), s(f2, { label: "GithubLight", value: "githubLight" }), s(f2, { label: "GithubDark", value: "githubDark" }), s(f2, { label: "Eclipse", value: "eclipse" }), s(f2, { label: "XcodeLight", value: "xcodeLight" }), s(f2, { label: "XcodeDark", value: "xcodeDark" })]), _: 1 }, 8, ["modelValue"])]), _: 1 }), s(g2, { class: "box-item", effect: "dark", content: "切换字体大小", placement: "top" }, { default: c(() => [s(h2, { class: "editorOption", modelValue: L.value.fontSize, "onUpdate:modelValue": l2[2] || (l2[2] = (e3) => L.value.fontSize = e3), placeholder: "", onChange: q, size: "small", style: { width: "80px" } }, { default: c(() => [s(f2, { label: "12", value: 12 }), s(f2, { label: "14", value: 14 }), s(f2, { label: "16", value: 16 }), s(f2, { label: "18", value: 18 }), s(f2, { label: "20", value: 20 }), s(f2, { label: "22", value: 22 }), s(f2, { label: "24", value: 24 }), s(f2, { label: "26", value: 26 }), s(f2, { label: "28", value: 28 })]), _: 1 }, 8, ["modelValue"])]), _: 1 })]), s(g2, { class: "box-item", effect: "dark", content: "打开搜索", placement: "top" }, { default: c(() => [s(b2, { class: "editorOption", onClick: H }, { default: c(() => [s(d(p))]), _: 1 })]), _: 1 }), s(g2, { class: "box-item", effect: "dark", content: "格式化代码", placement: "top" }, { default: c(() => [s(b2, { class: "editorOption", onClick: J }, { default: c(() => [s(d(v))]), _: 1 })]), _: 1 })]), i("div", { style: m(B.value), id: "cf-codemirror", ref_key: "codemirrorRef", ref: W }, null, 4), l2[8] || (l2[8] = i("span", { style: { color: "gray" } }, " }", -1))], 512);
|
|
74
|
+
};
|
|
75
|
+
} });
|
|
76
|
+
export {
|
|
77
|
+
O as default
|
|
78
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as e, ref as t, onMounted as n, onUnmounted as a, watch as l, resolveComponent as u, createElementBlock as o, openBlock as s, createElementVNode as i, createVNode as r, withDirectives as m, withCtx as c, vShow as d, unref as v, createTextVNode as p, toDisplayString as f, Fragment as g, renderList as b, createBlock as y } from "vue";
|
|
2
2
|
import { ElMessageBox as x, ElMessage as h } from "element-plus";
|
|
3
|
-
import C from "./config.
|
|
3
|
+
import C from "./config.vue2.js";
|
|
4
4
|
import { standardButtonOperations as E } from "../../../utils/assemblys-config.js";
|
|
5
5
|
import { findDesignItemByUuid as S, getUuidv4 as V, deepCopy as k } from "../../../utils/common-util.js";
|
|
6
6
|
import { usePageContextStore as _ } from "../../../../../stores/page-store.js";
|
|
@@ -16,7 +16,7 @@ import "@codemirror/autocomplete";
|
|
|
16
16
|
import "@codemirror/language";
|
|
17
17
|
import "@codemirror/search";
|
|
18
18
|
import "js-beautify";
|
|
19
|
-
/* empty css
|
|
19
|
+
/* empty css */
|
|
20
20
|
import "../../../utils/assemblys-config.js";
|
|
21
21
|
import "../../../../../stores/page-store.js";
|
|
22
22
|
import "../../../../../stores/event-undo-redo-store.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-page-designer",
|
|
3
|
-
"version": "2.3.12-sit1-
|
|
3
|
+
"version": "2.3.12-sit1-design2",
|
|
4
4
|
"description": "AgileBuilder super page designer",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "dist/es/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
30
30
|
"@vueuse/core": "^10.9.0",
|
|
31
31
|
"agilebuilder-private-libs": "1.0.26",
|
|
32
|
-
"agilebuilder-ui": "1.1.50-
|
|
32
|
+
"agilebuilder-ui": "1.1.50-sit2",
|
|
33
33
|
"echarts": "^5.5.0",
|
|
34
34
|
"element-plus": "^2.6.1",
|
|
35
35
|
"font-awesome": "^4.7.0",
|