eoss 0.1.0-alpha.39 → 0.1.0-alpha.40
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 +837 -862
- package/lib/alert.js +2 -2
- package/lib/aside.js +2 -2
- package/lib/audit-trajectory.js +4 -4
- package/lib/autocomplete.js +1813 -1988
- package/lib/avatar.js +2 -2
- package/lib/backtop.js +2 -2
- package/lib/badge.js +2 -2
- package/lib/breadcrumb-item.js +4 -4
- package/lib/breadcrumb.js +4 -4
- package/lib/button-group.js +4 -4
- package/lib/button.js +2 -2
- package/lib/ca-login.js +837 -862
- package/lib/calendar.js +839 -864
- package/lib/card.js +2 -2
- package/lib/carousel-item.js +846 -871
- package/lib/carousel.js +839 -864
- package/lib/cascader-panel.js +852 -877
- package/lib/cascader.js +2048 -2223
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +859 -884
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +1040 -1065
- package/lib/collapse.js +1040 -1065
- package/lib/color-picker.js +972 -1122
- package/lib/container.js +2 -2
- package/lib/cron.js +12 -12
- package/lib/data-table.js +843 -868
- package/lib/date-picker.js +10520 -10695
- package/lib/descriptions-item.js +4 -4
- package/lib/descriptions.js +4 -4
- package/lib/dialog.js +837 -862
- package/lib/divider.js +2 -2
- package/lib/drawer.js +2 -2
- package/lib/dropdown-item.js +4 -4
- package/lib/dropdown-menu.js +974 -1124
- package/lib/dropdown.js +841 -866
- package/lib/email-login.js +837 -862
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +4023 -2668
- package/lib/flip.js +2 -2
- package/lib/flow-group.js +853 -878
- package/lib/flow.js +868 -893
- package/lib/flows.js +854 -879
- package/lib/footer.js +2 -2
- package/lib/form-item.js +860 -885
- package/lib/form.js +933 -950
- package/lib/guide.js +2 -2
- package/lib/header.js +2 -2
- package/lib/icon.js +837 -862
- package/lib/icons.js +2 -2
- package/lib/image-viewer.js +837 -862
- package/lib/image.js +4 -4
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +2 -2
- package/lib/input-number.js +6 -6
- package/lib/input.js +839 -864
- package/lib/link.js +2 -2
- package/lib/loading.js +2 -2
- package/lib/login.js +867 -891
- package/lib/lowcode-view.js +1843 -1185
- package/lib/lowcode.js +3050 -1569
- package/lib/main.js +970 -988
- package/lib/marquee.js +837 -862
- package/lib/menu-item-group.js +15 -15
- package/lib/menu-item.js +6 -6
- package/lib/menu.js +2227 -2368
- package/lib/message-box.js +843 -868
- package/lib/message.js +839 -864
- package/lib/notification.js +861 -886
- package/lib/option-group.js +4 -4
- package/lib/option.js +839 -864
- package/lib/page-header.js +2 -2
- package/lib/pagination.js +839 -864
- package/lib/phone-login.js +847 -866
- package/lib/popconfirm.js +4 -4
- package/lib/popover.js +1831 -2006
- package/lib/process-config.js +839 -864
- package/lib/process-module.js +846 -871
- package/lib/process-rule.js +905 -930
- package/lib/progress.js +2 -2
- package/lib/qr-code.js +4 -4
- package/lib/qrcode-login.js +839 -864
- package/lib/radio-button.js +4 -4
- package/lib/radio-group.js +850 -875
- package/lib/radio.js +4 -4
- package/lib/rate.js +837 -862
- package/lib/retrial-auth.js +837 -862
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +839 -864
- package/lib/select.js +2139 -2314
- package/lib/selector-panel.js +940 -965
- package/lib/selector.js +852 -877
- package/lib/slider.js +4 -4
- package/lib/step.js +32 -32
- package/lib/steps.js +874 -899
- package/lib/submenu.js +1269 -1385
- package/lib/switch.js +839 -864
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +840 -865
- package/lib/table.js +1825 -2000
- package/lib/tabs.js +846 -871
- package/lib/tag.js +2 -2
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -1
- package/lib/time-picker.js +6471 -6646
- package/lib/time-select.js +5039 -5214
- package/lib/timeline-item.js +2 -2
- package/lib/timeline.js +2 -2
- package/lib/tips.js +837 -862
- package/lib/toolbar.js +4 -4
- package/lib/tooltip.js +1813 -1988
- package/lib/transfer.js +837 -862
- package/lib/tree-group.js +853 -878
- package/lib/tree.js +1026 -1051
- package/lib/update-history.js +4 -4
- package/lib/upload.js +859 -884
- package/lib/wujie.js +841 -866
- package/package.json +1 -1
- package/packages/flow-group/src/main.vue +2 -2
- package/packages/form/src/form-item-render.vue +1 -0
- package/packages/form/src/form-item.vue +12 -6
- package/packages/form/src/form.vue +5 -5
- package/packages/login/src/login.vue +1 -0
- package/packages/lowcode/src/attribute/function.vue +28 -9
- package/packages/lowcode/src/attribute/props.vue +202 -0
- package/packages/lowcode/src/attribute/styles.vue +79 -5
- package/packages/lowcode/src/attribute.vue +61 -4
- package/packages/lowcode/src/canvas.vue +159 -2
- package/packages/lowcode/src/form-render.vue +305 -0
- package/packages/lowcode/src/lowcode.vue +33 -13
- package/packages/lowcode/src/modules.vue +53 -37
- package/packages/lowcode/src/render.vue +80 -25
- package/packages/lowcode/src/util/components.js +100 -0
- package/packages/lowcode/src/util/props-util.js +67 -0
- package/packages/lowcode/src/util/source-generator.js +69 -9
- package/packages/lowcode/src/util/source-parser.js +64 -10
- package/packages/lowcode-view/src/render.vue +48 -18
- package/packages/main/src/components/userinfo.vue +0 -1
- package/packages/menu/src/menu-item-group.vue +1 -1
- package/packages/menu/src/mixins.js +8 -4
- package/packages/menu/src/submenu.vue +35 -5
- package/packages/phone-login/src/phone-login.vue +5 -2
- package/packages/theme-chalk/dist/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/dist/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.ttf +0 -0
- package/packages/theme-chalk/src/fonts/iconfont.woff +0 -0
- package/packages/theme-chalk/src/lowcode.scss +21 -2
- package/src/index.js +336 -336
|
@@ -6,22 +6,39 @@
|
|
|
6
6
|
lazy
|
|
7
7
|
v-for="(items, index) in contents"
|
|
8
8
|
:key="items.name"
|
|
9
|
+
v-show="items.children && items.children.length"
|
|
9
10
|
>
|
|
10
|
-
<es-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<es-collapse-item
|
|
16
|
-
:title="item.label"
|
|
17
|
-
class="es-lowcode__modules--content"
|
|
18
|
-
v-for="item in items.children"
|
|
19
|
-
:name="item.name"
|
|
20
|
-
:key="item.name"
|
|
11
|
+
<es-scrollbar>
|
|
12
|
+
<es-collapse
|
|
13
|
+
v-model="actives"
|
|
14
|
+
v-show="items.children.length"
|
|
15
|
+
v-if="items.collapse"
|
|
21
16
|
>
|
|
17
|
+
<es-collapse-item
|
|
18
|
+
:title="item.label"
|
|
19
|
+
class="es-lowcode__modules--content"
|
|
20
|
+
v-for="item in items.children"
|
|
21
|
+
:name="item.label"
|
|
22
|
+
:key="item.label"
|
|
23
|
+
>
|
|
24
|
+
<div
|
|
25
|
+
class="es-lowcode__modules--item"
|
|
26
|
+
v-for="ele in item.children"
|
|
27
|
+
:key="ele.name"
|
|
28
|
+
draggable="true"
|
|
29
|
+
@dragstart="handleDragStart($event, ele)"
|
|
30
|
+
>
|
|
31
|
+
<span class="es-lowcode__modules--item-dom">{{ ele.name }}</span>
|
|
32
|
+
<span class="es-lowcode__modules--item-desc">{{
|
|
33
|
+
ele.description
|
|
34
|
+
}}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</es-collapse-item>
|
|
37
|
+
</es-collapse>
|
|
38
|
+
<div v-else class="es-lowcode__modules--contents">
|
|
22
39
|
<div
|
|
23
40
|
class="es-lowcode__modules--item"
|
|
24
|
-
v-for="ele in
|
|
41
|
+
v-for="ele in items.children"
|
|
25
42
|
:key="ele.name"
|
|
26
43
|
draggable="true"
|
|
27
44
|
@dragstart="handleDragStart($event, ele)"
|
|
@@ -31,22 +48,8 @@
|
|
|
31
48
|
ele.description
|
|
32
49
|
}}</span>
|
|
33
50
|
</div>
|
|
34
|
-
</es-collapse-item>
|
|
35
|
-
</es-collapse>
|
|
36
|
-
<div v-else class="es-lowcode__modules--contents">
|
|
37
|
-
<div
|
|
38
|
-
class="es-lowcode__modules--item"
|
|
39
|
-
v-for="ele in items.children"
|
|
40
|
-
:key="ele.name"
|
|
41
|
-
draggable="true"
|
|
42
|
-
@dragstart="handleDragStart($event, ele)"
|
|
43
|
-
>
|
|
44
|
-
<span class="es-lowcode__modules--item-dom">{{ ele.name }}</span>
|
|
45
|
-
<span class="es-lowcode__modules--item-desc">{{
|
|
46
|
-
ele.description
|
|
47
|
-
}}</span>
|
|
48
51
|
</div>
|
|
49
|
-
</
|
|
52
|
+
</es-scrollbar>
|
|
50
53
|
</es-tab-pane>
|
|
51
54
|
</es-tabs>
|
|
52
55
|
</template>
|
|
@@ -68,21 +71,34 @@ export default {
|
|
|
68
71
|
},
|
|
69
72
|
data() {
|
|
70
73
|
return {
|
|
71
|
-
active: '0'
|
|
74
|
+
active: '0',
|
|
75
|
+
// 折叠面板展开项(v-model 可写)
|
|
76
|
+
actives: []
|
|
72
77
|
};
|
|
73
78
|
},
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
79
|
+
watch: {
|
|
80
|
+
active: {
|
|
81
|
+
immediate: true,
|
|
82
|
+
handler() {
|
|
83
|
+
this.resetActives();
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
contents() {
|
|
87
|
+
this.resetActives();
|
|
83
88
|
}
|
|
84
89
|
},
|
|
85
90
|
methods: {
|
|
91
|
+
/**
|
|
92
|
+
* 重置折叠面板展开项为当前标签下全部分组
|
|
93
|
+
*/
|
|
94
|
+
resetActives() {
|
|
95
|
+
const content = this.contents[Number(this.active)];
|
|
96
|
+
this.actives =
|
|
97
|
+
(content &&
|
|
98
|
+
content.children &&
|
|
99
|
+
content.children.map((item) => item.label)) ||
|
|
100
|
+
[];
|
|
101
|
+
},
|
|
86
102
|
/**
|
|
87
103
|
* 处理拖动开始事件
|
|
88
104
|
* @param event 拖动事件对象
|
|
@@ -30,23 +30,28 @@
|
|
|
30
30
|
: true
|
|
31
31
|
"
|
|
32
32
|
>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
33
|
+
<!-- 不用 v-if 包裹:children 为空时 v-if 会产出空注释节点,
|
|
34
|
+
导致 EsForm 等组件误判默认插槽有内容而不渲染 slot fallback -->
|
|
35
|
+
<!-- 子节点统一递归渲染;表单控件子节点(带 formItem 标记)由
|
|
36
|
+
form-render 渲染,es-form-item 包裹层渲染时生成、JSON 不存 -->
|
|
37
|
+
<component
|
|
38
|
+
:is="childRender(child)"
|
|
39
|
+
class="is-child"
|
|
40
|
+
v-for="child in newNode.children"
|
|
41
|
+
:class="{ 'is-active': active === child.id }"
|
|
42
|
+
:key="child.id"
|
|
43
|
+
:node="child"
|
|
44
|
+
:page="page"
|
|
45
|
+
:active="active"
|
|
46
|
+
:drag="false"
|
|
47
|
+
@click="(node, event) => $emit('click', node, event)"
|
|
48
|
+
@drop="(e) => $emit('drop', e)"
|
|
49
|
+
@remove="(node) => $emit('remove', node)"
|
|
50
|
+
@selectAncestor="(id) => $emit('selectAncestor', id)"
|
|
51
|
+
/>
|
|
52
|
+
<!-- 插槽文本同样不能用 v-if/v-else:假分支的空注释节点会被误判为插槽内容,
|
|
53
|
+
改用 v-for 空数组,无文本时不产出任何插槽节点 -->
|
|
54
|
+
<template v-for="t in slotTexts">{{ t }}</template>
|
|
50
55
|
</component>
|
|
51
56
|
<template v-if="newNode.id === active">
|
|
52
57
|
<div class="es-lowcode__handles">
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
</es-dropdown-menu>
|
|
68
73
|
</es-dropdown>
|
|
69
74
|
<es-button
|
|
75
|
+
v-if="isRemove()"
|
|
70
76
|
type="text"
|
|
71
77
|
size="mini"
|
|
72
78
|
icon="es-icon-shanchu"
|
|
@@ -121,11 +127,14 @@
|
|
|
121
127
|
|
|
122
128
|
<script>
|
|
123
129
|
import Frame from './iframe.vue';
|
|
130
|
+
import { propsToObject } from './util/props-util.js';
|
|
131
|
+
import FormRender from './form-render.vue';
|
|
124
132
|
|
|
125
133
|
import EsButton from 'eoss/packages/button';
|
|
126
134
|
import EsDropdown from 'eoss/packages/dropdown';
|
|
127
135
|
import EsDropdownItem from 'eoss/packages/dropdown-item';
|
|
128
136
|
import EsDropdownMenu from 'eoss/packages/dropdown-menu';
|
|
137
|
+
|
|
129
138
|
// 容器布局样式(需应用到内层 component,而非外层包裹 div)
|
|
130
139
|
const LAYOUT_PROPS = [
|
|
131
140
|
'display',
|
|
@@ -139,7 +148,20 @@ const LAYOUT_PROPS = [
|
|
|
139
148
|
];
|
|
140
149
|
export default {
|
|
141
150
|
name: 'Render',
|
|
142
|
-
|
|
151
|
+
// lowcode.vue provide 了自身实例,notRemoves(禁止删除名单)等编辑器级配置从其读取
|
|
152
|
+
inject: {
|
|
153
|
+
lowcode: {
|
|
154
|
+
default: null
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
components: {
|
|
158
|
+
Frame,
|
|
159
|
+
FormRender,
|
|
160
|
+
EsButton,
|
|
161
|
+
EsDropdown,
|
|
162
|
+
EsDropdownItem,
|
|
163
|
+
EsDropdownMenu
|
|
164
|
+
},
|
|
143
165
|
props: {
|
|
144
166
|
node: {
|
|
145
167
|
type: Object,
|
|
@@ -254,6 +276,28 @@ export default {
|
|
|
254
276
|
}
|
|
255
277
|
return textExpr;
|
|
256
278
|
},
|
|
279
|
+
/**
|
|
280
|
+
* 插槽文本:仅当无 children 时产出,
|
|
281
|
+
* 保证 EsForm 等组件在无字段时默认插槽为空、fallback 生效
|
|
282
|
+
*/
|
|
283
|
+
slotTexts() {
|
|
284
|
+
const node = this.newNode;
|
|
285
|
+
if (!node) {
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
const hasChildren =
|
|
289
|
+
Array.isArray(node.children) && node.children.length > 0;
|
|
290
|
+
if (hasChildren) {
|
|
291
|
+
return [];
|
|
292
|
+
}
|
|
293
|
+
return [this.resolvedText || node.description || ''];
|
|
294
|
+
},
|
|
295
|
+
/**
|
|
296
|
+
* 页面 data 变量:供 props 中 {{var}} 引用解析
|
|
297
|
+
*/
|
|
298
|
+
pageData() {
|
|
299
|
+
return (this.page && this.page.data) || {};
|
|
300
|
+
},
|
|
257
301
|
/**
|
|
258
302
|
* 过滤掉 Vue 指令(v-xxx)的 props,避免它们作为普通属性传递给组件
|
|
259
303
|
* 指令统一存在 directives 字段,这里仅兼容历史数据中混入 props 的 v- 键
|
|
@@ -265,13 +309,8 @@ export default {
|
|
|
265
309
|
if (this.newNode.attrs) {
|
|
266
310
|
Object.assign(result, this.newNode.attrs);
|
|
267
311
|
}
|
|
268
|
-
// 合并组件 props
|
|
269
|
-
|
|
270
|
-
Object.keys(this.newNode.props).forEach((key) => {
|
|
271
|
-
if (key.startsWith('v-')) return;
|
|
272
|
-
result[key] = this.newNode.props[key];
|
|
273
|
-
});
|
|
274
|
-
}
|
|
312
|
+
// 合并组件 props:定义数组经 propsToObject 转取值对象(含 {{var}} 解析)
|
|
313
|
+
Object.assign(result, propsToObject(this.newNode.props, this.pageData));
|
|
275
314
|
return result;
|
|
276
315
|
},
|
|
277
316
|
/**
|
|
@@ -410,6 +449,22 @@ export default {
|
|
|
410
449
|
mounted() {},
|
|
411
450
|
beforeDestroy() {},
|
|
412
451
|
methods: {
|
|
452
|
+
/**
|
|
453
|
+
* 子节点渲染器:表单控件子节点(canvas 拖入/源码解析时写入 formItem 标记)
|
|
454
|
+
* 由 form-render 渲染(es-form-item 包裹层渲染时生成),其余走通用 Render
|
|
455
|
+
*/
|
|
456
|
+
childRender(child) {
|
|
457
|
+
return child && child.formItem ? 'FormRender' : 'Render';
|
|
458
|
+
},
|
|
459
|
+
/**
|
|
460
|
+
* 是否展示删除按钮:节点 canRemove 未显式禁止,
|
|
461
|
+
* 且 id 不在 lowcode 的 notRemoves(禁止删除名单)中
|
|
462
|
+
*/
|
|
463
|
+
isRemove() {
|
|
464
|
+
if (this.newNode.canRemove === false) return false;
|
|
465
|
+
const notRemoves = (this.lowcode && this.lowcode.notRemoves) || [];
|
|
466
|
+
return !notRemoves.includes(this.newNode.id);
|
|
467
|
+
},
|
|
413
468
|
/**
|
|
414
469
|
* 处理组件大小调整开始事件
|
|
415
470
|
* @param event 指针事件对象
|