@cicctencent/low-code-editor 0.0.0-stage → 1.1.9-beta.6
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/README.md +2 -2
- package/api-extractor.json +36 -0
- package/dist/ActivityBar/index.vue.d.ts +29 -0
- package/dist/ComponentTree/components/List.vue.d.ts +29 -0
- package/dist/ComponentTree/index.vue.d.ts +32 -0
- package/dist/DataSource/index.vue.d.ts +34 -0
- package/dist/HeaderBar/components/BarTooltip.vue.d.ts +37 -0
- package/dist/HeaderBar/index.vue.d.ts +49 -0
- package/dist/NavTree/index.vue.d.ts +48 -0
- package/dist/SchemaConfig/index.vue.d.ts +36 -0
- package/dist/SidebarPane/index.vue.d.ts +38 -0
- package/dist/components/ComponentTreeFavorites/components/List.vue.d.ts +41 -0
- package/dist/components/ComponentTreeFavorites/components/Tips.vue.d.ts +16 -0
- package/dist/components/ComponentTreeFavorites/index.vue.d.ts +44 -0
- package/dist/components/ImageGuide/index.vue.d.ts +45 -0
- package/dist/components.d.ts +7 -0
- package/dist/composables/useComponentTree.d.ts +13 -0
- package/dist/config/ace.config.d.ts +3 -0
- package/dist/domain/EditorDomain.d.ts +89 -0
- package/dist/editor.d.ts +466 -0
- package/dist/editor.vue.d.ts +104 -0
- package/dist/formily/ActivityBar/index.d.ts +4 -0
- package/dist/formily/ComponentTree/index.d.ts +4 -0
- package/dist/formily/DataBinding/index.d.ts +4 -0
- package/dist/formily/DataBinding/index.vue.d.ts +26 -0
- package/dist/formily/DataSource/index.d.ts +4 -0
- package/dist/formily/MenuTable/PageList.vue.d.ts +28 -0
- package/dist/formily/MenuTable/index.d.ts +4 -0
- package/dist/formily/MenuTable/index.vue.d.ts +30 -0
- package/dist/formily/MenuTable/useMenuTable.d.ts +2 -0
- package/dist/formily/NavTree/index.d.ts +4 -0
- package/dist/formily/SidebarPane/index.d.ts +4 -0
- package/dist/formily/index.d.ts +2 -0
- package/dist/index.css +1167 -0
- package/dist/index.d.ts +250 -0
- package/dist/index.js +42688 -0
- package/dist/utils/base64.d.ts +4 -0
- package/dist/utils/index.d.ts +27 -0
- package/package.json +62 -4
- package/rollup.config.js +3 -0
- package/src/ActivityBar/index.vue +71 -0
- package/src/ComponentTree/components/List.vue +310 -0
- package/src/ComponentTree/index.vue +77 -0
- package/src/DataSource/index.vue +640 -0
- package/src/HeaderBar/components/BarDialog.vue +43 -0
- package/src/HeaderBar/components/BarTooltip.vue +33 -0
- package/src/HeaderBar/index.vue +513 -0
- package/src/NavTree/index.vue +345 -0
- package/src/SchemaConfig/index.vue +150 -0
- package/src/SidebarPane/index.vue +199 -0
- package/src/SynBarComponent/index.vue +31 -0
- package/src/assets/font/NotoSansSC.ttf +0 -0
- package/src/assets/img/header/edit.png +0 -0
- package/src/assets/img/header/link.png +0 -0
- package/src/assets/img/header/link.svg +9 -0
- package/src/assets/img/header/preview.png +0 -0
- package/src/assets/img/header/preview.svg +9 -0
- package/src/assets/img/header/redo.svg +1 -0
- package/src/assets/img/header/undo.svg +1 -0
- package/src/assets/img/tool/all-select.svg +9 -0
- package/src/assets/img/tool/all.svg +9 -0
- package/src/assets/img/tool/collect.svg +6 -0
- package/src/assets/img/tool/collection-select.svg +3 -0
- package/src/assets/img/tool/collection-tag.svg +5 -0
- package/src/assets/img/tool/info.svg +4 -0
- package/src/assets/img/tool/union.svg +4 -0
- package/src/components/ComponentTreeFavorites/components/List.vue +452 -0
- package/src/components/ComponentTreeFavorites/components/Tips.vue +108 -0
- package/src/components/ComponentTreeFavorites/index.vue +180 -0
- package/src/components/ImageGuide/index.vue +100 -0
- package/src/components.ts +23 -0
- package/src/composables/useComponentTree.ts +38 -0
- package/src/config/ace.config.ts +22 -0
- package/src/domain/EditorDomain.ts +265 -0
- package/src/editor.ts +645 -0
- package/src/editor.vue +380 -0
- package/src/formily/ActivityBar/index.ts +23 -0
- package/src/formily/ActivityBar/index.vue +121 -0
- package/src/formily/ComponentTree/index.ts +22 -0
- package/src/formily/DataBinding/index.ts +22 -0
- package/src/formily/DataBinding/index.vue +285 -0
- package/src/formily/DataSource/index.ts +22 -0
- package/src/formily/MenuTable/PageList.vue +132 -0
- package/src/formily/MenuTable/index.ts +19 -0
- package/src/formily/MenuTable/index.vue +218 -0
- package/src/formily/MenuTable/useMenuTable.ts +147 -0
- package/src/formily/NavTree/index.ts +20 -0
- package/src/formily/SidebarPane/index.ts +23 -0
- package/src/formily/SidebarPane/index.vue +174 -0
- package/src/formily/index.ts +12 -0
- package/src/index.ts +29 -0
- package/src/typings/vue-shim.d.ts +13 -0
- package/src/utils/base64.ts +5 -0
- package/src/utils/index.ts +57 -0
- package/test/case.ts +67 -0
- package/test/utils/index.test.ts +27 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,640 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="datapool" :style="{ width: dataPoolWidth + 'px' }">
|
|
3
|
+
<div class="datapool-view-group">
|
|
4
|
+
<div class="datapool-view-group-title">数据源</div>
|
|
5
|
+
<div class="datapool-view-operation-group">
|
|
6
|
+
<el-row :gutter="20">
|
|
7
|
+
<el-col :span="8">
|
|
8
|
+
<el-select v-model="dataSourceType" @change="onSelectChange">
|
|
9
|
+
<el-option
|
|
10
|
+
v-for="item in typeOptions"
|
|
11
|
+
:key="item.value"
|
|
12
|
+
:label="item.label"
|
|
13
|
+
:value="item.value"
|
|
14
|
+
/>
|
|
15
|
+
</el-select>
|
|
16
|
+
</el-col>
|
|
17
|
+
<el-col :span="16">
|
|
18
|
+
<el-input
|
|
19
|
+
v-model="keyword"
|
|
20
|
+
@input="onInputChange"
|
|
21
|
+
placeholder="搜索"
|
|
22
|
+
:suffix-icon="Search"
|
|
23
|
+
/>
|
|
24
|
+
</el-col>
|
|
25
|
+
</el-row>
|
|
26
|
+
<div class="datapool-view-button-group">
|
|
27
|
+
<el-dropdown trigger="click" @command="onAddItem">
|
|
28
|
+
<el-button type="primary">添加</el-button>
|
|
29
|
+
<template #dropdown>
|
|
30
|
+
<el-dropdown-menu>
|
|
31
|
+
<el-dropdown-item command="variable">变量</el-dropdown-item>
|
|
32
|
+
<el-dropdown-item command="method"
|
|
33
|
+
>新建远程API</el-dropdown-item
|
|
34
|
+
>
|
|
35
|
+
</el-dropdown-menu>
|
|
36
|
+
</template>
|
|
37
|
+
</el-dropdown>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
<div class="datapool-view-group-list">
|
|
41
|
+
<Draggable
|
|
42
|
+
:model-value="itemList"
|
|
43
|
+
handle=".icon-drag"
|
|
44
|
+
:move="() => !readOnly"
|
|
45
|
+
@change="onItemChange"
|
|
46
|
+
>
|
|
47
|
+
<template #item="{ element, index }">
|
|
48
|
+
<div class="datapool-list-item">
|
|
49
|
+
<div class="datapool-list-item-title">
|
|
50
|
+
<div class="title-icon icon-drag">
|
|
51
|
+
<svg
|
|
52
|
+
fill="currentColor"
|
|
53
|
+
preserveAspectRatio="xMidYMid meet"
|
|
54
|
+
width="16"
|
|
55
|
+
height="16"
|
|
56
|
+
viewBox="0 0 5 16"
|
|
57
|
+
class="ve-svgicon"
|
|
58
|
+
style="vertical-align: middle"
|
|
59
|
+
>
|
|
60
|
+
<path
|
|
61
|
+
d="M0.499972716,6 L1.50002728,6 C1.77615459,6 2,6.22384541 2,6.49997272 C2,6.77610002 1.77615459,6.99994543 1.50002728,6.99994543 L0.499972716,6.99994543 C0.22384541,6.99994543 3.38158422e-17,6.77610002 0,6.49997272 C-3.38158422e-17,6.22384541 0.22384541,6 0.499972716,6 Z M0.499972716,3 L1.50002728,3 C1.77615459,3 2,3.22384541 2,3.49997272 C2,3.77610002 1.77615459,3.99994543 1.50002728,3.99994543 L0.499972716,3.99994543 C0.22384541,3.99994543 3.38158422e-17,3.77610002 0,3.49997272 C-3.38158422e-17,3.22384541 0.22384541,3 0.499972716,3 Z M0.499972716,7.28787148e-18 L1.50002728,5.55666624e-14 C1.77615459,7.07214574e-14 2,0.22384541 2,0.499972716 C2,0.776100022 1.77615459,0.999945432 1.50002728,0.999945432 L0.499972716,0.999945432 C0.22384541,0.999945432 3.38158422e-17,0.776100022 0,0.499972716 C-3.38158422e-17,0.22384541 0.22384541,5.0723721e-17 0.499972716,0 Z M0.5,9.00002729 L1.5,9.00002729 C1.77614237,9.00002729 2,9.22388491 2,9.50002729 C2,9.77616966 1.77614237,10.0000273 1.5,10.0000273 L0.5,10.0000273 C0.223857625,10.0000273 3.38176876e-17,9.77616966 0,9.50002729 C-3.38176876e-17,9.22388491 0.223857625,9.00002729 0.5,9.00002729 Z M0.5,12.0000273 L1.5,12.0000273 C1.77614237,12.0000273 2,12.2238849 2,12.5000273 C2,12.7761697 1.77614237,13.0000273 1.5,13.0000273 L0.5,13.0000273 C0.223857625,13.0000273 3.38176876e-17,12.7761697 0,12.5000273 C-3.38176876e-17,12.2238849 0.223857625,12.0000273 0.5,12.0000273 Z M0.5,15.0000273 L1.5,15.0000273 C1.77614237,15.0000273 2,15.2238849 2,15.5000273 C2,15.7761697 1.77614237,16.0000273 1.5,16.0000273 L0.5,16.0000273 C0.223857625,16.0000273 3.38176876e-17,15.7761697 0,15.5000273 C-3.38176876e-17,15.2238849 0.223857625,15.0000273 0.5,15.0000273 Z M3.49997272,6 L4.50002728,6 C4.77615459,6 5,6.22384541 5,6.49997272 C5,6.77610002 4.77615459,6.99994543 4.50002728,6.99994543 L3.49997272,6.99994543 C3.22384541,6.99994543 3,6.77610002 3,6.49997272 C3,6.22384541 3.22384541,6 3.49997272,6 Z M3.49997272,3 L4.50002728,3 C4.77615459,3 5,3.22384541 5,3.49997272 C5,3.77610002 4.77615459,3.99994543 4.50002728,3.99994543 L3.49997272,3.99994543 C3.22384541,3.99994543 3,3.77610002 3,3.49997272 C3,3.22384541 3.22384541,3 3.49997272,3 Z M3.49997272,7.28787148e-18 L4.50002728,5.55666624e-14 C4.77615459,7.07214574e-14 5,0.22384541 5,0.499972716 C5,0.776100022 4.77615459,0.999945432 4.50002728,0.999945432 L3.49997272,0.999945432 C3.22384541,0.999945432 3,0.776100022 3,0.499972716 C3,0.22384541 3.22384541,5.0723721e-17 3.49997272,0 Z M3.5,9.00002729 L4.5,9.00002729 C4.77614237,9.00002729 5,9.22388491 5,9.50002729 C5,9.77616966 4.77614237,10.0000273 4.5,10.0000273 L3.5,10.0000273 C3.22385763,10.0000273 3,9.77616966 3,9.50002729 C3,9.22388491 3.22385763,9.00002729 3.5,9.00002729 Z M3.5,12.0000273 L4.5,12.0000273 C4.77614237,12.0000273 5,12.2238849 5,12.5000273 C5,12.7761697 4.77614237,13.0000273 4.5,13.0000273 L3.5,13.0000273 C3.22385763,13.0000273 3,12.7761697 3,12.5000273 C3,12.2238849 3.22385763,12.0000273 3.5,12.0000273 Z M3.5,15.0000273 L4.5,15.0000273 C4.77614237,15.0000273 5,15.2238849 5,15.5000273 C5,15.7761697 4.77614237,16.0000273 4.5,16.0000273 L3.5,16.0000273 C3.22385763,16.0000273 3,15.7761697 3,15.5000273 C3,15.2238849 3.22385763,15.0000273 3.5,15.0000273 Z"
|
|
62
|
+
id="Combined-Shape"
|
|
63
|
+
></path>
|
|
64
|
+
</svg>
|
|
65
|
+
</div>
|
|
66
|
+
<div class="title-icon icon-arrow">
|
|
67
|
+
<svg
|
|
68
|
+
fill="currentColor"
|
|
69
|
+
preserveAspectRatio="xMidYMid meet"
|
|
70
|
+
width="16"
|
|
71
|
+
height="16"
|
|
72
|
+
viewBox="0 0 1024 1024"
|
|
73
|
+
class="ve-svgicon"
|
|
74
|
+
style="vertical-align: middle"
|
|
75
|
+
data-spm-anchor-id="a2q5o.26736379.0.i38.c2202a4b1qWlpv"
|
|
76
|
+
>
|
|
77
|
+
<path
|
|
78
|
+
d="M342.016 214.016l468.010667 297.984-468.010667 297.984 0-596.010667z"
|
|
79
|
+
data-spm-anchor-id="a2q5o.26736379.0.i37.c2202a4b1qWlpv"
|
|
80
|
+
></path>
|
|
81
|
+
</svg>
|
|
82
|
+
</div>
|
|
83
|
+
<div
|
|
84
|
+
:class="[
|
|
85
|
+
'title-protocal',
|
|
86
|
+
element.type === DataSourceType.METHOD
|
|
87
|
+
? 'METHOD'
|
|
88
|
+
: 'VARIABLE',
|
|
89
|
+
]"
|
|
90
|
+
>
|
|
91
|
+
{{ element.type === DataSourceType.METHOD ? '远程' : '变量' }}
|
|
92
|
+
</div>
|
|
93
|
+
<div class="title-name">
|
|
94
|
+
<span>{{ element.name }}</span>
|
|
95
|
+
</div>
|
|
96
|
+
<div class="title-right-icons">
|
|
97
|
+
<div
|
|
98
|
+
class="title-icon icon-edit"
|
|
99
|
+
@click="onEditItem(element, index)"
|
|
100
|
+
>
|
|
101
|
+
<svg
|
|
102
|
+
fill="currentColor"
|
|
103
|
+
preserveAspectRatio="xMidYMid meet"
|
|
104
|
+
width="16"
|
|
105
|
+
height="16"
|
|
106
|
+
viewBox="0 0 1024 1024"
|
|
107
|
+
class="ve-svgicon"
|
|
108
|
+
style="vertical-align: middle"
|
|
109
|
+
data-spm-anchor-id="a2q5o.26736379.0.i33.c2202a4b1qWlpv"
|
|
110
|
+
>
|
|
111
|
+
<path
|
|
112
|
+
d="M707.872 289.6l-256.32 256.32 56.576 33.952 33.92 56.576 256.32-256.32-90.496-90.528z m45.28-45.248l90.496 90.496 22.624-22.624a32 32 0 0 0 0-45.248L821.024 221.76a32 32 0 0 0-45.248 0l-22.624 22.624z m-346.88 346.848l-15.168 15.2v90.496h90.496l15.2-15.2-33.92-56.544-56.576-33.952zM843.68 153.856l90.496 90.496a64 64 0 0 1 0 90.496L508.16 760.896h-181.024v-181.024L753.152 153.856a64 64 0 0 1 90.496 0zM576 96a32 32 0 0 1-32 32H160c-17.696 0-32 14.208-32 31.744v704.512c0 17.184 14.336 31.744 32 31.744h704c17.696 0 32-14.208 32-31.744V608a32 32 0 0 1 64 0v287.84C960 931.264 931.2 960 896.288 960H127.68C92.512 960 64 931.296 64 895.84V128.16C64 92.736 92.8 64 127.712 64H544a32 32 0 0 1 32 32z"
|
|
113
|
+
data-spm-anchor-id="a2q5o.26736379.0.i58.c2202a4b1qWlpv"
|
|
114
|
+
></path>
|
|
115
|
+
</svg>
|
|
116
|
+
</div>
|
|
117
|
+
<div
|
|
118
|
+
class="title-icon icon-copy"
|
|
119
|
+
@click="onCopyItem(element, index)"
|
|
120
|
+
>
|
|
121
|
+
<svg
|
|
122
|
+
fill="currentColor"
|
|
123
|
+
preserveAspectRatio="xMidYMid meet"
|
|
124
|
+
width="16"
|
|
125
|
+
height="16"
|
|
126
|
+
viewBox="0 0 1024 1024"
|
|
127
|
+
class="ve-svgicon"
|
|
128
|
+
style="vertical-align: middle"
|
|
129
|
+
>
|
|
130
|
+
<path
|
|
131
|
+
d="M192 256.16C192 220.736 220.704 192 256.16 192h639.68C931.264 192 960 220.704 960 256.16v639.68A64.16 64.16 0 0 1 895.84 960H256.16A64.16 64.16 0 0 1 192 895.84V256.16z m64 31.584v576.512a32 32 0 0 0 31.744 31.744h576.512a32 32 0 0 0 31.744-31.744V287.744A32 32 0 0 0 864.256 256H287.744A32 32 0 0 0 256 287.744zM288 192v64h64V192H288z m128 0v64h64V192h-64z m128 0v64h64V192h-64z m128 0v64h64V192h-64z m128 0v64h64V192h-64z m96 96v64h64V288h-64z m0 128v64h64v-64h-64z m0 128v64h64v-64h-64z m0 128v64h64v-64h-64z m0 128v64h64v-64h-64z m-96 96v64h64v-64h-64z m-128 0v64h64v-64h-64z m-128 0v64h64v-64h-64z m-128 0v64h64v-64h-64z m-128 0v64h64v-64H288z m-96-96v64h64v-64H192z m0-128v64h64v-64H192z m0-128v64h64v-64H192z m0-128v64h64v-64H192z m0-128v64h64V288H192z m160 416c0-17.664 14.592-32 32.064-32h319.872a31.968 31.968 0 1 1 0 64h-319.872A31.968 31.968 0 0 1 352 704z m0-128c0-17.664 14.4-32 32.224-32h383.552c17.792 0 32.224 14.208 32.224 32 0 17.664-14.4 32-32.224 32H384.224A32.032 32.032 0 0 1 352 576z m0-128c0-17.664 14.4-32 32.224-32h383.552c17.792 0 32.224 14.208 32.224 32 0 17.664-14.4 32-32.224 32H384.224A32.032 32.032 0 0 1 352 448z m512 47.936V192h-64V159.968A31.776 31.776 0 0 0 768.032 128H160A31.776 31.776 0 0 0 128 159.968V768c0 17.92 14.304 31.968 31.968 31.968H192v64h303.936H128.128A63.968 63.968 0 0 1 64 799.872V128.128C64 92.704 92.48 64 128.128 64h671.744C835.296 64 864 92.48 864 128.128v367.808z"
|
|
132
|
+
data-spm-anchor-id="a2q5o.26736379.0.i55.c2202a4b1qWlpv"
|
|
133
|
+
></path>
|
|
134
|
+
</svg>
|
|
135
|
+
</div>
|
|
136
|
+
<div
|
|
137
|
+
class="title-icon icon-delete"
|
|
138
|
+
@click="onDeleteItem(element, index)"
|
|
139
|
+
>
|
|
140
|
+
<svg
|
|
141
|
+
fill="currentColor"
|
|
142
|
+
preserveAspectRatio="xMidYMid meet"
|
|
143
|
+
width="16"
|
|
144
|
+
height="16"
|
|
145
|
+
viewBox="0 0 1024 1024"
|
|
146
|
+
class="ve-svgicon"
|
|
147
|
+
style="vertical-align: middle"
|
|
148
|
+
>
|
|
149
|
+
<path
|
|
150
|
+
d="M224 256v639.84A64 64 0 0 0 287.84 960h448.32A64 64 0 0 0 800 895.84V256h64a32 32 0 1 0 0-64H160a32 32 0 1 0 0 64h64zM384 96c0-17.664 14.496-32 31.904-32h192.192C625.696 64 640 78.208 640 96c0 17.664-14.496 32-31.904 32H415.904A31.872 31.872 0 0 1 384 96z m-96 191.744C288 270.208 302.4 256 320.224 256h383.552C721.6 256 736 270.56 736 287.744v576.512C736 881.792 721.6 896 703.776 896H320.224A32.224 32.224 0 0 1 288 864.256V287.744zM352 352c0-17.696 14.208-32.032 32-32.032 17.664 0 32 14.24 32 32v448c0 17.664-14.208 32-32 32-17.664 0-32-14.24-32-32V352z m128 0c0-17.696 14.208-32.032 32-32.032 17.664 0 32 14.24 32 32v448c0 17.664-14.208 32-32 32-17.664 0-32-14.24-32-32V352z m128 0c0-17.696 14.208-32.032 32-32.032 17.664 0 32 14.24 32 32v448c0 17.664-14.208 32-32 32-17.664 0-32-14.24-32-32V352z"
|
|
151
|
+
></path>
|
|
152
|
+
</svg>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</template>
|
|
158
|
+
</Draggable>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<div v-if="showForm" class="datapool-form-wrap">
|
|
162
|
+
<div class="datapool-form-wrap-title">
|
|
163
|
+
<div>{{ formType + '数据源' }}</div>
|
|
164
|
+
<div class="form-button-group">
|
|
165
|
+
<el-button type="primary" @click="onSave">保存</el-button>
|
|
166
|
+
<el-button @click="onCancel">取消</el-button>
|
|
167
|
+
</div>
|
|
168
|
+
</div>
|
|
169
|
+
<div class="datapool-form-wrap-content">
|
|
170
|
+
<el-form :model="formModel" ref="formRef" label-position="left">
|
|
171
|
+
<el-form-item label="名 称" prop="name" label-width="50px">
|
|
172
|
+
<el-input v-model="formModel.name" />
|
|
173
|
+
</el-form-item>
|
|
174
|
+
<el-form-item label="描 述" prop="desc" label-width="50px">
|
|
175
|
+
<el-input v-model="formModel.desc" />
|
|
176
|
+
</el-form-item>
|
|
177
|
+
<el-form-item prop="type" label-width="0px">
|
|
178
|
+
<el-radio-group v-model="formModel.type">
|
|
179
|
+
<el-radio label="method">方法</el-radio>
|
|
180
|
+
<el-radio label="variable">变量</el-radio>
|
|
181
|
+
</el-radio-group>
|
|
182
|
+
</el-form-item>
|
|
183
|
+
<el-row v-if="formModel.type === 'method'" :gutter="12">
|
|
184
|
+
<el-col :span="11">
|
|
185
|
+
<el-form-item prop="entityId" label-width="0px">
|
|
186
|
+
<el-select
|
|
187
|
+
v-model="formModel.entityId"
|
|
188
|
+
placeholder="实体"
|
|
189
|
+
:loading="entityData.loading"
|
|
190
|
+
>
|
|
191
|
+
<el-option
|
|
192
|
+
v-for="item in entityData.list"
|
|
193
|
+
:key="item.key"
|
|
194
|
+
:label="item.title"
|
|
195
|
+
:value="item.entityId"
|
|
196
|
+
/>
|
|
197
|
+
</el-select>
|
|
198
|
+
</el-form-item>
|
|
199
|
+
</el-col>
|
|
200
|
+
<el-col :span="11">
|
|
201
|
+
<el-form-item prop="methodId" label-width="0px">
|
|
202
|
+
<el-select
|
|
203
|
+
v-model="formModel.methodId"
|
|
204
|
+
placeholder="方法"
|
|
205
|
+
:loading="methodData.loading"
|
|
206
|
+
>
|
|
207
|
+
<el-option
|
|
208
|
+
v-for="item in methodData.list"
|
|
209
|
+
:key="item.key"
|
|
210
|
+
:label="item.title"
|
|
211
|
+
:value="item.methodId"
|
|
212
|
+
/>
|
|
213
|
+
</el-select>
|
|
214
|
+
</el-form-item>
|
|
215
|
+
</el-col>
|
|
216
|
+
<el-col :span="2">
|
|
217
|
+
<el-icon><Warning /></el-icon>
|
|
218
|
+
</el-col>
|
|
219
|
+
</el-row>
|
|
220
|
+
<el-form-item
|
|
221
|
+
v-if="formModel.type === 'method'"
|
|
222
|
+
style="flex-direction: column"
|
|
223
|
+
prop="queryDSL"
|
|
224
|
+
label-width="150px"
|
|
225
|
+
>
|
|
226
|
+
<template #label>
|
|
227
|
+
请求参数<el-icon><Warning /></el-icon>
|
|
228
|
+
</template>
|
|
229
|
+
<v-ace-editor
|
|
230
|
+
v-model:value="formModel.queryDSL"
|
|
231
|
+
:options="{ showPrintMargin: false }"
|
|
232
|
+
theme="chrome"
|
|
233
|
+
lang="typescript"
|
|
234
|
+
style="height: 220px; width: 100%"
|
|
235
|
+
/>
|
|
236
|
+
</el-form-item>
|
|
237
|
+
<el-form-item
|
|
238
|
+
v-else
|
|
239
|
+
style="flex-direction: column"
|
|
240
|
+
label="初始值"
|
|
241
|
+
prop="default"
|
|
242
|
+
required
|
|
243
|
+
>
|
|
244
|
+
<v-ace-editor
|
|
245
|
+
v-model:value="formModel.default"
|
|
246
|
+
:options="{ showPrintMargin: false }"
|
|
247
|
+
theme="chrome"
|
|
248
|
+
lang="typescript"
|
|
249
|
+
style="height: 220px; width: 100%"
|
|
250
|
+
/>
|
|
251
|
+
</el-form-item>
|
|
252
|
+
<el-form-item
|
|
253
|
+
style="flex-direction: column"
|
|
254
|
+
prop="exeDSL"
|
|
255
|
+
label-width="150px"
|
|
256
|
+
>
|
|
257
|
+
<template #label>
|
|
258
|
+
{{ formModel.type === 'method' ? '回包处理' : '变量取值脚本'
|
|
259
|
+
}}<el-icon><Warning /></el-icon>
|
|
260
|
+
</template>
|
|
261
|
+
<v-ace-editor
|
|
262
|
+
v-model:value="formModel.exeDSL"
|
|
263
|
+
:options="{ showPrintMargin: false }"
|
|
264
|
+
theme="chrome"
|
|
265
|
+
lang="typescript"
|
|
266
|
+
style="height: 220px; width: 100%"
|
|
267
|
+
/>
|
|
268
|
+
</el-form-item>
|
|
269
|
+
</el-form>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
273
|
+
</template>
|
|
274
|
+
|
|
275
|
+
<script lang="ts" setup>
|
|
276
|
+
//@ts-nocheck
|
|
277
|
+
import { watch, ref, reactive, withDefaults, defineProps, defineEmits } from 'vue';
|
|
278
|
+
import { Search, Warning } from '@cicctencent/icons-vue';
|
|
279
|
+
import Draggable from 'vuedraggable';
|
|
280
|
+
import '../config/ace.config';
|
|
281
|
+
import { VAceEditor } from 'vue3-ace-editor';
|
|
282
|
+
import { DataSource, DataSourceType } from '@cicctencent/low-code-core';
|
|
283
|
+
import { FormInstance } from '@jt/jtui';
|
|
284
|
+
enum DataPoolWidth {
|
|
285
|
+
FOLD = 300,
|
|
286
|
+
EXPAND = 710,
|
|
287
|
+
}
|
|
288
|
+
enum FormType {
|
|
289
|
+
ADD = '新建',
|
|
290
|
+
EDIT = '编辑',
|
|
291
|
+
COPY = '复制',
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const props = withDefaults(
|
|
295
|
+
defineProps<{
|
|
296
|
+
sourceList: DataSource[];
|
|
297
|
+
readOnly?: boolean;
|
|
298
|
+
}>(),
|
|
299
|
+
{
|
|
300
|
+
sourceList: () => [],
|
|
301
|
+
readOnly: false,
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
const emits = defineEmits([
|
|
306
|
+
'getEntityList',
|
|
307
|
+
'getMethodList',
|
|
308
|
+
'dataSourceChange',
|
|
309
|
+
]);
|
|
310
|
+
|
|
311
|
+
const typeOptions = [
|
|
312
|
+
{ label: '全部', value: '' },
|
|
313
|
+
{ label: '变量', value: 'variable' },
|
|
314
|
+
{ label: '远程', value: 'method' },
|
|
315
|
+
];
|
|
316
|
+
// 数据源类型
|
|
317
|
+
const dataSourceType = ref('');
|
|
318
|
+
// 关键字
|
|
319
|
+
const keyword = ref('');
|
|
320
|
+
// 显示宽度
|
|
321
|
+
const dataPoolWidth = ref(DataPoolWidth.FOLD);
|
|
322
|
+
// 是否展示表单
|
|
323
|
+
const showForm = ref(false);
|
|
324
|
+
/* 实际展示的数据源列表 */
|
|
325
|
+
const itemList = ref<DataSource[]>([]);
|
|
326
|
+
// 表单类型
|
|
327
|
+
const formType = ref<FormType>();
|
|
328
|
+
// 表单数据
|
|
329
|
+
const emptyFormModel = {
|
|
330
|
+
type: '',
|
|
331
|
+
name: '',
|
|
332
|
+
desc: '',
|
|
333
|
+
default: '',
|
|
334
|
+
queryDSL: '',
|
|
335
|
+
exeDSL: '',
|
|
336
|
+
entityId: null,
|
|
337
|
+
methodId: null,
|
|
338
|
+
};
|
|
339
|
+
const formModel = reactive<any>({ ...emptyFormModel });
|
|
340
|
+
// 实体数据
|
|
341
|
+
const entityData = reactive({
|
|
342
|
+
list: [],
|
|
343
|
+
loading: false,
|
|
344
|
+
});
|
|
345
|
+
// 方法数据
|
|
346
|
+
const methodData = reactive({
|
|
347
|
+
list: [],
|
|
348
|
+
loading: false,
|
|
349
|
+
});
|
|
350
|
+
// 表单实例
|
|
351
|
+
const formRef = ref<FormInstance>();
|
|
352
|
+
// 当前编辑/复制的数据源序号
|
|
353
|
+
let currentIndex = 0;
|
|
354
|
+
|
|
355
|
+
watch(
|
|
356
|
+
() => props.sourceList,
|
|
357
|
+
val => {
|
|
358
|
+
itemList.value = val;
|
|
359
|
+
},
|
|
360
|
+
{ deep: true, immediate: true }
|
|
361
|
+
);
|
|
362
|
+
|
|
363
|
+
watch(showForm, val => {
|
|
364
|
+
if (val && formModel.type === DataSourceType.METHOD) {
|
|
365
|
+
entityData.loading = true;
|
|
366
|
+
emits('getEntityList', list => {
|
|
367
|
+
entityData.loading = false;
|
|
368
|
+
entityData.list = list;
|
|
369
|
+
});
|
|
370
|
+
if (formModel.entityId) {
|
|
371
|
+
methodData.loading = true;
|
|
372
|
+
emits(
|
|
373
|
+
'getMethodList',
|
|
374
|
+
list => {
|
|
375
|
+
methodData.loading = false;
|
|
376
|
+
methodData.list = list;
|
|
377
|
+
},
|
|
378
|
+
formModel.entityId
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
watch(
|
|
385
|
+
() => formModel.entityId,
|
|
386
|
+
id => {
|
|
387
|
+
methodData.loading = true;
|
|
388
|
+
emits(
|
|
389
|
+
'getMethodList',
|
|
390
|
+
list => {
|
|
391
|
+
methodData.loading = false;
|
|
392
|
+
methodData.list = list;
|
|
393
|
+
},
|
|
394
|
+
id
|
|
395
|
+
);
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
|
|
399
|
+
/* 筛选数据源类型 */
|
|
400
|
+
const onSelectChange = value => {
|
|
401
|
+
itemList.value = props.sourceList.filter(
|
|
402
|
+
item => value === '' || item.type === value
|
|
403
|
+
);
|
|
404
|
+
};
|
|
405
|
+
/* 根据数据源名称关键字筛选数据源 */
|
|
406
|
+
const onInputChange = value => {
|
|
407
|
+
itemList.value = props.sourceList.filter(item => item.name.includes(value));
|
|
408
|
+
};
|
|
409
|
+
/* 数据源顺序发生变化 */
|
|
410
|
+
const onItemChange = ({ element, newIndex, oldIndex }) => {
|
|
411
|
+
emits('dataSourceChange', {
|
|
412
|
+
type: 'drag',
|
|
413
|
+
data: { element, newIndex, oldIndex },
|
|
414
|
+
});
|
|
415
|
+
};
|
|
416
|
+
/* 清空表单 */
|
|
417
|
+
const clearForm = () => {
|
|
418
|
+
Object.keys(emptyFormModel).forEach(key => {
|
|
419
|
+
formModel[key] = emptyFormModel[key];
|
|
420
|
+
});
|
|
421
|
+
};
|
|
422
|
+
/* 新建数据源 */
|
|
423
|
+
let countAdd = 1;
|
|
424
|
+
const onAddItem = (command: string) => {
|
|
425
|
+
dataPoolWidth.value = DataPoolWidth.EXPAND;
|
|
426
|
+
formType.value = FormType.ADD;
|
|
427
|
+
showForm.value = true;
|
|
428
|
+
// 初始表单数据
|
|
429
|
+
clearForm();
|
|
430
|
+
formModel.type = command;
|
|
431
|
+
formModel.name = command + countAdd++;
|
|
432
|
+
// 尚未保存 仅作为展示
|
|
433
|
+
itemList.value.push({ ...formModel });
|
|
434
|
+
};
|
|
435
|
+
/* 点击保存按钮触发的事件 */
|
|
436
|
+
const onSave = () => {
|
|
437
|
+
// emit事件新增/编辑/复制数据源
|
|
438
|
+
switch (formType.value) {
|
|
439
|
+
case FormType.ADD:
|
|
440
|
+
emits('dataSourceChange', {
|
|
441
|
+
type: 'add',
|
|
442
|
+
data: { element: formModel },
|
|
443
|
+
});
|
|
444
|
+
break;
|
|
445
|
+
case FormType.EDIT:
|
|
446
|
+
emits('dataSourceChange', {
|
|
447
|
+
type: 'edit',
|
|
448
|
+
data: { element: formModel, index: currentIndex },
|
|
449
|
+
});
|
|
450
|
+
break;
|
|
451
|
+
case FormType.COPY:
|
|
452
|
+
emits('dataSourceChange', {
|
|
453
|
+
type: 'copy',
|
|
454
|
+
data: { element: formModel },
|
|
455
|
+
});
|
|
456
|
+
break;
|
|
457
|
+
default:
|
|
458
|
+
break;
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
/* 点击取消按钮触发的事件 */
|
|
462
|
+
const onCancel = (element, index) => {
|
|
463
|
+
dataPoolWidth.value = DataPoolWidth.FOLD;
|
|
464
|
+
showForm.value = false;
|
|
465
|
+
// 新增和复制取消后删除预先增加的一项
|
|
466
|
+
[FormType.ADD, FormType.COPY].includes(formType.value) &&
|
|
467
|
+
itemList.value.pop();
|
|
468
|
+
clearForm();
|
|
469
|
+
};
|
|
470
|
+
/* 点击编辑图标 */
|
|
471
|
+
const onEditItem = (element, index) => {
|
|
472
|
+
dataPoolWidth.value = DataPoolWidth.EXPAND;
|
|
473
|
+
formType.value = FormType.EDIT;
|
|
474
|
+
showForm.value = true;
|
|
475
|
+
Object.keys(element).forEach(key => {
|
|
476
|
+
formModel[key] = element[key];
|
|
477
|
+
});
|
|
478
|
+
currentIndex = index;
|
|
479
|
+
};
|
|
480
|
+
/* 点击复制图标 */
|
|
481
|
+
const onCopyItem = (element, index) => {
|
|
482
|
+
dataPoolWidth.value = DataPoolWidth.EXPAND;
|
|
483
|
+
formType.value = FormType.COPY;
|
|
484
|
+
showForm.value = true;
|
|
485
|
+
Object.keys(element).forEach(key => {
|
|
486
|
+
if (key === 'name') formModel[key] = `${element[key]}_copy`;
|
|
487
|
+
else formModel[key] = element[key];
|
|
488
|
+
});
|
|
489
|
+
// 尚未保存 仅作为展示
|
|
490
|
+
itemList.value.push({ ...formModel });
|
|
491
|
+
};
|
|
492
|
+
/* 点击删除图标 */
|
|
493
|
+
const onDeleteItem = (element, index) => {
|
|
494
|
+
// emit事件通知领域对象删除数据源配置
|
|
495
|
+
emits('dataSourceChange', { type: 'delete', data: { element, index } });
|
|
496
|
+
};
|
|
497
|
+
</script>
|
|
498
|
+
|
|
499
|
+
<style lang="scss" scoped>
|
|
500
|
+
.datapool {
|
|
501
|
+
box-sizing: border-box;
|
|
502
|
+
display: flex;
|
|
503
|
+
height: 100%;
|
|
504
|
+
overflow: auto;
|
|
505
|
+
background: #fff;
|
|
506
|
+
.datapool-view-group {
|
|
507
|
+
padding-top: 44px;
|
|
508
|
+
width: 300px;
|
|
509
|
+
user-select: initial;
|
|
510
|
+
display: inline-block;
|
|
511
|
+
vertical-align: top;
|
|
512
|
+
height: 100%;
|
|
513
|
+
overflow: auto;
|
|
514
|
+
border-right: 1px solid rgba(31, 56, 88, 0.1);
|
|
515
|
+
.datapool-view-group-title {
|
|
516
|
+
box-sizing: border-box;
|
|
517
|
+
line-height: 44px;
|
|
518
|
+
width: 100%;
|
|
519
|
+
top: 0;
|
|
520
|
+
text-align: left;
|
|
521
|
+
padding: 0 12px;
|
|
522
|
+
position: absolute;
|
|
523
|
+
background: #f6f7f8;
|
|
524
|
+
}
|
|
525
|
+
.datapool-view-operation-group {
|
|
526
|
+
margin-top: 8px;
|
|
527
|
+
padding: 0 12px;
|
|
528
|
+
.datapool-view-button-group {
|
|
529
|
+
display: flex;
|
|
530
|
+
justify-content: space-between;
|
|
531
|
+
align-items: center;
|
|
532
|
+
margin-top: 10px;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
.datapool-view-group-list {
|
|
536
|
+
overflow-y: auto;
|
|
537
|
+
margin-top: 10px;
|
|
538
|
+
.datapool-list-item {
|
|
539
|
+
margin-bottom: 6px;
|
|
540
|
+
border-radius: 2px;
|
|
541
|
+
padding: 0 12px;
|
|
542
|
+
position: relative;
|
|
543
|
+
.datapool-list-item-title {
|
|
544
|
+
line-height: 28px;
|
|
545
|
+
font-size: 12px;
|
|
546
|
+
font-weight: 700;
|
|
547
|
+
border: 1px solid rgba(31, 56, 88, 0.1);
|
|
548
|
+
border-radius: 3px;
|
|
549
|
+
padding: 0 4px;
|
|
550
|
+
box-sizing: border-box;
|
|
551
|
+
position: relative;
|
|
552
|
+
transition: border 0.3s ease;
|
|
553
|
+
display: flex;
|
|
554
|
+
align-items: center;
|
|
555
|
+
.title-icon {
|
|
556
|
+
width: 16px;
|
|
557
|
+
height: 16px;
|
|
558
|
+
max-height: 100%;
|
|
559
|
+
max-width: 100%;
|
|
560
|
+
opacity: 0.7;
|
|
561
|
+
overflow: hidden;
|
|
562
|
+
display: inline-flex;
|
|
563
|
+
align-items: center;
|
|
564
|
+
justify-content: center;
|
|
565
|
+
box-sizing: border-box;
|
|
566
|
+
cursor: pointer;
|
|
567
|
+
}
|
|
568
|
+
.icon-drag {
|
|
569
|
+
cursor: ns-resize;
|
|
570
|
+
}
|
|
571
|
+
.title-protocal {
|
|
572
|
+
padding: 0 4px;
|
|
573
|
+
border-radius: 5px;
|
|
574
|
+
text-align: center;
|
|
575
|
+
}
|
|
576
|
+
.title-protocal.METHOD {
|
|
577
|
+
color: #33a4ff;
|
|
578
|
+
}
|
|
579
|
+
.title-protocal.VARIABLE {
|
|
580
|
+
color: #66bc5c;
|
|
581
|
+
}
|
|
582
|
+
.title-protocal.URI {
|
|
583
|
+
color: #fabd0e;
|
|
584
|
+
}
|
|
585
|
+
.title-name {
|
|
586
|
+
max-width: calc(100% - 145px);
|
|
587
|
+
white-space: nowrap;
|
|
588
|
+
text-overflow: ellipsis;
|
|
589
|
+
overflow: hidden;
|
|
590
|
+
word-wrap: normal;
|
|
591
|
+
}
|
|
592
|
+
.title-right-icons {
|
|
593
|
+
position: absolute;
|
|
594
|
+
right: 5px;
|
|
595
|
+
display: flex;
|
|
596
|
+
align-items: center;
|
|
597
|
+
height: 24px;
|
|
598
|
+
}
|
|
599
|
+
.icon-edit,
|
|
600
|
+
.icon-copy {
|
|
601
|
+
margin-right: 4px;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
.datapool-form-wrap {
|
|
608
|
+
position: relative;
|
|
609
|
+
padding-top: 44px;
|
|
610
|
+
flex: 1;
|
|
611
|
+
height: 100%;
|
|
612
|
+
box-sizing: border-box;
|
|
613
|
+
border-right: 1px solid rgba(31, 56, 88, 0.1);
|
|
614
|
+
overflow: auto;
|
|
615
|
+
vertical-align: top;
|
|
616
|
+
font-size: 12px;
|
|
617
|
+
.datapool-form-wrap-title {
|
|
618
|
+
box-sizing: border-box;
|
|
619
|
+
display: flex;
|
|
620
|
+
justify-content: space-between;
|
|
621
|
+
line-height: 44px;
|
|
622
|
+
padding: 0 12px;
|
|
623
|
+
position: absolute;
|
|
624
|
+
top: 0;
|
|
625
|
+
width: 409px;
|
|
626
|
+
background: #f6f7f8;
|
|
627
|
+
font-size: 14px;
|
|
628
|
+
z-index: 10;
|
|
629
|
+
}
|
|
630
|
+
.datapool-form-wrap-content {
|
|
631
|
+
width: 100%;
|
|
632
|
+
height: calc(100% - 37px);
|
|
633
|
+
box-sizing: border-box;
|
|
634
|
+
overflow-y: auto;
|
|
635
|
+
overflow-x: hidden;
|
|
636
|
+
padding: 8px 12px;
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="trigger-area" @click="dialogVisible = true">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
<el-dialog v-model="dialogVisible" :title="title" width="30%">
|
|
6
|
+
<VueForm :schema="schema" v-model="dataRef"></VueForm>
|
|
7
|
+
<template #footer>
|
|
8
|
+
<span class="dialog-footer">
|
|
9
|
+
<el-button @click="dialogVisible = false">取消</el-button>
|
|
10
|
+
<el-button type="primary" @click="dialogVisible = false"
|
|
11
|
+
>确定</el-button
|
|
12
|
+
>
|
|
13
|
+
</span>
|
|
14
|
+
</template>
|
|
15
|
+
</el-dialog>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script lang="ts" setup>
|
|
19
|
+
// @ts-nocheck
|
|
20
|
+
import { ref, withDefaults, defineProps, computed } from 'vue';
|
|
21
|
+
import { VueForm } from '@jt/formily';
|
|
22
|
+
import { Schema } from '@cicctencent/low-code-core';
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(
|
|
25
|
+
defineProps<{
|
|
26
|
+
title?: string;
|
|
27
|
+
schema: Schema;
|
|
28
|
+
data?: Record<string, any>;
|
|
29
|
+
}>(),
|
|
30
|
+
{}
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const dataRef = computed(() => props.data);
|
|
34
|
+
|
|
35
|
+
const dialogVisible = ref(false);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<style lang="scss" scoped>
|
|
39
|
+
.trigger-area {
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
}
|
|
43
|
+
</style>
|