bri-components 1.2.0 → 1.2.2

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.
Files changed (68) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/2.bri-components.min.js +1 -1
  4. package/lib/3.bri-components.min.js +1 -1
  5. package/lib/4.bri-components.min.js +1 -1
  6. package/lib/5.bri-components.min.js +1 -1
  7. package/lib/6.bri-components.min.js +1 -1
  8. package/lib/7.bri-components.min.js +1 -1
  9. package/lib/8.bri-components.min.js +1 -1
  10. package/lib/9.bri-components.min.js +1 -1
  11. package/lib/bri-components.min.js +6 -6
  12. package/package.json +1 -1
  13. package/src/.DS_Store +0 -0
  14. package/src/abolish/DshFlatTable.vue +1 -1
  15. package/src/components/.DS_Store +0 -0
  16. package/src/components/controls/.DS_Store +0 -0
  17. package/src/components/controls/base/BriUpload/BriUpload.vue +2 -1
  18. package/src/components/controls/base/BriUpload/BriUploadImage.vue +45 -32
  19. package/src/components/controls/base/BriUpload/uploadMixin.js +3 -2
  20. package/src/components/controls/base/DshCascader/DshCascader.vue +52 -53
  21. package/src/components/controls/base/DshCascader/InfoCascader.vue +3 -4
  22. package/src/components/controls/base/DshCheckbox.vue +133 -140
  23. package/src/components/controls/base/DshCoordinates.vue +121 -147
  24. package/src/components/controls/base/DshDaterange.vue +1 -1
  25. package/src/components/controls/base/DshEditor.vue +2 -1
  26. package/src/components/controls/base/DshSelect.vue +4 -14
  27. package/src/components/controls/base/DshSwitch.vue +13 -20
  28. package/src/components/controls/controlMap.js +4 -0
  29. package/src/components/controls/controlMixin.js +23 -12
  30. package/src/components/controls/senior/.DS_Store +0 -0
  31. package/src/components/controls/senior/BriLabels.vue +170 -158
  32. package/src/components/controls/senior/selectDepartments.vue +380 -0
  33. package/src/components/controls/senior/selectUsers/DepartmentMenu.vue +191 -0
  34. package/src/components/controls/senior/selectUsers/selectUsers.vue +482 -0
  35. package/src/components/list/BriCard.vue +52 -0
  36. package/src/components/list/BriTreeItem.vue +110 -0
  37. package/src/components/small/DshTags.vue +132 -9
  38. package/src/index.js +7 -3
  39. package/src/styles/.DS_Store +0 -0
  40. package/src/styles/common/control.less +61 -56
  41. package/src/styles/components/.DS_Store +0 -0
  42. package/src/styles/components/controls/.DS_Store +0 -0
  43. package/src/styles/components/controls/base/BriUpload/BriUpload.less +11 -3
  44. package/src/styles/components/controls/base/BriUpload/BriUploadImage.less +6 -0
  45. package/src/styles/components/controls/base/DshCascader/DshCascader.less +33 -81
  46. package/src/styles/components/controls/base/DshCheckbox.less +72 -103
  47. package/src/styles/components/controls/base/DshCoordinates.less +1 -35
  48. package/src/styles/components/controls/base/DshEditor.less +3 -2
  49. package/src/styles/components/controls/base/DshInput.less +4 -8
  50. package/src/styles/components/controls/base/DshNumber.less +2 -2
  51. package/src/styles/components/controls/base/DshSelect.less +19 -4
  52. package/src/styles/components/controls/base/DshSwitch.less +1 -31
  53. package/src/styles/components/controls/senior/.DS_Store +0 -0
  54. package/src/styles/components/controls/senior/BriLabels.less +32 -118
  55. package/src/styles/components/controls/senior/cascaderTable.less +1 -1
  56. package/src/styles/components/controls/senior/flatTable.less +1 -1
  57. package/src/styles/components/controls/senior/selectDepartments.less +106 -0
  58. package/src/styles/components/controls/senior/selectUsers/DepartmentMenu.less +37 -0
  59. package/src/styles/components/controls/senior/selectUsers/index.less +2 -0
  60. package/src/styles/components/controls/senior/selectUsers/selectUsers.less +167 -0
  61. package/src/styles/components/form/DshDefaultSearch.less +1 -2
  62. package/src/styles/components/index.less +7 -3
  63. package/src/styles/components/list/BriCard.less +50 -0
  64. package/src/styles/components/list/BriFlatTable.less +1 -1
  65. package/src/styles/components/list/BriTreeItem.less +50 -0
  66. package/src/styles/components/small/DshModal.less +20 -42
  67. package/src/styles/components/small/DshTags.less +32 -14
  68. package/src/styles/components/unit/DshFormItem.less +3 -26
