bri-components 1.2.9 → 1.2.11

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 (35) 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/bri-components.min.js +7 -7
  9. package/package.json +1 -1
  10. package/src/components/controls/BriControlInput.vue +68 -4
  11. package/src/components/controls/base/BriUpload/BriUpload.vue +75 -192
  12. package/src/components/controls/base/BriUpload/BriUploadImage.vue +4 -3
  13. package/src/components/controls/base/BriUpload/uploadMixin.js +15 -21
  14. package/src/components/controls/base/DshCascader/DshCascader.vue +55 -97
  15. package/src/components/controls/base/DshCoordinates.vue +38 -57
  16. package/src/components/controls/base/DshInput.vue +1 -0
  17. package/src/components/controls/controlMixin.js +20 -15
  18. package/src/components/controls/senior/BriLabels.vue +9 -40
  19. package/src/components/controls/senior/selectDepartments.vue +11 -41
  20. package/src/components/controls/senior/selectUsers/selectUsers.vue +8 -38
  21. package/src/components/form/DshAdvSearchForm.vue +9 -9
  22. package/src/components/small/BriButton.vue +1 -1
  23. package/src/components/small/BriTooltip.vue +34 -41
  24. package/src/components/unit/DshUnit.vue +2 -1
  25. package/src/index.js +2 -0
  26. package/src/styles/common/control.less +4 -38
  27. package/src/styles/components/controls/BriControlInput.less +28 -1
  28. package/src/styles/components/controls/base/DshCascader/DshCascader.less +2 -3
  29. package/src/styles/components/controls/base/DshCoordinates.less +1 -5
  30. package/src/styles/components/controls/senior/BriLabels.less +1 -1
  31. package/src/styles/components/controls/senior/selectDepartments.less +1 -1
  32. package/src/styles/components/controls/senior/selectUsers/selectUsers.less +1 -1
  33. package/src/styles/components/index.less +2 -0
  34. package/src/styles/components/small/BriTooltip.less +2 -2
  35. package/src/styles/components/small/DshModal.less +1 -1
@@ -8,50 +8,22 @@
8
8
  >
9
9
  <div @click.stop="clickInput">
10
10
  <slot>
11
- <!-- 编辑模式 -->
12
- <div
11
+ <!-- 编辑 -->
12
+ <bri-control-input
13
13
  v-if="canEdit"
14
14
  :class="{
15
15
  ...commonClass,
16
16
  'selectDepartments-edit': true
17
17
  }"
18
- @mouseenter="isHover = true"
19
- @mouseleave="isHover = false"
20
- >
21
- <!-- 有值 -->
22
- <template v-if="!$isEmptyData(curValList)">
23
- <dsh-tags
24
- class="text"
25
- :list="curValList"
26
- :propsObj="{
27
- disabled: !finalCanEdit,
28
- closable: true
29
- }"
30
- @delete="clickDeleteItem"
31
- ></dsh-tags>
32
- </template>
33
- <!-- 无值 -->
34
- <template v-else>
35
- {{ emptyShowVal }}
36
- </template>
18
+ :canEdit="finalCanEdit"
19
+ :value="curValList"
20
+ :inputIcon="inputIcon"
21
+ :propsObj="selfPropsObj"
22
+ @deleteItem="clickDeleteItem"
23
+ @clear="clickClear"
24
+ ></bri-control-input>
37
25
 
38
- <!-- 图标 -->
39
- <template>
40
- <Icon
41
- v-if="!$isEmptyData(curValList) && selfPropsObj._clearable && isHover"
42
- class="icon-close"
43
- type="ios-close-circle"
44
- @click.stop="clickClear"
45
- />
46
- <Icon
47
- v-else
48
- class="icon-default"
49
- :type="inputIcon"
50
- />
51
- </template>
52
- </div>
53
-
54
- <!-- 查看模式 -->
26
+ <!-- 查看 -->
55
27
  <div
56
28
  v-else
57
29
  :class="{
@@ -202,10 +174,8 @@
202
174
  props: {},
