bri-components 1.2.61 → 1.2.63

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.63",
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>
@@ -29,18 +29,31 @@
29
29
  class="DshCascader-show"
30
30
  >
31
31
  <!-- 有值 -->
32
- <bri-tooltip
33
- v-if="!$isEmptyData(curValList)"
34
- :content="showVal"
35
- :transfer="true"
36
- >
37
- <div :class="{
38
- commonClass,
39
- 'DshCascader-show-ellipsis': true
40
- }">
32
+ <template v-if="!$isEmptyData(curValList)">
33
+ <!-- 详情页查看 且单独占一行高度自由时 -->
34
+ <div
35
+ v-if="isDetailShow && isHeightAuto"
36
+ :class="{
37
+ ...commonClass,
38
+ 'DshCascader-show-auto': true
39
+ }"
40
+ >
41
41
  {{ showVal }}
42
42
  </div>
43
- </bri-tooltip>
43
+
44
+ <bri-tooltip
45
+ v-else
46
+ :content="showVal"
47
+ :transfer="true"
48
+ >
49
+ <div :class="{
50
+ ...commonClass,
51
+ 'DshCascader-show-ellipsis': true
52
+ }">
53
+ {{ showVal }}
54
+ </div>
55
+ </bri-tooltip>
56
+ </template>
44
57
 
45
58
  <!-- 无值 -->
46
59
  <div
@@ -81,26 +94,38 @@
81
94
  class="DshCascaders-show"
82
95
  >
83
96
  <!-- 有值 -->
84
- <bri-tooltip
85
- v-if="!$isEmptyData(curValList)"
86
- :content="showMulVal"
87
- :transfer="true"
88
- >
97
+ <template v-if="!$isEmptyData(curValList)">
98
+ <!-- 详情页查看 且单独占一行高度自由时 -->
89
99
  <dsh-tags
100
+ v-if="isDetailShow && isHeightAuto"
90
101
  :class="{
91
102
  ...commonClass,
92
- 'DshCascaders-show-ellipsis': !(isDetailShow && isHeightAuto)
103
+ 'DshCascaders-show-auto': true
93
104
  }"
94
- :list="curValNameList"
105
+ :list="curValObjList"
106
+ itemClass="DshCascaders-show-auto-tag"
95
107
  ></dsh-tags>
96
- </bri-tooltip>
108
+
109
+ <bri-tooltip
110
+ v-else
111
+ :content="showMulVal"
112
+ :transfer="true"
113
+ >
114
+ <dsh-tags
115
+ :class="{
116
+ ...commonClass,
117
+ 'DshCascaders-show-ellipsis': true
118
+ }"
119
+ :list="curValObjList"
120
+ itemClass="DshCascaders-show-ellipsis-tag"
121
+ ></dsh-tags>
122
+ </bri-tooltip>
123
+ </template>
97
124
 
98
125
  <!-- 无值 -->
99
126
  <div
100
127
  v-else
101
- :class="{
102
- ...commonClass
103
- }"
128
+ :class="commonClass"
104
129
  >
105
130
  {{ emptyShowVal }}
106
131
  </div>
@@ -161,20 +186,21 @@
161
186
  </script>
162
187
 
163
188
  <style lang="less">
189
+ @import url("../../control.less");
190
+
164
191
  .DshCascader {
192
+ #control-show();
193
+
165
194
  &-show {
195
+ &-auto,
166
196
  &-ellipsis {
167
- .dsh-ellipsis();
197
+ margin: 6px;
168
198
  }
169
199
  }
170
200
  }
171
201
 
172
202
  // 多选
173
203
  .DshCascaders {
174
- &-show {
175
- &-ellipsis {
176
- .dsh-ellipsis();
177
- }
178
- }
204
+ #control-show();
179
205
  }
180
206
  </style>
@@ -51,7 +51,7 @@
51
51
  :label="item.name || item._name"
52
52
  :disabled="getCheckItemDisabled(item, index)"
53
53
  >
54
- <Checkbox :value="curValList.includes(item._key)"></Checkbox>
54
+ <Checkbox :value="getItemCheckStatus(item)"></Checkbox>
55
55
 
