@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
package/lib/by-components.umd.js
CHANGED
|
@@ -60524,6 +60524,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
60524
60524
|
ByForm: function() { return /* reexport */ form_form; },
|
|
60525
60525
|
ByPageSearch: function() { return /* reexport */ page_search; },
|
|
60526
60526
|
ByPager: function() { return /* reexport */ pager; },
|
|
60527
|
+
ByPopoverSelector: function() { return /* reexport */ ByPopoverSelector; },
|
|
60527
60528
|
BySelect: function() { return /* reexport */ comps_select; },
|
|
60528
60529
|
ByTable: function() { return /* reexport */ table; },
|
|
60529
60530
|
ByToolBar: function() { return /* reexport */ ByToolBar; },
|
|
@@ -60761,8 +60762,8 @@ var component = normalizeComponent(
|
|
|
60761
60762
|
)
|
|
60762
60763
|
|
|
60763
60764
|
/* harmony default export */ var pager = (component.exports);
|
|
60764
|
-
;// ./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-82.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=
|
|
60765
|
-
var
|
|
60765
|
+
;// ./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-82.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
|
|
60766
|
+
var tablevue_type_template_id_22f2fb85_render = function render() {
|
|
60766
60767
|
var _vm = this,
|
|
60767
60768
|
_c = _vm._self._c;
|
|
60768
60769
|
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
@@ -60836,7 +60837,7 @@ var tablevue_type_template_id_5b90b233_render = function render() {
|
|
|
60836
60837
|
}
|
|
60837
60838
|
}) : _vm._e()], 1);
|
|
60838
60839
|
};
|
|
60839
|
-
var
|
|
60840
|
+
var tablevue_type_template_id_22f2fb85_staticRenderFns = [];
|
|
60840
60841
|
|
|
60841
60842
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
60842
60843
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -61941,7 +61942,7 @@ var custom_column_component = normalizeComponent(
|
|
|
61941
61942
|
},
|
|
61942
61943
|
computed: {
|
|
61943
61944
|
options() {
|
|
61944
|
-
var _others$pagerConfig, _others$sortConfig, _others$pagerConfig2, _others$pagerConfig3, _others$
|
|
61945
|
+
var _others$pagerConfig, _others$sortConfig, _others$pagerConfig2, _others$sortConfig2, _others$pagerConfig3, _others$sortConfig3, _sortConfig$remote;
|
|
61945
61946
|
const {
|
|
61946
61947
|
customColumnConfig,
|
|
61947
61948
|
columns,
|
|
@@ -61960,15 +61961,18 @@ var custom_column_component = normalizeComponent(
|
|
|
61960
61961
|
newColumns = this.removeFixedColumns(newColumns);
|
|
61961
61962
|
}
|
|
61962
61963
|
|
|
61963
|
-
//
|
|
61964
|
+
// 处理前端分页和虚拟滚动
|
|
61964
61965
|
let data = others.data || [];
|
|
61965
61966
|
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) {
|
|
61966
61967
|
// 保存完整数据
|
|
61967
61968
|
this.allData = [...data];
|
|
61968
61969
|
}
|
|
61969
61970
|
if ((_others$pagerConfig2 = others.pagerConfig) !== null && _others$pagerConfig2 !== void 0 && _others$pagerConfig2.frontendPagination) {
|
|
61970
|
-
//
|
|
61971
|
+
// 前端分页:截取当前页数据
|
|
61971
61972
|
data = this.spliteListData(this.allData, others.pagerConfig.currentPage, others.pagerConfig.pageSize);
|
|
61973
|
+
} else if ((_others$sortConfig2 = others.sortConfig) !== null && _others$sortConfig2 !== void 0 && _others$sortConfig2.frontendSort) {
|
|
61974
|
+
// 虚拟滚动:处理置顶行和默认排序
|
|
61975
|
+
data = this.spliteListData(this.allData, null, null);
|
|
61972
61976
|
}
|
|
61973
61977
|
|
|
61974
61978
|
// 移除 others 中的 data,避免覆盖
|
|
@@ -62020,9 +62024,12 @@ var custom_column_component = normalizeComponent(
|
|
|
62020
62024
|
},
|
|
62021
62025
|
sortConfig: {
|
|
62022
62026
|
...sortConfig,
|
|
62023
|
-
//
|
|
62024
|
-
//
|
|
62025
|
-
|
|
62027
|
+
// 🔧 排序模式配置:
|
|
62028
|
+
// - 前端分页:remote: true(数据已在 spliteListData 中排序)
|
|
62029
|
+
// - 虚拟滚动 + 前端排序:remote: true(手动处理置顶行,类似前端分页)
|
|
62030
|
+
// - 后端排序:remote: 外部配置或 false
|
|
62031
|
+
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,手动处理排序(支持置顶行)
|
|
62032
|
+
: (_sortConfig$remote = sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.remote) !== null && _sortConfig$remote !== void 0 ? _sortConfig$remote : false,
|
|
62026
62033
|
trigger: 'cell',
|
|
62027
62034
|
...this.gridOptions.sortConfig
|
|
62028
62035
|
},
|
|
@@ -62372,14 +62379,19 @@ var custom_column_component = normalizeComponent(
|
|
|
62372
62379
|
property,
|
|
62373
62380
|
order
|
|
62374
62381
|
} = event;
|
|
62375
|
-
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);
|
|
62376
62382
|
|
|
62377
|
-
//
|
|
62383
|
+
// 🔧 区分前端分页和虚拟滚动:
|
|
62384
|
+
// - 前端分页(frontendPagination):手动排序 + 分页
|
|
62385
|
+
// - 虚拟滚动(frontendSort 但无 frontendPagination):手动排序 + 虚拟滚动(支持置顶行)
|
|
62386
|
+
const isFrontendPagination = (_this$gridOptions$pag3 = this.gridOptions.pagerConfig) === null || _this$gridOptions$pag3 === void 0 ? void 0 : _this$gridOptions$pag3.frontendPagination;
|
|
62387
|
+
const isVirtualScrollWithSort = ((_this$gridOptions$sor2 = this.gridOptions.sortConfig) === null || _this$gridOptions$sor2 === void 0 ? void 0 : _this$gridOptions$sor2.frontendSort) && !isFrontendPagination;
|
|
62388
|
+
|
|
62389
|
+
// 无论哪种模式,都保存排序状态用于恢复箭头高亮
|
|
62378
62390
|
this.sortState.field = property;
|
|
62379
62391
|
this.sortState.order = order;
|
|
62380
|
-
if (
|
|
62381
|
-
|
|
62382
|
-
const newData = this.spliteListData(this.allData,
|
|
62392
|
+
if (isFrontendPagination) {
|
|
62393
|
+
// 前端分页模式:手动处理排序和分页
|
|
62394
|
+
const newData = this.spliteListData(this.allData, this.gridOptions.pagerConfig.currentPage, this.gridOptions.pagerConfig.pageSize);
|
|
62383
62395
|
if (this.$refs.xGrid) {
|
|
62384
62396
|
this.$refs.xGrid.reloadData(newData);
|
|
62385
62397
|
this.$nextTick(() => {
|
|
@@ -62392,8 +62404,7 @@ var custom_column_component = normalizeComponent(
|
|
|
62392
62404
|
}, 100);
|
|
62393
62405
|
}
|
|
62394
62406
|
setTimeout(() => {
|
|
62395
|
-
|
|
62396
|
-
if ((_this$gridOptions$pag6 = this.gridOptions.pagerConfig) !== null && _this$gridOptions$pag6 !== void 0 && _this$gridOptions$pag6.frontendPagination && this.$refs.xGrid) {
|
|
62407
|
+
if (this.$refs.xGrid) {
|
|
62397
62408
|
// 前端分页时,排序状态变化,回到第一页
|
|
62398
62409
|
const currentPage = this.gridOptions.pagerConfig.currentPage;
|
|
62399
62410
|
if (currentPage !== 1) {
|
|
@@ -62410,8 +62421,30 @@ var custom_column_component = normalizeComponent(
|
|
|
62410
62421
|
}, 0);
|
|
62411
62422
|
});
|
|
62412
62423
|
}
|
|
62424
|
+
} else if (isVirtualScrollWithSort) {
|
|
62425
|
+
// 虚拟滚动模式:手动处理排序(支持置顶行)
|
|
62426
|
+
const newData = this.spliteListData(this.allData, null, null);
|
|
62427
|
+
if (this.$refs.xGrid) {
|
|
62428
|
+
this.$refs.xGrid.reloadData(newData);
|
|
62429
|
+
this.$nextTick(() => {
|
|
62430
|
+
if (property && order) {
|
|
62431
|
+
setTimeout(() => {
|
|
62432
|
+
// 只高亮箭头,表格内部不排序(因为数据已经排序好)
|
|
62433
|
+
this.$refs.xGrid.sort(property, order, {
|
|
62434
|
+
silent: true
|
|
62435
|
+
});
|
|
62436
|
+
}, 100);
|
|
62437
|
+
}
|
|
62438
|
+
setTimeout(() => {
|
|
62439
|
+
if (this.$refs.xGrid) {
|
|
62440
|
+
// 排序后滚动到顶部
|
|
62441
|
+
this.$refs.xGrid.scrollTo(0, 0);
|
|
62442
|
+
}
|
|
62443
|
+
}, 0);
|
|
62444
|
+
});
|
|
62445
|
+
}
|
|
62413
62446
|
} else {
|
|
62414
|
-
//
|
|
62447
|
+
// 后端模式:确保排序箭头高亮
|
|
62415
62448
|
this.$nextTick(() => {
|
|
62416
62449
|
if (property && order && this.$refs.xGrid) {
|
|
62417
62450
|
setTimeout(() => {
|
|
@@ -62446,6 +62479,7 @@ var custom_column_component = normalizeComponent(
|
|
|
62446
62479
|
this.sortState.order = defaultSort.order;
|
|
62447
62480
|
setTimeout(() => {
|
|
62448
62481
|
if (this.$refs.xGrid) {
|
|
62482
|
+
// 🔧 两种模式都使用手动排序(支持置顶行)
|
|
62449
62483
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62450
62484
|
silent: true
|
|
62451
62485
|
});
|
|
@@ -62458,9 +62492,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62458
62492
|
* 初始化默认排序(支持前端分页和虚拟滚动)
|
|
62459
62493
|
*/
|
|
62460
62494
|
initDefaultSortForFrontendPagination() {
|
|
62461
|
-
var _this$gridOptions$
|
|
62495
|
+
var _this$gridOptions$pag4, _this$gridOptions$sor4, _this$gridOptions$sor5;
|
|
62462
62496
|
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62463
|
-
const shouldInitSort = ((_this$gridOptions$
|
|
62497
|
+
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);
|
|
62464
62498
|
if (!shouldInitSort) {
|
|
62465
62499
|
return;
|
|
62466
62500
|
}
|
|
@@ -62470,11 +62504,13 @@ var custom_column_component = normalizeComponent(
|
|
|
62470
62504
|
this.sortState.field = defaultSort.field;
|
|
62471
62505
|
this.sortState.order = defaultSort.order;
|
|
62472
62506
|
|
|
62473
|
-
// 在下一个tick
|
|
62507
|
+
// 在下一个tick中应用排序
|
|
62474
62508
|
this.$nextTick(() => {
|
|
62475
62509
|
if (this.$refs.xGrid) {
|
|
62476
62510
|
setTimeout(() => {
|
|
62477
|
-
//
|
|
62511
|
+
// 🔧 两种模式都使用手动排序(支持置顶行):
|
|
62512
|
+
// - 前端分页:数据在 spliteListData 中排序,只需UI高亮
|
|
62513
|
+
// - 虚拟滚动:数据在 spliteListData 中排序,只需UI高亮
|
|
62478
62514
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62479
62515
|
silent: true
|
|
62480
62516
|
});
|
|
@@ -62487,9 +62523,9 @@ var custom_column_component = normalizeComponent(
|
|
|
62487
62523
|
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
62488
62524
|
*/
|
|
62489
62525
|
ensureDefaultSortHighlight() {
|
|
62490
|
-
var _this$gridOptions$
|
|
62526
|
+
var _this$gridOptions$pag5, _this$gridOptions$sor6, _this$gridOptions$sor7;
|
|
62491
62527
|
// 支持前端分页或前端排序模式(包括虚拟滚动)
|
|
62492
|
-
const shouldEnsureSort = ((_this$gridOptions$
|
|
62528
|
+
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);
|
|
62493
62529
|
if (!shouldEnsureSort) {
|
|
62494
62530
|
return;
|
|
62495
62531
|
}
|
|
@@ -62499,9 +62535,12 @@ var custom_column_component = normalizeComponent(
|
|
|
62499
62535
|
this.sortState.field = defaultSort.field;
|
|
62500
62536
|
this.sortState.order = defaultSort.order;
|
|
62501
62537
|
|
|
62502
|
-
//
|
|
62538
|
+
// 应用排序
|
|
62503
62539
|
if (this.$refs.xGrid) {
|
|
62504
62540
|
setTimeout(() => {
|
|
62541
|
+
// 🔧 两种模式都使用手动排序(支持置顶行):
|
|
62542
|
+
// - 前端分页:数据已在 spliteListData 中排序,只需UI高亮(silent: true)
|
|
62543
|
+
// - 虚拟滚动:数据已在 spliteListData 中排序,只需UI高亮(silent: true)
|
|
62505
62544
|
this.$refs.xGrid.sort(defaultSort.field, defaultSort.order, {
|
|
62506
62545
|
silent: true
|
|
62507
62546
|
});
|
|
@@ -62523,8 +62562,8 @@ var custom_column_component = normalizeComponent(
|
|
|
62523
62562
|
;
|
|
62524
62563
|
var table_component = normalizeComponent(
|
|
62525
62564
|
components_tablevue_type_script_lang_js,
|
|
62526
|
-
|
|
62527
|
-
|
|
62565
|
+
tablevue_type_template_id_22f2fb85_render,
|
|
62566
|
+
tablevue_type_template_id_22f2fb85_staticRenderFns,
|
|
62528
62567
|
false,
|
|
62529
62568
|
null,
|
|
62530
62569
|
null,
|
|
@@ -80246,6 +80285,409 @@ var ByFloatingMenu_component = normalizeComponent(
|
|
|
80246
80285
|
)
|
|
80247
80286
|
|
|
80248
80287
|
/* harmony default export */ var ByFloatingMenu = (ByFloatingMenu_component.exports);
|
|
80288
|
+
;// ./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-82.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
|
|
80289
|
+
var ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_render = function render() {
|
|
80290
|
+
var _vm = this,
|
|
80291
|
+
_c = _vm._self._c;
|
|
80292
|
+
return _c('div', {
|
|
80293
|
+
staticClass: "by-popover-selector"
|
|
80294
|
+
}, [_c('el-popover', {
|
|
80295
|
+
ref: "popover",
|
|
80296
|
+
attrs: {
|
|
80297
|
+
"placement": _vm.placement,
|
|
80298
|
+
"width": _vm.popoverWidth,
|
|
80299
|
+
"trigger": "click",
|
|
80300
|
+
"disabled": _vm.disabled,
|
|
80301
|
+
"popper-class": "by-popover-selector-popover"
|
|
80302
|
+
},
|
|
80303
|
+
on: {
|
|
80304
|
+
"show": _vm.handleShow,
|
|
80305
|
+
"hide": _vm.handleHide
|
|
80306
|
+
},
|
|
80307
|
+
model: {
|
|
80308
|
+
value: _vm.visible,
|
|
80309
|
+
callback: function ($$v) {
|
|
80310
|
+
_vm.visible = $$v;
|
|
80311
|
+
},
|
|
80312
|
+
expression: "visible"
|
|
80313
|
+
}
|
|
80314
|
+
}, [_c('div', {
|
|
80315
|
+
staticClass: "popover-content"
|
|
80316
|
+
}, [_vm.title ? _c('div', {
|
|
80317
|
+
staticClass: "popover-title"
|
|
80318
|
+
}, [_vm._v(" " + _vm._s(_vm.title) + " ")]) : _vm._e(), _c('div', {
|
|
80319
|
+
staticClass: "options-container",
|
|
80320
|
+
class: {
|
|
80321
|
+
'multi-column': _vm.isMultiColumn
|
|
80322
|
+
}
|
|
80323
|
+
}, [!_vm.multiple ? _c('el-radio-group', {
|
|
80324
|
+
staticClass: "options-group",
|
|
80325
|
+
on: {
|
|
80326
|
+
"change": _vm.handleSingleChange
|
|
80327
|
+
},
|
|
80328
|
+
model: {
|
|
80329
|
+
value: _vm.selectedValue,
|
|
80330
|
+
callback: function ($$v) {
|
|
80331
|
+
_vm.selectedValue = $$v;
|
|
80332
|
+
},
|
|
80333
|
+
expression: "selectedValue"
|
|
80334
|
+
}
|
|
80335
|
+
}, _vm._l(_vm.displayOptions, function (item, index) {
|
|
80336
|
+
return _c('div', {
|
|
80337
|
+
key: item.id || item.value || index,
|
|
80338
|
+
staticClass: "option-item",
|
|
80339
|
+
class: {
|
|
80340
|
+
'disabled': item.disabled
|
|
80341
|
+
}
|
|
80342
|
+
}, [_c('el-radio', {
|
|
80343
|
+
staticClass: "option-radio",
|
|
80344
|
+
attrs: {
|
|
80345
|
+
"label": item.id || item.value,
|
|
80346
|
+
"disabled": item.disabled
|
|
80347
|
+
}
|
|
80348
|
+
}, [_vm._v(" " + _vm._s(item.name || item.label) + " ")])], 1);
|
|
80349
|
+
}), 0) : _c('el-checkbox-group', {
|
|
80350
|
+
staticClass: "options-group",
|
|
80351
|
+
on: {
|
|
80352
|
+
"change": _vm.handleMultipleChange
|
|
80353
|
+
},
|
|
80354
|
+
model: {
|
|
80355
|
+
value: _vm.selectedValues,
|
|
80356
|
+
callback: function ($$v) {
|
|
80357
|
+
_vm.selectedValues = $$v;
|
|
80358
|
+
},
|
|
80359
|
+
expression: "selectedValues"
|
|
80360
|
+
}
|
|
80361
|
+
}, _vm._l(_vm.displayOptions, function (item, index) {
|
|
80362
|
+
return _c('div', {
|
|
80363
|
+
key: item.id || item.value || index,
|
|
80364
|
+
staticClass: "option-item",
|
|
80365
|
+
class: {
|
|
80366
|
+
'disabled': item.disabled
|
|
80367
|
+
}
|
|
80368
|
+
}, [_c('el-checkbox', {
|
|
80369
|
+
staticClass: "option-checkbox",
|
|
80370
|
+
attrs: {
|
|
80371
|
+
"label": item.id || item.value,
|
|
80372
|
+
"disabled": item.disabled
|
|
80373
|
+
}
|
|
80374
|
+
}, [_vm._v(" " + _vm._s(item.name || item.label) + " ")])], 1);
|
|
80375
|
+
}), 0)], 1), _c('div', {
|
|
80376
|
+
staticClass: "popover-footer"
|
|
80377
|
+
}, [_c('el-button', {
|
|
80378
|
+
attrs: {
|
|
80379
|
+
"size": "small"
|
|
80380
|
+
},
|
|
80381
|
+
on: {
|
|
80382
|
+
"click": _vm.handleCancel
|
|
80383
|
+
}
|
|
80384
|
+
}, [_vm._v(" " + _vm._s(_vm.cancelText) + " ")]), _c('el-button', {
|
|
80385
|
+
staticClass: "confirm-button",
|
|
80386
|
+
staticStyle: {
|
|
80387
|
+
"min-width": "60px !important",
|
|
80388
|
+
"height": "32px !important",
|
|
80389
|
+
"visibility": "visible !important",
|
|
80390
|
+
"display": "inline-block !important",
|
|
80391
|
+
"opacity": "1 !important",
|
|
80392
|
+
"background-color": "#409eff !important",
|
|
80393
|
+
"border-color": "#409eff !important",
|
|
80394
|
+
"color": "#ffffff !important"
|
|
80395
|
+
},
|
|
80396
|
+
attrs: {
|
|
80397
|
+
"type": _vm.hasSelection ? 'primary' : 'default',
|
|
80398
|
+
"size": "small",
|
|
80399
|
+
"disabled": !_vm.hasSelection
|
|
80400
|
+
},
|
|
80401
|
+
on: {
|
|
80402
|
+
"click": _vm.handleConfirm
|
|
80403
|
+
}
|
|
80404
|
+
}, [_vm._v(" " + _vm._s(_vm.confirmText) + " ")])], 1)]), _c('el-button', {
|
|
80405
|
+
class: ['trigger-button', {
|
|
80406
|
+
'tiny-button': _vm.tiny
|
|
80407
|
+
}],
|
|
80408
|
+
attrs: {
|
|
80409
|
+
"slot": "reference",
|
|
80410
|
+
"type": _vm.buttonType,
|
|
80411
|
+
"plain": "",
|
|
80412
|
+
"size": _vm.tiny ? 'mini' : _vm.buttonSize,
|
|
80413
|
+
"disabled": _vm.disabled,
|
|
80414
|
+
"loading": _vm.loading
|
|
80415
|
+
},
|
|
80416
|
+
slot: "reference"
|
|
80417
|
+
}, [_vm._v(" " + _vm._s(_vm.buttonText) + " ")])], 1)], 1);
|
|
80418
|
+
};
|
|
80419
|
+
var ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_staticRenderFns = [];
|
|
80420
|
+
|
|
80421
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.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
|
|
80422
|
+
|
|
80423
|
+
|
|
80424
|
+
|
|
80425
|
+
|
|
80426
|
+
/* harmony default export */ var ByPopoverSelectorvue_type_script_lang_js = ({
|
|
80427
|
+
name: 'ByPopoverSelector',
|
|
80428
|
+
props: {
|
|
80429
|
+
// 数据源
|
|
80430
|
+
options: {
|
|
80431
|
+
type: Array,
|
|
80432
|
+
default: () => []
|
|
80433
|
+
},
|
|
80434
|
+
// 当前选中的值(单选)
|
|
80435
|
+
value: {
|
|
80436
|
+
type: [String, Number],
|
|
80437
|
+
default: null
|
|
80438
|
+
},
|
|
80439
|
+
// 当前选中的值(多选)
|
|
80440
|
+
values: {
|
|
80441
|
+
type: Array,
|
|
80442
|
+
default: () => []
|
|
80443
|
+
},
|
|
80444
|
+
// 是否多选
|
|
80445
|
+
multiple: {
|
|
80446
|
+
type: Boolean,
|
|
80447
|
+
default: false
|
|
80448
|
+
},
|
|
80449
|
+
// 弹出层标题
|
|
80450
|
+
title: {
|
|
80451
|
+
type: String,
|
|
80452
|
+
default: ''
|
|
80453
|
+
},
|
|
80454
|
+
// 按钮文本
|
|
80455
|
+
buttonText: {
|
|
80456
|
+
type: String,
|
|
80457
|
+
default: '选择'
|
|
80458
|
+
},
|
|
80459
|
+
// 按钮类型
|
|
80460
|
+
buttonType: {
|
|
80461
|
+
type: String,
|
|
80462
|
+
default: 'default'
|
|
80463
|
+
},
|
|
80464
|
+
// 按钮尺寸
|
|
80465
|
+
buttonSize: {
|
|
80466
|
+
type: String,
|
|
80467
|
+
default: 'small'
|
|
80468
|
+
},
|
|
80469
|
+
// 是否使用超小按钮
|
|
80470
|
+
tiny: {
|
|
80471
|
+
type: Boolean,
|
|
80472
|
+
default: false
|
|
80473
|
+
},
|
|
80474
|
+
// 弹出层位置
|
|
80475
|
+
placement: {
|
|
80476
|
+
type: String,
|
|
80477
|
+
default: 'bottom-start'
|
|
80478
|
+
},
|
|
80479
|
+
// 弹出层宽度
|
|
80480
|
+
popoverWidth: {
|
|
80481
|
+
type: [String, Number],
|
|
80482
|
+
default: 300
|
|
80483
|
+
},
|
|
80484
|
+
// 是否禁用
|
|
80485
|
+
disabled: {
|
|
80486
|
+
type: Boolean,
|
|
80487
|
+
default: false
|
|
80488
|
+
},
|
|
80489
|
+
// 是否加载中
|
|
80490
|
+
loading: {
|
|
80491
|
+
type: Boolean,
|
|
80492
|
+
default: false
|
|
80493
|
+
},
|
|
80494
|
+
// 确认按钮文本
|
|
80495
|
+
confirmText: {
|
|
80496
|
+
type: String,
|
|
80497
|
+
default: '确定'
|
|
80498
|
+
},
|
|
80499
|
+
// 取消按钮文本
|
|
80500
|
+
cancelText: {
|
|
80501
|
+
type: String,
|
|
80502
|
+
default: '取消'
|
|
80503
|
+
},
|
|
80504
|
+
// 选项的键名配置
|
|
80505
|
+
optionProps: {
|
|
80506
|
+
type: Object,
|
|
80507
|
+
default: () => ({
|
|
80508
|
+
label: 'name',
|
|
80509
|
+
value: 'id',
|
|
80510
|
+
disabled: 'disabled'
|
|
80511
|
+
})
|
|
80512
|
+
}
|
|
80513
|
+
},
|
|
80514
|
+
data() {
|
|
80515
|
+
return {
|
|
80516
|
+
visible: false,
|
|
80517
|
+
selectedValue: null,
|
|
80518
|
+
selectedValues: [],
|
|
80519
|
+
tempSelectedValue: null,
|
|
80520
|
+
tempSelectedValues: []
|
|
80521
|
+
};
|
|
80522
|
+
},
|
|
80523
|
+
computed: {
|
|
80524
|
+
// 处理后的选项数据
|
|
80525
|
+
processedOptions() {
|
|
80526
|
+
return this.options.map(item => {
|
|
80527
|
+
if (typeof item === 'string') {
|
|
80528
|
+
return {
|
|
80529
|
+
id: item,
|
|
80530
|
+
name: item,
|
|
80531
|
+
disabled: false
|
|
80532
|
+
};
|
|
80533
|
+
}
|
|
80534
|
+
return {
|
|
80535
|
+
id: item[this.optionProps.value] || item.id,
|
|
80536
|
+
name: item[this.optionProps.label] || item.name || item.label,
|
|
80537
|
+
disabled: item[this.optionProps.disabled] || item.disabled || false
|
|
80538
|
+
};
|
|
80539
|
+
});
|
|
80540
|
+
},
|
|
80541
|
+
// 显示的选项
|
|
80542
|
+
displayOptions() {
|
|
80543
|
+
return this.processedOptions;
|
|
80544
|
+
},
|
|
80545
|
+
// 是否多列显示
|
|
80546
|
+
isMultiColumn() {
|
|
80547
|
+
return false; // 不再使用多列布局
|
|
80548
|
+
},
|
|
80549
|
+
// 是否有选中项
|
|
80550
|
+
hasSelection() {
|
|
80551
|
+
if (this.multiple) {
|
|
80552
|
+
return this.tempSelectedValues.length > 0;
|
|
80553
|
+
} else {
|
|
80554
|
+
return this.tempSelectedValue !== null && this.tempSelectedValue !== '';
|
|
80555
|
+
}
|
|
80556
|
+
},
|
|
80557
|
+
// 当前选中的选项
|
|
80558
|
+
selectedOptions() {
|
|
80559
|
+
if (this.multiple) {
|
|
80560
|
+
return this.processedOptions.filter(option => this.selectedValues.includes(option.id));
|
|
80561
|
+
} else {
|
|
80562
|
+
return this.processedOptions.find(option => option.id === this.selectedValue);
|
|
80563
|
+
}
|
|
80564
|
+
}
|
|
80565
|
+
},
|
|
80566
|
+
watch: {
|
|
80567
|
+
value: {
|
|
80568
|
+
handler(newVal) {
|
|
80569
|
+
this.selectedValue = newVal;
|
|
80570
|
+
this.tempSelectedValue = newVal;
|
|
80571
|
+
},
|
|
80572
|
+
immediate: true
|
|
80573
|
+
},
|
|
80574
|
+
values: {
|
|
80575
|
+
handler(newVal) {
|
|
80576
|
+
this.selectedValues = [...newVal];
|
|
80577
|
+
this.tempSelectedValues = [...newVal];
|
|
80578
|
+
},
|
|
80579
|
+
immediate: true
|
|
80580
|
+
}
|
|
80581
|
+
},
|
|
80582
|
+
methods: {
|
|
80583
|
+
// 处理弹出层显示
|
|
80584
|
+
handleShow() {
|
|
80585
|
+
// 重置临时选择
|
|
80586
|
+
this.tempSelectedValue = this.selectedValue;
|
|
80587
|
+
this.tempSelectedValues = [...this.selectedValues];
|
|
80588
|
+
this.$emit('show');
|
|
80589
|
+
},
|
|
80590
|
+
// 处理弹出层隐藏
|
|
80591
|
+
handleHide() {
|
|
80592
|
+
this.$emit('hide');
|
|
80593
|
+
},
|
|
80594
|
+
// 处理单选变化
|
|
80595
|
+
handleSingleChange(value) {
|
|
80596
|
+
this.tempSelectedValue = value;
|
|
80597
|
+
},
|
|
80598
|
+
// 处理多选变化
|
|
80599
|
+
handleMultipleChange(values) {
|
|
80600
|
+
this.tempSelectedValues = [...values];
|
|
80601
|
+
},
|
|
80602
|
+
// 处理确认
|
|
80603
|
+
handleConfirm() {
|
|
80604
|
+
if (this.multiple) {
|
|
80605
|
+
this.selectedValues = [...this.tempSelectedValues];
|
|
80606
|
+
this.$emit('input', this.selectedValues);
|
|
80607
|
+
this.$emit('change', this.selectedValues, this.getSelectedOptions(this.selectedValues));
|
|
80608
|
+
} else {
|
|
80609
|
+
this.selectedValue = this.tempSelectedValue;
|
|
80610
|
+
this.$emit('input', this.selectedValue);
|
|
80611
|
+
this.$emit('change', this.selectedValue, this.getSelectedOption(this.selectedValue));
|
|
80612
|
+
}
|
|
80613
|
+
this.visible = false;
|
|
80614
|
+
this.$emit('confirm', this.multiple ? this.selectedValues : this.selectedValue);
|
|
80615
|
+
},
|
|
80616
|
+
// 处理取消
|
|
80617
|
+
handleCancel() {
|
|
80618
|
+
// 恢复临时选择
|
|
80619
|
+
this.tempSelectedValue = this.selectedValue;
|
|
80620
|
+
this.tempSelectedValues = [...this.selectedValues];
|
|
80621
|
+
this.visible = false;
|
|
80622
|
+
this.$emit('cancel');
|
|
80623
|
+
},
|
|
80624
|
+
// 获取选中的选项对象(单选)
|
|
80625
|
+
getSelectedOption(value) {
|
|
80626
|
+
return this.processedOptions.find(option => option.id === value);
|
|
80627
|
+
},
|
|
80628
|
+
// 获取选中的选项对象(多选)
|
|
80629
|
+
getSelectedOptions(values) {
|
|
80630
|
+
return this.processedOptions.filter(option => values.includes(option.id));
|
|
80631
|
+
},
|
|
80632
|
+
// 清空选择
|
|
80633
|
+
clear() {
|
|
80634
|
+
if (this.multiple) {
|
|
80635
|
+
this.selectedValues = [];
|
|
80636
|
+
this.tempSelectedValues = [];
|
|
80637
|
+
this.$emit('input', []);
|
|
80638
|
+
this.$emit('change', [], []);
|
|
80639
|
+
} else {
|
|
80640
|
+
this.selectedValue = null;
|
|
80641
|
+
this.tempSelectedValue = null;
|
|
80642
|
+
this.$emit('input', null);
|
|
80643
|
+
this.$emit('change', null, null);
|
|
80644
|
+
}
|
|
80645
|
+
},
|
|
80646
|
+
// 设置选择
|
|
80647
|
+
setSelection(value) {
|
|
80648
|
+
if (this.multiple) {
|
|
80649
|
+
const values = Array.isArray(value) ? value : [value];
|
|
80650
|
+
this.selectedValues = [...values];
|
|
80651
|
+
this.tempSelectedValues = [...values];
|
|
80652
|
+
this.$emit('input', values);
|
|
80653
|
+
this.$emit('change', values, this.getSelectedOptions(values));
|
|
80654
|
+
} else {
|
|
80655
|
+
this.selectedValue = value;
|
|
80656
|
+
this.tempSelectedValue = value;
|
|
80657
|
+
this.$emit('input', value);
|
|
80658
|
+
this.$emit('change', value, this.getSelectedOption(value));
|
|
80659
|
+
}
|
|
80660
|
+
}
|
|
80661
|
+
}
|
|
80662
|
+
});
|
|
80663
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue?vue&type=script&lang=js
|
|
80664
|
+
/* harmony default export */ var popover_selector_ByPopoverSelectorvue_type_script_lang_js = (ByPopoverSelectorvue_type_script_lang_js);
|
|
80665
|
+
;// ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-64.use[0]!./node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.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-64.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.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
|
|
80666
|
+
// extracted by mini-css-extract-plugin
|
|
80667
|
+
|
|
80668
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue?vue&type=style&index=0&id=58b99e88&prod&lang=scss&scoped=true
|
|
80669
|
+
|
|
80670
|
+
;// ./src/components/popover-selector/ByPopoverSelector.vue
|
|
80671
|
+
|
|
80672
|
+
|
|
80673
|
+
|
|
80674
|
+
;
|
|
80675
|
+
|
|
80676
|
+
|
|
80677
|
+
/* normalize component */
|
|
80678
|
+
|
|
80679
|
+
var ByPopoverSelector_component = normalizeComponent(
|
|
80680
|
+
popover_selector_ByPopoverSelectorvue_type_script_lang_js,
|
|
80681
|
+
ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_render,
|
|
80682
|
+
ByPopoverSelectorvue_type_template_id_58b99e88_scoped_true_staticRenderFns,
|
|
80683
|
+
false,
|
|
80684
|
+
null,
|
|
80685
|
+
"58b99e88",
|
|
80686
|
+
null
|
|
80687
|
+
|
|
80688
|
+
)
|
|
80689
|
+
|
|
80690
|
+
/* harmony default export */ var ByPopoverSelector = (ByPopoverSelector_component.exports);
|
|
80249
80691
|
;// ./src/index.js
|
|
80250
80692
|
|
|
80251
80693
|
|
|
@@ -80266,6 +80708,7 @@ var ByFloatingMenu_component = normalizeComponent(
|
|
|
80266
80708
|
|
|
80267
80709
|
|
|
80268
80710
|
|
|
80711
|
+
|
|
80269
80712
|
|
|
80270
80713
|
const components = {
|
|
80271
80714
|
ByPager: pager,
|
|
@@ -80282,7 +80725,8 @@ const components = {
|
|
|
80282
80725
|
ByTreeSearch: ByTreeSearch,
|
|
80283
80726
|
ByDialog: ByDialog,
|
|
80284
80727
|
ByCascaderPanel: ByCascaderPanel,
|
|
80285
|
-
ByFloatingMenu: ByFloatingMenu
|
|
80728
|
+
ByFloatingMenu: ByFloatingMenu,
|
|
80729
|
+
ByPopoverSelector: ByPopoverSelector
|
|
80286
80730
|
};
|
|
80287
80731
|
|
|
80288
80732
|
// 设置当前 z-index 起始值
|