bri-components 1.2.65 → 1.2.67

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.65",
3
+ "version": "1.2.67",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -1,32 +1,30 @@
1
1
  <template>
2
- <!-- 单选模式 -->
2
+ <!-- 单选模式 编辑 -->
3
3
  <div
4
- v-if="!multipleMode"
4
+ v-if="!multipleMode && canEdit"
5
5
  class="DshInput"
6
6
  >
7
- <!-- 编辑 -->
8
- <template v-if="canEdit">
9
- <Input
10
- class="DshInput-edit"
11
- v-model="value[controlKey]"
12
- :type="inputType"
13
- :placeholder="selfPropsObj._placeholder"
14
- :readonly="selfPropsObj._readonly"
15
- :disabled="selfPropsObj._disabled"
16
- :clearable="selfPropsObj._clearable"
17
- :size="selfPropsObj._size"
18
- :rows="selfPropsObj._rows"
19
- :search="selfPropsObj._search"
20
- :show-word-limit="selfPropsObj._showWordLimit"
21
- :maxlength="selfPropsObj._maxlength"
22
- :autosize="selfPropsObj._autosize"
23
- @on-enter="onEnter"
24
- @on-search="onSearch"
25
- @on-focus="onFocus"
26
- @on-change="onChange"
27
- @on-blur="onBlur"
28
- @on-clear="onClear"
29
- >
7
+ <i-input
8
+ class="DshInput-edit"
9
+ v-model="value[controlKey]"
10
+ :type="inputType"
11
+ :placeholder="selfPropsObj._placeholder"
12
+ :readonly="selfPropsObj._readonly"
13
+ :disabled="selfPropsObj._disabled"
14
+ :clearable="selfPropsObj._clearable"
15
+ :size="selfPropsObj._size"
16
+ :rows="selfPropsObj._rows"
17
+ :search="selfPropsObj._search"
18
+ :show-word-limit="selfPropsObj._showWordLimit"
19
+ :maxlength="selfPropsObj._maxlength"
20
+ :autosize="selfPropsObj._autosize"
21
+ @on-enter="onEnter"
22
+ @on-search="onSearch"
23
+ @on-focus="onFocus"
24
+ @on-change="onChange"
25
+ @on-blur="onBlur"
26
+ @on-clear="onClear"
27
+ >
30
28
  <span
31
29
  v-if="selfPropsObj._prepend"
32
30
  slot="prepend"
@@ -36,49 +34,61 @@
36
34
  v-if="selfPropsObj._append"
37
35
  slot="append"
38
36
  >{{ selfPropsObj._append }}</span>
39
- </Input>
40
- </template>
37
+ </i-input>
38
+ </div>
41
39
 
42
- <!-- 查看 -->
43
- <template v-else>
44
- <!-- 查看页 的textarea单独处理 -->
45
- <template v-if="inputType === 'textarea' && !$isEmptyData(curVal) && !isUnitShow">
46
- <p
47
- class="DshInput-show-textarea"
48
- v-text="showVal"
49
- ></p>
50
- </template>
40
+ <!-- 单选模式 查看 -->
41
+ <div v-else-if="!multipleMode && !canEdit">
42
+ <!-- 有值 -->
43
+ <template v-if="!$isEmptyData(curVal)">
44
+ <!-- 详情页查看 且单独占一行高度自由时 -->
45
+ <div
46
+ v-if="isHeightAuto"
47
+ :class="{
48
+ ...commonClass,
49
+ 'DshInput-show-auto': true
50
+ }"
51
+ v-html="showVal"
52
+ ></div>
51
53
 
52
54
  <!-- 表格和查看页 里的查看 -->
53
- <template v-else>
54
- <bri-tooltip
55
- :content="showVal"
56
- :defaultDisabled="false"
57
- maxWidth="200"
58
- :transfer="true"
59
- >
60
- <div :class="{
55
+ <bri-tooltip
56
+ v-else
57
+ :content="showVal"
58
+ :defaultDisabled="false"
59
+ :transfer="true"
60
+ >
61
+ <a
62
+ v-if="inputType === 'url'"
63
+ :class="{
61
64
  ...commonClass,
62
- 'DshInput-unit': isUnitShow,
63
- 'DshInput-show': !isUnitShow
64
- }">
65
- <!-- 有值 -->
66
- <a
67
- v-if="inputType === 'url' && !$isEmptyData(curVal)"
68
- class="text"
69
- @click="goHttpWindow($event)"
70
- >
71
- {{ showVal }}
72
- </a>
65
+ 'DshInput-show-ellipsis': true,
66
+ 'DshInput-show-ellipsis-url': true
67
+ }"
68
+ @click="goHttpWindow($event)"
69
+ >
70
+ {{ showVal }}
71
+ </a>
73
72
 
