bri-components 1.5.21 → 1.6.0

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 (153) hide show
  1. package/README.md +83 -83
  2. package/lib/styles/bundle.css +12 -12
  3. package/lib/styles/font/fontello.svg +31 -31
  4. package/package.json +125 -125
  5. package/src/components/Error/Error403.vue +42 -42
  6. package/src/components/Error/Error404.vue +40 -40
  7. package/src/components/Error/Error500.vue +51 -51
  8. package/src/components/Error/error.less +162 -162
  9. package/src/components/Error/errorBack.vue +40 -40
  10. package/src/components/controls/DshControlInput.vue +195 -195
  11. package/src/components/controls/base/BriUpload/BriUpload.vue +434 -434
  12. package/src/components/controls/base/BriUpload/BriUploadImage.vue +377 -377
  13. package/src/components/controls/base/BriUpload/uploadList.vue +727 -727
  14. package/src/components/controls/base/BriUpload/uploadMixin.js +446 -446
  15. package/src/components/controls/base/DshCascader/DshCascader.vue +215 -215
  16. package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
  17. package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
  18. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -141
  19. package/src/components/controls/base/DshCascader/components/cascaderTree.vue +151 -151
  20. package/src/components/controls/base/DshCoordinates.vue +585 -577
  21. package/src/components/controls/base/DshDate/DshDate.vue +191 -191
  22. package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
  23. package/src/components/controls/base/DshDivider.vue +201 -201
  24. package/src/components/controls/base/DshEditor.vue +274 -274
  25. package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
  26. package/src/components/controls/base/DshInput/DshInput.vue +260 -260
  27. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
  28. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
  29. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
  30. package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
  31. package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
  32. package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
  33. package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
  34. package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
  35. package/src/components/controls/base/DshSelect/DshSelectAll.vue +269 -269
  36. package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
  37. package/src/components/controls/control.less +324 -324
  38. package/src/components/controls/controlMap.js +117 -117
  39. package/src/components/controls/extra/DshColor.vue +81 -81
  40. package/src/components/controls/extra/DshThemeColor.vue +100 -100
  41. package/src/components/controls/extra/DshThemeIcon.vue +122 -122
  42. package/src/components/controls/mixins/cascaderMixin.js +325 -325
  43. package/src/components/controls/mixins/cascaderPickerMixin.js +227 -227
  44. package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
  45. package/src/components/controls/mixins/controlMixin.js +393 -393
  46. package/src/components/controls/mixins/dateMixin.js +149 -149
  47. package/src/components/controls/mixins/flatTableMixin.js +111 -111
  48. package/src/components/controls/mixins/numberMixin.js +112 -112
  49. package/src/components/controls/mixins/selectMixin.js +233 -233
  50. package/src/components/controls/mixins/switchMixin.js +87 -87
  51. package/src/components/controls/mixins/userAndDepartMixin.js +260 -260
  52. package/src/components/controls/senior/DshLabels.vue +333 -333
  53. package/src/components/controls/senior/DshPackage.vue +57 -57
  54. package/src/components/controls/senior/cascaderTable.vue +213 -213
  55. package/src/components/controls/senior/correlation.vue +135 -135
  56. package/src/components/controls/senior/flatTable.vue +138 -138
  57. package/src/components/controls/senior/selectDepartments.vue +399 -399
  58. package/src/components/controls/senior/selectUsers/departMenu.vue +293 -293
  59. package/src/components/controls/senior/selectUsers/selectUsers.vue +712 -712
  60. package/src/components/controls/special/DshBack.vue +42 -42
  61. package/src/components/controls/special/DshUndeveloped.vue +41 -41
  62. package/src/components/form/DshAdvSearch.vue +510 -510
  63. package/src/components/form/DshDefaultSearch.vue +260 -260
  64. package/src/components/form/DshForm.vue +494 -494
  65. package/src/components/form/searchMixin.js +376 -376
  66. package/src/components/list/BriCard.vue +95 -95
  67. package/src/components/list/BriTable.vue +205 -205
  68. package/src/components/list/BriTree.vue +529 -529
  69. package/src/components/list/BriTreeItem.vue +163 -163
  70. package/src/components/list/DshBox/DshBox.vue +219 -219
  71. package/src/components/list/DshBox/DshCard.vue +446 -446
  72. package/src/components/list/DshBox/DshCrossTable.vue +827 -827
  73. package/src/components/list/DshBox/DshList.vue +404 -404
  74. package/src/components/list/DshBox/DshPanel.vue +669 -669
  75. package/src/components/list/DshBox/DshSingleData.vue +119 -119
  76. package/src/components/list/DshBox/DshTable.vue +239 -239
  77. package/src/components/list/DshCascaderTable.vue +115 -115
  78. package/src/components/list/DshFlatTable.vue +337 -337
  79. package/src/components/list/DshPage.vue +194 -194
  80. package/src/components/list/DshTreeTable.vue +113 -113
  81. package/src/components/list/common/importModal.vue +243 -243
  82. package/src/components/list/common/quoteListModal.vue +206 -206
  83. package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
  84. package/src/components/list/mixins/DshFlatTableMixin.js +509 -509
  85. package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
  86. package/src/components/list/mixins/tableBaseMixin.js +1653 -1653
  87. package/src/components/list/mixins/treeTableBaseMixin.js +145 -145
  88. package/src/components/other/BriAvatar.vue +166 -166
  89. package/src/components/other/BriCode.vue +125 -125
  90. package/src/components/other/BriCollapseTree.vue +207 -207
  91. package/src/components/other/BriGantt.vue +1087 -1087
  92. package/src/components/other/BriIframe.vue +116 -116
  93. package/src/components/other/BriLoading.vue +171 -171
  94. package/src/components/other/BriSvg.vue +27 -27
  95. package/src/components/other/DshColorPanel.vue +128 -128
  96. package/src/components/other/DshMenuNav.vue +188 -188
  97. package/src/components/small/BriButton.vue +71 -71
  98. package/src/components/small/BriDrawer.vue +169 -169
  99. package/src/components/small/BriTooltip.vue +87 -87
  100. package/src/components/small/DshBtnModal.vue +68 -68
  101. package/src/components/small/DshButtons.vue +324 -324
  102. package/src/components/small/DshDropdown.vue +225 -225
  103. package/src/components/small/DshIcons.vue +59 -59
  104. package/src/components/small/DshListRender.js +21 -21
  105. package/src/components/small/DshModal.vue +160 -160
  106. package/src/components/small/DshSteps.vue +141 -141
  107. package/src/components/small/DshTabs.vue +598 -598
  108. package/src/components/small/DshTabsSet.vue +309 -309
  109. package/src/components/small/DshTags.vue +251 -251
  110. package/src/components/small/DshTitle.vue +50 -50
  111. package/src/components/small/render.js +20 -20
  112. package/src/components/unit/DshFormUnit.vue +398 -398
  113. package/src/components/unit/DshListUnit.vue +115 -115
  114. package/src/components/unit/unitMixin.js +86 -86
  115. package/src/data/index.js +4 -4
  116. package/src/index.js +285 -285
  117. package/src/styles/bundle.css +12 -12
  118. package/src/styles/components/BriButton.less +307 -307
  119. package/src/styles/components/BriTable.less +344 -344
  120. package/src/styles/components/DshModal.less +257 -257
  121. package/src/styles/components/index.less +3 -3
  122. package/src/styles/global/animate.less +11 -11
  123. package/src/styles/global/base.less +45 -45
  124. package/src/styles/global/box.less +186 -186
  125. package/src/styles/global/control.less +122 -122
  126. package/src/styles/global/flex.less +282 -282
  127. package/src/styles/global/global.less +8 -8
  128. package/src/styles/global/text.less +59 -59
  129. package/src/styles/global/variables.less +85 -85
  130. package/src/styles/iconfont/iconfont.css +254 -254
  131. package/src/styles/iconfont/iconfont.json +422 -422
  132. package/src/styles/iconfont/iconfont.svg +137 -137
  133. package/src/styles/index.less +26 -26
  134. package/src/styles/reset-easytable.less +21 -21
  135. package/src/styles/reset-iview-controls.less +145 -145
  136. package/src/styles/reset-iview-other.less +49 -49
  137. package/src/styles/reset-iview-variables.less +43 -43
  138. package/src/styles/reset.less +45 -45
  139. package/src/utils/index.js +3 -5
  140. package/lib/0.bri-components.min.js +0 -1
  141. package/lib/1.bri-components.min.js +0 -1
  142. package/lib/10.bri-components.min.js +0 -1
  143. package/lib/11.bri-components.min.js +0 -1
  144. package/lib/2.bri-components.min.js +0 -1
  145. package/lib/3.bri-components.min.js +0 -1
  146. package/lib/4.bri-components.min.js +0 -1
  147. package/lib/5.bri-components.min.js +0 -1
  148. package/lib/6.bri-components.min.js +0 -1
  149. package/lib/7.bri-components.min.js +0 -1
  150. package/lib/8.bri-components.min.js +0 -1
  151. package/lib/9.bri-components.min.js +0 -1
  152. package/lib/bri-components.min.js +0 -18
  153. package/src/utils/table.js +0 -175
