@aochuang/common 1.0.0 → 1.0.1

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 (194) hide show
  1. package/common/loading/index.js +7 -0
  2. package/common/loading/loading.vue +71 -0
  3. package/common/tips/index.js +7 -0
  4. package/common/tips/tips.vue +82 -0
  5. package/common/tooltip/index.js +7 -0
  6. package/common/tooltip/popper.js +18 -0
  7. package/common/tooltip/tooltip.vue +55 -0
  8. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-boolean.vue +33 -0
  9. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date-range.vue +30 -0
  10. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date.vue +41 -0
  11. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime-range.vue +34 -0
  12. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime.vue +41 -0
  13. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number-range.vue +67 -0
  14. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number.vue +35 -0
  15. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-string.vue +41 -0
  16. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-value.vue +73 -0
  17. package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item.vue +226 -0
  18. package/components/advanced-filter/advanced-filter-condition-toggle.vue +112 -0
  19. package/components/advanced-filter/advanced-filter-condition.vue +352 -0
  20. package/components/advanced-filter/advanced-filter-permanent-item.vue +10 -0
  21. package/components/advanced-filter/advanced-filter-permanent.vue +10 -0
  22. package/components/advanced-filter/advanced-filter-scene-form.vue +95 -0
  23. package/components/advanced-filter/advanced-filter-scene-item.vue +64 -0
  24. package/components/advanced-filter/advanced-filter-scene-manage.vue +264 -0
  25. package/components/advanced-filter/advanced-filter-scene-transfer.vue +283 -0
  26. package/components/advanced-filter/advanced-filter-scene.vue +199 -0
  27. package/components/advanced-filter/advanced-filter.vue +114 -0
  28. package/components/advanced-filter/index.js +36 -0
  29. package/components/advanced-filter/utils.js +132 -0
  30. package/components/autocomplete/autocomplete.vue +121 -0
  31. package/components/autocomplete/index.js +7 -0
  32. package/components/avatar/avatar.png +0 -0
  33. package/components/avatar/avatar.vue +212 -0
  34. package/components/avatar/index.js +7 -0
  35. package/components/brick-wall/brick-wall-skeleton.vue +125 -0
  36. package/components/brick-wall/brick-wall.vue +293 -0
  37. package/components/brick-wall/index.js +7 -0
  38. package/components/button/button.vue +537 -0
  39. package/components/button/index.js +7 -0
  40. package/components/button/utils.js +20 -0
  41. package/components/cascader/cascader.vue +184 -0
  42. package/components/cascader/index.js +7 -0
  43. package/components/cascader/util.js +50 -0
  44. package/components/checkbox/checkbox.vue +114 -0
  45. package/components/checkbox/index.js +7 -0
  46. package/components/checkbox-button/index.js +8 -0
  47. package/components/checkbox-group/checkbox-group.vue +11 -0
  48. package/components/checkbox-group/index.js +7 -0
  49. package/components/date-picker/date-picker.vue +300 -0
  50. package/components/date-picker/index.js +7 -0
  51. package/components/dialog/dialog.vue +182 -0
  52. package/components/dialog/index.js +14 -0
  53. package/components/dialog/utils.js +20 -0
  54. package/components/drawer/drawer.vue +186 -0
  55. package/components/drawer/index.js +14 -0
  56. package/components/drawer/utils.js +36 -0
  57. package/components/dropdown/dropdown-item.vue +63 -0
  58. package/components/dropdown/dropdown.vue +286 -0
  59. package/components/dropdown/index.js +16 -0
  60. package/components/empty/empty.vue +62 -0
  61. package/components/empty/index.js +7 -0
  62. package/components/filter/filter-group.vue +44 -0
  63. package/components/filter/filter-item.vue +122 -0
  64. package/components/filter/filter-more.vue +114 -0
  65. package/components/filter/filter.vue +407 -0
  66. package/components/filter/index.js +20 -0
  67. package/components/filter/refresh-line.svg +1 -0
  68. package/components/filter/util.js +5 -0
  69. package/components/form/form-cell.vue +231 -0
  70. package/components/form/form-group.vue +147 -0
  71. package/components/form/form-row.vue +51 -0
  72. package/components/form/form.vue +256 -0
  73. package/components/form/index.js +13 -0
  74. package/components/grid/grid-card-view/grid-card-view.vue +157 -0
  75. package/components/grid/grid-column.vue +136 -0
  76. package/components/grid/grid-filter/grid-filter-group.vue +41 -0
  77. package/components/grid/grid-filter/grid-filter-item.vue +68 -0
  78. package/components/grid/grid-filter/grid-filter.vue +115 -0
  79. package/components/grid/grid-filter/util.js +7 -0
  80. package/components/grid/grid-filter-operate/grid-filter-operate-item.vue +55 -0
  81. package/components/grid/grid-filter-operate/grid-filter-operate.vue +46 -0
  82. package/components/grid/grid-sort/grid-sort-proxy.js +27 -0
  83. package/components/grid/grid-sort/grid-sort.vue +205 -0
  84. package/components/grid/grid-sort/icons/asc.png +0 -0
  85. package/components/grid/grid-sort/icons/desc.png +0 -0
  86. package/components/grid/grid-sort/index.js +7 -0
  87. package/components/grid/grid-table-view/grid-table-view.vue +178 -0
  88. package/components/grid/grid-table.vue +547 -0
  89. package/components/grid/grid-toolbar/grid-batch-toolbar-proxy.js +21 -0
  90. package/components/grid/grid-toolbar/grid-batch-toolbar.vue +129 -0
  91. package/components/grid/grid-toolbar/grid-global-toolbar-proxy.js +21 -0
  92. package/components/grid/grid-toolbar/grid-global-toolbar.vue +37 -0
  93. package/components/grid/grid-toolbar/grid-more-toolbar-proxy.js +21 -0
  94. package/components/grid/grid-toolbar/grid-more-toolbar.vue +138 -0
  95. package/components/grid/grid-toolbar/grid-row-toolbar.vue +279 -0
  96. package/components/grid/grid-view-select.vue +78 -0
  97. package/components/grid/grid.vue +1102 -0
  98. package/components/grid/icons/more-line.svg +1 -0
  99. package/components/grid/icons/refresh.svg +14 -0
  100. package/components/grid/index.js +61 -0
  101. package/components/grid/util.js +31 -0
  102. package/components/icon/demo.css +539 -0
  103. package/components/icon/demo_index.html +7433 -0
  104. package/components/icon/icon.vue +96 -0
  105. package/components/icon/iconfont.css +1275 -0
  106. package/components/icon/iconfont.eot +0 -0
  107. package/components/icon/iconfont.js +1 -0
  108. package/components/icon/iconfont.json +2214 -0
  109. package/components/icon/iconfont.svg +455 -0
  110. package/components/icon/iconfont.ttf +0 -0
  111. package/components/icon/iconfont.woff +0 -0
  112. package/components/icon/iconfont.woff2 +0 -0
  113. package/components/icon/index.js +7 -0
  114. package/components/image/image.vue +299 -0
  115. package/components/image/index.js +12 -0
  116. package/components/image/util.js +26 -0
  117. package/components/index.js +153 -0
  118. package/components/loading/index.js +7 -0
  119. package/components/loading/loading.vue +130 -0
  120. package/components/menu/index.js +14 -0
  121. package/components/menu/menu-group.vue +240 -0
  122. package/components/menu/menu-item.vue +215 -0
  123. package/components/menu/menu.vue +64 -0
  124. package/components/message/index.js +19 -0
  125. package/components/message/message.js +28 -0
  126. package/components/message/message.less +6 -0
  127. package/components/message-box/index.js +10 -0
  128. package/components/message-box/message-box.js +140 -0
  129. package/components/message-box/message-box.less +5 -0
  130. package/components/pagination/index.js +7 -0
  131. package/components/pagination/pagination.vue +193 -0
  132. package/components/panel/index.js +7 -0
  133. package/components/panel/panel.vue +44 -0
  134. package/components/popover/index.js +7 -0
  135. package/components/popover/popover.vue +140 -0
  136. package/components/popup-select/index.js +7 -0
  137. package/components/popup-select/popup-select.vue +114 -0
  138. package/components/radio/index.js +7 -0
  139. package/components/radio/radio.vue +92 -0
  140. package/components/radio-button/index.js +7 -0
  141. package/components/radio-button/radio-button.vue +20 -0
  142. package/components/radio-group/index.js +7 -0
  143. package/components/radio-group/radio-group.vue +22 -0
  144. package/components/searchbox/index.js +7 -0
  145. package/components/searchbox/searchbox.vue +260 -0
  146. package/components/select/index.js +9 -0
  147. package/components/select/select-load-more.vue +53 -0
  148. package/components/select/select.vue +572 -0
  149. package/components/skeleton/index.js +14 -0
  150. package/components/skeleton/skeleton-rows.vue +52 -0
  151. package/components/skeleton/skeleton.vue +72 -0
  152. package/components/sortable/index.js +9 -0
  153. package/components/sortable/sortable-item.vue +77 -0
  154. package/components/sortable/sortable.vue +62 -0
  155. package/components/spinner/index.js +7 -0
  156. package/components/spinner/spinner.vue +121 -0
  157. package/components/spinner-range/index.js +7 -0
  158. package/components/spinner-range/spinner-range.vue +97 -0
  159. package/components/spinner-textarea/index.js +7 -0
  160. package/components/spinner-textarea/spinner-textarea.vue +65 -0
  161. package/components/switch/index.js +7 -0
  162. package/components/switch/switch.vue +105 -0
  163. package/components/tabs/index.js +10 -0
  164. package/components/tabs/tabs.vue +115 -0
  165. package/components/tag/index.js +9 -0
  166. package/components/tag/tag.less +30 -0
  167. package/components/text/index.js +7 -0
  168. package/components/text/text.vue +69 -0
  169. package/components/textarea/index.js +7 -0
  170. package/components/textarea/textarea.vue +229 -0
  171. package/components/textbox/index.js +7 -0
  172. package/components/textbox/textbox.vue +275 -0
  173. package/components/time-picker/index.js +7 -0
  174. package/components/time-picker/time-picker.vue +77 -0
  175. package/components/toolbar/index.js +14 -0
  176. package/components/toolbar/toolbar-item.vue +43 -0
  177. package/components/toolbar/toolbar.vue +81 -0
  178. package/components/tooltip/index.js +9 -0
  179. package/components/tooltip/tooltip.vue +86 -0
  180. package/components/transfer/index.js +7 -0
  181. package/components/transfer/transfer-load-more.vue +53 -0
  182. package/components/transfer/transfer.vue +245 -0
  183. package/components/tree/index.js +7 -0
  184. package/components/tree/tree.vue +326 -0
  185. package/components/tree/utils.js +122 -0
  186. package/components/video/index.js +7 -0
  187. package/components/video/video.vue +53 -0
  188. package/package.json +4 -1
  189. package/utils/date.js +55 -0
  190. package/utils/emitter.js +3 -0
  191. package/utils/json.js +19 -0
  192. package/utils/resize-event.js +35 -0
  193. package/utils/util.js +12 -0
  194. package/utils/utils.js +0 -0
