@weitutech/by-components 1.1.124 → 1.1.126

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.
@@ -77115,8 +77115,8 @@ var ByTreeSearch_component = normalizeComponent(
77115
77115
  )
77116
77116
 
77117
77117
  /* harmony default export */ var ByTreeSearch = (ByTreeSearch_component.exports);
77118
- ;// ./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/by-dialog/ByDialog.vue?vue&type=template&id=bc06eb78
77119
- var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77118
+ ;// ./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/by-dialog/ByDialog.vue?vue&type=template&id=7eb39597
77119
+ var ByDialogvue_type_template_id_7eb39597_render = function render() {
77120
77120
  var _vm = this,
77121
77121
  _c = _vm._self._c;
77122
77122
  return _c('el-dialog', _vm._g(_vm._b({
@@ -77148,8 +77148,8 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77148
77148
  staticClass: "by-dialog__buttons"
77149
77149
  }, [_vm.leftButtons.length > 0 ? _c('div', {
77150
77150
  staticClass: "by-dialog__buttons--left"
77151
- }, [_vm._l(_vm.leftButtons, function (button, index) {
77152
- return [_c('el-button', {
77151
+ }, _vm._l(_vm.leftButtons, function (button, index) {
77152
+ return _c('el-button', {
77153
77153
  key: `left-${index}`,
77154
77154
  class: button.class,
77155
77155
  style: button.style,
@@ -77165,11 +77165,11 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77165
77165
  return _vm.handleButtonClick(button, index);
77166
77166
  }
77167
77167
  }
77168
- }, [_vm._v(" " + _vm._s(button.text) + " ")])];
77169
- })], 2) : _vm._e(), _vm.rightButtons.length > 0 ? _c('div', {
77168
+ }, [_vm._v(" " + _vm._s(button.text) + " ")]);
77169
+ }), 1) : _vm._e(), _vm.rightButtons.length > 0 ? _c('div', {
77170
77170
  staticClass: "by-dialog__buttons--right"
77171
- }, [_vm._l(_vm.rightButtons, function (button, index) {
77172
- return [_c('el-button', {
77171
+ }, _vm._l(_vm.rightButtons, function (button, index) {
77172
+ return _c('el-button', {
77173
77173
  key: `right-${index}`,
77174
77174
  class: button.class,
77175
77175
  style: button.style,
@@ -77185,10 +77185,10 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77185
77185
  return _vm.handleButtonClick(button, index);
77186
77186
  }
77187
77187
  }
77188
- }, [_vm._v(" " + _vm._s(button.text) + " ")])];
77189
- })], 2) : _vm._e()]), _vm._t("footer")], 2) : _vm._e()]);
77188
+ }, [_vm._v(" " + _vm._s(button.text) + " ")]);
77189
+ }), 1) : _vm._e()]), _vm._t("footer")], 2) : _vm._e()]);
77190
77190
  };
77191
- var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77191
+ var ByDialogvue_type_template_id_7eb39597_staticRenderFns = [];
77192
77192
 
77193
77193
  ;// ./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/by-dialog/ByDialog.vue?vue&type=script&lang=js
77194
77194
 
@@ -77264,7 +77264,8 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77264
77264
  },
77265
77265
  data() {
77266
77266
  return {
77267
- internalVisible: false
77267
+ internalVisible: false,
77268
+ responsiveWidth: null
77268
77269
  };
77269
77270
  },
77270
77271
  computed: {
@@ -77288,12 +77289,28 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77288
77289
  closeOnClickModal,
77289
77290
  ...attrs
77290
77291
  } = this.$attrs;
