sone-ui-component-3.2.4 2.1.61 → 2.1.63
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/sone-ui.common.js +4398 -677
- package/lib/sone-ui.common.js.map +1 -1
- package/lib/sone-ui.css +1 -1
- package/lib/sone-ui.umd.js +4398 -677
- package/lib/sone-ui.umd.js.map +1 -1
- package/lib/sone-ui.umd.min.js +18 -3
- package/lib/sone-ui.umd.min.js.map +1 -1
- package/package.json +2 -2
- package/packages/normalTable/src/mainNew.vue +400 -189
- package/packages/normalTable/src/virtual/el-table-virtual-column-formatter.vue +14 -0
- package/packages/normalTable/src/virtual/el-table-virtual-column.vue +416 -0
- package/packages/normalTable/src/virtual/el-table-virtual-scroll.vue +1548 -0
- package/packages/normalTable/src/virtual/util.js +147 -0
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -25,202 +25,402 @@
|
|
|
25
25
|
</el-dropdown>
|
|
26
26
|
<slot name="transferRight"></slot>
|
|
27
27
|
</div>
|
|
28
|
-
<
|
|
29
|
-
v-if="
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
28
|
+
<VirtualScroll
|
|
29
|
+
v-if="useVirtualScroll"
|
|
30
|
+
ref="virtualScroll"
|
|
31
|
+
:data="tableData"
|
|
32
|
+
:item-size="itemSize"
|
|
33
|
+
:key-prop="option.rowKey"
|
|
34
|
+
@change="currentList => virtualList = currentList">
|
|
35
|
+
<el-table
|
|
36
|
+
v-if="isTable"
|
|
37
|
+
v-loading="loading"
|
|
38
|
+
style="width: 100%"
|
|
39
|
+
:ref="tabelRef"
|
|
40
|
+
:class="'sone-table ' + className"
|
|
41
|
+
:cell-class-name="option.cellClassName"
|
|
42
|
+
:cell-style="option.cellStyle"
|
|
43
|
+
:data="virtualList"
|
|
44
|
+
:header-cell-class-name="option.headerCellClassName"
|
|
45
|
+
:header-cell-style="option.headerCellStyle"
|
|
46
|
+
:header-row-class-name="option.headerRowClassName"
|
|
47
|
+
:header-row-style="option.headerRowStyle"
|
|
48
|
+
:height="option.height"
|
|
49
|
+
:highlight-current-row="option.highlightRow"
|
|
50
|
+
:max-height="option.maxHeight"
|
|
51
|
+
:default-expand-all="option.defaultExpandAll"
|
|
52
|
+
:row-class-name="tableRowClassName"
|
|
53
|
+
:row-key="option.rowKey"
|
|
54
|
+
:row-style="option.rowStyle"
|
|
55
|
+
:show-summary="option.showSummary"
|
|
56
|
+
:render-header="option.renderHeader"
|
|
57
|
+
:span-method="spanMethod"
|
|
58
|
+
:show-header="showHeader"
|
|
59
|
+
:stripe="stripe"
|
|
60
|
+
:border="border"
|
|
61
|
+
:sum-text="option.sumText"
|
|
62
|
+
:summary-method="summaryMethod"
|
|
63
|
+
@filter-change="filterChange"
|
|
64
|
+
@row-click="rowClick"
|
|
65
|
+
@header-dragend="onHeaderDragend"
|
|
66
|
+
@select="selectChange"
|
|
67
|
+
@select-all="selectAll"
|
|
68
|
+
@sort-change="sortChange">
|
|
69
|
+
<el-table-column
|
|
70
|
+
v-if="operation"
|
|
71
|
+
fixed
|
|
72
|
+
type="index"
|
|
73
|
+
:width="operation.width"
|
|
74
|
+
:label="operation.label ? operation.label : '操作'"
|
|
75
|
+
:resizable="operation.hasOwnProperty('resizable') ? operation.resizable : true">
|
|
76
|
+
<template slot-scope="scope">
|
|
77
|
+
<template v-if="!hideButtonMode">
|
|
78
|
+
<div class="sone-table-buttonList" v-if="scope.row.buttonShow&&scope.row.buttonShow.filter(d=>d.isShow).length<=3">
|
|
79
|
+
<template v-for="(item,index) in operation.buttonList">
|
|
80
|
+
<el-tooltip :content="item.label" :key="index" effect="light" placement="top" v-show="scope.row.buttonShow.find(i=>i.id===item.id).isShow">
|
|
81
|
+
<el-button
|
|
82
|
+
:icon="item.icon"
|
|
83
|
+
:style="{color:item.color}"
|
|
84
|
+
:disabled="scope.row.buttonShow.find(i=>i.id===item.id).isDisabled || false"
|
|
85
|
+
@click.native.stop="handButton(item.function, scope, item.id)"
|
|
86
|
+
circle
|
|
87
|
+
type="text"
|
|
88
|
+
></el-button>
|
|
89
|
+
</el-tooltip>
|
|
90
|
+
</template>
|
|
91
|
+
</div>
|
|
85
92
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
93
|
+
<div class="sone-table-buttonList" v-if="!scope.row.buttonShow&&operation.buttonList.length<=3">
|
|
94
|
+
<template v-for="(item,index) in operation.buttonList">
|
|
95
|
+
<el-tooltip :content="item.label" :key="index" effect="light" placement="top">
|
|
96
|
+
<el-button
|
|
97
|
+
:icon="item.icon"
|
|
98
|
+
:style="{color:item.color}"
|
|
99
|
+
@click.native.stop="handButton(item.function,scope, item.id)"
|
|
100
|
+
circle
|
|
101
|
+
type="text"
|
|
102
|
+
></el-button>
|
|
103
|
+
</el-tooltip>
|
|
104
|
+
</template>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
<template v-else>
|
|
108
|
+
<el-dropdown v-if="scope.row.buttonShow" class="dropdown_box_button sone-table-buttonList">
|
|
109
|
+
<span class="el-dropdown-link color-span menu-more" v-show="scope.row.buttonShow.filter(d=>d.isShow).length > 0">
|
|
110
|
+
<el-button type="text">
|
|
111
|
+
<i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
|
|
112
|
+
</el-button>
|
|
113
|
+
</span>
|
|
114
|
+
<el-dropdown-menu slot="dropdown">
|
|
115
|
+
<el-dropdown-item class="sone-table-dropdown" command="copy" v-for="(item, i) in scope.row.buttonShow.filter(d=>d.isShow)" :key="i">
|
|
116
|
+
<el-button
|
|
117
|
+
:icon="operation.buttonList.find(d=>d.id===item.id).icon"
|
|
118
|
+
:disabled="item.hasOwnProperty('isDisabled') ? item.isDisabled : false"
|
|
119
|
+
:style="{color:operation.buttonList.find(d=>d.id===item.id).color}"
|
|
120
|
+
type="text"
|
|
121
|
+
:title="operation.buttonList.find(d=>d.id === item.id).label"
|
|
122
|
+
@click.native.stop="handButton(operation.buttonList.find(d=>d.id===item.id).function, scope, item.id)"
|
|
123
|
+
>{{operation.buttonList.find(d=>d.id===item.id).label}}</el-button>
|
|
124
|
+
</el-dropdown-item>
|
|
125
|
+
</el-dropdown-menu>
|
|
126
|
+
</el-dropdown>
|
|
127
|
+
<el-dropdown v-else @command.stop="(command)=>{handleCommand(command,row)}" class="dropdown_box_button sone-table-buttonList">
|
|
128
|
+
<span class="el-dropdown-link color-span menu-more" v-show="operation.buttonList.length > 0">
|
|
129
|
+
<el-button type="text">
|
|
130
|
+
<i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
|
|
131
|
+
</el-button>
|
|
132
|
+
</span>
|
|
133
|
+
<el-dropdown-menu slot="dropdown">
|
|
134
|
+
<el-dropdown-item
|
|
135
|
+
class="sone-table-dropdown"
|
|
136
|
+
command="copy"
|
|
137
|
+
v-for="(item, i) in operation.buttonList"
|
|
138
|
+
:key="i">
|
|
139
|
+
<el-button
|
|
140
|
+
:icon="item.icon"
|
|
141
|
+
:style="{color:item.color}"
|
|
142
|
+
:title="item.label"
|
|
143
|
+
type="text"
|
|
144
|
+
@click.native.stop="handButton(item.function, scope, item.id)"
|
|
145
|
+
>{{item.label}}</el-button>
|
|
146
|
+
</el-dropdown-item>
|
|
147
|
+
</el-dropdown-menu>
|
|
148
|
+
</el-dropdown>
|
|
149
|
+
</template>
|
|
142
150
|
</template>
|
|
143
|
-
</
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
:name="column.slotColumnHeader"
|
|
186
|
-
></slot>
|
|
187
|
-
<template v-if="!column.slotColumnHeader && isShow">
|
|
188
|
-
<div class="slot_header_class">
|
|
189
|
-
<span class="table-header-isRequire" v-if="column.isRequire">*</span>
|
|
190
|
-
<span>{{ column.label }}</span>
|
|
191
|
-
<span class="hide">
|
|
192
|
-
<i
|
|
193
|
-
class="iconfont icon-help icon_describe"
|
|
194
|
-
:title="column.headerDescribe"
|
|
195
|
-
v-if="column.headerDescribe"
|
|
196
|
-
></i>
|
|
197
|
-
<span
|
|
198
|
-
:class="{ 'ascending': sortVal === column.prop + 'ascending', 'descending': sortVal === column.prop + 'descending' }"
|
|
199
|
-
class="caret-wrapper"
|
|
200
|
-
v-if="column.headerFilterSort">
|
|
201
|
-
<i
|
|
202
|
-
@click="handleCommand(column.prop, index, { command: 'ascending' })"
|
|
203
|
-
class="sort-caret ascending"
|
|
204
|
-
title="升序"
|
|
205
|
-
></i>
|
|
151
|
+
</el-table-column>
|
|
152
|
+
<VirtualColumn
|
|
153
|
+
v-if="option.index"
|
|
154
|
+
vfixed
|
|
155
|
+
type="index"
|
|
156
|
+
:width="option.indexWidth||50"
|
|
157
|
+
:label="option.indexLabel ? option.indexLabel : '序号'"
|
|
158
|
+
:index="indexMethod"
|
|
159
|
+
></VirtualColumn>
|
|
160
|
+
<VirtualColumn v-if="option.selection" vfixed width="60" type="selection"></VirtualColumn>
|
|
161
|
+
<template v-for="(column, index) in internalColumns">
|
|
162
|
+
<!-- 自定义列 -->
|
|
163
|
+
<slot v-if="column.slot && column.istrue" :name="column.slot"></slot>
|
|
164
|
+
<el-table-column
|
|
165
|
+
v-else-if="column.hasOwnProperty('istrue')?column.istrue:true"
|
|
166
|
+
:filter-method="column.filters ? filterHandler : null"
|
|
167
|
+
:filters="column.filters"
|
|
168
|
+
:fixed="column.fixed"
|
|
169
|
+
:key="`col_${column.prop}_${column.label}`"
|
|
170
|
+
:label="column.label"
|
|
171
|
+
:min-width="column.minWidth"
|
|
172
|
+
:prop="column.prop"
|
|
173
|
+
:width="column.width"
|
|
174
|
+
:align="column.hasOwnProperty('align') ? column.align : 'left'"
|
|
175
|
+
:show-overflow-tooltip="column.hasOwnProperty('showOverflowTooltip') ? column.showOverflowTooltip : false"
|
|
176
|
+
filter-placement="bottom-end"
|
|
177
|
+
:sortable="column.sortable"
|
|
178
|
+
:header-align="column.hasOwnProperty('headerAlign') ? column.headerAlign : 'left'"
|
|
179
|
+
:column-key="column.hasOwnProperty('elementId')? column.elementId:column.prop"
|
|
180
|
+
:resizable="column.hasOwnProperty('resizable') ? column.resizable : true">
|
|
181
|
+
<!-- 表头 -->
|
|
182
|
+
<template slot="header" slot-scope="scope">
|
|
183
|
+
<slot
|
|
184
|
+
v-if="column.slotColumnHeader && isShow"
|
|
185
|
+
:header="{column: scope.column, $index:scope.$index }"
|
|
186
|
+
:name="column.slotColumnHeader"
|
|
187
|
+
></slot>
|
|
188
|
+
<template v-if="!column.slotColumnHeader && isShow">
|
|
189
|
+
<div class="slot_header_class">
|
|
190
|
+
<span class="table-header-isRequire" v-if="column.isRequire">*</span>
|
|
191
|
+
<span>{{ column.label }}</span>
|
|
192
|
+
<span class="hide">
|
|
206
193
|
<i
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
194
|
+
class="iconfont icon-help icon_describe"
|
|
195
|
+
:title="column.headerDescribe"
|
|
196
|
+
v-if="column.headerDescribe"
|
|
210
197
|
></i>
|
|
198
|
+
<span
|
|
199
|
+
:class="{ 'ascending': sortVal === column.prop + 'ascending', 'descending': sortVal === column.prop + 'descending' }"
|
|
200
|
+
class="caret-wrapper"
|
|
201
|
+
v-if="column.headerFilterSort">
|
|
202
|
+
<i
|
|
203
|
+
@click="handleCommand(column.prop, index, { command: 'ascending' })"
|
|
204
|
+
class="sort-caret ascending"
|
|
205
|
+
title="升序"
|
|
206
|
+
></i>
|
|
207
|
+
<i
|
|
208
|
+
@click="handleCommand(column.prop, index, { command: 'descending' })"
|
|
209
|
+
class="sort-caret descending"
|
|
210
|
+
title="降序"
|
|
211
|
+
></i>
|
|
212
|
+
</span>
|
|
211
213
|
</span>
|
|
212
|
-
</
|
|
213
|
-
</
|
|
214
|
+
</div>
|
|
215
|
+
</template>
|
|
214
216
|
</template>
|
|
215
|
-
|
|
216
|
-
|
|
217
|
+
<!--表体-->
|
|
218
|
+
<template slot-scope="scope">
|
|
219
|
+
<slot :index="scope.$index" :name="column.slotCell" :row="scope.row" v-if="column.slotCell"></slot>
|
|
220
|
+
<template v-else>{{ scope.row[column.prop] }}</template>
|
|
221
|
+
</template>
|
|
222
|
+
</el-table-column>
|
|
223
|
+
</template>
|
|
224
|
+
</el-table>
|
|
225
|
+
</VirtualScroll>
|
|
226
|
+
<template v-else>
|
|
227
|
+
<el-table
|
|
228
|
+
v-if="isTable"
|
|
229
|
+
v-loading="loading"
|
|
230
|
+
style="width: 100%"
|
|
231
|
+
:ref="tabelRef"
|
|
232
|
+
:class="'sone-table ' + className"
|
|
233
|
+
:cell-class-name="option.cellClassName"
|
|
234
|
+
:cell-style="option.cellStyle"
|
|
235
|
+
:data="tableData"
|
|
236
|
+
:header-cell-class-name="option.headerCellClassName"
|
|
237
|
+
:header-cell-style="option.headerCellStyle"
|
|
238
|
+
:header-row-class-name="option.headerRowClassName"
|
|
239
|
+
:header-row-style="option.headerRowStyle"
|
|
240
|
+
:height="option.height"
|
|
241
|
+
:highlight-current-row="option.highlightRow"
|
|
242
|
+
:max-height="option.maxHeight"
|
|
243
|
+
:default-expand-all="option.defaultExpandAll"
|
|
244
|
+
:row-class-name="tableRowClassName"
|
|
245
|
+
:row-key="option.rowKey"
|
|
246
|
+
:row-style="option.rowStyle"
|
|
247
|
+
:show-summary="option.showSummary"
|
|
248
|
+
:render-header="option.renderHeader"
|
|
249
|
+
:span-method="spanMethod"
|
|
250
|
+
:show-header="showHeader"
|
|
251
|
+
:stripe="stripe"
|
|
252
|
+
:border="border"
|
|
253
|
+
:sum-text="option.sumText"
|
|
254
|
+
:summary-method="summaryMethod"
|
|
255
|
+
@filter-change="filterChange"
|
|
256
|
+
@row-click="rowClick"
|
|
257
|
+
@header-dragend="onHeaderDragend"
|
|
258
|
+
@select="selectChange"
|
|
259
|
+
@select-all="selectAll"
|
|
260
|
+
@sort-change="sortChange">
|
|
261
|
+
<el-table-column
|
|
262
|
+
v-if="operation"
|
|
263
|
+
fixed
|
|
264
|
+
type="index"
|
|
265
|
+
:width="operation.width"
|
|
266
|
+
:label="operation.label ? operation.label : '操作'"
|
|
267
|
+
:resizable="operation.hasOwnProperty('resizable') ? operation.resizable : true">
|
|
217
268
|
<template slot-scope="scope">
|
|
218
|
-
<
|
|
219
|
-
|
|
269
|
+
<template v-if="!hideButtonMode">
|
|
270
|
+
<div class="sone-table-buttonList" v-if="scope.row.buttonShow&&scope.row.buttonShow.filter(d=>d.isShow).length<=3">
|
|
271
|
+
<template v-for="(item,index) in operation.buttonList">
|
|
272
|
+
<el-tooltip :content="item.label" :key="index" effect="light" placement="top" v-show="scope.row.buttonShow.find(i=>i.id===item.id).isShow">
|
|
273
|
+
<el-button
|
|
274
|
+
:icon="item.icon"
|
|
275
|
+
:style="{color:item.color}"
|
|
276
|
+
:disabled="scope.row.buttonShow.find(i=>i.id===item.id).isDisabled || false"
|
|
277
|
+
@click.native.stop="handButton(item.function, scope, item.id)"
|
|
278
|
+
circle
|
|
279
|
+
type="text"
|
|
280
|
+
></el-button>
|
|
281
|
+
</el-tooltip>
|
|
282
|
+
</template>
|
|
283
|
+
</div>
|
|
284
|
+
|
|
285
|
+
<div class="sone-table-buttonList" v-if="!scope.row.buttonShow&&operation.buttonList.length<=3">
|
|
286
|
+
<template v-for="(item,index) in operation.buttonList">
|
|
287
|
+
<el-tooltip :content="item.label" :key="index" effect="light" placement="top">
|
|
288
|
+
<el-button
|
|
289
|
+
:icon="item.icon"
|
|
290
|
+
:style="{color:item.color}"
|
|
291
|
+
@click.native.stop="handButton(item.function,scope, item.id)"
|
|
292
|
+
circle
|
|
293
|
+
type="text"
|
|
294
|
+
></el-button>
|
|
295
|
+
</el-tooltip>
|
|
296
|
+
</template>
|
|
297
|
+
</div>
|
|
298
|
+
</template>
|
|
299
|
+
<template v-else>
|
|
300
|
+
<el-dropdown v-if="scope.row.buttonShow" class="dropdown_box_button sone-table-buttonList">
|
|
301
|
+
<span class="el-dropdown-link color-span menu-more" v-show="scope.row.buttonShow.filter(d=>d.isShow).length > 0">
|
|
302
|
+
<el-button type="text">
|
|
303
|
+
<i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
|
|
304
|
+
</el-button>
|
|
305
|
+
</span>
|
|
306
|
+
<el-dropdown-menu slot="dropdown">
|
|
307
|
+
<el-dropdown-item class="sone-table-dropdown" command="copy" v-for="(item, i) in scope.row.buttonShow.filter(d=>d.isShow)" :key="i">
|
|
308
|
+
<el-button
|
|
309
|
+
:icon="operation.buttonList.find(d=>d.id===item.id).icon"
|
|
310
|
+
:disabled="item.hasOwnProperty('isDisabled') ? item.isDisabled : false"
|
|
311
|
+
:style="{color:operation.buttonList.find(d=>d.id===item.id).color}"
|
|
312
|
+
type="text"
|
|
313
|
+
:title="operation.buttonList.find(d=>d.id === item.id).label"
|
|
314
|
+
@click.native.stop="handButton(operation.buttonList.find(d=>d.id===item.id).function, scope, item.id)"
|
|
315
|
+
>{{operation.buttonList.find(d=>d.id===item.id).label}}</el-button>
|
|
316
|
+
</el-dropdown-item>
|
|
317
|
+
</el-dropdown-menu>
|
|
318
|
+
</el-dropdown>
|
|
319
|
+
<el-dropdown v-else @command.stop="(command)=>{handleCommand(command,row)}" class="dropdown_box_button sone-table-buttonList">
|
|
320
|
+
<span class="el-dropdown-link color-span menu-more" v-show="operation.buttonList.length > 0">
|
|
321
|
+
<el-button type="text">
|
|
322
|
+
<i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
|
|
323
|
+
</el-button>
|
|
324
|
+
</span>
|
|
325
|
+
<el-dropdown-menu slot="dropdown">
|
|
326
|
+
<el-dropdown-item
|
|
327
|
+
class="sone-table-dropdown"
|
|
328
|
+
command="copy"
|
|
329
|
+
v-for="(item, i) in operation.buttonList"
|
|
330
|
+
:key="i">
|
|
331
|
+
<el-button
|
|
332
|
+
:icon="item.icon"
|
|
333
|
+
:style="{color:item.color}"
|
|
334
|
+
:title="item.label"
|
|
335
|
+
type="text"
|
|
336
|
+
@click.native.stop="handButton(item.function, scope, item.id)"
|
|
337
|
+
>{{item.label}}</el-button>
|
|
338
|
+
</el-dropdown-item>
|
|
339
|
+
</el-dropdown-menu>
|
|
340
|
+
</el-dropdown>
|
|
341
|
+
</template>
|
|
220
342
|
</template>
|
|
221
343
|
</el-table-column>
|
|
222
|
-
|
|
223
|
-
|
|
344
|
+
<el-table-column
|
|
345
|
+
v-if="option.index"
|
|
346
|
+
fixed
|
|
347
|
+
type="index"
|
|
348
|
+
:width="option.indexWidth||50"
|
|
349
|
+
:label="option.indexLabel ? option.indexLabel : '序号'"
|
|
350
|
+
:index="indexMethod"
|
|
351
|
+
></el-table-column>
|
|
352
|
+
<el-table-column
|
|
353
|
+
v-if="option.selection"
|
|
354
|
+
fixed
|
|
355
|
+
type="selection"
|
|
356
|
+
:show-overflow-tooltip="false"
|
|
357
|
+
:width="option.selectionWidth || 45">
|
|
358
|
+
</el-table-column>
|
|
359
|
+
<template v-for="(column, index) in internalColumns">
|
|
360
|
+
<!-- 自定义列 -->
|
|
361
|
+
<slot v-if="column.slot && column.istrue" :name="column.slot"></slot>
|
|
362
|
+
<el-table-column
|
|
363
|
+
v-else-if="column.hasOwnProperty('istrue')?column.istrue:true"
|
|
364
|
+
:filter-method="column.filters ? filterHandler : null"
|
|
365
|
+
:filters="column.filters"
|
|
366
|
+
:fixed="column.fixed"
|
|
367
|
+
:key="`col_${column.prop}_${column.label}`"
|
|
368
|
+
:label="column.label"
|
|
369
|
+
:min-width="column.minWidth"
|
|
370
|
+
:prop="column.prop"
|
|
371
|
+
:width="column.width"
|
|
372
|
+
:align="column.hasOwnProperty('align') ? column.align : 'left'"
|
|
373
|
+
:show-overflow-tooltip="column.hasOwnProperty('showOverflowTooltip') ? column.showOverflowTooltip : false"
|
|
374
|
+
filter-placement="bottom-end"
|
|
375
|
+
:sortable="column.sortable"
|
|
376
|
+
:header-align="column.hasOwnProperty('headerAlign') ? column.headerAlign : 'left'"
|
|
377
|
+
:column-key="column.hasOwnProperty('elementId')? column.elementId:column.prop"
|
|
378
|
+
:resizable="column.hasOwnProperty('resizable') ? column.resizable : true">
|
|
379
|
+
<!-- 表头 -->
|
|
380
|
+
<template slot="header" slot-scope="scope">
|
|
381
|
+
<slot
|
|
382
|
+
v-if="column.slotColumnHeader && isShow"
|
|
383
|
+
:header="{column: scope.column, $index:scope.$index }"
|
|
384
|
+
:name="column.slotColumnHeader"
|
|
385
|
+
></slot>
|
|
386
|
+
<template v-if="!column.slotColumnHeader && isShow">
|
|
387
|
+
<div class="slot_header_class">
|
|
388
|
+
<span class="table-header-isRequire" v-if="column.isRequire">*</span>
|
|
389
|
+
<span>{{ column.label }}</span>
|
|
390
|
+
<span class="hide">
|
|
391
|
+
<i
|
|
392
|
+
class="iconfont icon-help icon_describe"
|
|
393
|
+
:title="column.headerDescribe"
|
|
394
|
+
v-if="column.headerDescribe"
|
|
395
|
+
></i>
|
|
396
|
+
<span
|
|
397
|
+
:class="{ 'ascending': sortVal === column.prop + 'ascending', 'descending': sortVal === column.prop + 'descending' }"
|
|
398
|
+
class="caret-wrapper"
|
|
399
|
+
v-if="column.headerFilterSort">
|
|
400
|
+
<i
|
|
401
|
+
@click="handleCommand(column.prop, index, { command: 'ascending' })"
|
|
402
|
+
class="sort-caret ascending"
|
|
403
|
+
title="升序"
|
|
404
|
+
></i>
|
|
405
|
+
<i
|
|
406
|
+
@click="handleCommand(column.prop, index, { command: 'descending' })"
|
|
407
|
+
class="sort-caret descending"
|
|
408
|
+
title="降序"
|
|
409
|
+
></i>
|
|
410
|
+
</span>
|
|
411
|
+
</span>
|
|
412
|
+
</div>
|
|
413
|
+
</template>
|
|
414
|
+
</template>
|
|
415
|
+
<!--表体-->
|
|
416
|
+
<template slot-scope="scope">
|
|
417
|
+
<slot :index="scope.$index" :name="column.slotCell" :row="scope.row" v-if="column.slotCell"></slot>
|
|
418
|
+
<template v-else>{{ scope.row[column.prop] }}</template>
|
|
419
|
+
</template>
|
|
420
|
+
</el-table-column>
|
|
421
|
+
</template>
|
|
422
|
+
</el-table>
|
|
423
|
+
</template>
|
|
224
424
|
<div class="pagination-box" v-if="page && page.total > 0">
|
|
225
425
|
<el-pagination
|
|
226
426
|
:current-page="page.current"
|
|
@@ -242,10 +442,20 @@
|
|
|
242
442
|
import { deepClone } from 'sone-ui-component/src/utils/util'
|
|
243
443
|
import ColumnTransfer from './columnTransferNew.vue'
|
|
244
444
|
import IconButton from "sone-ui-component/packages/IconButton/index.vue";
|
|
445
|
+
import VirtualScroll from './virtual/el-table-virtual-scroll.vue'
|
|
446
|
+
import VirtualColumn from './virtual/el-table-virtual-column.vue'
|
|
245
447
|
export default {
|
|
246
448
|
name: "SoneNormalTable",
|
|
247
|
-
components: { ColumnTransfer, IconButton },
|
|
449
|
+
components: { ColumnTransfer, IconButton, VirtualScroll, VirtualColumn },
|
|
248
450
|
props: {
|
|
451
|
+
useVirtualScroll: {
|
|
452
|
+
type: Boolean,
|
|
453
|
+
default: false
|
|
454
|
+
},
|
|
455
|
+
itemSize: {
|
|
456
|
+
type: Number,
|
|
457
|
+
default: 60
|
|
458
|
+
},
|
|
249
459
|
showMenuLeft: {
|
|
250
460
|
type: Boolean,
|
|
251
461
|
default: false
|
|
@@ -357,7 +567,8 @@
|
|
|
357
567
|
internalColumns: deepClone(this.columns).filter(d => d && !d.isHidden),
|
|
358
568
|
sortVal: '', // 排序
|
|
359
569
|
isShow: true,
|
|
360
|
-
isTable: true
|
|
570
|
+
isTable: true,
|
|
571
|
+
virtualList: [],
|
|
361
572
|
}
|
|
362
573
|
},
|
|
363
574
|
watch: {
|