@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
package/src/editor.vue
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="editor"
|
|
4
|
+
@dragenter="onDragenter"
|
|
5
|
+
@drop.stop="onDrop(false, $event)"
|
|
6
|
+
@dragover="onDragover"
|
|
7
|
+
@dragleave="onDragleave"
|
|
8
|
+
@click="onClick"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
class="editor-top"
|
|
12
|
+
v-if="config?.functionData && !appConfig.hideHeader"
|
|
13
|
+
>
|
|
14
|
+
<HeaderBar
|
|
15
|
+
:scale-percent="viewScalePercent"
|
|
16
|
+
:function-data="config?.functionData"
|
|
17
|
+
:read-only="readOnly"
|
|
18
|
+
@update-scale="onUpdateScale"
|
|
19
|
+
@editTitle="onEditTitle"
|
|
20
|
+
@preview="$emit('preview')"
|
|
21
|
+
@copyUrl="$emit('copyUrl')"
|
|
22
|
+
@save="$emit('save', project)"
|
|
23
|
+
@publish="$emit('publish')"
|
|
24
|
+
@undo="onUndo"
|
|
25
|
+
@redo="onRedo"
|
|
26
|
+
></HeaderBar>
|
|
27
|
+
</div>
|
|
28
|
+
<div class="editor-container">
|
|
29
|
+
<div v-if="!config" class="editor-container__empty">暂无数据</div>
|
|
30
|
+
<template v-else>
|
|
31
|
+
<div
|
|
32
|
+
v-if="!(config.activityBarList && config.activityBarList.length)"
|
|
33
|
+
class="editor-container__tool"
|
|
34
|
+
>
|
|
35
|
+
<NavTree
|
|
36
|
+
ref="navTreeRef"
|
|
37
|
+
:key="timestamp"
|
|
38
|
+
:nav-tree-data="config?.navTreeData"
|
|
39
|
+
:menu-data="menuData"
|
|
40
|
+
:read-only="readOnly"
|
|
41
|
+
@select="onSelect"
|
|
42
|
+
@menu-open="onMenuOpen"
|
|
43
|
+
@splice="onSplice"
|
|
44
|
+
@menu-click="onMenuClick"
|
|
45
|
+
@submit-edit="onSubmitEdit"
|
|
46
|
+
@icon-click="onIconClick"
|
|
47
|
+
/>
|
|
48
|
+
<div class="divider"></div>
|
|
49
|
+
<slot
|
|
50
|
+
name="componentTree"
|
|
51
|
+
:componentTreeData="config?.componentTreeData"
|
|
52
|
+
:onAddItem="onAddItem"
|
|
53
|
+
:onDragEnd="onDragEnd"
|
|
54
|
+
:readOnly="readOnly"
|
|
55
|
+
>
|
|
56
|
+
<ComponentTree
|
|
57
|
+
:componentTreeData="config?.componentTreeData"
|
|
58
|
+
:read-only="readOnly"
|
|
59
|
+
@add-item="onAddItem"
|
|
60
|
+
@drag-end="onDragEnd"
|
|
61
|
+
/>
|
|
62
|
+
</slot>
|
|
63
|
+
</div>
|
|
64
|
+
<template v-else>
|
|
65
|
+
<ActivityBar
|
|
66
|
+
v-model="activeBarName"
|
|
67
|
+
:bar-list="config.activityBarList"
|
|
68
|
+
></ActivityBar>
|
|
69
|
+
<SidebarPane
|
|
70
|
+
v-if="activeBarName"
|
|
71
|
+
v-bind="config.primarySidebarData.sidebarPaneConfig"
|
|
72
|
+
@clear-active-bar="activeBarName = ''"
|
|
73
|
+
>
|
|
74
|
+
<component
|
|
75
|
+
:is="editorComponents[config.primarySidebarData.componentName]"
|
|
76
|
+
v-bind="config.primarySidebarData.componentProps"
|
|
77
|
+
@select="onSelect"
|
|
78
|
+
@menu-open="onMenuOpen"
|
|
79
|
+
@splice="onSplice"
|
|
80
|
+
@menu-click="onMenuClick"
|
|
81
|
+
@submit-edit="onSubmitEdit"
|
|
82
|
+
@icon-click="onIconClick"
|
|
83
|
+
@add-item="onAddItem"
|
|
84
|
+
@drag-end="onDragEnd"
|
|
85
|
+
@data-source-change="onDataSourceChange"
|
|
86
|
+
@getEntityList="onGetEntityList"
|
|
87
|
+
@getMethodList="onGetMethodList"
|
|
88
|
+
/>
|
|
89
|
+
</SidebarPane>
|
|
90
|
+
</template>
|
|
91
|
+
</template>
|
|
92
|
+
<div class="editor-container__context" @click="onSelectPage">
|
|
93
|
+
<div
|
|
94
|
+
class="iframe-box"
|
|
95
|
+
v-loading="loading"
|
|
96
|
+
:style="viewIframeBoxStyle"
|
|
97
|
+
@drop.stop="onDrop(true, $event)"
|
|
98
|
+
@dragover="onDragover"
|
|
99
|
+
>
|
|
100
|
+
<iframe
|
|
101
|
+
ref="iframe"
|
|
102
|
+
:src="url"
|
|
103
|
+
frameborder="0"
|
|
104
|
+
:style="viewScaleStyle"
|
|
105
|
+
class="editor-iframe"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
<div class="editor-container__schema">
|
|
110
|
+
<SchemaConfig
|
|
111
|
+
:schema-data="config?.schemaData"
|
|
112
|
+
:read-only="readOnly"
|
|
113
|
+
@change="onSchemaFormChange"
|
|
114
|
+
@upload="onSchemaUpload"
|
|
115
|
+
@openCloud="onOpenCloud"
|
|
116
|
+
@getData="onSchemaGetData"
|
|
117
|
+
@preloadCloud="onPreloadCloud"
|
|
118
|
+
@initValidateRule="onInitValidateRule"
|
|
119
|
+
/>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<ImageGuide
|
|
124
|
+
v-if="guideData"
|
|
125
|
+
:width="1000"
|
|
126
|
+
:title="guideData.title"
|
|
127
|
+
v-model="guideVisible"
|
|
128
|
+
:content="guideData.content"
|
|
129
|
+
/>
|
|
130
|
+
|
|
131
|
+
<el-dialog
|
|
132
|
+
v-model="dialog.visible"
|
|
133
|
+
:title="dialog.renderData.title"
|
|
134
|
+
:width="dialog.renderData?.width || '50%'"
|
|
135
|
+
destroy-on-close
|
|
136
|
+
>
|
|
137
|
+
<VueForm
|
|
138
|
+
:schema="dialog.renderData.schema"
|
|
139
|
+
:model-value="dialog.renderData.formData"
|
|
140
|
+
@fileUpload="onSchemaUpload"
|
|
141
|
+
@on-change="onDialogSchemaChange"
|
|
142
|
+
></VueForm>
|
|
143
|
+
<template #footer>
|
|
144
|
+
<span class="dialog-footer">
|
|
145
|
+
<el-button @click="onEditDialogCancel">
|
|
146
|
+
{{ dialog.renderData.cancelButton?.text }}
|
|
147
|
+
</el-button>
|
|
148
|
+
<el-button type="primary" @click="onEditDialogConfirm">
|
|
149
|
+
{{ dialog.renderData.confirmButton?.text }}
|
|
150
|
+
</el-button>
|
|
151
|
+
</span>
|
|
152
|
+
</template>
|
|
153
|
+
</el-dialog>
|
|
154
|
+
</template>
|
|
155
|
+
|
|
156
|
+
<script lang="ts" setup>
|
|
157
|
+
import {
|
|
158
|
+
onMounted,
|
|
159
|
+
watch,
|
|
160
|
+
} from 'vue';
|
|
161
|
+
import { PostMessageOption } from '@jt/postmessage-channel';
|
|
162
|
+
import HeaderBar from './HeaderBar/index.vue';
|
|
163
|
+
import NavTree from './NavTree/index.vue';
|
|
164
|
+
import ComponentTree from './ComponentTree/index.vue';
|
|
165
|
+
import SchemaConfig from './SchemaConfig/index.vue';
|
|
166
|
+
import ImageGuide from './components/ImageGuide/index.vue';
|
|
167
|
+
import ActivityBar from './ActivityBar/index.vue';
|
|
168
|
+
import SidebarPane from './SidebarPane/index.vue';
|
|
169
|
+
import { Project } from '@cicctencent/low-code-core';
|
|
170
|
+
import useEditor from './editor';
|
|
171
|
+
import { editorComponents } from './components';
|
|
172
|
+
import { VueForm } from '@jt/formily';
|
|
173
|
+
import EditorDomain from './domain/EditorDomain';
|
|
174
|
+
|
|
175
|
+
interface MessageReq {
|
|
176
|
+
type: string; //消息类型
|
|
177
|
+
data: any; // 相关数据
|
|
178
|
+
domain: EditorDomain; // 领域对象
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
const props = withDefaults(
|
|
182
|
+
defineProps<{
|
|
183
|
+
editorData?: Project; // 初始化project项目数,由于这里的数据流比较长,不适宜用v-model
|
|
184
|
+
url: string; // 模拟器页面url
|
|
185
|
+
// request?: () => void; // 获取数据方法,这里采用命令字的方式,限制访问的接口
|
|
186
|
+
request?: Function;
|
|
187
|
+
postMessageOption?: PostMessageOption;
|
|
188
|
+
readOnly?: boolean; // 是否有权限操作页面
|
|
189
|
+
appConfig?: any;
|
|
190
|
+
categoryList?: any[];
|
|
191
|
+
navBarComponents?: any;
|
|
192
|
+
onMessage?: (req: MessageReq) => any;
|
|
193
|
+
}>(),
|
|
194
|
+
{
|
|
195
|
+
readOnly: false,
|
|
196
|
+
appConfig: { hideHeader: false } as Record<string, any>,
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
onMounted(()=>{
|
|
201
|
+
// 如果有业务层处理的左侧菜单树,则注册进池
|
|
202
|
+
if(props.navBarComponents) editorComponents.push(props.navBarComponents);
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
watch(()=>props.navBarComponents, ()=>{
|
|
206
|
+
editorComponents.push(props.navBarComponents);
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const emits = defineEmits([
|
|
210
|
+
'save',
|
|
211
|
+
'upload',
|
|
212
|
+
'publish',
|
|
213
|
+
'preview',
|
|
214
|
+
'copyUrl',
|
|
215
|
+
'editTitle',
|
|
216
|
+
'autoSave',
|
|
217
|
+
'updateProject',
|
|
218
|
+
'updateScreenShot',
|
|
219
|
+
'openUpload',
|
|
220
|
+
'getData',
|
|
221
|
+
'openCloud',
|
|
222
|
+
'preloadCloud',
|
|
223
|
+
'editDialogConfirm',
|
|
224
|
+
'editDialogCancel',
|
|
225
|
+
]);
|
|
226
|
+
|
|
227
|
+
const {
|
|
228
|
+
iframe,
|
|
229
|
+
viewIframeBoxStyle,
|
|
230
|
+
viewScaleStyle,
|
|
231
|
+
config,
|
|
232
|
+
project,
|
|
233
|
+
menuData,
|
|
234
|
+
iframeMaskFlag,
|
|
235
|
+
onUpdateScale,
|
|
236
|
+
onSelect,
|
|
237
|
+
onSelectPage,
|
|
238
|
+
onMenuOpen,
|
|
239
|
+
onSplice,
|
|
240
|
+
onMenuClick,
|
|
241
|
+
onSubmitEdit,
|
|
242
|
+
onAddItem,
|
|
243
|
+
onDragEnd,
|
|
244
|
+
onSchemaFormChange,
|
|
245
|
+
onDrop,
|
|
246
|
+
onDragover,
|
|
247
|
+
onDragenter,
|
|
248
|
+
onDragleave,
|
|
249
|
+
onSchemaUpload,
|
|
250
|
+
fillData,
|
|
251
|
+
onIconClick,
|
|
252
|
+
validate,
|
|
253
|
+
guideVisible,
|
|
254
|
+
guideData,
|
|
255
|
+
editTitle,
|
|
256
|
+
onSchemaGetData,
|
|
257
|
+
onOpenCloud,
|
|
258
|
+
onPreloadCloud,
|
|
259
|
+
onEditTitle,
|
|
260
|
+
updateNavMenuConf,
|
|
261
|
+
loading,
|
|
262
|
+
onUndo,
|
|
263
|
+
onRedo,
|
|
264
|
+
viewScalePercent,
|
|
265
|
+
dialog,
|
|
266
|
+
onEditDialogConfirm,
|
|
267
|
+
onEditDialogCancel,
|
|
268
|
+
onDialogSchemaChange,
|
|
269
|
+
activeBarName,
|
|
270
|
+
onDataSourceChange,
|
|
271
|
+
onGetEntityList,
|
|
272
|
+
onGetMethodList,
|
|
273
|
+
onClick,
|
|
274
|
+
onInitValidateRule,
|
|
275
|
+
timestamp,
|
|
276
|
+
send,
|
|
277
|
+
navTreeRef
|
|
278
|
+
} = useEditor(props, emits);
|
|
279
|
+
|
|
280
|
+
defineExpose({ fillData, validate, editTitle, updateNavMenuConf, send });
|
|
281
|
+
</script>
|
|
282
|
+
|
|
283
|
+
<style lang="scss" scoped>
|
|
284
|
+
.editor {
|
|
285
|
+
height: 100%;
|
|
286
|
+
display: flex;
|
|
287
|
+
flex-direction: column;
|
|
288
|
+
align-items: stretch;
|
|
289
|
+
overflow: hidden;
|
|
290
|
+
|
|
291
|
+
&-top {
|
|
292
|
+
position: relative;
|
|
293
|
+
box-sizing: border-box;
|
|
294
|
+
background: #f8f8f8;
|
|
295
|
+
padding: 9px 23px;
|
|
296
|
+
display: flex;
|
|
297
|
+
/* z-index: 3; */
|
|
298
|
+
overflow-x: auto;
|
|
299
|
+
flex-shrink: 0;
|
|
300
|
+
flex-basis: 53px;
|
|
301
|
+
}
|
|
302
|
+
&-container {
|
|
303
|
+
display: flex;
|
|
304
|
+
flex-direction: row;
|
|
305
|
+
align-items: stretch;
|
|
306
|
+
overflow-y: hidden;
|
|
307
|
+
position: relative;
|
|
308
|
+
/* height: calc(100% - 53px); */
|
|
309
|
+
flex: 9;
|
|
310
|
+
&__empty {
|
|
311
|
+
flex: 1 0 410px;
|
|
312
|
+
display: flex;
|
|
313
|
+
justify-content: center;
|
|
314
|
+
margin-top: 11px;
|
|
315
|
+
font-weight: 400;
|
|
316
|
+
font-size: 16px;
|
|
317
|
+
color: #4d5260;
|
|
318
|
+
line-height: 24px;
|
|
319
|
+
}
|
|
320
|
+
&__tool {
|
|
321
|
+
flex: 1 1 480px;
|
|
322
|
+
display: flex;
|
|
323
|
+
flex-direction: column;
|
|
324
|
+
position: relative;
|
|
325
|
+
box-shadow: 0px 2px 12px rgba(216, 222, 235, 0.5);
|
|
326
|
+
height: 100%;
|
|
327
|
+
.divider {
|
|
328
|
+
height: 1px;
|
|
329
|
+
width: 100%;
|
|
330
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
&__context {
|
|
335
|
+
flex: 1 3 1100px;
|
|
336
|
+
position: relative;
|
|
337
|
+
background-color: #e8e8e8;
|
|
338
|
+
display: flex;
|
|
339
|
+
align-items: flex-start;
|
|
340
|
+
justify-content: center;
|
|
341
|
+
padding-top: 20px;
|
|
342
|
+
overflow: auto;
|
|
343
|
+
.iframe-box {
|
|
344
|
+
&.mask {
|
|
345
|
+
&::before {
|
|
346
|
+
content: '图片拖到这里上传';
|
|
347
|
+
z-index: inherit;
|
|
348
|
+
color: #fff;
|
|
349
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
350
|
+
position: absolute;
|
|
351
|
+
left: 0;
|
|
352
|
+
top: 0;
|
|
353
|
+
width: 100%;
|
|
354
|
+
height: 100%;
|
|
355
|
+
font-size: 16px;
|
|
356
|
+
display: flex;
|
|
357
|
+
align-items: center;
|
|
358
|
+
justify-content: center;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
.editor-iframe {
|
|
362
|
+
box-sizing: border-box;
|
|
363
|
+
border: 0;
|
|
364
|
+
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.1);
|
|
365
|
+
transition: all ease 300ms;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
&__schema {
|
|
371
|
+
flex: 1 0 364px;
|
|
372
|
+
box-sizing: border-box;
|
|
373
|
+
position: relative;
|
|
374
|
+
padding: 0 0 16px 0;
|
|
375
|
+
overflow: auto;
|
|
376
|
+
box-shadow: 0px 2px 12px rgba(216, 222, 235, 0.5);
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { connect, mapProps } from '@formily/vue';
|
|
2
|
+
import { transformComponent } from '@jt/formily';
|
|
3
|
+
// @ts-ignore
|
|
4
|
+
import JtActivityBar from './index.vue';
|
|
5
|
+
|
|
6
|
+
export type JtActivityBarProps = typeof JtActivityBar;
|
|
7
|
+
|
|
8
|
+
const TransformJtActivityBar = transformComponent<JtActivityBarProps>(
|
|
9
|
+
JtActivityBar,
|
|
10
|
+
{
|
|
11
|
+
change: 'update:modelValue',
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
export const ActivityBar = connect(
|
|
16
|
+
TransformJtActivityBar,
|
|
17
|
+
mapProps({
|
|
18
|
+
value: 'modelValue',
|
|
19
|
+
readOnly: 'readonly',
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
export default ActivityBar;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sidebar">
|
|
3
|
+
<div>
|
|
4
|
+
<el-tooltip content="大纲树" placement="right">
|
|
5
|
+
<span
|
|
6
|
+
:class="['title', modelValue === 'outline' ? 'activated' : '']"
|
|
7
|
+
@click="emits('update:modelValue', 'outline')"
|
|
8
|
+
>
|
|
9
|
+
<b class="title-icon">
|
|
10
|
+
<svg
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
preserveAspectRatio="xMidYMid meet"
|
|
13
|
+
width="20"
|
|
14
|
+
height="20"
|
|
15
|
+
viewBox="0 0 1024 1024"
|
|
16
|
+
data-spm-anchor-id="a2q5o.26736379.0.i46.c2202a4b1qWlpv"
|
|
17
|
+
>
|
|
18
|
+
<path
|
|
19
|
+
d="M128 96h512a64 64 0 0 1 64 64v64a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V160a64 64 0 0 1 64-64z m32 64a32 32 0 1 0 0 64h448a32 32 0 0 0 0-64H160z m224 576h512a64 64 0 0 1 64 64v64a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-64a64 64 0 0 1 64-64z m32 64a32 32 0 0 0 0 64h448a32 32 0 0 0 0-64H416z m-32-384h512a64 64 0 0 1 64 64v64a64 64 0 0 1-64 64H384a64 64 0 0 1-64-64v-64a64 64 0 0 1 64-64z m32 64a32 32 0 0 0 0 64h448a32 32 0 0 0 0-64H416z"
|
|
20
|
+
></path>
|
|
21
|
+
</svg>
|
|
22
|
+
</b>
|
|
23
|
+
</span>
|
|
24
|
+
</el-tooltip>
|
|
25
|
+
</div>
|
|
26
|
+
<div>
|
|
27
|
+
<el-tooltip content="组件库" placement="right">
|
|
28
|
+
<span
|
|
29
|
+
:class="['title', modelValue === 'truck' ? 'activated' : '']"
|
|
30
|
+
@click="emits('update:modelValue', 'truck')"
|
|
31
|
+
>
|
|
32
|
+
<b class="title-icon">
|
|
33
|
+
<svg
|
|
34
|
+
fill="currentColor"
|
|
35
|
+
preserveAspectRatio="xMidYMid meet"
|
|
36
|
+
width="20"
|
|
37
|
+
height="20"
|
|
38
|
+
viewBox="0 0 1024 1024"
|
|
39
|
+
class="ve-svgicon"
|
|
40
|
+
style="vertical-align: middle"
|
|
41
|
+
>
|
|
42
|
+
<path
|
|
43
|
+
d="M128 64h288a64 64 0 0 1 64 64v288a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64V128a64 64 0 0 1 64-64z m32 64a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h224a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32H160z m448-64h288a64 64 0 0 1 64 64v288a64 64 0 0 1-64 64h-288a64 64 0 0 1-64-64V128a64 64 0 0 1 64-64z m32 64a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h224a32 32 0 0 0 32-32V160a32 32 0 0 0-32-32h-224z m-32 416h288a64 64 0 0 1 64 64v288a64 64 0 0 1-64 64h-288a64 64 0 0 1-64-64v-288a64 64 0 0 1 64-64z m32 64a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h224a32 32 0 0 0 32-32v-224a32 32 0 0 0-32-32h-224zM128 544h288a64 64 0 0 1 64 64v288a64 64 0 0 1-64 64H128a64 64 0 0 1-64-64v-288a64 64 0 0 1 64-64z m32 64a32 32 0 0 0-32 32v224a32 32 0 0 0 32 32h224a32 32 0 0 0 32-32v-224a32 32 0 0 0-32-32H160z"
|
|
44
|
+
data-spm-anchor-id="a2q5o.26736379.0.i47.c2202a4b1qWlpv"
|
|
45
|
+
></path>
|
|
46
|
+
</svg>
|
|
47
|
+
</b>
|
|
48
|
+
</span>
|
|
49
|
+
</el-tooltip>
|
|
50
|
+
</div>
|
|
51
|
+
<div>
|
|
52
|
+
<el-tooltip content="数据源" placement="right">
|
|
53
|
+
<span
|
|
54
|
+
:class="['title', modelValue === 'datapool' ? 'activated' : '']"
|
|
55
|
+
@click="emits('update:modelValue', 'datapool')"
|
|
56
|
+
>
|
|
57
|
+
<b class="title-icon">
|
|
58
|
+
<svg
|
|
59
|
+
fill="currentColor"
|
|
60
|
+
preserveAspectRatio="xMidYMid meet"
|
|
61
|
+
width="20"
|
|
62
|
+
height="20"
|
|
63
|
+
viewBox="0 0 1024 1024"
|
|
64
|
+
class="ve-svgicon"
|
|
65
|
+
style="vertical-align: middle"
|
|
66
|
+
data-spm-anchor-id="a2q5o.26736379.0.i1.c2202a4b1qWlpv"
|
|
67
|
+
>
|
|
68
|
+
<path
|
|
69
|
+
d="M400 622.272c-118.912-7.264-220.544-37.504-280-79.712v81.408c0 55.488 121.056 101.568 280 110.4v55.904c-118.912-7.264-220.544-37.44-280-79.744v81.44H64V260C64 151.744 239.488 64 456 64c216.448 0 391.936 87.744 391.936 196v176.832h-56v-75.84c-68.576 56.896-193.408 94.976-335.968 94.976-142.56 0-267.36-38.08-336-94.976v94.976c0 55.488 121.088 101.6 280 110.432v55.872z m56 337.664c-216.512 0-392-75.2-392-168h56c0 61.888 150.4 112 336 112v56z m0-559.968c185.536 0 335.968-62.72 335.968-139.968 0-77.28-150.4-140-336-140-185.568 0-336 62.72-336 140 0 77.248 150.432 139.968 336 139.968z m487.264 367.36l-38.976-22.72c2.176-11.904 3.584-24.064 3.584-36.64a202.72 202.72 0 0 0-3.584-36.672l38.976-22.72c15.968-9.408 21.408-29.888 12.192-45.952l-33.28-58.176a33.152 33.152 0 0 0-45.568-12.32l-39.424 22.976a199.36 199.36 0 0 0-62.592-36.96v-28.576c0-18.528-14.88-33.6-33.312-33.6h-66.624a33.472 33.472 0 0 0-33.344 33.6v28.576a199.36 199.36 0 0 0-62.592 36.96l-39.424-22.976a33.152 33.152 0 0 0-45.536 12.32l-33.28 58.24a33.76 33.76 0 0 0 12.16 45.92l39.008 22.688c-2.304 12.064-3.52 24.352-3.584 36.672 0 12.576 1.376 24.736 3.584 36.672l-38.976 22.72c-16 9.376-21.44 29.856-12.224 45.92l33.312 58.176a33.152 33.152 0 0 0 45.536 12.32l39.424-22.944a198.784 198.784 0 0 0 62.592 36.96v28.544c0 18.56 14.912 33.6 33.344 33.6h66.624a33.472 33.472 0 0 0 33.312-33.6v-28.544a199.36 199.36 0 0 0 62.592-36.96l39.424 22.944a33.216 33.216 0 0 0 45.536-12.32l33.312-58.24a33.76 33.76 0 0 0-12.192-45.888z m-41.376 33.088l-15.36 26.144a15.52 15.52 0 0 1-20.992 5.472l-42.656-24.16a153.984 153.984 0 0 1-84.16 47.808v33.216c0 8.288-6.912 15.04-15.424 15.04h-30.688a15.232 15.232 0 0 1-15.36-15.104V855.68a153.984 153.984 0 0 1-84.192-47.808L550.4 832a15.52 15.52 0 0 1-21.024-5.472l-15.36-26.144a14.88 14.88 0 0 1 5.632-20.544l42.848-24.32a147.2 147.2 0 0 1-8.128-47.584c0-16.704 3.008-32.608 8.16-47.616l-42.88-24.32a14.88 14.88 0 0 1-5.6-20.512l15.36-26.176a15.52 15.52 0 0 1 20.992-5.472l42.656 24.192a153.984 153.984 0 0 1 84.16-47.808V527.04c0-8.32 6.88-15.04 15.392-15.04h30.72c8.48 0 15.36 6.72 15.36 15.104v33.152a153.984 153.984 0 0 1 84.16 47.808l42.688-24.192a15.52 15.52 0 0 1 20.992 5.472l15.36 26.176a14.88 14.88 0 0 1-5.6 20.544l-42.848 24.32c5.024 14.976 8.128 30.88 8.128 47.584 0 16.672-3.04 32.576-8.128 47.584l42.848 24.32a14.88 14.88 0 0 1 5.6 20.544z m-193.92-176.448a84 84 0 1 0 0 168 84 84 0 0 0 0-168z m0 112a28 28 0 1 1 0-56 28 28 0 0 1 0 56z"
|
|
70
|
+
data-spm-anchor-id="a2q5o.26736379.0.i32.c2202a4b1qWlpv"
|
|
71
|
+
></path>
|
|
72
|
+
</svg>
|
|
73
|
+
</b>
|
|
74
|
+
</span>
|
|
75
|
+
</el-tooltip>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script lang="ts" setup>
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
import { defineProps, defineEmits } from 'vue';
|
|
83
|
+
const props = defineProps({
|
|
84
|
+
modelValue: {
|
|
85
|
+
type: String,
|
|
86
|
+
default: '',
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
const emits = defineEmits(['update:modelValue']);
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<style lang="scss" scoped>
|
|
93
|
+
.sidebar {
|
|
94
|
+
padding-top: 12px;
|
|
95
|
+
height: 100%;
|
|
96
|
+
width: 48px;
|
|
97
|
+
display: flex;
|
|
98
|
+
flex-direction: column;
|
|
99
|
+
align-items: center;
|
|
100
|
+
justify-content: flex-start;
|
|
101
|
+
.title {
|
|
102
|
+
width: 46px;
|
|
103
|
+
height: 46px;
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-direction: column;
|
|
106
|
+
align-items: center;
|
|
107
|
+
justify-content: center;
|
|
108
|
+
cursor: pointer;
|
|
109
|
+
.title-icon {
|
|
110
|
+
width: 20px;
|
|
111
|
+
height: 20px;
|
|
112
|
+
margin: 0;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
.activated {
|
|
118
|
+
color: #0079f2;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { connect, mapProps } from '@formily/vue';
|
|
2
|
+
import { transformComponent } from '@jt/formily';
|
|
3
|
+
import JtComponentTree from '../../ComponentTree/index.vue';
|
|
4
|
+
|
|
5
|
+
export type JtComponentTreeProps = typeof JtComponentTree;
|
|
6
|
+
|
|
7
|
+
const TransformJtComponentTree = transformComponent<JtComponentTreeProps>(
|
|
8
|
+
JtComponentTree,
|
|
9
|
+
{
|
|
10
|
+
change: 'update:modelValue',
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const ActivityBar = connect(
|
|
15
|
+
TransformJtComponentTree,
|
|
16
|
+
mapProps({
|
|
17
|
+
value: 'modelValue',
|
|
18
|
+
readOnly: 'readonly',
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default ActivityBar;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { connect, mapProps } from '@formily/vue';
|
|
2
|
+
import { transformComponent } from '@jt/formily';
|
|
3
|
+
import JtDataBinding from './index.vue';
|
|
4
|
+
|
|
5
|
+
export type JtDataBindingProps = typeof JtDataBinding;
|
|
6
|
+
|
|
7
|
+
const TransformJtDataBinding = transformComponent<JtDataBindingProps>(
|
|
8
|
+
JtDataBinding,
|
|
9
|
+
{
|
|
10
|
+
change: 'update:modelValue',
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const MenuTable = connect(
|
|
15
|
+
TransformJtDataBinding,
|
|
16
|
+
mapProps({
|
|
17
|
+
value: 'modelValue',
|
|
18
|
+
readOnly: 'readonly',
|
|
19
|
+
})
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
export default MenuTable;
|