bri-components 1.2.84 → 1.2.86

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.84",
3
+ "version": "1.2.86",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -31,7 +31,7 @@
31
31
  height: auto;
32
32
  padding: 6px 0px;
33
33
  margin-right: 12px;
34
- margin-bottom: 4px;
34
+ margin-top: 4px;
35
35
  white-space: normal;
36
36
 
37
37
  .ivu-@{control-type} {
@@ -86,7 +86,7 @@
86
86
 
87
87
 
88
88
  & + span {
89
- color: #aaaaaa;
89
+ color: #999999;
90
90
  }
91
91
  }
92
92
  }
@@ -97,6 +97,67 @@
97
97
  }
98
98
 
99
99
  &-color {
100
+ #template (@color) {
101
+ .ivu-@{control-type} {
102
+ .ivu-@{control-type}-inner {
103
+ border-color: @color;
104
+ }
105
+
106
+ &-checked {
107
+ // 因为不一致,所以明确名字分开写
108
+ .ivu-radio-inner {
109
+ &::after {
110
+ background-color: @color;
111
+ }
112
+ }
113
+ .ivu-checkbox-inner {
114
+ background-color: @color;
115
+ }
116
+ }
117
+ }
118
+
119
+ &-checked {
120
+ border-color: @color;
121
+ }
122
+
123
+ &-disabled {
124
+ border-color: transparent;
125
+
126
+ .ivu-@{control-type} {
127
+ .ivu-@{control-type}-inner {
128
+ border-color: #cccccc;
129
+ }
130
+
131
+ &-checked {
132
+ // 因为不一致,所以明确名字分开写
133
+ .ivu-radio-inner {
134
+ &::after {
135
+ background-color: #cccccc;
136
+ }
137
+ }
138
+ .ivu-checkbox-inner {
139
+ background-color: #cccccc;
140
+
141
+ // 对勾的颜色
142
+ &::after {
143
+ border-color: #f3f3f3;
144
+ }
145
+ }
146
+ }
147
+
148
+
149
+ & + span {
150
+ color: @color;
151
+ opacity: 0.6;
152
+ }
153
+ }
154
+
155
+ &.ivu-@{control-type}-wrapper-checked {
156
+ border-color: #cccccc;
157
+ }
158
+ }
159
+ }
160
+
100
161
  .ivu-@{control-type}-wrapper {
101
162
  padding: 6px 15px;
102
163
  border-radius: 4px;
@@ -105,10 +166,8 @@
105
166
 
106
167
  .ivu-@{control-type} {
107
168
  .ivu-@{control-type}-inner {
108
- border: 2px solid @themeColor;
109
- background-color: transparent;
169
+ border: 2px solid #aaaaaa;
110
170
  }
111
-
112
171
  // 因为不一致,所以明确名字分开写
113
172
  .ivu-radio-inner {
114
173
  width: 14px;
@@ -119,77 +178,50 @@
119
178
  height: 6px;
120
179
  left: 2px;
121
180
  top: 2px;
181
+ background-color: transparent;
122
182
  }
123
183
  }
124
184
  .ivu-checkbox-inner {
185
+ background-color: transparent;
186
+
125
187
  &::after {
126
188
  top: 2px;
127
189
  left: 4px;
128
190
  }
129
191
  }
130
- }
131
- }
132
-
133
- each(@resourceColor, {
134
- .color-@{index}.ivu-@{control-type}-wrapper {
135
- .ivu-@{control-type} {
136
- .ivu-@{control-type}-inner {
137
- border-color: @value;
138
- }
139
192
 
140
- &-checked {
141
- // 因为不一致,所以明确名字分开写
142
- .ivu-radio-inner {
143
- &::after {
144
- background-color: @value;
145
- }
146
- }
147
- .ivu-checkbox-inner {
148
- background-color: @value;
193
+ &-checked {
194
+ // 因为不一致,所以明确名字分开写
195
+ .ivu-radio-inner {
196
+ &::after {
197
+ background-color: #aaaaaa;
149
198
  }
150
199
  }
200
+ .ivu-checkbox-inner {
201
+ background-color: #aaaaaa;
202
+ }
151
203
  }
204
+ }
152
205
 
153
- &-checked {
154
- border-color: @value;
206
+ &-checked {
207
+ border-color: #aaaaaa;
208
+ }
209
+ }
210
+
211
+ .color-default.ivu-@{control-type}-wrapper {
212
+ // 为了填补default主题下无style
213
+ // background-color: @theme-focus!important;
214
+ .ivu-@{control-type} {
215
+ & + span {
216
+ color: @themeColor;
155
217
  }
218
+ }
156
219
 
157
- &-disabled {
158
- border-color: transparent;
159
-
160
- .ivu-@{control-type} {
161
- .ivu-@{control-type}-inner {
162
- border-color: #cccccc;
163
- }
164
-
165
- &-checked {
166
- // 因为不一致,所以明确名字分开写
167
- .ivu-radio-inner {
168
- &::after {
169
- background-color: #cccccc;
170
- }
171
- }
172
- .ivu-checkbox-inner {
173
- background-color: #cccccc;
174
-
175
- // 对勾的颜色
176
- &::after {
177
- border-color: #f3f3f3;
178
- }
179
- }
180
- }
181
-
182
-
183
- & + span {
184
- color: @value;
185
- opacity: 0.6;
186
- }
187
- }
188
-
189
- &.ivu-@{control-type}-wrapper-checked {
190
- border-color: #cccccc;
191
- }
192
- }
220
+ #template(@themeColor);
221
+ }
222
+ each(@resourceColor, {
223
+ .color-@{index}.ivu-@{control-type}-wrapper {
224
+ #template(@value);
193
225
  }
194
226
  });
195
227
  }
@@ -201,6 +233,7 @@
201
233
 
202
234
  .ivu-@{control-type}-wrapper {
203
235
  height: 30px;
236
+ margin-top: 0px;
204
237
  margin-bottom: 2px;
205
238
  white-space: nowrap;
206
239
  }
@@ -24,11 +24,12 @@
24
24
  class="DshAdvSearch-conditions-loop"
25
25
  >
26
26
  <dsh-adv-search
27
- :isInner="true"
28
27
  :mode="mode"
28
+ :isInner="true"
29
29
  :value="conditionItem"
30
30
  :formList="canSearchFormList"
31
- :dynamicFieldsMap="dynamicFieldsMap"
31
+ :useChainField="useChainField"
32
+ :dynamicFormList="dynamicFormList"
32
33
  @change="change('loopControl', conditionItem, ...arguments)"
33
34
  >
34
35
  <slot
@@ -50,34 +51,19 @@
50
51
  <dsh-form-unit
51
52
  v-else-if="['field', undefined].includes(conditionItem.logic)"
52
53
  :key="`${conditionItem._id}field`"
53
- class="DshAdvSearch-conditions-item"
54
+ :class="{
55
+ 'DshAdvSearch-conditions-item': true,
56
+ 'DshAdvSearch-conditions-item-dynamic': conditionItem.dynamicList && conditionItem.dynamicList.length
57
+ }"
54
58
  :formData="conditionItem"
55
59
  :formItem="conditionItem.formItem"
56
60
  height="80"
57
61
  @change="change('control', conditionItem, ...arguments)"
58
62
  >
59
- <slot :conditionItem="conditionItem">
60
- <template v-if="!conditionItem.__isDelete__">
61
- <!-- 子表的筛选,出现是有条件的,递归 -->
62
- <template v-if="['subSearch', 'subTableSearch'].includes(conditionItem.fieldOperator)">
63
- <dsh-adv-search
64
- v-if="conditionItem.finished === true"
65
- :isInner="true"
66
- :mode="mode"
67
- :value="conditionItem.fieldSearch"
68
- :formList="conditionItem.subFormList"
69
- :dynamicFieldsMap="dynamicFieldsMap"
70
- @change="change('subSearch', conditionItem, ...arguments)"
71
- ></dsh-adv-search>
72
-
73
- <div
74
- v-else
75
- class="DshAdvSearch-conditions-item-loading"
76
- >加载中……</div>
77
- </template>
78
-
79
- <!-- 动态筛选字段,出现是有条件的 -->
80
- <template v-else-if="conditionItem.parameterType === 'dynamicText'">
63
+ <template v-if="!conditionItem.__isDelete__">
64
+ <slot :conditionItem="conditionItem">
65
+ <!-- 动态文本 -匹配的动态筛选字段 -->
66
+ <template v-if="conditionItem.parameterType === 'dynamicText'">
81
67
  <dsh-select
82
68
  v-if="useChainField"
83
69
  class="DshAdvSearch-conditions-item-control"
@@ -103,13 +89,35 @@
103
89
  ></dsh-checkbox>
104
90
  </template>
105
91
 
106
- <!-- 为空和不为空时 啥不显示 -->
107
- <div
108
- v-else-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
109
- class="DshAdvSearch-conditions-item-blank"
110
- >请选择右上角条件</div>
111
- </template>
112
- </slot>
92
+ <!-- 固定文本 -筛选条件对应的显示 -->
93
+ <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
108
+ v-else
109
+ class="DshAdvSearch-conditions-item-loading"
110
+ >加载中……</div>
111
+ </template>
112
+
113
+ <!-- 为空和不为空时 啥不显示 -->
114
+ <div
115
+ v-else-if="['isnull', 'notnull', 'nosize', 'size', 'nolist', 'list'].includes(conditionItem.fieldOperator)"
116
+ class="DshAdvSearch-conditions-item-blank"
117
+ >请选择右上角条件</div>
118
+ </template>
119
+ </slot>
120
+ </template>
113
121
 
114
122
  <!-- 右上角 -->
115
123
  <div
@@ -343,7 +351,7 @@
343
351
  &-delete {
344
352
  position: absolute;
345
353
  top: 3px;
346
- right: -2px;
354
+ right: -3px;
347
355
  padding: 3px;
348
356
  color: red;
349
357
  display: none;
@@ -412,7 +420,7 @@
412
420
  }
413
421
 
414
422
  &-icon {
415
- margin-left: 3px;
423
+
416
424
  }
417
425
  }
418
426
  }
@@ -453,16 +461,13 @@
453
461
  &-conditions {
454
462
  &-item {
455
463
  .DshFormUnit-label-right {
456
- flex: 4;
457
- margin-right: 12px;
464
+ flex: 3;
465
+ margin-right: 10px;
458
466
  }
459
467
 
460
- // 左右显示时
461
- .DshFormUnit-line {
462
- padding-left: 0px;
463
-
468
+ &-dynamic {
464
469
  .DshFormUnit-label-right {
465
- flex: none;
470
+ flex: 4;
466
471
  }
467
472
  }
468
473
  }
@@ -176,11 +176,6 @@
176
176
  ? {
177
177
  _useShortcuts: false
178
178
  }
179
- // labels类型的
180
- : ["labels"].includes(formItem._type)
181
- ? {
182
- mode: "defaultSearch"
183
- }
184
179
  : {}
185
180
  )
186
181
  };
@@ -21,15 +21,15 @@ export default {
21
21
  }
22
22
  },