@@ -1,24 +1,78 @@
1
1
  <template>
2
- <div class="DshTags">
2
+ <div
3
+ ref="DshTags"
4
+ :class="{
5
+ 'DshTags': true,
6
+ 'DshTags-autoEllipsis': autoEllipsis
7
+ }"
8
+ >
3
9
  <Tag
4
- v-for="(tagItem, tagIndex) in list"
10
+ v-for="(tagItem, tagIndex) in computedList"
5
11
  :key="tagIndex"
6
- :disabled="propsObj.disabled || tagItem.disabled"
12
+ ref="tagItem"
13
+ :style="tagItem.style"
14
+ :disabled="getItemDisabled(tagItem)"
7
15
  :name="tagIndex"
8
16
  :type="propsObj.type"
9
- :closable="closable(tagItem)"
17
+ :closable="getItemClosable(tagItem)"
10
18
  :checkable="propsObj.checkable"
11
19
  :checked="propsObj.checked"
12
- :color="propsObj.color || 'default'"
20
+ :color="propsObj.color || tagItem.color || 'primary'"
13
21
  :fade="propsObj.fade || false"
14
22
  :size="propsObj.size || 'medium'"
15
23
  @on-close="deleteTag($event, tagItem, tagIndex)"
16
24
  @on-change="changeChecked"
17
25
  >
18
26
  <slot :tagItem="tagItem">
19
- {{ tagItem }}
27
+ {{ $dataType(tagItem) === "object" ? tagItem.realname || tagItem.full_name || tagItem.name : tagItem }}
20
28
  </slot>
21
29
  </Tag>
30
+
31
+ <!-- 更多 -->
32
+ <Tag
33
+ v-if="subList.length"
34
+ :type="propsObj.type"
35
+ :checkable="propsObj.checkable"
36
+ :checked="propsObj.checked"
37
+ :color="propsObj.color || 'default'"
38
+ :fade="propsObj.fade || false"
39
+ :size="propsObj.size || 'medium'"
40
+ :disabled="propsObj.disabled"
41
+ >
42
+ <Poptip
43
+ :transfer="true"
44
+ :width="200"
45
+ trigger="hover"
46
+ word-wrap
47
+ placement="bottom"
48
+ popper-class="DshTags-poptip"
49
+ >
50
+ <dsh-icons :list="[moreOperation]" />
51
+ {{ subList.length }}项
52
+ <div slot="content">
53
+ <Tag
54
+ v-for="(tagItem, tagIndex) in subList"
55
+ :key="tagIndex"
56
+ :disabled="getItemDisabled(tagItem)"
57
+ :name="tagIndex"
58
+ :type="propsObj.type"
59
+ :closable="getItemClosable(tagItem)"
60
+ :checkable="propsObj.checkable"
61
+ :checked="propsObj.checked"
62
+ :color="propsObj.color || 'default'"
63
+ :fade="propsObj.fade || false"
64
+ :size="propsObj.size || 'medium'"
65
+ class="DshTags-poptip-tag"
66
+ @on-close="deleteTag($event, tagItem, tagIndex)"
67
+ @on-change="changeChecked"
68
+ >
69
+ <slot :tagItem="tagItem">
70
+ {{ $dataType(tagItem) === "object" ? tagItem.realname || tagItem.full_name || tagItem.name : tagItem }}
71
+ </slot>
72
+ </Tag>
73
+ </div>
74
+ </Poptip>
75
+ </Tag>
22
76
  </div>
23
77
  </template>
24
78
 
@@ -37,27 +91,96 @@
37
91
  default () {
38
92
  return {};
39
93
  }
94
+ },
95
+ autoEllipsis: {
96
+ type: Boolean,
97
+ default: false
40
98
  }
41
99
  },
