eoss 0.1.0-alpha.24 → 0.1.0-alpha.25
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/lib/0.js +1 -1
- package/lib/1.js +1 -1
- package/lib/10.js +1 -1
- package/lib/11.js +1 -1
- package/lib/12.js +1 -1
- package/lib/13.js +1 -1
- package/lib/14.js +1 -1
- package/lib/15.js +1 -1
- package/lib/16.js +1 -1
- package/lib/17.js +1 -1
- package/lib/18.js +1 -1
- package/lib/19.js +1 -1
- package/lib/20.js +1 -1
- package/lib/21.js +1 -1
- package/lib/22.js +1 -1
- package/lib/23.js +1 -1
- package/lib/24.js +1 -1
- package/lib/25.js +1 -1
- package/lib/26.js +1 -1
- package/lib/27.js +1 -1
- package/lib/28.js +1 -1
- package/lib/29.js +1 -1
- package/lib/3.js +1 -1
- package/lib/30.js +1 -1
- package/lib/31.js +1 -1
- package/lib/32.js +1 -1
- package/lib/33.js +1 -1
- package/lib/34.js +1 -1
- package/lib/35.js +1 -1
- package/lib/36.js +1 -1
- package/lib/37.js +1 -1
- package/lib/38.js +1 -1
- package/lib/39.js +1 -1
- package/lib/4.js +1 -1
- package/lib/40.js +1 -1
- package/lib/41.js +1 -1
- package/lib/42.js +1 -1
- package/lib/43.js +1 -1
- package/lib/44.js +1 -1
- package/lib/45.js +1 -1
- package/lib/46.js +1 -1
- package/lib/47.js +1 -1
- package/lib/48.js +1 -1
- package/lib/49.js +1 -1
- package/lib/5.js +1 -1
- package/lib/50.js +1 -1
- package/lib/51.js +1 -1
- package/lib/52.js +1 -1
- package/lib/53.js +1 -1
- package/lib/54.js +1 -1
- package/lib/55.js +1 -1
- package/lib/56.js +1 -1
- package/lib/57.js +1 -1
- package/lib/58.js +1 -1
- package/lib/59.js +1 -1
- package/lib/6.js +1 -1
- package/lib/60.js +1 -1
- package/lib/61.js +1 -1
- package/lib/62.js +1 -1
- package/lib/63.js +1 -1
- package/lib/64.js +1 -1
- package/lib/65.js +1 -1
- package/lib/66.js +1 -1
- package/lib/67.js +1 -1
- package/lib/68.js +1 -1
- package/lib/69.js +1 -1
- package/lib/7.js +1 -1
- package/lib/70.js +1 -1
- package/lib/71.js +1 -1
- package/lib/72.js +1 -1
- package/lib/73.js +1 -1
- package/lib/74.js +1 -1
- package/lib/75.js +1 -1
- package/lib/76.js +1 -1
- package/lib/77.js +1 -1
- package/lib/78.js +1 -1
- package/lib/79.js +1 -1
- package/lib/8.js +1 -1
- package/lib/80.js +1 -1
- package/lib/81.js +1 -1
- package/lib/9.js +1 -1
- package/lib/account-login.js +1455 -1367
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +924 -0
- package/lib/autocomplete.js +2306 -2491
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +2 -2
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +2 -2
- package/lib/breadcrumb.js +2 -2
- package/lib/button-group.js +13 -13
- package/lib/button.js +2 -2
- package/lib/ca-login.js +1375 -1400
- package/lib/calendar.js +972 -997
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +1300 -1325
- package/lib/carousel.js +1218 -1243
- package/lib/cascader-panel.js +2442 -2467
- package/lib/cascader.js +2873 -3058
- package/lib/checkbox-button.js +2 -2
- package/lib/checkbox-group.js +1669 -1614
- package/lib/checkbox.js +9 -42
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +2471 -2602
- package/lib/collapse.js +2475 -2602
- package/lib/color-picker.js +955 -1115
- package/lib/config/api.js +77 -1
- package/lib/container.js +2 -2
- package/lib/cron.js +2 -2
- package/lib/data-table.js +2050 -1952
- package/lib/date-picker.js +2882 -3067
- package/lib/dialog.js +1638 -1661
- package/lib/divider.js +2 -2
- package/lib/drawer.js +4 -4
- package/lib/dropdown-item.js +2 -2
- package/lib/dropdown-menu.js +944 -1104
- package/lib/dropdown.js +1529 -1554
- package/lib/email-login.js +1572 -1484
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +12000 -5745
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +1297 -1322
- package/lib/flow.js +1922 -1834
- package/lib/flows.js +1461 -1373
- package/lib/footer.js +2 -2
- package/lib/form-item.js +1887 -1912
- package/lib/form.js +2494 -2616
- package/lib/header.js +2 -2
- package/lib/icon.js +1526 -1438
- package/lib/icons.js +2 -2
- package/lib/image-viewer.js +1253 -1278
- package/lib/image.js +71 -71
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +71 -71
- package/lib/input-number.js +4 -4
- package/lib/input.js +1355 -1380
- package/lib/link.js +2 -2
- package/lib/loading.js +5 -5
- package/lib/login.js +3111 -3010
- package/lib/lowcode.js +9296 -5835
- package/lib/main.js +4863 -4775
- package/lib/marquee.js +1297 -1322
- package/lib/menu-item-group.js +2 -2
- package/lib/menu-item.js +2 -2
- package/lib/menu.js +2935 -3120
- package/lib/message-box.js +1724 -1749
- package/lib/message.js +1258 -1283
- package/lib/notification.js +1907 -1932
- package/lib/option-group.js +2 -2
- package/lib/option.js +1260 -1285
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +1587 -1612
- package/lib/phone-login.js +1562 -1474
- package/lib/popconfirm.js +12 -12
- package/lib/popover.js +3252 -3437
- package/lib/process-config.js +7645 -0
- package/lib/process-module.js +7051 -0
- package/lib/process-rule.js +8217 -0
- package/lib/progress.js +2 -2
- package/lib/qr-code.js +7 -7
- package/lib/qrcode-login.js +1561 -1473
- package/lib/radio-button.js +10 -21
- package/lib/radio-group.js +1691 -1632
- package/lib/radio.js +10 -25
- package/lib/rate.js +1377 -1402
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +1491 -1516
- package/lib/select.js +3481 -3552
- package/lib/selector-panel.js +1791 -1765
- package/lib/selector.js +1856 -1778
- package/lib/slider.js +2 -2
- package/lib/step.js +2475 -2602
- package/lib/steps.js +1292 -1317
- package/lib/submenu.js +1454 -1614
- package/lib/switch.js +1333 -1358
- package/lib/tab-pane.js +2 -2
- package/lib/table-column.js +1293 -1318
- package/lib/table.js +3951 -4023
- package/lib/tabs.js +2334 -2359
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/audit-trajectory.css +0 -0
- package/lib/theme-chalk/button-group.css +1 -1
- package/lib/theme-chalk/calendar.css +1 -1
- package/lib/theme-chalk/icons.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -1
- package/lib/theme-chalk/process-config.css +0 -0
- package/lib/theme-chalk/process-module.css +0 -0
- package/lib/theme-chalk/process-rule.css +1 -0
- package/lib/theme-chalk/tree.css +1 -1
- package/lib/theme-chalk/update-history.css +0 -0
- package/lib/time-picker.js +1953 -2138
- package/lib/time-select.js +1949 -2134
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +1496 -1408
- package/lib/toolbar.js +6 -6
- package/lib/tooltip.js +2730 -2915
- package/lib/transfer.js +1350 -1375
- package/lib/tree-group.js +1524 -1436
- package/lib/tree.js +1843 -1755
- package/lib/update-history.js +879 -0
- package/lib/upload.js +2375 -2287
- package/lib/utils/ajax.js +3 -5
- package/package.json +1 -1
- package/packages/audit-trajectory/index.js +5 -0
- package/packages/audit-trajectory/src/main.vue +99 -0
- package/packages/button/src/button-group.vue +1 -1
- package/packages/checkbox/src/checkbox.vue +9 -14
- package/packages/data-table/src/data-table.vue +13 -4
- package/packages/dialog/src/dialog.vue +2 -0
- package/packages/form/src/form-item-render.vue +4 -0
- package/packages/form/src/form.vue +2 -2
- package/packages/login/src/login.vue +47 -46
- package/packages/lowcode/src/aside.vue +3 -1
- package/packages/lowcode/src/attribute/bind.vue +449 -236
- package/packages/lowcode/src/attribute/dependency.vue +487 -267
- package/packages/lowcode/src/attribute/function.vue +391 -51
- package/packages/lowcode/src/attribute/javascript.vue +311 -0
- package/packages/lowcode/src/attribute/property.vue +269 -166
- package/packages/lowcode/src/attribute/styles.vue +11 -4
- package/packages/lowcode/src/attribute.vue +684 -46
- package/packages/lowcode/src/canvas.vue +199 -24
- package/packages/lowcode/src/editor.vue +15 -2
- package/packages/lowcode/src/lowcode.vue +205 -17
- package/packages/lowcode/src/mixins/history.js +132 -0
- package/packages/lowcode/src/pages.vue +0 -52
- package/packages/lowcode/src/render.vue +87 -4
- package/packages/lowcode/src/source.vue +12 -5
- package/packages/lowcode/src/toolbar.vue +43 -20
- package/packages/lowcode/src/util/source-generator.js +535 -0
- package/packages/lowcode/src/{source-parser.js → util/source-parser.js} +86 -32
- package/packages/lowcode/src/view.vue +187 -0
- package/packages/lowcode-view/index.js +5 -0
- package/packages/process-config/index.js +5 -0
- package/packages/process-config/src/FormList.vue +180 -0
- package/packages/process-config/src/NodeConfig.vue +212 -0
- package/packages/process-config/src/NodeForm.vue +237 -0
- package/packages/process-config/src/main.vue +257 -0
- package/packages/process-module/index.js +5 -0
- package/packages/process-module/src/FormList.vue +177 -0
- package/packages/process-module/src/main.vue +233 -0
- package/packages/process-rule/index.js +5 -0
- package/packages/process-rule/src/FormList.vue +614 -0
- package/packages/process-rule/src/companyReportDetail.vue +92 -0
- package/packages/process-rule/src/main.vue +749 -0
- package/packages/radio/src/radio-button.vue +12 -9
- package/packages/radio/src/radio-group.vue +10 -14
- package/packages/radio/src/radio.vue +12 -11
- package/packages/select/src/option-tree.vue +4 -4
- package/packages/select/src/option.vue +2 -2
- package/packages/select/src/select.vue +32 -36
- package/packages/selector/src/selector.vue +10 -12
- package/packages/theme-chalk/src/audit-trajectory.scss +0 -0
- package/packages/theme-chalk/src/button-group.scss +7 -0
- package/packages/theme-chalk/src/icons.scss +1 -1
- package/packages/theme-chalk/src/index.scss +5 -0
- package/packages/theme-chalk/src/lowcode.scss +48 -1
- package/packages/theme-chalk/src/process-config.scss +0 -0
- package/packages/theme-chalk/src/process-module.scss +0 -0
- package/packages/theme-chalk/src/process-rule.scss +57 -0
- package/packages/theme-chalk/src/tree.scss +1 -0
- package/packages/theme-chalk/src/update-history.scss +0 -0
- package/packages/update-history/index.js +5 -0
- package/packages/update-history/src/main.vue +54 -0
- package/src/components/field-render.vue +5 -0
- package/src/config/api.js +77 -0
- package/src/index.js +322 -307
- package/src/utils/ajax.js +2 -2
- package/packages/lowcode/src/source-generator.js +0 -316
- /package/packages/lowcode/src/{json-repair.js → util/json-repair.js} +0 -0
- /package/packages/lowcode/src/{monaco-vue-completions.js → util/monaco-vue-completions.js} +0 -0
|
@@ -2,17 +2,30 @@
|
|
|
2
2
|
<div :style="newNode.style" :data-id="newNode.id" @click.stop="handleClick">
|
|
3
3
|
<component
|
|
4
4
|
:is="newNode.name"
|
|
5
|
-
v-bind="
|
|
5
|
+
v-bind="cleanProps"
|
|
6
6
|
v-on="newNode.events"
|
|
7
7
|
:key="newNode.id"
|
|
8
|
+
v-text="resolvedText"
|
|
9
|
+
v-show="
|
|
10
|
+
newNode.directives['show'] !== undefined
|
|
11
|
+
? newNode.directives['show']
|
|
12
|
+
: true
|
|
13
|
+
"
|
|
8
14
|
>
|
|
9
15
|
<template v-if="newNode.children && newNode.children.length > 0">
|
|
10
16
|
<Render
|
|
11
17
|
v-for="child in newNode.children"
|
|
12
18
|
:key="child.id"
|
|
13
19
|
:node="child"
|
|
20
|
+
:page="page"
|
|
14
21
|
/>
|
|
15
22
|
</template>
|
|
23
|
+
<template v-else-if="newNode.directives['text']">
|
|
24
|
+
<!-- v-text 已经通过组件的 v-text 属性渲染 -->
|
|
25
|
+
</template>
|
|
26
|
+
<template v-else-if="newNode.template">
|
|
27
|
+
<div v-html="renderTemplate(newNode.template)"></div>
|
|
28
|
+
</template>
|
|
16
29
|
<template v-else>
|
|
17
30
|
{{ newNode.description }}
|
|
18
31
|
</template>
|
|
@@ -75,6 +88,10 @@ export default {
|
|
|
75
88
|
type: Object,
|
|
76
89
|
default: null
|
|
77
90
|
},
|
|
91
|
+
page: {
|
|
92
|
+
type: Object,
|
|
93
|
+
default: null
|
|
94
|
+
},
|
|
78
95
|
active: {
|
|
79
96
|
type: String,
|
|
80
97
|
default: ''
|
|
@@ -85,8 +102,11 @@ export default {
|
|
|
85
102
|
}
|
|
86
103
|
},
|
|
87
104
|
data() {
|
|
105
|
+
const newNode = JSON.parse(JSON.stringify(this.node)) || {};
|
|
106
|
+
// directives 在页面结构上已定义,这里兼容子节点未携带的情况
|
|
107
|
+
newNode.directives = newNode.directives || {};
|
|
88
108
|
return {
|
|
89
|
-
newNode
|
|
109
|
+
newNode,
|
|
90
110
|
resizingComponent: null,
|
|
91
111
|
initialMouseX: 0,
|
|
92
112
|
initialMouseY: 0,
|
|
@@ -102,11 +122,61 @@ export default {
|
|
|
102
122
|
watch: {
|
|
103
123
|
node: {
|
|
104
124
|
handler(newVal) {
|
|
105
|
-
|
|
125
|
+
const node = JSON.parse(JSON.stringify(newVal)) || {};
|
|
126
|
+
node.directives = node.directives || {};
|
|
127
|
+
this.newNode = node;
|
|
106
128
|
},
|
|
107
129
|
deep: true
|
|
108
130
|
}
|
|
109
131
|
},
|
|
132
|
+
computed: {
|
|
133
|
+
/**
|
|
134
|
+
* 解析 text 指令中的表达式
|
|
135
|
+
* 支持 {{variable}} 形式,从 page.data 中获取值
|
|
136
|
+
*/
|
|
137
|
+
resolvedText() {
|
|
138
|
+
const textExpr =
|
|
139
|
+
this.newNode.directives && this.newNode.directives['text'];
|
|
140
|
+
if (!textExpr) return '';
|
|
141
|
+
// 如果是表达式(不含空格,可能是变量名),尝试从 data 中获取值
|
|
142
|
+
if (
|
|
143
|
+
typeof textExpr === 'string' &&
|
|
144
|
+
!textExpr.includes(' ') &&
|
|
145
|
+
!textExpr.includes("'") &&
|
|
146
|
+
!textExpr.includes('"')
|
|
147
|
+
) {
|
|
148
|
+
// 尝试从 page.data 中获取值
|
|
149
|
+
if (
|
|
150
|
+
this.page &&
|
|
151
|
+
this.page.data &&
|
|
152
|
+
this.page.data[textExpr] !== undefined
|
|
153
|
+
) {
|
|
154
|
+
return this.page.data[textExpr];
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return textExpr;
|
|
158
|
+
},
|
|
159
|
+
/**
|
|
160
|
+
* 过滤掉 Vue 指令(v-xxx)的 props,避免它们作为普通属性传递给组件
|
|
161
|
+
* 指令统一存在 directives 字段,这里仅兼容历史数据中混入 props 的 v- 键
|
|
162
|
+
*/
|
|
163
|
+
cleanProps() {
|
|
164
|
+
if (!this.newNode) return {};
|
|
165
|
+
const result = {};
|
|
166
|
+
// 合并 HTML 属性
|
|
167
|
+
if (this.newNode.attrs) {
|
|
168
|
+
Object.assign(result, this.newNode.attrs);
|
|
169
|
+
}
|
|
170
|
+
// 合并组件 props(跳过 Vue 指令)
|
|
171
|
+
if (this.newNode.props) {
|
|
172
|
+
Object.keys(this.newNode.props).forEach((key) => {
|
|
173
|
+
if (key.startsWith('v-')) return;
|
|
174
|
+
result[key] = this.newNode.props[key];
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
},
|
|
110
180
|
mounted() {},
|
|
111
181
|
beforeDestroy() {},
|
|
112
182
|
methods: {
|
|
@@ -251,13 +321,26 @@ export default {
|
|
|
251
321
|
if (this.isResizing) {
|
|
252
322
|
return;
|
|
253
323
|
}
|
|
254
|
-
this.$emit('click');
|
|
324
|
+
this.$emit('click', this.newNode);
|
|
255
325
|
},
|
|
256
326
|
/**
|
|
257
327
|
* 处理组件删除事件
|
|
258
328
|
*/
|
|
259
329
|
handleRemove() {
|
|
260
330
|
this.$emit('remove');
|
|
331
|
+
},
|
|
332
|
+
/**
|
|
333
|
+
* 渲染模板内容
|
|
334
|
+
* @param {String} template - 模板字符串(可能包含 <template> 标签)
|
|
335
|
+
* @returns {String} 处理后的 HTML 内容
|
|
336
|
+
*/
|
|
337
|
+
renderTemplate(template) {
|
|
338
|
+
if (!template) return '';
|
|
339
|
+
// 提取 <template> 标签内的内容
|
|
340
|
+
const match = template.match(/<template>([\s\S]*?)<\/template>/);
|
|
341
|
+
const content = match ? match[1] : template;
|
|
342
|
+
// 返回原始 HTML(Vue 模板表达式如 {{id}} 会原样显示)
|
|
343
|
+
return content.trim();
|
|
261
344
|
}
|
|
262
345
|
}
|
|
263
346
|
};
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<script>
|
|
12
12
|
import editor from './editor.vue';
|
|
13
|
-
import { generateVueSource } from './source-generator';
|
|
14
|
-
import { parseVueSource } from './source-parser';
|
|
13
|
+
import { generateVueSource } from './util/source-generator';
|
|
14
|
+
import { parseVueSource } from './util/source-parser';
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
name: 'Source',
|
|
@@ -31,16 +31,23 @@ export default {
|
|
|
31
31
|
data() {
|
|
32
32
|
return {
|
|
33
33
|
// 编辑器内容,随页面实时生成
|
|
34
|
-
source:
|
|
34
|
+
source: ''
|
|
35
35
|
};
|
|
36
36
|
},
|
|
37
37
|
|
|
38
|
+
mounted() {
|
|
39
|
+
// 在 mounted 中初始化源码,确保 page prop 已正确设置
|
|
40
|
+
this.refreshSource();
|
|
41
|
+
},
|
|
42
|
+
|
|
38
43
|
watch: {
|
|
39
44
|
// 页面变化(画布操作、外部更新)时重新生成源码
|
|
40
45
|
page: {
|
|
41
46
|
deep: true,
|
|
42
|
-
handler() {
|
|
43
|
-
|
|
47
|
+
handler(newPage) {
|
|
48
|
+
if (newPage) {
|
|
49
|
+
this.refreshSource();
|
|
50
|
+
}
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
53
|
},
|
|
@@ -24,23 +24,25 @@
|
|
|
24
24
|
</es-button>
|
|
25
25
|
</es-button-group>
|
|
26
26
|
<div class="es-lowcode__toolbar--size" v-show="activeTool === 'custom'">
|
|
27
|
-
<es-input
|
|
27
|
+
<es-input
|
|
28
|
+
v-model="width"
|
|
29
|
+
size="small"
|
|
30
|
+
placeholder="请输入宽度"
|
|
31
|
+
@change="handleChangeSize"
|
|
32
|
+
/>
|
|
28
33
|
<span class="es-lowcode__toolbar--size-split">x</span>
|
|
29
|
-
<es-input
|
|
34
|
+
<es-input
|
|
35
|
+
v-model="height"
|
|
36
|
+
size="small"
|
|
37
|
+
placeholder="请输入高度"
|
|
38
|
+
@change="handleChangeSize"
|
|
39
|
+
/>
|
|
30
40
|
</div>
|
|
31
41
|
<es-button-group>
|
|
32
|
-
<es-button
|
|
33
|
-
size="small"
|
|
34
|
-
:disabled="isUndoDisabled"
|
|
35
|
-
@click="handleClick('repeal')"
|
|
36
|
-
>
|
|
42
|
+
<es-button size="small" :disabled="isUndoDisabled" @click="handleUndo">
|
|
37
43
|
<i class="es-icon-chehui"></i>
|
|
38
44
|
</es-button>
|
|
39
|
-
<es-button
|
|
40
|
-
size="small"
|
|
41
|
-
:disabled="isRedoDisabled"
|
|
42
|
-
@click="handleClick('advance')"
|
|
43
|
-
>
|
|
45
|
+
<es-button size="small" :disabled="isRedoDisabled" @click="handleRedo">
|
|
44
46
|
<i class="es-icon-qianjin"></i>
|
|
45
47
|
</es-button>
|
|
46
48
|
</es-button-group>
|
|
@@ -85,7 +87,7 @@
|
|
|
85
87
|
</template>
|
|
86
88
|
|
|
87
89
|
<script>
|
|
88
|
-
import bus from 'eoss/src/utils/bus.js'
|
|
90
|
+
import bus from 'eoss/src/utils/bus.js';
|
|
89
91
|
import Button from 'eoss/packages/button';
|
|
90
92
|
import ButtonGroup from 'eoss/packages/button-group';
|
|
91
93
|
import Dropdown from 'eoss/packages/dropdown';
|
|
@@ -104,6 +106,8 @@ export default {
|
|
|
104
106
|
Icon
|
|
105
107
|
},
|
|
106
108
|
|
|
109
|
+
inject: ['lowcode'],
|
|
110
|
+
|
|
107
111
|
props: {},
|
|
108
112
|
|
|
109
113
|
data() {
|
|
@@ -111,13 +115,18 @@ export default {
|
|
|
111
115
|
activeTool: 'web',
|
|
112
116
|
activeTab: 'design',
|
|
113
117
|
width: 300,
|
|
114
|
-
height: 200
|
|
115
|
-
isUndoDisabled: true,
|
|
116
|
-
isRedoDisabled: true
|
|
118
|
+
height: 200
|
|
117
119
|
};
|
|
118
120
|
},
|
|
119
121
|
|
|
120
|
-
computed: {
|
|
122
|
+
computed: {
|
|
123
|
+
isUndoDisabled() {
|
|
124
|
+
return !this.lowcode.canUndo;
|
|
125
|
+
},
|
|
126
|
+
isRedoDisabled() {
|
|
127
|
+
return !this.lowcode.canRedo;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
121
130
|
|
|
122
131
|
watch: {},
|
|
123
132
|
|
|
@@ -128,10 +137,24 @@ export default {
|
|
|
128
137
|
methods: {
|
|
129
138
|
handleClick(tool) {
|
|
130
139
|
this.activeTool = tool;
|
|
131
|
-
bus.$emit('changeSize', tool, {
|
|
140
|
+
bus.$emit('changeSize', tool, {
|
|
141
|
+
width: `${this.width}px`,
|
|
142
|
+
height: `${this.height}px`
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
/** 撤销 */
|
|
146
|
+
handleUndo() {
|
|
147
|
+
this.lowcode.undo();
|
|
148
|
+
},
|
|
149
|
+
/** 重做 */
|
|
150
|
+
handleRedo() {
|
|
151
|
+
this.lowcode.redo();
|
|
132
152
|
},
|
|
133
153
|
handleChangeSize() {
|
|
134
|
-
bus.$emit('changeSize', this.activeTool, {
|
|
154
|
+
bus.$emit('changeSize', this.activeTool, {
|
|
155
|
+
width: `${this.width}px`,
|
|
156
|
+
height: `${this.height}px`
|
|
157
|
+
});
|
|
135
158
|
},
|
|
136
159
|
handleOpen(type) {
|
|
137
160
|
bus.$emit('open', type);
|
|
@@ -141,7 +164,7 @@ export default {
|
|
|
141
164
|
},
|
|
142
165
|
handlePreview() {
|
|
143
166
|
bus.$emit('preview');
|
|
144
|
-
}
|
|
167
|
+
}
|
|
145
168
|
}
|
|
146
169
|
};
|
|
147
170
|
</script>
|