bri-components 1.2.86 → 1.2.87

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.2.86",
3
+ "version": "1.2.87",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -62,59 +62,61 @@
62
62
  >
63
63
  <template v-if="!conditionItem.__isDelete__">
64
64
  <slot :conditionItem="conditionItem">
65
- <!-- 动态文本 -匹配的动态筛选字段 -->
66
- <template v-if="conditionItem.parameterType === 'dynamicText'">
67
- <dsh-select
68
- v-if="useChainField"
69
- class="DshAdvSearch-conditions-item-control"
70
- :value="conditionItem"
71
- :propsObj="{
72
- _name: `${conditionItem.formItem._name}的联动字段`,
73
- _key: 'chainFieldKey',
74
- _data: conditionItem.dynamicList
75
- }"
76
- @change="change('parameterTypeControl', conditionItem, ...arguments)"
77
- ></dsh-select>
78
-
79
- <dsh-checkbox
65
+ <!-- 为空和不为空时 啥不显示 -->
66
+ <div
67
+ v-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
68
+ class="DshAdvSearch-conditions-item-blank"
69
+ >请选择右上角条件</div>
70
+
71
+ <!-- 子表的筛选,出现是有条件的,递归 -->
72
+ <template v-else-if="['subSearch', 'subTableSearch'].includes(conditionItem.fieldOperator)">
73
+ <dsh-adv-search
74
+ v-if="conditionItem.finished === true"
75
+ :mode="mode"
76
+ :isInner="true"
77
+ :value="conditionItem.fieldSearch"
78
+ :formList="conditionItem.subFormList"
79
+ :useChainField="useChainField"
80
+ :dynamicFormList="dynamicFormList"
81
+ @change="change('subSearch', conditionItem, ...arguments)"
82
+ ></dsh-adv-search>
83
+
84
+ <div
80
85
  v-else
81
- class="DshAdvSearch-conditions-item-control"
82
- :value="conditionItem"
83
- :propsObj="{
84
- _name: `${conditionItem.formItem._name}的动态参数`,
85
- _key: 'fieldParams',
86
- _data: conditionItem.dynamicList
87
- }"
88
- @change="change('parameterTypeControl', conditionItem, ...arguments)"
89
- ></dsh-checkbox>
86
+ class="DshAdvSearch-conditions-item-loading"
87
+ >加载中……</div>
90
88
  </template>
91
89
 
92
- <!-- 固定文本 -筛选条件对应的显示 -->
90
+ <!-- 其它条件 -->
93
91
  <template v-else>
94
- <!-- 子表的筛选,出现是有条件的,递归 -->
95
- <template v-if="['subSearch', 'subTableSearch'].includes(conditionItem.fieldOperator)">
96
- <dsh-adv-search
97
- v-if="conditionItem.finished === true"
98
- :mode="mode"
99
- :isInner="true"
100
- :value="conditionItem.fieldSearch"
101
- :formList="conditionItem.subFormList"
102
- :useChainField="useChainField"
103
- :dynamicFormList="dynamicFormList"
104
- @change="change('subSearch', conditionItem, ...arguments)"
105
- ></dsh-adv-search>
106
-
107
- <div
92
+ <!-- 动态文本 -匹配的动态筛选字段 -->
93
+ <template v-if="conditionItem.parameterType === 'dynamicText'">
94
+ <dsh-select
95
+ v-if="useChainField"
96
+ class="DshAdvSearch-conditions-item-control"
97
+ :value="conditionItem"
98
+ :propsObj="{
99
+ _name: `${conditionItem.formItem._name}的联动字段`,
100
+ _key: 'chainFieldKey',
101
+ _data: conditionItem.dynamicList
102
+ }"
103
+ @change="change('parameterTypeControl', conditionItem, ...arguments)"
104
+ ></dsh-select>
105
+
106
+ <dsh-checkbox
108
107
  v-else
109
- class="DshAdvSearch-conditions-item-loading"
110
- >加载中……</div>
108
+ class="DshAdvSearch-conditions-item-control"
109
+ :value="conditionItem"
110
+ :propsObj="{
111
+ _name: `${conditionItem.formItem._name}的动态参数`,
112
+ _key: 'fieldParams',
113
+ _data: conditionItem.dynamicList
114
+ }"
115
+ @change="change('parameterTypeControl', conditionItem, ...arguments)"
116
+ ></dsh-checkbox>
111
117
  </template>
112
118
 
