@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,140 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { Message, MessageBox } from 'element-ui'
|
|
3
|
+
import 'element-ui/lib/theme-chalk/message.css'
|
|
4
|
+
import 'element-ui/lib/theme-chalk/message-box.css'
|
|
5
|
+
import './message-box.less'
|
|
6
|
+
|
|
7
|
+
function createElement () {
|
|
8
|
+
let instance = createElement._vueInstance_
|
|
9
|
+
if (!instance) {
|
|
10
|
+
instance = createElement._vueInstance_ = new Vue({
|
|
11
|
+
functional: true,
|
|
12
|
+
el: document.createElement('div')
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
return instance.$createElement.apply(instance, arguments)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function buttonHandler () {
|
|
19
|
+
const deferred = {}
|
|
20
|
+
let promise = new Promise(function (resolve, reject) {
|
|
21
|
+
deferred.resolve = resolve
|
|
22
|
+
deferred.reject = reject
|
|
23
|
+
})
|
|
24
|
+
let callback
|
|
25
|
+
const thenCache = {
|
|
26
|
+
onFulfill: null,
|
|
27
|
+
onReject: null
|
|
28
|
+
}
|
|
29
|
+
const then = (onFulfill, onReject) => {
|
|
30
|
+
thenCache.onFulfill = onFulfill
|
|
31
|
+
thenCache.onReject = onReject
|
|
32
|
+
callback = promise.then(onFulfill, onReject)
|
|
33
|
+
}
|
|
34
|
+
const resetThen = () => {
|
|
35
|
+
promise = new Promise(function (resolve, reject) {
|
|
36
|
+
deferred.resolve = resolve
|
|
37
|
+
deferred.reject = reject
|
|
38
|
+
})
|
|
39
|
+
callback = promise.then(thenCache.onFulfill, thenCache.onReject)
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
handler (action, instance, done) {
|
|
43
|
+
if (instance.confirmButtonLoading) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
if (action === 'confirm') {
|
|
47
|
+
deferred.resolve('ok')
|
|
48
|
+
if (callback) {
|
|
49
|
+
instance.confirmButtonLoading = true
|
|
50
|
+
callback.then(() => {
|
|
51
|
+
instance.confirmButtonLoading = false
|
|
52
|
+
resetThen()
|
|
53
|
+
done()
|
|
54
|
+
}, () => {
|
|
55
|
+
instance.confirmButtonLoading = false
|
|
56
|
+
resetThen()
|
|
57
|
+
})
|
|
58
|
+
} else {
|
|
59
|
+
instance.confirmButtonLoading = false
|
|
60
|
+
done()
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
deferred.reject(action)
|
|
64
|
+
done()
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
promise: {
|
|
68
|
+
then: then
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
Vue.component('UiMessageContent', {
|
|
74
|
+
props: {
|
|
75
|
+
content: String
|
|
76
|
+
},
|
|
77
|
+
render () {
|
|
78
|
+
if (this.content) {
|
|
79
|
+
return createElement('div', {
|
|
80
|
+
class: 'ui-message-box_content',
|
|
81
|
+
domProps: {
|
|
82
|
+
innerHTML: this.content
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
} else {
|
|
86
|
+
return null
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
|
|
91
|
+
const UiMessageBox = {
|
|
92
|
+
message: Message,
|
|
93
|
+
alert (title, content, btnText = '我知道了') {
|
|
94
|
+
const p = buttonHandler()
|
|
95
|
+
MessageBox({
|
|
96
|
+
title: title,
|
|
97
|
+
customClass: 'ui-message-box' + (!content ? ' ui-message-box_no-content' : ''),
|
|
98
|
+
showConfirmButton: true,
|
|
99
|
+
showCancelButton: false,
|
|
100
|
+
confirmButtonText: btnText,
|
|
101
|
+
confirmButtonClass: 'ui-message-box_btn-iknow',
|
|
102
|
+
closeOnClickModal: false,
|
|
103
|
+
message: createElement('UiMessageContent', {
|
|
104
|
+
props: {
|
|
105
|
+
content: content
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
beforeClose: p.handler
|
|
109
|
+
})
|
|
110
|
+
return p.promise
|
|
111
|
+
},
|
|
112
|
+
confirm (content, title = '确定', btnText, cancelBtnText = '取消', showClose = true) {
|
|
113
|
+
const p = buttonHandler()
|
|
114
|
+
let opts = {
|
|
115
|
+
title: title,
|
|
116
|
+
// type: 'error',
|
|
117
|
+
customClass: 'ui-message-box' + (!content ? ' ui-message-box_no-content' : ''),
|
|
118
|
+
showConfirmButton: true,
|
|
119
|
+
showCancelButton: true,
|
|
120
|
+
showClose,
|
|
121
|
+
cancelButtonText: cancelBtnText,
|
|
122
|
+
closeOnClickModal: false,
|
|
123
|
+
message: createElement('UiMessageContent', {
|
|
124
|
+
props: {
|
|
125
|
+
content: content
|
|
126
|
+
}
|
|
127
|
+
}),
|
|
128
|
+
beforeClose: p.handler
|
|
129
|
+
}
|
|
130
|
+
if (typeof btnText === 'string') {
|
|
131
|
+
opts.confirmButtonText = btnText
|
|
132
|
+
} else {
|
|
133
|
+
opts = Object.assign({}, opts, btnText)
|
|
134
|
+
}
|
|
135
|
+
MessageBox(opts)
|
|
136
|
+
return p.promise
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export default UiMessageBox
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-grid-pagination">
|
|
3
|
+
<template v-if="showPrevOrNext">
|
|
4
|
+
<el-pagination
|
|
5
|
+
class="ui-pagination"
|
|
6
|
+
layout="sizes"
|
|
7
|
+
:page-sizes="pageSizeList"
|
|
8
|
+
:current-page="pageIndex"
|
|
9
|
+
:total="total"
|
|
10
|
+
@current-change="handlePageIndexChange"
|
|
11
|
+
@size-change="handlePageSizeChange"
|
|
12
|
+
></el-pagination>
|
|
13
|
+
<ui-button type="link" :disabled="pageIndex <= 1" @click="handlePrev" :loading="UiGrid && UiGrid.tableLoading">上一页</ui-button>
|
|
14
|
+
<ui-button type="link" :disabled="UiGrid && UiGrid.tableData.length < UiGrid.tablePageSize" @click="handleNext" :loading="UiGrid.tableLoading">下一页</ui-button>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<el-pagination
|
|
18
|
+
class="ui-pagination"
|
|
19
|
+
:layout="allowSelectPageSize ? 'total, sizes, ->, prev, pager, next, jumper' : 'total, ->, prev, pager, next, jumper'"
|
|
20
|
+
:page-sizes="pageSizeList"
|
|
21
|
+
:page-size="20"
|
|
22
|
+
:current-page="pageIndex"
|
|
23
|
+
:total="total"
|
|
24
|
+
@current-change="handlePageIndexChange"
|
|
25
|
+
@size-change="handlePageSizeChange"
|
|
26
|
+
></el-pagination>
|
|
27
|
+
</template>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
<script>
|
|
31
|
+
import Pagination from 'element-ui/lib/pagination'
|
|
32
|
+
import 'element-ui/lib/theme-chalk/pagination.css'
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'UiPagination',
|
|
36
|
+
components: {
|
|
37
|
+
ElPagination: Pagination
|
|
38
|
+
},
|
|
39
|
+
inject: {
|
|
40
|
+
UiGrid: {
|
|
41
|
+
default: null
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
props: {
|
|
45
|
+
pageSize: {
|
|
46
|
+
type: Number,
|
|
47
|
+
default: 20
|
|
48
|
+
},
|
|
49
|
+
pageIndex: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 0
|
|
52
|
+
},
|
|
53
|
+
total: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 0
|
|
56
|
+
},
|
|
57
|
+
showPrevOrNext: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
allowSelectPageSize: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
data () {
|
|
67
|
+
return {
|
|
68
|
+
innerPageSize: this.pageSize
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
computed: {
|
|
72
|
+
pageSizeList () {
|
|
73
|
+
return [20, 50, 100, 200]
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
methods: {
|
|
77
|
+
// 每页显示行数发生变化触发
|
|
78
|
+
handlePageSizeChange (value) {
|
|
79
|
+
if (this.innerPageSize === value) {
|
|
80
|
+
return
|
|
81
|
+
}
|
|
82
|
+
this.innerPageSize = value
|
|
83
|
+
const pageIndex = Math.max(Math.min(
|
|
84
|
+
Math.ceil(this.total / value),
|
|
85
|
+
this.pageIndex
|
|
86
|
+
), 1)
|
|
87
|
+
this.$emit('page-change', {
|
|
88
|
+
pageIndex,
|
|
89
|
+
pageSize: value
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
// 分页改变时触发
|
|
93
|
+
handlePageIndexChange (value) {
|
|
94
|
+
const pageIndex = value
|
|
95
|
+
if (this.pageIndex === pageIndex) {
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
this.$emit('page-change', {
|
|
99
|
+
pageIndex,
|
|
100
|
+
pageSize: this.innerPageSize
|
|
101
|
+
})
|
|
102
|
+
},
|
|
103
|
+
// 上一页
|
|
104
|
+
handlePrev() {
|
|
105
|
+
const xTable = this.UiGrid.$refs.table.$refs.table
|
|
106
|
+
if (this.pageIndex <= 1) {
|
|
107
|
+
this.$message.error('当前已经是最一页')
|
|
108
|
+
return
|
|
109
|
+
}
|
|
110
|
+
const pageIndex = this.pageIndex - 1
|
|
111
|
+
this.$emit('page-change', {
|
|
112
|
+
pageIndex,
|
|
113
|
+
pageSize: this.pageSize
|
|
114
|
+
})
|
|
115
|
+
xTable.scrollTo(0, 0)
|
|
116
|
+
},
|
|
117
|
+
// 下一页
|
|
118
|
+
handleNext() {
|
|
119
|
+
const xTable = this.UiGrid.$refs.table.$refs.table
|
|
120
|
+
const { tableData, tablePageSize } = this.UiGrid
|
|
121
|
+
if (tableData.length < tablePageSize) {
|
|
122
|
+
this.$message.error('当前已经是最后一页了')
|
|
123
|
+
return
|
|
124
|
+
}
|
|
125
|
+
const pageIndex = this.pageIndex + 1
|
|
126
|
+
this.$emit('page-change', {
|
|
127
|
+
pageIndex,
|
|
128
|
+
pageSize: this.pageSize
|
|
129
|
+
})
|
|
130
|
+
xTable.scrollTo(0, 0)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
</script>
|
|
135
|
+
<style lang="less">
|
|
136
|
+
.ui-grid-pagination {
|
|
137
|
+
width: 100%;
|
|
138
|
+
display: flex;
|
|
139
|
+
align-items: center;
|
|
140
|
+
padding: 5px;
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
}
|
|
143
|
+
.ui-pagination.el-pagination {
|
|
144
|
+
flex-grow: 1;
|
|
145
|
+
.btn-prev,
|
|
146
|
+
.btn-next,
|
|
147
|
+
.number,
|
|
148
|
+
.more {
|
|
149
|
+
min-width: 14px;
|
|
150
|
+
height: 28px;
|
|
151
|
+
line-height: 28px;
|
|
152
|
+
border: 1px solid #d9d9d9;
|
|
153
|
+
box-sizing: content-box;
|
|
154
|
+
padding: 0 8px;
|
|
155
|
+
border-radius: 3px;
|
|
156
|
+
margin-left: 6px;
|
|
157
|
+
font-weight: normal;
|
|
158
|
+
&:hover {
|
|
159
|
+
border-color: #172b4d;
|
|
160
|
+
}
|
|
161
|
+
&.active {
|
|
162
|
+
border-color: #172b4d;
|
|
163
|
+
color: #fff;
|
|
164
|
+
}
|
|
165
|
+
&[disabled] {
|
|
166
|
+
border-color: #d9d9d9;
|
|
167
|
+
color: #999;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.btn-prev,
|
|
172
|
+
.btn-next{
|
|
173
|
+
border-color: transparent!important;
|
|
174
|
+
}
|
|
175
|
+
.more {
|
|
176
|
+
color: #aaa;
|
|
177
|
+
font-size: 16px;
|
|
178
|
+
margin-left: 6px;
|
|
179
|
+
&:hover {
|
|
180
|
+
color: #172b4d;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
.el-pagination__total{
|
|
184
|
+
}
|
|
185
|
+
.el-pagination__sizes,
|
|
186
|
+
.el-pagination__jump {
|
|
187
|
+
.el-input__inner {
|
|
188
|
+
font-size: 14px;
|
|
189
|
+
box-sizing: border-box;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-panel">
|
|
3
|
+
<div class="ui-panel__head">
|
|
4
|
+
<strong class="ui-panel__title">{{ title }}</strong>
|
|
5
|
+
<div class="ui-panel__head-right">
|
|
6
|
+
<slot name="head-right"></slot>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="ui-panel__body">
|
|
10
|
+
<slot></slot>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'UiPanel',
|
|
17
|
+
props: {
|
|
18
|
+
title: {
|
|
19
|
+
type: String
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<style lang="less">
|
|
25
|
+
.ui-panel {
|
|
26
|
+
border: 1px solid #DFE1E6;
|
|
27
|
+
border-radius: 4px;
|
|
28
|
+
}
|
|
29
|
+
.ui-panel__title{
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
}
|
|
33
|
+
.ui-panel__head{
|
|
34
|
+
padding: 12px;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: row;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
align-items: center;
|
|
39
|
+
border-bottom: 1px solid #DFE1E6;
|
|
40
|
+
}
|
|
41
|
+
.ui-panel__body {
|
|
42
|
+
padding: 12px;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-popover
|
|
3
|
+
ref="popover"
|
|
4
|
+
v-model="innerVisible"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
:placement="placement"
|
|
7
|
+
:width="width"
|
|
8
|
+
:trigger="trigger"
|
|
9
|
+
:popper-class="popperClass"
|
|
10
|
+
:visible-arrow="visibleArrow"
|
|
11
|
+
@show="handleShow"
|
|
12
|
+
@hide="handleHide"
|
|
13
|
+
@after-enter="handleAfterShow"
|
|
14
|
+
@after-leave="handleAfterHide"
|
|
15
|
+
>
|
|
16
|
+
<slot></slot>
|
|
17
|
+
<template slot="reference">
|
|
18
|
+
<slot name="reference"></slot>
|
|
19
|
+
</template>
|
|
20
|
+
</el-popover>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
import Popover from 'element-ui/lib/popover'
|
|
24
|
+
import 'element-ui/lib/theme-chalk/popover.css'
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: 'UiPopover',
|
|
28
|
+
components: {
|
|
29
|
+
ElPopover: Popover
|
|
30
|
+
},
|
|
31
|
+
model: {
|
|
32
|
+
prop: 'visible',
|
|
33
|
+
event: 'input'
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
visible: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
visibleArrow: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true
|
|
43
|
+
},
|
|
44
|
+
disabled: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
width: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: 'auto'
|
|
51
|
+
},
|
|
52
|
+
placement: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: 'bottom'
|
|
55
|
+
},
|
|
56
|
+
effect: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: 'light' // light | dark
|
|
59
|
+
},
|
|
60
|
+
trigger: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'hover'
|
|
63
|
+
},
|
|
64
|
+
popoverClass: {
|
|
65
|
+
type: String
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
computed: {
|
|
69
|
+
popperClass () {
|
|
70
|
+
const cls = ['ui-popover']
|
|
71
|
+
if (this.effect) {
|
|
72
|
+
cls.push('ui-popper--' + this.effect)
|
|
73
|
+
}
|
|
74
|
+
if (this.popoverClass) {
|
|
75
|
+
cls.push(this.popoverClass)
|
|
76
|
+
}
|
|
77
|
+
return cls.join(' ')
|
|
78
|
+
},
|
|
79
|
+
innerVisible: {
|
|
80
|
+
get () {
|
|
81
|
+
return this.visible
|
|
82
|
+
},
|
|
83
|
+
set (val) {
|
|
84
|
+
this.$emit('input', val)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
methods: {
|
|
89
|
+
show () {
|
|
90
|
+
this.$refs.popover && this.$refs.popover.doShow()
|
|
91
|
+
this.updatePopper()
|
|
92
|
+
},
|
|
93
|
+
hide () {
|
|
94
|
+
this.$refs.popover && this.$refs.popover.doClose()
|
|
95
|
+
},
|
|
96
|
+
updatePopper () {
|
|
97
|
+
this.$refs.popover && this.$refs.popover.updatePopper()
|
|
98
|
+
},
|
|
99
|
+
handleShow () {
|
|
100
|
+
this.$emit('show')
|
|
101
|
+
},
|
|
102
|
+
handleHide () {
|
|
103
|
+
this.$emit('hide')
|
|
104
|
+
},
|
|
105
|
+
handleAfterShow () {
|
|
106
|
+
this.$emit('after-show')
|
|
107
|
+
},
|
|
108
|
+
handleAfterHide () {
|
|
109
|
+
this.$emit('after-hide')
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
</script>
|
|
114
|
+
<style lang="less">
|
|
115
|
+
.ui-popover.el-popover{
|
|
116
|
+
padding: 0;
|
|
117
|
+
min-width: auto;
|
|
118
|
+
font-size: 14px;
|
|
119
|
+
&.ui-popper--drak{
|
|
120
|
+
background-color: #18192f;
|
|
121
|
+
color: #ddd;
|
|
122
|
+
&[x-placement=bottom] {
|
|
123
|
+
.popper__arrow{
|
|
124
|
+
&:after{
|
|
125
|
+
display: none;
|
|
126
|
+
}
|
|
127
|
+
border-bottom-color: #18192f;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
&[x-placement=top] {
|
|
131
|
+
.popper__arrow{
|
|
132
|
+
&:after{
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
border-top-color: #18192f;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-popup-select">
|
|
3
|
+
<div class="ui-popup-select__handle">
|
|
4
|
+
<ui-select
|
|
5
|
+
ref="select"
|
|
6
|
+
v-model="innerValue"
|
|
7
|
+
:placeholder="placeholder"
|
|
8
|
+
:query-method="queryMethod"
|
|
9
|
+
:text-field="textField"
|
|
10
|
+
:page-size="pageSize"
|
|
11
|
+
:value-field="valueField"
|
|
12
|
+
:filterable="filterable"
|
|
13
|
+
:lazy="lazyLoad"
|
|
14
|
+
:clearable="clearable"
|
|
15
|
+
:temp-items="tempItems"
|
|
16
|
+
@change="handleChange"
|
|
17
|
+
@visible-change="handleVisibleChange"
|
|
18
|
+
>
|
|
19
|
+
<template slot="item" slot-scope="scope">
|
|
20
|
+
<slot name="item" v-bind="scope"></slot>
|
|
21
|
+
</template>
|
|
22
|
+
</ui-select>
|
|
23
|
+
</div>
|
|
24
|
+
<div class="ui-popup-select__dialog">
|
|
25
|
+
<ui-dialog
|
|
26
|
+
:title="popupTitle"
|
|
27
|
+
:size="popupSize"
|
|
28
|
+
v-model="showPopupDialog"
|
|
29
|
+
>
|
|
30
|
+
<slot name="popup"></slot>
|
|
31
|
+
</ui-dialog>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
35
|
+
<script>
|
|
36
|
+
export default {
|
|
37
|
+
name: 'UiPopupSelect',
|
|
38
|
+
props: {
|
|
39
|
+
value: {
|
|
40
|
+
type: String
|
|
41
|
+
},
|
|
42
|
+
filterable: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
queryMethod: {
|
|
47
|
+
type: Function
|
|
48
|
+
},
|
|
49
|
+
placeholder: {
|
|
50
|
+
type: String
|
|
51
|
+
},
|
|
52
|
+
pageSize: {
|
|
53
|
+
type: Number
|
|
54
|
+
},
|
|
55
|
+
textField: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: 'text'
|
|
58
|
+
},
|
|
59
|
+
valueField: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'value'
|
|
62
|
+
},
|
|
63
|
+
lazyLoad: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: true
|
|
66
|
+
},
|
|
67
|
+
popupTitle: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: '标题'
|
|
70
|
+
},
|
|
71
|
+
popupSize: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'large'
|
|
74
|
+
},
|
|
75
|
+
clearable: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
tempItems: {
|
|
80
|
+
type: Array
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
data () {
|
|
84
|
+
return {
|
|
85
|
+
showPopupDialog: false
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
innerValue: {
|
|
90
|
+
get () {
|
|
91
|
+
return this.value
|
|
92
|
+
},
|
|
93
|
+
set (value) {
|
|
94
|
+
this.$emit('input', value)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
methods: {
|
|
99
|
+
handleChange (evt) {
|
|
100
|
+
this.$emit('change', evt)
|
|
101
|
+
},
|
|
102
|
+
handleVisibleChange () {
|
|
103
|
+
// window.clearTimeout(this._timer)
|
|
104
|
+
// this._timer = window.setTimeout(() => {
|
|
105
|
+
// // 通讯台选择设备不知道为什么会错位,先临时这么处理一下
|
|
106
|
+
// this.$refs.select.doLayout()
|
|
107
|
+
// }, 50)
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
beforeDestroy () {
|
|
111
|
+
// window.clearTimeout(this._timer)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
</script>
|