bri-components 1.1.5 → 1.1.6

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 (43) 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/4.bri-components.min.js +1 -1
  5. package/lib/5.bri-components.min.js +1 -1
  6. package/lib/6.bri-components.min.js +1 -1
  7. package/lib/7.bri-components.min.js +1 -1
  8. package/lib/bri-components.min.js +5 -5
  9. package/package.json +1 -1
  10. package/src/components/controls/base/DshCascader/DshCascader.vue +3 -0
  11. package/src/components/controls/base/DshSelect.vue +8 -6
  12. package/src/components/controls/base/DshSwitch.vue +45 -87
  13. package/src/components/form/DshDefaultSearch.vue +1 -1
  14. package/src/components/form/DshForm.vue +4 -0
  15. package/src/components/small/BriButton.vue +2 -2
  16. package/src/components/small/DshButtons.vue +28 -2
  17. package/src/components/small/DshIcons.vue +1 -1
  18. package/src/components/unit/DshFormItem.vue +2 -2
  19. package/src/styles/common/control.less +11 -7
  20. package/src/styles/components/controls/base/DshCascader.less +110 -0
  21. package/src/styles/components/controls/base/DshSwitch.less +37 -0
  22. package/src/styles/components/form/DshDefaultSearch.less +41 -9
  23. package/src/styles/components/index.less +19 -18
  24. package/src/styles/components/small/BriButton.less +34 -2
  25. package/src/styles/components/unit/DshFormItem.less +1 -2
  26. package/src/styles/components/controls/DshCascader.less +0 -95
  27. /package/src/styles/components/controls/{BriInputs.less → base/BriInputs.less} +0 -0
  28. /package/src/styles/components/controls/{BriUpload.less → base/BriUpload.less} +0 -0
  29. /package/src/styles/components/controls/{DshCheckbox.less → base/DshCheckbox.less} +0 -0
  30. /package/src/styles/components/controls/{DshCoordinates.less → base/DshCoordinates.less} +0 -0
  31. /package/src/styles/components/controls/{DshDate.less → base/DshDate.less} +0 -0
  32. /package/src/styles/components/controls/{DshDaterange.less → base/DshDaterange.less} +0 -0
  33. /package/src/styles/components/controls/{DshDivider.less → base/DshDivider.less} +0 -0
  34. /package/src/styles/components/controls/{DshEditor.less → base/DshEditor.less} +0 -0
  35. /package/src/styles/components/controls/{DshInput.less → base/DshInput.less} +0 -0
  36. /package/src/styles/components/controls/{DshNumber.less → base/DshNumber.less} +0 -0
  37. /package/src/styles/components/controls/{DshNumberange.less → base/DshNumberange.less} +0 -0
  38. /package/src/styles/components/controls/{DshSelect.less → base/DshSelect.less} +0 -0
  39. /package/src/styles/components/controls/{InfoCascader.less → base/InfoCascader.less} +0 -0
  40. /package/src/styles/components/controls/{BriLabels.less → senior/BriLabels.less} +0 -0
  41. /package/src/styles/components/controls/{DshPackage.less → senior/DshPackage.less} +0 -0
  42. /package/src/styles/components/controls/{cascaderTable.less → senior/cascaderTable.less} +0 -0
  43. /package/src/styles/components/controls/{flatTable.less → senior/flatTable.less} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -33,6 +33,7 @@
33
33
  class="hasdata"
34
34
  >
35
35
  <dsh-tags
36
+ class="hasdata-multiple"
36
37
  :list="curValNameList"
37
38
  :propsObj="{
38
39
  closable: canEdit,
@@ -62,6 +63,7 @@
62
63
  ...commonClass,
63
64
  'DshCascader-custom-input': true
64
65
  }"
66
+ class
65
67
  @click="openModal"
66
68
  >
67
69
  <!-- 有值 -->
@@ -150,6 +152,7 @@
150
152
  class="hasdata-multiple"
151
153
  :list="curValNameList"
152
154
  :propsObj="{
155
+ closable: !canEdit,
153
156
  size: isSelfRow ? 'medium' : 'default'
154
157
  }"
155
158
  ></dsh-tags>
@@ -203,12 +203,14 @@
203
203
  ..._customData.params
204
204
  },
205
205
  callback: data => {
206
- this.initListData.push(...data.list.map(item => (
207
- {
208
- _key: item[_customData._key || "_key"],
209
- name: item[_customData._name || "name"]
210
- }
211
- )));
206
+ this.initListData.push(
207
+ ...data.list.map(item => (
208
+ {
209
+ _key: item[_customData._key || "_key"],
210
+ name: item[_customData._name || "name"]
211
+ }
212
+ ))
213
+ );
212
214
  }
