@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.
@@ -77125,8 +77125,8 @@ var ByTreeSearch_component = normalizeComponent(
77125
77125
  )
77126
77126
 
77127
77127
  /* harmony default export */ var ByTreeSearch = (ByTreeSearch_component.exports);
77128
- ;// ./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/by-dialog/ByDialog.vue?vue&type=template&id=bc06eb78
77129
- var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77128
+ ;// ./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/by-dialog/ByDialog.vue?vue&type=template&id=7eb39597
77129
+ var ByDialogvue_type_template_id_7eb39597_render = function render() {
77130
77130
  var _vm = this,
77131
77131
  _c = _vm._self._c;
77132
77132
  return _c('el-dialog', _vm._g(_vm._b({
@@ -77158,8 +77158,8 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77158
77158
  staticClass: "by-dialog__buttons"
77159
77159
  }, [_vm.leftButtons.length > 0 ? _c('div', {
77160
77160
  staticClass: "by-dialog__buttons--left"
77161
- }, [_vm._l(_vm.leftButtons, function (button, index) {
77162
- return [_c('el-button', {
77161
+ }, _vm._l(_vm.leftButtons, function (button, index) {
77162
+ return _c('el-button', {
77163
77163
  key: `left-${index}`,
77164
77164
  class: button.class,
77165
77165
  style: button.style,
@@ -77175,11 +77175,11 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77175
77175
  return _vm.handleButtonClick(button, index);
77176
77176
  }
77177
77177
  }
77178
- }, [_vm._v(" " + _vm._s(button.text) + " ")])];
77179
- })], 2) : _vm._e(), _vm.rightButtons.length > 0 ? _c('div', {
77178
+ }, [_vm._v(" " + _vm._s(button.text) + " ")]);
77179
+ }), 1) : _vm._e(), _vm.rightButtons.length > 0 ? _c('div', {
77180
77180
  staticClass: "by-dialog__buttons--right"
77181
- }, [_vm._l(_vm.rightButtons, function (button, index) {
77182
- return [_c('el-button', {
77181
+ }, _vm._l(_vm.rightButtons, function (button, index) {
77182
+ return _c('el-button', {
77183
77183
  key: `right-${index}`,
77184
77184
  class: button.class,
77185
77185
  style: button.style,
@@ -77195,10 +77195,10 @@ var ByDialogvue_type_template_id_bc06eb78_render = function render() {
77195
77195
  return _vm.handleButtonClick(button, index);
77196
77196
  }
77197
77197
  }
77198
- }, [_vm._v(" " + _vm._s(button.text) + " ")])];
77199
- })], 2) : _vm._e()]), _vm._t("footer")], 2) : _vm._e()]);
77198
+ }, [_vm._v(" " + _vm._s(button.text) + " ")]);
77199
+ }), 1) : _vm._e()]), _vm._t("footer")], 2) : _vm._e()]);
77200
77200
  };
77201
- var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77201
+ var ByDialogvue_type_template_id_7eb39597_staticRenderFns = [];
77202
77202
 
77203
77203
  ;// ./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/by-dialog/ByDialog.vue?vue&type=script&lang=js
77204
77204
 
@@ -77274,7 +77274,8 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77274
77274
  },
77275
77275
  data() {
77276
77276
  return {
77277
- internalVisible: false
77277
+ internalVisible: false,
77278
+ responsiveWidth: null
77278
77279
  };
77279
77280
  },
77280
77281
  computed: {
@@ -77298,12 +77299,28 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77298
77299
  closeOnClickModal,
77299
77300
  ...attrs
77300
77301
  } = this.$attrs;
77301
- return {
77302
- width: this.width,
77302
+ const result = {
77303
77303
  top: this.computedTop,
77304
77304
  closeOnClickModal: this.closeOnClickModal,
77305
77305
  ...attrs
77306
77306
  };
77307
+
77308
+ // 全屏弹窗不设置width属性,让CSS样式控制
77309
+ if (!this.isFullscreen) {
77310
+ result.width = this.computedWidth;
77311
+ }
77312
+ return result;
77313
+ },
77314
+ computedWidth() {
77315
+ // 全屏弹窗不设置宽度,让CSS样式控制
77316
+ if (this.isFullscreen) {
77317
+ return undefined;
77318
+ }
77319
+ // 如果设置了响应式宽度,优先使用响应式宽度
77320
+ if (this.responsiveWidth !== null) {
77321
+ return this.responsiveWidth;
77322
+ }
77323
+ return this.width;
77307
77324
  },
