Skip to content

Commit 695bc4f

Browse files
committed
删除未使用的变量
1 parent ffb86eb commit 695bc4f

14 files changed

+34
-147
lines changed

packages/ve-table/src/body/body-checkbox-content.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import VeCheckbox from "vue-easytable/packages/ve-checkbox";
2-
import {
3-
COMPS_NAME,
4-
EMIT_EVENTS,
5-
COLUMN_TYPES,
6-
EXPAND_TRIGGER_TYPES,
7-
} from "../util/constant";
2+
import { COMPS_NAME, EMIT_EVENTS } from "../util/constant";
83
import { clsName } from "../util";
94
import emitter from "../../../src/mixins/emitter";
105
export default {
@@ -94,7 +89,7 @@ export default {
9489

9590
// selected change
9691
selectedChange(isSelected) {
97-
const { checkboxOption, rowKey, isControlledProp } = this;
92+
const { isControlledProp } = this;
9893

9994
// 非受控
10095
if (!isControlledProp) {
@@ -112,7 +107,7 @@ export default {
112107
},
113108
},
114109
render() {
115-
const { isSelected, selectedChange, label, disabled } = this;
110+
const { isSelected, selectedChange, disabled } = this;
116111

117112
const checkboxProps = {
118113
class: clsName("checkbox-wrapper"),

packages/ve-table/src/body/body-radio-content.jsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import VeRadio from "vue-easytable/packages/ve-radio";
2-
import {
3-
COMPS_NAME,
4-
EMIT_EVENTS,
5-
COLUMN_TYPES,
6-
EXPAND_TRIGGER_TYPES,
7-
} from "../util/constant";
2+
import { COMPS_NAME, EMIT_EVENTS } from "../util/constant";
83
import { clsName } from "../util";
94
import emitter from "../../../src/mixins/emitter";
105
export default {
@@ -82,7 +77,7 @@ export default {
8277

8378
// selected change
8479
selectedChange() {
85-
const { radioOption, rowKey, isControlledProp } = this;
80+
const { isControlledProp } = this;
8681

8782
// 非受控
8883
if (!isControlledProp) {
@@ -99,7 +94,7 @@ export default {
9994
},
10095
},
10196
render() {
102-
const { isSelected, selectedChange, label, disabled } = this;
97+
const { isSelected, selectedChange, disabled } = this;
10398

10499
const radioProps = {
105100
class: clsName("radio-wrapper"),

packages/ve-table/src/body/body-td.jsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
import BodyCheckboxContent from "./body-checkbox-content";
22
import BodyRadioContent from "./body-radio-content";
33
import ExpandTrIcon from "./expand-tr-icon";
4-
import { getFixedTotalWidthByColumnKey, clsName, getRowKey } from "../util";
5-
import {
6-
getValByUnit,
7-
isEmptyValue,
8-
isNumber,
9-
isBoolean,
10-
} from "../../../src/utils/index.js";
4+
import { getFixedTotalWidthByColumnKey, clsName } from "../util";
5+
import { getValByUnit, isNumber, isBoolean } from "../../../src/utils/index.js";
116

127
import {
138
COMPS_NAME,
@@ -138,7 +133,7 @@ export default {
138133

139134
const { colgroups, column } = this;
140135

141-
const { fixed, field } = column;
136+
const { fixed } = column;
142137

143138
if (fixed === "left") {
144139
const { field } = column;
@@ -161,7 +156,7 @@ export default {
161156

162157
const { colgroups, column } = this;
163158

164-
const { fixed, field } = column;
159+
const { fixed } = column;
165160

166161
if (fixed === "right") {
167162
const { field } = column;
@@ -185,7 +180,7 @@ export default {
185180

186181
let result = {};
187182

188-
const { colgroups, column } = this;
183+
const { colgroups } = this;
189184

190185
// text align
191186
result["text-align"] = align || "center";
@@ -315,7 +310,7 @@ export default {
315310

316311
// ellipisis
317312
if (column.ellipsis) {
318-
const { lineClamp, showTitle } = column.ellipsis;
313+
const { showTitle } = column.ellipsis;
319314

320315
// default true
321316
const isShowTitle = isBoolean(showTitle) ? showTitle : true;

packages/ve-table/src/body/body-tr.jsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,9 @@ export default {
194194
render() {
195195
const {
196196
colgroups,
197-
cloneTableData,
198197
expandOption,
199-
rowExpandClick,
200198
expandRowChange,
201199
isExpandRow,
202-
getExpandRowComp,
203200
expandedRowkeys,
204201
checkboxOption,
205202
rowKeyFieldName,

packages/ve-table/src/body/expand-tr-icon.jsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ export default {
4343
isExpanded() {
4444
let result = false;
4545

46-
const {
47-
column,
48-
expandOption,
49-
rowData,
50-
expandedRowkeys,
51-
rowKeyFieldName,
52-
} = this;
46+
const { column, rowData, expandedRowkeys, rowKeyFieldName } = this;
5347

5448
if (column.type === COLUMN_TYPES.EXPAND) {
5549
const rowKey = rowData[rowKeyFieldName];

packages/ve-table/src/body/expand-tr.jsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { clsName } from "../util";
22
import { store } from "../util/store";
3-
import { COMPS_NAME, COLUMN_TYPES } from "../util/constant";
3+
import { COMPS_NAME } from "../util/constant";
44
import emitter from "../../../src/mixins/emitter";
55

66
export default {
@@ -122,13 +122,7 @@ export default {
122122
},
123123
},
124124
render(h) {
125-
const {
126-
isRowExpanded,
127-
columnCount,
128-
getExpandRowContent,
129-
expanRowStyle,
130-
expandTdClass,
131-
} = this;
125+
const { isRowExpanded, columnCount, getExpandRowContent } = this;
132126

133127
let result = null;
134128

packages/ve-table/src/body/index.jsx

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import BodyTr from "./body-tr";
22
import ExpandTr from "./expand-tr";
33
import VueDomResizeObserver from "../../../src/comps/resize-observer";
4-
import { clsName, getDomResizeObserverCompKey } from "../util";
5-
import { getValByUnit } from "../../../src/utils/index.js";
4+
import { getDomResizeObserverCompKey } from "../util";
65
import emitter from "../../../src/mixins/emitter";
76
import {
87
COMPS_NAME,
@@ -252,11 +251,7 @@ export default {
252251
},
253252
// is checkbox indeterminate
254253
isCheckboxIndeterminate() {
255-
const {
256-
internalCheckboxSelectedRowKeys,
257-
isCheckboxSelectedAll,
258-
allRowKeys,
259-
} = this;
254+
const { internalCheckboxSelectedRowKeys, allRowKeys } = this;
260255

261256
return (
262257
internalCheckboxSelectedRowKeys.length > 0 &&
@@ -283,7 +278,7 @@ export default {
283278
},
284279
// watch expandOption expandedRowKeys
285280
"expandOption.expandedRowKeys": {
286-
handler: function (val) {
281+
handler: function () {
287282
this.initInternalExpandRowKeys();
288283
},
289284
},
@@ -296,7 +291,7 @@ export default {
296291
},
297292
// watch selectedRowKeys
298293
"checkboxOption.selectedRowKeys": {
299-
handler: function (val) {
294+
handler: function () {
300295
this.resetInternalCheckboxSelectedRowKeys();
301296
},
302297
},
@@ -316,7 +311,7 @@ export default {
316311
},
317312
// watch selectedRowKeys
318313
"radioOption.selectedRowKey": {
319-
handler: function (val) {
314+
handler: function () {
320315
this.initInternalRadioSelectedRowKey();
321316
},
322317
},
@@ -341,7 +336,6 @@ export default {
341336
expandOption,
342337
internalExpandRowkeys,
343338
expandedRowkeys,
344-
isControlledExpand,
345339
rowKeyFieldName,
346340
} = this;
347341

@@ -386,7 +380,6 @@ export default {
386380
*/
387381
rowClick({ rowData, rowIndex }) {
388382
const {
389-
column,
390383
expandOption,
391384
isExpandRow,
392385
expandRowChange,
@@ -449,7 +442,7 @@ export default {
449442
isExpandRow({ rowData, rowIndex }) {
450443
let result = false;
451444

452-
const { colgroups, expandColumn, expandOption } = this;
445+
const { expandColumn, expandOption } = this;
453446

454447
if (expandColumn && expandOption) {
455448
// 是否允许展开
@@ -507,13 +500,7 @@ export default {
507500

508501
// init internal expand row keys
509502
initInternalExpandRowKeys() {
510-
const {
511-
expandOption,
512-
cloneTableData,
513-
isControlledExpand,
514-
rowKeyFieldName,
515-
allRowKeys,
516-
} = this;
503+
const { expandOption, isControlledExpand, allRowKeys } = this;
517504

518505
if (!expandOption) {
519506
return false;
@@ -585,7 +572,7 @@ export default {
585572
// init internal Checkbox SelectedRowKeys
586573
initInternalCheckboxSelectedRowKeys() {
587574
let result = [];
588-
const { checkboxOption, rowData, allRowKeys } = this;
575+
const { checkboxOption, allRowKeys } = this;
589576

590577
if (!checkboxOption) {
591578
return false;
@@ -785,7 +772,6 @@ export default {
785772
colgroups,
786773
actualRenderTableData,
787774
expandOption,
788-
rowClick,
789775
expandRowChange,
790776
isExpandRow,
791777
getExpandRowComp,

packages/ve-table/src/footer/footer-td.jsx

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import { getFixedTotalWidthByColumnKey, clsName } from "../util";
22
import { getValByUnit } from "../../../src/utils/index.js";
33

4-
import {
5-
COMPS_NAME,
6-
COLUMN_TYPES,
7-
EXPAND_TRIGGER_TYPES,
8-
EMIT_EVENTS,
9-
} from "../util/constant";
4+
import { COMPS_NAME } from "../util/constant";
105
import emitter from "../../../src/mixins/emitter";
116

127
export default {
@@ -81,7 +76,7 @@ export default {
8176

8277
const { colgroups, column } = this;
8378

84-
const { fixed, field } = column;
79+
const { fixed } = column;
8580

8681
if (fixed === "left") {
8782
const { field } = column;
@@ -104,7 +99,7 @@ export default {
10499

105100
const { colgroups, column } = this;
106101

107-
const { fixed, field } = column;
102+
const { fixed } = column;
108103

109104
if (fixed === "right") {
110105
const { field } = column;
@@ -306,29 +301,7 @@ export default {
306301
},
307302
},
308303
render(h) {
309-
const {
310-
column,
311-
cellClick,
312-
rowData,
313-
isExpandRow,
314-
expandOption,
315-
expandedRowkeys,
316-
rowKeyFieldName,
317-
rowIndex,
318-
eventCustomOption,
319-
} = this;
320-
321-
// expand icon props
322-
const expandIconProps = {
323-
props: {
324-
rowData,
325-
column,
326-
expandOption,
327-
expandedRowkeys,
328-
rowKeyFieldName,
329-
cellClick,
330-
},
331-
};
304+
const { column, rowData, rowIndex, eventCustomOption } = this;
332305

333306
const { rowspan, colspan } = this.getCellSpan();
334307
if (!rowspan || !colspan) {

packages/ve-table/src/footer/footer-tr.jsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,6 @@ export default {
108108
rowClick(e, fn) {
109109
fn && fn(e);
110110

111-
const { rowData, rowIndex } = this;
112-
113111
/* this.dispatch(COMPS_NAME.VE_TABLE_BODY, EMIT_EVENTS.BODY_TR_CLICK, {
114112
rowData,
115113
rowIndex
@@ -136,20 +134,9 @@ export default {
136134
render() {
137135
const {
138136
colgroups,
139-
cloneTableData,
140-
expandOption,
141-
rowExpandClick,
142-
expandRowChange,
143-
isExpandRow,
144-
getExpandRowComp,
145-
expandedRowkeys,
146-
checkboxOption,
147137
rowKeyFieldName,
148138
rowIndex,
149139
rowData,
150-
internalCheckboxSelectedRowKeys,
151-
internalRadioSelectedRowKey,
152-
radioOption,
153140
cellStyleOption,
154141
eventCustomOption,
155142
} = this;
@@ -177,8 +164,6 @@ export default {
177164
});
178165
};
179166

180-
let result = null;
181-
182167
// custom on row event
183168
let customEvents = {};
184169
if (eventCustomOption) {

packages/ve-table/src/header/header-checkbox-content.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import VeCheckbox from "vue-easytable/packages/ve-checkbox";
2-
import {
3-
COMPS_NAME,
4-
EMIT_EVENTS,
5-
COLUMN_TYPES,
6-
EXPAND_TRIGGER_TYPES,
7-
} from "../util/constant";
2+
import { COMPS_NAME, EMIT_EVENTS } from "../util/constant";
83
import { clsName } from "../util";
94
import emitter from "../../../src/mixins/emitter";
105
export default {
@@ -30,9 +25,6 @@ export default {
3025
methods: {
3126
// selected change
3227
selectedChange(isSelected) {
33-
const { checkboxOption } = this;
34-
const { selectedRowKeys } = checkboxOption;
35-
3628
this.isSelected = isSelected;
3729

3830
this.dispatch(

0 commit comments

Comments
 (0)