213
215
  });
214
216
  },
@@ -1,48 +1,44 @@
1
1
  <template>
2
- <div
3
- class="DshSwitch"
4
- :style="{ textAlign: propsObj._textAlign, width: '100%' }"
5
- >
6
- <!-- 组件无clearable -->
7
- <i-switch
8
- v-if="finalCanEdit"
9
- v-model="value[propsObj._key]"
10
- :size="propsObj._size"
11
- :disabled="!finalCanEdit"
12
- @on-change="change"
13
- >
14
- <span
15
- slot="open"
16
- style="font-size: 12px;"
17
- >{{ propsObj._openText }}</span>
18
- <span slot="close">{{ propsObj._closeText }}</span>
19
- </i-switch>
20
- <!-- 查看 和 编辑下无编辑权限 -->
21
- <Ctooltip
22
- v-else
23
- placement="top"
24
- :transfer="true"
25
- maxWidth="200"
26
- :content="showVal"
27
- >
28
- <div
29
- class="DshCheckbox-value-wrapper"
30
- :style="{
31
- textAlign: propsObj._textAlign,
32
- flexGrow: 1,
33
- display: 'flex',
34
- justifyContent: getFlexLayout(propsObj._textAlign)
35
- }"
2
+ <!-- 该组件无clearable -->
3
+ <div class="DshSwitch">
4
+ <!-- 编辑 -->
5
+ <template v-if="canEdit">
6
+ <i-switch
7
+ v-model="curVal"
8
+ :disabled="!finalCanEdit"
9
+ :size="propsObj._size"
10
+ @on-change="change"
36
11
  >
37
- <span
38
- class="DshCheckbox-value control-show-color-text dsh-ellipsis"
39
- :style="{
40
- background: value[controlKey] ? '#ECF3FD' : '#FEF6EB',
41
- color: value[controlKey] ? '#3D84EE' : '#F4A135'
42
- }"
43
- >{{ showVal }}</span>
44
- </div>
45
- </Ctooltip>
12
+ <span slot="open">
13
+ {{ propsObj._openText }}
14
+ </span>
15
+ <span slot="close">
16
+ {{ propsObj._closeText }}
17
+ </span>
18
+ </i-switch>
19
+ </template>
20
+
21
+ <!-- 查看 -->
22
+ <template v-else>
23
+ <Ctooltip
24
+ :content="showText"
25
+ placement="top"
26
+ :transfer="true"
27
+ maxWidth="200"
28
+ >
29
+ <div class="DshSwitch-show">
30
+ <span
31
+ class="DshSwitch-show-name"
32
+ :style="{
33
+ background: curVal ? '#ECF3FD' : '#FEF6EB',
34
+ color: curVal ? '#3D84EE' : '#F4A135'
35
+ }"
36
+ >
37
+ {{ showText }}
38
+ </span>
39
+ </div>
40
+ </Ctooltip>
41
+ </template>
46
42
  </div>
47
43
  </template>
48
44
 
@@ -51,58 +47,20 @@
51
47
 
