@weitutech/by-components 1.1.131 → 1.1.133
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/by-components.common.js +471 -27
- package/lib/by-components.css +1 -1
- package/lib/by-components.umd.js +471 -27
- package/lib/by-components.umd.min.js +1 -1
- package/lib/index.css +1 -1
- package/package.json +1 -1
|
@@ -60514,6 +60514,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
60514
60514
|
ByForm: function() { return /* reexport */ form_form; },
|
|
60515
60515
|
ByPageSearch: function() { return /* reexport */ page_search; },
|
|
60516
60516
|
ByPager: function() { return /* reexport */ pager; },
|
|
60517
|
+
ByPopoverSelector: function() { return /* reexport */ ByPopoverSelector; },
|
|
60517
60518
|
BySelect: function() { return /* reexport */ comps_select; },
|
|
60518
60519
|
ByTable: function() { return /* reexport */ table; },
|
|
60519
60520
|
ByToolBar: function() { return /* reexport */ ByToolBar; },
|
|
@@ -60751,8 +60752,8 @@ var component = normalizeComponent(
|
|
|
60751
60752
|
)
|
|
60752
60753
|
|
|
60753
60754
|
/* harmony default export */ var pager = (component.exports);
|
|
60754
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=
|
|
60755
|
-
var
|
|
60755
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/table/index.vue?vue&type=template&id=22f2fb85
|
|
60756
|
+
var tablevue_type_template_id_22f2fb85_render = function render() {
|
|
60756
60757
|
var _vm = this,
|
|
60757
60758
|
_c = _vm._self._c;
|
|
60758
60759
|
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
@@ -60826,7 +60827,7 @@ var tablevue_type_template_id_5b90b233_render = function render() {
|
|
|
60826
60827
|
}
|
|
60827
60828
|
}) : _vm._e()], 1);
|
|
60828
60829
|
};
|
|
60829
|
-
var
|
|
60830
|
+
var tablevue_type_template_id_22f2fb85_staticRenderFns = [];
|
|
60830
60831
|
|
|
60831
60832
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
60832
60833
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -61931,7 +61932,7 @@ var custom_column_component = normalizeComponent(
|
|
|
61931
61932
|
},
|
|
61932
61933
|
computed: {
|
|
61933
61934
|
options() {
|
|
61934
|
-
var _others$pagerConfig, _others$sortConfig, _others$pagerConfig2, _others$pagerConfig3, _others$
|
|
61935
|
+
var _others$pagerConfig, _others$sortConfig, _others$pagerConfig2, _others$sortConfig2, _others$pagerConfig3, _others$sortConfig3, _sortConfig$remote;
|
|
61935
61936
|
const {
|
|
61936
61937
|
customColumnConfig,
|
|
61937
61938
|
columns,
|
|
@@ -61950,15 +61951,18 @@ var custom_column_component = normalizeComponent(
|
|
|
61950
61951
|
newColumns = this.removeFixedColumns(newColumns);
|
|
61951
61952
|
}
|
|
61952
61953
|
|
|
61953
|
-
//
|
|
61954
|
+
// 处理前端分页和虚拟滚动
|
|
61954
61955
|
let data = others.data || [];
|
|
61955
61956
|
if ((_others$pagerConfig = others.pagerConfig) !== null && _others$pagerConfig !== void 0 && _others$pagerConfig.frontendPagination || (_others$sortConfig = others.sortConfig) !== null && _others$sortConfig !== void 0 && _others$sortConfig.frontendSort) {
|
|
61956
61957
|
// 保存完整数据
|
|
61957
61958
|
this.allData = [...data];
|
|
61958
61959
|
}
|
|
61959
61960
|
if ((_others$pagerConfig2 = others.pagerConfig) !== null && _others$pagerConfig2 !== void 0 && _others$pagerConfig2.frontendPagination) {
|
|
61960
|
-
//
|
|
61961
|
+
// 前端分页:截取当前页数据
|
|
61961
61962
|
data = this.spliteListData(this.allData, others.pagerConfig.currentPage, others.pagerConfig.pageSize);
|
|
61963
|
+
} else if ((_others$sortConfig2 = others.sortConfig) !== null && _others$sortConfig2 !== void 0 && _others$sortConfig2.frontendSort) {
|
|
61964
|
+
// 虚拟滚动:处理置顶行和默认排序
|
|
61965
|
+
data = this.spliteListData(this.allData, null, null);
|
|
61962
61966
|
}
|
|
61963
61967
|
|
|
61964
61968
|
// 移除 others 中的 data,避免覆盖
|
|
@@ -62010,9 +62014,12 @@ var custom_column_component = normalizeComponent(
|
|
|
62010
62014
|
},
|
|
62011
62015
|
sortConfig: {
|
|
62012
62016
|
...sortConfig,
|
|
62013
|
-
//
|
|
62014
|
-
//
|
|
62015
|
-
|
|
62017
|
+
// 🔧 排序模式配置:
|
|
62018
|
+
// - 前端分页:remote: true(数据已在 spliteListData 中排序)
|
|
62019
|
+
// - 虚拟滚动 + 前端排序:remote: true(手动处理置顶行,类似前端分页)
|
|
62020
|
+
// - 后端排序:remote: 外部配置或 false
|
|
62021
|
+
remote: (_others$pagerConfig3 = others.pagerConfig) !== null && _others$pagerConfig3 !== void 0 && _others$pagerConfig3.frontendPagination || (_others$sortConfig3 = others.sortConfig) !== null && _others$sortConfig3 !== void 0 && _others$sortConfig3.frontendSort ? true // 前端分页或虚拟滚动:都使用 remote: true,手动处理排序(支持置顶行)
|
|
62022
|
+
: (_sortConfig$remote = sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.remote) !== null && _sortConfig$remote !== void 0 ? _sortConfig$remote : false,
|
|
62016
62023
|
trigger: 'cell',
|
|
62017
62024
|
...this.gridOptions.sortConfig
|
|
62018
62025
|
},
|
|
@@ -62362,14 +62369,19 @@ var custom_column_component = normalizeComponent(
|
|
|
62362
62369
|
property,
|
|
62363
62370
|
order
|
|
62364
62371
|
} = event;
|
|
62365
|
-
const shouldHandleSort = ((_this$gridOptions$pag3 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag3 === void 0 ? void 0 : _this$gridOptions$pag3.frontendPagination) || ((_this$gridOptions$sor2 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor2 === void 0 ? void 0 : _this$gridOptions$sor2.frontendSort);
|
|
62366
62372
|
|
|
62367
|
-
//
|
|
62373
|
+
// 🔧 区分前端分页和虚拟滚动:
|
|
62374
|
+
// - 前端分页(frontendPagination):手动排序 + 分页
|
|
62375
|
+
// - 虚拟滚动(frontendSort 但无 frontendPagination):手动排序 + 虚拟滚动(支持置顶行)
|
|
62376
|
+
const isFrontendPagination = (_this$gridOptions$pag3 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag3 === void 0 ? void 0 : _this$gridOptions$pag3.frontendPagination;
|
|
62377
|
+
const isVirtualScrollWithSort = ((_this$gridOptions$sor2 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor2 === void 0 ? void 0 : _this$gridOptions$sor2.frontendSort) && !isFrontendPagination;
|
|
62378
|
+
|
|
62379
|
+
// 无论哪种模式,都保存排序状态用于恢复箭头高亮
|
|
62368
62380
|
this.sortState.field = property;
|
|
62369
62381
|
this.sortState.order = order;
|
|
62370
|
-
if (
|
|
62371
|
-
|
|
62372
|
-
const newData = this.spliteListData(this.allData,
|
|
62382
|
+
if (isFrontendPagination) {
|
|
62383
|
+
// 前端分页模式:手动处理排序和分页
|
|
62384
|
+
const newData = this.spliteListData(this.allData, this.gridOptions.pagerConfig.currentPage, this.gridOptions.pagerConfig.pageSize);
|
|
62373
62385
|
if (this.$refs.xGrid) {
|
|
62374
62386
|
this.$refs.xGrid.reloadData(newData);
|
|
62375
62387
|
this.$nextTick(() => {
|
|
@@ -62382,8 +62394,7 @@ var custom_column_component = normalizeComponent(
|
|
|
62382
62394
|
}, 100);
|
|
62383
62395
|
}
|
|
62384
62396
|
setTimeout(() => {
|
|
62385
|
-
|
|
62386
|
-
if ((_this$gridOptions$pag6 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag6 !== void 0 && _this$gridOptions$pag6.frontendPagination && this.$refs.xGrid) {
|
|
62397
|
+
if (this.$refs.xGrid) {
|
|
62387
62398
|
// 前端分页时,排序状态变化,回到第一页
|
|
62388
62399
|
const currentPage = this.gridOptions.pagerConfig.currentPage;
|
|
62389
62400
|
if (currentPage !== 1) {
|
|
@@ -62400,8 +62411,30 @@ var custom_column_component = normalizeComponent(
|
|
|
62400
62411
|
}, 0);
|
|
62401
62412
|
});
|
|
62402
62413
|
}
|
|
62414
|
+
} else if (isVirtualScrollWithSort) {
|
|
62415
|
+
// 虚拟滚动模式:手动处理排序(支持置顶行)
|
|
62416
|
+
const newData = this.spliteListData(this.allData, null, null);
|
|
62417
|
+
if (this.$refs.xGrid) {
|
|
62418
|
+
this.$refs.xGrid.reloadData(newData);
|
|
62419
|
+
this.$nextTick(() => {
|
|
62420
|
+
if (property && order) {
|
|
62421
|
+
setTimeout(() => {
|
|
62422
|
+
// 只高亮箭头,表格内部不排序(因为数据已经排序好)
|
|
62423
|
+
this.$refs.xGrid.sort(property, order, {
|
|
62424
|
+
silent: true
|
|
62425
|
+
});
|
|
62426
|
+
}, 100);
|
|
62427
|
+
}
|
|
62428
|
+
setTimeout(() => {
|
|
62429
|
+
if (this.$refs.xGrid) {
|
|
62430
|
+
// 排序后滚动到顶部
|
|
62431
|
+
this.$refs.xGrid.scrollTo(0, 0);
|
|
62432
|
+
}
|
|
62433
|
+
}, 0);
|
|
62434
|
+
});
|
|
62435
|
+
}
|
|
62403
62436
|
} else {
|
|
62404
|
-
//
|
|
62437
|
+
// 后端模式:确保排序箭头高亮
|
|
62405
62438
|
this.$nextTick(() => {
|
|
62406
62439
|
if (property && order && this.$refs.xGrid) {
|
|
62407
62440
|
setTimeout(() => {
|
|
@@ -62436,6 +62469,7 @@ var custom_column_component = normalizeComponent(
|
|
|
62436
62469
|
this.sortState.order = defaultSort.order;
|
|
62437
62470
|
setTimeout(() => {
|
|
62438
62471
|
if (this.$refs.xGrid) {
|
|
62472
|
+
// 🔧 两种模式都使用手动排序(支持置顶行)
|
|
62439
62473
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62440
62474
|
silent: true
|
|
62441
62475
|
});
|
|
@@ -62448,9 +62482,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62448
62482
|
* 初始化默认排序(支持前端分页和虚拟滚动)
|
|
62449
62483
|
*/
|
|
62450
62484
|
initDefaultSortForFrontendPagination() {
|
|
62451
|
-
var _this$gridOptions$
|
|
62485
|
+
var _this$gridOptions$pag4, _this$gridOptions$sor4, _this$gridOptions$sor5;
|
|
62452
62486
|
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62453
|
-
const shouldInitSort = ((_this$gridOptions$
|
|
62487
|
+
const shouldInitSort = ((_this$gridOptions$pag4 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag4 === void 0 ? void 0 : _this$gridOptions$pag4.frontendPagination) || ((_this$gridOptions$sor4 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor4 === void 0 ? void 0 : _this$gridOptions$sor4.frontendSort);
|
|
62454
62488
|
if (!shouldInitSort) {
|
|
62455
62489
|
return;
|
|
62456
62490
|
}
|
|
@@ -62460,11 +62494,13 @@ var custom_column_component = normalizeComponent(
|
|
|
62460
62494
|
this.sortState.field = defaultSort.field;
|
|
62461
62495
|
this.sortState.order = defaultSort.order;
|
|
62462
62496
|
|
|
62463
|
-
// 在下一个tick
|
|
62497
|
+
// 在下一个tick中应用排序
|
|
62464
62498
|
this.$nextTick(() => {
|
|
62465
62499
|
if (this.$refs.xGrid) {
|
|
62466
62500
|
setTimeout(() => {
|
|
62467
|
-
//
|
|
62501
|
+
// 🔧 两种模式都使用手动排序(支持置顶行):
|
|
62502
|
+
// - 前端分页:数据在 spliteListData 中排序,只需UI高亮
|
|
62503
|
+
// - 虚拟滚动:数据在 spliteListData 中排序,只需UI高亮
|
|
62468
62504
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62469
62505
|
silent: true
|
|
62470
62506
|
});
|
|
@@ -62477,9 +62513,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62477
62513
|
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
62478
62514
|
*/
|
|
62479
62515
|
ensureDefaultSortHighlight() {
|
|
62480
|
-
var _this$gridOptions$
|
|
62516
|
+
var _this$gridOptions$pag5, _this$gridOptions$sor6, _this$gridOptions$sor7;
|
|
62481
62517
|
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62482
|
-
const shouldEnsureSort = ((_this$gridOptions$
|
|
62518
|
+
const shouldEnsureSort = ((_this$gridOptions$pag5 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag5 === void 0 ? void 0 : _this$gridOptions$pag5.frontendPagination) || ((_this$gridOptions$sor6 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor6 === void 0 ? void 0 : _this$gridOptions$sor6.frontendSort);
|
|
62483
62519
|
if (!shouldEnsureSort) {
|
|
62484
62520
|
return;
|
|
62485
62521
|
}
|
|
@@ -62489,9 +62525,12 @@ var custom_column_component = normalizeComponent(
|
|
|
62489
62525
|
this.sortState.field = defaultSort.field;
|
|
62490
62526
|
this.sortState.order = defaultSort.order;
|
|
62491
62527
|
|
|
62492
|
-
//
|
|
62528
|
+
// 应用排序
|
|
62493
62529
|
if (this.$refs.xGrid) {
|
|
62494
62530
|
setTimeout(() => {
|
|
62531
|
+
// 🔧 两种模式都使用手动排序(支持置顶行):
|
|
62532
|
+
// - 前端分页:数据已在 spliteListData 中排序,只需UI高亮(silent: true)
|
|
62533
|
+
// - 虚拟滚动:数据已在 spliteListData 中排序,只需UI高亮(silent: true)
|
|
62495
62534
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62496
62535
|
silent: true
|
|
62497
62536
|
});
|
|
@@ -62513,8 +62552,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62513
62552
|
;
|
|
62514
62553
|
var table_component = normalizeComponent(
|
|
62515
62554
|
components_tablevue_type_script_lang_js,
|
|
62516
|
-
|
|
62517
|
-
|
|
62555
|
+
tablevue_type_template_id_22f2fb85_render,
|
|
62556
|
+
tablevue_type_template_id_22f2fb85_staticRenderFns,
|
|
62518
62557
|
false,
|
|
62519
62558
|
null,
|
|
62520
62559
|
null,
|
|
@@ -80236,6 +80275,409 @@ var ByFloatingMenu_component = normalizeComponent(
|
|
|
80236
80275
|
)
|
|
80237
80276
|
|
|
80238
80277
|
/* harmony default export */ var ByFloatingMenu = (ByFloatingMenu_component.exports);
|
|
80278
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"ffbc40de-vue-loader-template"}!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/popover-selector/ByPopoverSelector.vue?vue&type=template&id=58b99e88&scoped=true
|
|
80279
|
+
var ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_render = function render() {
|
|
80280
|
+
var _vm = this,
|
|
80281
|
+
_c = _vm._self._c;
|
|
80282
|
+
return _c('div', {
|
|
80283
|
+
staticClass: "by-popover-selector"
|
|
80284
|
+
}, [_c('el-popover', {
|
|
80285
|
+
ref: "popover",
|
|
80286
|
+
attrs: {
|
|
80287
|
+
"placement": _vm.placement,
|
|
80288
|
+
"width": _vm.popoverWidth,
|
|
80289
|
+
"trigger": "click",
|
|
80290
|
+
"disabled": _vm.disabled,
|
|
80291
|
+
"popper-class": "by-popover-selector-popover"
|
|
80292
|
+
},
|
|
80293
|
+
on: {
|
|
80294
|
+
"show": _vm.handleShow,
|
|
80295
|
+
"hide": _vm.handleHide
|
|
80296
|
+
},
|
|
80297
|
+
model: {
|
|
80298
|
+
value: _vm.visible,
|
|
80299
|
+
callback: function ($$v) {
|
|
80300
|
+
_vm.visible = $$v;
|
|
80301
|
+
},
|
|
80302
|
+
expression: "visible"
|
|
80303
|
+
}
|
|
80304
|
+
}, [_c('div', {
|
|
80305
|
+
staticClass: "popover-content"
|
|
80306
|
+
}, [_vm.title ? _c('div', {
|
|
80307
|
+
staticClass: "popover-title"
|
|
80308
|
+
}, [_vm._v(" " + _vm._s(_vm.title) + " ")]) : _vm._e(), _c('div', {
|
|
80309
|
+
staticClass: "options-container",
|
|
80310
|
+
class: {
|
|
80311
|
+
'multi-column': _vm.isMultiColumn
|
|
80312
|
+
}
|
|
80313
|
+
}, [!_vm.multiple ? _c('el-radio-group', {
|
|
80314
|
+
staticClass: "options-group",
|
|
80315
|
+
on: {
|
|
80316
|
+
"change": _vm.handleSingleChange
|
|
80317
|
+
},
|
|
80318
|
+
model: {
|
|
80319
|
+
value: _vm.selectedValue,
|
|
80320
|
+
callback: function ($$v) {
|
|
80321
|
+
_vm.selectedValue = $$v;
|
|
80322
|
+
},
|
|
80323
|
+
expression: "selectedValue"
|
|
80324
|
+
}
|
|
80325
|
+
}, _vm._l(_vm.displayOptions, function (item, index) {
|
|
80326
|
+
return _c('div', {
|
|
80327
|
+
key: item.id || item.value || index,
|
|
80328
|
+
staticClass: "option-item",
|
|
80329
|
+
class: {
|
|
80330
|
+
'disabled': item.disabled
|
|
80331
|
+
}
|
|
80332
|
+
}, [_c('el-radio', {
|
|
80333
|
+
staticClass: "option-radio",
|
|
80334
|
+
attrs: {
|
|
80335
|
+
"label": item.id || item.value,
|
|
80336
|
+
"disabled": item.disabled
|
|
80337
|
+
}
|
|
80338
|
+
}, [_vm._v(" " + _vm._s(item.name || item.label) + " ")])], 1);
|
|
80339
|
+
}), 0) : _c('el-checkbox-group', {
|
|
80340
|
+
staticClass: "options-group",
|
|
80341
|
+
on: {
|
|
80342
|
+
"change": _vm.handleMultipleChange
|
|
80343
|
+
},
|
|
80344
|
+
model: {
|
|
80345
|
+
value: _vm.selectedValues,
|
|
80346
|
+
callback: function ($$v) {
|
|
80347
|
+
_vm.selectedValues = $$v;
|
|
80348
|
+
},
|
|
80349
|
+
expression: "selectedValues"
|
|
80350
|
+
}
|
|
80351
|
+
}, _vm._l(_vm.displayOptions, function (item, index) {
|
|
80352
|
+
return _c('div', {
|
|
80353
|
+
key: item.id || item.value || index,
|
|
80354
|
+
staticClass: "option-item",
|
|
80355
|
+
class: {
|
|
80356
|
+
'disabled': item.disabled
|
|
80357
|
+
}
|
|
80358
|
+
}, [_c('el-checkbox', {
|
|
80359
|
+
staticClass: "option-checkbox",
|
|
80360
|
+
attrs: {
|
|
80361
|
+
"label": item.id || item.value,
|
|
80362
|
+
"disabled": item.disabled
|
|
80363
|
+
}
|
|
80364
|
+
}, [_vm._v(" " + _vm._s(item.name || item.label) + " ")])], 1);
|
|
80365
|
+
}), 0)], 1), _c('div', {
|
|
80366
|
+
staticClass: "popover-footer"
|
|
80367
|
+
}, [_c('el-button', {
|
|
80368
|
+
attrs: {
|
|
80369
|
+
"size": "small"
|
|
80370
|
+
},
|
|
80371
|
+
on: {
|
|
80372
|
+
"click": _vm.handleCancel
|
|
80373
|
+
}
|
|
80374
|
+
}, [_vm._v(" " + _vm._s(_vm.cancelText) + " ")]), _c('el-button', {
|
|
80375
|
+
staticClass: "confirm-button",
|
|
80376
|
+
staticStyle: {
|
|
80377
|
+
"min-width": "60px !important",
|
|
80378
|
+
"height": "32px !important",
|
|
80379
|
+
"visibility": "visible !important",
|
|
80380
|
+
"display": "inline-block !important",
|
|
80381
|
+
"opacity": "1 !important",
|
|
80382
|
+
"background-color": "#409eff !important",
|
|
80383
|
+
"border-color": "#409eff !important",
|
|
80384
|
+
"color": "#ffffff !important"
|
|
80385
|
+
},
|
|
80386
|
+
attrs: {
|
|
80387
|
+
"type": _vm.hasSelection ? 'primary' : 'default',
|
|
80388
|
+
"size": "small",
|
|
80389
|
+
"disabled": !_vm.hasSelection
|
|
80390
|
+
},
|
|
80391
|
+
on: {
|
|
80392
|
+
"click": _vm.handleConfirm
|
|
80393
|
+
}
|
|
80394
|
+
}, [_vm._v(" " + _vm._s(_vm.confirmText) + " ")])], 1)]), _c('el-button', {
|
|
80395
|
+
class: ['trigger-button', {
|
|
80396
|
+
'tiny-button': _vm.tiny
|
|
80397
|
+
}],
|
|
80398
|
+
attrs: {
|
|
80399
|
+
"slot": "reference",
|
|
80400
|
+
"type": _vm.buttonType,
|
|
80401
|
+
"plain": "",
|
|
80402
|
+
"size": _vm.tiny ? 'mini' : _vm.buttonSize,
|
|
80403
|
+
"disabled": _vm.disabled,
|
|
80404
|
+
"loading": _vm.loading
|
|
80405
|
+
},
|
|
80406
|
+
slot: "reference"
|
|
80407
|
+
}, [_vm._v(" " + _vm._s(_vm.buttonText) + " ")])], 1)], 1);
|
|
80408
|
+
};
|
|
80409
|
+
var ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_staticRenderFns = [];
|
|
80410
|
+
|
|
80411
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/popover-selector/ByPopoverSelector.vue?vue&type=script&lang=js
|
|
80412
|
+
|
|
80413
|
+
|
|
80414
|
+
|
|
80415
|
+
|
|
80416
|
+
/* harmony default export */ var ByPopoverSelectorvue_type_script_lang_js = ({
|
|
80417
|
+
name: 'ByPopoverSelector',
|
|
80418
|
+
props: {
|
|
80419
|
+
// 数据源
|
|
80420
|
+
options: {
|
|
80421
|
+
type: Array,
|
|
80422
|
+
default: () => []
|
|
80423
|
+
},
|
|
80424
|
+
// 当前选中的值(单选)
|
|
80425
|
+
value: {
|
|
80426
|
+
type: [String, Number],
|
|
80427
|
+
default: null
|
|
80428
|
+
},
|
|
80429
|
+
// 当前选中的值(多选)
|
|
80430
|
+
values: {
|
|
80431
|
+
type: Array,
|
|
80432
|
+
default: () => []
|
|
80433
|
+
},
|
|
80434
|
+
// 是否多选
|
|
80435
|
+
multiple: {
|
|
80436
|
+
type: Boolean,
|
|
80437
|
+
default: false
|
|
80438
|
+
},
|
|
80439
|
+
// 弹出层标题
|
|
80440
|
+
title: {
|
|
80441
|
+
type: String,
|
|
80442
|
+
default: ''
|
|
80443
|
+
},
|
|
80444
|
+
// 按钮文本
|
|
80445
|
+
buttonText: {
|
|
80446
|
+
type: String,
|
|
80447
|
+
default: '选择'
|
|
80448
|
+
},
|
|
80449
|
+
// 按钮类型
|
|
80450
|
+
buttonType: {
|
|
80451
|
+
type: String,
|
|
80452
|
+
default: 'default'
|
|
80453
|
+
},
|
|
80454
|
+
// 按钮尺寸
|
|
80455
|
+
buttonSize: {
|
|
80456
|
+
type: String,
|
|
80457
|
+
default: 'small'
|
|
80458
|
+
},
|
|
80459
|
+
// 是否使用超小按钮
|
|
80460
|
+
tiny: {
|
|
80461
|
+
type: Boolean,
|
|
80462
|
+
default: false
|
|
80463
|
+
},
|
|
80464
|
+
// 弹出层位置
|
|
80465
|
+
placement: {
|
|
80466
|
+
type: String,
|
|
80467
|
+
default: 'bottom-start'
|
|
80468
|
+
},
|
|
80469
|
+
// 弹出层宽度
|
|
80470
|
+
popoverWidth: {
|
|
80471
|
+
type: [String, Number],
|
|
80472
|
+
default: 300
|
|
80473
|
+
},
|
|
80474
|
+
// 是否禁用
|
|
80475
|
+
disabled: {
|
|
80476
|
+
type: Boolean,
|
|
80477
|
+
default: false
|
|
80478
|
+
},
|
|
80479
|
+
// 是否加载中
|
|
80480
|
+
loading: {
|
|
80481
|
+
type: Boolean,
|
|
80482
|
+
default: false
|
|
80483
|
+
},
|
|
80484
|
+
// 确认按钮文本
|
|
80485
|
+
confirmText: {
|
|
80486
|
+
type: String,
|
|
80487
|
+
default: '确定'
|
|
80488
|
+
},
|
|
80489
|
+
// 取消按钮文本
|
|
80490
|
+
cancelText: {
|
|
80491
|
+
type: String,
|
|
80492
|
+
default: '取消'
|
|
80493
|
+
},
|
|
80494
|
+
// 选项的键名配置
|
|
80495
|
+
optionProps: {
|
|
80496
|
+
type: Object,
|
|
80497
|
+
default: () => ({
|
|
80498
|
+
label: 'name',
|
|
80499
|
+
value: 'id',
|
|
80500
|
+
disabled: 'disabled'
|
|
80501
|
+
})
|
|
80502
|
+
}
|
|
80503
|
+
},
|
|
80504
|
+
data() {
|
|
80505
|
+
return {
|
|
80506
|
+
visible: false,
|
|
80507
|
+
selectedValue: null,
|
|
80508
|
+
selectedValues: [],
|
|
80509
|
+
tempSelectedValue: null,
|
|
80510
|
+
tempSelectedValues: []
|
|
80511
|
+
};
|
|
80512
|
+
},
|
|
80513
|
+
computed: {
|
|
80514
|
+
// 处理后的选项数据
|
|
80515
|
+
processedOptions() {
|
|
80516
|
+
return this.options.map(item => {
|
|
80517
|
+
if (typeof item === 'string') {
|
|
80518
|
+
return {
|
|
80519
|
+
id: item,
|
|
80520
|
+
name: item,
|
|
80521
|
+
disabled: false
|
|
80522
|
+
};
|
|
80523
|
+
}
|
|
80524
|
+
return {
|
|
80525
|
+
id: item[this.optionProps.value] || item.id,
|
|
80526
|
+
name: item[this.optionProps.label] || item.name || item.label,
|
|
80527
|
+
disabled: item[this.optionProps.disabled] || item.disabled || false
|
|
80528
|
+
};
|
|
80529
|
+
});
|
|
80530
|
+
},
|
|
80531
|
+
// 显示的选项
|
|
80532
|
+
displayOptions() {
|
|
80533
|
+
return this.processedOptions;
|
|
80534
|
+
},
|
|
80535
|
+
// 是否多列显示
|
|
80536
|
+
isMultiColumn() {
|
|
80537
|
+
return false; // 不再使用多列布局
|
|
80538
|
+
},
|
|
80539
|
+
// 是否有选中项
|
|
80540
|
+
hasSelection() {
|
|
80541
|
+
if (this.multiple) {
|
|
80542
|
+
return this.tempSelectedValues.length > 0;
|
|
80543
|
+
} else {
|
|
80544
|
+
return this.tempSelectedValue !== null && this.tempSelectedValue !== '';
|
|
80545
|
+
}
|
|
80546
|
+
},
|
|
80547
|
+
// 当前选中的选项
|
|
80548
|
+
selectedOptions() {
|
|
80549
|
+
if (this.multiple) {
|
|
80550
|
+
return this.processedOptions.filter(option => this.selectedValues.includes(option.id));
|
|
80551
|
+
} else {
|
|
80552
|
+
return this.processedOptions.find(option => option.id === this.selectedValue);
|
|
80553
|
+
}
|
|
80554
|
+
}
|
|
80555
|
+
},
|
|
80556
|
+
watch: {
|
|
80557
|
+
value: {
|
|
80558
|
+
handler(newVal) {
|
|
80559
|
+
this.selectedValue = newVal;
|
|
80560
|
+
this.tempSelectedValue = newVal;
|
|
80561
|
+
},
|
|
80562
|
+
immediate: true
|
|
80563
|
+
},
|
|
80564
|
+
values: {
|
|
80565
|
+
handler(newVal) {
|
|
80566
|
+
this.selectedValues = [...newVal];
|
|
80567
|
+
this.tempSelectedValues = [...newVal];
|
|
80568
|
+
},
|
|
80569
|
+
immediate: true
|
|
80570
|
+
}
|
|
80571
|
+
},
|
|
80572
|
+
methods: {
|
|
80573
|
+
// 处理弹出层显示
|
|
80574
|
+
handleShow() {
|
|
80575
|
+
// 重置临时选择
|
|
80576
|
+
this.tempSelectedValue = this.selectedValue;
|
|
80577
|
+
this.tempSelectedValues = [...this.selectedValues];
|
|
80578
|
+
this.$emit('show');
|
|
80579
|
+
},
|
|
80580
|
+
// 处理弹出层隐藏
|
|
80581
|
+
handleHide() {
|
|
80582
|
+
this.$emit('hide');
|
|
80583
|
+
},
|
|
80584
|
+
// 处理单选变化
|
|
80585
|
+
handleSingleChange(value) {
|
|
80586
|
+
this.tempSelectedValue = value;
|
|
80587
|
+
},
|
|
80588
|
+
// 处理多选变化
|
|
80589
|
+
handleMultipleChange(values) {
|
|
80590
|
+
this.tempSelectedValues = [...values];
|
|
80591
|
+
},
|
|
80592
|
+
// 处理确认
|
|
80593
|
+
handleConfirm() {
|
|
80594
|
+
if (this.multiple) {
|
|
80595
|
+
this.selectedValues = [...this.tempSelectedValues];
|
|
80596
|
+
this.$emit('input', this.selectedValues);
|
|
80597
|
+
this.$emit('change', this.selectedValues, this.getSelectedOptions(this.selectedValues));
|
|
80598
|
+
} else {
|
|
80599
|
+
this.selectedValue = this.tempSelectedValue;
|
|
80600
|
+
this.$emit('input', this.selectedValue);
|
|
80601
|
+
this.$emit('change', this.selectedValue, this.getSelectedOption(this.selectedValue));
|
|
80602
|
+
}
|
|
80603
|
+
this.visible = false;
|
|
80604
|
+
this.$emit('confirm', this.multiple ? this.selectedValues : this.selectedValue);
|
|
80605
|
+
},
|
|
80606
|
+
// 处理取消
|
|
80607
|
+
handleCancel() {
|
|
80608
|
+
// 恢复临时选择
|
|
80609
|
+
this.tempSelectedValue = this.selectedValue;
|
|
80610
|
+
this.tempSelectedValues = [...this.selectedValues];
|
|
80611
|
+
this.visible = false;
|
|
80612
|
+
this.$emit('cancel');
|
|
80613
|
+
},
|
|
80614
|
+
// 获取选中的选项对象(单选)
|
|
80615
|
+
getSelectedOption(value) {
|
|
80616
|
+
return this.processedOptions.find(option => option.id === value);
|
|
80617
|
+
},
|
|
80618
|
+
// 获取选中的选项对象(多选)
|
|
80619
|
+
getSelectedOptions(values) {
|
|
80620
|
+
return this.processedOptions.filter(option => values.includes(option.id));
|
|
80621
|
+
},
|
|
80622
|
+
// 清空选择
|
|
80623
|
+
clear() {
|
|
80624
|
+
if (this.multiple) {
|
|
80625
|
+
this.selectedValues = [];
|
|
80626
|
+
this.tempSelectedValues = [];
|
|
80627
|
+
this.$emit('input', []);
|
|
80628
|
+
this.$emit('change', [], []);
|
|
80629
|
+
} else {
|
|
80630
|
+
this.selectedValue = null;
|
|
80631
|
+
this.tempSelectedValue = null;
|
|
80632
|
+
this.$emit('input', null);
|
|
80633
|
+
this.$emit('change', null, null);
|
|
80634
|
+
}
|
|
80635
|
+
},
|
|
80636
|
+
// 设置选择
|
|
80637
|
+
setSelection(value) {
|
|
80638
|
+
if (this.multiple) {
|
|
80639
|
+
const values = Array.isArray(value) ? value : [value];
|
|
80640
|
+
this.selectedValues = [...values];
|
|
80641
|
+
this.tempSelectedValues = [...values];
|
|
80642
|
+
this.$emit('input', values);
|
|
80643
|
+
this.$emit('change', values, this.getSelectedOptions(values));
|
|
80644
|
+
} else {
|
|
80645
|
+
this.selectedValue = value;
|
|
80646
|
+
this.tempSelectedValue = value;
|
|
80647
|
+
this.$emit('input', value);
|
|
80648
|
+
this.$emit('change', value, this.getSelectedOption(value));
|
|
80649
|
+
}
|
|
80650
|
+
}
|
|
80651
|
+
}
|
|
80652
|
+
});
|
|
80653
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue?vue&type=script&lang=js
|
|
80654
|
+
/* harmony default export */ var popover_selector_ByPopoverSelectorvue_type_script_lang_js = (ByPopoverSelectorvue_type_script_lang_js);
|
|
80655
|
+
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!./node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/popover-selector/ByPopoverSelector.vue?vue&type=style&index=0&id=58b99e88&prod&lang=scss&scoped=true
|
|
80656
|
+
// extracted by mini-css-extract-plugin
|
|
80657
|
+
|
|
80658
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue?vue&type=style&index=0&id=58b99e88&prod&lang=scss&scoped=true
|
|
80659
|
+
|
|
80660
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue
|
|
80661
|
+
|
|
80662
|
+
|
|
80663
|
+
|
|
80664
|
+
;
|
|
80665
|
+
|
|
80666
|
+
|
|
80667
|
+
/* normalize component */
|
|
80668
|
+
|
|
80669
|
+
var ByPopoverSelector_component = normalizeComponent(
|
|
80670
|
+
popover_selector_ByPopoverSelectorvue_type_script_lang_js,
|
|
80671
|
+
ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_render,
|
|
80672
|
+
ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_staticRenderFns,
|
|
80673
|
+
false,
|
|
80674
|
+
null,
|
|
80675
|
+
"58b99e88",
|
|
80676
|
+
null
|
|
80677
|
+
|
|
80678
|
+
)
|
|
80679
|
+
|
|
80680
|
+
/* harmony default export */ var ByPopoverSelector = (ByPopoverSelector_component.exports);
|
|
80239
80681
|
;// ./src/index.js
|
|
80240
80682
|
|
|
80241
80683
|
|
|
@@ -80256,6 +80698,7 @@ var ByFloatingMenu_component = normalizeComponent(
|
|
|
80256
80698
|
|
|
80257
80699
|
|
|
80258
80700
|
|
|
80701
|
+
|
|
80259
80702
|
|
|
80260
80703
|
const components = {
|
|
80261
80704
|
ByPager: pager,
|
|
@@ -80272,7 +80715,8 @@ const components = {
|
|
|
80272
80715
|
ByTreeSearch: ByTreeSearch,
|
|
80273
80716
|
ByDialog: ByDialog,
|
|
80274
80717
|
ByCascaderPanel: ByCascaderPanel,
|
|
80275
|
-
ByFloatingMenu: ByFloatingMenu
|
|
80718
|
+
ByFloatingMenu: ByFloatingMenu,
|
|
80719
|
+
ByPopoverSelector: ByPopoverSelector
|
|
80276
80720
|
};
|
|
80277
80721
|
|
|
80278
80722
|
// 设置当前 z-index 起始值
|
package/lib/by-components.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.b-form .header[data-v-04400171]{margin-bottom:20px}.b-form .footer[data-v-04400171]{margin-top:20px}
|
|
1
|
+
.b-form .header[data-v-04400171]{margin-bottom:20px}.b-form .footer[data-v-04400171]{margin-top:20px}.by-popover-selector[data-v-58b99e88]{display:inline-block}.by-popover-selector .trigger-button[data-v-58b99e88]{min-width:80px}[data-v-58b99e88] .by-popover-selector-popover{padding:0!important}[data-v-58b99e88] .by-popover-selector-popover .popover-content{padding:16px;min-width:200px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .popover-title{font-size:16px;font-weight:600;color:#303133;margin-bottom:16px;text-align:left;border-bottom:1px solid #ebeef5;padding-bottom:8px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container{margin-bottom:16px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container.multi-column{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group{width:100%}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item{margin-bottom:8px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item.disabled{opacity:.6;cursor:not-allowed}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-checkbox,[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-radio{width:100%;margin-right:0}[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-checkbox :deep(.el-checkbox__label),[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-checkbox :deep(.el-radio__label),[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-radio :deep(.el-checkbox__label),[data-v-58b99e88] .by-popover-selector-popover .popover-content .options-container .options-group .option-item .option-radio :deep(.el-radio__label){font-size:14px;color:#606266;padding-left:8px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .popover-footer{display:flex;justify-content:flex-end;gap:8px;border-top:1px solid #ebeef5;padding-top:12px}[data-v-58b99e88] .by-popover-selector-popover .popover-content .popover-footer .el-button{min-width:60px}
|