bri-components 1.2.61 → 1.2.62

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.61",
3
+ "version": "1.2.62",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -143,7 +143,13 @@
143
143
  }
144
144
 
145
145
  .ivu-tag-size-medium {
146
+ height: 24px;
146
147
  margin: 3px 4px 3px 0px;
148
+ line-height: 24px;
149
+
150
+ .ivu-icon {
151
+ padding: 0px;
152
+ }
147
153
  }
148
154
  }
149
155
  </style>
@@ -81,26 +81,38 @@
81
81
  class="DshCascaders-show"
82
82
  >
83
83
  <!-- 有值 -->
84
- <bri-tooltip
85
- v-if="!$isEmptyData(curValList)"
86
- :content="showMulVal"
87
- :transfer="true"
88
- >
84
+ <template v-if="!$isEmptyData(curValList)">
85
+ <!-- 详情查看页 且单独充满行的 -->
89
86
  <dsh-tags
87
+ v-if="isDetailShow && isHeightAuto"
90
88
  :class="{
91
89
  ...commonClass,
92
- 'DshCascaders-show-ellipsis': !(isDetailShow && isHeightAuto)
90
+ 'DshCascaders-show-auto': true
93
91
  }"
94
- :list="curValNameList"
92
+ :list="curValObjList"
93
+ itemClass="DshCascaders-show-auto-tag"
95
94
  ></dsh-tags>
96
- </bri-tooltip>
95
+
96
+ <bri-tooltip
97
+ v-else
98
+ :content="showMulVal"
99
+ :transfer="true"
100
+ >
101
+ <dsh-tags
102
+ :class="{
103
+ ...commonClass,
104
+ 'DshCascaders-show-ellipsis': true
105
+ }"
106
+ :list="curValObjList"
107
+ itemClass="DshCascaders-show-ellipsis-tag"
108
+ ></dsh-tags>
109
+ </bri-tooltip>
110
+ </template>
97
111
 
98
112
  <!-- 无值 -->
99
113
  <div
100
114
  v-else
101
- :class="{
102
- ...commonClass
103
- }"
115
+ :class="commonClass"
104
116
  >
105
117
  {{ emptyShowVal }}
106
118
  </div>
@@ -161,6 +173,8 @@
161
173
  </script>
162
174
 
163
175
  <style lang="less">
176
+ @import url("../../control.less");
177
+
164
178
  .DshCascader {
165
179
  &-show {
166
180
  &-ellipsis {
@@ -171,10 +185,6 @@
171
185
 
172
186
  // 多选
173
187
  .DshCascaders {
174
- &-show {
175
- &-ellipsis {
176
- .dsh-ellipsis();
177
- }
178
- }
188
+ #control-select(cascader);
179
189
  }
180
190
  </style>
@@ -74,19 +74,33 @@
74
74
  class="DshCheckbox-show"
75
75
  >
76
76
  <!-- 有值 -->
77
- <bri-tooltip
78
- v-if="!$isEmptyData(curValList)"
79
- :content="showMulVal"
80
- :transfer="true"
81
- >
77
+ <template v-if="!$isEmptyData(curValList)">
78
+ <!-- 详情查看页 且单独充满行的 -->
82
79
  <dsh-tags
80
+ v-if="isDetailShow && isHeightAuto"
83
81
  :class="{
84
82
  ...commonClass,
85
- 'DshCheckbox-show-ellipsis': !(isDetailShow && isHeightAuto)
83
+ 'DshCheckbox-show-auto': true
86
84
  }"
87
85
  :list="curValObjList"
86
+ itemClass="DshCheckbox-show-auto-tag"
88
87
  ></dsh-tags>
89
- </bri-tooltip>
88
+
89
+ <bri-tooltip
90
+ v-else
91
+ :content="showMulVal"
92
+ :transfer="true"
93
+ >
94
+ <dsh-tags
95
+ :class="{
96
+ ...commonClass,
97
+ 'DshCheckbox-show-ellipsis': true
98
+ }"
99
+ :list="curValObjList"
100
+ itemClass="DshCheckbox-show-tag"
101
+ ></dsh-tags>
102
+ </bri-tooltip>
103
+ </template>
90
104
 
91
105
  <!-- 无值 -->
92
106
  <div
@@ -84,19 +84,32 @@
84
84
  class="DshSelect-show"
85
85
  >
86
86
  <!-- 有值 -->
87
- <bri-tooltip
88
- v-if="!$isEmptyData(curVal)"
89
- :content="showVal"
90
- :transfer="true"
91
- >
87
+ <template v-if="!$isEmptyData(curVal)">
92
88
  <dsh-tags
89
+ v-if="isDetailShow && isHeightAuto"
93
90
  :class="{
94
91
  ...commonClass,
95
- 'DshSelect-show-ellipsis': !(isDetailShow && isHeightAuto)
92
+ 'DshSelect-show-auto': true
96
93
  }"