52
48
  export default {
53
49
  name: "DshSwitch",
54
- mixins: [controlMixin],
50
+ mixins: [
51
+ controlMixin
52
+ ],
55
53
  data () {
56
54
  return {};
57
55
  },
58
56
  computed: {
59
- showVal () {
57
+ showText () {
60
58
  return this.value[this.controlKey]
61
59
  ? this.propsObj._openText
62
60
  : this.propsObj._closeText;
63
61
  }
64
62
  },
65
- created () {
66
- },
67
- methods: {
68
- getFlexLayout (align) {
69
- let map = {
70
- left: "flex-start",
71
- center: "center",
72
- right: "flex-end"
73
- };
74
- if (align) {
75
- return map[align];
76
- } else {
77
- return "flex-start";
78
- }
79
- }
80
- }
63
+ created () {},
64
+ methods: {}
81
65
  };
82
66
  </script>
83
-
84
- <style lang="less" scoped>
85
- .DshSwitch {
86
-
87
- }
88
- </style>
89
- <style lang="less">
90
- .DshSwitch {
91
- .ivu-switch {
92
- width: 50px;
93
- }
94
- .ivu-switch-checked:after {
95
- left: 29px;
96
- }
97
- .ivu-switch-inner {
98
- color: #fff;
99
- font-size: 12px;
100
- position: absolute;
101
- left: auto;
102
- right: 4px;
103
- }
104
- .ivu-switch-checked .ivu-switch-inner {
105
- left: 3px;
106
- }
107
- }
108
- </style>
@@ -53,7 +53,7 @@
53
53
  v-if="canUseFold"
54
54
  class="DshDefaultSearch-fold"
55
55
  >
56
- <div class="DshDefaultSearch-fold-zhanwei"></div>
56
+ <!-- <div class="DshDefaultSearch-fold-zhanwei"></div> -->
57
57
  <Icon
58
58
  :class="[
59
59
  'DshDefaultSearch-fold-icon',
@@ -325,6 +325,10 @@
325
325
  &-item-FormItem {
326
326
  margin-bottom: 0px!important;
327
327
  }
328
+
329
+ .ivu-form-item-content {
330
+ line-height: normal;
331
+ }
328
332
  .ivu-form-item-error-tip {
329
333
  top: 90%;
330
334
  left: 15px;
@@ -42,13 +42,13 @@
42
42
  let setType = this.propsObj.btnType || this.type;
43
43
  if (["cancel"].includes(defaultType)) {
44
44
  setType = "primary";
45
- } else if (["errorLine"].includes(defaultType)) {
45
+ } else if (["errorLine", "primaryLine"].includes(defaultType)) {
46
46
  setType = "default";
47
47
  } else if (["linkText", "primaryText", "errorText"].includes(defaultType)) {
48
48
  setType = "text";
49
49
  }
50
50
  return {
51
- class: ["cancel", "linkText", "primaryText", "errorLine", "errorText"].includes(defaultType) ? `ivu-btn-${defaultType}` : "",
51
+ class: ["cancel", "linkText", "primaryText", "errorLine", "errorText", "primaryLine"].includes(defaultType) ? `ivu-btn-${defaultType}` : "",
52
52
  ...this.propsObj,
53
53
  btnType: setType,
54
54
  customIcon: this.propsObj.customIcon ? `bico-font ${this.propsObj.customIcon}` : undefined
@@ -78,7 +78,7 @@
78
78
 
79
79
  <template v-else>
80
80
  <bri-button
81
- v-for="(operationItem, index) in list"
81
+ v-for="(operationItem, index) in flatList"
82
82
  :key="operationItem.type"
83
83
  :style="operationItem.style"
84
84
  :class="[
@@ -97,6 +97,25 @@
97
97
  {{ operationItem.name }}
98
98
  </span>
99
99
  </bri-button>
100
+
101
+ <dsh-dropdown
102
+ v-if="moreList.length"
103
+ class="DshButtons-dropdown"
104
+ :list="moreList"
105
+ :trigger="'hover'"
106
+ @click="emit($event)"
107
+ >
108
+ <slot name="more">
109
+ <bri-button
110
+ class="DshButtons-dropdown-more"
111
+ :propsObj="moreBtnOperationObj"
112
+ >
113
+ <span class="DshButtons-dropdown-more-name">
114
+ {{ moreBtnOperationObj.name }}
115
+ </span>
116
+ </bri-button>
117
+ </slot>
118
+ </dsh-dropdown>
100
119
  </template>
101
120
  </div>
102
121
  </template>
@@ -143,11 +162,18 @@
143
162
  name: "更多",
144
163
  type: "more",
145
164
  size: "default",
146
- customIcon: "bico-gengduo1"
165
+ customIcon: "bico-gengduo",
166
+ btnType: "primaryText"
147
167
  }
148
168
  };
149
169
  },
150
170
  computed: {
171
+ flatList () {
172
+ return this.list.slice(0, this.maxFlatNum);
173
+ },
174
+ moreList () {
175
+ return this.list.slice(this.maxFlatNum);
176
+ },
151
177
  leftFlatList () {
152
178
  return this.leftList.slice(0, this.maxFlatNum);
153
179
  },
@@ -5,7 +5,7 @@
5
5
  >
6
6
  <Icon
7
7
  v-for="(operationItem, index) in list"
8
- :key="operationItem._key || operationItem._id || operationItem.customIcon || operationItem.icon"
8
+ :key="operationItem._key || operationItem._id || index"
9
9
  :style="operationItem.style"
10
10
  :class="[
11
11
  'DshIcons-item',
@@ -117,10 +117,10 @@
117
117
  return [];
118
118
  }
119
119
  },