23
23
 
24
+ useChainField: {
25
+ type: Boolean,
26
+ default: false
27
+ },
24
28
  dynamicFormList: {
25
29
  type: Array,
26
30
  default () {
27
31
  return [];
28
32
  }
29
- },
30
- useChainField: {
31
- type: Boolean,
32
- default: false
33
33
  }
34
34
  },
35
35
  data () {
@@ -51,6 +51,7 @@ export default {
51
51
  _key: "parameterType",
52
52
  _clearable: false,
53
53
  _size: "small",
54
+ _default: "fixedText",
54
55
  _data: [
55
56
  { _key: "fixedText", name: "固定文本" },
56
57
  { _key: "dynamicText", name: "动态文本" }
@@ -116,25 +117,32 @@ export default {
116
117
  // 生成筛选条件的值
117
118
  createContionFunc (initContion = { logic: "field" }, curFormItem, fieldKey) {
118
119
  if (["field", undefined].includes(initContion.logic)) {
119
- const formItem = curFormItem || this.canSearchFormList.find(formItem => formItem._key === fieldKey);
120
+ curFormItem = curFormItem || this.canSearchFormList.find(formItem => formItem._key === fieldKey);
120
121
 
121
- if (formItem) {
122
- const fieldData = this.fieldMap[formItem._type];
122
+ if (curFormItem) {
123
+ const fieldData = this.fieldMap[curFormItem._type];
123
124
 
124
- const dynamicTypes = this.useChainField ? (fieldData.categoryKinds || []) : [formItem._type];
125
- const dynamicList = dynamicTypes.reduce((list, type) => [...list, ...(this.dynamicFieldsMap[type] || [])], []) || [];
125
+ const dynamicTypes = this.useChainField ? [...new Set([...(fieldData.categoryTypes || []), curFormItem._type])] : [curFormItem._type];
126
+ let dynamicList = dynamicTypes.reduce((list, type) => [...list, ...(this.dynamicFieldsMap[type] || [])], []);
127
+ dynamicList = this.useChainField
128
+ ? ["select", "checkbox", "cascader", "cascaders"].includes(curFormItem._type)
129
+ ? dynamicList.filter(dynamicItem => dynamicItem._resourceKey === curFormItem._resourceKey)
130
+ : ["reference"].includes(curFormItem._type) && !!curFormItem._ref
131
+ ? dynamicList.filter(dynamicItem => dynamicItem._ref === curFormItem._ref)
132
+ : dynamicList
133
+ : dynamicList;
126
134
  const parameterType = initContion.parameterType || ((initContion.fieldParams || []).length || initContion.chainFieldKey ? "dynamicText" : "fixedText");
127
- const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || {}).name;
135
+ const parameterTypeName = (this.parameterPropsObj._data.find(parameterTypeItem => parameterTypeItem._key === parameterType) || { name: `${parameterType}不存在` }).name;
128
136
 
129
137
  const operators = fieldData[this.mode === "set" ? "operatorsSet" : this.mode === "rely" ? "operatorsRely" : "operators"] || fieldData.operators || [];
130
138
  const fieldOperator = initContion.fieldOperator || (operators[0] || {})._key;
131
- const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || {}).name;
139
+ const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || { name: `${fieldOperator}不存在` }).name;
132
140
 
133
141
  return {
134
142
  _id: this.$ObjectID().str,
135
143
  logic: "field",
136
- fieldKey: formItem._key,
137
- fieldType: formItem._type,
144
+ fieldKey: curFormItem._key,
145
+ fieldType: curFormItem._type,
138
146
  fieldValue: [],
139
147
  fieldOperator: fieldOperator,
140
148
  fieldSearch: {
@@ -151,8 +159,8 @@ export default {
151
159
  parameterTypeName: parameterTypeName,
152
160
  operators: operators,
153
161
  fieldOperatorName: fieldOperatorName,
154
- formItem: this.getFormItem(formItem),
155
- subFormList: formItem._subForm || [],
162
+ formItem: this.getFormItem(curFormItem),
163
+ subFormList: curFormItem._subForm || [],
156
164
  finished: false // 标记 reference类型请求form数据 是否完成状态
157
165
  };
158
166
  } else {