203
175
  data () {
204
176
  return {
205
- isHover: false,
206
-
207
- newValList: [],
208
177
  showModal: false,
178
+ newValList: [],
209
179
  loading: false,
210
180
  searchName: "", // 搜索名字
211
181
  departmentList: [],
@@ -9,47 +9,19 @@
9
9
  <div @click.stop="clickInput">
10
10
  <slot>
11
11
  <!-- 编辑 -->
12
- <div
12
+ <bri-control-input
13
13
  v-if="canEdit"
14
14
  :class="{
15
15
  ...commonClass,
16
16
  'selectUsers-edit': true
17
17
  }"
18
- @mouseenter="isHover = true"
19
- @mouseleave="isHover = false"
20
- >
21
- <!-- 有值 -->
22
- <template v-if="!$isEmptyData(curValList)">
23
- <dsh-tags
24
- class="text"
25
- :list="curValList"
26
- :propsObj="{
27
- disabled: !finalCanEdit,
28
- closable: true
29
- }"
30
- @delete="clickDeleteItem"
31
- ></dsh-tags>
32
- </template>
33
- <!-- 无值 -->
34
- <template v-else>
35
- {{ emptyShowVal }}
36
- </template>
37
-
38
- <!-- 图标 -->
39
- <template>
40
- <Icon
41
- v-if="!$isEmptyData(curValList) && selfPropsObj._clearable && isHover"
42
- class="icon-close"
43
- type="ios-close-circle"
44
- @click.stop="clickClear"
45
- />
46
- <Icon
47
- v-else
48
- class="icon-default"
49
- :type="inputIcon"
50
- />
51
- </template>
52
- </div>
18
+ :canEdit="finalCanEdit"
19
+ :value="curValList"
20
+ :inputIcon="inputIcon"
21
+ :propsObj="selfPropsObj"
22
+ @clickDeleteItem="clickDeleteItem"
23
+ @clickClear="clickClear"
24
+ ></bri-control-input>
53
25
 
54
26
  <!-- 查看 -->
55
27
  <div
@@ -219,8 +191,6 @@
219
191
  props: {},
220
192
  data () {
221
193
  return {
222
- isHover: false,
223
-
224
194
  // 弹框
225
195
  newValList: [],
226
196
  showModal: false,
@@ -20,7 +20,7 @@
20
20
  <!-- 'and', 'or' 循环模式 -->
21
21
  <div
22
22
  v-if="['and', 'or'].includes(conditionItem.logic)"
23
- :key="conditionItem._id"
23
+ :key="`${conditionItem._id}andor`"
24
24
  class="DshAdvSearchForm-conditions-loop"
25
25
  >
26
26
  <dsh-advSearch-form
@@ -44,7 +44,7 @@
44
44
  <!-- field 正常模式 -->
45
45
  <dsh-formItem
46
46
  v-else-if="['field', undefined].includes(conditionItem.logic)"
47
- :key="conditionItem._id"
47
+ :key="`${conditionItem._id}field`"
48
48
  class="DshAdvSearchForm-conditions-item"
49
49
  :formData="conditionItem"
50
50
  :formItem="conditionItem.formItem"
@@ -76,11 +76,11 @@
76
76
  class="DshAdvSearchForm-conditions-item-control"
77
77
  :value="conditionItem"
78
78
  :propsObj="{
79
- _name: `${conditionItem.formItem._name}的动态参数`,
80
- _key: 'fieldParams',
81
- _multiple: true,
82
- _data: conditionItem.dynamicList
83
- }"
79
+ _name: `${conditionItem.formItem._name}的动态参数`,
80
+ _key: 'fieldParams',
81
+ _multiple: true,
82
+ _data: conditionItem.dynamicList
83
+ }"
84
84
  @change="change(conditionItem, arguments)"
85
85
  ></dsh-select>
86
86
 
@@ -137,7 +137,7 @@
137
137
  <!-- text 关键字的模式 -->
138
138
  <div
139
139
  v-else-if="['text'].includes(conditionItem.logic)"
140
- :key="conditionItem._id"
140
+ :key="`${conditionItem._id}text`"
141
141
  >
142
142
  {{ conditionItem.logic }}模式暂未开发
143
143
  </div>
@@ -145,7 +145,7 @@
145
145
  <!-- native 以及以后可能增加的模式 -->
146
146
  <div
147
147
  v-else
148
- :key="conditionItem._id"
148
+ :key="`${conditionItem._id}other`"
149
149
  >
150
150
  {{ conditionItem.logic }}模式是不用开发的
151
151
  </div>
@@ -8,7 +8,7 @@
8
8
  :loading="selfPropsObj.loading"
9
9
  :disabled="selfPropsObj.disabled"
10
10
  :htmlType="selfPropsObj.htmlType"
11
- :icon="selfPropsObj.icon || icon"
11
+ :icon="(selfPropsObj.customIcon || customIcon) ? undefined : (selfPropsObj.icon || icon)"
12
12
  :customIcon="selfPropsObj.customIcon || customIcon"
13
13
  :long="selfPropsObj.long"
14
14
  :ghost="selfPropsObj.ghost"
@@ -2,18 +2,13 @@
2
2
  <Tooltip
3
3
  class="BriTooltip"
4
4
  style="width: 100%;"
5
- :disabled="disabled"
6
5
  :content="content"
6
+ :disabled="toolTipDisabled"
7
7
  :placement="placement"
