eoss 0.1.0-alpha.20 → 0.1.0-alpha.21
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/account-login.js +1943 -1890
- package/lib/alert.js +4 -4
- package/lib/aside.js +4 -4
- package/lib/autocomplete.js +4936 -4834
- package/lib/avatar.js +4 -4
- package/lib/backtop.js +4 -4
- package/lib/badge.js +4 -4
- package/lib/breadcrumb-item.js +6 -6
- package/lib/breadcrumb.js +7 -7
- package/lib/button-group.js +11 -14
- package/lib/button.js +6 -6
- package/lib/ca-login.js +2480 -2382
- package/lib/calendar.js +798 -798
- package/lib/card.js +4 -4
- package/lib/carousel-item.js +911 -813
- package/lib/carousel.js +1646 -1548
- package/lib/cascader-panel.js +2556 -2458
- package/lib/cascader.js +4546 -4444
- package/lib/checkbox-button.js +4 -4
- package/lib/checkbox-group.js +2894 -2841
- package/lib/checkbox.js +4 -4
- package/lib/col.js +2 -2
- package/lib/collapse-item.js +35159 -2572
- package/lib/collapse.js +35410 -2762
- package/lib/color-picker.js +494 -490
- package/lib/config/api.js +15 -1
- package/lib/container.js +4 -4
- package/lib/cron.js +4 -4
- package/lib/data-table.js +1895 -1842
- package/lib/date-picker.js +6422 -6320
- package/lib/dialog.js +2912 -2806
- package/lib/divider.js +4 -4
- package/lib/drawer.js +311 -299
- package/lib/dropdown-item.js +6 -6
- package/lib/dropdown-menu.js +539 -535
- package/lib/dropdown.js +2270 -2172
- package/lib/email-login.js +1783 -1730
- package/lib/empty.js +723 -0
- package/lib/eoss.common.js +63680 -56193
- package/lib/flip.js +4 -4
- package/lib/flow-group.js +2985 -2887
- package/lib/flow.js +28067 -28022
- package/lib/footer.js +4 -4
- package/lib/form-item.js +1935 -1837
- package/lib/form.js +9230 -9092
- package/lib/header.js +4 -4
- package/lib/icon.js +1708 -1590
- package/lib/icons.js +4 -4
- package/lib/image-viewer.js +1660 -1562
- package/lib/image.js +162 -162
- package/lib/index.js +1 -1
- package/lib/infinite-scroll.js +76 -76
- package/lib/input-number.js +172 -172
- package/lib/input.js +1362 -1264
- package/lib/link.js +4 -4
- package/lib/loading.js +321 -317
- package/lib/login.js +3306 -3300
- package/lib/lowcode.js +13320 -0
- package/lib/main.js +14465 -14339
- package/lib/marquee.js +1237 -1139
- package/lib/menu-item-group.js +119 -119
- package/lib/menu-item.js +114 -114
- package/lib/menu.js +6193 -6091
- package/lib/message-box.js +3582 -3480
- package/lib/message.js +2265 -2163
- package/lib/notification.js +2430 -2328
- package/lib/option-group.js +4 -4
- package/lib/option.js +842 -744
- package/lib/page-header.js +4 -4
- package/lib/pagination.js +1916 -1815
- package/lib/phone-login.js +1788 -1735
- package/lib/popconfirm.js +8 -8
- package/lib/popover.js +4559 -4457
- package/lib/progress.js +4 -4
- package/lib/qr-code.js +9 -9
- package/lib/qrcode-login.js +1600 -1543
- package/lib/radio-button.js +6 -6
- package/lib/radio-group.js +2142 -2089
- package/lib/radio.js +6 -6
- package/lib/rate.js +1226 -1128
- package/lib/row.js +2 -2
- package/lib/scrollbar.js +2695 -2597
- package/lib/select.js +5985 -5961
- package/lib/selector-panel.js +5239 -5186
- package/lib/selector.js +1712 -1659
- package/lib/slider.js +16 -16
- package/lib/step.js +35836 -2736
- package/lib/steps.js +1281 -1183
- package/lib/submenu.js +461 -457
- package/lib/switch.js +1010 -912
- package/lib/tab-pane.js +4 -4
- package/lib/table-column.js +2595 -2497
- package/lib/table.js +9225 -9239
- package/lib/tabs.js +2414 -2320
- package/lib/tag.js +4 -4
- package/lib/theme-chalk/account-login.css +1 -1
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/base.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/empty.css +1 -0
- package/lib/theme-chalk/fonts/iconfont.ttf +0 -0
- package/lib/theme-chalk/fonts/iconfont.woff +0 -0
- package/lib/theme-chalk/form.css +1 -1
- package/lib/theme-chalk/icon.css +1 -1
- package/lib/theme-chalk/index.css +1 -1
- package/lib/theme-chalk/input-number.css +1 -1
- package/lib/theme-chalk/input.css +1 -1
- package/lib/theme-chalk/login.css +1 -1
- package/lib/theme-chalk/lowcode.css +1 -0
- package/lib/theme-chalk/main.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/qrcode-login.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/tabs.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/time-picker.js +5823 -5819
- package/lib/time-select.js +3578 -3574
- package/lib/timeline-item.js +4 -4
- package/lib/timeline.js +4 -4
- package/lib/tips.js +1633 -1580
- package/lib/toolbar.js +213 -213
- package/lib/tooltip.js +4441 -4339
- package/lib/transfer.js +938 -840
- package/lib/tree-group.js +1875 -1757
- package/lib/tree.js +2626 -2573
- package/lib/upload.js +7209 -7156
- package/lib/utils/ajax.js +185 -243
- package/lib/utils/bus.js +2 -2
- package/lib/utils/popup/index.js +5 -1
- package/lib/utils/util.js +108 -11
- package/package.json +2 -2
- package/packages/button/src/button-group.vue +1 -4
- package/packages/collapse/src/collapse-item.vue +47 -33
- package/packages/dialog/src/dialog.vue +4 -1
- package/packages/drawer/src/drawer.vue +12 -4
- package/packages/empty/index.js +7 -0
- package/packages/empty/src/img-empty.vue +132 -0
- package/packages/empty/src/index.vue +49 -0
- package/packages/form/src/form-item-render.vue +16 -18
- package/packages/form/src/form.vue +27 -5
- package/packages/icons/src/icon.json +1 -1
- package/packages/login/src/login.vue +19 -21
- package/packages/login/src/mixins.js +2 -1
- package/packages/lowcode/index.js +5 -0
- package/packages/lowcode/src/aside.vue +331 -0
- package/packages/lowcode/src/attribute/bind.vue +441 -0
- package/packages/lowcode/src/attribute/dependency.vue +325 -0
- package/packages/lowcode/src/attribute/function.vue +112 -0
- package/packages/lowcode/src/attribute/property.vue +331 -0
- package/packages/lowcode/src/attribute/styles.vue +318 -0
- package/packages/lowcode/src/attribute.vue +135 -0
- package/packages/lowcode/src/canvas.vue +296 -0
- package/packages/lowcode/src/json.vue +32 -0
- package/packages/lowcode/src/lowcode.vue +539 -0
- package/packages/lowcode/src/modules.vue +93 -0
- package/packages/lowcode/src/pages.vue +91 -0
- package/packages/lowcode/src/render.vue +247 -0
- package/packages/lowcode/src/source.vue +32 -0
- package/packages/lowcode/src/toolbar.vue +162 -0
- package/packages/main/src/components/pages.vue +28 -2
- package/packages/main/src/components/set-menus.vue +3 -3
- package/packages/main/src/components/user.vue +6 -1
- package/packages/main/src/early.vue +2 -2
- package/packages/main/src/gzw.vue +55 -61
- package/packages/main/src/minxs.js +113 -36
- package/packages/pagination/src/pager.vue +2 -2
- package/packages/pagination/src/pagination.js +4 -1
- package/packages/qrcode-login/src/qrcode-login.vue +6 -2
- package/packages/select/src/select.vue +28 -6
- package/packages/steps/src/step.vue +7 -5
- package/packages/tabs/src/tab-nav.vue +1 -0
- package/packages/tabs/src/tabs.vue +0 -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/gulpfile.js +3 -0
- package/packages/theme-chalk/src/account-login.scss +1 -0
- package/packages/theme-chalk/src/base.scss +1 -1
- package/packages/theme-chalk/src/common/var.scss +16 -0
- package/packages/theme-chalk/src/empty.scss +45 -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/form.scss +1 -8
- package/packages/theme-chalk/src/icon.scss +30 -1
- package/packages/theme-chalk/src/index.scss +2 -0
- package/packages/theme-chalk/src/input-number.scss +0 -4
- package/packages/theme-chalk/src/input.scss +9 -0
- package/packages/theme-chalk/src/login.scss +32 -29
- package/packages/theme-chalk/src/lowcode.scss +461 -0
- package/packages/theme-chalk/src/main.scss +28 -65
- package/packages/theme-chalk/src/pagination.scss +4 -55
- package/packages/theme-chalk/src/qrcode-login.scss +3 -1
- package/packages/theme-chalk/src/tabs.scss +81 -50
- package/src/config/api.js +13 -0
- package/src/index.js +17 -4
- package/src/utils/ajax.js +61 -65
- package/src/utils/bus.js +2 -2
- package/src/utils/popup/index.js +5 -1
- package/src/utils/util.js +104 -7
- package/lib/index_/345/211/257/346/234/254.js +0 -583
- package/packages/dialog copy/index.js +0 -8
- package/packages/dialog copy/src/dialog.vue +0 -615
- package/src/index_/345/211/257/346/234/254.js +0 -359
- /package/{packages/form/src → src/components}/field-render.vue +0 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="newNode.style" :data-id="newNode.id" @click.stop="handleClick">
|
|
3
|
+
<component
|
|
4
|
+
:is="newNode.name"
|
|
5
|
+
v-bind="newNode.props"
|
|
6
|
+
v-on="newNode.events"
|
|
7
|
+
:key="newNode.id"
|
|
8
|
+
>
|
|
9
|
+
<template v-if="newNode.children && newNode.children.length > 0">
|
|
10
|
+
<Render
|
|
11
|
+
v-for="child in newNode.children"
|
|
12
|
+
:key="child.id"
|
|
13
|
+
:node="child"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
{{ newNode.description }}
|
|
18
|
+
</template>
|
|
19
|
+
</component>
|
|
20
|
+
<template v-if="newNode.id === active">
|
|
21
|
+
<div class="es-lowcode__handles">
|
|
22
|
+
<es-button
|
|
23
|
+
type="text"
|
|
24
|
+
size="mini"
|
|
25
|
+
icon="es-icon-shanchu"
|
|
26
|
+
@click="handleRemove"
|
|
27
|
+
></es-button>
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
class="es-lowcode__resize-handle is-top es-icon-lashen"
|
|
31
|
+
@pointerdown="handleResizeStart($event, newNode, 'top')"
|
|
32
|
+
@dragstart="$event.preventDefault()"
|
|
33
|
+
>
|
|
34
|
+
<span class="es-lowcode__resize-size" v-show="direction === 'top'">{{ height }}</span>
|
|
35
|
+
</div>
|
|
36
|
+
<div
|
|
37
|
+
class="es-lowcode__resize-handle is-bottom es-icon-lashen"
|
|
38
|
+
@pointerdown="handleResizeStart($event, newNode, 'bottom')"
|
|
39
|
+
@dragstart="$event.preventDefault()"
|
|
40
|
+
>
|
|
41
|
+
<span class="es-lowcode__resize-size" v-show="direction === 'bottom'">{{ height }}</span>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
class="es-lowcode__resize-handle is-left es-icon-stretch"
|
|
45
|
+
@pointerdown="handleResizeStart($event, newNode, 'left')"
|
|
46
|
+
@dragstart="$event.preventDefault()"
|
|
47
|
+
>
|
|
48
|
+
<span class="es-lowcode__resize-size" v-show="direction === 'left'">{{ width }}</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div
|
|
51
|
+
class="es-lowcode__resize-handle is-right es-icon-stretch"
|
|
52
|
+
@pointerdown="handleResizeStart($event, newNode, 'right')"
|
|
53
|
+
@dragstart="$event.preventDefault()"
|
|
54
|
+
>
|
|
55
|
+
<span class="es-lowcode__resize-size" v-show="direction === 'right'">{{ width }}</span>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
60
|
+
|
|
61
|
+
<script>
|
|
62
|
+
export default {
|
|
63
|
+
name: 'Render',
|
|
64
|
+
components: {},
|
|
65
|
+
props: {
|
|
66
|
+
node: {
|
|
67
|
+
type: Object,
|
|
68
|
+
default: null
|
|
69
|
+
},
|
|
70
|
+
active: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ''
|
|
73
|
+
},
|
|
74
|
+
span: {
|
|
75
|
+
type: Number,
|
|
76
|
+
default: 1
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
data() {
|
|
80
|
+
return {
|
|
81
|
+
newNode: JSON.parse(JSON.stringify(this.node)),
|
|
82
|
+
resizingComponent: null,
|
|
83
|
+
initialMouseX: 0,
|
|
84
|
+
initialMouseY: 0,
|
|
85
|
+
initialWidth: 0,
|
|
86
|
+
initialHeight: 0,
|
|
87
|
+
resizeObserver: null,
|
|
88
|
+
isResizing: false,
|
|
89
|
+
direction: '',
|
|
90
|
+
width: 0,
|
|
91
|
+
height: 0
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
watch: {
|
|
95
|
+
node: {
|
|
96
|
+
handler(newVal) {
|
|
97
|
+
this.newNode = JSON.parse(JSON.stringify(newVal));
|
|
98
|
+
},
|
|
99
|
+
deep: true
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
mounted() {},
|
|
103
|
+
beforeDestroy() {},
|
|
104
|
+
methods: {
|
|
105
|
+
/**
|
|
106
|
+
* 处理组件大小调整开始事件
|
|
107
|
+
* @param event 指针事件对象
|
|
108
|
+
* @param node 组件数据
|
|
109
|
+
* @param direction 调整方向
|
|
110
|
+
*/
|
|
111
|
+
handleResizeStart(event, node, direction) {
|
|
112
|
+
event.preventDefault();
|
|
113
|
+
event.stopPropagation(); // 阻止事件冒泡,防止触发父级点击事件
|
|
114
|
+
this.direction = direction;
|
|
115
|
+
// 只响应鼠标左键或触摸
|
|
116
|
+
if (event.pointerType === 'mouse' && event.button !== 0) return;
|
|
117
|
+
if (!node.style || !node.style.width || !node.style.height) {
|
|
118
|
+
// 从组件DOM元素获取实际宽高
|
|
119
|
+
const componentElement = document.querySelector(
|
|
120
|
+
`[data-id="${node.id}"]`
|
|
121
|
+
);
|
|
122
|
+
if (componentElement) {
|
|
123
|
+
// 获取计算后的样式
|
|
124
|
+
const computedStyle = window.getComputedStyle(componentElement);
|
|
125
|
+
const width =
|
|
126
|
+
parseInt(computedStyle.width) || componentElement.offsetWidth;
|
|
127
|
+
const height =
|
|
128
|
+
parseInt(computedStyle.height) || componentElement.offsetHeight;
|
|
129
|
+
// 使用Vue.set确保style对象是响应式的
|
|
130
|
+
this.$set(this.newNode, 'style', {
|
|
131
|
+
width: `${width}px`,
|
|
132
|
+
height: `${height}px`
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// 初始化调整大小的状态
|
|
138
|
+
this.resizingComponent = { ...this.newNode, direction };
|
|
139
|
+
this.initialMouseX = event.clientX;
|
|
140
|
+
this.initialMouseY = event.clientY;
|
|
141
|
+
// 记录初始宽高
|
|
142
|
+
this.initialWidth = parseInt(this.newNode.style.width) || 200;
|
|
143
|
+
this.initialHeight = parseInt(this.newNode.style.height) || 100;
|
|
144
|
+
this.$emit('change', this.newNode, true);
|
|
145
|
+
|
|
146
|
+
document.addEventListener('pointermove', this.handleResizeMove);
|
|
147
|
+
document.addEventListener('pointerup', this.handleResizeEnd);
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* 处理组件大小调整移动事件
|
|
151
|
+
* @param event 指针事件对象
|
|
152
|
+
*/
|
|
153
|
+
handleResizeMove(event) {
|
|
154
|
+
event.preventDefault();
|
|
155
|
+
event.stopPropagation();
|
|
156
|
+
this.isResizing = true;
|
|
157
|
+
const pointerEvent = event;
|
|
158
|
+
if (this.resizingComponent) {
|
|
159
|
+
const deltaX = pointerEvent.clientX - this.initialMouseX;
|
|
160
|
+
const deltaY = pointerEvent.clientY - this.initialMouseY;
|
|
161
|
+
const direction = this.resizingComponent.direction;
|
|
162
|
+
const canvasElement = document.querySelector(
|
|
163
|
+
'.es-lowcode__canvas--content'
|
|
164
|
+
);
|
|
165
|
+
const canvasWidth = (canvasElement && canvasElement.offsetWidth) || 0;
|
|
166
|
+
|
|
167
|
+
// 使用初始宽高进行计算
|
|
168
|
+
let newWidth = this.initialWidth;
|
|
169
|
+
let newHeight = this.initialHeight;
|
|
170
|
+
|
|
171
|
+
switch (direction) {
|
|
172
|
+
case 'top':
|
|
173
|
+
newHeight = this.initialHeight - deltaY;
|
|
174
|
+
break;
|
|
175
|
+
case 'bottom':
|
|
176
|
+
newHeight = this.initialHeight + deltaY;
|
|
177
|
+
break;
|
|
178
|
+
case 'left':
|
|
179
|
+
newWidth = this.initialWidth - deltaX;
|
|
180
|
+
break;
|
|
181
|
+
case 'right':
|
|
182
|
+
newWidth = this.initialWidth + deltaX;
|
|
183
|
+
break;
|
|
184
|
+
case 'top-left':
|
|
185
|
+
newWidth = this.initialWidth - deltaX;
|
|
186
|
+
newHeight = this.initialHeight - deltaY;
|
|
187
|
+
break;
|
|
188
|
+
case 'top-right':
|
|
189
|
+
newWidth = this.initialWidth + deltaX;
|
|
190
|
+
newHeight = this.initialHeight - deltaY;
|
|
191
|
+
break;
|
|
192
|
+
case 'bottom-left':
|
|
193
|
+
newWidth = this.initialWidth - deltaX;
|
|
194
|
+
newHeight = this.initialHeight + deltaY;
|
|
195
|
+
break;
|
|
196
|
+
case 'bottom-right':
|
|
197
|
+
newWidth = this.initialWidth + deltaX;
|
|
198
|
+
newHeight = this.initialHeight + deltaY;
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 限制最大宽度不超过画布宽度
|
|
203
|
+
newWidth = Math.min(canvasWidth, newWidth);
|
|
204
|
+
this.width = parseInt(newWidth);
|
|
205
|
+
this.height = parseInt(newHeight);
|
|
206
|
+
if (this.newNode) {
|
|
207
|
+
// 使用Vue.set确保样式变化能触发响应式更新
|
|
208
|
+
this.$set(this.newNode.style, 'width', `${newWidth}px`);
|
|
209
|
+
this.$set(this.newNode.style, 'height', `${newHeight}px`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
/**
|
|
214
|
+
* 处理组件大小调整结束事件
|
|
215
|
+
* @param event 鼠标事件对象
|
|
216
|
+
*/
|
|
217
|
+
handleResizeEnd(event) {
|
|
218
|
+
event.preventDefault();
|
|
219
|
+
event.stopPropagation(); // 阻止事件冒泡,防止触发父级点击事件
|
|
220
|
+
this.$emit('change', this.newNode, this.resizingComponent.direction);
|
|
221
|
+
this.resizingComponent = null;
|
|
222
|
+
document.removeEventListener('pointermove', this.handleResizeMove);
|
|
223
|
+
document.removeEventListener('pointerup', this.handleResizeEnd);
|
|
224
|
+
// 延迟重置调整状态,避免触发点击事件
|
|
225
|
+
setTimeout(() => {
|
|
226
|
+
this.isResizing = false;
|
|
227
|
+
}, 200);
|
|
228
|
+
},
|
|
229
|
+
/**
|
|
230
|
+
* 处理组件点击事件
|
|
231
|
+
*/
|
|
232
|
+
handleClick() {
|
|
233
|
+
// 如果正在调整大小,则不处理点击事件
|
|
234
|
+
if (this.isResizing) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
this.$emit('click');
|
|
238
|
+
},
|
|
239
|
+
/**
|
|
240
|
+
* 处理组件删除事件
|
|
241
|
+
*/
|
|
242
|
+
handleRemove() {
|
|
243
|
+
this.$emit('remove');
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
</script>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="es-lowcode__source">
|
|
3
|
+
<pre>{{ page }}</pre>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'Source',
|
|
10
|
+
|
|
11
|
+
components: {},
|
|
12
|
+
|
|
13
|
+
props: {},
|
|
14
|
+
|
|
15
|
+
data () {
|
|
16
|
+
return {
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
computed: {},
|
|
21
|
+
|
|
22
|
+
watch: {},
|
|
23
|
+
|
|
24
|
+
created() {},
|
|
25
|
+
|
|
26
|
+
mounted() {},
|
|
27
|
+
|
|
28
|
+
methods: {}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
</script>
|
|
32
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="es-lowcode__toolbar">
|
|
3
|
+
<es-button-group>
|
|
4
|
+
<es-button
|
|
5
|
+
:type="activeTool === 'web' ? 'primary' : 'default'"
|
|
6
|
+
size="small"
|
|
7
|
+
@click="handleClick('web')"
|
|
8
|
+
>
|
|
9
|
+
<i class="es-icon-diannao"></i>
|
|
10
|
+
</es-button>
|
|
11
|
+
<es-button
|
|
12
|
+
:type="activeTool === 'app' ? 'primary' : 'default'"
|
|
13
|
+
size="small"
|
|
14
|
+
@click="handleClick('app')"
|
|
15
|
+
>
|
|
16
|
+
<i class="es-icon-shouji"></i>
|
|
17
|
+
</es-button>
|
|
18
|
+
<es-button
|
|
19
|
+
:type="activeTool === 'custom' ? 'primary' : 'default'"
|
|
20
|
+
size="small"
|
|
21
|
+
@click="handleClick('custom')"
|
|
22
|
+
>
|
|
23
|
+
<i class="es-icon-xiugai"></i>
|
|
24
|
+
</es-button>
|
|
25
|
+
</es-button-group>
|
|
26
|
+
<div class="es-lowcode__toolbar--size" v-show="activeTool === 'custom'">
|
|
27
|
+
<es-input v-model="width" size="small" placeholder="请输入宽度" @change="handleChangeSize" />
|
|
28
|
+
<span class="es-lowcode__toolbar--size-split">x</span>
|
|
29
|
+
<es-input v-model="height" size="small" placeholder="请输入高度" @change="handleChangeSize" />
|
|
30
|
+
</div>
|
|
31
|
+
<es-button-group>
|
|
32
|
+
<es-button
|
|
33
|
+
size="small"
|
|
34
|
+
:disabled="isUndoDisabled"
|
|
35
|
+
@click="handleClick('repeal')"
|
|
36
|
+
>
|
|
37
|
+
<i class="es-icon-chehui"></i>
|
|
38
|
+
</es-button>
|
|
39
|
+
<es-button
|
|
40
|
+
size="small"
|
|
41
|
+
:disabled="isRedoDisabled"
|
|
42
|
+
@click="handleClick('advance')"
|
|
43
|
+
>
|
|
44
|
+
<i class="es-icon-qianjin"></i>
|
|
45
|
+
</es-button>
|
|
46
|
+
</es-button-group>
|
|
47
|
+
<div class="es-lowcode__toolbar--right">
|
|
48
|
+
<es-button-group>
|
|
49
|
+
<es-button
|
|
50
|
+
:type="activeTab === 'design' ? 'primary' : 'default'"
|
|
51
|
+
size="small"
|
|
52
|
+
>
|
|
53
|
+
设计
|
|
54
|
+
</es-button>
|
|
55
|
+
<es-button
|
|
56
|
+
:type="activeTab === 'json' ? 'primary' : 'default'"
|
|
57
|
+
size="small"
|
|
58
|
+
@click="handleOpen('json')"
|
|
59
|
+
>
|
|
60
|
+
JSON
|
|
61
|
+
</es-button>
|
|
62
|
+
<es-button
|
|
63
|
+
:type="activeTab === 'source' ? 'primary' : 'default'"
|
|
64
|
+
size="small"
|
|
65
|
+
@click="handleOpen('source')"
|
|
66
|
+
>
|
|
67
|
+
源码
|
|
68
|
+
</es-button>
|
|
69
|
+
</es-button-group>
|
|
70
|
+
<es-button-group separate>
|
|
71
|
+
<es-button type="primary" size="small" @click="handleSave">
|
|
72
|
+
保存
|
|
73
|
+
</es-button>
|
|
74
|
+
<es-button
|
|
75
|
+
type="primary"
|
|
76
|
+
class="es-margin-left-none"
|
|
77
|
+
size="small"
|
|
78
|
+
@click="handlePreview"
|
|
79
|
+
>
|
|
80
|
+
预览
|
|
81
|
+
</es-button>
|
|
82
|
+
</es-button-group>
|
|
83
|
+
<es-dropdown type="primary" @command="handlePublish" size="small">
|
|
84
|
+
<es-button type="primary" size="small">
|
|
85
|
+
发布<i class="es-icon-xia"></i>
|
|
86
|
+
</es-button>
|
|
87
|
+
|
|
88
|
+
<template #dropdown>
|
|
89
|
+
<es-dropdown-menu>
|
|
90
|
+
<es-dropdown-item command="page">发布页面</es-dropdown-item>
|
|
91
|
+
<es-dropdown-item command="component">发布组件</es-dropdown-item>
|
|
92
|
+
</es-dropdown-menu>
|
|
93
|
+
</template>
|
|
94
|
+
</es-dropdown>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script>
|
|
100
|
+
import bus from 'eoss/src/utils/bus.js'
|
|
101
|
+
import Button from 'eoss/packages/button';
|
|
102
|
+
import ButtonGroup from 'eoss/packages/button-group';
|
|
103
|
+
import Dropdown from 'eoss/packages/dropdown';
|
|
104
|
+
import DropdownMenu from 'eoss/packages/dropdown-menu';
|
|
105
|
+
import DropdownItem from 'eoss/packages/dropdown-item';
|
|
106
|
+
import Icon from 'eoss/packages/icon';
|
|
107
|
+
export default {
|
|
108
|
+
name: 'Toolbar',
|
|
109
|
+
|
|
110
|
+
components: {
|
|
111
|
+
ButtonGroup,
|
|
112
|
+
Button,
|
|
113
|
+
Dropdown,
|
|
114
|
+
DropdownMenu,
|
|
115
|
+
DropdownItem,
|
|
116
|
+
Icon
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
props: {},
|
|
120
|
+
|
|
121
|
+
data() {
|
|
122
|
+
return {
|
|
123
|
+
activeTool: 'web',
|
|
124
|
+
activeTab: 'design',
|
|
125
|
+
width: 300,
|
|
126
|
+
height: 200,
|
|
127
|
+
isUndoDisabled: true,
|
|
128
|
+
isRedoDisabled: true
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
computed: {},
|
|
133
|
+
|
|
134
|
+
watch: {},
|
|
135
|
+
|
|
136
|
+
created() {},
|
|
137
|
+
|
|
138
|
+
mounted() {},
|
|
139
|
+
|
|
140
|
+
methods: {
|
|
141
|
+
handleClick(tool) {
|
|
142
|
+
this.activeTool = tool;
|
|
143
|
+
bus.$emit('changeSize', tool, {width: `${this.width}px`, height: `${this.height}px` });
|
|
144
|
+
},
|
|
145
|
+
handleChangeSize() {
|
|
146
|
+
bus.$emit('changeSize', this.activeTool, {width: `${this.width}px`, height: `${this.height}px` });
|
|
147
|
+
},
|
|
148
|
+
handleOpen(type) {
|
|
149
|
+
bus.$emit('open', type);
|
|
150
|
+
},
|
|
151
|
+
handleSave() {
|
|
152
|
+
bus.$emit('save');
|
|
153
|
+
},
|
|
154
|
+
handlePreview() {
|
|
155
|
+
bus.$emit('preview');
|
|
156
|
+
},
|
|
157
|
+
handlePublish(command) {
|
|
158
|
+
bus.$emit('publish', command);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
</script>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<div
|
|
12
12
|
class="es-main-pages__handle--item"
|
|
13
13
|
:class="{ 'is-disabled': refresh }"
|
|
14
|
-
@click="
|
|
14
|
+
@click="handleRefresh"
|
|
15
15
|
>
|
|
16
16
|
刷新
|
|
17
17
|
</div>
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
:id="activeName == item.id ? iframeId : item.id || item.appCode"
|
|
115
115
|
:name="activeName == item.id ? iframeId : item.id || item.appCode"
|
|
116
116
|
:onload="handleLoadIframe(item)"
|
|
117
|
-
:src="item.url"
|
|
117
|
+
:src="renderUrl(item.url)"
|
|
118
118
|
></iframe>
|
|
119
119
|
</div>
|
|
120
120
|
</es-tab-pane>
|
|
@@ -225,6 +225,19 @@ export default {
|
|
|
225
225
|
},
|
|
226
226
|
|
|
227
227
|
methods: {
|
|
228
|
+
/**
|
|
229
|
+
* @desc:渲染url
|
|
230
|
+
* @author huangbo
|
|
231
|
+
* @date 2024年9月7日
|
|
232
|
+
**/
|
|
233
|
+
renderUrl(url) {
|
|
234
|
+
const userInfo = this.$main.userInfo || this.$main.userModel || {};
|
|
235
|
+
for (let key in userInfo) {
|
|
236
|
+
url = url.replace(new RegExp(`{{${key}}}`, 'g'), userInfo[key]);
|
|
237
|
+
}
|
|
238
|
+
return url;
|
|
239
|
+
},
|
|
240
|
+
|
|
228
241
|
handleSelect(res, index) {
|
|
229
242
|
const { node } = res;
|
|
230
243
|
if (node.urlopenmode === 1 || node.openModel === 1) {
|
|
@@ -331,6 +344,9 @@ export default {
|
|
|
331
344
|
* @date 2024年9月7日
|
|
332
345
|
**/
|
|
333
346
|
handleRefresh() {
|
|
347
|
+
if (this.refresh) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
334
350
|
let tab = this.tabs[this.index];
|
|
335
351
|
if (tab.method == 'iframe') {
|
|
336
352
|
this.tabs[this.index].url = timestampUrl(tab.url);
|
|
@@ -338,6 +354,8 @@ export default {
|
|
|
338
354
|
if (tab.method === 'router') {
|
|
339
355
|
this.$set(this.tabs[this.index], 'keys', uuid());
|
|
340
356
|
}
|
|
357
|
+
this.operate = false;
|
|
358
|
+
window.removeEventListener('click', this.closeTabsEvents);
|
|
341
359
|
},
|
|
342
360
|
/**
|
|
343
361
|
* @desc:关闭标签
|
|
@@ -356,6 +374,8 @@ export default {
|
|
|
356
374
|
}
|
|
357
375
|
}
|
|
358
376
|
this.tabs.splice(i, 1);
|
|
377
|
+
this.operate = false;
|
|
378
|
+
window.removeEventListener('click', this.closeTabsEvents);
|
|
359
379
|
},
|
|
360
380
|
/**
|
|
361
381
|
* @desc:关闭其他标签
|
|
@@ -366,6 +386,8 @@ export default {
|
|
|
366
386
|
let tab = this.tabs[this.index];
|
|
367
387
|
this.tabs = [tab];
|
|
368
388
|
this.activeName = tab.id;
|
|
389
|
+
this.operate = false;
|
|
390
|
+
window.removeEventListener('click', this.closeTabsEvents);
|
|
369
391
|
},
|
|
370
392
|
/**
|
|
371
393
|
* @desc:关闭左侧标签
|
|
@@ -378,6 +400,8 @@ export default {
|
|
|
378
400
|
this.activeName = this.tabs[i].id;
|
|
379
401
|
}
|
|
380
402
|
this.tabs.splice(0, i);
|
|
403
|
+
this.operate = false;
|
|
404
|
+
window.removeEventListener('click', this.closeTabsEvents);
|
|
381
405
|
},
|
|
382
406
|
/**
|
|
383
407
|
* @desc:关闭右侧标签
|
|
@@ -390,6 +414,8 @@ export default {
|
|
|
390
414
|
this.activeName = this.tabs[i].id;
|
|
391
415
|
}
|
|
392
416
|
this.tabs.splice(i + 1, this.tabs.length - 1);
|
|
417
|
+
this.operate = false;
|
|
418
|
+
window.removeEventListener('click', this.closeTabsEvents);
|
|
393
419
|
}
|
|
394
420
|
}
|
|
395
421
|
};
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
color="#fff"
|
|
44
44
|
></es-icon>
|
|
45
45
|
</div>
|
|
46
|
-
<div class="es-set-menus__apps--text">
|
|
46
|
+
<div class="es-set-menus__apps--text" :title="item.text || item.name">
|
|
47
47
|
{{ item.text || item.name }}
|
|
48
48
|
</div>
|
|
49
49
|
</li>
|
|
@@ -166,8 +166,8 @@ export default {
|
|
|
166
166
|
},
|
|
167
167
|
checkList: {
|
|
168
168
|
handler(newVal) {
|
|
169
|
-
if (this
|
|
170
|
-
this.
|
|
169
|
+
if (this.$main && this.$main.changeData) {
|
|
170
|
+
this.$main.changeData('customMenus', newVal);
|
|
171
171
|
}
|
|
172
172
|
},
|
|
173
173
|
deep: true
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
import userInfo from './userinfo.vue';
|
|
78
78
|
import { ajax } from 'eoss/src/utils/ajax';
|
|
79
79
|
import { removeStorage, setStorage } from 'eoss/src/utils/storage';
|
|
80
|
-
import { debounce } from 'throttle-debounce';
|
|
80
|
+
//import { debounce } from 'throttle-debounce';
|
|
81
81
|
import { initUserSet, switchUserTo } from 'eoss/src/config/api.js';
|
|
82
82
|
export default {
|
|
83
83
|
name: 'User',
|
|
@@ -139,6 +139,11 @@ export default {
|
|
|
139
139
|
this.checkPasswordMsg = results.checkPasswordMsg;
|
|
140
140
|
this.headImgCode = results.headImgCode || undefined;
|
|
141
141
|
this.$main.userInfo = results.simpleUserInfo;
|
|
142
|
+
setStorage({
|
|
143
|
+
type: this.storage,
|
|
144
|
+
key: 'userInfo',
|
|
145
|
+
value: results.simpleUserInfo
|
|
146
|
+
});
|
|
142
147
|
this.$emit('success', results);
|
|
143
148
|
} else {
|
|
144
149
|
let msg = res.msg || '系统错误,请联系管理员!';
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
>
|
|
28
28
|
<div
|
|
29
29
|
class="es-public-drawer-main"
|
|
30
|
-
v-if="
|
|
30
|
+
v-if="showAi"
|
|
31
31
|
v-show="drawer.active == 'ai'"
|
|
32
32
|
>
|
|
33
33
|
<iframe
|
|
34
34
|
frameborder="0"
|
|
35
35
|
width="100%"
|
|
36
36
|
height="100%"
|
|
37
|
-
:src="
|
|
37
|
+
:src="aiConfig.url"
|
|
38
38
|
></iframe>
|
|
39
39
|
</div>
|
|
40
40
|
<div
|