56
56
  <slot :item="item"></slot>
57
57
 
@@ -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-ellipsis-tag"
101
+ ></dsh-tags>
102
+ </bri-tooltip>
103
+ </template>
90
104
 
91
105
  <!-- 无值 -->
92
106
  <div
@@ -139,6 +153,7 @@
139
153
  @import url("../../control.less");
140
154
 
141
155
  .DshCheckbox {
156
+ #control-show();
142
157
  #control-select(checkbox);
143
158
  }
144
159
  </style>
@@ -84,19 +84,33 @@
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)">
88
+ <!-- 详情页查看 且单独占一行高度自由时 -->
92
89
  <dsh-tags
90
+ v-if="isDetailShow && isHeightAuto"
93
91
  :class="{
94
92
  ...commonClass,
95
- 'DshSelect-show-ellipsis': !(isDetailShow && isHeightAuto)
93
+ 'DshSelect-show-auto': true
96
94
  }"
97
95
  :list="[curValObj]"
96
+ itemClass="DshSelect-show-auto-tag"
98
97
  ></dsh-tags>
99
- </bri-tooltip>
98
+
99
+ <bri-tooltip
100
+ v-else
101
+ :content="showVal"
102
+ :transfer="true"
103
+ >
104
+ <dsh-tags
105
+ :class="{
106
+ ...commonClass,
107
+ 'DshSelect-show-ellipsis': true
108
+ }"
109
+ :list="[curValObj]"
110
+ itemClass="DshSelect-show-ellipsis-tag"
111
+ ></dsh-tags>
112
+ </bri-tooltip>
113
+ </template>
100
114
 
101
115
  <!-- 无值 -->
102
116
  <div
@@ -154,6 +168,7 @@
154
168
  @import url("../../control.less");
155
169
 
156
170
  .DshSelect {
171
+ #control-show();
157
172
  #control-select(radio);
158
173
  }
159
174
  </style>
@@ -13,7 +13,6 @@
13
13
  :false-color="selfPropsObj._closeColor"
14
14
  :true-value="selfPropsObj._openValue"
15
15
  :false-value="selfPropsObj._closeValue"
16
- @on-change="change"
17
16
  >
18
17
  <span slot="open">
19
18
  {{ selfPropsObj._openText }}
@@ -25,15 +24,47 @@
25
24
  </div>
26
25
 
27
26
  <!-- 单选模式 查看 -->
28
- <span
27
+ <div
29
28
  v-else-if="!multipleMode && !canEdit"
30
- :class="{
31
- ...commonClass
32
- }"
33
- :style="showStyle"
29
+ class="DshSwitch-show"
34
30
  >
35
- {{ showVal }}
36
- </span>
31
+ <!-- 有值 -->
32
+ <template v-if="!$isEmptyData(curVal)">
33
+ <!-- 详情页查看 且单独占一行高度自由时 -->
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-show();
78
111
  }
79
112
  </style>
@@ -1,3 +1,24 @@
1
+ // 控件查看状态的样式
2
+ #control-show () {
3
+ &-show {
4
+ &-auto {
5
+ &-tag {
6
+ height: auto!important;
7
+ }
8
+ }
9
+
10
+ &-ellipsis {
11
+ margin: 2px 0px;
12
+ .dsh-ellipsis();
13
+
14
+ &-tag {
15
+ .dsh-ellipsis();
16
+ }
17
+ }
18
+ }
19
+ }
20
+
21
+ // 单选多选控件样式
1
22
  #control-select (@control-type) {
2
23
  &-flat {
3
24
  width: 100%;
@@ -152,7 +173,6 @@
152
173
  &.ivu-select-multiple {
153
174
  .ivu-select-selection {
154
175
  height: 32px;
155
- .dsh-flex-row-between-center();
156
176
 
157
177
  & > div {
158
178
  .bri-scrollbar3();
@@ -162,7 +182,7 @@
162
182
  white-space: nowrap;
163
183
  overflow: auto;
164
184
  overflow-y: hidden;
165
-
185
+
166
186
  .ivu-tag {
167
187
  margin: 2px 4px 0px 0px;
168
188
  background-color: @borderColor;
@@ -185,11 +205,5 @@
185
205
  }
186
206
  }
187
207
  }
208
+ }
188
209
 
189
- // 查看
190
- &-show {
191
- &-ellipsis {
192
- .dsh-ellipsis();
193
- }
194
- }
195
- }
@@ -1,5 +1,5 @@
1
1
  import controlMixin from "./controlMixin.js";