@@ -0,0 +1,240 @@
1
+ <template>
2
+ <div class="ui-menu-group" :class="{'is-accordion': accordion, 'is-expanded': isExpanded, 'is-enable-indent': enableIndent}">
3
+ <router-link
4
+ v-if="isLink"
5
+ :to="path"
6
+ class="ui-menu-group__head"
7
+ @click="handleToggleClick"
8
+ >
9
+ <template slot-scope="{isActive, isExactActive, href}">
10
+ {{handleLinkActive(href, isActive, isExactActive)}}
11
+ <a :href="href" class="ui-menu-group__head-main" :class="[handleActiveLink(isActive, isExactActive, href) && 'router-link-active']">
12
+ <div class="ui-menu-group__text">
13
+ <ui-icon class="ui-menu-group__icon" v-if="icon" :name="icon"></ui-icon>
14
+ <strong class="ui-menu-group__title" :title="label">{{label}}</strong>
15
+ </div>
16
+ <slot name="append"></slot>
17
+ <span v-if="accordion" class="ui-menu-group__toggle">
18
+ <ui-icon name="arrow-left" :size="22"></ui-icon>
19
+ </span>
20
+ </a>
21
+ </template>
22
+ </router-link>
23
+ <div v-else class="ui-menu-group__head" @click="handleToggleClick">
24
+ <div class="ui-menu-group__head-main">
25
+ <div class="ui-menu-group__text">
26
+ <ui-icon class="ui-menu-group__icon" v-if="icon" :name="icon"></ui-icon>
27
+ <strong class="ui-menu-group__title" :title="label">{{label}}</strong>
28
+ </div>
29
+ <slot name="append"></slot>
30
+ <span v-if="accordion" class="ui-menu-group__toggle">
31
+ <ui-icon name="arrow-left" :size="22"></ui-icon>
32
+ </span>
33
+ </div>
34
+ </div>
35
+ <div class="ui-menu-group__body">
36
+ <slot></slot>
37
+ </div>
38
+ </div>
39
+ </template>
40
+ <script>
41
+ import UiIcon from '../icon'
42
+
43
+ export default {
44
+ name: 'UiMenuGroup',
45
+ inject: ['UiMenu'],
46
+ provide () {
47
+ return {
48
+ UiMenuGroup: this
49
+ }
50
+ },
51
+ components: {
52
+ UiIcon
53
+ },
54
+ props: {
55
+ label: {
56
+ type: String
57
+ },
58
+ icon: {
59
+ type: String
60
+ },
61
+ path: {
62
+ type: String
63
+ },
64
+ checkActiveMethod: {
65
+ type: Function
66
+ }
67
+ },
68
+ data () {
69
+ return {
70
+ ready: false
71
+ }
72
+ },
73
+ computed: {
74
+ index () {
75
+ let index = -1
76
+ const $vnodes = this.UiMenu.$slots.default || []
77
+ $vnodes.filter(v => v.componentOptions.tag === 'ui-menu-group').some((v, i) => {
78
+ if (v === this.$vnode) {
79
+ index = i
80
+ return true
81
+ }
82
+ })
83
+ return index
84
+ },
85
+ enableIndent () {
86
+ return this.UiMenu.enableIndent
87
+ },
88
+ isExpanded () {
89
+ if (this.accordion) {
90
+ return this.UiMenu.innerExpandedGroupIndex === this.index
91
+ }
92
+ return true
93
+ },
94
+ accordion () {
95
+ return this.UiMenu.accordion
96
+ },
97
+ tag () {
98
+ if (this.path) {
99
+ return 'router-link'
100
+ } else {
101
+ return 'div'
102
+ }
103
+ },
104
+ isLink () {
105
+ return !!this.path
106
+ },
107
+ activeLink () {
108
+ return this.UiMenu.activeLink
109
+ }
110
+ },
111
+ mounted () {
112
+ this.ready = true
113
+ },
114
+ methods: {
115
+ handleToggleClick () {
116
+ if (this.accordion) {
117
+ this.UiMenu.setExpandedGroupIndex(this.index)
118
+ }
119
+ },
120
+ handleLinkActive (href, isActive, isExactActive) {
121
+ if (isExactActive) {
122
+ this.UiMenu.activeLink = href
123
+ }
124
+ },
125
+ handleActiveLink (isActive, isExactActive, href) {
126
+ if (!this.ready) {
127
+ return false
128
+ }
129
+ if (this.checkActiveMethod) {
130
+ const rs = this.checkActiveMethod()
131
+ if (typeof rs === 'boolean') {
132
+ return rs
133
+ }
134
+ }
135
+ if (isExactActive) {
136
+ return true
137
+ }
138
+ if (isActive) {
139
+ if (this.activeLink && this.activeLink !== href) {
140
+ return false
141
+ } else {
142
+ return true
143
+ }
144
+ }
145
+ return false
146
+ }
147
+ }
148
+ }
149
+ </script>
150
+ <style lang="less">
151
+ .ui-menu-group__head-main{
152
+ display: block;
153
+ }
154
+ .ui-menu--static{
155
+ .ui-menu-group__head-main{
156
+ padding: 10px 20px;
157
+ height: 24px;
158
+ line-height: 24px;
159
+ display: flex;
160
+ flex-direction: row;
161
+ align-items: center;
162
+ justify-content: space-between;
163
+ position: relative;
164
+ color: #404040;
165
+ &:after{
166
+ content: '';
167
+ position: absolute;
168
+ top: 0;
169
+ bottom: 0;
170
+ right: 0;
171
+ transition: all 0.3s;
172
+ background-color: transparent;
173
+ width: 2px;
174
+ }
175
+ &.router-link-active{
176
+ background-color: #fcfbfe;
177
+ &:after{
178
+ background-color: #00A0EB;
179
+ }
180
+ }
181
+ }
182
+ .ui-menu-group__title{
183
+ min-width: 0;
184
+ white-space: nowrap;
185
+ overflow: hidden;
186
+ text-overflow: ellipsis;
187
+ }
188
+ .ui-menu-group__icon{
189
+ font-weight: normal;
190
+ color: #888;
191
+ display: inline-block;
192
+ vertical-align: top;
193
+ margin-right: 8px;
194
+ margin-left: -9px;
195
+ }
196
+ .ui-menu-group__body{
197
+ .ui-menu-item__main{
198
+ padding-left: 20px;
199
+ padding-right: 20px;
200
+ }
201
+ }
202
+ .ui-menu-group__toggle{
203
+ margin-right: -12px;
204
+ height: 20px;
205
+ line-height: 20px;
206
+ display: inline-block;
207
+ transition: all .3s;
208
+ transform: rotate(0deg);
209
+ .ui-icon{
210
+ color: #888;
211
+ font-weight: normal;
212
+ }
213
+ }
214
+ .ui-menu-group{
215
+ &.is-accordion{
216
+ .ui-menu-group__head-main{
217
+ cursor: pointer;
218
+ }
219
+ .ui-menu-group__body{
220
+ display: none;
221
+ }
222
+ &.is-expanded{
223
+ .ui-menu-group__toggle{
224
+ transform: rotate(270deg);
225
+ }
226
+ .ui-menu-group__body{
227
+ display: block;
228
+ }
229
+ }
230
+ }
231
+ &.is-enable-indent{
232
+ .ui-menu-group__body{
233
+ .ui-menu-item__main{
234
+ padding-left: 34px;
235
+ }
236
+ }
237
+ }
238
+ }
239
+ }
240
+ </style>
@@ -0,0 +1,215 @@
1
+ <template>
2
+ <div class="ui-menu-item" :class="className" @click="handleItemClick">
3
+ <component
4
+ :is="isLink ? 'router-link' : 'span'"
5
+ class="ui-menu-item__main"
6
+ :to="path"
7
+ >
8
+ <ui-icon v-if="icon" :name="icon" class="ui-menu-item__icon"></ui-icon>
9
+ <span v-if="label || $slots.default" class="ui-menu-item__text" :title="label">
10
+ <slot>{{label}}</slot>
11
+ </span>
12
+ <slot name="append"></slot>
13
+ </component>
14
+ </div>
15
+ </template>
16
+ <script>
17
+ export default {
18
+ name: 'UiMenuItem',
19
+ inject: {
20
+ UiMenu: 'UiMenu',
21
+ UiMenuGroup: {
22
+ default: null
23
+ }
24
+ },
25
+ props: {
26
+ name: {
27
+ type: [String, Number]
28
+ },
29
+ label: {
30
+ type: String
31
+ },
32
+ icon: {
33
+ type: String
34
+ },
35
+ path: {
36
+ type: String
37
+ },
38
+ type: {
39
+ type: String,
40
+ default: 'default',
41
+ validator (value) {
42
+ return ['divided', 'default'].indexOf(value) >= 0
43
+ }
44
+ }
45
+ },
46
+ computed: {
47
+ router () {
48
+ return this.UiMenu.router
49
+ },
50
+ isActive () {
51
+ if (!this.name) {
52
+ return false
53
+ }
54
+ return this.UiMenu.current === this.name
55
+ },
56
+ isLink () {
57
+ return !!this.path
58
+ },
59
+ className () {
60
+ const cls = []
61
+ if (this.type === 'divided') {
62
+ cls.push('is-devided')
63
+ }
64
+ if (this.isActive) {
65
+ cls.push('is-active')
66
+ }
67
+ if (this.router) {
68
+ cls.push('is-router')
69
+ }
70
+ return cls
71
+ }
72
+ },
73
+ methods: {
74
+ handleItemClick () {
75
+ this.$emit('click')
76
+ }
77
+ }
78
+ }
79
+ </script>
80
+ <style lang="less">
81
+ .ui-menu-item{
82
+ display: block;
83
+ }
84
+ .ui-menu-item__main,
85
+ .ui-menu-item__wrap{
86
+ display: block;
87
+ }
88
+ .ui-menu--float{
89
+ .ui-menu-item__main{
90
+ display: block;
91
+ line-height: 24px;
92
+ padding: 6px 12px;
93
+ cursor: pointer;
94
+ transition: all .3s;
95
+ &:hover{
96
+ background-color: #f0f8fc;
97
+ color: #00A0EB;
98
+ }
99
+ }
100
+ .ui-menu-item__icon{
101
+ display: inline-block;
102
+ vertical-align: top;
103
+ margin-right: 4px;
104
+ }
105
+ .ui-menu-item{
106
+ &.is-devided{
107
+ padding: 0;
108
+ height: 1px;
109
+ background: #eee;
110
+ margin: 6px 0;
111
+ .ui-menu-item__main{
112
+ display: none;
113
+ }
114
+ }
115
+ }
116
+ }
117
+ .ui-menu--static{
118
+ .ui-menu-item {
119
+ &.is-router .router-link-active, &.is-active .ui-menu-item__main{
120
+ color: #404040;
121
+ background-color: #fcfbfe;
122
+ .ui-menu-item__text{
123
+ color: #404040;
124
+ }
125
+ &:after{
126
+ background-color: #0052cc;
127
+ }
128
+ }
129
+ }
130
+ .ui-menu-item__main{
131
+ display: flex;
132
+ flex-direction: row;
133
+ width: 100%;
134
+ box-sizing: border-box;
135
+ line-height: 24px;
136
+ padding-top: 9px;
137
+ padding-bottom: 9px;
138
+ padding-left: 20px;
139
+ padding-right: 20px;
140
+ transition: all .3s;
141
+ position: relative;
142
+ cursor: pointer;
143
+ .ui-menu-item__text{
144
+ color: #888888;
145
+ }
146
+ &:hover{
147
+ color: #404040;
148
+ .ui-menu-item__text{
149
+ color: #404040;
150
+ }
151
+ }
152
+ &:after{
153
+ content: '';
154
+ position: absolute;
155
+ top: 0;
156
+ bottom: 0;
157
+ right: 0;
158
+ transition: all .3s;
159
+ background-color: transparent;
160
+ width: 2px;
161
+ }
162
+ }
163
+ .ui-menu-item__text{
164
+ flex: 1;
165
+ min-width: 0;
166
+ white-space: nowrap;
167
+ overflow: hidden;
168
+ text-overflow: ellipsis;
169
+ }
170
+ }
171
+ .ui-menu--box{
172
+ padding: 8px;
173
+ .ui-menu-item__main{
174
+ display: block;
175
+ line-height: 32px;
176
+ padding: 6px 12px;
177
+ white-space: nowrap;
178
+ overflow: hidden;
179
+ text-overflow: ellipsis;
180
+ cursor: pointer;
181
+ transition: all .3s;
182
+ border: 1px solid transparent;
183
+ border-radius: 3px;
184
+ // &:hover{
185
+ // background-color: #f0f8fc;
186
+ // color: #00A0EB;
187
+ // }
188
+ }
189
+ .ui-menu-item__icon{
190
+ display: inline-block;
191
+ vertical-align: top;
192
+ margin-right: 4px;
193
+ }
194
+ .ui-menu-item{
195
+ &:not(:last-child) {
196
+ margin-bottom: 6px;
197
+ }
198
+ &:hover, &.is-active {
199
+ .ui-menu-item__main{
200
+ background-color: #deebff;
201
+ border-color: #4c9aff;
202
+ }
203
+ }
204
+ &.is-devided{
205
+ padding: 0;
206
+ height: 1px;
207
+ background: #eee;
208
+ margin: 6px 0;
209
+ .ui-menu-item__main{
210
+ display: none;
211
+ }
212
+ }
213
+ }
214
+ }
215
+ </style>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div class="ui-menu" :class="['ui-menu--' + type]">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+ <script>
7
+ export default {
8
+ name: 'UiMenu',
9
+ provide () {
10
+ return {
11
+ UiMenu: this
12
+ }
13
+ },
14
+ props: {
15
+ type: {
16
+ type: String,
17
+ default: 'static',
18
+ validator (value) {
19
+ return ['static', 'float', 'box'].indexOf(value) >= 0
20
+ }
21
+ },
22
+ current: {
23
+ type: [String, Number]
24
+ },
25
+ router: {
26
+ type: Boolean,
27
+ default: true
28
+ },
29
+ enableIndent: {
30
+ type: Boolean,
31
+ default: true
32
+ },
33
+ accordion: {
34
+ type: Boolean,
35
+ default: false
36
+ },
37
+ expandedGroupIndex: {
38
+ type: Number,
39
+ default: 0
40
+ }
41
+ },
42
+ data () {
43
+ return {
44
+ activeLink: null,
45
+ innerExpandedGroupIndex: this.expandedGroupIndex
46
+ }
47
+ },
48
+ watch: {
49
+ expandedGroupIndex (val) {
50
+ this.innerExpandedGroupIndex = val
51
+ }
52
+ },
53
+ methods: {
54
+ setExpandedGroupIndex (groupIndex) {
55
+ this.innerExpandedGroupIndex = groupIndex
56
+ }
57
+ }
58
+ }
59
+ </script>
60
+ <style lang="less">
61
+ .ui-menu--float{
62
+ padding: 6px 0;
63
+ }
64
+ </style>
@@ -0,0 +1,19 @@
1
+ import {
2
+ warn,
3
+ success,
4
+ error
5
+ } from './message'
6
+ import './message.less'
7
+
8
+ export const install = (Vue) => {
9
+ Vue.prototype.$warn = warn
10
+ Vue.prototype.$success = success
11
+ Vue.prototype.$error = error
12
+ }
13
+
14
+ export default {
15
+ install,
16
+ warn,
17
+ success,
18
+ error
19
+ }
@@ -0,0 +1,28 @@
1
+ import Message from 'element-ui/lib/message'
2
+ import 'element-ui/lib/theme-chalk/icon.css'
3
+ import 'element-ui/lib/theme-chalk/message.css'
4
+
5
+ const warn = (message) => {
6
+ Message({
7
+ message,
8
+ type: 'warning'
9
+ })
10
+ }
11
+ const success = (message) => {
12
+ Message({
13
+ message,
14
+ type: 'success'
15
+ })
16
+ }
17
+ const error = (message) => {
18
+ Message({
19
+ message,
20
+ type: 'error'
21
+ })
22
+ }
23
+
24
+ export {
25
+ warn,
26
+ error,
27
+ success
28
+ }
@@ -0,0 +1,6 @@
1
+ body {
2
+ .el-message .el-message__content{
3
+ white-space: pre-wrap;
4
+ line-height: 1.7em;
5
+ }
6
+ }
@@ -0,0 +1,10 @@
1
+ import MessageBox from './message-box'
2
+
3
+ MessageBox.install = (Vue) => {
4
+ Vue.prototype.$message = MessageBox.message
5
+ Vue.prototype.$alert = MessageBox.alert
6
+ Vue.prototype.$confirm = MessageBox.confirm
7
+ // Vue.prototype.$confirmDel = MessageBox.confirmDel
8
+ }
9
+
10
+ export default MessageBox