bri-components 1.4.51 → 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
|
@@ -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
|
+
};
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|