bri-components 1.4.88 → 1.4.90

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.4.88",
3
+ "version": "1.4.90",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -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
- ? this.dftInitValMap[column._type]
271
- : column._default
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 this.selfTotal % this.pagePropsObj.pagesize > 0
174
- ? Math.ceil(this.selfTotal / this.pagePropsObj.pagesize)
175
- : Math.floor(this.selfTotal / this.pagePropsObj.pagesize);
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 == 1) {
225
- row.__isShow__ = true;
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 == 1) {
232
- row.__isShow__ = Object.prototype.hasOwnProperty.call(row, "__isShow__") ? row.__isShow__ : true;
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
- // __isExpand__: false, // 此行不用也行
267
- // __isTmpShow__: true // 此行不用也行
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: ["__isShow__", "__isTmpShow__", "__isExpand__", "__treeIndex__"],
73
+ // resetProperties: ["__treeIndex__", "__isExpand__", "__isShow__", "__isTmpShow__"],
74
+ resetProperties: ["__treeIndex__", "__isExpand__", "__isShow__", "__isTmpShow__", "__isSearchShow__", "__isRendered__"],
74
75
 
75
76
  initFlag: true,
76
77
  isExpandAction: false,
@@ -24,6 +24,7 @@
24
24
  export default {
25
25
  name: "DshSteps",
26
26
  props: {
27
+ value: Number,
27
28
  list: {
28
29
  type: Array,
29
30
  default () {
@@ -53,7 +54,18 @@
53
54
  };
54
55
  }
55
56
  },
56
- created () {},
57
+ watch: {
58
+ value (newVal, oldVal) {
59
+ if (newVal !== oldVal) {
60
+ this.current = this.value;
61
+ }
62
+ }
63
+ },
64
+ created () {
65
+ if (this.value != null) {
66
+ this.current = this.value;
67
+ }
68
+ },
57
69
  methods: {
58
70
  clickStepItem (stepItem, stepIndex) {
59
71
  if (!this.stepShowFunc || this.stepShowFunc(stepItem, stepIndex)) {
@@ -220,6 +220,8 @@
220
220
 
221
221
  &-tip {
222
222
  padding: 0px 0px 0px 16px;
223
+ // text-align: left;
224
+ word-break: break-all;
223
225
  font-size: 12px;
224
226
  line-height: 1;
225
227
  color: #ed4014;
@@ -162,7 +162,7 @@ const transformToColumns = function (formList, {
162
162
 
163
163
  ...col
164
164
  };
165
- });
165
+ });
166
166
  };
167
167
 
168
168
  export default {