@weitutech/by-components 1.1.132 → 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.
@@ -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; },
@@ -80284,6 +80285,409 @@ var ByFloatingMenu_component = normalizeComponent(
80284
80285
  )
80285
80286
 
80286
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);
80287
80691
  ;// ./src/index.js
80288
80692
 
80289
80693
 
@@ -80304,6 +80708,7 @@ var ByFloatingMenu_component = normalizeComponent(
80304
80708
 
80305
80709
 
80306
80710
 
80711
+
80307
80712
 
80308
80713
  const components = {
80309
80714
  ByPager: pager,
@@ -80320,7 +80725,8 @@ const components = {
80320
80725
  ByTreeSearch: ByTreeSearch,
80321
80726
  ByDialog: ByDialog,
80322
80727
  ByCascaderPanel: ByCascaderPanel,
80323
- ByFloatingMenu: ByFloatingMenu
80728
+ ByFloatingMenu: ByFloatingMenu,
80729
+ ByPopoverSelector: ByPopoverSelector
80324
80730
  };
80325
80731
 
80326
80732
  // 设置当前 z-index 起始值