super-page-designer 2.0.34 → 2.0.39
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/assemblys-config.js +378 -88
- package/dist/es/components/design/utils/container-design-util.js +6 -8
- package/dist/es/components/design/utils/interfaces/page-design-types.d.ts +3 -2
- package/dist/es/components/design/utils/page-table-util.js +4 -2
- package/dist/es/components/design/views/assemblys/button/button/button-attr-base.vue.js +6 -3
- package/dist/es/components/design/views/assemblys/button/button/button-attr.vue.js +0 -1
- package/dist/es/components/design/views/assemblys/common/common-style-border.vue.js +1 -1
- package/dist/es/components/design/views/assemblys/common/common-style-margin.vue.js +9 -9
- package/dist/es/components/design/views/assemblys/common/common-style-padding.vue.js +9 -9
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue.js +3 -3
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue2.js +691 -1
- package/dist/es/components/design/views/assemblys/common/common-variable-bind.vue3.js +1 -686
- package/dist/es/components/design/views/assemblys/common/page-permission-select.vue.js +77 -31
- package/dist/es/components/design/views/assemblys/container/card/card-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/card/card-design.vue2.js +12 -11
- package/dist/es/components/design/views/assemblys/container/collapse/collapse-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/container/container-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/flex/flex-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/flex/flex-design.vue2.js +31 -15
- package/dist/es/components/design/views/assemblys/container/form/form-attr-base.vue.js +2 -2
- package/dist/es/components/design/views/assemblys/container/form/form-attr-style.vue.js +21 -16
- package/dist/es/components/design/views/assemblys/container/form/form-design.vue2.js +16 -19
- package/dist/es/components/design/views/assemblys/container/iframe/iframe-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/tabs/tabs-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/container/tools/tools-attr-style.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue.js +46 -5
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue2.js +1 -45
- package/dist/es/components/design/views/assemblys/data/component/data-origin.vue2.js +1 -1
- package/dist/es/components/design/views/assemblys/data/table/table-attr-base.vue.js +3 -58
- package/dist/es/components/design/views/assemblys/data/table/table-attr.vue2.js +10 -10
- package/dist/es/components/design/views/assemblys/form/checkbox/checkbox-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/common/data-format.vue.js +2 -2
- package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue.js +1 -152
- package/dist/es/components/design/views/assemblys/form/common/dataorigin-input-table.vue2.js +152 -1
- package/dist/es/components/design/views/assemblys/form/date-picker/datepicker-attr-base.vue.js +8 -8
- package/dist/es/components/design/views/assemblys/form/dept-tree/depttree-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/file-upload/fileupload-attr-base.vue.js +5 -2
- package/dist/es/components/design/views/assemblys/form/input-number/input-number-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/input-text/inputtext-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/label/label-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/link/link-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/radio/radio-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/rich-text/richtext-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/select/select-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/switch/switch-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/tag/tag-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/form/textarea/textarea-attr-base.vue.js +4 -1
- package/dist/es/components/design/views/assemblys/object-design.vue.js +6 -1
- package/dist/es/components/design/views/design/page-event/config.vue.js +7 -1
- package/dist/es/components/design/views/design/page-event/config.vue2.js +1 -7
- package/dist/es/components/design/views/design/page-event/page-event-content.vue.js +594 -5
- package/dist/es/components/design/views/design/page-event/page-event-content.vue2.js +1 -594
- package/dist/es/components/design/views/design/page-event/page-event-view.vue.js +2 -2
- package/dist/es/components/design/views/design/view/components/quick-add-dialog.vue.js +13 -4
- package/dist/es/components/design/views/design/view/components/quick-add-fields.vue.js +0 -1
- package/dist/es/components/design/views/design/view/view-design-display.vue.js +88 -81
- package/dist/es/components/design/views/design/view/view-design-preview.vue.js +21 -2
- package/dist/es/stores/page-store.js +2 -1
- package/dist/es/style.css +1143 -1386
- package/package.json +4 -4
- package/dist/es/components/design/views/assemblys/button/button/button-attr.vue3.js +0 -1
- package/dist/es/components/design/views/assemblys/data/component/attr-header.vue3.js +0 -1
- package/dist/es/components/design/views/design/page-event/page-event-content.vue3.js +0 -1
|
@@ -1,7 +1,596 @@
|
|
|
1
|
-
import
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent, ref, onMounted, onUnmounted, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, withCtx, withDirectives, vShow, unref, createTextVNode, toDisplayString, Fragment, renderList, createBlock } from "vue";
|
|
2
|
+
import { ElMessageBox, ElMessage } from "element-plus";
|
|
3
|
+
import config from "./config.vue.js";
|
|
4
|
+
import { standardButtonOperations } from "../../../utils/assemblys-config.js";
|
|
5
|
+
import { getUuidv4, deepCopy } from "../../../utils/common-util.js";
|
|
6
|
+
import { usePageContextStore } from "../../../../../stores/page-store.js";
|
|
7
|
+
import { undoRedo } from "../../../../../stores/event-undo-redo-store.js";
|
|
8
|
+
import eventBus from "../../../utils/eventBus.js";
|
|
9
|
+
const _hoisted_1 = { style: { "margin": "10px" } };
|
|
10
|
+
const _hoisted_2 = {
|
|
11
|
+
class: "amb-design-tool",
|
|
12
|
+
style: { "user-select": "none" }
|
|
13
|
+
};
|
|
14
|
+
const _hoisted_3 = { class: "amb-design-tool-item" };
|
|
15
|
+
const _hoisted_4 = /* @__PURE__ */ createElementVNode("label", null, "添加自定义方法", -1);
|
|
16
|
+
const _hoisted_5 = { style: { "margin-left": "0px", "display": "inline-block", "width": "39px" } };
|
|
17
|
+
const _hoisted_6 = /* @__PURE__ */ createElementVNode("span", {
|
|
18
|
+
class: "iconfont icon-chexiaozuo",
|
|
19
|
+
style: { "font-size": "20px" },
|
|
20
|
+
title: "撤销"
|
|
21
|
+
}, null, -1);
|
|
22
|
+
const _hoisted_7 = [
|
|
23
|
+
_hoisted_6
|
|
24
|
+
];
|
|
25
|
+
const _hoisted_8 = /* @__PURE__ */ createElementVNode("span", {
|
|
26
|
+
class: "iconfont icon-chexiaoyou",
|
|
27
|
+
style: { "font-size": "20px" },
|
|
28
|
+
title: "恢复"
|
|
29
|
+
}, null, -1);
|
|
30
|
+
const _hoisted_9 = [
|
|
31
|
+
_hoisted_8
|
|
32
|
+
];
|
|
33
|
+
const _hoisted_10 = {
|
|
34
|
+
class: "amb-design-tool-item",
|
|
35
|
+
style: { "padding-right": "10px" }
|
|
36
|
+
};
|
|
37
|
+
const _hoisted_11 = /* @__PURE__ */ createElementVNode("label", null, "确定", -1);
|
|
38
|
+
const _hoisted_12 = /* @__PURE__ */ createElementVNode("label", null, "清除", -1);
|
|
39
|
+
const _hoisted_13 = {
|
|
40
|
+
class: "codemirror",
|
|
41
|
+
style: { "margin-left": "20px", "margin-top": "-10px" }
|
|
42
|
+
};
|
|
43
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
44
|
+
__name: "page-event-content",
|
|
45
|
+
props: {
|
|
46
|
+
eventForm: {},
|
|
47
|
+
configure: {},
|
|
48
|
+
customEvent: {},
|
|
49
|
+
handleType: {}
|
|
50
|
+
},
|
|
51
|
+
emits: ["changeSelectEvent", "addEvent", "changeSelectStandardEvent"],
|
|
52
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
53
|
+
const props = __props;
|
|
54
|
+
const undoRedoStore = undoRedo();
|
|
55
|
+
const pageDesignUtil = usePageContextStore();
|
|
56
|
+
const editorRef = ref(null);
|
|
57
|
+
const winHeight = ref();
|
|
58
|
+
let containerHeightStyle = ref();
|
|
59
|
+
const standardEventOptions = standardButtonOperations;
|
|
60
|
+
let myCustomEvent = props.customEvent;
|
|
61
|
+
const editEvent = ref({ jsContent: "" });
|
|
62
|
+
const tempEvent = ref({ jsContent: "" });
|
|
63
|
+
const snapshotLen = ref(0);
|
|
64
|
+
const snapshotIndex = ref(-1);
|
|
65
|
+
onMounted(() => {
|
|
66
|
+
winHeight.value = window.innerHeight;
|
|
67
|
+
containerHeightStyle.value = {
|
|
68
|
+
overflow: "auto",
|
|
69
|
+
height: winHeight.value + "px"
|
|
70
|
+
};
|
|
71
|
+
bindEventBus();
|
|
72
|
+
});
|
|
73
|
+
onUnmounted(() => {
|
|
74
|
+
clearEventBus();
|
|
75
|
+
});
|
|
76
|
+
function standardChange() {
|
|
77
|
+
let isStandard = false;
|
|
78
|
+
if (tempEvent.value && tempEvent.value.standardValues && tempEvent.value.standardValues.includes("true")) {
|
|
79
|
+
isStandard = true;
|
|
80
|
+
}
|
|
81
|
+
if (tempEvent.value) {
|
|
82
|
+
tempEvent.value.isStandard = isStandard;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function addCustomFunc() {
|
|
86
|
+
const hisStr = editEvent.value ? JSON.stringify(editEvent.value) : null;
|
|
87
|
+
const newStr = tempEvent.value ? JSON.stringify(tempEvent.value) : null;
|
|
88
|
+
if (hisStr && hisStr !== newStr) {
|
|
89
|
+
ElMessageBox.confirm("当前方法有修改,是否需要暂存?", "确认", {
|
|
90
|
+
confirmButtonText: "确定",
|
|
91
|
+
cancelButtonText: "忽略",
|
|
92
|
+
type: "warning"
|
|
93
|
+
}).then(() => {
|
|
94
|
+
const res = tempSaveEvent();
|
|
95
|
+
if (res !== false) {
|
|
96
|
+
_addCustomFunc();
|
|
97
|
+
}
|
|
98
|
+
}).catch((err) => {
|
|
99
|
+
_addCustomFunc();
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
_addCustomFunc();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function _addCustomFunc() {
|
|
106
|
+
const customFunc = {
|
|
107
|
+
name: "customFunc",
|
|
108
|
+
isStandard: false,
|
|
109
|
+
jsContent: ""
|
|
110
|
+
};
|
|
111
|
+
customFunc.uuid = getUuidv4();
|
|
112
|
+
beginEditEvent(customFunc);
|
|
113
|
+
}
|
|
114
|
+
_addCustomFunc();
|
|
115
|
+
function beginEditEvent(eventObj) {
|
|
116
|
+
eventObj = eventObj ? eventObj : {};
|
|
117
|
+
editEvent.value = eventObj;
|
|
118
|
+
tempEvent.value = deepCopy(eventObj);
|
|
119
|
+
if (editorRef.value && editorRef.value.updateJsContent) {
|
|
120
|
+
editorRef.value.updateJsContent(tempEvent.value);
|
|
121
|
+
}
|
|
122
|
+
undoRedoStore.clearSnapshot();
|
|
123
|
+
undoRedoStore.addSnapshot(tempEvent);
|
|
124
|
+
snapshotLen.value = 1;
|
|
125
|
+
snapshotIndex.value = 0;
|
|
126
|
+
}
|
|
127
|
+
function tempSaveEvent() {
|
|
128
|
+
if (!tempEvent.value) {
|
|
129
|
+
ElMessageBox.confirm("编辑对象不存在,不需要保存!", "提示", {
|
|
130
|
+
confirmButtonText: "确定",
|
|
131
|
+
showCancelButton: false,
|
|
132
|
+
type: "error"
|
|
133
|
+
});
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
const pageDesign = pageDesignUtil.pageContext;
|
|
137
|
+
if (!pageDesign) {
|
|
138
|
+
ElMessageBox.confirm("页面设计对象不存在,不可保存!", "提示", {
|
|
139
|
+
confirmButtonText: "确定",
|
|
140
|
+
showCancelButton: false,
|
|
141
|
+
type: "error"
|
|
142
|
+
});
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
const validRes = validateBeforeSave();
|
|
146
|
+
if (validRes === false) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
if (!pageDesign.customEvents) {
|
|
150
|
+
pageDesign.customEvents = [];
|
|
151
|
+
}
|
|
152
|
+
const tempObj = tempEvent.value;
|
|
153
|
+
let hisEvent = null;
|
|
154
|
+
for (let e of pageDesign.customEvents) {
|
|
155
|
+
if (tempObj.name == "customFunc") {
|
|
156
|
+
if (e.uuid == tempObj.uuid) {
|
|
157
|
+
hisEvent = e;
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
if (e.componentUuid == tempObj.componentUuid && e.name == tempObj.name) {
|
|
162
|
+
hisEvent = e;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
if (hisEvent) {
|
|
168
|
+
Object.assign(hisEvent, tempObj);
|
|
169
|
+
} else {
|
|
170
|
+
Object.assign(editEvent.value, tempObj);
|
|
171
|
+
pageDesign.customEvents.push(editEvent.value);
|
|
172
|
+
}
|
|
173
|
+
editEvent.value = tempObj;
|
|
174
|
+
tempEvent.value = deepCopy(tempObj);
|
|
175
|
+
ElMessage({
|
|
176
|
+
message: "暂存成功!",
|
|
177
|
+
type: "success"
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function clearFunc() {
|
|
181
|
+
ElMessageBox.confirm("确定要清除吗?", "确认", {
|
|
182
|
+
confirmButtonText: "确定",
|
|
183
|
+
cancelButtonText: "取消",
|
|
184
|
+
type: "warning"
|
|
185
|
+
}).then(() => {
|
|
186
|
+
_clearFunc();
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function _clearFunc() {
|
|
190
|
+
if (tempEvent.value) {
|
|
191
|
+
deleteEvent(tempEvent.value);
|
|
192
|
+
}
|
|
193
|
+
_addCustomFunc();
|
|
194
|
+
}
|
|
195
|
+
function clearEventBus() {
|
|
196
|
+
console.log("unmounted---------------------");
|
|
197
|
+
eventBus.$off("clearEvent");
|
|
198
|
+
eventBus.$off("editEvent");
|
|
199
|
+
}
|
|
200
|
+
function bindEventBus() {
|
|
201
|
+
eventBus.$on("clearEvent", (event) => {
|
|
202
|
+
deleteEvent(event);
|
|
203
|
+
if (tempEvent.value) {
|
|
204
|
+
const tempObj = tempEvent.value;
|
|
205
|
+
if (event.name == "customFunc") {
|
|
206
|
+
if (event.uuid == tempObj.uuid) {
|
|
207
|
+
_addCustomFunc();
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
if (event.componentUuid == tempObj.componentUuid && event.name == tempObj.name) {
|
|
211
|
+
_addCustomFunc();
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
eventBus.$on("editEvent", (event) => {
|
|
217
|
+
let isSame = false;
|
|
218
|
+
if (tempEvent.value) {
|
|
219
|
+
if (event.name == "customFunc") {
|
|
220
|
+
if (tempEvent.value.uuid == event.uuid) {
|
|
221
|
+
isSame = true;
|
|
222
|
+
}
|
|
223
|
+
} else {
|
|
224
|
+
if (tempEvent.value.componentUuid == event.componentUuid && event.name == tempEvent.value.name) {
|
|
225
|
+
isSame = true;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (isSame) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (event.jsContent == void 0) {
|
|
233
|
+
event.jsContent = "";
|
|
234
|
+
}
|
|
235
|
+
if (event.isStandard == void 0) {
|
|
236
|
+
event.isStandard = false;
|
|
237
|
+
event.standardValues = [];
|
|
238
|
+
}
|
|
239
|
+
if (event.isStandard && !event.standardValues) {
|
|
240
|
+
event.standardValues = ["true"];
|
|
241
|
+
}
|
|
242
|
+
const hisStr = editEvent.value ? JSON.stringify(editEvent.value) : null;
|
|
243
|
+
const newStr = tempEvent.value ? JSON.stringify(tempEvent.value) : null;
|
|
244
|
+
if (hisStr && hisStr !== newStr) {
|
|
245
|
+
console.log("hisStr", hisStr, newStr);
|
|
246
|
+
ElMessageBox.confirm("当前方法有修改,是否需要暂存?", "确认", {
|
|
247
|
+
confirmButtonText: "确定",
|
|
248
|
+
cancelButtonText: "忽略",
|
|
249
|
+
type: "warning"
|
|
250
|
+
}).then(() => {
|
|
251
|
+
const res = tempSaveEvent();
|
|
252
|
+
if (res !== false) {
|
|
253
|
+
beginEditEvent(event);
|
|
254
|
+
}
|
|
255
|
+
}).catch((err) => {
|
|
256
|
+
beginEditEvent(event);
|
|
257
|
+
});
|
|
258
|
+
} else {
|
|
259
|
+
beginEditEvent(event);
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
function deleteEvent(event) {
|
|
264
|
+
const tempObj = event;
|
|
265
|
+
const pageDesign = pageDesignUtil.pageContext;
|
|
266
|
+
console.log("exist", tempObj, pageDesign.customEvents);
|
|
267
|
+
if (pageDesign && pageDesign.customEvents) {
|
|
268
|
+
for (let i = 0; i < pageDesign.customEvents.length; i++) {
|
|
269
|
+
let event2 = pageDesign.customEvents[i];
|
|
270
|
+
if (tempObj.name == "customFunc") {
|
|
271
|
+
if (tempObj.uuid == event2.uuid) {
|
|
272
|
+
pageDesign.customEvents.splice(i, 1);
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
} else {
|
|
276
|
+
if (event2.name == tempObj.name && tempObj.componentUuid == event2.componentUuid) {
|
|
277
|
+
event2.eventName = null;
|
|
278
|
+
event2.isStandard = false;
|
|
279
|
+
event2.jsContent = "";
|
|
280
|
+
event2.remark = "";
|
|
281
|
+
event2.standardValues = [];
|
|
282
|
+
pageDesign.customEvents.splice(i, 1);
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
function validateBeforeSave() {
|
|
290
|
+
const tempObj = tempEvent.value;
|
|
291
|
+
if (!tempObj.isStandard) {
|
|
292
|
+
if (!tempObj.jsContent) {
|
|
293
|
+
ElMessage({
|
|
294
|
+
message: "方法内容不能为空!",
|
|
295
|
+
type: "error"
|
|
296
|
+
});
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
if (tempObj.name == "customFunc") {
|
|
301
|
+
if (tempObj.eventName) {
|
|
302
|
+
tempObj.eventName = tempObj.eventName.trim();
|
|
303
|
+
}
|
|
304
|
+
const funcName = tempObj.eventName;
|
|
305
|
+
if (!funcName) {
|
|
306
|
+
ElMessage({
|
|
307
|
+
message: "方法名不能为空!",
|
|
308
|
+
type: "error"
|
|
309
|
+
});
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
const regex = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
|
|
313
|
+
if (!regex.test(funcName)) {
|
|
314
|
+
ElMessage({
|
|
315
|
+
message: "方法名只能以字母、下划线或$开头,只能包含数字、字母或$!",
|
|
316
|
+
type: "error"
|
|
317
|
+
});
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
if (tempObj.funcParam) {
|
|
321
|
+
tempObj.funcParam = tempObj.funcParam.trim().replace(",", ",");
|
|
322
|
+
}
|
|
323
|
+
const funcParam = tempObj.funcParam;
|
|
324
|
+
if (funcParam) {
|
|
325
|
+
const regex2 = /^([a-zA-Z_$][a-zA-Z0-9_$]*(?:,[a-zA-Z_$][a-zA-Z0-9_$]*)*)$/;
|
|
326
|
+
if (!regex2.test(funcParam)) {
|
|
327
|
+
ElMessage({
|
|
328
|
+
message: "方法参数只能以字母、下划线或$开头,只能包含数字、字母或$!",
|
|
329
|
+
type: "error"
|
|
330
|
+
});
|
|
331
|
+
return false;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
const pageDesign = pageDesignUtil.pageContext;
|
|
335
|
+
if (pageDesign && pageDesign.customEvents) {
|
|
336
|
+
for (let e of pageDesign.customEvents) {
|
|
337
|
+
if (e.name == "customFunc" && e.eventName == funcName && e.uuid != tempObj.uuid) {
|
|
338
|
+
ElMessage({
|
|
339
|
+
message: "存在相同的方法名!",
|
|
340
|
+
type: "error"
|
|
341
|
+
});
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
} else {
|
|
347
|
+
if (tempObj.isStandard && !tempObj.eventName) {
|
|
348
|
+
ElMessage({
|
|
349
|
+
message: "未指定标准功能!",
|
|
350
|
+
type: "error"
|
|
351
|
+
});
|
|
352
|
+
return false;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
let isUndoRedo = false;
|
|
357
|
+
watch(
|
|
358
|
+
() => tempEvent,
|
|
359
|
+
(newVal) => {
|
|
360
|
+
if (!isUndoRedo) {
|
|
361
|
+
undoRedoStore.addSnapshot(tempEvent, function() {
|
|
362
|
+
snapshotLen.value = undoRedoStore.getTotalLen();
|
|
363
|
+
snapshotIndex.value = undoRedoStore.getCurrentIndex();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{ deep: true }
|
|
368
|
+
);
|
|
369
|
+
function revocation() {
|
|
370
|
+
isUndoRedo = true;
|
|
371
|
+
undoRedoStore.undo(tempEvent);
|
|
372
|
+
snapshotLen.value = undoRedoStore.getTotalLen();
|
|
373
|
+
snapshotIndex.value = undoRedoStore.getCurrentIndex();
|
|
374
|
+
if (editorRef.value && editorRef.value.updateJsContent) {
|
|
375
|
+
editorRef.value.updateJsContent(tempEvent.value);
|
|
376
|
+
}
|
|
377
|
+
setTimeout(() => {
|
|
378
|
+
isUndoRedo = false;
|
|
379
|
+
}, 100);
|
|
380
|
+
}
|
|
381
|
+
function regain() {
|
|
382
|
+
isUndoRedo = true;
|
|
383
|
+
undoRedoStore.record(tempEvent);
|
|
384
|
+
snapshotLen.value = undoRedoStore.getTotalLen();
|
|
385
|
+
snapshotIndex.value = undoRedoStore.getCurrentIndex();
|
|
386
|
+
if (editorRef.value && editorRef.value.updateJsContent) {
|
|
387
|
+
editorRef.value.updateJsContent(tempEvent.value);
|
|
388
|
+
}
|
|
389
|
+
setTimeout(() => {
|
|
390
|
+
isUndoRedo = false;
|
|
391
|
+
}, 100);
|
|
392
|
+
}
|
|
393
|
+
function resize() {
|
|
394
|
+
if (editorRef.value && editorRef.value.resize) {
|
|
395
|
+
editorRef.value.resize();
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
__expose({ resize });
|
|
399
|
+
return (_ctx, _cache) => {
|
|
400
|
+
const _component_Plus = resolveComponent("Plus");
|
|
401
|
+
const _component_el_icon = resolveComponent("el-icon");
|
|
402
|
+
const _component_el_divider = resolveComponent("el-divider");
|
|
403
|
+
const _component_Check = resolveComponent("Check");
|
|
404
|
+
const _component_View = resolveComponent("View");
|
|
405
|
+
const _component_el_text = resolveComponent("el-text");
|
|
406
|
+
const _component_el_input = resolveComponent("el-input");
|
|
407
|
+
const _component_el_form_item = resolveComponent("el-form-item");
|
|
408
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
409
|
+
const _component_el_checkbox_group = resolveComponent("el-checkbox-group");
|
|
410
|
+
const _component_el_option = resolveComponent("el-option");
|
|
411
|
+
const _component_el_option_group = resolveComponent("el-option-group");
|
|
412
|
+
const _component_el_select = resolveComponent("el-select");
|
|
413
|
+
const _component_el_col = resolveComponent("el-col");
|
|
414
|
+
const _component_el_row = resolveComponent("el-row");
|
|
415
|
+
const _component_el_form = resolveComponent("el-form");
|
|
416
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
417
|
+
createElementVNode("div", _hoisted_2, [
|
|
418
|
+
createElementVNode("div", _hoisted_3, [
|
|
419
|
+
createElementVNode("label", {
|
|
420
|
+
class: "amb-page-type",
|
|
421
|
+
onClick: addCustomFunc
|
|
422
|
+
}, [
|
|
423
|
+
createVNode(_component_el_icon, { size: 18 }, {
|
|
424
|
+
default: withCtx(() => [
|
|
425
|
+
createVNode(_component_Plus)
|
|
426
|
+
]),
|
|
427
|
+
_: 1
|
|
428
|
+
}),
|
|
429
|
+
_hoisted_4
|
|
430
|
+
]),
|
|
431
|
+
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
432
|
+
withDirectives(createElementVNode("label", _hoisted_5, null, 512), [
|
|
433
|
+
[vShow, snapshotIndex.value < 1]
|
|
434
|
+
]),
|
|
435
|
+
withDirectives(createElementVNode("label", {
|
|
436
|
+
class: "amb-page-type",
|
|
437
|
+
style: { "margin-left": "0px" },
|
|
438
|
+
onClick: revocation
|
|
439
|
+
}, _hoisted_7, 512), [
|
|
440
|
+
[vShow, snapshotIndex.value > 0]
|
|
441
|
+
]),
|
|
442
|
+
withDirectives(createElementVNode("label", {
|
|
443
|
+
class: "amb-page-type",
|
|
444
|
+
onClick: regain
|
|
445
|
+
}, _hoisted_9, 512), [
|
|
446
|
+
[vShow, snapshotIndex.value > -1 && snapshotIndex.value + 1 < snapshotLen.value]
|
|
447
|
+
])
|
|
448
|
+
]),
|
|
449
|
+
withDirectives(createElementVNode("div", _hoisted_10, [
|
|
450
|
+
createElementVNode("label", {
|
|
451
|
+
class: "amb-page-type",
|
|
452
|
+
onClick: _cache[0] || (_cache[0] = ($event) => tempSaveEvent())
|
|
453
|
+
}, [
|
|
454
|
+
createVNode(_component_el_icon, { size: 18 }, {
|
|
455
|
+
default: withCtx(() => [
|
|
456
|
+
createVNode(_component_Check)
|
|
457
|
+
]),
|
|
458
|
+
_: 1
|
|
459
|
+
}),
|
|
460
|
+
_hoisted_11
|
|
461
|
+
]),
|
|
462
|
+
createVNode(_component_el_divider, { direction: "vertical" }),
|
|
463
|
+
createElementVNode("label", {
|
|
464
|
+
class: "amb-page-type",
|
|
465
|
+
style: { "margin-left": "0px" },
|
|
466
|
+
onClick: clearFunc
|
|
467
|
+
}, [
|
|
468
|
+
createVNode(_component_el_icon, { size: 18 }, {
|
|
469
|
+
default: withCtx(() => [
|
|
470
|
+
createVNode(_component_View)
|
|
471
|
+
]),
|
|
472
|
+
_: 1
|
|
473
|
+
}),
|
|
474
|
+
_hoisted_12
|
|
475
|
+
])
|
|
476
|
+
], 512), [
|
|
477
|
+
[vShow, tempEvent.value.name]
|
|
478
|
+
])
|
|
479
|
+
]),
|
|
480
|
+
createVNode(_component_el_form, {
|
|
481
|
+
class: "amb-design-board",
|
|
482
|
+
style: { "padding-top": "10px" },
|
|
483
|
+
ref: "form",
|
|
484
|
+
size: "small",
|
|
485
|
+
model: unref(myCustomEvent),
|
|
486
|
+
"inline-message": "",
|
|
487
|
+
"label-width": "80px"
|
|
488
|
+
}, {
|
|
489
|
+
default: withCtx(() => [
|
|
490
|
+
createVNode(_component_el_row, null, {
|
|
491
|
+
default: withCtx(() => [
|
|
492
|
+
createVNode(_component_el_form_item, {
|
|
493
|
+
label: "名称",
|
|
494
|
+
style: { "min-width": "280px" }
|
|
495
|
+
}, {
|
|
496
|
+
default: withCtx(() => [
|
|
497
|
+
withDirectives(createVNode(_component_el_text, { type: "primary" }, {
|
|
498
|
+
default: withCtx(() => [
|
|
499
|
+
createTextVNode(toDisplayString(tempEvent.value.title ? tempEvent.value.title + (tempEvent.value.componentLabel ? "(" + tempEvent.value.componentLabel + ")" : "") : tempEvent.value.componentLabel) + "." + toDisplayString(tempEvent.value.name), 1)
|
|
500
|
+
]),
|
|
501
|
+
_: 1
|
|
502
|
+
}, 512), [
|
|
503
|
+
[vShow, tempEvent.value.name && tempEvent.value.name != "customFunc"]
|
|
504
|
+
]),
|
|
505
|
+
withDirectives(createVNode(_component_el_input, {
|
|
506
|
+
modelValue: tempEvent.value.eventName,
|
|
507
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => tempEvent.value.eventName = $event),
|
|
508
|
+
title: "自定义方法名"
|
|
509
|
+
}, null, 8, ["modelValue"]), [
|
|
510
|
+
[vShow, tempEvent.value.name == "customFunc"]
|
|
511
|
+
])
|
|
512
|
+
]),
|
|
513
|
+
_: 1
|
|
514
|
+
}),
|
|
515
|
+
withDirectives(createVNode(_component_el_checkbox_group, {
|
|
516
|
+
modelValue: tempEvent.value.standardValues,
|
|
517
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => tempEvent.value.standardValues = $event),
|
|
518
|
+
onChange: standardChange
|
|
519
|
+
}, {
|
|
520
|
+
default: withCtx(() => [
|
|
521
|
+
createVNode(_component_el_checkbox, {
|
|
522
|
+
value: "true",
|
|
523
|
+
label: "标准功能"
|
|
524
|
+
})
|
|
525
|
+
]),
|
|
526
|
+
_: 1
|
|
527
|
+
}, 8, ["modelValue"]), [
|
|
528
|
+
[vShow, tempEvent.value.name != "customFunc"]
|
|
529
|
+
]),
|
|
530
|
+
withDirectives(createVNode(_component_el_select, {
|
|
531
|
+
disabled: !tempEvent.value.isStandard,
|
|
532
|
+
modelValue: tempEvent.value.eventName,
|
|
533
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => tempEvent.value.eventName = $event),
|
|
534
|
+
placeholder: "请选择",
|
|
535
|
+
filterable: "",
|
|
536
|
+
style: { "width": "240px", "margin-left": "10px" }
|
|
537
|
+
}, {
|
|
538
|
+
default: withCtx(() => [
|
|
539
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(standardEventOptions), (group) => {
|
|
540
|
+
return openBlock(), createBlock(_component_el_option_group, {
|
|
541
|
+
key: group.label,
|
|
542
|
+
label: group.label
|
|
543
|
+
}, {
|
|
544
|
+
default: withCtx(() => [
|
|
545
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(group.options, (item) => {
|
|
546
|
+
return openBlock(), createBlock(_component_el_option, {
|
|
547
|
+
key: item.value,
|
|
548
|
+
label: item.label,
|
|
549
|
+
value: item.value
|
|
550
|
+
}, null, 8, ["label", "value"]);
|
|
551
|
+
}), 128))
|
|
552
|
+
]),
|
|
553
|
+
_: 2
|
|
554
|
+
}, 1032, ["label"]);
|
|
555
|
+
}), 128))
|
|
556
|
+
]),
|
|
557
|
+
_: 1
|
|
558
|
+
}, 8, ["disabled", "modelValue"]), [
|
|
559
|
+
[vShow, tempEvent.value.name != "customFunc"]
|
|
560
|
+
]),
|
|
561
|
+
createVNode(_component_el_col, { span: 10 }, {
|
|
562
|
+
default: withCtx(() => [
|
|
563
|
+
createVNode(_component_el_form_item, { label: "描述" }, {
|
|
564
|
+
default: withCtx(() => [
|
|
565
|
+
createVNode(_component_el_input, {
|
|
566
|
+
modelValue: tempEvent.value.remark,
|
|
567
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => tempEvent.value.remark = $event)
|
|
568
|
+
}, null, 8, ["modelValue"])
|
|
569
|
+
]),
|
|
570
|
+
_: 1
|
|
571
|
+
})
|
|
572
|
+
]),
|
|
573
|
+
_: 1
|
|
574
|
+
})
|
|
575
|
+
]),
|
|
576
|
+
_: 1
|
|
577
|
+
}),
|
|
578
|
+
withDirectives(createElementVNode("div", _hoisted_13, [
|
|
579
|
+
createVNode(config, {
|
|
580
|
+
eventForm: tempEvent.value,
|
|
581
|
+
ref_key: "editorRef",
|
|
582
|
+
ref: editorRef
|
|
583
|
+
}, null, 8, ["eventForm"])
|
|
584
|
+
], 512), [
|
|
585
|
+
[vShow, tempEvent.value.name == "customFunc" || tempEvent.value.name != "customFunc" && !tempEvent.value.isStandard]
|
|
586
|
+
])
|
|
587
|
+
]),
|
|
588
|
+
_: 1
|
|
589
|
+
}, 8, ["model"])
|
|
590
|
+
]);
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
});
|
|
5
594
|
export {
|
|
6
|
-
|
|
595
|
+
_sfc_main as default
|
|
7
596
|
};
|