n20-common-lib 3.2.0 → 3.2.1
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
|
@@ -14,11 +14,17 @@ export default {
|
|
|
14
14
|
column: {
|
|
15
15
|
type: Number,
|
|
16
16
|
default: 2
|
|
17
|
+
},
|
|
18
|
+
autoResize: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
created() {
|
|
20
|
-
this.
|
|
21
|
-
|
|
24
|
+
if (this.autoResize) {
|
|
25
|
+
this.resize()
|
|
26
|
+
window.addEventListener('resize', this.resize)
|
|
27
|
+
}
|
|
22
28
|
},
|
|
23
29
|
beforeDestroy() {
|
|
24
30
|
window.removeEventListener('resize', this.resize)
|
|
@@ -325,20 +325,32 @@ export default {
|
|
|
325
325
|
return obj
|
|
326
326
|
},
|
|
327
327
|
filterObj() {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
328
|
+
const filterKeys = new Set()
|
|
329
|
+
this.filterList.forEach((item) => {
|
|
330
|
+
;[
|
|
331
|
+
item.value,
|
|
332
|
+
item.startDate,
|
|
333
|
+
item.endDate,
|
|
334
|
+
item.startValue,
|
|
335
|
+
item.endValue,
|
|
336
|
+
...(item.slotFields || [])
|
|
337
|
+
].forEach((key) => {
|
|
338
|
+
if (key) filterKeys.add(key)
|
|
336
339
|
})
|
|
340
|
+
})
|
|
341
|
+
|
|
342
|
+
const extraInitialValues = {}
|
|
343
|
+
Object.keys(this.initialValue || {}).forEach((key) => {
|
|
344
|
+
if (!filterKeys.has(key)) {
|
|
345
|
+
extraInitialValues[key] = this.initialValue[key]
|
|
346
|
+
}
|
|
347
|
+
})
|
|
348
|
+
|
|
337
349
|
return {
|
|
338
350
|
// 高级查询组合
|
|
339
351
|
conditionGroups: this.conditionGroups,
|
|
340
|
-
//
|
|
341
|
-
searchValue: { ...this.searchValue
|
|
352
|
+
// 筛选条件:保留 initialValue 中的额外业务参数,但不覆盖视图自身的筛选字段
|
|
353
|
+
searchValue: { ...extraInitialValues, ...this.searchValue },
|
|
342
354
|
// 视图id
|
|
343
355
|
viewId: this.selectItem ? this.selectItem.viewId : null,
|
|
344
356
|
// 视图类型
|
|
@@ -706,13 +718,13 @@ export default {
|
|
|
706
718
|
this.selectedItem = item.viewName
|
|
707
719
|
if (item.viewName === '无视图') {
|
|
708
720
|
this.selectItem = ''
|
|
709
|
-
this.searchValue = {}
|
|
721
|
+
this.searchValue = { ...this.getInitialSearchValue, ...this.initialValue }
|
|
710
722
|
this.conditionGroups = []
|
|
711
723
|
}
|
|
712
724
|
if (item.viewType === VIEW_TYPE.ADVANCED) {
|
|
713
725
|
const config = this.safeParse(item.viewConfig)
|
|
714
726
|
this.searchForm = config
|
|
715
|
-
this.searchValue = config
|
|
727
|
+
this.searchValue = { ...this.getInitialSearchValue, ...config }
|
|
716
728
|
} else if (item.viewType === VIEW_TYPE.BASIC) {
|
|
717
729
|
this.conditionGroups = this.safeParse(item.viewConfig).conditionGroups || []
|
|
718
730
|
this.searchValue = { ...this.getInitialSearchValue }
|