bri-components 1.4.50 → 1.4.52

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.50",
3
+ "version": "1.4.52",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -1,5 +1,5 @@
1
1
  import controlMixin from "./controlMixin.js";
2
- import { resourceData, regionData, benjiRegionData, userIndustryData } from "../../../data/index.js";
2
+ import { resourceData, regionData, benjiRegionData, userIndustryData } from "bri-datas";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -0,0 +1,130 @@
1
+ import controlMixin from "./controlMixin.js";
2
+ import DshCascaderTable from "../../list/DshCascaderTable.vue";
3
+ import DshTreeTable from "../../list/DshTreeTable.vue";
4
+
5
+ export default {
6
+ mixins: [
7
+ controlMixin
8
+ ],
9
+ components: {
10
+ DshCascaderTable,
11
+ DshTreeTable
12
+ },
13
+ props: {},
14
+ data () {
15
+ return {};
16
+ },
17
+ computed: {
18
+ selfPropsObj () {
19
+ return {
20
+ _subType: "default", // "default", "cross", "old"
21
+ _subForm: [],
22
+ _treeForm: [],
23
+ _searchList: [], // 作为搜索的字段
24
+ _tableAdvSearch: {
25
+ logic: "and",
26
+ conditions: []
27
+ },
28
+ ...this.propsObj
29
+ };
30
+ },
31
+ defaultPropsObj () {
32
+ return {
33
+ ...this.selfPropsObj,
34
+ _tableAdvSearch: {
35
+ logic: "and",
36
+ conditions: []
37
+ }
38
+ };
39
+ },
40
+ subType () {
41
+ return this.selfPropsObj._subType;
42
+ },
43
+ subForm () {
44
+ return this.selfPropsObj._subForm;
45
+ },
46
+ // 用户态的每条数据的表头配置,都是存的自己的,不用通用配置_treeForm的
47
+ treeForm () {
48
+ return this.curVal && this.curVal._treeForm
49
+ ? this.curVal._treeForm
50
+ : this.selfPropsObj._treeForm;
51
+ },
52
+
53
+ searchList () {
54
+ return this.selfPropsObj._searchList;
55
+ },
56
+ searchListMap () {
57
+ return this.$arrToMap(this.searchList, "_key");
58
+ },
59
+ searchListFields () {
60
+ return this.searchList.map(searchItem => searchItem._key);
61
+ },
62
+ tableAdvSearch () {
63
+ return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.value);
64
+ },
65
+ dftAdvSearch () {
66
+ return {
67
+ logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
68
+ conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
69
+ this.searchListFields.includes(conditionItem.fieldKey)
70
+ )
71
+ };
72
+ },
73
+ // 配置的默认筛选值里 隐藏的看不到的筛选条件
74
+ hideAdvSearch () {
75
+ return {
76
+ logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
77
+ conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
78
+ !this.searchListFields.includes(conditionItem.fieldKey)
79
+ )
80
+ };
81
+ },
82
+ // 过滤行数据的 最终的筛选条件
83
+ finalTableAdvSearch () {
84
+ return {
85
+ logic: "and",
86
+ conditions: [
87
+ this.hideAdvSearch,
88
+ this.dftAdvSearch
89
+ ]
90
+ };
91
+ },
92
+ isSearching () {
93
+ return this.$isAdvSearching(this.finalTableAdvSearch);
94
+ },
95
+
96
+ curVal () {
97
+ return this.value[this.controlKey] || {
98
+ tree: []
99
+ };
100
+ },
101
+ showVal () {
102
+ return `${this.curVal
103
+ ? this.$getTreeFlatArr(this.curVal.tree, (row) =>
104
+ (
105
+ this.subType === "old"
106
+ ? row.isLeaf === true
107
+ : true
108
+ ) && (
109
+ this.isSearching
110
+ ? this.$isAdvRelyAccord(this.finalTableAdvSearch, row)
111
+ : true
112
+ )
113
+ ).length
114
+ : 0
115
+ } 行`;
116
+ }
117
+ },
118
+ created () { },
119
+ methods: {
120
+ // 校验方法 -供外部使用
121
+ validate () {
122
+ return this.$refs.table.validate();
123
+ },
124
+
125
+ // 发生变动
126
+ change (...params) {
127
+ this.$emit("change", ...params);
128
+ }
129
+ }
130
+ };
@@ -1,5 +1,5 @@
1
1
  import controlMixin from "./controlMixin.js";
