From dc1059e9d5a9d299a9fe524678da1424eef454e9 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Thu, 3 Nov 2022 09:33:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90JVxeTable=E3=80=91=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=9B=B4=E6=94=B9columns=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=90=8D=E4=B8=8D=E8=83=BD=E4=BB=A5=E4=B8=8B=E5=88=92=E7=BA=BF?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/JVxeTable/components/JVxeTable.js | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/components/jeecg/JVxeTable/components/JVxeTable.js b/src/components/jeecg/JVxeTable/components/JVxeTable.js index bf9b134..b9018d2 100644 --- a/src/components/jeecg/JVxeTable/components/JVxeTable.js +++ b/src/components/jeecg/JVxeTable/components/JVxeTable.js @@ -107,9 +107,9 @@ export default { // caseId,表格唯一标识 caseId: `_j-vxe-${randomString(8)}_`, // 内置columns - _innerColumns: [], + innerColumns: [], // 内置 EditRules - _innerEditRules: [], + innerEditRules: [], // 记录滚动条位置 scroll: {top: 0, left: 0}, // 当前是否正在滚动 @@ -156,14 +156,14 @@ export default { excludeCode:[], // 联动下拉选项(用于隔离不同的下拉选项) // 内部联动配置,map - _innerLinkageConfig: null, + innerLinkageConfig: null, } }, computed: { // vxe 最终 columns vxeColumns() { - this._innerColumns.forEach(column => { + this.innerColumns.forEach(column => { let renderOptions = { caseId: this.caseId, bordered: this.bordered, @@ -184,11 +184,11 @@ export default { } } // 处理联动列,联动列只能作用于 select 组件 - if (column.$type === JVXETypes.select && this._innerLinkageConfig != null) { + if (column.$type === JVXETypes.select && this.innerLinkageConfig != null) { // 判断当前列是否是联动列 - if (this._innerLinkageConfig.has(column.key)) { + if (this.innerLinkageConfig.has(column.key)) { renderOptions.linkage = { - config: this._innerLinkageConfig.get(column.key), + config: this.innerLinkageConfig.get(column.key), getLinkageOptionsSibling: this.getLinkageOptionsSibling, getLinkageOptionsAsync: this.getLinkageOptionsAsync, linkageSelectChange: this.linkageSelectChange, @@ -224,11 +224,11 @@ export default { } // update--end--autor:lvdandan-----date:20201211------for:JT-118 【online】 日期、时间控件长度较小 }) - return this._innerColumns + return this.innerColumns }, // vxe 最终 editRules vxeEditRules() { - return Object.assign({}, this.editRules, this._innerEditRules) + return Object.assign({}, this.editRules, this.innerEditRules) }, // vxe 最终 props vxeProps() { @@ -302,8 +302,8 @@ export default { this.$set(data, this.dragSortKey, idx + 1) } // 处理联动回显数据 - if (this._innerLinkageConfig != null) { - for (let configItem of this._innerLinkageConfig.values()) { + if (this.innerLinkageConfig != null) { + for (let configItem of this.innerLinkageConfig.values()) { this.autoSetLinkageOptionsByData(data, '', configItem, 0) } } @@ -341,8 +341,8 @@ export default { handler(columns) { //获取不需要显示列 this.loadExcludeCode() - let _innerColumns = [] - let _innerEditRules = {} + let innerColumns = [] + let innerEditRules = {} let {rowNumber, rowSelection, rowExpand, dragSort} = this let expandColumn, seqColumn, checkboxColumn, radioColumn, dragSortColumn if (Array.isArray(columns)) { @@ -422,7 +422,7 @@ export default { rules.push(Object.assign({}, rule, replace)) } } - _innerEditRules[col.key] = rules + innerEditRules[col.key] = rules } // 处理统计列 // sum = 求和、average = 平均值 @@ -435,7 +435,7 @@ export default { } }) } - _innerColumns.push(col) + innerColumns.push(col) } }) } @@ -445,7 +445,7 @@ export default { if (seqColumn) { col = Object.assign(col, seqColumn, {type: 'seq'}) } - _innerColumns.unshift(col) + innerColumns.unshift(col) } // 判断是否开启了可选择行 if (rowSelection) { @@ -462,7 +462,7 @@ export default { if (this.rowSelectionType === 'checkbox' && checkboxColumn) { col = Object.assign(col, checkboxColumn, {type: 'checkbox'}) } - _innerColumns.unshift(col) + innerColumns.unshift(col) } // 是否可展开行 if (rowExpand) { @@ -474,7 +474,7 @@ export default { if (expandColumn) { col = Object.assign(col, expandColumn, {type: 'expand'}) } - _innerColumns.unshift(col) + innerColumns.unshift(col) } // 是否可拖动排序 if (dragSort) { @@ -486,11 +486,11 @@ export default { if (dragSortColumn) { col = Object.assign(col, dragSortColumn, {type: JVXETypes.rowDragSort}) } - _innerColumns.unshift(col) + innerColumns.unshift(col) } - this._innerColumns = _innerColumns - this._innerEditRules = _innerEditRules + this.innerColumns = innerColumns + this.innerEditRules = innerEditRules } }, // watch linkageConfig @@ -501,7 +501,7 @@ export default { if (Array.isArray(this.linkageConfig) && this.linkageConfig.length > 0) { // 获取联动的key顺序 let getLcKeys = (key, arr) => { - let col = this._innerColumns.find(col => col.key === key) + let col = this.innerColumns.find(col => col.key === key) if (col) { arr.push(col.key) if (col.linkageKey) { @@ -520,9 +520,9 @@ export default { } keys.forEach(k => configMap.set(k, configItem)) }) - this._innerLinkageConfig = configMap + this.innerLinkageConfig = configMap } else { - this._innerLinkageConfig = null + this.innerLinkageConfig = null } } }, @@ -734,8 +734,8 @@ export default { this.$set(data, this.dragSortKey, idx + 1) } // 处理联动回显数据 - if (this._innerLinkageConfig != null) { - for (let configItem of this._innerLinkageConfig.values()) { + if (this.innerLinkageConfig != null) { + for (let configItem of this.innerLinkageConfig.values()) { this.autoSetLinkageOptionsByData(data, '', configItem, 0) } } @@ -1253,10 +1253,10 @@ export default { record[col.key] = createValue({row: record, column, $table: xTable}) } // update-begin--author:sunjianlei---date:20210819------for: 处理联动列,联动列只能作用于 select 组件 - if (col.$type === JVXETypes.select && this._innerLinkageConfig != null) { + if (col.$type === JVXETypes.select && this.innerLinkageConfig != null) { // 判断当前列是否是联动列 - if (this._innerLinkageConfig.has(col.key)) { - let configItem = this._innerLinkageConfig.get(col.key) + if (this.innerLinkageConfig.has(col.key)) { + let configItem = this.innerLinkageConfig.get(col.key) this.getLinkageOptionsAsync(configItem, '') } }