bri-components 1.3.57 → 1.3.61

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.3.57",
3
+ "version": "1.3.61",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -35,6 +35,7 @@
35
35
  :rowDefault="curVal.rowDefault"
36
36
  :columns="subForm"
37
37
  :data="curVal"
38
+ :treeColumns="treeForm"
38
39
  :propsObj="defaultPropsObj"
39
40
  :allFormList="allFormList"
40
41
  :parentObj="value"
@@ -129,8 +130,55 @@
129
130
  : this.selfPropsObj._treeForm;
130
131
  },
131
132
 
133
+ searchList () {
134
+ return this.selfPropsObj._searchList || []; // 级联表切层级表时 值会undefined覆盖selfPropsObj默认的[]
135
+ },
136
+ searchListMap () {
137
+ return this.$arrToMap(this.searchList, "_key");
138
+ },
139
+ searchListFields () {
140
+ return this.searchList.map(searchItem => searchItem._key);
141
+ },
142
+ tableAdvSearch () {
143
+ return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.value);
144
+ },
145
+ dftAdvSearch () {
146
+ return {
147
+ logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
148
+ conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
149
+ this.searchListFields.includes(conditionItem.fieldKey)
150
+ )
151
+ };
152
+ },
153
+ // 配置的默认筛选值里 隐藏的看不到的筛选条件
154
+ hideAdvSearch () {
155
+ return {
156
+ logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
157
+ conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
158
+ !this.searchListFields.includes(conditionItem.fieldKey)
159
+ )
160
+ };
161
+ },
162
+ // 过滤行数据的 最终的筛选条件
163
+ finalTableAdvSearch () {
164
+ return {
165
+ logic: "and",
166
+ conditions: [
167
+ this.hideAdvSearch,
168
+ this.dftAdvSearch
169
+ ]
170
+ };
171
+ },
132
172
  showVal () {
133
- return `${this.curVal ? this.$getTreeLeafTotal(this.curVal.tree, this.showMode === "treeTable") : 0} 行`;
173
+ return `${
174
+ this.curVal
175
+ ? this.$getTreeFlatArr(this.curVal.tree, (row) => {
176
+ return (this.showMode === "treeTable" ? true : row.isLeaf === true) &&
177
+ this.$isAdvRelyAccord(this.finalTableAdvSearch, row);
178
+ }).length
179
+ // ? this.$getTreeLeafTotal(this.curVal.tree, this.showMode === "treeTable")
180
+ : 0
181
+ } 行`;
134
182
  }
135
183
  },
136
184
  created () {},
@@ -199,18 +199,22 @@ export default {
199
199
  : fieldData.operators
200
200
  ) || [];
201
201
 
202
- const fieldOperator = ["_id"].includes(fieldKey)
203
- ? "eq"
204
- : ["reference"].includes(fieldType) && this.isSimpleSearch
202
+ const fieldOperator = initContion.fieldOperator || (
203
+ ["_id"].includes(fieldKey)
205
204
  ? "eq"
206
- : (operators[0] || {})._key;
205
+ : ["reference"].includes(fieldType) && this.isSimpleSearch
206
+ ? "eq"
207
+ : (operators[0] || {})._key
208
+ );
207
209
  const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || { name: `${fieldOperator}不存在` }).name;
208
210
 
209
- const parameterType = (
210
- (initContion.fieldParams || []).length ||
211
- initContion.chainFieldKey ||
212
- (!!dynamicList.length && operators.some(operator => ["subSearch", "subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(operator._key)))
213
- ) ? "dynamicText" : "fixedText";
211
+ const parameterType = initContion.parameterType || (
212
+ (
213
+ (initContion.fieldParams || []).length ||
214
+ initContion.chainFieldKey ||
215
+ (!!dynamicList.length && operators.some(operator => ["subSearch", "subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(operator._key)))
216
+ ) ? "dynamicText" : "fixedText"
217
+ );
214
218
  const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
215
219
 
216
220
  return {
@@ -358,7 +362,7 @@ export default {
358
362
  ? loop(item[key])
359
363
  : item[key]
360
364
  : item[key]
361
- })), {});
365
+ })), {});
362
366
  };
363
367
 
364
368
  return loop(list);
@@ -130,7 +130,7 @@
130
130
  }
131
131
  },
132
132
  dblclick: (event) => {
133
- this.$emit("db-click-row", row, rowIndex, event);
133
+ this.$emit("db-click-row", row, rowIndex, column, event);
134
134
  }
135
135
  };
136
136
  },