77308
77325
  computedTop() {
77309
77326
  if (!this.autoAdjustTop) return '15vh';
@@ -77344,6 +77361,10 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77344
77361
  // 右侧按钮(默认位置,包括未设置position的按钮)
77345
77362
  rightButtons() {
77346
77363
  return this.buttons.filter(button => !button.position || button.position === 'right');
77364
+ },
77365
+ // 判断是否为全屏弹窗
77366
+ isFullscreen() {
77367
+ return this.customClass && this.customClass.includes('fullscreen');
77347
77368
  }
77348
77369
  },
77349
77370
  watch: {
@@ -77351,10 +77372,78 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77351
77372
  immediate: true,
77352
77373
  handler(newVal) {
77353
77374
  this.internalVisible = newVal;
77375
+ if (newVal && !this.isFullscreen) {
77376
+ this.$nextTick(() => {
77377
+ this.calculateResponsiveWidth();
77378
+ });
77379
+ }
77380
+ }
77381
+ },
77382
+ width: {
77383
+ handler() {
77384
+ if (this.internalVisible && !this.isFullscreen) {
77385
+ this.$nextTick(() => {
77386
+ this.calculateResponsiveWidth();
77387
+ });
77388
+ }
77354
77389
  }
77355
77390
  }
77356
77391
  },