42
100
  data () {
43
101
  return {
44
- closable (tagItem) {
45
- return this.propsObj.disabled || tagItem.disabled ? false : (this.propsObj.closable !== false);
102
+ maxTagCount: undefined,
103
+
104
+ getItemDisabled (item) {
105
+ return this.propsObj.disabled || item._disabled || item.disabled;
106
+ },
107
+ getItemClosable (item) {
108
+ return this.getItemDisabled(item) ? false : (this.propsObj.closable !== false);
46
109
  }
47
110
  };
48
111
  },
49
- computed: {},
112
+ computed: {
113
+ moreOperation () {
114
+ return {
115
+ customIcon: "bico-gengduo"
116
+ };
117
+ },
118
+ computedList () {
119
+ return this.list.slice(0, this.maxTagCount);
120
+ },
121
+ subList () {
122
+ if (this.autoEllipsis && this.maxTagCount) {
123
+ return this.list.slice(this.maxTagCount);
124
+ } else {
125
+ return [];
126
+ }
127
+ }
128
+ },
50
129
  created () {},
130
+ mounted () {
131
+ this.callEliipsis();
132
+
133
+ window.addEventListener("resize", this.callEliipsis, true);
134
+ },
51
135
  methods: {
52
136
  // 删除标签
53
137
  deleteTag (event, item, index) {
54
138
  this.list.splice(index, 1);
139
+ this.getAutoEllipsis();
55
140
  this.$emit("delete", item, index);
56
141
  },
57
142
  // 改变标签状态
58
143
  changeChecked (checked, name) {
59
144
 
145
+ },
146
+
147
+ getAutoEllipsis () {
148
+ let parWidth = this.$refs.DshTags.clientWidth;
149
+ let tags = this.$refs.tagItem;
150
+
151
+ for (let idx in tags) {
152
+ let el = tags[idx]["$el"];
153
+ let showEllipsis = el.clientWidth + el.offsetLeft > parWidth;
154
+
155
+ if (showEllipsis) {
156
+ // 判断加上... 是否被隐藏
157
+ if (el.clientWidth + el.offsetLeft + 40 < parWidth) {
158
+ this.maxTagCount = idx;
159
+ } else {
160
+ this.maxTagCount = idx - 1;
161
+ }
162
+ break;
163
+ } else {
164
+ this.maxTagCount = undefined;
165
+ }
166
+ }
167
+ },
168
+ callEliipsis () {
169
+ if (this.autoEllipsis) {
170
+ this.maxTagCount = undefined;
171
+ this.$nextTick(() => {
172
+ this.getAutoEllipsis();
173
+ });
174
+ }
60
175
  }
176
+ },
177
+ watch: {
178
+ list: function () {
179
+ this.callEliipsis();
180
+ }
181
+ },
182
+ destroyed () {
183
+ window.removeEventListener("resize", this.callEliipsis, true);
61
184
  }
62
185
  };
63
186
  </script>
package/src/index.js CHANGED
@@ -12,8 +12,8 @@ import DshBox from "./components/list/DshBox/DshBox.vue";
12
12
  import DshTable from "./components/list/DshBox/DshTable.vue";
13
13
  import DshList from "./components/list/DshBox/DshList.vue";
14
14
 
15
- import BriTable from "./components/list/BriTable.vue";
16
15
  import BriFlatTable from "./components/list/BriFlatTable.vue";
16
+ import BriTable from "./components/list/BriTable.vue";
17
17
  import DshCascaderTable from "./components/list/DshCascaderTable.vue";
18
18
  import DshPage from "./components/list/DshPage.vue";
19
19
 
@@ -66,7 +66,9 @@ import Error403 from "./components/Error/Error403.vue";
66
66
  import Error404 from "./components/Error/Error404.vue";
67
67
 
68
68
  // list
69
+ import BriCard from "./components/list/BriCard.vue";
69
70
  import BriTree from "./components/list/BriTree.vue";
71
+ import BriTreeItem from "./components/list/BriTreeItem.vue";
70
72
 
71
73
  // controls
72
74
  import BriInputs from "./components/controls/base/BriInputs.vue";
