@lx-frontend/wrap-element-ui 1.0.7-beta.0 → 1.0.7-beta.2

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": "@lx-frontend/wrap-element-ui",
3
- "version": "1.0.7-beta.0",
3
+ "version": "1.0.7-beta.2",
4
4
  "description": "wrap-element-ui",
5
5
  "author": "",
6
6
  "main": "src/components/index.ts",
@@ -46,7 +46,7 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
46
46
  watch(
47
47
  () => props.columnConfig,
48
48
  (val) => {
49
- filteredValue.value = val.reduce((prev, curr) => ({ ...prev, [curr.prop]: [] }), {});
49
+ val?.forEach(v => handleResetFilterValue(v));
50
50
  tempFilteredValue.value = { ...filteredValue.value };
51
51
  },
52
52
  { immediate: true }
@@ -151,7 +151,10 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
151
151
  if (params[key] === undefined) delete params[key]
152
152
  })
153
153
 
154
- emit('search', params);
154
+ emit('search', {
155
+ ...params,
156
+ page: 1
157
+ });
155
158
  };
156
159
 
157
160
  const handleHeaderOperationConfirm = async (column: IColumnConfig, scope) => {
@@ -223,6 +226,18 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
223
226
  }
224
227
  }
225
228
 
229
+ function handleResetFilterValue (column: IColumnConfig) {
230
+ if (column.filters) {
231
+ if (Array.isArray(column.filters)) {
232
+ filteredValue.value[column.prop] = []
233
+ } else if (column.filters.default) {
234
+ filteredValue.value[column.prop] = column.filters.default
235
+ } else {
236
+ filteredValue.value[column.prop] = column.filters.type === 'radio' ? '' : []
237
+ }
238
+ }
239
+ }
240
+
226
241
  const handleHeaderOperationReset = async (column: IColumnConfig, scope) => {
227
242
  if (sortingColumn.value && sortingColumn.value.prop === column.prop) {
228
243
  clearSort();
@@ -231,11 +246,7 @@ export function useColumnHeaderOperation({ props, tableDomRef, sortFilterPopover
231
246
  // 合计
232
247
  summaryList.value = summaryList.value.filter(item => item !== column.prop);
233
248
 
234
- if (column.filters) {
235
- filteredValue.value[column.prop] = Array.isArray(column.filters)
236
- ? []
237
- : column.filters.default ?? []
238
- }
249
+ handleResetFilterValue(column)
239
250
  if (column.search) {
240
251
  if (!Array.isArray(column.search)) {
241
252
  searchValue.value[column.prop] = '';
@@ -28,4 +28,4 @@ export function usePagination({ emit, beforePageChange }: IParams) {
28
28
  handlePageSizeChange,
29
29
  handleCurrPageChange,
30
30
  }
31
- }
31
+ }
@@ -125,6 +125,7 @@
125
125
  v-for="item in (Array.isArray(column.filters) ? column.filters : column.filters.options)"
126
126
  :key="item.value"
127
127
  :label="item.value"
128
+ :title="item.text"
128
129
  class="editable-table-sort-filter__filter-checkbox"
129
130
  >
130
131
  <slot
@@ -146,6 +147,7 @@
146
147
  v-for="item in column.filters.options"
147
148
  :key="item.value"
148
149
  :label="item.value"
150
+ :title="item.text"
149
151
  >
150
152
  <slot
151
153
  name="filter-item"
@@ -387,10 +387,26 @@
387
387
  &__sort,
388
388
  &__search {
389
389
  padding: 14px;
390
+
391
+ .el-radio__label {
392
+ white-space: nowrap;
393
+ overflow: hidden;
394
+ text-overflow: ellipsis;
395
+ width: calc(100% + 10px);
396
+ display: inline-block;
397
+ vertical-align: middle;
398
+ }
390
399
  }
391
400
 
392
401
  &__filter {
393
402
  padding-top: 0;
403
+
404
+ .el-radio-group,
405
+ .el-checkbox-group {
406
+ max-height: 166px;
407
+ overflow-y: auto;
408
+ overflow-x: hidden;
409
+ }
394
410
  }
395
411
 
396
412
  &__filter-title,
@@ -447,6 +463,7 @@
447
463
  }
448
464
 
449
465
  &__filter-checkbox-group {
466
+ width: 100%;
450
467
  display: flex;
451
468
  flex-direction: column;
452
469
  justify-content: flex-start;
@@ -456,10 +473,20 @@
456
473
  &__filter-checkbox {
457
474
  margin-top: 10px;
458
475
  font-size: 14px;
476
+ width: 100%;
459
477
 
460
478
  &:first-child {
461
479
  margin-top: 0;
462
480
  }
481
+
482
+ .el-checkbox__label {
483
+ white-space: nowrap;
484
+ overflow: hidden;
485
+ text-overflow: ellipsis;
486
+ width: calc(100% - 20px);
487
+ display: inline-block;
488
+ vertical-align: middle;
489
+ }
463
490
  }
464
491
 
465
492
  &__footer {
@@ -496,6 +523,11 @@
496
523
  background: @--theme-blue--;
497
524
  border-color: @--theme-blue--;
498
525
  }
526
+
527
+ .el-checkbox__input.is-checked+.el-checkbox__label,
528
+ .el-radio__input.is-checked+.el-radio__label {
529
+ color: @--theme-blue--;
530
+ }
499
531
  }
500
532
 
501
533
  &__pin-top {
@@ -725,4 +757,4 @@
725
757
  &::before {
726
758
  bottom: -4px;
727
759
  }
728
- }
760
+ }
@@ -514,7 +514,7 @@ const {
514
514
  tempSortType,
515
515
  sortingColumn,
516
516
  isColumnFiltering,
517
- searchValue,
517
+ // searchValue,
518
518
  inSorting,
519
519
  } = useColumnHeaderOperation({
520
520
  tableDomRef,
@@ -12,6 +12,8 @@ type _IColumnConfigRequired = {
12
12
  editType?: IEditType; // 编辑格式
13
13
  editSlotName?: string; // 编辑时,自定义编辑组件的slotName
14
14
  sortable?: boolean; // 该列是否允许排序,ture则表头弹窗会显示升降序按钮
15
+ /** 内部使用, */
16
+ isColumnSortable?: boolean;
15
17
  slotName?: string; // 如果要自定义,传入 slotName
16
18
  hoverSlotName?: string; // 悬浮时,自定义悬浮组件的slotName
17
19
  isAlwaysShow?: boolean; // 不可隐藏,显示设置中,该列不允许隐藏