@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.
- package/common/loading/index.js +7 -0
- package/common/loading/loading.vue +71 -0
- package/common/tips/index.js +7 -0
- package/common/tips/tips.vue +82 -0
- package/common/tooltip/index.js +7 -0
- package/common/tooltip/popper.js +18 -0
- package/common/tooltip/tooltip.vue +55 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-boolean.vue +33 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date-range.vue +30 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime-range.vue +34 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number-range.vue +67 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number.vue +35 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-string.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-value.vue +73 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item.vue +226 -0
- package/components/advanced-filter/advanced-filter-condition-toggle.vue +112 -0
- package/components/advanced-filter/advanced-filter-condition.vue +352 -0
- package/components/advanced-filter/advanced-filter-permanent-item.vue +10 -0
- package/components/advanced-filter/advanced-filter-permanent.vue +10 -0
- package/components/advanced-filter/advanced-filter-scene-form.vue +95 -0
- package/components/advanced-filter/advanced-filter-scene-item.vue +64 -0
- package/components/advanced-filter/advanced-filter-scene-manage.vue +264 -0
- package/components/advanced-filter/advanced-filter-scene-transfer.vue +283 -0
- package/components/advanced-filter/advanced-filter-scene.vue +199 -0
- package/components/advanced-filter/advanced-filter.vue +114 -0
- package/components/advanced-filter/index.js +36 -0
- package/components/advanced-filter/utils.js +132 -0
- package/components/autocomplete/autocomplete.vue +121 -0
- package/components/autocomplete/index.js +7 -0
- package/components/avatar/avatar.png +0 -0
- package/components/avatar/avatar.vue +212 -0
- package/components/avatar/index.js +7 -0
- package/components/brick-wall/brick-wall-skeleton.vue +125 -0
- package/components/brick-wall/brick-wall.vue +293 -0
- package/components/brick-wall/index.js +7 -0
- package/components/button/button.vue +537 -0
- package/components/button/index.js +7 -0
- package/components/button/utils.js +20 -0
- package/components/cascader/cascader.vue +184 -0
- package/components/cascader/index.js +7 -0
- package/components/cascader/util.js +50 -0
- package/components/checkbox/checkbox.vue +114 -0
- package/components/checkbox/index.js +7 -0
- package/components/checkbox-button/index.js +8 -0
- package/components/checkbox-group/checkbox-group.vue +11 -0
- package/components/checkbox-group/index.js +7 -0
- package/components/date-picker/date-picker.vue +300 -0
- package/components/date-picker/index.js +7 -0
- package/components/dialog/dialog.vue +182 -0
- package/components/dialog/index.js +14 -0
- package/components/dialog/utils.js +20 -0
- package/components/drawer/drawer.vue +186 -0
- package/components/drawer/index.js +14 -0
- package/components/drawer/utils.js +36 -0
- package/components/dropdown/dropdown-item.vue +63 -0
- package/components/dropdown/dropdown.vue +286 -0
- package/components/dropdown/index.js +16 -0
- package/components/empty/empty.vue +62 -0
- package/components/empty/index.js +7 -0
- package/components/filter/filter-group.vue +44 -0
- package/components/filter/filter-item.vue +122 -0
- package/components/filter/filter-more.vue +114 -0
- package/components/filter/filter.vue +407 -0
- package/components/filter/index.js +20 -0
- package/components/filter/refresh-line.svg +1 -0
- package/components/filter/util.js +5 -0
- package/components/form/form-cell.vue +231 -0
- package/components/form/form-group.vue +147 -0
- package/components/form/form-row.vue +51 -0
- package/components/form/form.vue +256 -0
- package/components/form/index.js +13 -0
- package/components/grid/grid-card-view/grid-card-view.vue +157 -0
- package/components/grid/grid-column.vue +136 -0
- package/components/grid/grid-filter/grid-filter-group.vue +41 -0
- package/components/grid/grid-filter/grid-filter-item.vue +68 -0
- package/components/grid/grid-filter/grid-filter.vue +115 -0
- package/components/grid/grid-filter/util.js +7 -0
- package/components/grid/grid-filter-operate/grid-filter-operate-item.vue +55 -0
- package/components/grid/grid-filter-operate/grid-filter-operate.vue +46 -0
- package/components/grid/grid-sort/grid-sort-proxy.js +27 -0
- package/components/grid/grid-sort/grid-sort.vue +205 -0
- package/components/grid/grid-sort/icons/asc.png +0 -0
- package/components/grid/grid-sort/icons/desc.png +0 -0
- package/components/grid/grid-sort/index.js +7 -0
- package/components/grid/grid-table-view/grid-table-view.vue +178 -0
- package/components/grid/grid-table.vue +547 -0
- package/components/grid/grid-toolbar/grid-batch-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-batch-toolbar.vue +129 -0
- package/components/grid/grid-toolbar/grid-global-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-global-toolbar.vue +37 -0
- package/components/grid/grid-toolbar/grid-more-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-more-toolbar.vue +138 -0
- package/components/grid/grid-toolbar/grid-row-toolbar.vue +279 -0
- package/components/grid/grid-view-select.vue +78 -0
- package/components/grid/grid.vue +1102 -0
- package/components/grid/icons/more-line.svg +1 -0
- package/components/grid/icons/refresh.svg +14 -0
- package/components/grid/index.js +61 -0
- package/components/grid/util.js +31 -0
- package/components/icon/demo.css +539 -0
- package/components/icon/demo_index.html +7433 -0
- package/components/icon/icon.vue +96 -0
- package/components/icon/iconfont.css +1275 -0
- package/components/icon/iconfont.eot +0 -0
- package/components/icon/iconfont.js +1 -0
- package/components/icon/iconfont.json +2214 -0
- package/components/icon/iconfont.svg +455 -0
- package/components/icon/iconfont.ttf +0 -0
- package/components/icon/iconfont.woff +0 -0
- package/components/icon/iconfont.woff2 +0 -0
- package/components/icon/index.js +7 -0
- package/components/image/image.vue +299 -0
- package/components/image/index.js +12 -0
- package/components/image/util.js +26 -0
- package/components/index.js +153 -0
- package/components/loading/index.js +7 -0
- package/components/loading/loading.vue +130 -0
- package/components/menu/index.js +14 -0
- package/components/menu/menu-group.vue +240 -0
- package/components/menu/menu-item.vue +215 -0
- package/components/menu/menu.vue +64 -0
- package/components/message/index.js +19 -0
- package/components/message/message.js +28 -0
- package/components/message/message.less +6 -0
- package/components/message-box/index.js +10 -0
- package/components/message-box/message-box.js +140 -0
- package/components/message-box/message-box.less +5 -0
- package/components/pagination/index.js +7 -0
- package/components/pagination/pagination.vue +193 -0
- package/components/panel/index.js +7 -0
- package/components/panel/panel.vue +44 -0
- package/components/popover/index.js +7 -0
- package/components/popover/popover.vue +140 -0
- package/components/popup-select/index.js +7 -0
- package/components/popup-select/popup-select.vue +114 -0
- package/components/radio/index.js +7 -0
- package/components/radio/radio.vue +92 -0
- package/components/radio-button/index.js +7 -0
- package/components/radio-button/radio-button.vue +20 -0
- package/components/radio-group/index.js +7 -0
- package/components/radio-group/radio-group.vue +22 -0
- package/components/searchbox/index.js +7 -0
- package/components/searchbox/searchbox.vue +260 -0
- package/components/select/index.js +9 -0
- package/components/select/select-load-more.vue +53 -0
- package/components/select/select.vue +572 -0
- package/components/skeleton/index.js +14 -0
- package/components/skeleton/skeleton-rows.vue +52 -0
- package/components/skeleton/skeleton.vue +72 -0
- package/components/sortable/index.js +9 -0
- package/components/sortable/sortable-item.vue +77 -0
- package/components/sortable/sortable.vue +62 -0
- package/components/spinner/index.js +7 -0
- package/components/spinner/spinner.vue +121 -0
- package/components/spinner-range/index.js +7 -0
- package/components/spinner-range/spinner-range.vue +97 -0
- package/components/spinner-textarea/index.js +7 -0
- package/components/spinner-textarea/spinner-textarea.vue +65 -0
- package/components/switch/index.js +7 -0
- package/components/switch/switch.vue +105 -0
- package/components/tabs/index.js +10 -0
- package/components/tabs/tabs.vue +115 -0
- package/components/tag/index.js +9 -0
- package/components/tag/tag.less +30 -0
- package/components/text/index.js +7 -0
- package/components/text/text.vue +69 -0
- package/components/textarea/index.js +7 -0
- package/components/textarea/textarea.vue +229 -0
- package/components/textbox/index.js +7 -0
- package/components/textbox/textbox.vue +275 -0
- package/components/time-picker/index.js +7 -0
- package/components/time-picker/time-picker.vue +77 -0
- package/components/toolbar/index.js +14 -0
- package/components/toolbar/toolbar-item.vue +43 -0
- package/components/toolbar/toolbar.vue +81 -0
- package/components/tooltip/index.js +9 -0
- package/components/tooltip/tooltip.vue +86 -0
- package/components/transfer/index.js +7 -0
- package/components/transfer/transfer-load-more.vue +53 -0
- package/components/transfer/transfer.vue +245 -0
- package/components/tree/index.js +7 -0
- package/components/tree/tree.vue +326 -0
- package/components/tree/utils.js +122 -0
- package/components/video/index.js +7 -0
- package/components/video/video.vue +53 -0
- package/package.json +4 -1
- package/utils/date.js +55 -0
- package/utils/emitter.js +3 -0
- package/utils/json.js +19 -0
- package/utils/resize-event.js +35 -0
- package/utils/util.js +12 -0
- 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,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
|