97
94
  :list="[curValObj]"
95
+ itemClass="DshSelect-show-auto-tag"
98
96
  ></dsh-tags>
99
- </bri-tooltip>
97
+
98
+ <bri-tooltip
99
+ v-else
100
+ :content="showVal"
101
+ :transfer="true"
102
+ >
103
+ <dsh-tags
104
+ :class="{
105
+ ...commonClass,
106
+ 'DshSelect-show-ellipsis': true
107
+ }"
108
+ :list="[curValObj]"
109
+ itemClass="DshSelect-show-ellipsis-tag"
110
+ ></dsh-tags>
111
+ </bri-tooltip>
112
+ </template>
100
113
 
101
114
  <!-- 无值 -->
102
115
  <div
@@ -25,15 +25,46 @@
25
25
  </div>
26
26
 
27
27
  <!-- 单选模式 查看 -->
28
- <span
28
+ <div
29
29
  v-else-if="!multipleMode && !canEdit"
30
- :class="{
31
- ...commonClass
32
- }"
33
- :style="showStyle"
30
+ class="DshSwitch-show"
34
31
  >
35
- {{ showVal }}
36
- </span>
32
+ <!-- 有值 -->
33
+ <template v-if="!$isEmptyData(curVal)">
34
+ <dsh-tags
35
+ v-if="isDetailShow && isHeightAuto"
36
+ :class="{
37
+ ...commonClass,
38
+ 'DshSwitch-show-auto': true
39
+ }"
40
+ :list="[curValObj]"
41
+ itemClass="DshSwitch-show-auto-tag"
42
+ ></dsh-tags>
43
+
44
+ <bri-tooltip
45
+ v-else
46
+ :content="showVal"
47
+ :transfer="true"
48
+ >
49
+ <dsh-tags
50
+ :class="{
51
+ ...commonClass,
52
+ 'DshSwitch-show-ellipsis': true
53
+ }"
54
+ :list="[curValObj]"
55
+ itemClass="DshSwitch-show-ellipsis-tag"
56
+ ></dsh-tags>
57
+ </bri-tooltip>
58
+ </template>
59
+
60
+ <!-- 无值 -->
61
+ <div
62
+ v-else
63
+ :class="commonClass"
64
+ >
65
+ {{ emptyShowVal }}
66
+ </div>
67
+ </div>
37
68
 
38
69
  <!-- 多选模式 -->
39
70
  <dsh-checkbox
@@ -46,7 +77,7 @@
46
77
  </template>
47
78
 
48
79
  <script>
49
- import switchMixin from "./switchMixin.js";
80
+ import switchMixin from "../../mixins/switchMixin.js";
50
81
 
51
82
  export default {
52
83
  name: "DshSwitch",
@@ -63,7 +94,7 @@
63
94
  return {
64
95
  _size: "default", // "default", "small", "large"
65
96
 
66
- ...this.switchPropsObj
97
+ ...this.basePropsObj
67
98
  };
68
99
  }
69
100
  },
@@ -73,7 +104,9 @@
73
104
  </script>
74
105
 
75
106
  <style lang="less">
