eoss 0.1.0-alpha.47 → 0.1.0-alpha.49
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/3.js +1 -1
- package/lib/autocomplete.js +6 -6
- package/lib/ca-login.js +2 -2
- package/lib/calendar.js +2 -2
- package/lib/cascader-panel.js +2 -2
- package/lib/cascader.js +4 -4
- package/lib/code-editor.js +2 -2
- package/lib/collapse-item.js +2 -2
- package/lib/collapse.js +2 -2
- package/lib/color-picker.js +2 -2
- package/lib/cron.js +4 -4
- package/lib/data-table.js +366 -20
- package/lib/date-picker.js +3 -3
- package/lib/dialog.js +12 -10
- package/lib/drawer.js +2 -2
- package/lib/dropdown-item.js +23 -4
- package/lib/dropdown.js +4 -4
- package/lib/empty.js +2 -2
- package/lib/eoss.common.js +734 -322
- package/lib/flow-group.js +2 -2
- package/lib/flow.js +7 -7
- package/lib/form-editor.js +2 -2
- package/lib/form.js +12 -11
- package/lib/guide.js +2 -2
- package/lib/icons.js +4 -4
- package/lib/index.js +1 -1
- package/lib/input.js +2 -2
- package/lib/loading.js +4 -4
- package/lib/lowcode-view.js +2 -2
- package/lib/lowcode.js +7 -50
- package/lib/main.js +5 -5
- package/lib/menu-item-group.js +5 -1
- package/lib/menu.js +33 -43
- package/lib/message-box.js +4 -4
- package/lib/message.js +2 -2
- package/lib/notification.js +2 -2
- package/lib/pagination.js +2 -2
- package/lib/process-module.js +2 -2
- package/lib/rate.js +2 -2
- package/lib/scrollbar.js +71 -87
- package/lib/select.js +23 -13
- package/lib/selector-panel.js +2 -2
- package/lib/selector.js +16 -18
- package/lib/slider.js +2 -2
- package/lib/step.js +2 -2
- package/lib/steps.js +4 -4
- package/lib/submenu.js +16 -24
- package/lib/switch.js +2 -2
- package/lib/table-column.js +69 -3
- package/lib/table.js +162 -56
- package/lib/tabs.js +2 -2
- package/lib/theme-chalk/autocomplete.css +1 -1
- package/lib/theme-chalk/cascader-panel.css +1 -1
- package/lib/theme-chalk/cascader.css +1 -1
- package/lib/theme-chalk/data-table.css +1 -1
- package/lib/theme-chalk/date-picker.css +1 -1
- package/lib/theme-chalk/form.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/menu.css +1 -1
- package/lib/theme-chalk/message-box.css +1 -1
- package/lib/theme-chalk/pagination.css +1 -1
- package/lib/theme-chalk/scrollbar.css +1 -1
- package/lib/theme-chalk/select.css +1 -1
- package/lib/theme-chalk/selector.css +1 -1
- package/lib/theme-chalk/slider.css +1 -1
- package/lib/theme-chalk/table.css +1 -1
- package/lib/theme-chalk/time-picker.css +1 -1
- package/lib/theme-chalk/time-select.css +1 -1
- package/lib/theme-chalk/transfer.css +1 -1
- package/lib/theme-chalk/tree.css +1 -1
- package/lib/theme-chalk/upload.css +1 -1
- package/lib/time-picker.js +2 -2
- package/lib/time-select.js +6 -6
- package/lib/toolbar.js +2 -2
- package/lib/transfer.js +4 -4
- package/lib/tree.js +8 -15
- package/lib/upload.js +20 -20
- package/lib/utils/popup/popup-manager.js +24 -8
- package/package.json +4 -1
- package/packages/data-table/src/data-table.vue +43 -8
- package/packages/data-table/src/sizer.vue +104 -87
- package/packages/dialog/src/dialog.vue +4 -2
- package/packages/dropdown/src/dropdown-item.vue +21 -3
- package/packages/form/src/form.vue +5 -8
- package/packages/icons/src/icons.vue +2 -2
- package/packages/lowcode/src/util/components.js +0 -59
- package/packages/menu/src/menu.vue +7 -21
- package/packages/menu/src/mixins.js +6 -1
- package/packages/menu/src/submenu.vue +7 -16
- package/packages/scrollbar/src/main.js +64 -78
- package/packages/select/src/select.vue +13 -6
- package/packages/selector/src/selector.vue +6 -13
- package/packages/table/src/config.js +48 -0
- package/packages/table/src/store/index.js +19 -4
- package/packages/table/src/store/watcher.js +14 -3
- package/packages/table/src/table-body.js +9 -4
- package/packages/table/src/table-column.js +17 -3
- package/packages/table/src/table-footer.js +4 -2
- package/packages/table/src/table-header.js +9 -6
- package/packages/table/src/table.vue +48 -27
- package/packages/theme-chalk/src/data-table.scss +4 -0
- package/packages/theme-chalk/src/form.scss +3 -0
- package/packages/theme-chalk/src/input.scss +2 -2
- package/packages/theme-chalk/src/menu.scss +8 -0
- package/packages/theme-chalk/src/mixins/function.scss +61 -12
- package/packages/theme-chalk/src/mixins/utils.scss +12 -0
- package/packages/theme-chalk/src/scrollbar.scss +4 -5
- package/packages/theme-chalk/src/selector.scss +6 -1
- package/packages/theme-chalk/src/table.scss +40 -0
- package/packages/theme-chalk/src/tree.scss +7 -6
- package/packages/theme-chalk/src/upload.scss +5 -0
- package/packages/tree/src/tree.vue +2 -13
- package/packages/upload/src/upload-list.vue +5 -10
- package/src/index.js +1 -1
- package/src/utils/popup/popup-manager.js +24 -9
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
</div>
|
|
6
|
-
<es-data-table
|
|
7
|
-
dragSort
|
|
8
|
-
numbers
|
|
9
|
-
form
|
|
10
|
-
row-key="id"
|
|
11
|
-
default-expand-all
|
|
12
|
-
height="480px"
|
|
13
|
-
:mode="mode"
|
|
14
|
-
:data="theads"
|
|
15
|
-
:thead="thead"
|
|
16
|
-
:tree-props="{ children: 'childHead' }"
|
|
17
|
-
@change="handleChange"
|
|
18
|
-
@update-drag-sort="handleDrag"
|
|
19
|
-
>
|
|
20
|
-
</es-data-table>
|
|
21
|
-
<div class="sizer-btn-box">
|
|
2
|
+
<div>
|
|
3
|
+
<es-table height="380px" :data.sync="rows" :thead="thead"> </es-table>
|
|
4
|
+
<div class="es-data-table__sizer-btn">
|
|
22
5
|
<es-button type="primary" size="medium" @click="handleConfirm"
|
|
23
6
|
>确定</es-button
|
|
24
7
|
>
|
|
@@ -35,25 +18,15 @@ export default {
|
|
|
35
18
|
components: { EsButton, EsDataTable },
|
|
36
19
|
|
|
37
20
|
props: {
|
|
38
|
-
|
|
39
|
-
|
|
21
|
+
data: Array,
|
|
22
|
+
showSummary: Boolean
|
|
40
23
|
},
|
|
41
24
|
computed: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return newData;
|
|
48
|
-
}
|
|
49
|
-
return [];
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
data() {
|
|
54
|
-
return {
|
|
55
|
-
visible: false,
|
|
56
|
-
thead: [
|
|
25
|
+
thead() {
|
|
26
|
+
const thead = [
|
|
27
|
+
{
|
|
28
|
+
type: 'drag'
|
|
29
|
+
},
|
|
57
30
|
{
|
|
58
31
|
title: '名称',
|
|
59
32
|
field: 'title'
|
|
@@ -62,9 +35,10 @@ export default {
|
|
|
62
35
|
title: '锁定列位置',
|
|
63
36
|
field: 'fixed',
|
|
64
37
|
type: 'select',
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
config: {
|
|
39
|
+
clearable: true
|
|
40
|
+
},
|
|
41
|
+
optionData: [
|
|
68
42
|
{
|
|
69
43
|
value: 'left',
|
|
70
44
|
name: '左'
|
|
@@ -79,43 +53,58 @@ export default {
|
|
|
79
53
|
title: '列是否显示',
|
|
80
54
|
field: 'hide',
|
|
81
55
|
type: 'switch',
|
|
82
|
-
width: 160,
|
|
83
56
|
align: 'center',
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
value: false,
|
|
104
|
-
name: '关闭'
|
|
105
|
-
},
|
|
57
|
+
// row.hide 为「是否显示」(true=显示),与 thead.hide(true=隐藏)互反,
|
|
58
|
+
// es-switch 的 ON(true)/OFF(false) 文案按显示语义对应
|
|
59
|
+
config: {
|
|
60
|
+
data: [
|
|
61
|
+
{
|
|
62
|
+
value: false,
|
|
63
|
+
name: '隐藏'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
value: true,
|
|
67
|
+
name: '显示'
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
return this.showSummary
|
|
74
|
+
? [
|
|
75
|
+
...thead,
|
|
106
76
|
{
|
|
107
|
-
|
|
108
|
-
|
|
77
|
+
title: '是否开启合计',
|
|
78
|
+
field: 'total',
|
|
79
|
+
type: 'switch',
|
|
80
|
+
align: 'center',
|
|
81
|
+
data: [
|
|
82
|
+
{
|
|
83
|
+
value: false,
|
|
84
|
+
name: '关闭'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
value: true,
|
|
88
|
+
name: '开启'
|
|
89
|
+
}
|
|
90
|
+
]
|
|
109
91
|
}
|
|
110
92
|
]
|
|
111
|
-
|
|
112
|
-
|
|
93
|
+
: thead;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
data() {
|
|
97
|
+
return {
|
|
98
|
+
visible: false,
|
|
113
99
|
newThead: [],
|
|
114
|
-
|
|
100
|
+
// sizer 表格行模型(活模型):拖拽顺序经 :data.sync 回写,
|
|
101
|
+
// 锁定/显示/合计等编辑由 renderDom 的 setValue 直接写回行对象
|
|
102
|
+
rows: []
|
|
115
103
|
};
|
|
116
104
|
},
|
|
117
105
|
mounted() {
|
|
118
106
|
this.newThead = extend(true, [], this.data);
|
|
107
|
+
this.getThead(this.data, this.rows);
|
|
119
108
|
},
|
|
120
109
|
methods: {
|
|
121
110
|
show() {
|
|
@@ -126,7 +115,8 @@ export default {
|
|
|
126
115
|
if (
|
|
127
116
|
item.type !== 'index' &&
|
|
128
117
|
item.type !== 'selection' &&
|
|
129
|
-
item.type !== 'handle'
|
|
118
|
+
item.type !== 'handle' &&
|
|
119
|
+
item.type !== 'drag'
|
|
130
120
|
) {
|
|
131
121
|
let { fixed, hide, childHead, children, title, ...other } = item;
|
|
132
122
|
let items = {
|
|
@@ -152,8 +142,6 @@ export default {
|
|
|
152
142
|
items.children = childHeads;
|
|
153
143
|
}
|
|
154
144
|
data.push(items);
|
|
155
|
-
} else {
|
|
156
|
-
this.nid++;
|
|
157
145
|
}
|
|
158
146
|
});
|
|
159
147
|
},
|
|
@@ -175,24 +163,53 @@ export default {
|
|
|
175
163
|
}
|
|
176
164
|
}
|
|
177
165
|
},
|
|
178
|
-
handleChange(res) {
|
|
179
|
-
this.setThead(res, this.newThead);
|
|
180
|
-
},
|
|
181
|
-
handleDrag(res, evt) {
|
|
182
|
-
let { oldIndex, newIndex } = evt;
|
|
183
|
-
oldIndex += this.nid;
|
|
184
|
-
newIndex += this.nid;
|
|
185
|
-
if (oldIndex > newIndex) {
|
|
186
|
-
this.newThead.splice(newIndex, 0, this.newThead[oldIndex]);
|
|
187
|
-
this.newThead.splice(oldIndex + 1, 1);
|
|
188
|
-
} else {
|
|
189
|
-
this.newThead.splice(newIndex + 1, 0, this.newThead[oldIndex]);
|
|
190
|
-
this.newThead.splice(oldIndex, 1);
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
166
|
handleConfirm() {
|
|
167
|
+
console.log(this.newThead, this.rows);
|
|
194
168
|
this.visible = false;
|
|
195
|
-
|
|
169
|
+
// rows 是拖拽+编辑后的活模型:按 field 把各列新值反写回 newThead
|
|
170
|
+
// (取值映射与 getThead/setThead 的约定互逆),再按 rows 顺序重排,
|
|
171
|
+
// drag/handle 等不在 rows 里的结构列保持原槽位不动
|
|
172
|
+
const rowByField = {};
|
|
173
|
+
this.rows.forEach((row) => {
|
|
174
|
+
rowByField[row.field] = row;
|
|
175
|
+
});
|
|
176
|
+
const applyRow = (item) => {
|
|
177
|
+
const row = rowByField[item.field];
|
|
178
|
+
if (row) {
|
|
179
|
+
if (row.fixed === 'left') {
|
|
180
|
+
item.fixed = true;
|
|
181
|
+
} else if (row.fixed === 'right') {
|
|
182
|
+
item.fixed = 'right';
|
|
183
|
+
} else {
|
|
184
|
+
delete item.fixed;
|
|
185
|
+
}
|
|
186
|
+
// row.hide 为「是否显示」,与 thead.hide(true=隐藏)互反,回写时取反;
|
|
187
|
+
// false 时删键保持 thead 干净(与 setThead 的历史处理一致)
|
|
188
|
+
item.hide = !row.hide;
|
|
189
|
+
item.hide === false && delete item.hide;
|
|
190
|
+
// 合计列在展示时把每列 total 标记显式回写:table-footer 默认对
|
|
191
|
+
// 除 total===false 外的所有列求和,不显式化会把未开启合计的列也算进去
|
|
192
|
+
if (this.showSummary || 'total' in row) {
|
|
193
|
+
item.total = !!row.total;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (item.childHead && item.childHead.length) {
|
|
197
|
+
item.childHead.forEach(applyRow);
|
|
198
|
+
}
|
|
199
|
+
if (item.children && item.children.length) {
|
|
200
|
+
item.children.forEach(applyRow);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
this.newThead.forEach(applyRow);
|
|
204
|
+
const order = this.rows.map((row) => row.field);
|
|
205
|
+
const pool = this.newThead
|
|
206
|
+
.filter((item) => order.includes(item.field))
|
|
207
|
+
.sort((a, b) => order.indexOf(a.field) - order.indexOf(b.field));
|
|
208
|
+
let i = 0;
|
|
209
|
+
const merged = this.newThead.map((item) =>
|
|
210
|
+
order.includes(item.field) ? pool[i++] : item
|
|
211
|
+
);
|
|
212
|
+
this.$emit('confirm', merged);
|
|
196
213
|
}
|
|
197
214
|
}
|
|
198
215
|
};
|
|
@@ -365,13 +365,15 @@ export default {
|
|
|
365
365
|
* 获取定位基准矩形(视口)
|
|
366
366
|
* wujie 沙箱(非降级)下 document.body 为 shadowRoot.body,其 rect 只是子应用在主应用内的容器区域
|
|
367
367
|
* (扣除了主应用侧栏/顶栏),fixed 定位的 dialog 用它居中、定边界会整体偏移;
|
|
368
|
-
* documentElement
|
|
368
|
+
* 沙箱内 documentElement 仅在主应用注册了 wujie-polyfill 的 DocElementRectPlugin 时才被修正(如 eoss-ui 的 main 未注册),
|
|
369
|
+
* 故直接通过 __WUJIE_RAW_WINDOW__ 取主应用真实视口尺寸做基准,不依赖主应用是否配置插件;
|
|
369
370
|
* 降级模式与非微前端环境保持原有 document.body 基准不变
|
|
370
371
|
*/
|
|
371
372
|
getViewportRect() {
|
|
372
373
|
if (window.__WUJIE && !window.__WUJIE.degrade) {
|
|
374
|
+
const rawWindow = window.__WUJIE_RAW_WINDOW__ || window;
|
|
373
375
|
const { clientWidth: width, clientHeight: height } =
|
|
374
|
-
document.documentElement;
|
|
376
|
+
rawWindow.document.documentElement;
|
|
375
377
|
return { width, height, top: 0, left: 0 };
|
|
376
378
|
}
|
|
377
379
|
return document.body.getBoundingClientRect();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- 根据rules
|
|
2
|
+
<!-- 根据rules条件决定是否渲染;表格操作列场景下行数据从 esButtonGroup 取 -->
|
|
3
3
|
<li
|
|
4
|
-
v-if="
|
|
4
|
+
v-if="checkRules()"
|
|
5
5
|
class="es-dropdown-menu__item"
|
|
6
6
|
:class="{
|
|
7
7
|
'is-disabled': disabled,
|
|
@@ -55,7 +55,11 @@ export default {
|
|
|
55
55
|
name: 'EsDropdownItem',
|
|
56
56
|
|
|
57
57
|
mixins: [Emitter],
|
|
58
|
-
inject:
|
|
58
|
+
inject: {
|
|
59
|
+
dropdownMenu: { default: null },
|
|
60
|
+
// 按钮组内使用时由 es-button-group provide;独立使用 dropdown 时为 null
|
|
61
|
+
esButtonGroup: { default: null }
|
|
62
|
+
},
|
|
59
63
|
components: { EsTooltip, EsIcon },
|
|
60
64
|
|
|
61
65
|
props: {
|
|
@@ -117,6 +121,20 @@ export default {
|
|
|
117
121
|
this.dropdownMenu.menuItemCreate(this.$el, this.divided);
|
|
118
122
|
},
|
|
119
123
|
methods: {
|
|
124
|
+
/**
|
|
125
|
+
* rules 校验:按钮组场景(表格操作列)用行数据调用,
|
|
126
|
+
* 否则 rules 拿到 undefined 会把本该显示的菜单项判掉
|
|
127
|
+
* @returns {Boolean} 是否渲染该菜单项
|
|
128
|
+
*/
|
|
129
|
+
checkRules() {
|
|
130
|
+
if (!this.rules) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
if (this.esButtonGroup) {
|
|
134
|
+
return this.rules(this.esButtonGroup.data, this.esButtonGroup.rowData);
|
|
135
|
+
}
|
|
136
|
+
return this.rules(this.param);
|
|
137
|
+
},
|
|
120
138
|
/**
|
|
121
139
|
* 处理点击事件
|
|
122
140
|
* @param {Event} evt - 点击事件对象
|
|
@@ -109,11 +109,7 @@
|
|
|
109
109
|
</template>
|
|
110
110
|
<script>
|
|
111
111
|
import objectAssign from 'eoss/src/utils/merge';
|
|
112
|
-
import {
|
|
113
|
-
getScrollbarWidth,
|
|
114
|
-
getScrollSize,
|
|
115
|
-
scrollMove
|
|
116
|
-
} from 'eoss/src/utils/scrollbar';
|
|
112
|
+
import { getScrollSize, scrollMove } from 'eoss/src/utils/scrollbar';
|
|
117
113
|
import { throttle } from 'throttle-debounce';
|
|
118
114
|
import { uuid, extend, exclAttribute, getWinTop } from 'eoss/src/utils/util';
|
|
119
115
|
import { isObject } from 'eoss/src/utils/types.js';
|
|
@@ -486,11 +482,12 @@ export default {
|
|
|
486
482
|
bodyWrapper() {
|
|
487
483
|
return this.$refs.scrollbar;
|
|
488
484
|
},
|
|
489
|
-
//
|
|
485
|
+
// 滚动条样式:只声明滚动方向,原生滚动条由 CSS 隐藏(见 form.scss 的
|
|
486
|
+
// .es-form-scroll),它不占位,也就不需要再按条宽加宽容器——那样在浏览器
|
|
487
|
+
// 缩放时量到的 15px 和实际渲染宽度对不上,容器右侧会露出一条灰边
|
|
490
488
|
scrollStyle() {
|
|
491
489
|
if (!this.inline && !this.accordion) {
|
|
492
|
-
|
|
493
|
-
return { width: `calc(100% + ${barWidth}px)`, 'overflow-y': 'scroll' };
|
|
490
|
+
return { 'overflow-y': 'scroll' };
|
|
494
491
|
}
|
|
495
492
|
return {};
|
|
496
493
|
}
|
|
@@ -209,7 +209,7 @@ export default {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
const keyword = newVal.toLowerCase();
|
|
212
|
-
this.filteredIconsList = this.
|
|
212
|
+
this.filteredIconsList = this.filterIcons(keyword);
|
|
213
213
|
}),
|
|
214
214
|
immediate: true
|
|
215
215
|
}
|
|
@@ -229,7 +229,7 @@ export default {
|
|
|
229
229
|
* @param {string} keyword - 搜索关键词
|
|
230
230
|
* @returns {Array} 过滤后的图标列表
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
filterIcons(keyword) {
|
|
233
233
|
return this.allIcons.filter((name) => {
|
|
234
234
|
if (typeof name === 'string') {
|
|
235
235
|
return (
|
|
@@ -9712,35 +9712,6 @@ export default [
|
|
|
9712
9712
|
}
|
|
9713
9713
|
]
|
|
9714
9714
|
},
|
|
9715
|
-
{
|
|
9716
|
-
name: 'dragSort',
|
|
9717
|
-
type: 'switch',
|
|
9718
|
-
default: false,
|
|
9719
|
-
label: [
|
|
9720
|
-
{
|
|
9721
|
-
type: 'tips',
|
|
9722
|
-
contents: '是否行拖拽排序(需清除列固定)'
|
|
9723
|
-
},
|
|
9724
|
-
{
|
|
9725
|
-
type: 'text',
|
|
9726
|
-
contents: 'dragSort'
|
|
9727
|
-
}
|
|
9728
|
-
]
|
|
9729
|
-
},
|
|
9730
|
-
{
|
|
9731
|
-
name: 'dragSortClass',
|
|
9732
|
-
type: 'text',
|
|
9733
|
-
label: [
|
|
9734
|
-
{
|
|
9735
|
-
type: 'tips',
|
|
9736
|
-
contents: '行拖拽排序指示器(handle)类名'
|
|
9737
|
-
},
|
|
9738
|
-
{
|
|
9739
|
-
type: 'text',
|
|
9740
|
-
contents: 'dragSortClass'
|
|
9741
|
-
}
|
|
9742
|
-
]
|
|
9743
|
-
},
|
|
9744
9715
|
{
|
|
9745
9716
|
name: 'infiniteScroll',
|
|
9746
9717
|
type: 'text',
|
|
@@ -9983,21 +9954,6 @@ export default [
|
|
|
9983
9954
|
}
|
|
9984
9955
|
]
|
|
9985
9956
|
},
|
|
9986
|
-
{
|
|
9987
|
-
name: 'dragSort',
|
|
9988
|
-
type: 'switch',
|
|
9989
|
-
default: false,
|
|
9990
|
-
label: [
|
|
9991
|
-
{
|
|
9992
|
-
type: 'tips',
|
|
9993
|
-
contents: '是否行拖拽排序'
|
|
9994
|
-
},
|
|
9995
|
-
{
|
|
9996
|
-
type: 'text',
|
|
9997
|
-
contents: 'dragSort'
|
|
9998
|
-
}
|
|
9999
|
-
]
|
|
10000
|
-
},
|
|
10001
9957
|
{
|
|
10002
9958
|
name: 'readonly',
|
|
10003
9959
|
type: 'switch',
|
|
@@ -10549,21 +10505,6 @@ export default [
|
|
|
10549
10505
|
contents: 'executeFilter'
|
|
10550
10506
|
}
|
|
10551
10507
|
]
|
|
10552
|
-
},
|
|
10553
|
-
{
|
|
10554
|
-
name: 'dragSortIcon',
|
|
10555
|
-
type: 'text',
|
|
10556
|
-
default: 'es-icon-caidan',
|
|
10557
|
-
label: [
|
|
10558
|
-
{
|
|
10559
|
-
type: 'tips',
|
|
10560
|
-
contents: '行拖拽排序操作列图标'
|
|
10561
|
-
},
|
|
10562
|
-
{
|
|
10563
|
-
type: 'text',
|
|
10564
|
-
contents: 'dragSortIcon'
|
|
10565
|
-
}
|
|
10566
|
-
]
|
|
10567
10508
|
}
|
|
10568
10509
|
]
|
|
10569
10510
|
},
|
|
@@ -74,11 +74,7 @@ import emitter from 'eoss/src/mixins/emitter';
|
|
|
74
74
|
import Migrating from 'eoss/src/mixins/migrating';
|
|
75
75
|
import Menubar from 'eoss/src/utils/menu/aria-menubar';
|
|
76
76
|
import { addClass, removeClass, hasClass } from 'eoss/src/utils/dom';
|
|
77
|
-
import {
|
|
78
|
-
getScrollbarWidth,
|
|
79
|
-
getScrollSize,
|
|
80
|
-
scrollMove
|
|
81
|
-
} from 'eoss/src/utils/scrollbar';
|
|
77
|
+
import { getScrollSize, scrollMove } from 'eoss/src/utils/scrollbar';
|
|
82
78
|
import { throttle } from 'throttle-debounce';
|
|
83
79
|
/**
|
|
84
80
|
* 导航菜单组件
|
|
@@ -338,20 +334,13 @@ export default {
|
|
|
338
334
|
(this.mode === 'vertical' && this.collapse)
|
|
339
335
|
);
|
|
340
336
|
},
|
|
337
|
+
// 菜单容器自身滚动,原生条由 CSS 隐藏(见 menu.scss 的 .es-menu-container),
|
|
338
|
+
// 不占位也就无需按条宽加大容器把它推出去——那样在浏览器缩放时量到的 15px
|
|
339
|
+
// 和实际渲染宽度对不上,容器右/下侧会露出一条灰边
|
|
341
340
|
styles() {
|
|
342
|
-
// 优化:使用预计算的滚动条宽度,避免重复计算
|
|
343
|
-
const barWidth = this.scrollbarWidth;
|
|
344
341
|
return this.mode === 'horizontal'
|
|
345
|
-
? {
|
|
346
|
-
|
|
347
|
-
width: '100%',
|
|
348
|
-
'overflow-x': 'scroll'
|
|
349
|
-
}
|
|
350
|
-
: {
|
|
351
|
-
width: `calc(100% + ${barWidth}px)`,
|
|
352
|
-
height: '100%',
|
|
353
|
-
'overflow-y': 'scroll'
|
|
354
|
-
};
|
|
342
|
+
? { height: '100%', width: '100%', 'overflow-x': 'scroll' }
|
|
343
|
+
: { width: '100%', height: '100%', 'overflow-y': 'scroll' };
|
|
355
344
|
}
|
|
356
345
|
},
|
|
357
346
|
watch: {
|
|
@@ -406,8 +395,7 @@ export default {
|
|
|
406
395
|
items: {},
|
|
407
396
|
submenus: {},
|
|
408
397
|
moveTo: 0,
|
|
409
|
-
barSize: 0
|
|
410
|
-
scrollbarWidth: 0
|
|
398
|
+
barSize: 0
|
|
411
399
|
};
|
|
412
400
|
},
|
|
413
401
|
beforeCreate() {
|
|
@@ -415,8 +403,6 @@ export default {
|
|
|
415
403
|
},
|
|
416
404
|
created() {},
|
|
417
405
|
mounted() {
|
|
418
|
-
// 计算并存储滚动条宽度,避免重复计算
|
|
419
|
-
this.scrollbarWidth = getScrollbarWidth();
|
|
420
406
|
this.initOpenedMenu();
|
|
421
407
|
this.$on('item-click', this.handleItemClick);
|
|
422
408
|
this.$on('submenu-click', this.handleSubmenuClick);
|
|
@@ -93,7 +93,12 @@ export default {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
const { id, index, open, extendData, ...rest } = item;
|
|
96
|
-
|
|
96
|
+
// extendData 存在时以它为准,没有则回退到 item 自身的 open;
|
|
97
|
+
// 原写法 `open || extendData ? Boolean(extendData.openStatus)` 在
|
|
98
|
+
// 只声明了 open、没带 extendData 的菜单项上会直接抛错
|
|
99
|
+
const openStatus = extendData
|
|
100
|
+
? Boolean(extendData.openStatus)
|
|
101
|
+
: Boolean(open);
|
|
97
102
|
let props;
|
|
98
103
|
if (this.isFourthTabs) {
|
|
99
104
|
if ((item.children && item.children.length) || (item.fourthTabs && item.fourthTabs.length)) {
|
|
@@ -109,8 +109,11 @@
|
|
|
109
109
|
]"
|
|
110
110
|
:style="{
|
|
111
111
|
backgroundColor: rootMenu.backgroundColor || '',
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
// 原生条已由 CSS 隐藏(见 menu.scss 的
|
|
113
|
+
// .es-menu-hidden > .es-menu--popup),不占位也就无需再用
|
|
114
|
+
// marginRight: -条宽 把它推出容器——缩放时量到的 15px 和
|
|
115
|
+
// 实际渲染宽度对不上,popup 右/下侧会露出一条灰边
|
|
116
|
+
maxHeight: maxH === undefined ? '' : maxH
|
|
114
117
|
}"
|
|
115
118
|
>
|
|
116
119
|
<slot>
|
|
@@ -162,7 +165,6 @@
|
|
|
162
165
|
</template>
|
|
163
166
|
|
|
164
167
|
<script>
|
|
165
|
-
import { getScrollbarWidth } from 'eoss/src/utils/scrollbar';
|
|
166
168
|
import mixins from './mixins';
|
|
167
169
|
import menuMixin from './menu-mixin';
|
|
168
170
|
import Emitter from 'eoss/src/mixins/emitter';
|
|
@@ -399,9 +401,6 @@ export default {
|
|
|
399
401
|
? 'es-icon-xia'
|
|
400
402
|
: 'es-icon-you';
|
|
401
403
|
},
|
|
402
|
-
gutterWith() {
|
|
403
|
-
return `-${getScrollbarWidth()}px`;
|
|
404
|
-
},
|
|
405
404
|
iconClass() {
|
|
406
405
|
return this.icon || this.rootMenu.parentMenuIcon || this.rootMenu.icon;
|
|
407
406
|
},
|
|
@@ -459,7 +458,6 @@ export default {
|
|
|
459
458
|
items: {},
|
|
460
459
|
submenus: {},
|
|
461
460
|
mouseInChild: false,
|
|
462
|
-
isScroll: false,
|
|
463
461
|
height: '',
|
|
464
462
|
isHoveringTitle: false
|
|
465
463
|
};
|
|
@@ -601,15 +599,8 @@ export default {
|
|
|
601
599
|
updated() {
|
|
602
600
|
this.$nextTick(() => {
|
|
603
601
|
const dom = this.$refs.menucontent;
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
(dom.scrollHeight > dom.clientHeight ||
|
|
607
|
-
dom.offsetHeight > dom.clientHeight)
|
|
608
|
-
) {
|
|
609
|
-
this.isScroll = true;
|
|
610
|
-
} else {
|
|
611
|
-
this.isScroll = false;
|
|
612
|
-
}
|
|
602
|
+
// 只需要给 es-scrollbar 分支算高度;popup 分支的原生条由 CSS 隐藏,
|
|
603
|
+
// 不再需要判定是否出了滚动条去抵消它的占位
|
|
613
604
|
if (dom && this.maxH && dom.clientHeight > parseInt(this.maxH, 10)) {
|
|
614
605
|
this.height = this.maxH;
|
|
615
606
|
} else {
|