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/package.json CHANGED
@@ -1,6 +1,6 @@
1
- {
1
+ {
2
2
  "name": "sone-ui-component-3.2.4",
3
- "version": "2.1.61",
3
+ "version": "2.1.63",
4
4
  "private": false,
5
5
  "main": "lib/sone-ui.common.js",
6
6
  "files": [
@@ -25,202 +25,402 @@
25
25
  </el-dropdown>
26
26
  <slot name="transferRight"></slot>
27
27
  </div>
28
- <el-table
29
- v-if="isTable"
30
- v-loading="loading"
31
- style="width: 100%"
32
- :ref="tabelRef"
33
- :class="'sone-table ' + className"
34
- :cell-class-name="option.cellClassName"
35
- :cell-style="option.cellStyle"
36
- :data="tableData"
37
- :header-cell-class-name="option.headerCellClassName"
38
- :header-cell-style="option.headerCellStyle"
39
- :header-row-class-name="option.headerRowClassName"
40
- :header-row-style="option.headerRowStyle"
41
- :height="option.height"
42
- :highlight-current-row="option.highlightRow"
43
- :max-height="option.maxHeight"
44
- :default-expand-all="option.defaultExpandAll"
45
- :row-class-name="tableRowClassName"
46
- :row-key="option.rowKey"
47
- :row-style="option.rowStyle"
48
- :show-summary="option.showSummary"
49
- :render-header="option.renderHeader"
50
- :span-method="spanMethod"
51
- :show-header="showHeader"
52
- :stripe="stripe"
53
- :border="border"
54
- :sum-text="option.sumText"
55
- :summary-method="summaryMethod"
56
- @filter-change="filterChange"
57
- @row-click="rowClick"
58
- @header-dragend="onHeaderDragend"
59
- @select="selectChange"
60
- @select-all="selectAll"
61
- @sort-change="sortChange">
62
- <el-table-column
63
- v-if="operation"
64
- fixed
65
- type="index"
66
- :width="operation.width"
67
- :label="operation.label ? operation.label : '操作'"
68
- :resizable="operation.hasOwnProperty('resizable') ? operation.resizable : true">
69
- <template slot-scope="scope">
70
- <template v-if="!hideButtonMode">
71
- <div class="sone-table-buttonList" v-if="scope.row.buttonShow&&scope.row.buttonShow.filter(d=>d.isShow).length<=3">
72
- <template v-for="(item,index) in operation.buttonList">
73
- <el-tooltip :content="item.label" :key="index" effect="light" placement="top" v-show="scope.row.buttonShow.find(i=>i.id===item.id).isShow">
74
- <el-button
75
- :icon="item.icon"
76
- :style="{color:item.color}"
77
- :disabled="scope.row.buttonShow.find(i=>i.id===item.id).isDisabled || false"
78
- @click.native.stop="handButton(item.function, scope, item.id)"
79
- circle
80
- type="text"
81
- ></el-button>
82
- </el-tooltip>
83
- </template>
84
- </div>
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
- <div class="sone-table-buttonList" v-if="!scope.row.buttonShow&&operation.buttonList.length<=3">
87
- <template v-for="(item,index) in operation.buttonList">
88
- <el-tooltip :content="item.label" :key="index" effect="light" placement="top">
89
- <el-button
90
- :icon="item.icon"
91
- :style="{color:item.color}"
92
- @click.native.stop="handButton(item.function,scope, item.id)"
93
- circle
94
- type="text"
95
- ></el-button>
96
- </el-tooltip>
97
- </template>
98
- </div>
99
- </template>
100
- <template v-else>
101
- <el-dropdown v-if="scope.row.buttonShow" class="dropdown_box_button sone-table-buttonList">
102
- <span class="el-dropdown-link color-span menu-more" v-show="scope.row.buttonShow.filter(d=>d.isShow).length > 0">
103
- <el-button type="text">
104
- <i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
105
- </el-button>
106
- </span>
107
- <el-dropdown-menu slot="dropdown">
108
- <el-dropdown-item class="sone-table-dropdown" command="copy" v-for="(item, i) in scope.row.buttonShow.filter(d=>d.isShow)" :key="i">
109
- <el-button
110
- :icon="operation.buttonList.find(d=>d.id===item.id).icon"
111
- :disabled="item.hasOwnProperty('isDisabled') ? item.isDisabled : false"
112
- :style="{color:operation.buttonList.find(d=>d.id===item.id).color}"
113
- type="text"
114
- :title="operation.buttonList.find(d=>d.id === item.id).label"
115
- @click.native.stop="handButton(operation.buttonList.find(d=>d.id===item.id).function, scope, item.id)"
116
- >{{operation.buttonList.find(d=>d.id===item.id).label}}</el-button>
117
- </el-dropdown-item>
118
- </el-dropdown-menu>
119
- </el-dropdown>
120
- <el-dropdown v-else @command.stop="(command)=>{handleCommand(command,row)}" class="dropdown_box_button sone-table-buttonList">
121
- <span class="el-dropdown-link color-span menu-more" v-show="operation.buttonList.length > 0">
122
- <el-button type="text">
123
- <i :style="{color:operation.moreIconColor}" class="el-icon-more more-handel"></i>
124
- </el-button>
125
- </span>
126
- <el-dropdown-menu slot="dropdown">
127
- <el-dropdown-item
128
- class="sone-table-dropdown"
129
- command="copy"
130
- v-for="(item, i) in operation.buttonList"
131
- :key="i">
132
- <el-button
133
- :icon="item.icon"
134
- :style="{color:item.color}"
135
- :title="item.label"
136
- type="text"
137
- @click.native.stop="handButton(item.function, scope, item.id)"
138
- >{{item.label}}</el-button>
139
- </el-dropdown-item>
140
- </el-dropdown-menu>
141
- </el-dropdown>
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
- </template>
144
- </el-table-column>
145
- <el-table-column
146
- v-if="option.index"
147
- fixed
148
- type="index"
149
- :width="option.indexWidth||50"
150
- :label="option.indexLabel ? option.indexLabel : '序号'"
151
- :index="indexMethod"
152
- ></el-table-column>
153
- <el-table-column
154
- v-if="option.selection"
155
- fixed
156
- type="selection"
157
- :show-overflow-tooltip="false"
158
- :width="option.selectionWidth || 45">
159
- </el-table-column>
160
- <template v-for="(column, index) in internalColumns">
161
- <!-- 自定义列 -->
162
- <slot v-if="column.slot && column.istrue" :name="column.slot"></slot>
163
- <el-table-column
164
- v-else-if="column.hasOwnProperty('istrue')?column.istrue:true"
165
- :filter-method="column.filters ? filterHandler : null"
166
- :filters="column.filters"
167
- :fixed="column.fixed"
168
- :key="`col_${column.prop}_${column.label}`"
169
- :label="column.label"
170
- :min-width="column.minWidth"
171
- :prop="column.prop"
172
- :width="column.width"
173
- :align="column.hasOwnProperty('align') ? column.align : 'left'"
174
- :show-overflow-tooltip="column.hasOwnProperty('showOverflowTooltip') ? column.showOverflowTooltip : false"
175
- filter-placement="bottom-end"
176
- :sortable="column.sortable"
177
- :header-align="column.hasOwnProperty('headerAlign') ? column.headerAlign : 'left'"
178
- :column-key="column.hasOwnProperty('elementId')? column.elementId:column.prop"
179
- :resizable="column.hasOwnProperty('resizable') ? column.resizable : true">
180
- <!-- 表头 -->
181
- <template slot="header" slot-scope="scope">
182
- <slot
183
- v-if="column.slotColumnHeader && isShow"
184
- :header="{column: scope.column, $index:scope.$index }"
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
- @click="handleCommand(column.prop, index, { command: 'descending' })"
208
- class="sort-caret descending"
209
- title="降序"
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
- </span>
213
- </div>
214
+ </div>
215
+ </template>
214
216
  </template>
215
- </template>
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
- <slot :index="scope.$index" :name="column.slotCell" :row="scope.row" v-if="column.slotCell"></slot>
219
- <template v-else>{{ scope.row[column.prop] }}</template>
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
- </template>
223
- </el-table>
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: {
@@ -0,0 +1,14 @@
1
+ <script>
2
+ // 此组件仅用于显示VNode
3
+ export default {
4
+ name: 'el-table-virtual-column-formatter',
5
+ props: {
6
+ vNode: {
7
+ type: Object
8
+ }
9
+ },
10
+ render () {
11
+ return this.vNode
12
+ }
13
+ }
14
+ </script>