120
- // 实际最精确值是74px(label:30px, control:32px, 上下padding各: 6px,因为ivu-form-item-content里line-height: 32px导致有问题,故先76px
120
+ // 实际最精确值是68px(label:30px, control:32px, 上下padding各: 3px,因为ivu-form-item-content里line-height: 32px导致有问题,故先70px
121
121
  height: {
122
122
  type: [String, Number],
123
- default: "76"
123
+ default: "70"
124
124
  },
125
125
  rowStyle: {
126
126
  type: Object,
@@ -61,12 +61,23 @@
61
61
  color: @textColor;
62
62
  }
63
63
  .control-disabled {
64
+ height: 32px;
64
65
  border: 1px solid @border-disabled;
65
66
  border-radius: @borderRadius;
66
67
  background: @inputBg-disabled;
68
+ line-height: 32px;
67
69
  cursor: not-allowed;
68
70
  color: @textColor-disabled;
69
71
  }
72
+ .control-readonly {
73
+ height: 32px;
74
+ border: 1px solid @border-readonly;
75
+ border-radius: @borderRadius;
76
+ background: @inputBg-readonly;
77
+ line-height: 32px;
78
+ cursor: not-allowed;
79
+ color: @textColor-readonly;
80
+ }
70
81
  .control-show {
71
82
  border: none;
72
83
  background-color: transparent;
@@ -79,13 +90,6 @@
79
90
  .control-placeholder {
80
91
  color: @placeholderColor;
81
92
  }
82
- .control-readonly {
83
- border: 1px solid @border-readonly;
84
- border-radius: @borderRadius;
85
- background: @inputBg-readonly;
86
- line-height: 32px;
87
- color: @textColor-readonly;
88
- }
89
93
  .control-notext {
90
94
  color: @placeholderColor;
91
95
  }
@@ -0,0 +1,110 @@
1
+ .DshCascader {
2
+ width: 100%;
3
+
4
+ #nodata () {
5
+ display: inline-block;
6
+ padding: 0px 8px;
7
+ color: @placeholderColor;
8
+ }
9
+
10
+ // 多选
11
+ &-multiple {
12
+ width: 100%;
13
+
14
+ &-input {
15
+ .hasdata {
16
+ width: 100%;
17
+ height: 100%;
18
+
19
+ &-multiple {
20
+ width: 100%;
21
+ height: 100%;
22
+ padding: 0px 8px;
23
+ .bri-scrollbar3();
24
+ overflow-y: hidden;
25
+ }
26
+ }
27
+
28
+ .nodata {
29
+ #nodata();
30
+ }
31
+ }
32
+ }
33
+
34
+ // 单选 -新模式
35
+ &-custom {
36
+ &-input {
37
+ .hasdata {
38
+ width: 100%;
39
+ height: 100%;
40
+ padding: 0px 8px;
41
+
42
+ &-text {
43
+ .dsh-ellipsis();
44
+ }
45
+
46
+ &-clear {
47
+ margin-left: 5px;
48
+ }
49
+ }
50
+
51
+ .nodata {
52
+ #nodata();
53
+ }
54
+ }
55
+ }
56
+
57
+ // 单选 -默认模式
58
+ &-single {
59
+ width: 100%;
60
+ }
61
+
62
+ // 查看
63
+ &-show {
64
+ .hasdata {
65
+ width: 100%;
66
+ height: 100%;
67
+
68
+ &-multiple {
69
+ width: 100%;
70
+ height: 100%;
71
+ padding: 0px 8px;
72
+ .bri-scrollbar3();
73
+ overflow-y: hidden;
74
+ }
75
+ }
76
+
77
+ .nodata {
78
+ #nodata();
79
+ }
80
+ }
81
+
82
+ &-multiplerow {
83
+ height: 70px;
84
+
85
+ .hasdata {
86
+ &-multiple {
87
+ padding: 4px 8px;
88
+ overflow-y: auto;
89
+ display: flex;
90
+ flex-wrap: wrap;
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ .ivu-cascader {
97
+ &-label {
98
+ padding-right: 24px;
99
+ }
100
+
101
+ &-transfer {
102
+ max-height: 400px !important;
103
+
104
+ .ivu-cascader-menu {
105
+ max-height: 400px;
106
+ height: auto;
107
+ max-width: 300px;
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,37 @@
1
+ .DshSwitch {
2
+ width: 100%;
3
+
4
+ &-show {
5
+ height: 24px;
6
+ padding: 2px 8px;
7
+ border-radius: 4px;
8
+ line-height: 20px;
9
+ flex-grow: 1;
10
+ display: flex;
11
+ justify-content: flex-start;
12
+
13
+ &-name {
14
+ .dsh-ellipsis();
15
+ display: flex;
16
+ min-height: 32px;
17
+ padding: 4px;
18
+ }
19
+ }
20
+
21
+ .ivu-switch {
22
+ width: 50px;
23
+ }
24
+ .ivu-switch-checked:after {
25
+ left: 29px;
26
+ }
27
+ .ivu-switch-inner {
28
+ color: #fff;
29
+ font-size: 12px;
30
+ position: absolute;
31
+ left: auto;
32
+ right: 4px;
33
+ }
34
+ .ivu-switch-checked .ivu-switch-inner {
35
+ left: 3px;
36
+ }
37
+ }
@@ -1,5 +1,6 @@
1
1
  .DshDefaultSearch {
2
2
  position: relative;
3
+ background: #fff;
3
4
 
4
5
  &-item {
5
6
  padding: 0 !important;
@@ -21,17 +22,9 @@
21
22
  width: 100%;
22
23
  text-align: center;
23
24
  position: absolute;
24
- bottom: -20px;
25
+ bottom: -10px;
25
26
  left: 0px;
26
27
 
27
- &-zhanwei {
28
- width: 100%;
29
- height: 15px;
30
- background: #fff;
31
- position: relative;
32
- z-index: 1;
33
- }
34
-
35
28
  &-icon {
36
29
  width: 48px;
37
30
  height: 20px;
@@ -48,4 +41,43 @@
48
41
  }
49
42
  }
50
43
  }
44
+
45
+ // 输入框/下拉框
46
+ input,
47
+ .ivu-select-selection,
48
+ .ivu-cascader-size-default,
49
+ .DshCascader-multiple-input,
50
+ .DshDaterange-item {
51
+ border-radius: 0;
52
+
53
+ .ivu-select-input{
54
+ top: 0px!important;
55
+ }
56
+ }
57
+
58
+ .DshCascader-multiple-input {
59
+ height: 32px;
60
+ padding: 1px 6px;
61
+ overflow: hidden!important;
62
+ }
63
+
64
+ .DshFormItem-label {
65
+ width: 80px;
66
+ text-align: right;
67
+ margin-right: 16px;
68
+
69
+ .DshFormItem-label-left {
70
+ .DshFormItem-label-name {
71
+ font-family: "Microsoft YaHei";
72
+ }
73
+ }
74
+
75
+ .DshFormItem-label-right {
76
+ text-align: left;
77
+ }
78
+ }
79
+ .control-edit {
80
+ border-radius: 0px;
81
+ }
82
+
51
83
  }
@@ -1,23 +1,24 @@
1
1
  // controls
2
- @import "./controls/DshInput.less";
3
- @import "./controls/BriInputs.less";
4
- @import "./controls/DshNumber.less";
5
- @import "./controls/DshNumberange.less";
6
- @import "./controls/DshCheckbox.less";
7
- @import "./controls/DshSelect.less";
8
- @import "./controls/DshDate.less";
9
- @import "./controls/DshDaterange.less";
10
- @import "./controls/DshCascader.less";
11
- @import "./controls/InfoCascader.less";
12
- @import "./controls/DshCoordinates.less";
13
- @import "./controls/DshEditor.less";
14
- @import "./controls/DshDivider.less";
2
+ @import "./controls/base/DshInput.less";
3
+ @import "./controls/base/BriInputs.less";
4
+ @import "./controls/base/DshNumber.less";
5
+ @import "./controls/base/DshNumberange.less";
6
+ @import "./controls/base/DshSwitch.less";
7
+ @import "./controls/base/DshSelect.less";
8
+ @import "./controls/base/DshCheckbox.less";
9
+ @import "./controls/base/DshDate.less";
10
+ @import "./controls/base/DshDaterange.less";
11
+ @import "./controls/base/DshCascader.less";
12
+ @import "./controls/base/InfoCascader.less";
13
+ @import "./controls/base/BriUpload.less";
14
+ @import "./controls/base/DshCoordinates.less";
15
+ @import "./controls/base/DshEditor.less";
16
+ @import "./controls/base/DshDivider.less";
15
17
 
16
- @import "./controls/BriUpload.less";
17
- @import "./controls/flatTable.less";
18
- @import "./controls/cascaderTable.less";
19
- @import "./controls/BriLabels.less";
20
- @import "./controls/DshPackage.less";
18
+ @import "./controls/senior/flatTable.less";
19
+ @import "./controls/senior/cascaderTable.less";
20
+ @import "./controls/senior/BriLabels.less";
21
+ @import "./controls/senior/DshPackage.less";
21
22
 
22
23
  @import "./controls/controlShow.less";
23
24