Skip to content

Commit 3f652d9

Browse files
author
KevinMint55
committed
- 修复数据修改时固定列高度计算赋值问题
- removeItems删除不能删除索引为0时的问题
1 parent 3098030 commit 3f652d9

File tree

8 files changed

+19
-21
lines changed

8 files changed

+19
-21
lines changed

config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
build: {
1111
assetsRoot: path.resolve(__dirname, './demo'),
1212
assetsPublicPath: '/',
13-
bundleAnalyzerReport: true
13+
bundleAnalyzerReport: false
1414
},
1515
release: {
1616
assetsRoot: path.resolve(__dirname, './dist'),

dist/km-excel.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/km-excel.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/App.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import axios from 'axios';
2727
import { button } from 'element-ui';
2828
import Excel from '../src/components/Excel.vue';
2929
// import Excel from '../dist/km-excel.min';
30-
import '../dist/km-excel.min.css';
30+
// import '../dist/km-excel.min.css';
3131
3232
export default {
3333
name: 'App',

example/mock.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Mock from 'mockjs';
22

33
Mock.mock('https://demo.kevinmint.com/1.json', 'get', {
44
// 属性 list 的值是一个数组,其中含有 1 到 3 个元素
5-
'list|5': [{
5+
'list|50': [{
66
// 属性 sid 是一个自增数,起始值为 1,每次增 1
77
'sid|+1': 1,
88
// 属性 userId 是一个5位的随机码

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "km-excel",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "在线编辑excel组件",
55
"author": "kevinmint55 <943642973@qq.com>",
66
"private": false,

src/components/Excel.vue

+11-11
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ export default {
178178
if (!this.initialData) {
179179
this.initData();
180180
}
181-
this.handleResize();
182181
this.handleFilters();
183182
this.handleChangeData();
184-
this.handleErrors();
183+
// this.handleErrors();
184+
this.handleResize();
185185
},
186186
deep: true,
187187
},
@@ -332,13 +332,15 @@ export default {
332332
this.theaderHeight = this.$refs.theaderContent.$el.offsetHeight;
333333
334334
// 设置左侧定位高度
335-
if (this.tableWidth > this.wrapperWidth) {
336-
this.$refs.fixedWrapper.style.height = `${this.$refs.wrapper.offsetHeight - scrollBarWidth}px`;
337-
this.$refs.fixedTbody.style.height = `${this.$refs.wrapper.offsetHeight - scrollBarWidth - this.theaderHeight}px`;
338-
} else {
339-
this.$refs.fixedWrapper.style.height = `${this.$refs.wrapper.offsetHeight}px`;
340-
this.$refs.fixedTbody.style.height = `${this.$refs.wrapper.offsetHeight - this.theaderHeight}px`;
341-
}
335+
this.$nextTick(() => {
336+
if (this.tableWidth > this.wrapperWidth) {
337+
this.$refs.fixedWrapper.style.height = `${this.$refs.wrapper.offsetHeight - scrollBarWidth}px`;
338+
this.$refs.fixedTbody.style.height = `${this.$refs.wrapper.offsetHeight - scrollBarWidth - this.theaderHeight}px`;
339+
} else {
340+
this.$refs.fixedWrapper.style.height = `${this.$refs.wrapper.offsetHeight}px`;
341+
this.$refs.fixedTbody.style.height = `${this.$refs.wrapper.offsetHeight - this.theaderHeight}px`;
342+
}
343+
});
342344
// 当出现竖向滚动条时处理滚动条
343345
if (this.$refs.tbodyContent.$el.offsetHeight > this.maxHeight) {
344346
this.$refs.tbody.style.overflowY = 'auto';
@@ -712,8 +714,6 @@ export default {
712714
this.curHisory += 1;
713715
}
714716
this.isOperation = true;
715-
// if (this.data.length != JSON.parse(this.historyData[this.curHisory - 1]).length) {
716-
// }
717717
JSON.parse(this.historyData[this.curHisory - 1]).forEach((i, index) => {
718718
Object.keys(i).forEach((j) => {
719719
this.data[index][j] = i[j];

src/mixins/methods.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ export default {
3232
if (key && values instanceof Array) {
3333
values.forEach((value) => {
3434
const dIndex = this.data.findIndex(d => d[key] === value);
35-
if (dIndex) {
36-
this.dataStatusList.splice(dIndex, 1);
37-
this.data.splice(dIndex, 1);
38-
}
35+
this.dataStatusList.splice(dIndex, 1);
36+
this.data.splice(dIndex, 1);
3937
});
4038
}
4139
},

0 commit comments

Comments
 (0)