77291
- return {
77292
- width: this.width,
77292
+ const result = {
77293
77293
  top: this.computedTop,
77294
77294
  closeOnClickModal: this.closeOnClickModal,
77295
77295
  ...attrs
77296
77296
  };
77297
+
77298
+ // 全屏弹窗不设置width属性,让CSS样式控制
77299
+ if (!this.isFullscreen) {
77300
+ result.width = this.computedWidth;
77301
+ }
77302
+ return result;
77303
+ },
77304
+ computedWidth() {
77305
+ // 全屏弹窗不设置宽度,让CSS样式控制
77306
+ if (this.isFullscreen) {
77307
+ return undefined;
77308
+ }
77309
+ // 如果设置了响应式宽度,优先使用响应式宽度
77310
+ if (this.responsiveWidth !== null) {
77311
+ return this.responsiveWidth;
77312
+ }
77313
+ return this.width;
77297
77314
  },
77298
77315
  computedTop() {
77299
77316
  if (!this.autoAdjustTop) return '15vh';
@@ -77334,6 +77351,10 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77334
77351
  // 右侧按钮(默认位置,包括未设置position的按钮)
77335
77352
  rightButtons() {
77336
77353
  return this.buttons.filter(button => !button.position || button.position === 'right');
77354
+ },
77355
+ // 判断是否为全屏弹窗
77356
+ isFullscreen() {
77357
+ return this.customClass && this.customClass.includes('fullscreen');
77337
77358
  }
77338
77359
  },
77339
77360
  watch: {
@@ -77341,10 +77362,78 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77341
77362
  immediate: true,
77342
77363
  handler(newVal) {
77343
77364
  this.internalVisible = newVal;
77365
+ if (newVal && !this.isFullscreen) {
77366
+ this.$nextTick(() => {
77367
+ this.calculateResponsiveWidth();
77368
+ });
77369
+ }
77370
+ }
77371
+ },
77372
+ width: {
77373
+ handler() {
77374
+ if (this.internalVisible && !this.isFullscreen) {
77375
+ this.$nextTick(() => {
77376
+ this.calculateResponsiveWidth();
77377
+ });
77378
+ }
77344
77379
  }
77345
77380
  }
77346
77381
  },