74
- <!-- 无值 -->
75
- <template v-else>
76
- {{ showVal }}
77
- </template>
78
- </div>
79
- </bri-tooltip>
80
- </template>
73
+ <div
74
+ v-else
75
+ :class="{
76
+ ...commonClass,
77
+ 'DshInput-show-ellipsis': true
78
+ }"
79
+ >
80
+ {{ showVal }}
81
+ </div>
82
+ </bri-tooltip>
81
83
  </template>
84
+
85
+ <!-- 无值 -->
86
+ <div
87
+ v-else
88
+ :class="commonClass"
89
+ >
90
+ {{ emptyShowVal }}
91
+ </div>
82
92
  </div>
83
93
 
84
94
  <!-- 多选模式 -->
@@ -117,7 +127,8 @@
117
127
  _readonly: ["serialNumber"].includes(this.controlType),
118
128
  _showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
119
129
  _autosize: {
120
- minRows: 2
130
+ minRows: 2,
131
+ maxRows: 20
121
132
  },
122
133
 
123
134
  ...this.propsObj,
@@ -182,16 +193,23 @@
182
193
  </script>
183
194
 
184
195
  <style lang="less">
196
+ @import url("../../control.less");
197
+
185
198
  .DshInput {
199
+ #control-show();
186
200
  width: 100%;
187
201
 
188
202
  &-show {
189
- &-textarea {
190
- display: inline-block;
191
- width: 100%;
192
- height: auto;
193
- white-space: pre-wrap;
194
- min-height: 32px;
203
+ &-auto {
204
+ white-space: pre-wrap!important;
205
+ max-height: 500px;
206
+ overflow: auto;
207
+ }
208
+
209
+ &-ellipsis {
210
+ &-url {
211
+ color: @themeColor!important;
212
+ }
195
213
  }
196
214
  }
197
215
  }
@@ -33,7 +33,11 @@
33
33
  <!-- dropdown模式 -->
34
34
  <template v-else>
35
35
  <Select
36
- class="DshCheckbox-dropdown"
36
+ :class="{
37
+ 'DshCheckbox-dropdown': true,
38
+ 'DshCheckbox-dropdown-auto': isHeightAuto,
39
+ 'DshCheckbox-dropdown-scroll': !isHeightAuto,
40
+ }"
37
41
  :value="curValList"
38
42
  :multiple="true"
39
43
  :placeholder="selfPropsObj._placeholder"
@@ -130,7 +134,7 @@
130
134
  return {
131
135
  _max: 100000000,
132
136
  _transfer: true,
133
- _transferClassName: "",
137
+ _transferClassName: "DshCheckbox-dropdown-transfer",
134
138
 
135
139
  ...this.basePropsObj
136
140
  };
@@ -151,6 +151,7 @@
151
151
  selfPropsObj () {
152
152
  return {
153
153
  _transfer: true,
154
+ _transferClassName: "DshSelect-dropdown-transfer",
154
155
 
155
156
  ...this.basePropsObj
156
157
  };
@@ -50,7 +50,6 @@
50
50
  background-color: @themeColor;
51
51
  }
52
52
  }
53
-
54
53
  .ivu-checkbox-inner {
55
54
  background-color: @themeColor;
56
55
  }
@@ -65,22 +64,29 @@
65
64
  &-disabled {
66
65
  .ivu-@{control-type} {
67
66
  .ivu-@{control-type}-inner {
68
- border-color: #aaaaaa!important; // 为了useColor且disbaled时,压住下面each里的样式,这些还生效
67
+ border-color: #aaaaaa;
69
68
  }
70
69
 
71
70
  &-checked {
72
- .ivu-@{control-type}-inner {
73
- background-color: #E5E5E5!important; // 为了useColor且disbaled时,压住下面each里的样式,这些还生效
74
-
71
+ // 因为不一致,所以明确名字分开写
72
+ .ivu-radio-inner {
73
+ &::after {
74
+ background-color: #aaaaaa;
75
+ }
76
+ }
77
+ .ivu-checkbox-inner {
78
+ background-color: #aaaaaa;
79
+
80
+ // 对勾的颜色
75
81
  &::after {
76
- background-color: #aaaaaa!important; // 为了useColor且disbaled时,压住下面each里的样式,这些还生效
82
+ border-color: #f3f3f3;
77
83
  }
78
84
  }
79
85
  }
80
86
 
81
87
 
82
88
  & + span {
83
- color: #aaaaaa!important; // 为了useColor且disbaled时,压住下面each里的样式,这些还生效
89
+ color: #aaaaaa;
84
90
  }
85
91
  }
86
92
  }
@@ -149,11 +155,39 @@
149
155
  }
