bri-components 1.2.87 → 1.2.88
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
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<dsh-dropdown
|
|
132
132
|
v-if="conditionItem.dynamicList.length"
|
|
133
133
|
class="extra-dynamic"
|
|
134
|
-
:list="parameterPropsObj._data"
|
|
134
|
+
:list="['set'].includes(mode) && ['reference', 'flatTable'].includes(conditionItem.fieldType) ? [] : parameterPropsObj._data"
|
|
135
135
|
@click="$dispatchEvent(operationMap.selectParameterType, conditionItem, conditionIndex, value.conditions, $event)"
|
|
136
136
|
>
|
|
137
137
|
<span class="extra-operator-wrap">
|
|
@@ -139,6 +139,7 @@
|
|
|
139
139
|
{{ conditionItem.parameterTypeName }}
|
|
140
140
|
</span>
|
|
141
141
|
<Icon
|
|
142
|
+
v-if="!(['set'].includes(mode) && ['reference', 'flatTable'].includes(conditionItem.fieldType))"
|
|
142
143
|
class="extra-operator-icon"
|
|
143
144
|
type="ios-arrow-down"
|
|
144
145
|
/>
|
|
@@ -305,20 +306,8 @@
|
|
|
305
306
|
);
|
|
306
307
|
}
|
|
307
308
|
},
|
|
308
|
-
created () {
|
|
309
|
-
|
|
310
|
-
},
|
|
311
|
-
methods: {
|
|
312
|
-
// 初始化
|
|
313
|
-
init () {
|
|
314
|
-
this.value.conditions = this.value.conditions.map(conditionItem => {
|
|
315
|
-
const newConditionItem = this.createContionFunc(conditionItem, undefined, conditionItem.fieldKey);
|
|
316
|
-
this.dealSubSearch(newConditionItem);
|
|
317
|
-
|
|
318
|
-
return newConditionItem;
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
}
|
|
309
|
+
created () {},
|
|
310
|
+
methods: {}
|
|
322
311
|
};
|
|
323
312
|
</script>
|
|
324
313
|
|
|
@@ -5,6 +5,12 @@ export default {
|
|
|
5
5
|
DshFormUnit
|
|
6
6
|
},
|
|
7
7
|
props: {
|
|
8
|
+
initFields: {
|
|
9
|
+
type: Array,
|
|
10
|
+
default () {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
},
|
|
8
14
|
value: {
|
|
9
15
|
type: Object,
|
|
10
16
|
default () {
|
|
@@ -67,8 +73,22 @@ export default {
|
|
|
67
73
|
return this.$arrToCategoryArr(this.dynamicFormList);
|
|
68
74
|
}
|
|
69
75
|
},
|
|
70
|
-
created () {
|
|
76
|
+
created () {
|
|
77
|
+
this.init();
|
|
78
|
+
},
|
|
71
79
|
methods: {
|
|
80
|
+
// 初始化
|
|
81
|
+
init () {
|
|
82
|
+
this.value.conditions = [...this.initFields, ...this.value.conditions].map(conditionItem => {
|
|
83
|
+
const newConditionItem = typeof conditionItem === "string"
|
|
84
|
+
? this.createContionFunc(undefined, undefined, conditionItem)
|
|
85
|
+
: this.createContionFunc(conditionItem, undefined, conditionItem.fieldKey);
|
|
86
|
+
this.dealSubSearch(newConditionItem);
|
|
87
|
+
|
|
88
|
+
return newConditionItem;
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
|
|
72
92
|
// 新增筛选条件
|
|
73
93
|
createCondition (operationItem, isLoop, formItem, list) {
|
|
74
94
|
const newConditionItem = this.createContionFunc({ logic: isLoop ? "and" : "field" }, formItem);
|
|
@@ -138,21 +158,26 @@ export default {
|
|
|
138
158
|
curFormItem = curFormItem || this.canSearchFormList.find(formItem => formItem._key === fieldKey);
|
|
139
159
|
|
|
140
160
|
if (curFormItem) {
|
|
141
|
-
const
|
|
161
|
+
const fieldType = curFormItem._type;
|
|
162
|
+
const fieldData = this.fieldMap[fieldType];
|
|
142
163
|
|
|
143
|
-
const dynamicTypes = this.useChainField ? [...new Set([...(fieldData.categoryTypes || []),
|
|
144
|
-
let dynamicList = dynamicTypes.reduce((list, type) =>
|
|
164
|
+
const dynamicTypes = this.useChainField ? [...new Set([...(fieldData.categoryTypes || []), fieldType])] : [fieldType];
|
|
165
|
+
let dynamicList = dynamicTypes.reduce((list, type) => list.concat(this.dynamicFieldsMap[type] || []), []);
|
|
145
166
|
dynamicList = this.useChainField
|
|
146
|
-
? ["select", "checkbox", "cascader", "cascaders"].includes(
|
|
167
|
+
? ["select", "checkbox", "cascader", "cascaders"].includes(fieldType)
|
|
147
168
|
? dynamicList.filter(dynamicItem => dynamicItem._resourceKey === curFormItem._resourceKey)
|
|
148
|
-
: ["reference"].includes(
|
|
169
|
+
: ["reference"].includes(fieldType) && !!curFormItem._ref
|
|
149
170
|
? dynamicList.filter(dynamicItem => dynamicItem._ref === curFormItem._ref)
|
|
150
171
|
: dynamicList
|
|
151
172
|
: dynamicList;
|
|
152
|
-
const parameterType = initContion.parameterType || (
|
|
173
|
+
const parameterType = initContion.parameterType || (
|
|
174
|
+
(initContion.fieldParams || []).length || initContion.chainFieldKey || (!!dynamicList.length && ["set"].includes(this.mode) && ["reference", "flatTable"].includes(fieldType))
|
|
175
|
+
? "dynamicText"
|
|
176
|
+
: "fixedText"
|
|
177
|
+
);
|
|
153
178
|
const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
|
|
154
179
|
|
|
155
|
-
const operators = fieldData[
|
|
180
|
+
const operators = fieldData[!dynamicList.length && ["set"].includes(this.mode) ? "operatorsSet" : "operators"] || fieldData.operators || [];
|
|
156
181
|
const fieldOperator = initContion.fieldOperator || (operators[0] || {})._key;
|
|
157
182
|
const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || { name: `${fieldOperator}不存在` }).name;
|
|
158
183
|
|
|
@@ -160,7 +185,7 @@ export default {
|
|
|
160
185
|
_id: this.$ObjectID().str,
|
|
161
186
|
logic: "field",
|
|
162
187
|
fieldKey: curFormItem._key,
|
|
163
|
-
fieldType:
|
|
188
|
+
fieldType: fieldType,
|
|
164
189
|
fieldValue: [],
|
|
165
190
|
fieldOperator: fieldOperator,
|
|
166
191
|
fieldSearch: {
|
|
@@ -294,7 +319,7 @@ export default {
|
|
|
294
319
|
: item[key]
|
|
295
320
|
)
|
|
296
321
|
: item[key]
|
|
297
|
-
|
|
322
|
+
}), {})
|
|
298
323
|
);
|
|
299
324
|
};
|
|
300
325
|
|