77382
+ mounted() {
77383
+ // 直接监听窗口大小变化,让CSS过渡处理平滑效果
77384
+ this.resizeHandler = () => {
77385
+ if (this.internalVisible && !this.isFullscreen) {
77386
+ this.calculateResponsiveWidth();
77387
+ }
77388
+ };
77389
+ window.addEventListener('resize', this.resizeHandler);
77390
+ },
77391
+ beforeDestroy() {
77392
+ if (this.resizeHandler) {
77393
+ window.removeEventListener('resize', this.resizeHandler);
77394
+ }
77395
+ },
77347
77396
  methods: {
77397
+ // 计算响应式宽度
77398
+ calculateResponsiveWidth() {
77399
+ // 全屏弹窗不需要响应式适配
77400
+ if (this.isFullscreen) {
77401
+ this.responsiveWidth = null;
77402
+ return;
77403
+ }
77404
+ const screenWidth = window.innerWidth;
77405
+ const dialogWidth = this.parseWidth(this.width);
77406
+
77407
+ // 如果屏幕宽度小于等于弹窗宽度,则使用屏幕宽度的95%
77408
+ if (screenWidth <= dialogWidth) {
77409
+ this.responsiveWidth = '95%';
77410
+ } else {
77411
+ // 重置为原始宽度
77412
+ this.responsiveWidth = null;
77413
+ }
77414
+ },
77415
+ // 解析宽度值,转换为像素值
77416
+ parseWidth(width) {
77417
+ if (typeof width === 'number') {
77418
+ return width;
77419
+ }
77420
+ if (typeof width === 'string') {
77421
+ if (width.endsWith('px')) {
77422
+ return parseFloat(width);
77423
+ }
77424
+ if (width.endsWith('%')) {
77425
+ // 百分比宽度需要根据父容器计算,这里假设为屏幕宽度
77426
+ return parseFloat(width) / 100 * window.innerWidth;
77427
+ }
77428
+ if (width.endsWith('vw')) {
77429
+ return parseFloat(width) / 100 * window.innerWidth;
77430
+ }
77431
+ // 其他情况尝试解析为数字
77432
+ const num = parseFloat(width);
77433
+ return isNaN(num) ? 600 : num; // 默认600px
77434
+ }
77435
+ return 600; // 默认600px
77436
+ },
77348
77437
  handleClose() {
77349
77438
  this.internalVisible = false;
77350
77439
  this.$emit('update:visible', false);
@@ -77384,8 +77473,8 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77384
77473
  ;
77385
77474
  var ByDialog_component = normalizeComponent(
77386
77475
  by_dialog_ByDialogvue_type_script_lang_js,
77387
- ByDialogvue_type_template_id_bc06eb78_render,
77388
- ByDialogvue_type_template_id_bc06eb78_staticRenderFns,
77476
+ ByDialogvue_type_template_id_7eb39597_render,
77477
+ ByDialogvue_type_template_id_7eb39597_staticRenderFns,
77389
77478
  false,
77390
77479
  null,
77391
77480
  null,
@@ -77785,32 +77874,22 @@ ByDialogService.install = function (Vue) {
77785
77874
  Vue.prototype.$byDialog = ByDialogService;
77786
77875
  };
77787
77876
  /* harmony default export */ var by_dialog_ByDialogService = (ByDialogService);
77788
- ;// ./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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=36849b3b
77789
- var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77877
+ ;// ./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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=3977c801
77878
+ var ByCascaderPanelvue_type_template_id_3977c801_render = function render() {
77790
77879
  var _vm = this,
77791
77880
  _c = _vm._self._c;
77792
77881
  return _c('div', {
77793
- attrs: {
77794
- "id": "by-cascader-panel-container"
77795
- }
77796
- }, [_c('div', {
77797
- staticClass: "by-cascader-panel",
77798
- attrs: {
77799
- "data-component": "cascader-panel"
77800
- }
77882
+ staticClass: "cascader-panel"
77801
77883
  }, [_c('div', {
77802
- staticClass: "cascade-box row"
77884
+ staticClass: "panel-container"
77803
77885
  }, [_c('div', {
77804
- staticClass: "cascade-container left-panel"
77886
+ staticClass: "left-panel"
77805
77887
  }, [_c('div', {
77806
- staticClass: "cascade-title row column-c"
77888
+ staticClass: "panel-header"
77807
77889
  }, [!_vm.aggregationMode ? _c('div', {
77808
- staticClass: "txt"
77890
+ staticClass: "panel-title"
77809
77891
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
77810
- staticClass: "cell",
77811
- staticStyle: {
77812
- "padding-left": "20px"
77813
- }
77892
+ staticClass: "search-section"
77814
77893
  }, [_c('div', {
77815
77894
  staticClass: "search-container"
77816
77895
  }, [_c('el-input', {
@@ -77896,26 +77975,25 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77896
77975
  }, [_c('i', {
77897
77976
  staticClass: "el-icon-edit-outline"
77898
77977
  })])], 1) : _vm._e()], 1)]), _c('div', {
77899
- staticClass: "menu"
77978
+ staticClass: "action-buttons"
77900
77979
  }, [_vm.searchInput === '' && _vm.isMultiple && _vm.showSelectAll && !_vm.isViewMode ? _c('div', {
77901
77980
  staticClass: "all-select",
77902
- attrs: {
77903
- "size": "mini"
77904
- },
77905
77981
  on: {
77906
77982
  "click": _vm.handleSelectAll
77907
77983
  }
77908
77984
  }, [_vm._v(" " + _vm._s(_vm.isAllSelected ? '取消全选' : '全选') + " ")]) : _vm._e()])]), _c('div', {
77909
- staticClass: "cascade-content",
77910
- staticStyle: {
77911
- "border": "1px solid #dcdfe6",
77912
- "overflow-x": "scroll",
77913
- "padding": "20px 20px 20px 20px"
77914
- },
77985
+ staticClass: "panel-content",
77915
77986
  style: {
77916
77987
  height: _vm.computedPanelHeight + 'px'
77917
77988
  }
77918
- }, [_c('div', [_vm.isShow && _vm.filteredOptions.length > 0 ? _c('el-cascader-panel', {
77989
+ }, [_c('div', {
77990
+ staticClass: "cascader-content-wrapper",
77991
+ staticStyle: {
77992
+ "overflow-x": "scroll",
77993
+ "padding": "20px 20px 20px 20px",
77994
+ "height": "100%"
77995
+ }
77996
+ }, [_vm.isShow && _vm.filteredOptions.length > 0 ? _c('el-cascader-panel', {
77919
77997
  directives: [{
77920
77998
  name: "show",
77921
77999
  rawName: "v-show",
@@ -77923,7 +78001,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77923
78001
  expression: "searchInput === '' || !isShowSearch"
77924
78002
  }],
77925
78003
  ref: "cascaderPanel",
77926
- staticClass: "singleCascader",
78004
+ staticClass: "cascader-panel-inner",
77927
78005
  style: {
77928
78006
  height: _vm.computedPanelHeight - 50 + 'px'
77929
78007
  },
@@ -77951,7 +78029,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77951
78029
  expression: "searchInput !== '' && isShowSearch"
77952
78030
  }],
77953
78031
  ref: "searchCascaderPanel",
77954
- staticClass: "singleCascader",
78032
+ staticClass: "cascader-panel-inner",
77955
78033
  style: {
77956
78034
  height: _vm.computedPanelHeight - 50 + 'px'
77957
78035
  },
@@ -77971,54 +78049,42 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77971
78049
  },
77972
78050
  expression: "searchPanelValue"
77973
78051
  }
77974
- }) : _vm._e()], 1), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
78052
+ }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
77975
78053
  directives: [{
77976
78054
  name: "show",
77977
78055
  rawName: "v-show",
77978
78056
  value: _vm.searchInput !== '',
77979
78057
  expression: "searchInput !== ''"
77980
78058
  }],
77981
- staticClass: "row column-c row-c",
77982
- staticStyle: {
77983
- "width": "100%",
77984
- "height": "100%"
77985
- }
78059
+ staticClass: "empty-search"
77986
78060
  }, [_c('el-empty', {
77987
78061
  attrs: {
77988
78062
  "image-size": 100
77989
78063
  }
77990
- })], 1) : _vm._e()])]), _c('div', {
77991
- staticClass: "cascade-container bb right-panel"
78064
+ })], 1) : _vm._e()], 1)])]), _c('div', {
78065
+ staticClass: "right-panel"
77992
78066
  }, [_c('div', {
77993
- staticClass: "cascade-title row column-c"
78067
+ staticClass: "panel-header"
77994
78068
  }, [_c('div', {
77995
- staticClass: "txt"
78069
+ staticClass: "panel-title"
77996
78070
  }, [_vm._v("已选(" + _vm._s(_vm.selectedItems.length) + ")")]), _c('div', {
77997
- staticClass: "menu"
78071
+ staticClass: "action-buttons"
77998
78072
  }, [_vm.selectedItems.length > 0 && !_vm.isViewMode ? _c('div', {
77999
78073
  staticClass: "clear-btn",
78000
- attrs: {
78001
- "size": "mini"
78002
- },
78003
78074
  on: {
78004
78075
  "click": _vm.clearSelection
78005
78076
  }
78006
78077
  }, [_vm._v("清除")]) : _vm._e()])]), _c('div', {
78007
- staticClass: "cascade-content",
78078
+ staticClass: "panel-content",
78008
78079
  style: {
78009
78080
  height: _vm.computedPanelHeight - 5 + 'px'
78010
78081
  }
78011
78082
  }, [_c('div', {
78012
- staticClass: "item",
78013
- staticStyle: {
78014
- "overflow-y": "auto",
78015
- "height": "100%",
78016
- "max-height": "100%"
78017
- }
78083
+ staticClass: "selected-list"
78018
78084
  }, [_vm._l(_vm.selectedItems, function (item, index) {
78019
78085
  return _c('div', {
78020
78086
  key: item.value,
78021
- staticClass: "check-box row column-c",
78087
+ staticClass: "selected-item",
78022
78088
  staticStyle: {
78023
78089
  "height": "36px",
78024
78090
  "flex-shrink": "0",
@@ -78026,7 +78092,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78026
78092
  "align-items": "center !important"
78027
78093
  }
78028
78094
  }, [_c('div', {
78029
- staticClass: "cell item-content",
78095
+ staticClass: "item-content",
78030
78096
  staticStyle: {
78031
78097
  "display": "flex !important",
78032
78098
  "align-items": "center !important",
@@ -78058,10 +78124,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78058
78124
  "vertical-align": "middle !important"
78059
78125
  }
78060
78126
  }, [_vm._v(" " + _vm._s(item[_vm.subtitleField]) + " ")]) : _vm._e()]), !_vm.isViewMode ? _c('div', {
78061
- staticClass: "icon",
78062
- staticStyle: {
78063
- "cursor": "pointer"
78064
- },
78127
+ staticClass: "remove-btn",
78065
78128
  on: {
78066
78129
  "click": function ($event) {
78067
78130
  return _vm.removeItem(item, index);
@@ -78072,9 +78135,9 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78072
78135
  })]) : _vm._e()]);
78073
78136
  }), _vm.selectedItems.length === 0 ? _c('div', {
78074
78137
  staticClass: "empty-state"
78075
- }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])])]);
78138
+ }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])]);
78076
78139
  };
