@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.
@@ -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; },
@@ -80274,6 +80275,409 @@ var ByFloatingMenu_component = normalizeComponent(
80274
80275
  )
80275
80276
 
80276
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);
80277
80681
  ;// ./src/index.js
80278
80682
 
80279
80683
 
@@ -80294,6 +80698,7 @@ var ByFloatingMenu_component = normalizeComponent(
80294
80698
 
80295
80699
 
80296
80700
 
80701
+
80297
80702
 
80298
80703
  const components = {
80299
80704
  ByPager: pager,
@@ -80310,7 +80715,8 @@ const components = {
80310
80715
  ByTreeSearch: ByTreeSearch,
80311
80716
  ByDialog: ByDialog,
80312
80717
  ByCascaderPanel: ByCascaderPanel,
80313
- ByFloatingMenu: ByFloatingMenu
80718
+ ByFloatingMenu: ByFloatingMenu,
80719
+ ByPopoverSelector: ByPopoverSelector
80314
80720
  };
80315
80721
 
80316
80722
  // 设置当前 z-index 起始值
@@ -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}