super-page-designer 2.0.23 → 2.0.26

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