150
156
 
151
157
  &-disabled {
152
- border-color: #f3f3f3;
153
- background-color: #f3f3f3!important; // 压住style里的background-color
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.5;
186
+ }
187
+ }
154
188
 
155
189
  &.ivu-@{control-type}-wrapper-checked {
156
- border-color: #aaaaaa;
190
+ border-color: #cccccc;
157
191
  }
158
192
  }
159
193
  }
@@ -174,21 +208,14 @@
174
208
  }
175
209
 
176
210
  &-dropdown {
211
+ // 输入框部分
177
212
  &.ivu-select-multiple {
178
213
  .ivu-select-selection {
179
- height: 32px;
180
-
181
214
  & > div {
182
- .bri-scrollbar3();
183
215
  width: 100%;
184
216
  height: 100%;
185
- word-break: keep-all;
186
- white-space: nowrap;
187
- overflow: auto;
188
- overflow-y: hidden;
189
217
 
190
218
  .ivu-tag {
191
- margin: 2px 4px 0px 0px;
192
219
  background-color: @borderColor;
193
220
  }
194
221
  }
@@ -203,9 +230,50 @@
203
230
  }
204
231
  }
205
232
  }
233
+ }
234
+
235
+ &-auto {
236
+ &.ivu-select-multiple {
237
+ .ivu-select-selection {
238
+ & > div {
239
+ .ivu-tag {
240
+ height: auto;
241
+
242
+ span:not(.ivu-select-max-tag) {
243
+ text-overflow: auto;
244
+ white-space: normal;
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
+ &-scroll {
253
+ &.ivu-select-multiple {
254
+ .ivu-select-selection {
255
+ height: 32px;
256
+
257
+ & > div {
258
+ .bri-scrollbar3();
259
+ word-break: keep-all;
260
+ white-space: nowrap;
261
+ overflow: auto;
262
+ overflow-y: hidden;
263
+
264
+ .ivu-tag {
265
+
266
+ }
267
+ }
268
+ }
269
+ }
270
+ }
206
271
 
207
- .ivu-select-item-selected:after {
208
- content: none;
272
+ // 下拉面板
273
+ &-transfer {
274
+ &.ivu-select-dropdown {
275
+ max-width: 200px;
276
+ max-height: 350px;
209
277
  }
210
278
  }
211
279
  }
@@ -14,14 +14,16 @@ export default {
14
14
  basePropsObj () {
15
15
  const _joinSymbol = this.propsObj._joinSymbol || "/";
16
16
  return {
17
- _showMode: "default",
17
+ _showMode: "default", // "default", "custom", "simple"
18
18
  colorMap: resourceData.colorMap,
19
19
  _useColor: false,
20
20
  _saveKey: "_key",
21
21
  _valueKey: "code",
22
22
  _nameKey: "name",
23
- _filterable: true,
24
- _cascaderFilterVals: [], // 过滤级联数据,只保留的数组
23
+ _filterable: true, // 是否支持搜索
24
+ _data: [],
25
+ _reverseFilter: false, // 是否反向过滤,默认正向过滤
26
+ _cascaderFilterVals: [], // 过滤的级联数据
25
27
  _renderFormat: (labels) => labels.join(_joinSymbol),
26
28
 
27
29
  ...this.propsObj,
@@ -54,6 +56,9 @@ export default {
54
56
  cascaderLevel () {
55
57
  return this.selfPropsObj._cascaderLevel;
56
58
  },
59
+ reverseFilter () {
60
+ return this.selfPropsObj._reverseFilter;
61
+ },
57
62
  cascaderFilterVals () {
58
63
  return this.selfPropsObj._cascaderFilterVals;
59
64
  },
@@ -70,8 +75,12 @@ export default {
70
75
  },
71
76
  cascaderData () {
72
77
  const loop = (arr = [], level, parentKeys = [], filterVals = [], isMobile = false) => {
73
- if (arr && filterVals.length) {
74
- arr = arr.filter(item => filterVals.includes(item[this.saveKey]));
78
+ if (filterVals.length) {
79
+ arr = arr.filter(item =>
80
+ this.reverseFilter
81
+ ? !filterVals.includes(item[this.saveKey])
82
+ : filterVals.includes(item[this.saveKey])
83
+ );
75
84
  }
76
85
 
77
86
  return arr
@@ -154,7 +163,7 @@ export default {
154
163
  confirmMulCb (selectedValue, selectedOptions) {
155
164
  if (this.curValList.some(item => JSON.stringify(item) === JSON.stringify(selectedValue))) {
156
165
  this.$Message.error({
157
- content: `"${this.transformFullName(selectedValue)}"已选择,请勿重复选择!`,
166
+ content: `请勿重复选择"${this.transformFullName(selectedValue)}"!`,
158
167
  duration: 4
159
168
  });
160
169
  } else {
@@ -187,7 +196,7 @@ export default {
187
196
  }
188
197
  : {
189
198
  _key: val,
190
- name: `提示:选项${val}已找不到`,
199
+ name: `提示:选项${val}已不存在`,
191
200
  style: {
192
201
  ...this.tagStyle
193
202
  }
@@ -18,9 +18,11 @@ export default {
18
18
  _optionKind: "dropdown", // "flat"、"dropdown"
19
19
  colorMap: resourceData.colorMap,
20
20
  _useColor: false,
21
- _filterable: true,
21
+ _filterable: true, // 是否支持搜索
22
22
  _data: [],
23
23
  _customData: [],
24
+ _reverseFilter: false, // 是否反向过滤,默认正向过滤
25
+ _selectFilterVals: [], // 过滤的数据
24
26
 
25
27
  ...this.propsObj,
26
28
  ...this.commonDealPropsObj
@@ -35,14 +37,27 @@ export default {
35
37
  useColor () {
36
38
  return this.selfPropsObj._useColor;
37
39
  },
40
+ reverseFilter () {
41
+ return this.selfPropsObj._reverseFilter;
42
+ },
43
+ selectFilterVals () {
44
+ return this.selfPropsObj._selectFilterVals;
45
+ },
46
+
38
47
  listData () {
39
- const listData = this.selfPropsObj._data.concat(this.initListData);
48
+ let listData = this.selfPropsObj._data.concat(this.initListData);
49
+ if (this.selectFilterVals.length) {
50
+ listData = listData.filter(item =>
51
+ this.reverseFilter
52
+ ? !this.selectFilterVals.includes(item._key)
53
+ : this.selectFilterVals.includes(item._key)
54
+ );
55
+ }
40
56
 
41
57
  return this.$dataType(this.selfPropsObj._filterFunc, "function")
42
58
  ? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
43
59
  : listData;
44
60
  },
45
-
46
61
  curValObj () {
47
62
  return this.getItemObj(this.curVal);
48
63
  },
@@ -120,7 +135,7 @@ export default {
120
135
  getItemObj (val) {
121
136
  const obj = this.listData.find(item => item._key === val) || {
122
137
  _key: val,
123
- name: `提示:选项${val}已找不到`
138
+ name: `提示:选项${val}已不存在`
124
139
  };
125
140
 
126
141
  return !this.$isEmptyData(val)
@@ -105,7 +105,7 @@
105
105
  v-else
106
106
  class="tree-nodata"
107
107
  >
108
- 暂无数据……
108
+ 暂无数据…
109
109
  </div>
110
110
  </div>
111
111
  </template>
@@ -85,8 +85,10 @@
85
85
 
86
86
  <div
87
87
  v-else
88
- class="dsh-tip"
89
- >{{ "--- 无字段 ---" }}</div>
88
+ class="DshForm-nodata"
89
+ >
90
+ {{ "--- 无字段 ---" }}
91
+ </div>
90
92
  </Row>
91
93
  </Form>
92
94
  </template>
@@ -400,6 +402,10 @@
400
402
  &-item-FormItem {
401
403
  margin-bottom: 0px;
402
404
  }
405
+
406
+ &-nodata {
407
+ #dsh-nodata();
408
+ }
403
409
  }
404
410
  </style>
405
411
  <style lang="less">
@@ -20,7 +20,7 @@
20
20
  v-else
21
21
  class="BriCard-nodata"
22
22
  >
23
- 暂无数据……
23
+ 暂无数据…
24
24
  </div>
25
25
  </div>
26
26
  </template>
@@ -59,7 +59,7 @@
59
59
  isLoading: Boolean,
60
60
  noDataText: {
61
61
  type: String,
62
- default: "暂无内容"
62
+ default: "暂无数据…"
63
63
  },
64
64
  columns: Array,
65
65
  data: Array,
@@ -13,7 +13,7 @@
13
13
  :propsObj="listPropsObj"
14
14
  :changedFields="changedFields"
15
15
  :isLoading="listPropsObj && listPropsObj.isLoading"
16
- :noDataText="listPropsObj && listPropsObj.noDataText || '暂无内容...'"
16
+ :noDataText="listPropsObj && listPropsObj.noDataText || '暂无数据…'"
17
17
  @clickRow="clickRow"
18
18
  @sortChange="changeSort"
19
19
  @changeSelect="changeSelect"