@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
package/lib/by-components.umd.js
CHANGED
|
@@ -74534,18 +74534,11 @@ var component = normalizeComponent(
|
|
|
74534
74534
|
)
|
|
74535
74535
|
|
|
74536
74536
|
/* harmony default export */ var pager = (component.exports);
|
|
74537
|
-
;// ./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-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/table/index.vue?vue&type=template&id=
|
|
74538
|
-
var
|
|
74537
|
+
;// ./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-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/table/index.vue?vue&type=template&id=35ba1298
|
|
74538
|
+
var tablevue_type_template_id_35ba1298_render = function render() {
|
|
74539
74539
|
var _vm = this,
|
|
74540
74540
|
_c = _vm._self._c;
|
|
74541
|
-
return _c('div', {
|
|
74542
|
-
staticClass: "by-table-wrapper",
|
|
74543
|
-
class: {
|
|
74544
|
-
'custom-loading-mode': (_vm.loadingStyle === 'pulse' || _vm.loadingStyle === 'box') && _vm.loading
|
|
74545
|
-
}
|
|
74546
|
-
}, [_c('div', {
|
|
74547
|
-
staticClass: "vxe-grid-wrapper"
|
|
74548
|
-
}, [_c('vxe-grid', _vm._g(_vm._b({
|
|
74541
|
+
return _c('div', [_c('vxe-grid', _vm._g(_vm._b({
|
|
74549
74542
|
ref: "xGrid",
|
|
74550
74543
|
on: {
|
|
74551
74544
|
"cell-click": _vm.handleCellClick,
|
|
@@ -74607,7 +74600,7 @@ var tablevue_type_template_id_23b79ced_render = function render() {
|
|
|
74607
74600
|
},
|
|
74608
74601
|
proxy: true
|
|
74609
74602
|
}], null, true)
|
|
74610
|
-
}, 'vxe-grid', _vm.options, false), _vm.eventListeners))
|
|
74603
|
+
}, 'vxe-grid', _vm.options, false), _vm.eventListeners)), _vm.gridOptions && _vm.gridOptions.customColumnConfig && _vm.gridOptions.customColumnConfig.showCustomColumn ? _c('CustomColumn', {
|
|
74611
74604
|
ref: "CustomColumnRef",
|
|
74612
74605
|
attrs: {
|
|
74613
74606
|
"info-method": _vm.gridOptions.customColumnConfig.infoMethod,
|
|
@@ -74626,7 +74619,7 @@ var tablevue_type_template_id_23b79ced_render = function render() {
|
|
|
74626
74619
|
}
|
|
74627
74620
|
}) : _vm._e()], 1);
|
|
74628
74621
|
};
|
|
74629
|
-
var
|
|
74622
|
+
var tablevue_type_template_id_35ba1298_staticRenderFns = [];
|
|
74630
74623
|
|
|
74631
74624
|
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
|
74632
74625
|
var es_array_push = __webpack_require__(4114);
|
|
@@ -76672,14 +76665,6 @@ var custom_column_component = normalizeComponent(
|
|
|
76672
76665
|
loading: {
|
|
76673
76666
|
type: Boolean,
|
|
76674
76667
|
default: false
|
|
76675
|
-
},
|
|
76676
|
-
loadingStyle: {
|
|
76677
|
-
// loading样式类型:'pulse' 3D旋转圆环样式(默认),'box' 方块变形动画样式,'default' 使用vxe-table默认样式
|
|
76678
|
-
type: String,
|
|
76679
|
-
default: 'default',
|
|
76680
|
-
validator(value) {
|
|
76681
|
-
return ['pulse', 'box', 'default'].includes(value);
|
|
76682
|
-
}
|
|
76683
76668
|
}
|
|
76684
76669
|
},
|
|
76685
76670
|
data() {
|
|
@@ -76708,9 +76693,7 @@ var custom_column_component = normalizeComponent(
|
|
|
76708
76693
|
tableWidth: 1200,
|
|
76709
76694
|
// 默认值,将在客户端初始化
|
|
76710
76695
|
// 是否为移动设备
|
|
76711
|
-
isMobile: false
|
|
76712
|
-
// MutationObserver实例
|
|
76713
|
-
loadingObserver: null
|
|
76696
|
+
isMobile: false
|
|
76714
76697
|
};
|
|
76715
76698
|
},
|
|
76716
76699
|
mounted() {
|
|
@@ -76724,52 +76707,14 @@ var custom_column_component = normalizeComponent(
|
|
|
76724
76707
|
|
|
76725
76708
|
// 前端分页模式下初始化默认排序
|
|
76726
76709
|
this.initDefaultSortForFrontendPagination();
|
|
76727
|
-
|
|
76728
|
-
// 初始化自定义loading
|
|
76729
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76730
|
-
this.$nextTick(() => {
|
|
76731
|
-
this.initCustomLoading();
|
|
76732
|
-
// 使用MutationObserver监听DOM变化,确保默认loading被隐藏
|
|
76733
|
-
if (this.$refs.xGrid && this.$refs.xGrid.$el) {
|
|
76734
|
-
this.observeLoadingChanges();
|
|
76735
|
-
}
|
|
76736
|
-
});
|
|
76737
|
-
}
|
|
76738
76710
|
},
|
|
76739
76711
|
beforeDestroy() {
|
|
76740
76712
|
// 确保只在客户端环境中移除事件监听
|
|
76741
76713
|
if (typeof window !== 'undefined') {
|
|
76742
76714
|
this.removeResizeListener();
|
|
76743
|
-
// 清理MutationObserver
|
|
76744
|
-
if (this.loadingObserver) {
|
|
76745
|
-
this.loadingObserver.disconnect();
|
|
76746
|
-
this.loadingObserver = null;
|
|
76747
|
-
}
|
|
76748
76715
|
}
|
|
76749
76716
|
},
|
|
76750
76717
|
watch: {
|
|
76751
|
-
loading(newVal) {
|
|
76752
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76753
|
-
this.$nextTick(() => {
|
|
76754
|
-
this.updateCustomLoading();
|
|
76755
|
-
});
|
|
76756
|
-
}
|
|
76757
|
-
},
|
|
76758
|
-
loadingStyle() {
|
|
76759
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76760
|
-
this.$nextTick(() => {
|
|
76761
|
-
this.updateCustomLoading();
|
|
76762
|
-
});
|
|
76763
|
-
} else {
|
|
76764
|
-
// 切换到default样式时,移除自定义loading
|
|
76765
|
-
if (this.$refs.xGrid && this.$refs.xGrid.$el) {
|
|
76766
|
-
const customLoading = this.$refs.xGrid.$el.querySelector('.custom-loading-content');
|
|
76767
|
-
if (customLoading) {
|
|
76768
|
-
customLoading.remove();
|
|
76769
|
-
}
|
|
76770
|
-
}
|
|
76771
|
-
}
|
|
76772
|
-
},
|
|
76773
76718
|
'gridOptions.columns': {
|
|
76774
76719
|
handler(newColumns) {
|
|
76775
76720
|
//这里保存的列宽要恢复至最初未拖动时的列宽
|
|
@@ -76890,19 +76835,9 @@ var custom_column_component = normalizeComponent(
|
|
|
76890
76835
|
copyFields: this.gridOptions.copyFields || [],
|
|
76891
76836
|
emptyText: this.gridOptions.emptyText || '暂无数据',
|
|
76892
76837
|
loading: this.loading,
|
|
76893
|
-
loadingConfig:
|
|
76894
|
-
|
|
76895
|
-
|
|
76896
|
-
};
|
|
76897
|
-
// 如果使用自定义loading样式,隐藏默认的loading文字和图标
|
|
76898
|
-
if (this.loadingStyle === 'pulse' || this.loadingStyle === 'box') {
|
|
76899
|
-
baseConfig.text = null;
|
|
76900
|
-
baseConfig.icon = null;
|
|
76901
|
-
} else {
|
|
76902
|
-
baseConfig.text = baseConfig.text || '加载中...';
|
|
76903
|
-
}
|
|
76904
|
-
return baseConfig;
|
|
76905
|
-
})(),
|
|
76838
|
+
loadingConfig: {
|
|
76839
|
+
text: '加载中...'
|
|
76840
|
+
},
|
|
76906
76841
|
columns: newColumns,
|
|
76907
76842
|
data,
|
|
76908
76843
|
resizableConfig: {
|
|
@@ -77559,200 +77494,6 @@ var custom_column_component = normalizeComponent(
|
|
|
77559
77494
|
});
|
|
77560
77495
|
}
|
|
77561
77496
|
},
|
|
77562
|
-
/**
|
|
77563
|
-
* 初始化自定义loading
|
|
77564
|
-
*/
|
|
77565
|
-
initCustomLoading() {
|
|
77566
|
-
if (this.loadingStyle !== 'pulse' && this.loadingStyle !== 'box') return;
|
|
77567
|
-
this.$nextTick(() => {
|
|
77568
|
-
this.updateCustomLoading();
|
|
77569
|
-
});
|
|
77570
|
-
},
|
|
77571
|
-
/**
|
|
77572
|
-
* 监听loading DOM变化,确保默认loading被隐藏
|
|
77573
|
-
*/
|
|
77574
|
-
observeLoadingChanges() {
|
|
77575
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77576
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77577
|
-
|
|
77578
|
-
// 如果已经有observer,先断开
|
|
77579
|
-
if (this.loadingObserver) {
|
|
77580
|
-
this.loadingObserver.disconnect();
|
|
77581
|
-
}
|
|
77582
|
-
|
|
77583
|
-
// 创建MutationObserver
|
|
77584
|
-
this.loadingObserver = new MutationObserver(() => {
|
|
77585
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77586
|
-
this.hideDefaultLoading();
|
|
77587
|
-
}
|
|
77588
|
-
});
|
|
77589
|
-
|
|
77590
|
-
// 开始监听
|
|
77591
|
-
this.loadingObserver.observe(gridEl, {
|
|
77592
|
-
childList: true,
|
|
77593
|
-
subtree: true
|
|
77594
|
-
});
|
|
77595
|
-
},
|
|
77596
|
-
/**
|
|
77597
|
-
* 强制隐藏默认loading
|
|
77598
|
-
*/
|
|
77599
|
-
hideDefaultLoading() {
|
|
77600
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77601
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77602
|
-
const loadingEl = gridEl.querySelector('.vxe-loading');
|
|
77603
|
-
if (!loadingEl) return;
|
|
77604
|
-
|
|
77605
|
-
// 隐藏所有可能的默认loading元素
|
|
77606
|
-
const selectors = ['.vxe-loading--spinner', '.vxe-loading--text', '.vxe-icon', 'i[class*="spinner"]', 'i[class*="loading"]', '.vxe-loading--content > *:not(.custom-loading-content)'];
|
|
77607
|
-
selectors.forEach(selector => {
|
|
77608
|
-
const elements = loadingEl.querySelectorAll(selector);
|
|
77609
|
-
elements.forEach(el => {
|
|
77610
|
-
if (!el.closest('.custom-loading-content')) {
|
|
77611
|
-
el.style.display = 'none';
|
|
77612
|
-
el.style.visibility = 'hidden';
|
|
77613
|
-
el.style.opacity = '0';
|
|
77614
|
-
}
|
|
77615
|
-
});
|
|
77616
|
-
});
|
|
77617
|
-
},
|
|
77618
|
-
/**
|
|
77619
|
-
* 更新自定义loading显示
|
|
77620
|
-
*/
|
|
77621
|
-
updateCustomLoading() {
|
|
77622
|
-
if (!this.$refs.xGrid || !this.$refs.xGrid.$el) return;
|
|
77623
|
-
const gridEl = this.$refs.xGrid.$el;
|
|
77624
|
-
const loadingEl = gridEl.querySelector('.vxe-loading');
|
|
77625
|
-
if (!loadingEl) {
|
|
77626
|
-
// 如果loading元素不存在,延迟重试
|
|
77627
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77628
|
-
setTimeout(() => {
|
|
77629
|
-
this.updateCustomLoading();
|
|
77630
|
-
}, 100);
|
|
77631
|
-
}
|
|
77632
|
-
return;
|
|
77633
|
-
}
|
|
77634
|
-
let customLoading = loadingEl.querySelector('.custom-loading-content');
|
|
77635
|
-
|
|
77636
|
-
// 强制隐藏默认loading(只在自定义loading模式下)
|
|
77637
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77638
|
-
this.hideDefaultLoading();
|
|
77639
|
-
}
|
|
77640
|
-
if (this.loading && (this.loadingStyle === 'pulse' || this.loadingStyle === 'box')) {
|
|
77641
|
-
if (!customLoading) {
|
|
77642
|
-
// 创建自定义loading元素
|
|
77643
|
-
customLoading = document.createElement('div');
|
|
77644
|
-
customLoading.className = 'custom-loading-content';
|
|
77645
|
-
if (this.loadingStyle === 'pulse') {
|
|
77646
|
-
var _this$gridOptions$loa;
|
|
77647
|
-
// 3D旋转圆环样式
|
|
77648
|
-
// 获取loading文案配置
|
|
77649
|
-
const loadingText = ((_this$gridOptions$loa = this.gridOptions.loadingConfig) === null || _this$gridOptions$loa === void 0 ? void 0 : _this$gridOptions$loa.text) || '加载中...';
|
|
77650
|
-
|
|
77651
|
-
// 将文案转换为字符数组
|
|
77652
|
-
const textChars = loadingText.split('');
|
|
77653
|
-
|
|
77654
|
-
// 创建容器
|
|
77655
|
-
const uiverseDiv = document.createElement('div');
|
|
77656
|
-
uiverseDiv.className = 'table-loading-pulse';
|
|
77657
|
-
const loaderContainer = document.createElement('div');
|
|
77658
|
-
loaderContainer.className = 'loader-container';
|
|
77659
|
-
|
|
77660
|
-
// 创建文字元素(使用h3标签)
|
|
77661
|
-
if (loadingText) {
|
|
77662
|
-
const textElement = document.createElement('h3');
|
|
77663
|
-
textElement.className = 'loader-text';
|
|
77664
|
-
|
|
77665
|
-
// 为每个字符创建span,并设置动画延迟
|
|
77666
|
-
textChars.forEach((char, index) => {
|
|
77667
|
-
const charSpan = document.createElement('span');
|
|
77668
|
-
charSpan.className = 'loader-char';
|
|
77669
|
-
charSpan.style.animationDelay = `${index * 0.15}s`;
|
|
77670
|
-
charSpan.textContent = char === ' ' ? '\u00A0' : char; // 使用不间断空格
|
|
77671
|
-
textElement.appendChild(charSpan);
|
|
77672
|
-
});
|
|
77673
|
-
loaderContainer.appendChild(textElement);
|
|
77674
|
-
}
|
|
77675
|
-
|
|
77676
|
-
// 添加旋转圆环
|
|
77677
|
-
for (let i = 0; i < 4; i++) {
|
|
77678
|
-
const ring = document.createElement('div');
|
|
77679
|
-
ring.className = 'loader-ring';
|
|
77680
|
-
loaderContainer.appendChild(ring);
|
|
77681
|
-
}
|
|
77682
|
-
uiverseDiv.appendChild(loaderContainer);
|
|
77683
|
-
customLoading.appendChild(uiverseDiv);
|
|
77684
|
-
} else if (this.loadingStyle === 'box') {
|
|
77685
|
-
var _this$gridOptions$loa2;
|
|
77686
|
-
// 方块变形动画样式
|
|
77687
|
-
const boxDiv = document.createElement('div');
|
|
77688
|
-
boxDiv.className = 'table-loading-box';
|
|
77689
|
-
const loader = document.createElement('div');
|
|
77690
|
-
loader.className = 'loader';
|
|
77691
|
-
|
|
77692
|
-
// 创建三个方块
|
|
77693
|
-
const box1 = document.createElement('div');
|
|
77694
|
-
box1.className = 'box1';
|
|
77695
|
-
const box2 = document.createElement('div');
|
|
77696
|
-
box2.className = 'box2';
|
|
77697
|
-
const box3 = document.createElement('div');
|
|
77698
|
-
box3.className = 'box3';
|
|
77699
|
-
loader.appendChild(box1);
|
|
77700
|
-
loader.appendChild(box2);
|
|
77701
|
-
loader.appendChild(box3);
|
|
77702
|
-
|
|
77703
|
-
// 创建容器包裹loader和文字
|
|
77704
|
-
const loaderContainer = document.createElement('div');
|
|
77705
|
-
loaderContainer.className = 'loader-container';
|
|
77706
|
-
loaderContainer.appendChild(loader);
|
|
77707
|
-
|
|
77708
|
-
// 添加文字动画(显示在下方)
|
|
77709
|
-
const loadingText = ((_this$gridOptions$loa2 = this.gridOptions.loadingConfig) === null || _this$gridOptions$loa2 === void 0 ? void 0 : _this$gridOptions$loa2.text) || '加载中...';
|
|
77710
|
-
if (loadingText) {
|
|
77711
|
-
const textChars = loadingText.split('');
|
|
77712
|
-
const textElement = document.createElement('h3');
|
|
77713
|
-
textElement.className = 'loader-text';
|
|
77714
|
-
textChars.forEach((char, index) => {
|
|
77715
|
-
const charSpan = document.createElement('span');
|
|
77716
|
-
charSpan.className = 'loader-char';
|
|
77717
|
-
charSpan.style.animationDelay = `${index * 0.1}s`;
|
|
77718
|
-
charSpan.textContent = char === ' ' ? '\u00A0' : char;
|
|
77719
|
-
textElement.appendChild(charSpan);
|
|
77720
|
-
});
|
|
77721
|
-
loaderContainer.appendChild(textElement);
|
|
77722
|
-
}
|
|
77723
|
-
boxDiv.appendChild(loaderContainer);
|
|
77724
|
-
customLoading.appendChild(boxDiv);
|
|
77725
|
-
}
|
|
77726
|
-
loadingEl.appendChild(customLoading);
|
|
77727
|
-
|
|
77728
|
-
// 确保loading在表格中央区域居中显示
|
|
77729
|
-
this.$nextTick(() => {
|
|
77730
|
-
if (customLoading) {
|
|
77731
|
-
customLoading.style.position = 'absolute';
|
|
77732
|
-
customLoading.style.top = '0';
|
|
77733
|
-
customLoading.style.left = '0';
|
|
77734
|
-
customLoading.style.right = '0';
|
|
77735
|
-
customLoading.style.bottom = '0';
|
|
77736
|
-
customLoading.style.display = 'flex';
|
|
77737
|
-
customLoading.style.justifyContent = 'center';
|
|
77738
|
-
customLoading.style.alignItems = 'center';
|
|
77739
|
-
customLoading.style.zIndex = '10001';
|
|
77740
|
-
}
|
|
77741
|
-
});
|
|
77742
|
-
|
|
77743
|
-
// 再次确保默认loading被隐藏
|
|
77744
|
-
setTimeout(() => {
|
|
77745
|
-
this.hideDefaultLoading();
|
|
77746
|
-
}, 50);
|
|
77747
|
-
} else {
|
|
77748
|
-
customLoading.style.display = 'flex';
|
|
77749
|
-
customLoading.style.visibility = 'visible';
|
|
77750
|
-
}
|
|
77751
|
-
} else if (customLoading) {
|
|
77752
|
-
// loading结束时隐藏
|
|
77753
|
-
customLoading.style.display = 'none';
|
|
77754
|
-
}
|
|
77755
|
-
},
|
|
77756
77497
|
/**
|
|
77757
77498
|
* 确保默认排序高亮(数据变化时调用,支持前端分页和虚拟滚动)
|
|
77758
77499
|
*/
|
|
@@ -77796,8 +77537,8 @@ var custom_column_component = normalizeComponent(
|
|
|
77796
77537
|
;
|
|
77797
77538
|
var table_component = normalizeComponent(
|
|
77798
77539
|
components_tablevue_type_script_lang_js,
|
|
77799
|
-
|
|
77800
|
-
|
|
77540
|
+
tablevue_type_template_id_35ba1298_render,
|
|
77541
|
+
tablevue_type_template_id_35ba1298_staticRenderFns,
|
|
77801
77542
|
false,
|
|
77802
77543
|
null,
|
|
77803
77544
|
null,
|