76
- .DshSwitch {
107
+ @import url("../../control.less");
77
108
 
109
+ .DshSwitch {
110
+ #control-select(switch);
78
111
  }
79
112
  </style>
@@ -152,7 +152,6 @@
152
152
  &.ivu-select-multiple {
153
153
  .ivu-select-selection {
154
154
  height: 32px;
155
- .dsh-flex-row-between-center();
156
155
 
157
156
  & > div {
158
157
  .bri-scrollbar3();
@@ -162,7 +161,7 @@
162
161
  white-space: nowrap;
163
162
  overflow: auto;
164
163
  overflow-y: hidden;
165
-
164
+
166
165
  .ivu-tag {
167
166
  margin: 2px 4px 0px 0px;
168
167
  background-color: @borderColor;
@@ -188,8 +187,19 @@
188
187
 
189
188
  // 查看
190
189
  &-show {
190
+ &-auto {
191
+ &-tag {
192
+ height: auto!important;
193
+ }
194
+ }
195
+
191
196
  &-ellipsis {
197
+ margin: 2px 0px;
192
198
  .dsh-ellipsis();
199
+
200
+ &-tag {
201
+ .dsh-ellipsis();
202
+ }
193
203
  }
194
204
  }
195
205
  }
@@ -114,13 +114,24 @@ export default {
114
114
  ? this.emptyShowVal
115
115
  : this.curValName;
116
116
  },
117
+ curValObjList () {
118
+ return this.curValNameList.map((item, index) => {
119
+ return {
120
+ _key: index,
121
+ name: item,
122
+ style: {
123
+ ...this.tagStyle
124
+ }
125
+ };
126
+ });
127
+ },
117
128
  curValNameList () {
118
129
  return this.curValList.map(item => this.transformFullName(item));
119
130
  },
120
131
  showMulVal () {
121
132
  return this.$isEmptyData(this.curValList)
122
133
  ? this.emptyShowVal
123
- : this.curValNameList.join("");
134
+ : this.curValNameList.join("");
124
135
  }
125
136
  },
126
137
  created () { },
@@ -36,7 +36,21 @@ export default {
36
36
  },
37
37
  data () {
38
38
  return {
39
- showModal: false
39
+ showModal: false,
40
+
41
+ tagStyle: {
42
+ display: "inline-block",
43
+ "max-width": "100%",
44
+ height: "24px",
45
+ padding: "4px 8px",
46
+ margin: "2px 4px 2px 0px",
47
+ "border-radius": "4px",
48
+ "line-height": "16px",
49
+ "font-size": "12px",
50
+
51
+ backgroundColor: "#E5E5E5",
52
+ color: "rgb(0, 0, 0, 0.9)"
53
+ }
40
54
  };
41
55
  },
42
56
  computed: {
@@ -46,7 +46,7 @@ export default {
46
46
  curValObj () {
47
47
  return this.getItemObj(this.curVal);
48
48
  },
49
- valStr: {
49
+ curValName: {
50
50
  get () {
51
51
  return this.curValObj
52
52
  ? this.curValObj.name || this.curValObj._name
@@ -61,19 +61,19 @@ export default {
61
61
  showVal () {
62
62
  return this.$isEmptyData(this.curVal)
63
63
  ? this.emptyShowVal
64
- : this.valStr;
64
+ : this.curValName;
65
65
  },
66
66
  // 已选择项的对象列表
67
67
  curValObjList () {
68
68
  return this.curValList.map(key => this.getItemObj(key));
69
69
  },
70
- valListStr () {
71
- return this.curValObjList.map(item => item.name || item._name).join("、");
70
+ curValNameList () {
71
+ return this.curValObjList.map(item => item.name || item._name);
72
72
  },
73
73
  showMulVal () {
74
74
  return this.$isEmptyData(this.curValList)
75
75
  ? this.emptyShowVal
76
- : this.valListStr;
76
+ : this.curValNameList.join("、");
77
77
  }
78
78
  },
79
79
  created () {
@@ -136,11 +136,8 @@ export default {
136
136
  // 每项的具体样式 -查看状态时用
137
137
  getItemShowStyle (item) {
138
138
  return {
139
- ...this.getItemColorStyle(item),
140
- display: "inline-block",
141
- "max-width": "100%",
142
- padding: "0px 6px",
143
- "border-radius": "4px"
139
+ ...this.tagStyle,
140
+ ...this.getItemColorStyle(item)
144
141
  };
145
142
  },
146
143
  // 获取单选项的置灰状态
@@ -1,5 +1,5 @@
1
- import controlMixin from "../../mixins/controlMixin.js";
2
- import DshCheckbox from "../DshSelect/DshCheckbox.vue";
1
+ import controlMixin from "./controlMixin.js";
2
+ import DshCheckbox from "../base/DshSelect/DshCheckbox.vue";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -13,7 +13,7 @@ export default {
13
13
  return {};
14
14
  },
15
15
  computed: {
16
- switchPropsObj () {
16
+ basePropsObj () {
17
17
  return {
18
18
  loading: false, // 是否为加载状态
19
19
  _openColor: this.$appData.themeColor, // 打开时的背景色
@@ -50,16 +50,20 @@ export default {
50
50
  showStyle () {
51
51
  return !this.$isEmptyData(this.curVal)
52
52
  ? {
53
+ ...this.tagStyle,
53
54
  backgroundColor: this.curVal === true ? "#d3f3dc" : "#FDEDED",
54
- color: this.curVal === true ? "#37C45E" : "#E83636",
55
- display: "inline-block",
56
- "max-width": "100%",
57
- padding: "0px 6px",
58
- "border-radius": "4px"
55
+ color: this.curVal === true ? "#37C45E" : "#E83636"
59
56
  }
60
57
  : {};
61
58
  },
62
59
 
60
+ curValObj () {
61
+ return {
62
+ _key: "1",
63
+ name: this.showVal,
64
+ style: this.showStyle
65
+ };
66
+ },
63
67
  showVal () {
64
68
  return this.$isEmptyData(this.curVal)
65
69
  ? this.emptyShowVal
@@ -90,12 +90,15 @@
90
90
  <td
91
91
  class="DshCrossTable-col DshCrossTable-col-content"
92
92
  :style="{
93
- background: '#F7F9FD'
93
+ background: '#F7F9FD',
94
+ display: 'flex',
95
+ width: (propsObj.titleWidth ? propsObj.titleWidth : 160)+ 'px'
94
96
  }"
95
97
  >
96
98
  <bri-tooltip
97
99
  transfer
98
100
  :content="colItem.title"
101
+ style="width: calc(100% - 16px)"
99
102
  >
100
103
  <div class="td-content dsh-ellipsis">
101
104
  <slot
@@ -112,22 +115,23 @@
112
115
 
113
116
  <template v-else>
114
117
  {{ colItem.title }}
115
- <Tooltip
116
- v-if="colItem._comment"
117
- :content="colItem._comment"
118
- :transfer="true"
119
- placement="top-start"
120
- max-width="200"
121
- >
122
- <Icon
123
- type="ios-help-circle-outline"
124
- size="16"
125
- />
126
- </Tooltip>
127
118
  </template>
128
119
  </slot>
129
120
  </div>
130
121
  </bri-tooltip>
122
+ <Tooltip
123
+ style="width:16px"
124
+ v-if="colItem._comment"
125
+ :content="colItem._comment"
126
+ :transfer="true"
127
+ placement="top-start"
128
+ max-width="200"
129
+ >
130
+ <Icon
131
+ type="ios-help-circle-outline"
132
+ size="16"
133
+ />
134
+ </Tooltip>
131
135
  </td>
132
136
  </tr>
133
137
  </table>
@@ -82,5 +82,6 @@
82
82
  <style lang="less" scoped>
83
83
  .BriTooltip {
84
84
  width: 100%;
85
+ display: flex;
85
86
  }
86
87
  </style>
@@ -3,7 +3,7 @@
3
3
  ref="DshTags"
4
4
  :class="{
5
5
  'DshTags': true,
6
- 'DshTags-autoEllipsis': autoEllipsis
6
+ 'DshTags-auto': autoEllipsis
7
7
  }"
8
8
  >
9
9
  <Tag
@@ -11,6 +11,7 @@
11
11
  :key="tagIndex"
12
12
  ref="tagItem"
13
13
  :style="tagItem.style"
14
+ :class="itemClass || tagItem.class"
14
15
  :disabled="getItemDisabled(tagItem)"
15
16
  :name="tagIndex"
16
17
  :type="propsObj.type"
@@ -51,8 +52,11 @@
51
52
  placement="bottom"
52
53
  popper-class="DshTags-poptip"
53
54
  >
54
- <dsh-icons :list="[moreOperation]" />
55
+ <dsh-icons :list="[{
56
+ customIcon: 'bico-gengduo'
57
+ }]" />
55
58
  {{ subList.length }}项
59
+
56
60
  <div slot="content">
57
61
  <Tag
58
62
  v-for="(tagItem, tagIndex) in subList"
@@ -100,6 +104,9 @@
100
104
  return {};
101
105
  }
102
106
  },
107
+ itemClass: {
108
+ type: String
109
+ },
103
110
  autoEllipsis: {
104
111
  type: Boolean,
105
112
  default: false
@@ -128,20 +135,13 @@
128
135
  };
129
136
  },
130
137
  computed: {
131
- moreOperation () {
132
- return {
133
- customIcon: "bico-gengduo"
134
- };
135
- },
136
138
  computedList () {
137
139
  return this.list.slice(0, this.maxTagCount);
138
140
  },
139
141
  subList () {
140
- if (this.autoEllipsis && this.maxTagCount) {
141
- return this.list.slice(this.maxTagCount);
142
- } else {
143
- return [];
144
- }
142
+ return this.autoEllipsis && this.maxTagCount
143
+ ? this.list.slice(this.maxTagCount)
144
+ : [];
145
145
  }
146
146
  },
147
147
  created () {},
@@ -150,6 +150,14 @@
150
150
 
151
151
  window.addEventListener("resize", this.callEliipsis, true);
152
152
  },
153
+ destroyed () {
154
+ window.removeEventListener("resize", this.callEliipsis, true);
155
+ },
156
+ watch: {
157
+ list: function () {
158
+ this.callEliipsis();
159
+ }
160
+ },
153
161
  methods: {
154
162
  // 删除标签
155
163
  deleteTag (event, item, index) {
@@ -194,14 +202,25 @@
194
202
  }
195
203
  }
196
204
  }
197
- },
198
- watch: {
199
- list: function () {
200
- this.callEliipsis();
201
- }
202
- },
203
- destroyed () {
204
- window.removeEventListener("resize", this.callEliipsis, true);
205
205
  }
206
206
  };
207
207
  </script>
208
+
209
+ <style lang="less">
210
+ .DshTags {
211
+ &-auto {
212
+ overflow: hidden;
213
+ width: 100%;
214
+ }
215
+
216
+ &-poptip {
217
+ &-tag {
218
+ margin: 2px 0;
219
+ .dsh-flex-row-between-center();
220
+ }
221
+ .ivu-tag-text {
222
+ .dsh-ellipsis();
223
+ }
224
+ }
225
+ }
226
+ </style>
@@ -32,7 +32,6 @@
32
32
  @import "./small/DshIcons.less";
33
33
  @import "./small/DshModal.less";
34
34
  @import "./small/DshSteps.less";
35
- @import "./small/DshTags.less";
36
35
  @import "./small/DshTitle.less";
37
36
 
38
37
  @import "./small/DshBtnModal.less";
@@ -43,10 +43,6 @@
43
43
 
44
44
  &-body {
45
45
  overflow: hidden;
46
-
47
- td {
48
- width: 100% !important;
49
- }
50
46
  }
51
47
 
52
48
  &-footer {
@@ -78,7 +74,6 @@
78
74
  }
79
75
 
80
76
  &-col {
81
- width: 160px !important;
82
77
  font-weight: bold;
83
78
  color: #5D5D5D;
84
79
 
@@ -18,4 +18,20 @@
18
18
  &-rel {
19
19
  width: 100%;
20
20
  }
21
+ }
22
+
23
+ .ivu-tag {
24
+ &-default {
25
+ border: none;
26
+ background-color: @borderColor;
27
+ color: @text-color;
28
+ }
29
+
30
+ .ivu-tag-text {
31
+ color: inherit;
32
+ }
33
+
34
+ &[disabled] {
35
+ background-color: @border-disabled;
36
+ }
21
37
  }
@@ -1,36 +0,0 @@
1
- .DshTags {
2
- &-autoEllipsis {
3
- overflow: hidden;
4
- width: 100%;
5
- }
6
-
7
- &-poptip {
8
- &-tag {
9
- margin: 2px 0;
10
- .dsh-flex-row-between-center();
11
- }
12
- .ivu-tag-text {
13
- .dsh-ellipsis();
14
- }
15
- }
16
- }
17
-
18
- .ivu-tag {
19
- &-default {
20
- border: none;
21
- background-color: @borderColor;
22
- color: @text-color;
23
- }
24
- &-size-medium {
25
- height: 24px;
26
- padding: 0 8px;
27
- line-height: 26px;
28
- }
29
- &[disabled] {
30
- background-color: @border-disabled;
31
- }
32
-
33
- .ivu-tag-text {
34
- color: inherit;
35
- }
36
- }