78077
- var ByCascaderPanelvue_type_template_id_36849b3b_staticRenderFns = [];
78140
+ var ByCascaderPanelvue_type_template_id_3977c801_staticRenderFns = [];
78078
78141
 
78079
78142
  ;// ./src/utils/cascaderUtils.js
78080
78143
 
@@ -79463,7 +79526,34 @@ class CascaderUtils {
79463
79526
  };
79464
79527
  searchInOptions(this.filteredOptions);
79465
79528
  return matchedPaths;
79529
+ },
79530
+ // 强制调整已选项的垂直居中样式
79531
+ forceVerticalCenter() {
79532
+ this.$nextTick(() => {
79533
+ const itemLabels = this.$el.querySelectorAll('.item-label');
79534
+ itemLabels.forEach(label => {
79535
+ if (label) {
79536
+ // 使用JavaScript强制设置样式
79537
+ label.style.setProperty('display', 'flex', 'important');
79538
+ label.style.setProperty('align-items', 'center', 'important');
79539
+ label.style.setProperty('height', '36px', 'important');
79540
+ label.style.setProperty('line-height', '36px', 'important');
79541
+ label.style.setProperty('margin', '0', 'important');
79542
+ label.style.setProperty('padding', '0', 'important');
79543
+ label.style.setProperty('vertical-align', 'middle', 'important');
79544
+ label.style.setProperty('font-size', '14px', 'important');
79545
+ }
79546
+ });
79547
+ });
79466
79548
  }
79549
+ },
79550
+ mounted() {
79551
+ // 组件挂载后强制调整样式
79552
+ this.forceVerticalCenter();
79553
+ },
79554
+ updated() {
79555
+ // 组件更新后强制调整样式
79556
+ this.forceVerticalCenter();
79467
79557
  }
79468
79558
  });
79469
79559
  ;// ./src/components/cascader-panel/ByCascaderPanel.vue?vue&type=script&lang=js
@@ -79478,8 +79568,8 @@ class CascaderUtils {
79478
79568
  ;
79479
79569
  var ByCascaderPanel_component = normalizeComponent(
79480
79570
  cascader_panel_ByCascaderPanelvue_type_script_lang_js,
79481
- ByCascaderPanelvue_type_template_id_36849b3b_render,
79482
- ByCascaderPanelvue_type_template_id_36849b3b_staticRenderFns,
79571
+ ByCascaderPanelvue_type_template_id_3977c801_render,
79572
+ ByCascaderPanelvue_type_template_id_3977c801_staticRenderFns,
79483
79573
  false,
79484
79574
  null,
79485
79575
  null,