@@ -98,8 +100,8 @@ const map = {
98
100
  DshTable,
99
101
  DshList,
100
102
 
101
- BriTable,
102
103
  BriFlatTable, // 可取消全局
104
+ BriTable,
103
105
  DshCascaderTable, // 可取消全局
104
106
  DshPage,
105
107
 
@@ -186,9 +188,11 @@ export {
186
188
  DshTable,
187
189
  DshList,
188
190
 
191
+ BriCard,
192
+ BriFlatTable,
189
193
  BriTable,
190
194
  BriTree,
191
- BriFlatTable,
195
+ BriTreeItem,
192
196
  DshCascaderTable,
193
197
  DshPage,
194
198
 
Binary file
@@ -1,100 +1,105 @@
1
- // 表格展示-非通用
2
- .unit-show () {
1
+ // 单元格标签式展示 -非全部类型通用
2
+ .bri-unit-show () {
3
3
  background-color: @theme-focus;
4
4
  color: @themeColor;
5
5
  border-radius: @borderRadius;
6
- padding: 3px 8px;
6
+ padding: 2px 8px;
7
7
  line-height: 24px;
8
8
  display: inline;
9
9
  }
10
10
 
11
- // 表单模式
12
- .control-edit {
11
+ // 表单控件共用样式
12
+ .bri-control-edit {
13
13
  border: 1px solid @borderColor;
14
14
  border-radius: @borderRadius;
15
15
  background: @inputBg;
16
16
  cursor: pointer;
17
17
  color: @textColor;
18
- &.control-notext {
19
- .control-placeholder();
18
+
19
+ &.bri-control-nodata {
20
+ .bri-control-nodata();
20
21
  }
21
22
  }
22
- .control-disabled {
23
+ .bri-control-disabled {
23
24
  border: 1px solid @border-disabled;
24
25
  border-radius: @borderRadius;
25
26
  background: @inputBg-disabled;
26
27
  cursor: not-allowed;
27
28
  color: @textColor;
28
- &.control-notext {
29
- .control-disPlaceholder();
29
+
30
+ &.bri-control-nodata {
31
+ .bri-control-disabled-placeholder();
30
32
  }
31
33
  }
32
- .control-readonly {
33
- border: 1px solid @border-readonly;
34
- border-radius: @borderRadius;
35
- background: @inputBg-readonly;
36
- cursor: not-allowed;
37
- color: @textColor-readonly;
38
- }
39
- .control-show {
34
+ // .bri-control-readonly {
35
+ // border: 1px solid @border-readonly;
36
+ // border-radius: @borderRadius;
37
+ // background: @inputBg-readonly;
38
+ // cursor: not-allowed;
39
+ // color: @textColor-readonly;
40
+ // }
41
+ .bri-control-show {
40
42
  border: none;
41
43
  background-color: transparent;
42
- &.control-notext {
43
- .control-notext();
44
+
45
+ &.bri-control-nodata {
46
+ .bri-control-nodata();
44
47
  }
45
48
  }
46
- .control-unit {
49
+ .bri-control-unit {
47
50
  border: none;
48
51
  background-color: transparent;
49
- &.control-notext {
50
- color: @text-color;
52
+
53
+ // unit 模式下不用特殊处理颜色
54
+ &.bri-control-nodata {
55
+ .bri-control-nodata();
51
56
  }
52
57
  }
53
-
54
- // 编辑模式下无数据
55
- .control-placeholder {
58
+ // 无数据
59
+ .bri-control-nodata {
56
60
  color: @placeholderColor;
57
61
  }
58
62
  // 编辑disabled模式下无数据
59
- .control-disPlaceholder {
63
+ .bri-control-disabled-placeholder {
60
64
  color: @textColor-disabled;
61
65
  }
62
- // 查看模式下无数据
63
- .control-notext {
64
- color: @placeholderColor;
65
- }
66
-
67
- // unit 模式下不用特殊处理颜色
68
-
69
66
 
70
67
  // 展示为tag标签公共样式
71
- .control-wrap {
72
- width: 100%;
73
- &-box {
74
- height: 32px;
75
- padding: 4px 0 4px 4px;
76
- line-height: 24px;
77
- .dsh-flex-row-between-center();
78
- &:hover {
79
- .control-wrap-close {
80
- display: block;
81
- }
82
- }
68
+ #bri-control-wrap () {
69
+ .dsh-flex-row-between-center();
70
+ height: 32px;
71
+ padding: 4px 0 4px 4px;
72
+ line-height: 24px;
73
+
74
+ .text {
75
+ .dsh-ellipsis();
83
76
  }
84
-
85
- .control-edit.control-notext {
86
- padding-left: 7px;
77
+
78
+ .overflow {
79
+ overflow: auto;
80
+ .bri-scrollbar3();
87
81
  }
88
82
 
89
- &-text {
90
- .dsh-ellipsis();
83
+ .icon {
84
+ &-default {
85
+ padding: 5px;
86
+ color: @placeholderColor;
87
+ }
88
+
89
+ &-close {
90
+ padding: 5px;
91
+ display: none;
92
+ color: @placeholderColor;
93
+ }
91
94
  }
92
95
 
93
- &-close {
94
- padding: 5px;
95
- display: none;
96
+ &:hover {
97
+ .icon-close {
98
+ display: block;
99
+ }
96
100
  }
97
- &-icon {
98
- padding: 5px;
101
+
102
+ &.bri-control-nodata {
103
+ padding-left: 7px;
99
104
  }
100
105
  }
Binary file
@@ -132,7 +132,7 @@
132
132
  }
133
133
 
134
134
  &-disabled {
135
- .control-disabled();
135
+ .bri-control-disabled();
136
136
 
137
137
  .uploadList {
138
138
  &-old {
@@ -147,12 +147,20 @@
147
147
  }
148
148
 
149
149
  &-nodata {
150
- .control-disPlaceholder();
150
+ .bri-control-disabled-placeholder();
151
151
  text-indent: 7px;
152
152
  text-align: left;
153
153
  }
154
154
  &-inline-nodata {
155
- .control-disPlaceholder();
155
+ .bri-control-disabled-placeholder();
156
+ }
157
+ }
158
+ }
159
+
160
+ &-unit {
161
+ .uploadList {
162
+ &-inline-nodata {
163
+ .bri-control-nodata();
156
164
  }
157
165
  }
158
166
  }
@@ -78,4 +78,10 @@
78
78
  }
79
79
  }
80
80
  }
81
+
82
+ &-cropper {
83
+ width: 400px;
84
+ height: 400px;
85
+ margin: 0 auto;
86
+ }
81
87
  }
@@ -1,104 +1,56 @@
1
1
  .DshCascader {
2
2
  width: 100%;
3
3
 
4
- #multiple-content () {
5
- .hasdata {
4
+ &-edit {
5
+ // 多选
6
+ &-multiple {
6
7
  width: 100%;
7
- height: 100%;
8
- padding: 0px 7px;
9
- .bri-scrollbar3();
10
- overflow-y: hidden;
11
- }
12
-
13
- .nodata {
14
- padding: 0px 7px;
15
- line-height: 28px;
16
- color: @placeholderColor;
17
- }
18
-
19
- // 多选类型 且独自一行时
20
- &-row {
21
- height: 68px;
22
-
23
- .hasdata {
24
- overflow-y: auto;
25
- display: flex;
26
- flex-wrap: wrap;
8
+
9
+ &-edit {
10
+ #bri-control-wrap();
27
11
  }
28
12
  }
29
- }
30
13
 
31
- // 多选
32
- &-multiple {
33
- width: 100%;
34
-
35
- &-input {
14
+ // 单选 -新模式
15
+ &-custom {
36
16
  width: 100%;
37
- height: 32px;
38
- #multiple-content();
39
-
40
- .hasdata {
41
-
42
- }
43
- .nodata {
44
-
45
- }
46
-
47
- // 多选类型 且独自一行时
48
- &-row {
49
-
50
- }
17
+ #bri-control-wrap();
51
18
  }
52
- }
53
-
54
- // 单选 -新模式
55
- &-custom {
56
- width: 100%;
57
-
58
- &-input {
19
+ // 单选 -默认模式
20
+ &-single {
59
21
  width: 100%;
60
- height: 32px;
61
- padding: 0px 7px;
62
- .dsh-flex-row-between-center();
63
-
64
- .text {
65
- .dsh-ellipsis();
66
- }
67
-
68
- .clear {
69
- margin-left: 5px;
70
- }
71
22
  }
72
23
  }
73
-
74
- // 单选 -默认模式
75
- &-single {
76
- width: 100%;
77
- }
78
-
24
+
79
25
  // 查看
80
26
  &-show {
81
27
  &-multiple {
82
- #multiple-content();
28
+ #bri-control-wrap();
29
+ }
83
30
 
84
- .hasdata {
85
- &-unit {
86
- .dsh-ellipsis();
87
- }
88
- }
89
- .nodata {
31
+ &-single {
90
32
 
91
- }
33
+ }
34
+ }
92
35
 
93
- // 多选类型 且独自一行时
94
- &-row {
95
- height: auto;
96
- min-height: 32px;
36
+ // 多选类型且独自一行时
37
+ &-row {
38
+ &-edit,
39
+ &-show {
40
+ .text,
41
+ .overflow {
42
+ width: 100%;
43
+ height: 100%;
44
+ white-space: normal;
45
+ overflow: auto;
46
+ .bri-scrollbar3();
97
47
  }
98
48
  }
99
-
100
- &-single {
101
-
49
+ &-edit {
50
+ height: 68px;
51
+ }
52
+ &-show {
53
+ height: auto;
102
54
  }
103
55
  }
104
56
  }