xt-element-ui 2.1.5 → 2.1.7
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/docs/components/base/xt-badge.md +0 -2
- package/docs/components/base/xt-bar.md +5 -32
- package/docs/components/base/xt-button.md +0 -2
- package/docs/components/base/xt-card-item.md +0 -2
- package/docs/components/base/xt-card.md +17 -19
- package/docs/components/base/xt-chart.md +5 -31
- package/docs/components/base/xt-config-provider.md +0 -2
- package/docs/components/base/xt-date-picker.md +268 -180
- package/docs/components/base/xt-flex-box.md +25 -25
- package/docs/components/base/xt-form-schema.md +356 -0
- package/docs/components/base/xt-grid-box.md +4 -6
- package/docs/components/base/xt-icon.md +0 -2
- package/docs/components/base/xt-input.md +204 -44
- package/docs/components/base/xt-line.md +4 -30
- package/docs/components/base/xt-list.md +456 -458
- package/docs/components/base/xt-map-provider.md +0 -2
- package/docs/components/base/xt-map.md +0 -2
- package/docs/components/base/xt-multi.md +5 -44
- package/docs/components/base/xt-page.md +17 -6
- package/docs/components/base/xt-pie.md +5 -30
- package/docs/components/base/xt-progress.md +0 -2
- package/docs/components/base/xt-scroll-arrow.md +0 -2
- package/docs/components/base/xt-select-tree.md +0 -2
- package/docs/components/base/xt-step-price.md +0 -2
- package/docs/components/base/xt-table.md +2 -2
- package/docs/components/base/xt-tabs.md +0 -2
- package/docs/components/base/xt-text.md +1 -2
- package/docs/components/base/xt-time.md +0 -2
- package/docs/components/base/xt-transfer-tree.md +0 -2
- package/docs/components/base/xt-upload.md +11 -8
- package/docs/components/utils/config.md +285 -0
- package/docs/components/utils/format.md +445 -0
- package/package.json +5 -2
- package/src/components/xt-badge/style/index.scss +0 -22
- package/src/components/xt-chart/XtBar.vue +0 -3
- package/src/components/xt-date-picker/component/Picker.vue +196 -0
- package/src/components/xt-date-picker/component/RangeDate.vue +136 -0
- package/src/components/xt-date-picker/index.vue +164 -144
- package/src/components/xt-flex-box/index.vue +1 -1
- package/src/components/xt-form-schema/index.js +8 -0
- package/src/components/xt-form-schema/index.vue +328 -0
- package/src/components/xt-grid-item/index.vue +2 -2
- package/src/components/xt-input/index.vue +224 -28
- package/src/components/xt-input/style/index.scss +10 -0
- package/src/components/xt-layout/ExFieldset.vue +4 -4
- package/src/components/xt-list/index.js +7 -7
- package/src/components/xt-list/index.vue +885 -885
- package/src/components/xt-page/index.vue +148 -75
- package/src/components/xt-progress/style/index.scss +0 -14
- package/src/components/xt-tab-pane/index.js +10 -0
- package/src/components/{xt-tabs/TabPane.vue → xt-tab-pane/index.vue} +14 -1
- package/src/components/xt-table/XtTableCell.vue +2 -2
- package/src/components/xt-table/index.vue +5 -7
- package/src/components/xt-tabs/index.js +1 -3
- package/src/components/xt-tabs/index.vue +303 -44
- package/src/components/xt-tabs/style/index.scss +0 -40
- package/src/components/xt-text/style/index.scss +0 -15
- package/src/components/xt-transfer-tree/index.js +7 -7
- package/src/components/xt-transfer-tree/index.vue +493 -493
- package/src/components/xt-upload/index.vue +12 -6
- package/src/enhance/index.scss +13 -0
- package/src/index.js +7 -2
- package/src/styles/theme/colors.scss +0 -44
- package/src/styles/theme/dark-variables.scss +0 -29
- package/lib/demo.html +0 -10
- package/lib/index.common.js +0 -126851
- package/lib/index.css +0 -1
- package/lib/index.umd.js +0 -126861
- package/lib/index.umd.min.js +0 -1
- package/src/components/xt-date-picker/SearchDate.vue +0 -45
- package/src/components/xt-date-picker/quarter.vue +0 -154
- package/src/components/xt-table/index copy.vue +0 -663
|
@@ -1,109 +1,182 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div
|
|
3
|
+
class="xt-page-container"
|
|
4
|
+
:class="containerClass"
|
|
5
|
+
:style="rootCssVars"
|
|
6
|
+
>
|
|
7
|
+
<!-- 主体左右容器 -->
|
|
8
|
+
<el-container class="xt-page-main-wrap">
|
|
9
|
+
<!-- 顶部Header -->
|
|
10
|
+
<el-header
|
|
11
|
+
v-if="$slots.header && showHeader"
|
|
12
|
+
ref="header"
|
|
13
|
+
class="xt-page-header"
|
|
14
|
+
:class="headerClass"
|
|
15
|
+
>
|
|
5
16
|
<slot name="header" />
|
|
6
17
|
</el-header>
|
|
7
|
-
|
|
8
|
-
|
|
18
|
+
|
|
19
|
+
<!-- 主内容区域 -->
|
|
20
|
+
<el-main ref="main" class="xt-page-main" :class="mainClass">
|
|
21
|
+
<slot :table-height="tableContentHeight" />
|
|
9
22
|
</el-main>
|
|
10
|
-
|
|
23
|
+
|
|
24
|
+
<!-- 底部Footer -->
|
|
25
|
+
<el-footer
|
|
26
|
+
v-if="$slots.footer && showFooter"
|
|
27
|
+
ref="footer"
|
|
28
|
+
class="xt-page-footer"
|
|
29
|
+
:class="footerClass"
|
|
30
|
+
>
|
|
11
31
|
<slot name="footer" />
|
|
12
32
|
</el-footer>
|
|
13
33
|
</el-container>
|
|
14
|
-
|
|
34
|
+
|
|
35
|
+
<!-- 侧边栏Aside -->
|
|
36
|
+
<el-aside
|
|
37
|
+
v-if="$slots.aside && showAside"
|
|
38
|
+
ref="aside"
|
|
39
|
+
class="xt-page-aside"
|
|
40
|
+
:class="asideClass"
|
|
41
|
+
:width="asideWidth"
|
|
42
|
+
>
|
|
15
43
|
<slot name="aside" />
|
|
16
44
|
</el-aside>
|
|
45
|
+
|
|
46
|
+
<!-- 弹窗插槽 -->
|
|
17
47
|
<slot name="dialog" />
|
|
18
|
-
</
|
|
48
|
+
</div>
|
|
19
49
|
</template>
|
|
50
|
+
|
|
20
51
|
<script>
|
|
21
52
|
export default {
|
|
22
|
-
name:
|
|
53
|
+
name: 'XtPage',
|
|
23
54
|
props: {
|
|
55
|
+
// 结构显隐控制(布局逻辑类Props,仅保留这类)
|
|
24
56
|
showHeader: { type: Boolean, default: true },
|
|
25
57
|
showFooter: { type: Boolean, default: true },
|
|
26
58
|
showAside: { type: Boolean, default: true },
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
type: String
|
|
41
|
-
}
|
|
59
|
+
asideWidth: { type: String, default: '240px' },
|
|
60
|
+
|
|
61
|
+
// 表格自适应高度计算专用业务参数
|
|
62
|
+
diffHeight: { type: Number, default: 0 },
|
|
63
|
+
minTableHeight: { type: Number, default: 200 },
|
|
64
|
+
tableBorderHeight: { type: Number, default: 1 },
|
|
65
|
+
|
|
66
|
+
// 自定义扩展Class(重度差异化页面使用)
|
|
67
|
+
containerClass: { type: String, default: '' },
|
|
68
|
+
headerClass: { type: String, default: '' },
|
|
69
|
+
mainClass: { type: String, default: '' },
|
|
70
|
+
asideClass: { type: String, default: '' },
|
|
71
|
+
footerClass: { type: String, default: '' }
|
|
42
72
|
},
|
|
43
73
|
data() {
|
|
44
74
|
return {
|
|
45
|
-
|
|
75
|
+
rawMainHeight: 0,
|
|
76
|
+
resizeTimer: null
|
|
46
77
|
};
|
|
47
78
|
},
|
|
48
79
|
computed: {
|
|
49
|
-
|
|
50
|
-
|
|
80
|
+
// 根节点注入CSS变量,业务页面外层style可直接覆盖
|
|
81
|
+
rootCssVars() {
|
|
82
|
+
return {
|
|
83
|
+
'--xt-page-aside-width': this.asideWidth
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
// 传给插槽表格的可用高度
|
|
87
|
+
tableContentHeight() {
|
|
88
|
+
const usable = this.rawMainHeight - this.diffHeight - this.tableBorderHeight;
|
|
89
|
+
return Math.max(usable, this.minTableHeight);
|
|
51
90
|
}
|
|
52
91
|
},
|
|
53
92
|
mounted() {
|
|
54
|
-
this.$nextTick(() =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
93
|
+
this.$nextTick(() => this.calcMainHeight());
|
|
94
|
+
// 防抖监听窗口缩放
|
|
95
|
+
window.addEventListener('resize', this.handleResize);
|
|
96
|
+
},
|
|
97
|
+
beforeDestroy() {
|
|
98
|
+
// 销毁解绑,防止内存泄漏
|
|
99
|
+
clearTimeout(this.resizeTimer);
|
|
100
|
+
window.removeEventListener('resize', this.handleResize);
|
|
61
101
|
},
|
|
62
102
|
methods: {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
103
|
+
// 防抖封装
|
|
104
|
+
handleResize() {
|
|
105
|
+
clearTimeout(this.resizeTimer);
|
|
106
|
+
this.resizeTimer = setTimeout(() => {
|
|
107
|
+
this.calcMainHeight();
|
|
108
|
+
}, 120);
|
|
109
|
+
},
|
|
110
|
+
// 计算main可视高度
|
|
111
|
+
calcMainHeight() {
|
|
112
|
+
if (!this.$refs.main || !this.$refs.main.$el) return;
|
|
113
|
+
const rect = this.$refs.main.$el.getBoundingClientRect();
|
|
114
|
+
this.rawMainHeight = rect.height;
|
|
69
115
|
}
|
|
70
116
|
}
|
|
71
117
|
};
|
|
72
118
|
</script>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
border
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
margin-left: 10px;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
.page-container{
|
|
98
|
-
padding: 20px;
|
|
119
|
+
|
|
120
|
+
<style lang="scss" scoped>
|
|
121
|
+
.xt-page-container {
|
|
122
|
+
// 全局默认样式变量(统一维护,全局:root可覆盖)
|
|
123
|
+
--xt-page-container-padding: 20px;
|
|
124
|
+
--xt-page-container-bg: #f0f0f2;
|
|
125
|
+
|
|
126
|
+
--xt-header-padding: 0;
|
|
127
|
+
--xt-header-bg: #ffffff;
|
|
128
|
+
--xt-header-border: none;
|
|
129
|
+
|
|
130
|
+
--xt-main-padding: 0;
|
|
131
|
+
--xt-main-bg: #ffffff;
|
|
132
|
+
|
|
133
|
+
--xt-footer-padding: 5px 0;
|
|
134
|
+
--xt-footer-border-top: 1px solid #f0f0f2;
|
|
135
|
+
|
|
136
|
+
--xt-aside-margin-left: 10px;
|
|
137
|
+
--xt-aside-bg: #ffffff;
|
|
138
|
+
--xt-aside-border: 1px solid #eeeeee;
|
|
139
|
+
--xt-aside-padding: 0;
|
|
140
|
+
--xt-aside-overflow-x: hidden;
|
|
141
|
+
|
|
142
|
+
display: flex;
|
|
99
143
|
height: 100%;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
144
|
+
padding: var(--xt-page-container-padding);
|
|
145
|
+
background: var(--xt-page-container-bg);
|
|
146
|
+
gap: var(--xt-page-aside-gap, 0);
|
|
147
|
+
|
|
148
|
+
.xt-page-main-wrap {
|
|
149
|
+
flex: 1;
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
height: 100%;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.xt-page-header {
|
|
156
|
+
padding: var(--xt-header-padding);
|
|
157
|
+
background: var(--xt-header-bg);
|
|
158
|
+
border: var(--xt-header-border);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.xt-page-main {
|
|
162
|
+
flex: 1;
|
|
163
|
+
padding: var(--xt-main-padding);
|
|
164
|
+
background: var(--xt-main-bg);
|
|
165
|
+
overflow: auto;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.xt-page-footer {
|
|
169
|
+
padding: var(--xt-footer-padding);
|
|
170
|
+
border-top: var(--xt-footer-border-top);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.xt-page-aside {
|
|
174
|
+
margin-left: var(--xt-aside-margin-left);
|
|
175
|
+
background: var(--xt-aside-bg);
|
|
176
|
+
border: var(--xt-aside-border);
|
|
177
|
+
padding: var(--xt-aside-padding);
|
|
178
|
+
height: 100%;
|
|
179
|
+
overflow-x: var(--xt-aside-overflow-x);
|
|
180
|
+
}
|
|
108
181
|
}
|
|
109
|
-
</style>
|
|
182
|
+
</style>
|
|
@@ -103,17 +103,3 @@
|
|
|
103
103
|
opacity: 0;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
[data-theme='dark'], html.dark {
|
|
107
|
-
.xt-progress__bar {
|
|
108
|
-
background: $xt-dark-color-border;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.xt-progress__bar-text,
|
|
112
|
-
.xt-progress__text {
|
|
113
|
-
color: $xt-dark-color-text-secondary;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.xt-progress__circle-percent {
|
|
117
|
-
color: $xt-dark-color-text-primary;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -15,6 +15,14 @@ export default {
|
|
|
15
15
|
label: {
|
|
16
16
|
type: String,
|
|
17
17
|
default: ''
|
|
18
|
+
},
|
|
19
|
+
disabled: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
23
|
+
closable: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: true
|
|
18
26
|
}
|
|
19
27
|
},
|
|
20
28
|
computed: {
|
|
@@ -24,7 +32,12 @@ export default {
|
|
|
24
32
|
},
|
|
25
33
|
mounted() {
|
|
26
34
|
if (this.$parent && typeof this.$parent.addPane === 'function') {
|
|
27
|
-
this.$parent.addPane({
|
|
35
|
+
this.$parent.addPane({
|
|
36
|
+
name: this.name,
|
|
37
|
+
label: this.label,
|
|
38
|
+
disabled: this.disabled,
|
|
39
|
+
closable: this.closable
|
|
40
|
+
})
|
|
28
41
|
}
|
|
29
42
|
},
|
|
30
43
|
beforeDestroy() {
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
props: {
|
|
6
6
|
row: Object,
|
|
7
7
|
index: Number,
|
|
8
|
-
|
|
8
|
+
render: Function,
|
|
9
9
|
column: { type: Object, default: null }
|
|
10
10
|
},
|
|
11
11
|
render: (h, ctx) => {
|
|
@@ -15,7 +15,7 @@ export default {
|
|
|
15
15
|
}
|
|
16
16
|
if (ctx.props.column) params.column = ctx.props.column
|
|
17
17
|
const isVnode = (it) => it !== null && it !== undefined && typeof it === 'object' && it.hasOwnProperty('componentOptions')
|
|
18
|
-
const renderNode = ctx.props.
|
|
18
|
+
const renderNode = ctx.props.render(h, params)
|
|
19
19
|
if (renderNode === null || renderNode === undefined || renderNode === '') return h('span', '')
|
|
20
20
|
return isVnode(renderNode) ? renderNode : h('span', String(renderNode))
|
|
21
21
|
}
|
|
@@ -51,12 +51,11 @@
|
|
|
51
51
|
>
|
|
52
52
|
<template v-for="child in col.children">
|
|
53
53
|
<el-table-column :key="child._key" v-bind="getColumnProps(child)">
|
|
54
|
-
<template v-if="child.render" v-slot="scope">
|
|
55
|
-
<template v-else-if="child.formatter" v-slot="scope">
|
|
54
|
+
<template v-if="child.render" v-slot="scope">
|
|
56
55
|
<XtTableCell
|
|
57
56
|
:row="scope.row"
|
|
58
57
|
:index="scope.$index"
|
|
59
|
-
:
|
|
58
|
+
:render="child.render"
|
|
60
59
|
:column="child"
|
|
61
60
|
/>
|
|
62
61
|
</template>
|
|
@@ -72,12 +71,11 @@
|
|
|
72
71
|
</template>
|
|
73
72
|
</el-table-column>
|
|
74
73
|
<el-table-column v-else :key="col._key" v-bind="getColumnProps(col)">
|
|
75
|
-
<template v-if="col.render" v-slot="scope">
|
|
76
|
-
<template v-else-if="col.formatter" v-slot="scope">
|
|
74
|
+
<template v-if="col.render" v-slot="scope">
|
|
77
75
|
<XtTableCell
|
|
78
76
|
:row="scope.row"
|
|
79
77
|
:index="scope.$index"
|
|
80
|
-
:
|
|
78
|
+
:render="col.render"
|
|
81
79
|
:column="col"
|
|
82
80
|
/>
|
|
83
81
|
</template>
|
|
@@ -427,7 +425,7 @@ export default {
|
|
|
427
425
|
|
|
428
426
|
// ========== 列处理 ==========
|
|
429
427
|
getColumnProps(col) {
|
|
430
|
-
const { _key, children, render,
|
|
428
|
+
const { _key, children, render, slot, sortMethod, ...props } = col
|
|
431
429
|
return props
|
|
432
430
|
},
|
|
433
431
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import XtTabs from './index.vue'
|
|
2
|
-
import XtTabPane from './TabPane.vue'
|
|
3
2
|
|
|
4
3
|
XtTabs.install = function(Vue) {
|
|
5
4
|
Vue.component(XtTabs.name, XtTabs)
|
|
6
|
-
Vue.component(XtTabPane.name, XtTabPane)
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
export default XtTabs
|
|
10
|
-
export {
|
|
8
|
+
export { XtTabs }
|