2
- import { regionData, userIndustryData } from "bri-datas";
2
+ import { resourceData, regionData, userIndustryData } from "bri-datas";
3
3
 
4
4
  export default {
5
5
  mixins: [
@@ -15,6 +15,8 @@ export default {
15
15
  const _joinSymbol = this.propsObj._joinSymbol || "/";
16
16
  return {
17
17
  _showMode: "default",
18
+ colorMap: resourceData.colorMap,
19
+ _useColor: false,
18
20
  _saveKey: "_key",
19
21
  _valueKey: "code",
20
22
  _nameKey: "name",
@@ -34,6 +36,12 @@ export default {
34
36
  showType () {
35
37
  return this.selfPropsObj._showMode;
36
38
  },
39
+ colorMap () {
40
+ return this.selfPropsObj.colorMap;
41
+ },
42
+ useColor () {
43
+ return this.selfPropsObj._useColor;
44
+ },
37
45
  saveKey () {
38
46
  return this.selfPropsObj._saveKey;
39
47
  },
@@ -99,12 +107,17 @@ export default {
99
107
  return loop(this.originData, this.cascaderLevel, undefined, this.cascaderFilterVals, this.isMobile);
100
108
  },
101
109
 
110
+ curValObj () {
111
+ return this.getItemObj(this.curValList);
112
+ },
102
113
  curValName: {
103
114
  get () {
104
- return this.transformFullName(this.curValList);
115
+ return this.curValObj
116
+ ? this.curValObj[this.nameKey]
117
+ : "";
105
118
  },
106
- set (str) {
107
- if (!str) {
119
+ set (val) {
120
+ if (!val) {
108
121
  this.clickClear();
109
122
  }
110
123
  }
@@ -114,13 +127,17 @@ export default {
114
127
  ? this.emptyShowVal
115
128
  : this.curValName;
116
129
  },
130
+ // 已选择项的对象列表
131
+ curValObjList () {
132
+ return this.curValList.map(arrItem => this.getItemObj(arrItem));
133
+ },
117
134
  curValNameList () {
118
- return this.curValList.map(item => this.transformFullName(item));
135
+ return this.curValObjList.map(item => item[this.nameKey]);
119
136
  },
120
137
  showMulVal () {
121
138
  return this.$isEmptyData(this.curValList)
122
139
  ? this.emptyShowVal
123
- : this.curValNameList.join("");
140
+ : this.curValNameList.join("");
124
141
  }
125
142
  },
126
143
  created () { },
@@ -153,9 +170,43 @@ export default {
153
170
  },
154
171
 
155
172
  /* --------- 工具类 -------- */
173
+ getItemObj (val) {
174
+ const objArr = this.$getTreeLinealDatas(val, this.cascaderData, undefined, this.saveKey);
175
+
176
+ return !this.$isEmptyData(val)
177
+ ? objArr.length
178
+ ? {
179
+ ...objArr.slice(-1)[0],
180
+ [this.nameKey]: this.transformFullName(val),
181
+ // 查看状态时tag用
182
+ style: {
183
+ ...this.tagStyle,
184
+ ...this.getItemColorStyle(objArr.slice(-1)[0])
185
+ },
186
+ color: undefined
187
+ }
188
+ : {
189
+ _key: val,
190
+ name: `提示:选项${val}已找不到`,
191
+ style: {
192
+ ...this.tagStyle
193
+ }
194
+ }
195
+ : undefined;
196
+ },
197
+ // 每项的颜色相关style --flat方式在用
198
+ getItemColorStyle (item) {
199
+ const color = this.colorMap[item.color] || this.colorMap["color-1"];
200
+ return this.useColor
201
+ ? {
202
+ backgroundColor: this.$getColor(color, 0.1),
203
+ color: color
204
+ }
205
+ : {};
206
+ },
156
207
  // 转化出级联全名
157
- transformFullName (value) {
158
- return this.renderFormat(this.$getTreeLinealDatas(value, this.cascaderData, this.nameKey, this.saveKey));
208
+ transformFullName (val) {
209
+ return this.renderFormat(this.$getTreeLinealDatas(val, this.cascaderData, this.nameKey, this.saveKey));
159
210
  }
160
211
  }
161
212
  };
@@ -188,6 +188,8 @@ export default {
188
188
  });
189
189
  }
190
190
  },
191
+
192
+ // 接口 -获得某个节点对应的描述内容
191
193
  getDescription (value = []) {
192
194
  if (value.length) {
193
195
  this.$https({
@@ -201,7 +203,7 @@ export default {
201
203
  },
202
204
  callback: data => {
203
205
  this.description = data;
204
- this.selectedObj.description = data;
206
+ // this.selectedObj.description = data;
205
207
  }
206
208
  });
207
209
  }
@@ -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: {
@@ -116,8 +130,8 @@ export default {
116
130
  return {
117
131
  "bri-control-edit": this.canEdit && this.finalCanEdit,
118
132
  "bri-control-disabled": this.canEdit && !this.finalCanEdit,
119
- "bri-control-unit": !this.canEdit && this.isInTable,
120
- "bri-control-show": !this.canEdit && !this.isInTable,
133
+ "bri-control-unit": this.isUnitShow,
134
+ "bri-control-show": this.isDetailShow,
121
135
 
122
136
  "dsh-ellipsis": this.isUnitShow,
123
137
  "bri-control-nodata": this.$isEmptyData(this.curVal)
@@ -15,8 +15,8 @@ export default {
15
15
  computed: {
16
16
  basePropsObj () {
17
17
  return {
18
- colorMap: resourceData.colorMap,
19
18
  _optionKind: "dropdown", // "flat"、"dropdown"
19
+ colorMap: resourceData.colorMap,
20
20
  _useColor: false,
21
21
  _filterable: true,
22
22
  _data: [],
@@ -29,12 +29,12 @@ export default {
29
29
  showType () {
30
30
  return this.selfPropsObj._optionKind;
31
31
  },
32
- useColor () {
33
- return this.selfPropsObj._useColor;
34
- },
35
32
  colorMap () {
36
33
  return this.selfPropsObj.colorMap;
37
34
  },
35
+ useColor () {
36
+ return this.selfPropsObj._useColor;
37
+ },
38
38
  listData () {
39
39
  const listData = this.selfPropsObj._data.concat(this.initListData);
40
40
 
@@ -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
@@ -54,26 +54,26 @@ export default {
54
54
  },
55
55
  set (val) {
56
56
  if (!val) {
57
- this.curVal = "";
57
+ this.clickClear();
58
58
  }
59
59
  }
60
60
  },
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 () {
@@ -84,6 +84,10 @@ export default {
84
84
  this.getListData();
85
85
  },
86
86
 
87
+ // 点击清除
88
+ clickClear () {
89
+ this.curVal = "";
90
+ },
87
91
  // 单选模式 点击选项
88
92
  clickRadioItem (item, index) {
89
93
  if (!this.getRadioItemDisabled(item)) {
@@ -105,16 +109,37 @@ export default {
105
109
  // 多选模式 点击选项
106
110
  clickCheckItem (item, index) {
107
111
  if (!this.getCheckItemDisabled(item)) {
108
- if (this.curValList.includes(item._key)) {
109
- this.curValList = this.curValList.filter(key => key !== item._key);
110
- } else {
111
- this.curValList = [...this.curValList, item._key];
112
- }
112
+ this.curValList = this.getItemCheckStatus(item)
113
+ ? this.curValList.filter(key => key !== item._key)
114
+ : [...this.curValList, item._key];
113
115
  }
114
116
  },
115
117
 
116
118
  /* ------- 方法 ------- */
117
- // 每项的class集合 --flat方式在用
119
+ // 获取某项的对象数据
120
+ getItemObj (val) {
121
+ const obj = this.listData.find(item => item._key === val) || {
122
+ _key: val,
123
+ name: `提示:选项${val}已找不到`
124
+ };
125
+
126
+ return !this.$isEmptyData(val)
127
+ ? {
128
+ ...obj,
129
+ // 查看状态时tag用
130
+ style: {
131
+ ...this.tagStyle,
132
+ ...this.getItemColorStyle(obj)
133
+ },
134
+ color: undefined
135
+ }
136
+ : undefined;
137
+ },
138
+ // 获取某项的选中状态
139
+ getItemCheckStatus (item) {
140
+ return this.curValList.includes(item._key);
141
+ },
142
+ // 获取某项的class集合 --flat方式在用
118
143
  getItemClass (item) {
119
144
  return [
120
145
  this.useColor
@@ -123,7 +148,7 @@ export default {
123
148
  item.class
124
149
  ];
125
150
  },
126
- // 每项的颜色相关style --flat方式在用
151
+ // 获取某项的颜色相关style --flat方式在用
127
152
  getItemColorStyle (item) {
128
153
  const color = this.colorMap[item.color] || this.colorMap["color-1"];
129
154
  return this.useColor
@@ -133,16 +158,6 @@ export default {
133
158
  }
134
159
  : {};
135
160
  },
136
- // 每项的具体样式 -查看状态时用
137
- getItemShowStyle (item) {
138
- return {
139
- ...this.getItemColorStyle(item),
140
- display: "inline-block",
141
- "max-width": "100%",
142
- padding: "0px 6px",
143
- "border-radius": "4px"
144
- };
145
- },
146
161
  // 获取单选项的置灰状态
147
162
  getRadioItemDisabled (item) {
148
163
  return !!(
@@ -155,23 +170,9 @@ export default {
155
170
  return !!(
156
171
  this.selfPropsObj._disabled ||
157
172
  item._disabled ||
158
- (this.curValList.length >= this.selfPropsObj._max && !this.curValList.includes(item._key))
173
+ (this.curValList.length >= this.selfPropsObj._max && !this.getItemCheckStatus(item))
159
174
  );
160
175
  },
161
- getItemObj (key) {
162
- const obj = this.listData.find(item => item._key === key) || {
163
- _key: key,
164
- name: `温馨提示:选项${key}已找不到`
165
- };
166
-
167
- return this.$isEmptyData(key)
168
- ? undefined
169
- : {
170
- ...obj,
171
- style: this.getItemShowStyle(obj),
172
- color: undefined
173
- };
174
- },
175
176
 
176
177
  // TODO:待删除 接口 -获取自定义的接口数据
177
178
  getListData () {
@@ -182,12 +183,10 @@ export default {
182
183
  callback: data => {
183
184
  this.initListData = [
184
185
  ...this.initListData,
185
- ...data.list.map(dataItem =>
186
- ({
187
- _key: dataItem._key,
188
- name: dataItem.name
189
- })
190
- )
186
+ ...data.list.map(dataItem => ({
187
+ _key: dataItem._key,
188
+ name: dataItem.name
189
+ }))
191
190
  ];
192
191
  }
193
192
  });
@@ -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, // 打开时的背景色
@@ -47,19 +47,20 @@ export default {
47
47
  ...this.propsObj
48
48
  };
49
49
  },
50
- showStyle () {
50
+
51
+ curValObj () {
51
52
  return !this.$isEmptyData(this.curVal)
52
53
  ? {
53
- 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"
54
+ _key: "1",
55
+ name: this.showVal,
56
+ style: {
57
+ ...this.tagStyle,
58
+ backgroundColor: this.curVal === true ? "#d3f3dc" : "#FDEDED",
59
+ color: this.curVal === true ? "#37C45E" : "#E83636"
60
+ }
59
61
  }
60
- : {};
62
+ : undefined;
61
63
  },
62
-
63
64
  showVal () {
64
65
  return this.$isEmptyData(this.curVal)
65
66
  ? 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,24 @@
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
+ }
37
+ }
38
+
39
+ .ivu-select-dropdown {
40
+ max-width: 800px;
21
41
  }
@@ -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
- }