@weitutech/by-components 1.1.183 → 1.1.184
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 +11 -270
- package/lib/by-components.umd.js +11 -270
- package/lib/by-components.umd.min.js +1 -1
- package/lib/index.css +1 -1
- package/package.json +1 -1
|
@@ -74524,18 +74524,11 @@ var component = normalizeComponent(
|
|
|
74524
74524
|
)
|
|
74525
74525
|
|
|
74526
74526
|
/* harmony default export */ var pager = (component.exports);
|
|
74527
|
-
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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/table/index.vue?vue&type=template&id=
|
|
74528
|
-
var
|
|
74527
|
+
;// ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"5daa4f39-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/table/index.vue?vue&type=template&id=35ba1298
|
|
74528
|
+
var tablevue_type_template_id_35ba1298_render = function render() {
|
|
74529
74529
|
var _vm = this,
|
|
74530
74530
|
_c = _vm._self._c;
|
|
74531
|
-
return _c('div', {
|
|
74532
|
-
staticClass: "by-table-wrapper",
|
|
74533
|
-
class: {
|
|
74534
|
-
'custom-loading-mode': (_vm.loadingStyle === 'pulse' || _vm.loadingStyle === 'box') && _vm.loading
|
|
74535
|
-
}
|
|
74536
|
-
}, [_c('div', {
|
|
74537
|
-
staticClass: "vxe-grid-wrapper"
|
|
74538
|
-
}, [_c('vxe-grid', _vm._g(_vm._b({
|
|
74531
|
+
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
74539
74532
|
ref: "xGrid",
|
|
74540
74533
|
on: {
|
|
74541
74534
|
"cell-click": _vm.handleCellClick,
|
|
@@ -74597,7 +74590,7 @@ var tablevue_type_template_id_23b79ced_render = function render() {
|
|
|
74597
74590
|
},
|
|
74598
74591
|
proxy: true
|
|
74599
74592
|
}], null, true)
|
|
74600
|
-
}, 'vxe-grid', _vm.options, false), _vm.eventListeners))
|
|
74593
|
+
}, 'vxe-grid', _vm.options, false), _vm.eventListeners)), _vm.gridOptions && _vm.gridOptions.customColumnConfig && _vm.gridOptions.customColumnConfig.showCustomColumn ? _c('CustomColumn', {
|
|
74601
74594
|
ref: "CustomColumnRef",
|
|
74602
74595
|
attrs: {
|
|
74603
74596
|
"info-method": _vm.gridOptions.customColumnConfig.infoMethod,
|
|
@@ -74616,7 +74609,7 @@ var tablevue_type_template_id_23b79ced_render = function render() {
|
|
|
74616
74609
|
}
|
|
74617
74610
|
}) : _vm._e()], 1);
|
|
74618
74611
|
};
|
|
74619
|
-
var
|
|
74612
|
+
var tablevue_type_template_id_35ba1298_staticRenderFns = [];
|
|
74620
74613
|
|
|
74621
74614
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
74622
74615
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -76662,14 +76655,6 @@ var custom_column_component = normalizeComponent(
|
|
|
76662
76655
|
loading: {
|
|
76663
76656
|
type: Boolean,
|
|
76664
76657
|
default: false
|
|
76665
|
-
},
|
|
76666
|
-
loadingStyle: {
|
|
76667
|
-
// loading样式类型:'pulse' 3D旋转圆环样式(默认),'box' 方块变形动画样式,'default' 使用vxe-table默认样式
|
|
76668
|
-
type: String,
|
|
76669
|
-
default: 'default',
|
|
76670
|
-
validator(value) {
|
|
76671
|
-
return ['pulse', 'box', 'default'].includes(value);
|
|
76672
|
-
}
|
|
76673
76658
|
}
|
|
76674
76659
|
},
|
|
76675
76660
|
data() {
|
|
@@ -76698,9 +76683,7 @@ var custom_column_component = normalizeComponent(
|
|
|
76698
76683
|
tableWidth: 1200,
|
|
76699
76684
|
// 默认值,将在客户端初始化
|
|
76700
76685
|
// 是否为移动设备
|
|
76701
|
-
isMobile: false
|
|
76702
|
-
// MutationObserver实例
|
|
76703
|
-
loadingObserver: null
|
|
76686
|
+
isMobile: false
|
|
76704
76687
|
};
|
|
76705
76688
|
},
|
|
76706
76689
|
mounted() {
|
|
@@ -76714,52 +76697,14 @@ var custom_column_component = normalizeComponent(
|
|
|
76714
76697
|
|
|
76715
76698
|
// 前端分页模式下初始化默认排序
|
|
76716
76699
|
this.initDefaultSortForFrontendPagination();
|
|
76717
|
-
|
|
76718
|
-
// 初始化自定义loading
|
|
76719
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76720
|
-
this.$nextTick(() => {
|
|
76721
|
-
this.initCustomLoading();
|
|
76722
|
-
// 使用MutationObserver监听DOM变化,确保默认loading被隐藏
|
|
76723
|
-
if (this.$refs.xGrid && this.$refs.xGrid.$el) {
|
|
76724
|
-
this.observeLoadingChanges();
|
|
76725
|
-
}
|
|
76726
|
-
});
|
|
76727
|
-
}
|
|
76728
76700
|
},
|
|
76729
76701
|
beforeDestroy() {
|
|
76730
76702
|
// 确保只在客户端环境中移除事件监听
|
|
76731
76703
|
if (typeof window !== 'undefined') {
|
|
76732
76704
|
this.removeResizeListener();
|
|
76733
|
-
// 清理MutationObserver
|
|
76734
|
-
if (this.loadingObserver) {
|
|
76735
|
-
this.loadingObserver.disconnect();
|
|
76736
|
-
this.loadingObserver = null;
|
|
76737
|
-
}
|
|
76738
76705
|
}
|
|
76739
76706
|
},
|
|
76740
76707
|
watch: {
|
|
76741
|
-
loading(newVal) {
|
|
76742
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76743
|
-
this.$nextTick(() => {
|
|
76744
|
-
this.updateCustomLoading();
|
|
76745
|
-
});
|
|
76746
|
-
}
|
|
76747
|
-
},
|
|
76748
|
-
loadingStyle() {
|
|
76749
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76750
|
-
this.$nextTick(() => {
|
|
76751
|
-
this.updateCustomLoading();
|
|
76752
|
-
});
|
|
76753
|
-
} else {
|
|
76754
|
-
// 切换到default样式时,移除自定义loading
|
|
76755
|
-
if (this.$refs.xGrid && this.$refs.xGrid.$el) {
|
|
76756
|
-
const customLoading = this.$refs.xGrid.$el.querySelector('.custom-loading-content');
|
|
76757
|
-
if (customLoading) {
|
|
76758
|
-
customLoading.remove();
|
|
76759
|
-
}
|
|
76760
|
-
}
|
|
76761
|
-
}
|
|
76762
|
-
},
|
|
76763
76708
|
'gridOptions.columns': {
|
|
76764
76709
|
handler(newColumns) {
|
|
76765
76710
|
//这里保存的列宽要恢复至最初未拖动时的列宽
|
|
@@ -76880,19 +76825,9 @@ var custom_column_component = normalizeComponent(
|
|
|
76880
76825
|
copyFields: this.gridOptions.copyFields || [],
|
|
76881
76826
|
emptyText: this.gridOptions.emptyText || '暂无数据',
|
|
76882
76827
|
loading: this.loading,
|
|
76883
|
-
loadingConfig:
|
|
76884
|
-
|
|
76885
|
-
|
|
76886
|
-
};
|
|
76887
|
-
// 如果使用自定义loading样式,隐藏默认的loading文字和图标
|
|
76888
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76889
|
-
baseConfig.text = null;
|
|
76890
|
-
baseConfig.icon = null;
|
|
76891
|
-
} else {
|
|
76892
|
-
baseConfig.text = baseConfig.text || '加载中...';
|
|
76893
|
-
}
|
|
76894
|
-
return baseConfig;
|
|
76895
|
-
})(),
|
|
76828
|
+
loadingConfig: {
|
|
76829
|
+
text: '加载中...'
|
|
76830
|
+
},
|
|
76896
76831
|
columns: newColumns,
|
|
76897
76832
|
data,
|
|
76898
76833
|
resizableConfig: {
|
|
@@ -77549,200 +77484,6 @@ var custom_column_component = normalizeComponent(
|
|
|
77549
77484
|
});
|
|
77550
77485
|
}
|
|
77551
77486
|
},
|
|
77552
|
-
/**
|
|
77553
|
-
* 初始化自定义loading
|
|
77554
|
-
*/
|
|
77555
|
-
initCustomLoading() {
|
|
77556
|
-
if (this.loadingStyle !== 'pulse' && this.loadingStyle !== 'box') return;
|
|
77557
|
-
this.$nextTick(() => {
|
|
77558
|
-
this.updateCustomLoading();
|
|
77559
|
-
});
|
|
77560
|
-
},
|
|
77561
|
-
/**
|
|
77562
|
-
* 监听loading DOM变化,确保默认loading被隐藏
|
|
77563
|
-
*/
|
|
77564
|
-
observeLoadingChanges() {
|
|
77565
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77566
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77567
|
-
|
|
77568
|
-
// 如果已经有observer,先断开
|
|
77569
|
-
if (this.loadingObserver) {
|
|
77570
|
-
this.loadingObserver.disconnect();
|
|
77571
|
-
}
|
|
77572
|
-
|
|
77573
|
-
// 创建MutationObserver
|
|
77574
|
-
this.loadingObserver = new MutationObserver(() => {
|
|
77575
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77576
|
-
this.hideDefaultLoading();
|
|
77577
|
-
}
|
|
77578
|
-
});
|
|
77579
|
-
|
|
77580
|
-
// 开始监听
|
|
77581
|
-
this.loadingObserver.observe(gridEl, {
|
|
77582
|
-
childList: true,
|
|
77583
|
-
subtree: true
|
|
77584
|
-
});
|
|
77585
|
-
},
|
|
77586
|
-
/**
|
|
77587
|
-
* 强制隐藏默认loading
|
|
77588
|
-
*/
|
|
77589
|
-
hideDefaultLoading() {
|
|
77590
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77591
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77592
|
-
const loadingEl = gridEl.querySelector('.vxe-loading');
|
|
77593
|
-
if (!loadingEl) return;
|
|
77594
|
-
|
|
77595
|
-
// 隐藏所有可能的默认loading元素
|
|
77596
|
-
const selectors = ['.vxe-loading--spinner', '.vxe-loading--text', '.vxe-icon', 'i[class*="spinner"]', 'i[class*="loading"]', '.vxe-loading--content > *:not(.custom-loading-content)'];
|
|
77597
|
-
selectors.forEach(selector => {
|
|
77598
|
-
const elements = loadingEl.querySelectorAll(selector);
|
|
77599
|
-
elements.forEach(el => {
|
|
77600
|
-
if (!el.closest('.custom-loading-content')) {
|
|
77601
|
-
el.style.display = 'none';
|
|
77602
|
-
el.style.visibility = 'hidden';
|
|
77603
|
-
el.style.opacity = '0';
|
|
77604
|
-
}
|
|
77605
|
-
});
|
|
77606
|
-
});
|
|
77607
|
-
},
|
|
77608
|
-
/**
|
|
77609
|
-
* 更新自定义loading显示
|
|
77610
|
-
*/
|
|
77611
|
-
updateCustomLoading() {
|
|
77612
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77613
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77614
|
-
const loadingEl = gridEl.querySelector('.vxe-loading');
|
|
77615
|
-
if (!loadingEl) {
|
|
77616
|
-
// 如果loading元素不存在,延迟重试
|
|
77617
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77618
|
-
setTimeout(() => {
|
|
77619
|
-
this.updateCustomLoading();
|
|
77620
|
-
}, 100);
|
|
77621
|
-
}
|
|
77622
|
-
return;
|
|
77623
|
-
}
|
|
77624
|
-
let customLoading = loadingEl.querySelector('.custom-loading-content');
|
|
77625
|
-
|
|
77626
|
-
// 强制隐藏默认loading(只在自定义loading模式下)
|
|
77627
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77628
|
-
this.hideDefaultLoading();
|
|
77629
|
-
}
|
|
77630
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77631
|
-
if (!customLoading) {
|
|
77632
|
-
// 创建自定义loading元素
|
|
77633
|
-
customLoading = document.createElement('div');
|
|
77634
|
-
customLoading.className = 'custom-loading-content';
|
|
77635
|
-
if (this.loadingStyle === 'pulse') {
|
|
77636
|
-
var _this$gridOptions$loa;
|
|
77637
|
-
// 3D旋转圆环样式
|
|
77638
|
-
// 获取loading文案配置
|
|
77639
|
-
const loadingText = ((_this$gridOptions$loa = this.gridOptions.loadingConfig) === null || _this$gridOptions$loa === void 0 ? void 0 : _this$gridOptions$loa.text) || '加载中...';
|
|
77640
|
-
|
|
77641
|
-
// 将文案转换为字符数组
|
|
77642
|
-
const textChars = loadingText.split('');
|
|
77643
|
-
|
|
77644
|
-
// 创建容器
|
|
77645
|
-
const uiverseDiv = document.createElement('div');
|
|
77646
|
-
uiverseDiv.className = 'table-loading-pulse';
|
|
77647
|
-
const loaderContainer = document.createElement('div');
|
|
77648
|
-
loaderContainer.className = 'loader-container';
|
|
77649
|
-
|
|
77650
|
-
// 创建文字元素(使用h3标签)
|
|
77651
|
-
if (loadingText) {
|
|
77652
|
-
const textElement = document.createElement('h3');
|
|
77653
|
-
textElement.className = 'loader-text';
|
|
77654
|
-
|
|
77655
|
-
// 为每个字符创建span,并设置动画延迟
|
|
77656
|
-
textChars.forEach((char, index) => {
|
|
77657
|
-
const charSpan = document.createElement('span');
|
|
77658
|
-
charSpan.className = 'loader-char';
|
|
77659
|
-
charSpan.style.animationDelay = `${index * 0.15}s`;
|
|
77660
|
-
charSpan.textContent = char === ' ' ? '\u00A0' : char; // 使用不间断空格
|
|
77661
|
-
textElement.appendChild(charSpan);
|
|
77662
|
-
});
|
|
77663
|
-
loaderContainer.appendChild(textElement);
|
|
77664
|
-
}
|
|
77665
|
-
|
|
77666
|
-
// 添加旋转圆环
|
|
77667
|
-
for (let i = 0; i < 4; i++) {
|
|
77668
|
-
const ring = document.createElement('div');
|
|
77669
|
-
ring.className = 'loader-ring';
|
|
77670
|
-
loaderContainer.appendChild(ring);
|
|
77671
|
-
}
|
|
77672
|
-
uiverseDiv.appendChild(loaderContainer);
|
|
77673
|
-
customLoading.appendChild(uiverseDiv);
|
|
77674
|
-
} else if (this.loadingStyle === 'box') {
|
|
77675
|
-
var _this$gridOptions$loa2;
|
|
77676
|
-
// 方块变形动画样式
|
|
77677
|
-
const boxDiv = document.createElement('div');
|
|
77678
|
-
boxDiv.className = 'table-loading-box';
|
|
77679
|
-
const loader = document.createElement('div');
|
|
77680
|
-
loader.className = 'loader';
|
|
77681
|
-
|
|
77682
|
-
// 创建三个方块
|
|
77683
|
-
const box1 = document.createElement('div');
|
|
77684
|
-
box1.className = 'box1';
|
|
77685
|
-
const box2 = document.createElement('div');
|
|
77686
|
-
box2.className = 'box2';
|
|
77687
|
-
const box3 = document.createElement('div');
|
|
77688
|
-
box3.className = 'box3';
|
|
77689
|
-
loader.appendChild(box1);
|
|
77690
|
-
loader.appendChild(box2);
|
|
77691
|
-
loader.appendChild(box3);
|
|
77692
|
-
|
|
77693
|
-
// 创建容器包裹loader和文字
|
|
77694
|
-
const loaderContainer = document.createElement('div');
|
|
77695
|
-
loaderContainer.className = 'loader-container';
|
|
77696
|
-
loaderContainer.appendChild(loader);
|
|
77697
|
-
|
|
77698
|
-
// 添加文字动画(显示在下方)
|
|
77699
|
-
const loadingText = ((_this$gridOptions$loa2 = this.gridOptions.loadingConfig) === null || _this$gridOptions$loa2 === void 0 ? void 0 : _this$gridOptions$loa2.text) || '加载中...';
|
|
77700
|
-
if (loadingText) {
|
|
77701
|
-
const textChars = loadingText.split('');
|
|
77702
|
-
const textElement = document.createElement('h3');
|
|
77703
|
-
textElement.className = 'loader-text';
|
|
77704
|
-
textChars.forEach((char, index) => {
|
|
77705
|
-
const charSpan = document.createElement('span');
|
|
77706
|
-
charSpan.className = 'loader-char';
|
|
77707
|
-
charSpan.style.animationDelay = `${index * 0.1}s`;
|
|
77708
|
-
charSpan.textContent = char === ' ' ? '\u00A0' : char;
|
|
77709
|
-
textElement.appendChild(charSpan);
|
|
77710
|
-
});
|
|
77711
|
-
loaderContainer.appendChild(textElement);
|
|
77712
|
-
}
|
|
77713
|
-
boxDiv.appendChild(loaderContainer);
|
|
77714
|
-
customLoading.appendChild(boxDiv);
|
|
77715
|
-
}
|
|
77716
|
-
loadingEl.appendChild(customLoading);
|
|
77717
|
-
|
|
77718
|
-
// 确保loading在表格中央区域居中显示
|
|
77719
|
-
this.$nextTick(() => {
|
|
77720
|
-
if (customLoading) {
|
|
77721
|
-
customLoading.style.position = 'absolute';
|
|
77722
|
-
customLoading.style.top = '0';
|
|
77723
|
-
customLoading.style.left = '0';
|
|
77724
|
-
customLoading.style.right = '0';
|
|
77725
|
-
customLoading.style.bottom = '0';
|
|
77726
|
-
customLoading.style.display = 'flex';
|
|
77727
|
-
customLoading.style.justifyContent = 'center';
|
|
77728
|
-
customLoading.style.alignItems = 'center';
|
|
77729
|
-
customLoading.style.zIndex = '10001';
|
|
77730
|
-
}
|
|
77731
|
-
});
|
|
77732
|
-
|
|
77733
|
-
// 再次确保默认loading被隐藏
|
|
77734
|
-
setTimeout(() => {
|
|
77735
|
-
this.hideDefaultLoading();
|
|
77736
|
-
}, 50);
|
|
77737
|
-
} else {
|
|
77738
|
-
customLoading.style.display = 'flex';
|
|
77739
|
-
customLoading.style.visibility = 'visible';
|
|
77740
|
-
}
|
|
77741
|
-
} else if (customLoading) {
|
|
77742
|
-
// loading结束时隐藏
|
|
77743
|
-
customLoading.style.display = 'none';
|
|
77744
|
-
}
|
|
77745
|
-
},
|
|
77746
77487
|
/**
|
|
77747
77488
|
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
77748
77489
|
*/
|
|
@@ -77786,8 +77527,8 @@ var custom_column_component = normalizeComponent(
|
|
|
77786
77527
|
;
|
|
77787
77528
|
var table_component = normalizeComponent(
|
|
77788
77529
|
components_tablevue_type_script_lang_js,
|
|
77789
|
-
|
|
77790
|
-
|
|
77530
|
+
tablevue_type_template_id_35ba1298_render,
|
|
77531
|
+
tablevue_type_template_id_35ba1298_staticRenderFns,
|
|
77791
77532
|
false,
|
|
77792
77533
|
null,
|
|
77793
77534
|
null,
|