8
- :transfer="transfer"
9
8
  :max-width="maxWidth"
9
+ :transfer="transfer"
10
10
  >
11
- <div
12
- ref="ellipsisContent"
13
- class="ellipsisContent"
14
- >
15
- <slot></slot>
16
- </div>
11
+ <slot></slot>
17
12
 
18
13
  <slot
19
14
  slot="content"
@@ -27,12 +22,6 @@
27
22
  name: "BriTooltip",
28
23
  props: {
29
24
  content: String,
30
- propsObj: {
31
- type: Object,
32
- default () {
33
- return {};
34
- }
35
- },
36
25
  placement: {
37
26
  type: String,
38
27
  default: "bottom"
@@ -44,44 +33,48 @@
44
33
  transfer: {
45
34
  type: Boolean,
46
35
  default: false
36
+ },
37
+
38
+ defaultDisabled: {
39
+ type: Boolean,
40
+ default: true
47
41
  }
48
42
  },
49
43
  data () {
50
44
  return {
51
- disabled: false
45
+ toolTipDisabled: true,
46
+ tmpToolTipDisabled: true
52
47
  };
53
48
  },
54
- computed: {},
55
- methods: {
56
- computedDisable () {
57
- // 获取overflow:hidden元素的实际被撑开的宽度
58
- let test = this.$refs.ellipsisContent;
59
- if (test) {
60
- let cp = test.cloneNode(true);
61
- cp.style.cssText = "all: unset;position: absolute;opacity:0;";
62
- test.parentElement.appendChild(cp);
63
- let realWidth = cp.offsetWidth;
64
- cp.remove();
65
- this.disabled = realWidth <= test.offsetWidth;
66
- }
67
- }
49
+ created () {
50
+ this.toolTipDisabled = this.defaultDisabled;
51
+ this.tmpToolTipDisabled = this.toolTipDisabled;
68
52
  },
69
- created () {},
70
53
  mounted () {
71
- this.$nextTick(() => {
72
- this.computedDisable();
73
- });
54
+ this.getToolTipDisabled("mouted");
74
55
  },
75
56
  updated () {
76
- this.$nextTick(() => {
77
- this.computedDisable();
78
- });
57
+ this.getToolTipDisabled("updated");
79
58
  },
80
- watch: {
81
- content () {
82
- this.$nextTick(() => {
83
- this.computedDisable();
84
- });
59
+ methods: {
60
+ getToolTipDisabled (type) {
61
+ const isOverflow = this.$slots.default;
62
+ const toolTipDisabled = isOverflow[0]
63
+ ? !(isOverflow[0].elm.scrollWidth > isOverflow[0].elm.clientWidth)
64
+ : this.toolTipDisabled;
65
+
66
+ if (toolTipDisabled !== this.toolTipDisabled) {
67
+ if (toolTipDisabled !== this.tmpToolTipDisabled) {
68
+ this.tmpToolTipDisabled = toolTipDisabled;
69
+
70
+ this.timer = setTimeout(() => {
71
+ this.toolTipDisabled = toolTipDisabled;
72
+ this.tmpToolTipDisabled = this.toolTipDisabled;
73
+ }, 2000);
74
+ }
75
+ } else {
76
+ clearTimeout(this.timer);
77
+ }
85
78
  }
86
79
  }
87
80
  };
@@ -21,8 +21,9 @@
21
21
  :propsObj="{
22
22
  ...formItem,
23
23
  size: 'default',
24
- inTable: true
24
+ isInTable: true
25
25
  }"
26
+ :rowIndex="rowIndex"
26
27
  :parentData="parentData"
27
28
  @blur="blur"
28
29
  @change="change"
package/src/index.js CHANGED
@@ -26,6 +26,7 @@ import DshFormItem from "./components/unit/DshFormItem.vue";
26
26
  import DshUnit from "./components/unit/DshUnit.vue";
27
27
 
28
28
  // controls
29
+ import BriControlInput from "./components/controls/BriControlInput.vue";
29
30
  import DshInput from "./components/controls/base/DshInput.vue";
30
31
  import DshNumber from "./components/controls/base/DshNumber/DshNumber.vue";
31
32
  import DshSelect from "./components/controls/base/DshSelect.vue";
@@ -118,6 +119,7 @@ const map = {
118
119
  DshUnit,
119
120
 
120
121
  // controls
122
+ BriControlInput,
121
123
  DshInput,
122
124
  DshNumber,
123
125
  DshSelect,
@@ -52,18 +52,16 @@
52
52
  border: none;
53
53
  background-color: transparent;
54
54
 
55
- .ivu-icon {
56
- padding: 5px;
57
- color: @placeholderColor;
55
+ .text {
56
+ .dsh-ellipsis();
58
57
  }
59
58
  }
60
59
  .bri-control-unit {
61
60
  border: none;
62
61
  background-color: transparent;
63
62
 
64
- .ivu-icon {
65
- padding: 5px;
66
- color: @placeholderColor;
63
+ .text {
64
+ .dsh-ellipsis();
67
65
  }
68
66
  }
69
67
 
@@ -75,35 +73,3 @@
75
73
  .bri-control-disabled-placeholder {
76
74
  color: @textColor-disabled;
77
75
  }
78
-
79
- // 展示为tag标签公共样式
80
- #bri-control-wrap () {
81
- height: 32px;
82
- padding: 4px 0 4px 7px;
83
- line-height: 24px;
84
- .dsh-flex-row-between-center();
85
-
86
- .text {
87
- .dsh-ellipsis();
88
- }
89
-
90
- .overflow {
91
- overflow: auto;
92
- .bri-scrollbar3();
93
- }
94
-
95
- .icon {
96
- &-default {
97
-
98
- }
99
- &-close {
100
- display: none;
101
- }
102
- }
103
-
104
- &:hover {
105
- .icon-close {
106
- display: block;
107
- }
108
- }
109
- }
@@ -1,3 +1,30 @@
1
1
  .BriControlInput {
2
-
2
+ height: 32px;
3
+ padding: 4px 0 4px 7px;
4
+ line-height: 24px;
5
+ .dsh-flex-row-between-center();
6
+
7
+ .text {
8
+ .dsh-ellipsis();
9
+ }
10
+
11
+ .overflow {
12
+ overflow: auto;
13
+ .bri-scrollbar3();
14
+ }
15
+
16
+ .placeholder {
17
+ flex: 1;
18
+ min-width: 0px;
19
+ overflow: hidden;
20
+ }
21
+
22
+ .icon {
23
+ &-default {
24
+
25
+ }
26
+ &-close {
27
+
28
+ }
29
+ }
3
30
  }
@@ -7,14 +7,13 @@
7
7
  width: 100%;
8
8
 
9
9
  &-edit {
10
- #bri-control-wrap();
10
+
11
11
  }
12
12
  }
13
13
 
14
14
  // 单选 -新模式
15
15
  &-custom {
16
16
  width: 100%;
17
- #bri-control-wrap();
18
17
  }
19
18
  // 单选 -默认模式
20
19
  &-single {
@@ -36,7 +35,7 @@
36
35
  // 多选类型且独自一行时
37
36
  &-row {
38
37
  &-edit {
39
- // height: 68px;
38
+
40
39
  }
41
40
  &-show {
42
41
  height: auto;
@@ -2,14 +2,10 @@
2
2
  width: 100%;
3
3
 
4
4
  &-edit {
5
- #bri-control-wrap();
6
- }
7
5
 
8
- &-show {
9
-
10
6
  }
11
7
 
12
- &-unit {
8
+ &-show {
13
9
 
14
10
  }
15
11
 
@@ -2,7 +2,7 @@
2
2
  width: 100%;
3
3
 
4
4
  &-edit {
5
- #bri-control-wrap();
5
+
6
6
  }
7
7
 
8
8
  &-show {
@@ -2,7 +2,7 @@
2
2
  width: 100%;
3
3
 
4
4
  &-edit {
5
- #bri-control-wrap();
5
+
6
6
  }
7
7
 
8
8
  &-show {
@@ -2,7 +2,7 @@
2
2
  width: 100%;
3
3
 
4
4
  &-edit {
5
- #bri-control-wrap();
5
+
6
6
  }
7
7
  &-show {
8
8
 
@@ -23,6 +23,8 @@
23
23
  @import "./unit/DshUnit.less";
24
24
 
25
25
  // controls
26
+ @import "./controls/BriControlInput.less";
27
+
26
28
  @import "./controls/base/DshInput.less";
27
29
  @import "./controls/base/BriInputs.less";
28
30
  @import "./controls/base/DshNumber.less";
@@ -6,12 +6,12 @@
6
6
  }
7
7
 
8
8
  .ivu-tooltip-inner {
9
+ padding: 5px 8px;
9
10
  border-radius: 4px;
10
11
  background: rgba(0, 0, 0, 0.9);
11
- color: rgba(255, 255, 255, 0.9);
12
12
  font-size: 14px;
13
13
  font-weight: 400;
14
- padding: 5px 8px;
14
+ color: rgba(255, 255, 255, 0.9);
15
15
  }
16
16
 
17
17
  .ivu-tooltip-rel {
@@ -90,7 +90,7 @@
90
90
  }
91
91
  }
92
92
  .ivu-modal-body {
93
- padding: 16px 24px 20px;
93
+ padding: 10px;
94
94
  }
95
95
  }
96
96
  }