77392
+ mounted() {
77393
+ // 直接监听窗口大小变化,让CSS过渡处理平滑效果
77394
+ this.resizeHandler = () => {
77395
+ if (this.internalVisible && !this.isFullscreen) {
77396
+ this.calculateResponsiveWidth();
77397
+ }
77398
+ };
77399
+ window.addEventListener('resize', this.resizeHandler);
77400
+ },
77401
+ beforeDestroy() {
77402
+ if (this.resizeHandler) {
77403
+ window.removeEventListener('resize', this.resizeHandler);
77404
+ }
77405
+ },
77357
77406
  methods: {
77407
+ // 计算响应式宽度
77408
+ calculateResponsiveWidth() {
77409
+ // 全屏弹窗不需要响应式适配
77410
+ if (this.isFullscreen) {
77411
+ this.responsiveWidth = null;
77412
+ return;
77413
+ }
77414
+ const screenWidth = window.innerWidth;
77415
+ const dialogWidth = this.parseWidth(this.width);
77416
+
77417
+ // 如果屏幕宽度小于等于弹窗宽度,则使用屏幕宽度的95%
77418
+ if (screenWidth <= dialogWidth) {
77419
+ this.responsiveWidth = '95%';
77420
+ } else {
77421
+ // 重置为原始宽度
77422
+ this.responsiveWidth = null;
77423
+ }
77424
+ },
77425
+ // 解析宽度值,转换为像素值
77426
+ parseWidth(width) {
77427
+ if (typeof width === 'number') {
77428
+ return width;
77429
+ }
77430
+ if (typeof width === 'string') {
77431
+ if (width.endsWith('px')) {
77432
+ return parseFloat(width);
77433
+ }
77434
+ if (width.endsWith('%')) {
77435
+ // 百分比宽度需要根据父容器计算,这里假设为屏幕宽度
77436
+ return parseFloat(width) / 100 * window.innerWidth;
77437
+ }
77438
+ if (width.endsWith('vw')) {
77439
+ return parseFloat(width) / 100 * window.innerWidth;
77440
+ }
77441
+ // 其他情况尝试解析为数字
77442
+ const num = parseFloat(width);
77443
+ return isNaN(num) ? 600 : num; // 默认600px
77444
+ }
77445
+ return 600; // 默认600px
77446
+ },
77358
77447
  handleClose() {
77359
77448
  this.internalVisible = false;
77360
77449
  this.$emit('update:visible', false);
@@ -77394,8 +77483,8 @@ var ByDialogvue_type_template_id_bc06eb78_staticRenderFns = [];
77394
77483
  ;
77395
77484
  var ByDialog_component = normalizeComponent(
77396
77485
  by_dialog_ByDialogvue_type_script_lang_js,
77397
- ByDialogvue_type_template_id_bc06eb78_render,
77398
- ByDialogvue_type_template_id_bc06eb78_staticRenderFns,
77486
+ ByDialogvue_type_template_id_7eb39597_render,
77487
+ ByDialogvue_type_template_id_7eb39597_staticRenderFns,
77399
77488
  false,
77400
77489
  null,
77401
77490
  null,
@@ -77795,32 +77884,22 @@ ByDialogService.install = function (Vue) {
77795
77884
  Vue.prototype.$byDialog = ByDialogService;
77796
77885
  };
77797
77886
  /* harmony default export */ var by_dialog_ByDialogService = (ByDialogService);
77798
- ;// ./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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=36849b3b
77799
- var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77887
+ ;// ./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/cascader-panel/ByCascaderPanel.vue?vue&type=template&id=3977c801
77888
+ var ByCascaderPanelvue_type_template_id_3977c801_render = function render() {
77800
77889
  var _vm = this,
77801
77890
  _c = _vm._self._c;
77802
77891
  return _c('div', {
77803
- attrs: {
77804
- "id": "by-cascader-panel-container"
77805
- }
77806
- }, [_c('div', {
77807
- staticClass: "by-cascader-panel",
77808
- attrs: {
77809
- "data-component": "cascader-panel"
77810
- }
77892
+ staticClass: "cascader-panel"
77811
77893
  }, [_c('div', {
77812
- staticClass: "cascade-box row"
77894
+ staticClass: "panel-container"
77813
77895
  }, [_c('div', {
77814
- staticClass: "cascade-container left-panel"
77896
+ staticClass: "left-panel"
77815
77897
  }, [_c('div', {
77816
- staticClass: "cascade-title row column-c"
77898
+ staticClass: "panel-header"
77817
77899
  }, [!_vm.aggregationMode ? _c('div', {
77818
- staticClass: "txt"
77900
+ staticClass: "panel-title"
77819
77901
  }, [_vm._v("可选(" + _vm._s(_vm.selectedCount) + "/" + _vm._s(_vm.totalCount) + ")")]) : _vm._e(), _c('div', {
77820
- staticClass: "cell",
77821
- staticStyle: {
77822
- "padding-left": "20px"
77823
- }
77902
+ staticClass: "search-section"
77824
77903
  }, [_c('div', {
77825
77904
  staticClass: "search-container"
77826
77905
  }, [_c('el-input', {
@@ -77906,26 +77985,25 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77906
77985
  }, [_c('i', {
77907
77986
  staticClass: "el-icon-edit-outline"
77908
77987
  })])], 1) : _vm._e()], 1)]), _c('div', {
77909
- staticClass: "menu"
77988
+ staticClass: "action-buttons"
77910
77989
  }, [_vm.searchInput === '' && _vm.isMultiple && _vm.showSelectAll && !_vm.isViewMode ? _c('div', {
77911
77990
  staticClass: "all-select",
77912
- attrs: {
77913
- "size": "mini"
77914
- },
77915
77991
  on: {
77916
77992
  "click": _vm.handleSelectAll
77917
77993
  }
77918
77994
  }, [_vm._v(" " + _vm._s(_vm.isAllSelected ? '取消全选' : '全选') + " ")]) : _vm._e()])]), _c('div', {
77919
- staticClass: "cascade-content",
77920
- staticStyle: {
77921
- "border": "1px solid #dcdfe6",
77922
- "overflow-x": "scroll",
77923
- "padding": "20px 20px 20px 20px"
77924
- },
77995
+ staticClass: "panel-content",
77925
77996
  style: {
77926
77997
  height: _vm.computedPanelHeight + 'px'
77927
77998
  }
77928
- }, [_c('div', [_vm.isShow && _vm.filteredOptions.length > 0 ? _c('el-cascader-panel', {
77999
+ }, [_c('div', {
78000
+ staticClass: "cascader-content-wrapper",
78001
+ staticStyle: {
78002
+ "overflow-x": "scroll",
78003
+ "padding": "20px 20px 20px 20px",
78004
+ "height": "100%"
78005
+ }
78006
+ }, [_vm.isShow && _vm.filteredOptions.length > 0 ? _c('el-cascader-panel', {
77929
78007
  directives: [{
77930
78008
  name: "show",
77931
78009
  rawName: "v-show",
@@ -77933,7 +78011,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77933
78011
  expression: "searchInput === '' || !isShowSearch"
77934
78012
  }],
77935
78013
  ref: "cascaderPanel",
77936
- staticClass: "singleCascader",
78014
+ staticClass: "cascader-panel-inner",
77937
78015
  style: {
77938
78016
  height: _vm.computedPanelHeight - 50 + 'px'
77939
78017
  },
@@ -77961,7 +78039,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77961
78039
  expression: "searchInput !== '' && isShowSearch"
77962
78040
  }],
77963
78041
  ref: "searchCascaderPanel",
77964
- staticClass: "singleCascader",
78042
+ staticClass: "cascader-panel-inner",
77965
78043
  style: {
77966
78044
  height: _vm.computedPanelHeight - 50 + 'px'
77967
78045
  },
@@ -77981,54 +78059,42 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
77981
78059
  },
77982
78060
  expression: "searchPanelValue"
77983
78061
  }
77984
- }) : _vm._e()], 1), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
78062
+ }) : _vm._e(), _vm.isShowSearch && _vm.searchOptions.length === 0 ? _c('div', {
77985
78063
  directives: [{
77986
78064
  name: "show",
77987
78065
  rawName: "v-show",
77988
78066
  value: _vm.searchInput !== '',
77989
78067
  expression: "searchInput !== ''"
77990
78068
  }],
77991
- staticClass: "row column-c row-c",
77992
- staticStyle: {
77993
- "width": "100%",
77994
- "height": "100%"
77995
- }
78069
+ staticClass: "empty-search"
77996
78070
  }, [_c('el-empty', {
77997
78071
  attrs: {
77998
78072
  "image-size": 100
77999
78073
  }
78000
- })], 1) : _vm._e()])]), _c('div', {
78001
- staticClass: "cascade-container bb right-panel"
78074
+ })], 1) : _vm._e()], 1)])]), _c('div', {
78075
+ staticClass: "right-panel"
78002
78076
  }, [_c('div', {
78003
- staticClass: "cascade-title row column-c"
78077
+ staticClass: "panel-header"
78004
78078
  }, [_c('div', {
78005
- staticClass: "txt"
78079
+ staticClass: "panel-title"
78006
78080
  }, [_vm._v("已选(" + _vm._s(_vm.selectedItems.length) + ")")]), _c('div', {
78007
- staticClass: "menu"
78081
+ staticClass: "action-buttons"
78008
78082
  }, [_vm.selectedItems.length > 0 && !_vm.isViewMode ? _c('div', {
78009
78083
  staticClass: "clear-btn",
78010
- attrs: {
78011
- "size": "mini"
78012
- },
78013
78084
  on: {
78014
78085
  "click": _vm.clearSelection
78015
78086
  }
78016
78087
  }, [_vm._v("清除")]) : _vm._e()])]), _c('div', {
78017
- staticClass: "cascade-content",
78088
+ staticClass: "panel-content",
78018
78089
  style: {
78019
78090
  height: _vm.computedPanelHeight - 5 + 'px'
78020
78091
  }
78021
78092
  }, [_c('div', {
78022
- staticClass: "item",
78023
- staticStyle: {
78024
- "overflow-y": "auto",
78025
- "height": "100%",
78026
- "max-height": "100%"
78027
- }
78093
+ staticClass: "selected-list"
78028
78094
  }, [_vm._l(_vm.selectedItems, function (item, index) {
78029
78095
  return _c('div', {
78030
78096
  key: item.value,
78031
- staticClass: "check-box row column-c",
78097
+ staticClass: "selected-item",
78032
78098
  staticStyle: {
78033
78099
  "height": "36px",
78034
78100
  "flex-shrink": "0",
@@ -78036,7 +78102,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78036
78102
  "align-items": "center !important"
78037
78103
  }
78038
78104
  }, [_c('div', {
78039
- staticClass: "cell item-content",
78105
+ staticClass: "item-content",
78040
78106
  staticStyle: {
78041
78107
  "display": "flex !important",
78042
78108
  "align-items": "center !important",
@@ -78068,10 +78134,7 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78068
78134
  "vertical-align": "middle !important"
78069
78135
  }
78070
78136
  }, [_vm._v(" " + _vm._s(item[_vm.subtitleField]) + " ")]) : _vm._e()]), !_vm.isViewMode ? _c('div', {
78071
- staticClass: "icon",
78072
- staticStyle: {
78073
- "cursor": "pointer"
78074
- },
78137
+ staticClass: "remove-btn",
78075
78138
  on: {
78076
78139
  "click": function ($event) {
78077
78140
  return _vm.removeItem(item, index);
@@ -78082,9 +78145,9 @@ var ByCascaderPanelvue_type_template_id_36849b3b_render = function render() {
78082
78145
  })]) : _vm._e()]);
78083
78146
  }), _vm.selectedItems.length === 0 ? _c('div', {
78084
78147
  staticClass: "empty-state"
78085
- }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])])]);
78148
+ }, [_vm._v("暂无选中项")]) : _vm._e()], 2)])])])]);
78086
78149
  };