2
- import { resourceData } from "../../../data/index.js";
2
+ import { resourceData } from "bri-datas";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -66,6 +66,7 @@
66
66
  </dsh-modal>
67
67
  </template>
68
68
 
69
+ <!-- 编辑 和 查看-表单内 -->
69
70
  <template v-else>
70
71
  <!-- 配置端 设置默认值用-->
71
72
  <dsh-btn-modal v-if="controlKey === '_default'">
@@ -149,139 +150,24 @@
149
150
  </template>
150
151
 
151
152
  <script>
152
- import controlMixin from "../mixins/controlMixin.js";
153
- import DshCascaderTable from "../../list/DshCascaderTable.vue";
154
- import DshTreeTable from "../../list/DshTreeTable.vue";
153
+ import cascaderTableMixin from "../mixins/cascaderTableMixin.js";
155
154
  import DshBtnModal from "../../small/DshBtnModal.vue";
156
155
 
157
156
  export default {
158
157
  name: "cascaderTable",
159
158
  mixins: [
160
- controlMixin
159
+ cascaderTableMixin
161
160
  ],
162
161
  components: {
163
- DshCascaderTable,
164
- DshTreeTable,
165
162
  DshBtnModal
166
163
  },
167
164
  props: {},
168
165
  data () {
169
166
  return {};
170
167
  },
171
- computed: {
172
- selfPropsObj () {
173
- return {
174
- _subType: "default", // "default", "cross", "old"
175
- _subForm: [],
176
- _treeForm: [],
177
- _searchList: [], // 作为搜索的字段
178
- _tableAdvSearch: {
179
- logic: "and",
180
- conditions: []
181
- },
182
- ...this.propsObj
183
- };
184
- },
185
- defaultPropsObj () {
186
- return {
187
- ...this.selfPropsObj,
188
- _tableAdvSearch: {
189
- logic: "and",
190
- conditions: []
191
- }
192
- };
193
- },
194
- subType () {
195
- return this.selfPropsObj._subType;
196
- },
197
- subForm () {
198
- return this.selfPropsObj._subForm;
199
- },
200
- // 用户态的每条数据的表头配置,都是存的自己的,不用通用配置_treeForm的
201
- treeForm () {
202
- return this.curVal && this.curVal._treeForm
203
- ? this.curVal._treeForm
204
- : this.selfPropsObj._treeForm;
205
- },
206
-
207
- searchList () {
208
- return this.selfPropsObj._searchList;
209
- },
210
- searchListMap () {
211
- return this.$arrToMap(this.searchList, "_key");
212
- },
213
- searchListFields () {
214
- return this.searchList.map(searchItem => searchItem._key);
215
- },
216
- tableAdvSearch () {
217
- return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.value);
218
- },
219
- dftAdvSearch () {
220
- return {
221
- logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
222
- conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
223
- this.searchListFields.includes(conditionItem.fieldKey)
224
- )
225
- };
226
- },
227
- // 配置的默认筛选值里 隐藏的看不到的筛选条件
228
- hideAdvSearch () {
229
- return {
230
- logic: ["and", "or"].includes(this.tableAdvSearch.logic) ? this.tableAdvSearch.logic : "and",
231
- conditions: this.tableAdvSearch.conditions.filter(conditionItem =>
232
- !this.searchListFields.includes(conditionItem.fieldKey)
233
- )
234
- };
235
- },
236
- // 过滤行数据的 最终的筛选条件
237
- finalTableAdvSearch () {
238
- return {
239
- logic: "and",
240
- conditions: [
241
- this.hideAdvSearch,
242
- this.dftAdvSearch
243
- ]
244
- };
245
- },
246
- isSearching () {
247
- return this.$isAdvSearching(this.finalTableAdvSearch);
248
- },
249
-
250
- curVal () {
251
- return this.value[this.controlKey] || {
252
- tree: []
253
- };
254
- },
255
- showVal () {
256
- return `${
257
- this.curVal
258
- ? this.$getTreeFlatArr(this.curVal.tree, (row) =>
259
- (
260
- this.subType === "old"
261
- ? row.isLeaf === true
262
- : true
263
- ) && (
264
- this.isSearching
265
- ? this.$isAdvRelyAccord(this.finalTableAdvSearch, row)
266
- : true
267
- )
268
- ).length
269
- : 0
270
- } 行`;
271
- }
272
- },
168
+ computed: {},
273
169
  created () {},