113
- <!-- 为空和不为空时 啥不显示 -->
114
- <div
115
- v-else-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
116
- class="DshAdvSearch-conditions-item-blank"
117
- >请选择右上角条件</div>
119
+ <!-- 固定文本 -筛选条件对应的显示 -->
118
120
  </template>
119
121
  </slot>
120
122
  </template>
@@ -243,7 +245,7 @@
243
245
  default: "default",
244
246
  validator: function (val) {
245
247
  // 用户态、 配置端、高级依赖、以及仪表盘乱用的地方
246
- return ["default", "set", "rely"].includes(val);
248
+ return ["default", "set"].includes(val);
247
249
  }
248
250
  },
249
251
  useLoop: {
@@ -72,6 +72,7 @@ export default {
72
72
  // 新增筛选条件
73
73
  createCondition (operationItem, isLoop, formItem, list) {
74
74
  const newConditionItem = this.createContionFunc({ logic: isLoop ? "and" : "field" }, formItem);
75
+ this.dealSubSearch(newConditionItem);
75
76
  list.push(newConditionItem);
76
77
 
77
78
  this.change(operationItem.type, newConditionItem);
@@ -94,15 +95,32 @@ export default {
94
95
  },
95
96
  // 选择某控件的筛选类型
96
97
  changeOperator (operationItem, conditionItem, conditionIndex, list, optionItem) {
97
- conditionItem.fieldOperator = optionItem._key;
98
- conditionItem.fieldOperatorName = optionItem.name;
99
- conditionItem.fieldSearch = {
100
- logic: "and",
101
- conditions: []
102
- };
103
- this.dealSubSearch(conditionItem);
98
+ if (optionItem._key !== conditionItem.fieldOperator) {
99
+ conditionItem.fieldOperator = optionItem._key;
100
+ conditionItem.fieldOperatorName = optionItem.name;
104
101
 
105
- this.change(operationItem.type, conditionItem);
102
+ if (["isnull", "notnull", "nosize", "size", "nolist", "list"].includes(conditionItem.fieldOperator)) {
103
+ conditionItem.fieldParams = [];
104
+ conditionItem.chainFieldKey = "";
105
+ conditionItem.fieldValue = [];
106
+ conditionItem.fieldSearch = {
107
+ logic: "and",
108
+ conditions: []
109
+ };
110
+ } else if (["subSearch", "subTableSearch"].includes(conditionItem.fieldOperator)) {
111
+ conditionItem.fieldParams = [];
112
+ conditionItem.chainFieldKey = "";
113
+ conditionItem.fieldValue = [];
114
+ this.dealSubSearch(conditionItem);
115
+ } else {
116
+ conditionItem.fieldSearch = {
117
+ logic: "and",
118
+ conditions: []
119
+ };
120
+ }
121
+
122
+ this.change(operationItem.type, conditionItem);
123
+ }
106
124
  },
107
125
  // 发生改动
108
126
  change (operationType, conditionItem) {
@@ -134,7 +152,7 @@ export default {
134
152
  const parameterType = initContion.parameterType || ((initContion.fieldParams || []).length || initContion.chainFieldKey ? "dynamicText" : "fixedText");
135
153
  const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
136
154
 
137
- const operators = fieldData[this.mode === "set" ? "operatorsSet" : this.mode === "rely" ? "operatorsRely" : "operators"] || fieldData.operators || [];
155
+ const operators = fieldData[this.mode === "default" || dynamicList.length ? "operators" : "operatorsSet"] || fieldData.operators || [];
138
156
  const fieldOperator = initContion.fieldOperator || (operators[0] || {})._key;
139
157
  const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || { name: `${fieldOperator}不存在` }).name;
140
158
 
@@ -201,19 +219,7 @@ export default {
201
219
 
202
220
  _line: false,
203
221
  _span: 24,
204
- _useColor: true,
205
-
206
- ...(
207
- ["default", "rely"].includes(this.mode)
208
- ? (
209
- ["date", "daterange"].includes(formItem._type)
210
- ? {
211
- _useShortcuts: false
212
- }
213
- : {}
214
- )
215
- : {}
216
- )
222
+ _useColor: true
217
223
  };
218
224
  },
219
225
  // 格式化表单配置,适合需要
@@ -288,7 +294,7 @@ export default {
288
294
  : item[key]
289
295
  )
290
296
  : item[key]
291
- }), {})
297
+ }), {})
292
298
  );
293
299
  };
294
300