@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,71 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<transition>
|
|
3
|
+
<div class="ac-loading" v-if="visible" :style="style">
|
|
4
|
+
<ui-icon class="ac-loading__icon" name="loading" :size="40" color="#28a4e6"></ui-icon>
|
|
5
|
+
<div v-if="text" class="ac-loading__text">{{text}}</div>
|
|
6
|
+
</div>
|
|
7
|
+
</transition>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'AcLoading',
|
|
12
|
+
props: {
|
|
13
|
+
visible: {
|
|
14
|
+
type: Boolean
|
|
15
|
+
},
|
|
16
|
+
opacity: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 1
|
|
19
|
+
},
|
|
20
|
+
text: {
|
|
21
|
+
type: String
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
computed: {
|
|
25
|
+
style () {
|
|
26
|
+
const sy = {}
|
|
27
|
+
if (this.opacity) {
|
|
28
|
+
sy['background-color'] = `rgba(255, 255, 255, ${this.opacity})`
|
|
29
|
+
}
|
|
30
|
+
return sy
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
<style lang="less">
|
|
36
|
+
.ac-loading{
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
top: 1px;
|
|
41
|
+
bottom: 0;
|
|
42
|
+
background-color: #fff;
|
|
43
|
+
z-index: 100000;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
align-items: center;
|
|
48
|
+
&.v-enter{
|
|
49
|
+
opacity: 0;
|
|
50
|
+
}
|
|
51
|
+
&.v-enter-active{
|
|
52
|
+
transition: all .3s;
|
|
53
|
+
}
|
|
54
|
+
&.v-enter-active{
|
|
55
|
+
opacity: 1;
|
|
56
|
+
}
|
|
57
|
+
&.v-leave{
|
|
58
|
+
opacity: 1;
|
|
59
|
+
}
|
|
60
|
+
&.v-leave-active{
|
|
61
|
+
transition: all .3s;
|
|
62
|
+
}
|
|
63
|
+
&.v-leave-active{
|
|
64
|
+
opacity: 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
.ac-loading__text{
|
|
68
|
+
display: block;
|
|
69
|
+
color: #999;
|
|
70
|
+
}
|
|
71
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'AcTips',
|
|
4
|
+
functional: true,
|
|
5
|
+
props: {
|
|
6
|
+
showIcon: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: true
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'info',
|
|
13
|
+
validator (value) {
|
|
14
|
+
return ['info', 'warning'].includes(value)
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
bgColor: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
inline: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: false
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
render (h, context) {
|
|
30
|
+
const { props, data } = context
|
|
31
|
+
return h('div', {
|
|
32
|
+
class: ['ac-tips', 'ac-tips--' + props.type, { 'is-bgcolor': props.bgColor, 'is-inline': props.inline }, data.staticClass]
|
|
33
|
+
}, [
|
|
34
|
+
h('span', {
|
|
35
|
+
class: 'ac-tips__title'
|
|
36
|
+
}, [
|
|
37
|
+
props.showIcon ? h('ui-icon', {
|
|
38
|
+
props: {
|
|
39
|
+
name: props.type === 'warning' ? 'alert-fill1' : 'error-warning-line'
|
|
40
|
+
}
|
|
41
|
+
}) : null,
|
|
42
|
+
props.title ? h('span', {
|
|
43
|
+
class: 'ac-tips__title-text'
|
|
44
|
+
}, [props.title]) : null
|
|
45
|
+
]),
|
|
46
|
+
h('div', {
|
|
47
|
+
class: 'ac-tips__main'
|
|
48
|
+
}, [context.slots().default])
|
|
49
|
+
])
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
</script>
|
|
53
|
+
<style lang="less">
|
|
54
|
+
.ac-tips{
|
|
55
|
+
line-height: 24px;
|
|
56
|
+
padding: 4px 0;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
.ui-icon{
|
|
60
|
+
margin-right: 3px;
|
|
61
|
+
vertical-align: top;
|
|
62
|
+
display: inline-block;
|
|
63
|
+
}
|
|
64
|
+
&.is-bgcolor{
|
|
65
|
+
background-color: #f3f3f3;
|
|
66
|
+
border-radius: 3px;
|
|
67
|
+
padding: 6px 12px;
|
|
68
|
+
}
|
|
69
|
+
&.is-inline{
|
|
70
|
+
display: inline-block;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
.ac-tips__title-text {
|
|
74
|
+
margin-right: 6px;
|
|
75
|
+
}
|
|
76
|
+
.ac-tips--warning {
|
|
77
|
+
color: #E6A23C;
|
|
78
|
+
}
|
|
79
|
+
.ac-tips--tips {
|
|
80
|
+
color: #999;
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import UiTooltip from '../../components/tooltip'
|
|
3
|
+
|
|
4
|
+
const TooltipConstructor = Vue.extend(UiTooltip)
|
|
5
|
+
|
|
6
|
+
let tooltip = null
|
|
7
|
+
|
|
8
|
+
export function getTooltip () {
|
|
9
|
+
if (!tooltip) {
|
|
10
|
+
const $mound = document.createElement('div')
|
|
11
|
+
tooltip = new TooltipConstructor({
|
|
12
|
+
el: $mound
|
|
13
|
+
})
|
|
14
|
+
tooltip.manual = true
|
|
15
|
+
document.body.appendChild($mound)
|
|
16
|
+
}
|
|
17
|
+
return tooltip
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { getTooltip } from './popper'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
name: 'BiTooltip',
|
|
6
|
+
functional: true,
|
|
7
|
+
props: {
|
|
8
|
+
text: {
|
|
9
|
+
type: String
|
|
10
|
+
},
|
|
11
|
+
html: {
|
|
12
|
+
type: String
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
render (h, context) {
|
|
16
|
+
if (!context.props.text && !context.props.html) {
|
|
17
|
+
return context.scopedSlots.default ? context.scopedSlots.default() : null
|
|
18
|
+
}
|
|
19
|
+
return h('span', {
|
|
20
|
+
class: ['bi-tooltip'].concat(context.data.class || '', context.data.staticClass || ''),
|
|
21
|
+
attrs: context.data.attrs,
|
|
22
|
+
on: {
|
|
23
|
+
...context.listeners,
|
|
24
|
+
mouseenter (e) {
|
|
25
|
+
const tooltip = getTooltip()
|
|
26
|
+
tooltip.visible = true
|
|
27
|
+
tooltip.content = context.props.text
|
|
28
|
+
tooltip.html = context.props.html
|
|
29
|
+
tooltip.setReferenceElm(e.target)
|
|
30
|
+
},
|
|
31
|
+
mouseleave () {
|
|
32
|
+
const tooltip = getTooltip()
|
|
33
|
+
tooltip.visible = false
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}, [
|
|
37
|
+
context.children
|
|
38
|
+
])
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
<style lang="less">
|
|
43
|
+
body {
|
|
44
|
+
.el-tooltip__popper{
|
|
45
|
+
white-space: pre-wrap;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.bi-tooltip{
|
|
49
|
+
display: inline-block;
|
|
50
|
+
max-width: 100%;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
vertical-align: middle;
|
|
54
|
+
}
|
|
55
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-select
|
|
3
|
+
type="date"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
:placeholder="placeholder"
|
|
6
|
+
>
|
|
7
|
+
<ui-select-item label="为真" :value="true"></ui-select-item>
|
|
8
|
+
<ui-select-item label="为假" :value="false"></ui-select-item>
|
|
9
|
+
</ui-select>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'UiAdvancedFilterconditionItemDate',
|
|
14
|
+
props: {
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: String
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
innerValue: {
|
|
24
|
+
get () {
|
|
25
|
+
return this.value
|
|
26
|
+
},
|
|
27
|
+
set (val) {
|
|
28
|
+
this.$emit('input', val)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-date-picker
|
|
3
|
+
type="daterange"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
start-placeholder="起始日期"
|
|
6
|
+
end-placeholder="截止日期"
|
|
7
|
+
format="yyyy-MM-dd"
|
|
8
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
9
|
+
></ui-date-picker>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'UiAdvancedFilterconditionItemDateRange',
|
|
14
|
+
props: {
|
|
15
|
+
value: {
|
|
16
|
+
type: Array
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
computed: {
|
|
20
|
+
innerValue: {
|
|
21
|
+
get () {
|
|
22
|
+
return this.value
|
|
23
|
+
},
|
|
24
|
+
set (val) {
|
|
25
|
+
this.$emit('input', val)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-date-picker
|
|
3
|
+
type="date"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
:placeholder="placeholder"
|
|
6
|
+
format="yyyy-MM-dd"
|
|
7
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
8
|
+
></ui-date-picker>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'UiAdvancedFilterconditionItemDate',
|
|
13
|
+
props: {
|
|
14
|
+
placeholder: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '选择日期'
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: Array
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
innerValue: {
|
|
24
|
+
get () {
|
|
25
|
+
if (Array.isArray(this.value)) {
|
|
26
|
+
return this.value[0]
|
|
27
|
+
}
|
|
28
|
+
return this.value
|
|
29
|
+
},
|
|
30
|
+
set (val) {
|
|
31
|
+
if (val === null || val === undefined) {
|
|
32
|
+
val = []
|
|
33
|
+
} else {
|
|
34
|
+
val = [val]
|
|
35
|
+
}
|
|
36
|
+
this.$emit('input', val)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-date-picker
|
|
3
|
+
type="datetimerange"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
start-placeholder="起始日期"
|
|
6
|
+
end-placeholder="截止日期"
|
|
7
|
+
format="yyyy-MM-dd HH:mm"
|
|
8
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
9
|
+
></ui-date-picker>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'UiAdvancedFilterconditionItemDatetimeRange',
|
|
14
|
+
props: {
|
|
15
|
+
placeholder: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '选择时间'
|
|
18
|
+
},
|
|
19
|
+
value: {
|
|
20
|
+
type: Array
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
computed: {
|
|
24
|
+
innerValue: {
|
|
25
|
+
get () {
|
|
26
|
+
return this.value
|
|
27
|
+
},
|
|
28
|
+
set (val) {
|
|
29
|
+
this.$emit('input', val)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-date-picker
|
|
3
|
+
type="datetime"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
:placeholder="placeholder"
|
|
6
|
+
format="yyyy-MM-dd HH:mm"
|
|
7
|
+
value-format="yyyy-MM-dd HH:mm:ss"
|
|
8
|
+
></ui-date-picker>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'UiAdvancedFilterconditionItemDatetime',
|
|
13
|
+
props: {
|
|
14
|
+
placeholder: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '选择时间'
|
|
17
|
+
},
|
|
18
|
+
value: {
|
|
19
|
+
type: Array
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
innerValue: {
|
|
24
|
+
get () {
|
|
25
|
+
if (Array.isArray(this.value)) {
|
|
26
|
+
return this.value[0]
|
|
27
|
+
}
|
|
28
|
+
return this.value
|
|
29
|
+
},
|
|
30
|
+
set (val) {
|
|
31
|
+
if (val === null || val === undefined) {
|
|
32
|
+
val = []
|
|
33
|
+
} else {
|
|
34
|
+
val = [val]
|
|
35
|
+
}
|
|
36
|
+
this.$emit('input', val)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-advanced-filter-conditon-item-number-range">
|
|
3
|
+
<div class="ui-advanced-filter-conditon-item-number-range__item">
|
|
4
|
+
<ui-spinner
|
|
5
|
+
v-model="startValue"
|
|
6
|
+
placeholder="起始值"
|
|
7
|
+
style="width: 100%"
|
|
8
|
+
></ui-spinner>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="ui-advanced-filter-conditon-item-number-range__line">~</div>
|
|
11
|
+
<div class="ui-advanced-filter-conditon-item-number-range__item">
|
|
12
|
+
<ui-spinner
|
|
13
|
+
v-model="endValue"
|
|
14
|
+
placeholder="截止值"
|
|
15
|
+
style="width: 100%"
|
|
16
|
+
></ui-spinner>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script>
|
|
21
|
+
export default {
|
|
22
|
+
name: 'UiAdvancedFilterConditionItemNumberRange',
|
|
23
|
+
props: {
|
|
24
|
+
value: {
|
|
25
|
+
type: Array
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
innerValue: {
|
|
30
|
+
get () {
|
|
31
|
+
if (!Array.isArray(this.value)) {
|
|
32
|
+
return []
|
|
33
|
+
}
|
|
34
|
+
return this.value
|
|
35
|
+
},
|
|
36
|
+
set (val) {
|
|
37
|
+
this.$emit('input', val)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
startValue: {
|
|
41
|
+
get () {
|
|
42
|
+
return this.innerValue[0]
|
|
43
|
+
},
|
|
44
|
+
set (val) {
|
|
45
|
+
this.innerValue = [val, this.endValue]
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
endValue: {
|
|
49
|
+
get () {
|
|
50
|
+
return this.innerValue[1]
|
|
51
|
+
},
|
|
52
|
+
set (val) {
|
|
53
|
+
this.innerValue = [this.startValue, val]
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
<style lang="less">
|
|
60
|
+
.ui-advanced-filter-conditon-item-number-range{
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: row;
|
|
63
|
+
}
|
|
64
|
+
.ui-advanced-filter-conditon-item-number-range__line{
|
|
65
|
+
margin: 0 6px;
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-spinner
|
|
3
|
+
v-model="innerValue"
|
|
4
|
+
placeholder="请输入"
|
|
5
|
+
style="width: 100%"
|
|
6
|
+
></ui-spinner>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'UiAdvancedFilterconditionItemNumber',
|
|
11
|
+
props: {
|
|
12
|
+
value: {
|
|
13
|
+
type: Array
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
innerValue: {
|
|
18
|
+
get () {
|
|
19
|
+
if (Array.isArray(this.value)) {
|
|
20
|
+
return this.value[0]
|
|
21
|
+
}
|
|
22
|
+
return this.value
|
|
23
|
+
},
|
|
24
|
+
set (val) {
|
|
25
|
+
if (val === null || val === undefined) {
|
|
26
|
+
val = []
|
|
27
|
+
} else {
|
|
28
|
+
val = [val]
|
|
29
|
+
}
|
|
30
|
+
this.$emit('input', val)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ui-textbox
|
|
3
|
+
v-model="innerValue"
|
|
4
|
+
placeholder="多个条件使用;隔开"
|
|
5
|
+
@blur="handleBlur"
|
|
6
|
+
:maxlength="null"
|
|
7
|
+
></ui-textbox>
|
|
8
|
+
</template>
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'UiAdvancedFilterconditionItemString',
|
|
12
|
+
props: {
|
|
13
|
+
placeholder: {
|
|
14
|
+
type: String
|
|
15
|
+
},
|
|
16
|
+
value: {
|
|
17
|
+
type: Array
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
computed: {
|
|
21
|
+
innerValue: {
|
|
22
|
+
get () {
|
|
23
|
+
if (Array.isArray(this.value)) {
|
|
24
|
+
return this.value.join(';')
|
|
25
|
+
}
|
|
26
|
+
return this.value
|
|
27
|
+
},
|
|
28
|
+
set (val) {
|
|
29
|
+
val = val.split(/[;;]/)
|
|
30
|
+
this.$emit('input', val)
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
handleBlur() {
|
|
36
|
+
let innerValue = (this.innerValue || '').split(/[;;]/).filter(v => !!v)
|
|
37
|
+
this.$emit('input', innerValue)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component :is="component" v-model="innerValues"></component>
|
|
3
|
+
</template>
|
|
4
|
+
<script>
|
|
5
|
+
export default {
|
|
6
|
+
name: 'UiAdvancedFilterConditionItemValue',
|
|
7
|
+
inject: ['UiAdvancedFilter'],
|
|
8
|
+
provide () {
|
|
9
|
+
return {
|
|
10
|
+
UiAdvancedFilterConditionItemValue: this
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
component: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
value: {
|
|
22
|
+
type: Array
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
innerValues: {
|
|
27
|
+
get () {
|
|
28
|
+
return this.value
|
|
29
|
+
},
|
|
30
|
+
set (val) {
|
|
31
|
+
this.$emit('input', val)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
created () {
|
|
36
|
+
this.UiAdvancedFilter.$on('collect-condition-text-data', this.handleCollectConditionTextData)
|
|
37
|
+
},
|
|
38
|
+
methods: {
|
|
39
|
+
handleCollectConditionTextData (evt) {
|
|
40
|
+
if (!this.name) {
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
if (!evt || !evt.conditions || !evt.conditions.length) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
const condition = evt.conditions.find(v => v.name === this.name)
|
|
47
|
+
let isSet = false
|
|
48
|
+
this.$emit('ui-advanced-filter-condition-item-collect_text', {
|
|
49
|
+
getValue () {
|
|
50
|
+
return condition.values
|
|
51
|
+
},
|
|
52
|
+
/**
|
|
53
|
+
* 设置值对应的textMap
|
|
54
|
+
* {
|
|
55
|
+
* [value]: text
|
|
56
|
+
* ...
|
|
57
|
+
* }
|
|
58
|
+
*/
|
|
59
|
+
setTextMap (textMap) {
|
|
60
|
+
// 设置了就不在继续设置,防止类型用户选择组件里面包select基础组件,导致重复触发问题
|
|
61
|
+
if (isSet) {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
condition.valueMap = textMap
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
beforeDestroy () {
|
|
70
|
+
this.UiAdvancedFilter.$off('collect-condition-text-data', this.handleCollectConditionTextData)
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
</script>
|