274
- methods: {
275
- // 校验方法 -供外部使用
276
- validate () {
277
- return this.$refs.table.validate();
278
- },
279
-
280
- // 发生变动
281
- change (...params) {
282
- this.$emit("change", ...params);
283
- }
284
- }
170
+ methods: {}
285
171
  };
286
172
  </script>
287
173
 
@@ -321,7 +321,7 @@ export default {
321
321
  });
322
322
  },
323
323
  quickChangeVal (operationItem, row, rowIndex, column, params) {
324
- if (this.isUseQuickChange({ row, rowIndex, column })) {
324
+ if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
325
325
  this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
326
326
  this.dealSameRowsVal({ row, rowIndex, column });
327
327
 
@@ -329,7 +329,7 @@ export default {
329
329
  }
330
330
  },
331
331
  changeVal (operationItem, row, rowIndex, column, params) {
332
- if (!this.isUseQuickChange({ row, rowIndex, column })) {
332
+ if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
333
333
  this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
334
334
  this.dealSameRowsVal({ row, rowIndex, column });
335
335
 
@@ -385,19 +385,22 @@ export default {
385
385
 
386
386
  return rowspan;
387
387
  },
388
- // 是都满足使用quickChange
389
- isUseQuickChange ({ row, rowIndex, column }) {
390
- return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
391
- this.mergeRowColKeys.includes(column._key) &&
392
- this.rowspanMap[this.getMixKey(row, column)] > 1;
393
- },
388
+ // // 是都满足使用quickChange
389
+ // isUseQuickChange ({ row, rowIndex, column }) {
390
+ // return ["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type) &&
391
+ // this.mergeRowColKeys.includes(column._key) &&
392
+ // this.rowspanMap[this.getMixKey(row, column)] > 1;
393
+ // },
394
394
  // 合并单元格的行,某列的值全部跟着修改
395
395
  dealSameRowsVal ({ row, rowIndex, column }, list = this.allListData) {
396
- const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
397
- list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
398
- .forEach(rowItem => {
399
- rowItem[column._key] = this.$deepCopy(row[column._key]);
400
- });
396
+ if (this.mergeRowColKeys.includes(column._key) && this.rowspanMap[this.getMixKey(row, column)] > 1) {
397
+ const indexInAll = list.findIndex(dataItem => dataItem._id === row._id);
398
+ list.slice(indexInAll + 1, indexInAll + this.rowspanMap[this.getMixKey(row, column)])
399
+ .forEach(rowItem => {
400
+ console.log(rowItem[column._key]);
401
+ rowItem[column._key] = this.$deepCopy(row[column._key]);
402
+ });
403
+ }
401
404
  }
402
405
  }
403
406
  };
@@ -856,12 +856,17 @@ export default {
856
856
  },
857
857
  // 输入框值改变立即
858
858
  quickChangeVal (operationItem, row, rowIndex, column, params) {
859
- // 啥也不做,平级表格合并单元格时用这个方法
859
+ if (["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
860
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
861
+ this.change("quickChangeVal", row, rowIndex, column, ...params);
862
+ }
860
863
  },
861
864
  // 输入框值改变
862
865
  changeVal (operationItem, row, rowIndex, column, params) {
863
- this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
864
- this.change("changeVal", row, rowIndex, column, ...params);
866
+ if (!["text", "textarea", "idcard", "email", "phone", "url", "password"].includes(column._type)) {
867
+ this.$set(this.ruleRecordMap, this.getMixKey(row, column), { showRuleMessage: true });
868
+ this.change("changeVal", row, rowIndex, column, ...params);
869
+ }
865
870
  },
866
871
  change (eventType, row, rowIndex, column, ...params) {
867
872
  this.$emit("change", this.tableDataObj, eventType, column, row, rowIndex, ...params);
@@ -1,4 +1,4 @@
1
- import { resourceData } from "../../../data/index.js";
1
+ import { resourceData } from "bri-datas";
2
2
 
3
3
  export default {
4
4
  mixins: [],