@weitutech/by-components 1.1.0 → 1.1.1
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/package.json +7 -2
- package/.babelrc +0 -7
- package/.editorconfig +0 -19
- package/.eslintignore +0 -9
- package/.eslintrc.cjs +0 -65
- package/.prettierignore +0 -9
- package/.prettierrc +0 -22
- package/.vscode/extensions.json +0 -7
- package/.vscode/settings.json +0 -27
- package/CHANGELOG.md +0 -58
- package/docs/extension.md +0 -15
- package/docs/form.md +0 -93
- package/docs/table.md +0 -43
- package/src/components/custom-column/index.vue +0 -394
- package/src/components/fold-search/index.vue +0 -39
- package/src/components/form/comps/custom-date-picker.vue +0 -171
- package/src/components/form/comps/date-picker-range.vue +0 -112
- package/src/components/form/comps/pair-number-input.vue +0 -79
- package/src/components/form/comps/select.vue +0 -130
- package/src/components/form/form.vue +0 -417
- package/src/components/page-search/page-search.vue +0 -122
- package/src/components/pager/index.vue +0 -87
- package/src/components/table/index.vue +0 -371
- package/src/index.js +0 -31
- package/src/plugin/vxeTable.js +0 -300
- package/src/plugin/vxeTable.scss +0 -14
- package/src/style/custom-column.scss +0 -192
- package/src/style/fold-search.scss +0 -21
- package/src/style/form.scss +0 -342
- package/src/style/index.scss +0 -13
- package/src/style/page-search.scss +0 -26
- package/src/style/pager.scss +0 -40
- package/src/style/table.scss +0 -39
- package/src/utils/index.js +0 -32
|
@@ -1,371 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<vxe-grid
|
|
4
|
-
ref="xGrid"
|
|
5
|
-
v-bind="options"
|
|
6
|
-
v-on="eventListeners"
|
|
7
|
-
@cell-click="handleCellClick"
|
|
8
|
-
@resizable-change="handleResizableChange"
|
|
9
|
-
>
|
|
10
|
-
<template v-for="item in slotMap" #[item]="context">
|
|
11
|
-
<slot :name="item" v-bind="context" />
|
|
12
|
-
</template>
|
|
13
|
-
<template v-if="options.pagerConfig" #pager>
|
|
14
|
-
<!-- 📢 由于BPager利用的是ElementUi分页目前只支持vxeTable中分页配置中的currentPage、pageSize、total、pageSizes选项配置 -->
|
|
15
|
-
<by-pager
|
|
16
|
-
:page="options.pagerConfig.currentPage"
|
|
17
|
-
:limit="options.pagerConfig.pageSize"
|
|
18
|
-
:total-count="options.pagerConfig.total"
|
|
19
|
-
:page-sizes="options.pagerConfig.pageSizes"
|
|
20
|
-
@onChange="pageChange"
|
|
21
|
-
/>
|
|
22
|
-
</template>
|
|
23
|
-
</vxe-grid>
|
|
24
|
-
<CustomColumn
|
|
25
|
-
v-if="
|
|
26
|
-
gridOptions.customColumnConfig &&
|
|
27
|
-
gridOptions.customColumnConfig.showCustomColumn
|
|
28
|
-
"
|
|
29
|
-
ref="CustomColumnRef"
|
|
30
|
-
:info-method="gridOptions.customColumnConfig.infoMethod"
|
|
31
|
-
:submit-method="gridOptions.customColumnConfig.submitMethod"
|
|
32
|
-
:dialog-visible="customTableVisible"
|
|
33
|
-
@closeDialog="closeCustomColumnDialog"
|
|
34
|
-
@changeTable="changeTableFields"
|
|
35
|
-
@changeTableGroup="changeTableGroupFields"
|
|
36
|
-
/>
|
|
37
|
-
</div>
|
|
38
|
-
</template>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
import CustomColumn from '../custom-column/index.vue'
|
|
42
|
-
export default {
|
|
43
|
-
name: 'BYTable',
|
|
44
|
-
components: {
|
|
45
|
-
CustomColumn
|
|
46
|
-
},
|
|
47
|
-
props: {
|
|
48
|
-
gridOptions: {
|
|
49
|
-
type: Object,
|
|
50
|
-
default: () => {}
|
|
51
|
-
},
|
|
52
|
-
name: {
|
|
53
|
-
//如果有传入name时,当表格宽度拖动时,会缓存当前表格每列的宽度,下次刷新将展示缓存宽度(⚠️注意:同一个项目中name一定不要重复)
|
|
54
|
-
type: String,
|
|
55
|
-
default: ''
|
|
56
|
-
},
|
|
57
|
-
autoHeight: {
|
|
58
|
-
// 是否根据内容自动撑高
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
data() {
|
|
64
|
-
return {
|
|
65
|
-
/**
|
|
66
|
-
* @see https://vxetable.cn/v3.8/#/grid/api
|
|
67
|
-
*/
|
|
68
|
-
events: [
|
|
69
|
-
'keydown',
|
|
70
|
-
'current-change',
|
|
71
|
-
'radio-change',
|
|
72
|
-
'checkbox-change',
|
|
73
|
-
'checkbox-all',
|
|
74
|
-
'checkbox-range-start',
|
|
75
|
-
'checkbox-range-change',
|
|
76
|
-
'checkbox-range-end',
|
|
77
|
-
'cell-dblclick',
|
|
78
|
-
'cell-menu',
|
|
79
|
-
'cell-mouseenter',
|
|
80
|
-
'cell-mouseleave',
|
|
81
|
-
'cell-delete-value',
|
|
82
|
-
'header-cell-click',
|
|
83
|
-
'header-cell-dblclick',
|
|
84
|
-
'header-cell-menu',
|
|
85
|
-
'footer-cell-click',
|
|
86
|
-
'footer-cell-dblclick',
|
|
87
|
-
'footer-cell-menu',
|
|
88
|
-
'clear-merge',
|
|
89
|
-
'sort-change',
|
|
90
|
-
'clear-sort',
|
|
91
|
-
'filter-visible',
|
|
92
|
-
'filter-change',
|
|
93
|
-
'clear-filter',
|
|
94
|
-
'toggle-row-expand',
|
|
95
|
-
'toggle-tree-expand',
|
|
96
|
-
'menu-click',
|
|
97
|
-
'cell-selected',
|
|
98
|
-
'edit-closed',
|
|
99
|
-
'edit-activated',
|
|
100
|
-
'edit-disabled',
|
|
101
|
-
'valid-error',
|
|
102
|
-
'scroll',
|
|
103
|
-
'custom',
|
|
104
|
-
'page-change',
|
|
105
|
-
'form-submit',
|
|
106
|
-
'form-submit-invalid',
|
|
107
|
-
'form-reset',
|
|
108
|
-
'form-collapse',
|
|
109
|
-
'proxy-query',
|
|
110
|
-
'proxy-delete',
|
|
111
|
-
'proxy-save',
|
|
112
|
-
'toolbar-button-click',
|
|
113
|
-
'toolbar-tool-click',
|
|
114
|
-
'zoom'
|
|
115
|
-
],
|
|
116
|
-
// 自定义对话框显示和隐藏控制
|
|
117
|
-
customTableVisible: false
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
computed: {
|
|
121
|
-
options() {
|
|
122
|
-
const { customColumnConfig, columns, ...others } = this.gridOptions
|
|
123
|
-
|
|
124
|
-
// 使用列宽缓存值(若有)
|
|
125
|
-
const newColumns = this.getColumnsData(columns)
|
|
126
|
-
|
|
127
|
-
return {
|
|
128
|
-
border: true,
|
|
129
|
-
resizable: true,
|
|
130
|
-
/**
|
|
131
|
-
* 控制单元格内容的溢出显示方式
|
|
132
|
-
* 可选值:
|
|
133
|
-
* true:默认值,超出部分显示省略号(...)
|
|
134
|
-
* 'visible':内容完整显示,不会被截断
|
|
135
|
-
* 'ellipsis':显示省略号
|
|
136
|
-
* 'tooltip':超出部分显示省略号,鼠标悬停时显示完整内容
|
|
137
|
-
*/
|
|
138
|
-
showOverflow: this.autoHeight ? 'visible' : true,
|
|
139
|
-
showHeaderOverflow: this.autoHeight ? 'tooltip' : true,
|
|
140
|
-
height: 550,
|
|
141
|
-
align: 'left',
|
|
142
|
-
copyFields: [],
|
|
143
|
-
pagerConfig: false,
|
|
144
|
-
emptyText: '暂无数据',
|
|
145
|
-
loadingConfig: {
|
|
146
|
-
text: '加载中...'
|
|
147
|
-
},
|
|
148
|
-
columns: newColumns,
|
|
149
|
-
...others,
|
|
150
|
-
resizableConfig: {
|
|
151
|
-
minWidth: 50,
|
|
152
|
-
...this.gridOptions.resizableConfig
|
|
153
|
-
},
|
|
154
|
-
rowConfig: {
|
|
155
|
-
height: 41,
|
|
156
|
-
isHover: true,
|
|
157
|
-
...this.gridOptions.rowConfig
|
|
158
|
-
},
|
|
159
|
-
sortConfig: {
|
|
160
|
-
remote: true,
|
|
161
|
-
trigger: 'cell',
|
|
162
|
-
...this.gridOptions.sortConfig
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
// 插槽集合
|
|
168
|
-
slotMap() {
|
|
169
|
-
const slotSet = new Set([])
|
|
170
|
-
const slots = this.gridOptions?.customColumnConfig?.slots ?? []
|
|
171
|
-
this.options.columns.forEach(col => {
|
|
172
|
-
if (col.slots) {
|
|
173
|
-
const slots = Object.values(col.slots)
|
|
174
|
-
slots.forEach(slot => slotSet.add(slot))
|
|
175
|
-
}
|
|
176
|
-
})
|
|
177
|
-
return [...Array.from(slotSet), ...slots]
|
|
178
|
-
},
|
|
179
|
-
// 注册emit事件
|
|
180
|
-
eventListeners() {
|
|
181
|
-
const listeners = {}
|
|
182
|
-
this.events.forEach(eventName => {
|
|
183
|
-
listeners[eventName] = event => this.$emit(eventName, event)
|
|
184
|
-
})
|
|
185
|
-
return listeners
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
methods: {
|
|
190
|
-
//获取缓存列宽,并替换列宽值
|
|
191
|
-
getColumnsData(columns) {
|
|
192
|
-
if (!this.name) {
|
|
193
|
-
return columns
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const cacheColumns = JSON.parse(localStorage.getItem(this.name))
|
|
197
|
-
if (!cacheColumns) {
|
|
198
|
-
return columns
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
//比较columns和cols列宽缓存数据,如果有变动(表头有增加或删除),更新缓存
|
|
202
|
-
const cols = this.compareColumnsAndCols(columns, cacheColumns)
|
|
203
|
-
|
|
204
|
-
// 将缓存中的列宽,替换到columns中的列宽
|
|
205
|
-
if (cols && this.name) {
|
|
206
|
-
columns.forEach(item => {
|
|
207
|
-
item.width =
|
|
208
|
-
(cols.find(col => col.field === item.field) || {}).width ||
|
|
209
|
-
item.width ||
|
|
210
|
-
undefined
|
|
211
|
-
})
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
return columns
|
|
215
|
-
},
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 更新列宽缓存
|
|
219
|
-
* 比较columns和cacheColumns列宽缓存数据,如果有变动(表头有增加或删除),更新缓存
|
|
220
|
-
* 如果columns的列在cacheColumns中不存在,则说明是新增的列,将对应的列加入到缓存中
|
|
221
|
-
* 如果cacheColumns的列在columns中不存在,则说明是删除的列,将对应的列从缓存中删除
|
|
222
|
-
* @param columns 当前表格列配置
|
|
223
|
-
* @param cacheColumns 缓存列配置
|
|
224
|
-
*/
|
|
225
|
-
compareColumnsAndCols(columns, cacheColumns) {
|
|
226
|
-
if (!cacheColumns || !this.name) {
|
|
227
|
-
return undefined
|
|
228
|
-
}
|
|
229
|
-
// 如果columns的列在cacheColumns中不存在,则说明是新增的列,将对应的列加入到缓存中
|
|
230
|
-
columns.forEach(item => {
|
|
231
|
-
if (
|
|
232
|
-
item &&
|
|
233
|
-
item.field &&
|
|
234
|
-
!cacheColumns.some(col => col && col.field === item.field)
|
|
235
|
-
) {
|
|
236
|
-
cacheColumns.push({
|
|
237
|
-
field: item.field,
|
|
238
|
-
width: item.width
|
|
239
|
-
})
|
|
240
|
-
}
|
|
241
|
-
})
|
|
242
|
-
// 如果cacheColumns的列在columns中不存在,则说明是删除的列,将对应的列从缓存中删除
|
|
243
|
-
const newCacheColumns = cacheColumns.filter(
|
|
244
|
-
item =>
|
|
245
|
-
item &&
|
|
246
|
-
item.field &&
|
|
247
|
-
columns.some(col => col && col.field === item.field)
|
|
248
|
-
)
|
|
249
|
-
// 更新缓存
|
|
250
|
-
localStorage.setItem(this.name, JSON.stringify(newCacheColumns))
|
|
251
|
-
return newCacheColumns
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
handleCellClick(context) {
|
|
255
|
-
if (this.options.copyFields.includes(context.column.field)) {
|
|
256
|
-
const text = context.cell.outerText
|
|
257
|
-
this.copy(text)
|
|
258
|
-
}
|
|
259
|
-
this.$emit('cell-click', context)
|
|
260
|
-
},
|
|
261
|
-
handleResizableChange(context) {
|
|
262
|
-
this.$emit('resizable-change', context)
|
|
263
|
-
if (!this.name) return
|
|
264
|
-
const collectColumn = context.$table.collectColumn
|
|
265
|
-
console.log(collectColumn, 'collectColumn')
|
|
266
|
-
const clos = collectColumn
|
|
267
|
-
.filter(col => col.field)
|
|
268
|
-
.map(col => ({
|
|
269
|
-
field: col.field,
|
|
270
|
-
width: col.renderWidth
|
|
271
|
-
}))
|
|
272
|
-
localStorage.setItem(this.name, JSON.stringify(clos))
|
|
273
|
-
},
|
|
274
|
-
pageChange(values) {
|
|
275
|
-
this.$emit('page-change', values)
|
|
276
|
-
},
|
|
277
|
-
copy(text) {
|
|
278
|
-
const oInput = document.createElement('input')
|
|
279
|
-
oInput.value = text
|
|
280
|
-
document.body.appendChild(oInput)
|
|
281
|
-
oInput.select() // 选择对象;
|
|
282
|
-
document.execCommand('Copy') // 执行浏览器复制命令
|
|
283
|
-
this.$message({
|
|
284
|
-
message: '复制成功',
|
|
285
|
-
type: 'success'
|
|
286
|
-
})
|
|
287
|
-
oInput.remove()
|
|
288
|
-
},
|
|
289
|
-
getCustomColumnRef() {
|
|
290
|
-
return this.$refs.CustomColumnRef
|
|
291
|
-
},
|
|
292
|
-
handleOpenCustomColumn() {
|
|
293
|
-
this.customTableVisible = true
|
|
294
|
-
},
|
|
295
|
-
// 改变表头字段
|
|
296
|
-
changeTableFields(cols) {
|
|
297
|
-
const columns = []
|
|
298
|
-
cols.forEach(item => {
|
|
299
|
-
if (!columns.some(col => col.field === item.key) && item.type) {
|
|
300
|
-
columns.push({
|
|
301
|
-
field: item.key,
|
|
302
|
-
title: item.label,
|
|
303
|
-
minWidth: item.minWidth || item.width,
|
|
304
|
-
maxWidth: item.maxWidth,
|
|
305
|
-
sortable:
|
|
306
|
-
typeof item.sortable === 'undefined'
|
|
307
|
-
? true
|
|
308
|
-
: JSON.parse(item.sortable),
|
|
309
|
-
fixed: item.fixed,
|
|
310
|
-
slots: this.gridOptions.customColumnConfig.slots.includes(item.key)
|
|
311
|
-
? { default: item.key }
|
|
312
|
-
: undefined
|
|
313
|
-
})
|
|
314
|
-
}
|
|
315
|
-
})
|
|
316
|
-
this.$emit('setColumn', columns)
|
|
317
|
-
},
|
|
318
|
-
// 多层级表头
|
|
319
|
-
changeTableGroupFields(cols) {
|
|
320
|
-
const recursiveData = cols => {
|
|
321
|
-
const arr = []
|
|
322
|
-
cols.forEach((item, index) => {
|
|
323
|
-
if (item.data && item.data.length > 0) {
|
|
324
|
-
arr.push({
|
|
325
|
-
title: item.label,
|
|
326
|
-
align: 'center',
|
|
327
|
-
children: recursiveData(item.data)
|
|
328
|
-
})
|
|
329
|
-
if (index < cols.length - 1) {
|
|
330
|
-
arr.push({
|
|
331
|
-
title: '',
|
|
332
|
-
width: 5,
|
|
333
|
-
headerClassName: 'group-split',
|
|
334
|
-
className: 'group-split'
|
|
335
|
-
})
|
|
336
|
-
}
|
|
337
|
-
} else {
|
|
338
|
-
if (!arr.some(col => col.field === item.key) && item.type) {
|
|
339
|
-
arr.push({
|
|
340
|
-
field: item.key,
|
|
341
|
-
title: item.label,
|
|
342
|
-
minWidth: item.minWidth || item.width,
|
|
343
|
-
maxWidth: item.maxWidth,
|
|
344
|
-
sortable:
|
|
345
|
-
typeof item.sortable === 'undefined'
|
|
346
|
-
? true
|
|
347
|
-
: JSON.parse(item.sortable),
|
|
348
|
-
fixed: item.fixed,
|
|
349
|
-
slots: this.gridOptions.customColumnConfig.slots.includes(
|
|
350
|
-
item.key
|
|
351
|
-
)
|
|
352
|
-
? { default: item.key }
|
|
353
|
-
: undefined
|
|
354
|
-
})
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
})
|
|
358
|
-
return arr
|
|
359
|
-
}
|
|
360
|
-
this.$emit('setGroupColumn', recursiveData(cols))
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
// 关闭自定义表头弹框
|
|
364
|
-
closeCustomColumnDialog() {
|
|
365
|
-
this.customTableVisible = false
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
</script>
|
|
370
|
-
|
|
371
|
-
<style lang="scss" scoped></style>
|
package/src/index.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import ByPager from './components/pager/index'
|
|
2
|
-
import ByTable from './components/table/index'
|
|
3
|
-
import ByForm from './components/form/form'
|
|
4
|
-
import ByPageSearch from './components/page-search/page-search'
|
|
5
|
-
import ByFoldSearch from './components/fold-search/index'
|
|
6
|
-
import BySelect from './components/form/comps/select.vue'
|
|
7
|
-
import ByDatePickerRange from './components/form/comps/date-picker-range.vue'
|
|
8
|
-
import domZindex from 'dom-zindex'
|
|
9
|
-
const components = {
|
|
10
|
-
ByPager,
|
|
11
|
-
ByTable,
|
|
12
|
-
ByForm,
|
|
13
|
-
ByPageSearch,
|
|
14
|
-
ByFoldSearch,
|
|
15
|
-
BySelect,
|
|
16
|
-
ByDatePickerRange
|
|
17
|
-
}
|
|
18
|
-
// 设置当前 z-index 起始值
|
|
19
|
-
domZindex.setCurrent(99999)
|
|
20
|
-
|
|
21
|
-
const install = Vue => {
|
|
22
|
-
Object.keys(components).forEach(name => {
|
|
23
|
-
Vue.component(name, components[name])
|
|
24
|
-
})
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// 支持直接通过 script 标签引入
|
|
28
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
29
|
-
install(window.Vue)
|
|
30
|
-
}
|
|
31
|
-
export default { install }
|
package/src/plugin/vxeTable.js
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
// import XEUtils from "xe-utils"
|
|
3
|
-
import {
|
|
4
|
-
// 全局实例对象
|
|
5
|
-
// VXETable,
|
|
6
|
-
|
|
7
|
-
// 可选表格模块
|
|
8
|
-
// VxeTableFilterModule,
|
|
9
|
-
// VxeTableEditModule,
|
|
10
|
-
// VxeTableMenuModule,
|
|
11
|
-
// VxeTableExportModule,
|
|
12
|
-
// VxeTableKeyboardModule,
|
|
13
|
-
// VxeTableValidatorModule,
|
|
14
|
-
// VxeTableCustomModule,
|
|
15
|
-
|
|
16
|
-
// 可选组件
|
|
17
|
-
VxeIcon,
|
|
18
|
-
VxeTable,
|
|
19
|
-
VxeColumn,
|
|
20
|
-
VxeColgroup,
|
|
21
|
-
VxeGrid,
|
|
22
|
-
VxeTooltip,
|
|
23
|
-
VxeToolbar,
|
|
24
|
-
VxePager,
|
|
25
|
-
// VxeForm,
|
|
26
|
-
// VxeFormItem,
|
|
27
|
-
// VxeFormGather,
|
|
28
|
-
// VxeCheckbox,
|
|
29
|
-
// VxeCheckboxGroup,
|
|
30
|
-
// VxeRadio,
|
|
31
|
-
// VxeRadioGroup,
|
|
32
|
-
// VxeRadioButton,
|
|
33
|
-
// VxeSwitch,
|
|
34
|
-
// VxeInput,
|
|
35
|
-
VxeSelect
|
|
36
|
-
// VxeOptgroup,
|
|
37
|
-
// VxeOption,
|
|
38
|
-
// VxeTextarea,
|
|
39
|
-
// VxeButton,
|
|
40
|
-
// VxeButtonGroup,
|
|
41
|
-
// VxeModal,
|
|
42
|
-
// VxeList,
|
|
43
|
-
// VxePulldown
|
|
44
|
-
} from 'vxe-table'
|
|
45
|
-
|
|
46
|
-
// 旧版本使用 setup({}) 或者 config({})
|
|
47
|
-
// VXETable.config({
|
|
48
|
-
// // size: null, // 全局尺寸
|
|
49
|
-
// // zIndex: 999, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡;新版本可以使用 dom-zindex 共享配置
|
|
50
|
-
// // version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
|
|
51
|
-
// // loadingText: '加载中...', // 全局loading提示内容,如果为null则不显示文本
|
|
52
|
-
// table: {
|
|
53
|
-
// // showHeader: true,
|
|
54
|
-
// // keepSource: false,
|
|
55
|
-
// // showOverflow: null,
|
|
56
|
-
// // showHeaderOverflow: null,
|
|
57
|
-
// // showFooterOverflow: null,
|
|
58
|
-
// // size: null,
|
|
59
|
-
// // autoResize: false,
|
|
60
|
-
// // stripe: false,
|
|
61
|
-
// // border: false,
|
|
62
|
-
// // round: false,
|
|
63
|
-
// // minHeight: 144,
|
|
64
|
-
// emptyText: "暂无数据"
|
|
65
|
-
// // resizeConfig: {
|
|
66
|
-
// // refreshDelay: 250
|
|
67
|
-
// // },
|
|
68
|
-
// // rowConfig: {
|
|
69
|
-
// // keyField: '_X_ROW_KEY' // 行数据的唯一主键字段名
|
|
70
|
-
// // },
|
|
71
|
-
// // radioConfig: {
|
|
72
|
-
// // trigger: 'default'
|
|
73
|
-
// // },
|
|
74
|
-
// // checkboxConfig: {
|
|
75
|
-
// // strict: false,
|
|
76
|
-
// // highlight: false,
|
|
77
|
-
// // range: false,
|
|
78
|
-
// // trigger: 'default'
|
|
79
|
-
// // },
|
|
80
|
-
// // sortConfig: {
|
|
81
|
-
// // remote: false,
|
|
82
|
-
// // trigger: 'default',
|
|
83
|
-
// // orders: ['asc', 'desc', null],
|
|
84
|
-
// // sortMethod: null
|
|
85
|
-
// // },
|
|
86
|
-
// // filterConfig: {
|
|
87
|
-
// // remote: false,
|
|
88
|
-
// // filterMethod: null
|
|
89
|
-
// // },
|
|
90
|
-
// // expandConfig: {
|
|
91
|
-
// // trigger: 'default',
|
|
92
|
-
// // showIcon: true
|
|
93
|
-
// // },
|
|
94
|
-
// // treeConfig: {
|
|
95
|
-
// // rowField: 'id',
|
|
96
|
-
// // parentField: 'parentId',
|
|
97
|
-
// // children: 'children',
|
|
98
|
-
// // hasChild: 'hasChild',
|
|
99
|
-
// // mapChildren: '_X_ROW_CHILD',
|
|
100
|
-
// // indent: 20,
|
|
101
|
-
// // showIcon: true
|
|
102
|
-
// // },
|
|
103
|
-
// // tooltipConfig: {
|
|
104
|
-
// // enterable: true
|
|
105
|
-
// // },
|
|
106
|
-
// // menuConfig: {
|
|
107
|
-
// // visibleMethod () {}
|
|
108
|
-
// // },
|
|
109
|
-
// // editConfig: {
|
|
110
|
-
// // mode: 'cell',
|
|
111
|
-
// // showAsterisk: true
|
|
112
|
-
// // },
|
|
113
|
-
// // importConfig: {
|
|
114
|
-
// // modes: ['insert', 'covering']
|
|
115
|
-
// // },
|
|
116
|
-
// // exportConfig: {
|
|
117
|
-
// // modes: ['current', 'selected']
|
|
118
|
-
// // },
|
|
119
|
-
// // customConfig: {
|
|
120
|
-
// // storage: false,
|
|
121
|
-
// // mode: 'simple' // 默认自定义列方式
|
|
122
|
-
// // },
|
|
123
|
-
// // area-config: {
|
|
124
|
-
// // multiple: false
|
|
125
|
-
// // },
|
|
126
|
-
// // scrollX: {
|
|
127
|
-
// // enabled: false, // 是否默认开启横向虚拟滚动
|
|
128
|
-
// // gt: 60 // 当列大于指定数量时自动触发启用虚拟滚动
|
|
129
|
-
// // },
|
|
130
|
-
// // scrollY: {
|
|
131
|
-
// // enabled: false, // 是否默认开启纵向虚拟滚动
|
|
132
|
-
// // gt: 100 // 当数据大于指定数量时自动触发启用虚拟滚动
|
|
133
|
-
// // },
|
|
134
|
-
// // loading: {
|
|
135
|
-
// // icon: 'vxe-icon-spinner roll',
|
|
136
|
-
// // text: '加载中...'
|
|
137
|
-
// // }
|
|
138
|
-
// }
|
|
139
|
-
// // grid: {
|
|
140
|
-
// // emptyText: "暂无数据"
|
|
141
|
-
// // size: null,
|
|
142
|
-
// // zoomConfig: {
|
|
143
|
-
// // escRestore: true
|
|
144
|
-
// // },
|
|
145
|
-
// // pagerConfig: {
|
|
146
|
-
// // },
|
|
147
|
-
// // toolbarConfig: {
|
|
148
|
-
// // },
|
|
149
|
-
// // proxyConfig: {
|
|
150
|
-
// // autoLoad: true,
|
|
151
|
-
// // message: true,
|
|
152
|
-
// // props: {
|
|
153
|
-
// // list: null, // 用于列表,读取响应数据
|
|
154
|
-
// // result: 'result', // 用于分页,读取响应数据
|
|
155
|
-
// // total: 'page.total' // 用于分页,读取总条数
|
|
156
|
-
// // }
|
|
157
|
-
// // beforeItem: null,
|
|
158
|
-
// // beforeColumn: null,
|
|
159
|
-
// // beforeQuery: null,
|
|
160
|
-
// // afterQuery: null,
|
|
161
|
-
// // beforeDelete: null,
|
|
162
|
-
// // afterDelete: null,
|
|
163
|
-
// // beforeSave: null,
|
|
164
|
-
// // afterSave: null
|
|
165
|
-
// // }
|
|
166
|
-
// // }
|
|
167
|
-
// // pager: {
|
|
168
|
-
// // size: null,
|
|
169
|
-
// // autoHidden: false,
|
|
170
|
-
// // pageSize: 10,
|
|
171
|
-
// // pagerCount: 7,
|
|
172
|
-
// // pageSizes: [10, 15, 20, 50, 100],
|
|
173
|
-
// // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
|
|
174
|
-
// // },
|
|
175
|
-
// // form: {
|
|
176
|
-
// // preventSubmit: false
|
|
177
|
-
// // size: null,
|
|
178
|
-
// // colon: false,
|
|
179
|
-
// // validConfig: {
|
|
180
|
-
// // autoPos: true
|
|
181
|
-
// // },
|
|
182
|
-
// // tooltipConfig: {
|
|
183
|
-
// // enterable: true
|
|
184
|
-
// // },
|
|
185
|
-
// // titleAsterisk: true
|
|
186
|
-
// // },
|
|
187
|
-
// // input: {
|
|
188
|
-
// // size: null,
|
|
189
|
-
// // transfer: false
|
|
190
|
-
// // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
|
|
191
|
-
// // labelFormat: '',
|
|
192
|
-
// // valueFormat: '',
|
|
193
|
-
// // startDay: 1,
|
|
194
|
-
// // digits: 2,
|
|
195
|
-
// // controls: true
|
|
196
|
-
// // },
|
|
197
|
-
// // textarea: {
|
|
198
|
-
// // size: null
|
|
199
|
-
// // autosize: {
|
|
200
|
-
// // minRows: 1,
|
|
201
|
-
// // maxRows: 10
|
|
202
|
-
// // }
|
|
203
|
-
// // },
|
|
204
|
-
// // select: {
|
|
205
|
-
// // size: null,
|
|
206
|
-
// // transfer: false,
|
|
207
|
-
// // optionConfig: {
|
|
208
|
-
// // keyField: '_X_OPTION_KEY' // 选项数据的唯一主键字段名
|
|
209
|
-
// // },
|
|
210
|
-
// // multiCharOverflow: 8
|
|
211
|
-
// // },
|
|
212
|
-
// // toolbar: {
|
|
213
|
-
// // size: null,
|
|
214
|
-
// // import: {
|
|
215
|
-
// // mode: 'covering'
|
|
216
|
-
// // },
|
|
217
|
-
// // export: {
|
|
218
|
-
// // types: ['csv', 'html', 'xml', 'txt']
|
|
219
|
-
// // },
|
|
220
|
-
// // buttons: [],
|
|
221
|
-
// // tools: []
|
|
222
|
-
// // },
|
|
223
|
-
// // button: {
|
|
224
|
-
// // size: null,
|
|
225
|
-
// // transfer: false
|
|
226
|
-
// // },
|
|
227
|
-
// // radio: {
|
|
228
|
-
// // size: null
|
|
229
|
-
// // },
|
|
230
|
-
// // checkbox: {
|
|
231
|
-
// // size: null
|
|
232
|
-
// // },
|
|
233
|
-
// // switch: {
|
|
234
|
-
// // size: null
|
|
235
|
-
// // },
|
|
236
|
-
// // modal: {
|
|
237
|
-
// // // size: null,
|
|
238
|
-
// // minWidth: 340,
|
|
239
|
-
// // minHeight: 200,
|
|
240
|
-
// // lockView: true,
|
|
241
|
-
// // mask: true,
|
|
242
|
-
// // duration: 3000,
|
|
243
|
-
// // marginSize: 0,
|
|
244
|
-
// // dblclickZoom: true,
|
|
245
|
-
// // showTitleOverflow: true
|
|
246
|
-
// // storage: false
|
|
247
|
-
// // },
|
|
248
|
-
// // list: {
|
|
249
|
-
// // scrollY: {
|
|
250
|
-
// // gt: 100
|
|
251
|
-
// // }
|
|
252
|
-
// // }
|
|
253
|
-
// })
|
|
254
|
-
|
|
255
|
-
// 导入默认的语言
|
|
256
|
-
// import zhCN from "vxe-table/lib/locale/lang/zh-CN"
|
|
257
|
-
|
|
258
|
-
// 按需加载的方式默认是不带国际化的,自定义国际化需要自行解析占位符 '{0}',例如:
|
|
259
|
-
// VXETable.setConfig({
|
|
260
|
-
// i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args)
|
|
261
|
-
// })
|
|
262
|
-
|
|
263
|
-
// 可选表格模块
|
|
264
|
-
// Vue.use(VxeTableFilterModule)
|
|
265
|
-
// Vue.use(VxeTableEditModule)
|
|
266
|
-
// Vue.use(VxeTableMenuModule)
|
|
267
|
-
// Vue.use(VxeTableExportModule)
|
|
268
|
-
// Vue.use(VxeTableKeyboardModule)
|
|
269
|
-
// Vue.use(VxeTableValidatorModule)
|
|
270
|
-
// Vue.use(VxeTableCustomModule)
|
|
271
|
-
|
|
272
|
-
// 可选组件
|
|
273
|
-
Vue.use(VxeIcon)
|
|
274
|
-
Vue.use(VxeTable)
|
|
275
|
-
Vue.use(VxeColumn)
|
|
276
|
-
Vue.use(VxeColgroup)
|
|
277
|
-
Vue.use(VxeGrid)
|
|
278
|
-
Vue.use(VxeTooltip)
|
|
279
|
-
Vue.use(VxeToolbar)
|
|
280
|
-
Vue.use(VxePager)
|
|
281
|
-
// Vue.use(VxeForm)
|
|
282
|
-
// Vue.use(VxeFormItem)
|
|
283
|
-
// Vue.use(VxeFormGather)
|
|
284
|
-
// Vue.use(VxeCheckbox)
|
|
285
|
-
// Vue.use(VxeCheckboxGroup)
|
|
286
|
-
// Vue.use(VxeRadio)
|
|
287
|
-
// Vue.use(VxeRadioGroup)
|
|
288
|
-
// Vue.use(VxeRadioButton)
|
|
289
|
-
// Vue.use(VxeSwitch)
|
|
290
|
-
// Vue.use(VxeInput)
|
|
291
|
-
Vue.use(VxeSelect)
|
|
292
|
-
// Vue.use(VxeOptgroup)
|
|
293
|
-
// Vue.use(VxeOption)
|
|
294
|
-
// Vue.use(VxeTextarea)
|
|
295
|
-
// Vue.use(VxeButton)
|
|
296
|
-
// Vue.use(VxeButtonGroup)
|
|
297
|
-
// Vue.use(VxeModal)
|
|
298
|
-
// Vue.use(VxeList)
|
|
299
|
-
// Vue.use(VxePulldown)
|
|
300
|
-
import './vxeTable.scss'
|