@@ -1,71 +1,71 @@
1
- <template>
2
- <Button
3
- class="BriButton"
4
- :class="selfPropsObj.class"
5
- :type="selfPropsObj.btnType"
6
- :shape="selfPropsObj.shape || shape"
7
- :size="selfPropsObj.size || size"
8
- :loading="selfPropsObj.loading"
9
- :disabled="selfPropsObj.disabled"
10
- :htmlType="selfPropsObj.htmlType"
11
- :icon="(selfPropsObj.customIcon || customIcon) ? undefined : (selfPropsObj.icon || icon)"
12
- :customIcon="selfPropsObj.customIcon || customIcon"
13
- :long="selfPropsObj.long"
14
- :ghost="selfPropsObj.ghost"
15
- @click="dispatchEvent"
16
- >
17
- <slot></slot>
18
- </Button>
19
- </template>
20
-
21
- <script>
22
- export default {
23
- name: "BriButton",
24
- props: {
25
- type: {
26
- type: String,
27
- default: "primary"
28
- },
29
- icon: String,
30
- shape: String,
31
- size: String,
32
- customIcon: String,
33
-
34
- propsObj: {
35
- type: Object,
36
- default () {
37
- return {};
38
- }
39
- }
40
- },
41
- data () {
42
- return {};
43
- },
44
- computed: {
45
- selfPropsObj () {
46
- const originBtnType = this.propsObj.btnType || this.type;
47
- let btnType = originBtnType;
48
- if (["cancel"].includes(originBtnType)) {
49
- btnType = "primary";
50
- } else if (["errorLine", "primaryLine"].includes(originBtnType)) {
51
- btnType = "default";
52
- } else if (["linkText", "primaryText", "errorText", "successText"].includes(originBtnType)) {
53
- btnType = "text";
54
- }
55
-
56
- return {
57
- class: ["cancel", "errorLine", "primaryLine", "linkText", "primaryText", "errorText", "successText"].includes(originBtnType) ? `ivu-btn-${originBtnType}` : "",
58
- ...this.propsObj,
59
- btnType: btnType,
60
- customIcon: this.propsObj.customIcon ? `bico-font ${this.propsObj.customIcon}` : undefined
61
- };
62
- }
63
- },
64
- created () {},
65
- methods: {
66
- dispatchEvent () {
67
- this.$emit("click", this.selfPropsObj);
68
- }
69
- }
70
- };
71
- </script>
1
+ <template>
2
+ <Button
3
+ class="BriButton"
4
+ :class="selfPropsObj.class"
5
+ :type="selfPropsObj.btnType"
6
+ :shape="selfPropsObj.shape || shape"
7
+ :size="selfPropsObj.size || size"
8
+ :loading="selfPropsObj.loading"
9
+ :disabled="selfPropsObj.disabled"
10
+ :htmlType="selfPropsObj.htmlType"
11
+ :icon="(selfPropsObj.customIcon || customIcon) ? undefined : (selfPropsObj.icon || icon)"
12
+ :customIcon="selfPropsObj.customIcon || customIcon"
13
+ :long="selfPropsObj.long"
14
+ :ghost="selfPropsObj.ghost"
15
+ @click="dispatchEvent"
16
+ >
17
+ <slot></slot>
18
+ </Button>
19
+ </template>
20
+
21
+ <script>
22
+ export default {
23
+ name: "BriButton",
24
+ props: {
25
+ type: {
26
+ type: String,
27
+ default: "primary"
28
+ },
29
+ icon: String,
30
+ shape: String,
31
+ size: String,
32
+ customIcon: String,
33
+
34
+ propsObj: {
35
+ type: Object,
36
+ default () {
37
+ return {};
38
+ }
39
+ }
40
+ },
41
+ data () {
42
+ return {};
43
+ },
44
+ computed: {
45
+ selfPropsObj () {
46
+ const originBtnType = this.propsObj.btnType || this.type;
47
+ let btnType = originBtnType;
48
+ if (["cancel"].includes(originBtnType)) {
49
+ btnType = "primary";
50
+ } else if (["errorLine", "primaryLine"].includes(originBtnType)) {
51
+ btnType = "default";
52
+ } else if (["linkText", "primaryText", "errorText", "successText"].includes(originBtnType)) {
53
+ btnType = "text";
54
+ }
55
+
56
+ return {
57
+ class: ["cancel", "errorLine", "primaryLine", "linkText", "primaryText", "errorText", "successText"].includes(originBtnType) ? `ivu-btn-${originBtnType}` : "",
58
+ ...this.propsObj,
59
+ btnType: btnType,
60
+ customIcon: this.propsObj.customIcon ? `bico-font ${this.propsObj.customIcon}` : undefined
61
+ };
62
+ }
63
+ },
64
+ created () {},
65
+ methods: {
66
+ dispatchEvent () {
67
+ this.$emit("click", this.selfPropsObj);
68
+ }
69
+ }
70
+ };
71
+ </script>
@@ -1,169 +1,169 @@
1
- <template>
2
- <Drawer
3
- class="BriDrawer"
4
- v-model="showModal"
5
- :title="selfPropsObj.title"
6
- :width="selfPropsObj.width"
7
- :height="selfPropsObj.height"
8
- :closable="selfPropsObj.closable"
9
- :mask-closable="selfPropsObj.maskClosable"
10
- :mask="selfPropsObj.mask"
11
- :mask-style="selfPropsObj.maskStyle"
12
- :styles="selfPropsObj.styles"
13
- :scrollable="selfPropsObj.scrollable"
14
- :placement="selfPropsObj.placement"
15
- :transfer="selfPropsObj.transfer"
16
- :class-name="selfPropsObj.className"
17
- :inner="selfPropsObj.inner"
18
- :draggable="selfPropsObj.draggable"
19
- :before-close="selfPropsObj.beforeClose"
20
- :lock-scroll="selfPropsObj.lockScroll"
21
- @on-close="close"
22
- @on-visible-change="visibleChange"
23
- @on-resize-width="resizeChange"
24
- >
25
- <div
26
- slot="header"
27
- class="BriDrawer-header"
28
- >
29
- <slot name="header">
30
- {{ selfPropsObj.title }}
31
- </slot>
32
- </div>
33
-
34
- <!-- 删除按钮 -->
35
- <Icon
36
- v-if="selfPropsObj.closable"
37
- slot="close"
38
- class="BriDrawer-close"
39
- type="md-close"
40
- size="20"
41
- @click.stop="clickClose"
42
- />
43
-
44
- <slot
45
- slot="trigger"
46
- name="trigger"
47
- ></slot>
48
-
49
- <div class="BriDrawer-main">
50
- <div class="BriDrawer-body">
51
- <slot></slot>
52
- </div>
53
-
54
- <div
55
- v-if="selfPropsObj.footer"
56
- class="BriDrawer-footer"
57
- >
58
- <slot name="footer">
59
- <dsh-buttons
60
- :list="list"
61
- @click="$dshEmit($event)"
62
- ></dsh-buttons>
63
- </slot>
64
- </div>
65
- </div>
66
- </Drawer>
67
- </template>
68
-
69
- <script>
70
- export default {
71
- name: "BriDrawer",
72
- props: {
73
- value: Boolean,
74
- propsObj: {
75
- type: Object,
76
- default () {
77
- return {};
78
- }
79
- },
80
- list: {
81
- type: Array,
82
- default () {
83
- return [];
84
- }
85
- }
86
- },
87
- data () {
88
- return {};
89
- },
90
- computed: {
91
- showModal: {
92
- get () {
93
- return this.value;
94
- },
95
- set (bool) {
96
- this.$emit("input", bool);
97
- }
98
- },
99
- selfPropsObj () {
100
- return {
101
- width: 320,
102
- closable: true,
103
- transfer: true,
104
- footer: true,
105
- maskClosable: false,
106
- draggable: true,
107
- ...this.propsObj
108
- };
109
- }
110
- },
111
- created () {},
112
- methods: {
113
- clickClose () {
114
- this.showModal = false;
115
- },
116
- close (...parmas) {
117
- this.$emit("on-close", ...parmas);
118
- },
119
- resizeChange (...parmas) {
120
- this.$emit("on-resize-change", ...parmas);
121
- },
122
- visibleChange (bool = false) {
123
- this.$emit("on-visible-change", bool);
124
- }
125
- }
126
- };
127
- </script>
128
-
129
- <style lang="less">
130
- .BriDrawer {
131
- &-header {
132
- color: @textColor;
133
- font-weight: 500;
134
- font-size: @smallTitleSize;
135
- line-height: @smallTitleHeight;
136
- }
137
-
138
- &-close {
139
- color: @contentColor;
140
- }
141
-
142
- &-main {
143
- height: 100%;
144
- display: flex;
145
- flex-direction: column;
146
- }
147
-
148
- &-body {
149
- flex: 1;
150
- overflow: auto;
151
- }
152
-
153
- &-footer {
154
- border-top: 1px solid @borderColor;
155
- padding: 11px 16px 12px;
156
- }
157
-
158
- .ivu-drawer-header {
159
- padding: 16px 16px 15px;
160
- }
161
- .ivu-drawer-body {
162
- padding: 0px;
163
- }
164
- .ivu-drawer-close {
165
- top: 18px;
166
- right: 18px
167
- }
168
- }
169
- </style>
1
+ <template>
2
+ <Drawer
3
+ class="BriDrawer"
4
+ v-model="showModal"
5
+ :title="selfPropsObj.title"
6
+ :width="selfPropsObj.width"
7
+ :height="selfPropsObj.height"
8
+ :closable="selfPropsObj.closable"
9
+ :mask-closable="selfPropsObj.maskClosable"
10
+ :mask="selfPropsObj.mask"
11
+ :mask-style="selfPropsObj.maskStyle"
12
+ :styles="selfPropsObj.styles"
13
+ :scrollable="selfPropsObj.scrollable"
14
+ :placement="selfPropsObj.placement"
15
+ :transfer="selfPropsObj.transfer"
16
+ :class-name="selfPropsObj.className"
17
+ :inner="selfPropsObj.inner"
18
+ :draggable="selfPropsObj.draggable"
19
+ :before-close="selfPropsObj.beforeClose"
20
+ :lock-scroll="selfPropsObj.lockScroll"
21
+ @on-close="close"
22
+ @on-visible-change="visibleChange"
23
+ @on-resize-width="resizeChange"
24
+ >
25
+ <div
26
+ slot="header"
27
+ class="BriDrawer-header"
28
+ >
29
+ <slot name="header">
30
+ {{ selfPropsObj.title }}
31
+ </slot>
32
+ </div>
33
+
34
+ <!-- 删除按钮 -->
35
+ <Icon
36
+ v-if="selfPropsObj.closable"
37
+ slot="close"
38
+ class="BriDrawer-close"
39
+ type="md-close"
40
+ size="20"
41
+ @click.stop="clickClose"
42
+ />
43
+
44
+ <slot
45
+ slot="trigger"
46
+ name="trigger"
47
+ ></slot>
48
+
49
+ <div class="BriDrawer-main">
50
+ <div class="BriDrawer-body">
51
+ <slot></slot>
52
+ </div>
53
+
54
+ <div
55
+ v-if="selfPropsObj.footer"
56
+ class="BriDrawer-footer"
57
+ >
58
+ <slot name="footer">
59
+ <dsh-buttons
60
+ :list="list"
61
+ @click="$dshEmit($event)"
62
+ ></dsh-buttons>
63
+ </slot>
64
+ </div>
65
+ </div>
66
+ </Drawer>
67
+ </template>
68
+
69
+ <script>
70
+ export default {
71
+ name: "BriDrawer",
72
+ props: {
73
+ value: Boolean,
74
+ propsObj: {
75
+ type: Object,
76
+ default () {
77
+ return {};
78
+ }
79
+ },
80
+ list: {
81
+ type: Array,
82
+ default () {
83
+ return [];
84
+ }
85
+ }
86
+ },
87
+ data () {
88
+ return {};
89
+ },
90
+ computed: {
91
+ showModal: {
92
+ get () {
93
+ return this.value;
94
+ },
95
+ set (bool) {
96
+ this.$emit("input", bool);
97
+ }
98
+ },
99
+ selfPropsObj () {
100
+ return {
101
+ width: 320,
102
+ closable: true,
103
+ transfer: true,
104
+ footer: true,
105
+ maskClosable: false,
106
+ draggable: true,
107
+ ...this.propsObj
108
+ };
109
+ }
110
+ },
111
+ created () {},
112
+ methods: {
113
+ clickClose () {
114
+ this.showModal = false;
115
+ },
116
+ close (...parmas) {
117
+ this.$emit("on-close", ...parmas);
118
+ },
119
+ resizeChange (...parmas) {
120
+ this.$emit("on-resize-change", ...parmas);
121
+ },
122
+ visibleChange (bool = false) {
123
+ this.$emit("on-visible-change", bool);
124
+ }
125
+ }
126
+ };
127
+ </script>
128
+
129
+ <style lang="less">
130
+ .BriDrawer {
131
+ &-header {
132
+ color: @textColor;
133
+ font-weight: 500;
134
+ font-size: @smallTitleSize;
135
+ line-height: @smallTitleHeight;
136
+ }
137
+
138
+ &-close {
139
+ color: @contentColor;
140
+ }
141
+
142
+ &-main {
143
+ height: 100%;
144
+ display: flex;
145
+ flex-direction: column;
146
+ }
147
+
148
+ &-body {
149
+ flex: 1;
150
+ overflow: auto;
151
+ }
152
+
153
+ &-footer {
154
+ border-top: 1px solid @borderColor;
155
+ padding: 11px 16px 12px;
156
+ }
157
+
158
+ .ivu-drawer-header {
159
+ padding: 16px 16px 15px;
160
+ }
161
+ .ivu-drawer-body {
162
+ padding: 0px;
163
+ }
164
+ .ivu-drawer-close {
165
+ top: 18px;
166
+ right: 18px
167
+ }
168
+ }
169
+ </style>
@@ -1,87 +1,87 @@
1
- <template>
2
- <Tooltip
3
- class="BriTooltip"
4
- :content="content"
5
- :disabled="toolTipDisabled"
6
- :placement="placement"
7
- :max-width="maxWidth"
8
- :transfer="transfer"
9
- >
10
- <slot></slot>
11
-
12
- <slot
13
- slot="content"
14
- name="content"
15
- ></slot>
16
- </Tooltip>
17
- </template>
18
-
19
- <script>
20
- export default {
21
- name: "BriTooltip",
22
- props: {
23
- content: [String, Number],
24
- placement: {
25
- type: String,
26
- default: "bottom"
27
- },
28
- maxWidth: {
29
- type: String,
30
- default: "300"
31
- },
32
- transfer: {
33
- type: Boolean,
34
- default: false
35
- },
36
-
37
- defaultDisabled: {
38
- type: Boolean,
39
- default: true
40
- }
41
- },
42
- data () {
43
- return {
44
- toolTipDisabled: true,
45
- tmpToolTipDisabled: true
46
- };
47
- },
48
- created () {
49
- this.toolTipDisabled = this.defaultDisabled;
50
- this.tmpToolTipDisabled = this.toolTipDisabled;
51
- },
52
- mounted () {
53
- this.getToolTipDisabled("mouted");
54
- },
55
- updated () {
56
- this.getToolTipDisabled("updated");
57
- },
58
- methods: {
59
- getToolTipDisabled (type) {
60
- const isOverflow = this.$slots.default;
61
- const toolTipDisabled = isOverflow[0]
62
- ? !(isOverflow[0].elm.scrollWidth > isOverflow[0].elm.clientWidth)
63
- : this.toolTipDisabled;
64
-
65
- if (toolTipDisabled !== this.toolTipDisabled) {
66
- if (toolTipDisabled !== this.tmpToolTipDisabled) {
67
- this.tmpToolTipDisabled = toolTipDisabled;
68
-
69
- this.timer = setTimeout(() => {
70
- this.toolTipDisabled = toolTipDisabled;
71
- this.tmpToolTipDisabled = this.toolTipDisabled;
72
- }, 2000);
73
- }
74
- } else {
75
- clearTimeout(this.timer);
76
- }
77
- }
78
- }
79
- };
80
- </script>
81
-
82
- <style lang="less" scoped>
83
- .BriTooltip {
84
- width: 100%;
85
- display: flex;
86
- }
87
- </style>
1
+ <template>
2
+ <Tooltip
3
+ class="BriTooltip"
4
+ :content="content"
5
+ :disabled="toolTipDisabled"
6
+ :placement="placement"
7
+ :max-width="maxWidth"
8
+ :transfer="transfer"
9
+ >
10
+ <slot></slot>
11
+
12
+ <slot
13
+ slot="content"
14
+ name="content"
15
+ ></slot>
16
+ </Tooltip>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ name: "BriTooltip",
22
+ props: {
23
+ content: [String, Number],
24
+ placement: {
25
+ type: String,
26
+ default: "bottom"
27
+ },
28
+ maxWidth: {
29
+ type: String,
30
+ default: "300"
31
+ },
32
+ transfer: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+
37
+ defaultDisabled: {
38
+ type: Boolean,
39
+ default: true
40
+ }
41
+ },
42
+ data () {
43
+ return {
44
+ toolTipDisabled: true,
45
+ tmpToolTipDisabled: true
46
+ };
47
+ },
48
+ created () {
49
+ this.toolTipDisabled = this.defaultDisabled;
50
+ this.tmpToolTipDisabled = this.toolTipDisabled;
51
+ },
52
+ mounted () {
53
+ this.getToolTipDisabled("mouted");
54
+ },
55
+ updated () {
56
+ this.getToolTipDisabled("updated");
57
+ },
58
+ methods: {
59
+ getToolTipDisabled (type) {
60
+ const isOverflow = this.$slots.default;
61
+ const toolTipDisabled = isOverflow[0]
62
+ ? !(isOverflow[0].elm.scrollWidth > isOverflow[0].elm.clientWidth)
63
+ : this.toolTipDisabled;
64
+
65
+ if (toolTipDisabled !== this.toolTipDisabled) {
66
+ if (toolTipDisabled !== this.tmpToolTipDisabled) {
67
+ this.tmpToolTipDisabled = toolTipDisabled;
68
+
69
+ this.timer = setTimeout(() => {
70
+ this.toolTipDisabled = toolTipDisabled;
71
+ this.tmpToolTipDisabled = this.toolTipDisabled;
72
+ }, 2000);
73
+ }
74
+ } else {
75
+ clearTimeout(this.timer);
76
+ }
77
+ }
78
+ }
79
+ };
80
+ </script>
81
+
82
+ <style lang="less" scoped>
83
+ .BriTooltip {
84
+ width: 100%;
85
+ display: flex;
86
+ }
87
+ </style>