bri-components 1.4.88 → 1.4.89
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/package.json +1 -1
- package/src/components/list/mixins/DshCascaderTableMixin.js +6 -4
- package/src/components/list/mixins/DshFlatTableMixin.js +6 -4
- package/src/components/list/mixins/DshTreeTableMixin.js +24 -9
- package/src/components/list/mixins/tableBaseMixin.js +2 -1
- package/src/styles/components/BriTable.less +2 -0
- package/src/utils/table.js +1 -1
package/package.json
CHANGED
|
@@ -147,6 +147,8 @@ export default {
|
|
|
147
147
|
getCalcuedTree (nodes = [], subCols = [], treeCols = []) {
|
|
148
148
|
const loop = (nodes = [], parentNodes = []) => {
|
|
149
149
|
nodes.forEach(row => {
|
|
150
|
+
this.fixRowData(row);
|
|
151
|
+
|
|
150
152
|
// 初始化树节点的数据,给节点加上一些属性并监测,注入到节点对象中
|
|
151
153
|
let curCol = treeCols[row.level - 1];
|
|
152
154
|
this.$setObj(row, {
|
|
@@ -184,8 +186,6 @@ export default {
|
|
|
184
186
|
loop(row.children, [...parentNodes, row]);
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
|
-
|
|
188
|
-
this.fixRowData(row);
|
|
189
189
|
});
|
|
190
190
|
};
|
|
191
191
|
|
|
@@ -263,12 +263,14 @@ export default {
|
|
|
263
263
|
// getNewRowData时,额外补充的行相关的数据(针对层级列)
|
|
264
264
|
getSelfNewRowData (level) {
|
|
265
265
|
const column = this.treeColumns[level - 1];
|
|
266
|
+
const dftVal = column._default;
|
|
267
|
+
const dftInitVal = this.dftInitValMap[column._type];
|
|
266
268
|
|
|
267
269
|
return {
|
|
268
270
|
name: this.$deepCopy(
|
|
269
271
|
this.$isEmptyData(dftVal)
|
|
270
|
-
?
|
|
271
|
-
:
|
|
272
|
+
? dftInitVal
|
|
273
|
+
: dftVal
|
|
272
274
|
)
|
|
273
275
|
};
|
|
274
276
|
}
|
|
@@ -168,11 +168,13 @@ export default {
|
|
|
168
168
|
)
|
|
169
169
|
: [];
|
|
170
170
|
},
|
|
171
|
-
// 全部数据 或 筛选时符合条件的数据
|
|
171
|
+
// 全部数据 或 筛选时符合条件的数据 -共多少分(!!!最小为1)
|
|
172
172
|
PageNum () {
|
|
173
|
-
return
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
return (
|
|
174
|
+
this.selfTotal % this.pagePropsObj.pagesize > 0
|
|
175
|
+
? Math.ceil(this.selfTotal / this.pagePropsObj.pagesize)
|
|
176
|
+
: this.selfTotal / this.pagePropsObj.pagesize
|
|
177
|
+
) || 1;
|
|
176
178
|
}
|
|
177
179
|
},
|
|
178
180
|
created () {
|
|
@@ -130,6 +130,8 @@ export default {
|
|
|
130
130
|
getCalcuedTree (treeData = [], cols = []) {
|
|
131
131
|
const loop = (list = [], parentRow, levelNum = 1) =>
|
|
132
132
|
list.forEach(rowItem => {
|
|
133
|
+
this.fixRowData(rowItem, levelNum);
|
|
134
|
+
|
|
133
135
|
// 递归到叶子节点前 从上往下执行 要处理的
|
|
134
136
|
cols.reduce((newRow, column) => {
|
|
135
137
|
if (["number", "date"].includes(column._type)) {
|
|
@@ -201,8 +203,6 @@ export default {
|
|
|
201
203
|
return newRow;
|
|
202
204
|
}, rowItem);
|
|
203
205
|
}
|
|
204
|
-
|
|
205
|
-
this.fixRowData(rowItem, levelNum);
|
|
206
206
|
});
|
|
207
207
|
loop(treeData);
|
|
208
208
|
|
|
@@ -210,6 +210,7 @@ export default {
|
|
|
210
210
|
return treeData;
|
|
211
211
|
},
|
|
212
212
|
fixSelfRowData (row, levelNum) {
|
|
213
|
+
// console.log(row.level);
|
|
213
214
|
if (this.initFlag) {
|
|
214
215
|
// 每条数据都补充全所有字段值(赋一个默认的空值)
|
|
215
216
|
this.selfColumns.forEach((colItem) => {
|
|
@@ -221,15 +222,28 @@ export default {
|
|
|
221
222
|
|
|
222
223
|
row.level = row.level || levelNum; // TODO:修正数据level属性,后期可以删除
|
|
223
224
|
// 第一级的需要显示出来
|
|
224
|
-
if (row.level
|
|
225
|
-
|
|
225
|
+
if (row.level === 1) {
|
|
226
|
+
// 必须用$set
|
|
227
|
+
this.$set(row, "__isExpand__", false);
|
|
228
|
+
this.$set(row, "__isShow__", true);
|
|
229
|
+
this.$set(row, "__isTmpShow__", true);
|
|
230
|
+
} else {
|
|
231
|
+
this.$set(row, "__isExpand__", false);
|
|
232
|
+
this.$set(row, "__isShow__", false);
|
|
233
|
+
this.$set(row, "__isTmpShow__", false);
|
|
226
234
|
}
|
|
227
235
|
}
|
|
228
|
-
//
|
|
236
|
+
// 考虑计算或其它重新传进来值时
|
|
229
237
|
else {
|
|
230
238
|
// 第一级的需要显示出来
|
|
231
|
-
if (row.level
|
|
232
|
-
|
|
239
|
+
if (row.level === 1) {
|
|
240
|
+
!Object.prototype.hasOwnProperty.call(row, "__isExpand__") && this.$set(row, "__isExpand__", false);
|
|
241
|
+
!Object.prototype.hasOwnProperty.call(row, "__isShow__") && this.$set(row, "__isShow__", true);
|
|
242
|
+
!Object.prototype.hasOwnProperty.call(row, "__isTmpShow__") && this.$set(row, "__isTmpShow__", true);
|
|
243
|
+
} else {
|
|
244
|
+
!Object.prototype.hasOwnProperty.call(row, "__isExpand__") && this.$set(row, "__isExpand__", false);
|
|
245
|
+
!Object.prototype.hasOwnProperty.call(row, "__isShow__") && this.$set(row, "__isShow__", false);
|
|
246
|
+
!Object.prototype.hasOwnProperty.call(row, "__isTmpShow__") && this.$set(row, "__isTmpShow__", false);
|
|
233
247
|
}
|
|
234
248
|
}
|
|
235
249
|
},
|
|
@@ -263,8 +277,9 @@ export default {
|
|
|
263
277
|
// getNewRowData时,额外补充的行相关的数据
|
|
264
278
|
getSelfNewRowData (level) {
|
|
265
279
|
return {
|
|
266
|
-
|
|
267
|
-
|
|
280
|
+
__isExpand__: false,
|
|
281
|
+
__isShow__: true,
|
|
282
|
+
__isTmpShow__: true
|
|
268
283
|
};
|
|
269
284
|
}
|
|
270
285
|
}
|
|
@@ -70,7 +70,8 @@ export default {
|
|
|
70
70
|
widthMap: this.$getModFieldPropertyMap("width"),
|
|
71
71
|
dftInitValMap: this.$getModFieldPropertyMap("initDefaultVal"),
|
|
72
72
|
// saveProperties: ["__readonly__", "__isDefault__", "__old__", "__isQuote__"],
|
|
73
|
-
resetProperties: ["
|
|
73
|
+
// resetProperties: ["__treeIndex__", "__isExpand__", "__isShow__", "__isTmpShow__"],
|
|
74
|
+
resetProperties: ["__treeIndex__", "__isExpand__", "__isShow__", "__isTmpShow__", "__isSearchShow__", "__isRendered__"],
|
|
74
75
|
|
|
75
76
|
initFlag: true,
|
|
76
77
|
isExpandAction: false,
|