78087
- var ByCascaderPanelvue_type_template_id_36849b3b_staticRenderFns = [];
78150
+ var ByCascaderPanelvue_type_template_id_3977c801_staticRenderFns = [];
78088
78151
 
78089
78152
  ;// ./src/utils/cascaderUtils.js
78090
78153
 
@@ -79473,7 +79536,34 @@ class CascaderUtils {
79473
79536
  };
79474
79537
  searchInOptions(this.filteredOptions);
79475
79538
  return matchedPaths;
79539
+ },
79540
+ // 强制调整已选项的垂直居中样式
79541
+ forceVerticalCenter() {
79542
+ this.$nextTick(() => {
79543
+ const itemLabels = this.$el.querySelectorAll('.item-label');
79544
+ itemLabels.forEach(label => {
79545
+ if (label) {
79546
+ // 使用JavaScript强制设置样式
79547
+ label.style.setProperty('display', 'flex', 'important');
79548
+ label.style.setProperty('align-items', 'center', 'important');
79549
+ label.style.setProperty('height', '36px', 'important');
79550
+ label.style.setProperty('line-height', '36px', 'important');
79551
+ label.style.setProperty('margin', '0', 'important');
79552
+ label.style.setProperty('padding', '0', 'important');
79553
+ label.style.setProperty('vertical-align', 'middle', 'important');
79554
+ label.style.setProperty('font-size', '14px', 'important');
79555
+ }
79556
+ });
79557
+ });
79476
79558
  }
79559
+ },
79560
+ mounted() {
79561
+ // 组件挂载后强制调整样式
79562
+ this.forceVerticalCenter();
79563
+ },
79564
+ updated() {
79565
+ // 组件更新后强制调整样式
79566
+ this.forceVerticalCenter();
79477
79567
  }
79478
79568
  });
79479
79569
  ;// ./src/components/cascader-panel/ByCascaderPanel.vue?vue&type=script&lang=js
@@ -79488,8 +79578,8 @@ class CascaderUtils {
79488
79578
  ;
79489
79579
  var ByCascaderPanel_component = normalizeComponent(
79490
79580
  cascader_panel_ByCascaderPanelvue_type_script_lang_js,
79491
- ByCascaderPanelvue_type_template_id_36849b3b_render,
79492
- ByCascaderPanelvue_type_template_id_36849b3b_staticRenderFns,
79581
+ ByCascaderPanelvue_type_template_id_3977c801_render,
79582
+ ByCascaderPanelvue_type_template_id_3977c801_staticRenderFns,
79493
79583
  false,
79494
79584
  null,
79495
79585
  null,