@idooel/components 0.0.1-beta.39 → 0.0.1-beta.40
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/dist/@idooel/components.esm.js +4667 -4273
- package/dist/@idooel/components.umd.js +4609 -4191
- package/jsconfig.json +8 -0
- package/package.json +3 -3
- package/packages/alert/index.js +4 -4
- package/packages/alert/src/index.vue +45 -45
- package/packages/batch-export/index.js +4 -4
- package/packages/batch-export/src/index.vue +104 -108
- package/packages/business-components/modal-fsm/index.js +5 -0
- package/packages/business-components/modal-fsm/src/index.vue +164 -0
- package/packages/{composite-components → business-components}/modal-import/index.js +4 -4
- package/packages/{composite-components → business-components}/modal-import/src/index.vue +139 -145
- package/packages/{composite-components → business-components}/modal-timeline/index.js +4 -4
- package/packages/{composite-components → business-components}/modal-timeline/src/index.vue +77 -76
- package/packages/button/index.js +4 -4
- package/packages/button/src/index.vue +54 -54
- package/packages/checkbox/index.js +4 -4
- package/packages/checkbox/src/index.vue +52 -52
- package/packages/composite-components/button-group/index.js +4 -4
- package/packages/composite-components/button-group/src/index.vue +88 -53
- package/packages/composite-components/{attachment → form-attachment}/src/index.vue +14 -14
- package/packages/composite-components/modal-confirm/index.js +5 -0
- package/packages/composite-components/modal-confirm/src/index.vue +69 -0
- package/packages/composite-components/modal-form/index.js +4 -4
- package/packages/composite-components/modal-form/src/index.vue +202 -202
- package/packages/{img-crop → composite-components/modal-img-crop}/index.js +4 -4
- package/packages/{img-crop → composite-components/modal-img-crop}/src/index.vue +284 -290
- package/packages/composite-components/modal-table/index.js +0 -0
- package/packages/composite-components/modal-tree/index.js +4 -4
- package/packages/composite-components/modal-tree/src/index.vue +75 -75
- package/packages/composite-components/search-area/index.js +4 -4
- package/packages/composite-components/search-area/src/index.vue +218 -229
- package/packages/composite-components/search-area/src/label.vue +35 -35
- package/packages/composite-components/table-transfer/index.js +0 -0
- package/packages/date/index.js +4 -4
- package/packages/date/src/index.vue +95 -39
- package/packages/date-range/index.js +4 -4
- package/packages/date-range/src/index.vue +47 -47
- package/packages/form/index.js +4 -4
- package/packages/form/src/index.vue +236 -240
- package/packages/icon/index.js +4 -4
- package/packages/icon/src/index.vue +31 -31
- package/packages/index.js +132 -99
- package/packages/input/index.js +4 -4
- package/packages/input/src/index.vue +35 -35
- package/packages/input-number/index.js +4 -4
- package/packages/input-number/src/index.vue +23 -23
- package/packages/modal/index.js +4 -4
- package/packages/modal/src/index.vue +184 -162
- package/packages/{form-group-model → models/form-group-model}/index.js +4 -4
- package/packages/{form-group-model → models/form-group-model}/src/index.vue +273 -279
- package/packages/{form-model → models/form-model}/index.js +4 -4
- package/packages/{form-model → models/form-model}/src/index.vue +201 -189
- package/packages/{step-model → models/step-model}/index.js +4 -4
- package/packages/{step-model → models/step-model}/src/index.vue +215 -219
- package/packages/models/tree-table-model/README.md +0 -0
- package/packages/{tree-table-model → models/tree-table-model}/index.js +4 -4
- package/packages/{tree-table-model → models/tree-table-model}/src/index.vue +494 -493
- package/packages/radio/index.js +4 -4
- package/packages/radio/src/index.vue +56 -56
- package/packages/select/index.js +4 -4
- package/packages/select/src/index.vue +92 -92
- package/packages/select-entity/index.js +4 -4
- package/packages/select-entity/src/index.vue +113 -113
- package/packages/table/index.js +4 -4
- package/packages/table/src/action.vue +164 -134
- package/packages/table/src/index.vue +257 -257
- package/packages/tabs/index.js +4 -4
- package/packages/tabs/src/index.vue +55 -55
- package/packages/text/index.js +4 -4
- package/packages/text/src/index.vue +47 -47
- package/packages/text-editor/index.js +4 -4
- package/packages/text-editor/src/index.vue +72 -72
- package/packages/textarea/index.js +4 -4
- package/packages/textarea/src/index.vue +57 -57
- package/packages/theme/form.scss +21 -21
- package/packages/theme/index.scss +42 -42
- package/packages/theme/overrid.scss +7 -7
- package/packages/theme/styleClass.scss +2 -2
- package/packages/theme/variables.scss +55 -55
- package/packages/timeline/index.js +4 -4
- package/packages/timeline/src/index.vue +253 -234
- package/packages/tpl/index.js +4 -4
- package/packages/tpl/src/index.vue +55 -55
- package/packages/tree/index.js +4 -4
- package/packages/tree/src/TreeNode.vue +29 -29
- package/packages/tree/src/index.vue +101 -101
- package/packages/upload/index.js +4 -4
- package/packages/upload/src/index.vue +440 -442
- package/packages/utils/index.js +48 -47
- package/scripts/rollup.config.js +42 -40
- package/scripts/rollup.esm.config.js +11 -11
- package/scripts/rollup.umd.config.js +14 -14
- /package/packages/composite-components/{attachment → form-attachment}/index.js +0 -0
- /package/packages/{tree-table-model/README.md → composite-components/modal-table-transfer/index.js} +0 -0
|
@@ -1,146 +1,140 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ele-modal :value="innerValue" :buttonGroupMeta="buttonGroupMeta" @cancel="onCancel" @handleClose="handleClose" title="导入">
|
|
3
|
-
<div class="ele-modal-import__upload" v-if="isFileEmpty">
|
|
4
|
-
<div class="import-download__link" @click="handleClickDownloadTpl">点击此链接下载导入模板</div>
|
|
5
|
-
<ele-upload v-model="file" @on-success="uploadFileSuccess"></ele-upload>
|
|
6
|
-
</div>
|
|
7
|
-
<div v-else class="ele-modal-import__hint">
|
|
8
|
-
<div class="import-hint__content">
|
|
9
|
-
<div class="import-hint__left">
|
|
10
|
-
<ele-icon></ele-icon>
|
|
11
|
-
</div>
|
|
12
|
-
<div class="import-hint__right">
|
|
13
|
-
<div class="hint-right__title" @click="handleClickJump">文件上传成功,任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>
|
|
14
|
-
<div class="hint-right__sub-title">批处理任务的准备工作会在后台运行</div>
|
|
15
|
-
</div>
|
|
16
|
-
</div>
|
|
17
|
-
<div class="import-footer__hint--text">
|
|
18
|
-
您可以请点击上方按钮查看任务进度或关闭弹框
|
|
19
|
-
</div>
|
|
20
|
-
</div>
|
|
21
|
-
</ele-modal>
|
|
22
|
-
</template>
|
|
23
|
-
|
|
24
|
-
<script>
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
this
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
this.emitEvent({ action: '
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
this.
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
.import-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.import-footer__hint--text {
|
|
141
|
-
font-size: 14px;
|
|
142
|
-
color: var(--idooel-link-06);
|
|
143
|
-
line-height: 22px;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<ele-modal :value="innerValue" :buttonGroupMeta="buttonGroupMeta" @cancel="onCancel" @handleClose="handleClose" title="导入">
|
|
3
|
+
<div class="ele-modal-import__upload" v-if="isFileEmpty">
|
|
4
|
+
<div class="import-download__link" @click="handleClickDownloadTpl">点击此链接下载导入模板</div>
|
|
5
|
+
<ele-upload v-model="file" @on-success="uploadFileSuccess"></ele-upload>
|
|
6
|
+
</div>
|
|
7
|
+
<div v-else class="ele-modal-import__hint">
|
|
8
|
+
<div class="import-hint__content">
|
|
9
|
+
<div class="import-hint__left">
|
|
10
|
+
<ele-icon></ele-icon>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="import-hint__right">
|
|
13
|
+
<div class="hint-right__title" @click="handleClickJump">文件上传成功,任务处理中..... 请点击此按钮跳转到“批处理管理”菜单查看任务进度</div>
|
|
14
|
+
<div class="hint-right__sub-title">批处理任务的准备工作会在后台运行</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="import-footer__hint--text">
|
|
18
|
+
您可以请点击上方按钮查看任务进度或关闭弹框
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</ele-modal>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { type } from '@idooel/shared'
|
|
26
|
+
export default {
|
|
27
|
+
name: 'ele-modal-import',
|
|
28
|
+
model: {
|
|
29
|
+
prop: 'value',
|
|
30
|
+
event: 'change'
|
|
31
|
+
},
|
|
32
|
+
props: {
|
|
33
|
+
value: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
data() {
|
|
39
|
+
return {
|
|
40
|
+
innerValue: false,
|
|
41
|
+
file: [],
|
|
42
|
+
buttonGroupMeta: {
|
|
43
|
+
elements: [
|
|
44
|
+
{
|
|
45
|
+
label: '关闭',
|
|
46
|
+
key: 'close',
|
|
47
|
+
type: 'default',
|
|
48
|
+
eventName: 'handleClose'
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
isFileEmpty () {
|
|
56
|
+
return type.isEmpty(this.file)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
watch: {
|
|
60
|
+
value: {
|
|
61
|
+
handler (value) {
|
|
62
|
+
this.innerValue = value
|
|
63
|
+
},
|
|
64
|
+
immediate: true
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
emitEvent (props = {}) {
|
|
69
|
+
this.$emit('on-actions', { ...props })
|
|
70
|
+
},
|
|
71
|
+
onCancel () {
|
|
72
|
+
this.innerValue = false
|
|
73
|
+
this.$emit('change', false)
|
|
74
|
+
},
|
|
75
|
+
handleClickJump () {
|
|
76
|
+
this.emitEvent({ action: 'jump' })
|
|
77
|
+
},
|
|
78
|
+
uploadFileSuccess (props) {
|
|
79
|
+
this.emitEvent({ action: 'uploaded', file: props })
|
|
80
|
+
},
|
|
81
|
+
handleClickDownloadTpl () {
|
|
82
|
+
this.emitEvent({ action: 'download' })
|
|
83
|
+
},
|
|
84
|
+
cleanFile () {
|
|
85
|
+
this.file = []
|
|
86
|
+
},
|
|
87
|
+
handleClose () {
|
|
88
|
+
this.cleanFile()
|
|
89
|
+
this.innerValue = false
|
|
90
|
+
this.$emit('change', false)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
</script>
|
|
95
|
+
<style lang="scss">
|
|
96
|
+
@import '../../../theme/index';
|
|
97
|
+
</style>
|
|
98
|
+
<style lang="scss" scoped>
|
|
99
|
+
.import-download__link {
|
|
100
|
+
color: var(--idooel-link-06);
|
|
101
|
+
font-size: 14px;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
line-height: 22px;
|
|
104
|
+
}
|
|
105
|
+
.ele-modal-import__hint {
|
|
106
|
+
.import-hint__content {
|
|
107
|
+
padding: 16px;
|
|
108
|
+
border-radius: 2px;
|
|
109
|
+
height: 82px;
|
|
110
|
+
border: 1px dashed var(--idooel-link-06);
|
|
111
|
+
background: var(--idoole-black-02);
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-direction: row;
|
|
114
|
+
align-items: center;
|
|
115
|
+
.import-hint__left {
|
|
116
|
+
.anticon-upload {
|
|
117
|
+
font-size: 48px;
|
|
118
|
+
color: var(--idooel-link-06);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.import-hint__right {
|
|
122
|
+
margin-left: 16px;
|
|
123
|
+
.hint-right__title {
|
|
124
|
+
font-size: 16px;
|
|
125
|
+
color: var(--idooel-link-06);
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
.hint-right__sub-title {
|
|
129
|
+
font-size: 14px;
|
|
130
|
+
color: var(--idooel-link-03);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
.import-footer__hint--text {
|
|
135
|
+
font-size: 14px;
|
|
136
|
+
color: var(--idooel-link-06);
|
|
137
|
+
line-height: 22px;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
146
140
|
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EleModalTimeline from './src/index.vue'
|
|
2
|
-
|
|
3
|
-
EleModalTimeline.install = Vue => Vue.component(EleModalTimeline.name, EleModalTimeline)
|
|
4
|
-
|
|
1
|
+
import EleModalTimeline from './src/index.vue'
|
|
2
|
+
|
|
3
|
+
EleModalTimeline.install = Vue => Vue.component(EleModalTimeline.name, EleModalTimeline)
|
|
4
|
+
|
|
5
5
|
export default EleModalTimeline
|
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<ele-modal v-on="$listeners" :value="value" :title="title" :buttonGroupMeta="buttonGroupMeta">
|
|
3
|
-
<slot name="alert"></slot>
|
|
4
|
-
<ele-timeline v-bind="meta"></ele-timeline>
|
|
5
|
-
<template v-if="showTextSlot" #footer-text>
|
|
6
|
-
<ele-text v-bind="textAttrs"></ele-text>
|
|
7
|
-
</template>
|
|
8
|
-
</ele-modal>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
import { CONTEXT } from '
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<ele-modal v-on="$listeners" :value="value" :title="title" :buttonGroupMeta="buttonGroupMeta">
|
|
3
|
+
<slot name="alert"></slot>
|
|
4
|
+
<ele-timeline v-bind="meta"></ele-timeline>
|
|
5
|
+
<template v-if="showTextSlot" #footer-text>
|
|
6
|
+
<ele-text v-bind="textAttrs"></ele-text>
|
|
7
|
+
</template>
|
|
8
|
+
</ele-modal>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
// import { CONTEXT } from '@/utils'
|
|
13
|
+
import { CONTEXT } from '../../../utils'
|
|
14
|
+
import { type } from '@idooel/shared'
|
|
15
|
+
export default {
|
|
16
|
+
name: 'ele-modal-timeline',
|
|
17
|
+
model: {
|
|
18
|
+
prop: 'value',
|
|
19
|
+
event: 'change'
|
|
20
|
+
},
|
|
21
|
+
props: {
|
|
22
|
+
value: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
title: {
|
|
27
|
+
type: String
|
|
28
|
+
},
|
|
29
|
+
meta: {
|
|
30
|
+
type: Object,
|
|
31
|
+
default: () => ({})
|
|
32
|
+
},
|
|
33
|
+
buttonGroupMeta: {
|
|
34
|
+
type: Object,
|
|
35
|
+
default: () => {
|
|
36
|
+
return {
|
|
37
|
+
elements: [
|
|
38
|
+
{
|
|
39
|
+
label: '关闭',
|
|
40
|
+
key: 'cancel',
|
|
41
|
+
type: 'default',
|
|
42
|
+
eventName: 'cancel'
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
contextProp: {
|
|
49
|
+
type: Object,
|
|
50
|
+
default: () => ({})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
provide() {
|
|
54
|
+
return {
|
|
55
|
+
[CONTEXT]: () => {
|
|
56
|
+
return {
|
|
57
|
+
_route: this.$route.query,
|
|
58
|
+
_routeMeta: this.$route.meta,
|
|
59
|
+
...this.contextProp
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
computed: {
|
|
65
|
+
showTextSlot () {
|
|
66
|
+
return !type.isEmpty(this.textAttrs)
|
|
67
|
+
},
|
|
68
|
+
textAttrs() {
|
|
69
|
+
const { text = {} } = this.buttonGroupMeta
|
|
70
|
+
return text
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<style lang="scss" scoped>
|
|
77
|
+
|
|
77
78
|
</style>
|
package/packages/button/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EleButton from './src/index.vue'
|
|
2
|
-
|
|
3
|
-
EleButton.install = Vue => Vue.component(EleButton.name, EleButton)
|
|
4
|
-
|
|
1
|
+
import EleButton from './src/index.vue'
|
|
2
|
+
|
|
3
|
+
EleButton.install = Vue => Vue.component(EleButton.name, EleButton)
|
|
4
|
+
|
|
5
5
|
export default EleButton
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<a-dropdown v-if="mode == 'dropdown'">
|
|
3
|
-
<a-menu slot="overlay" @click="handleMenuClick">
|
|
4
|
-
<a-menu-item :key="opt.value" v-for="opt in dataSource">
|
|
5
|
-
{{ opt.label }}
|
|
6
|
-
</a-menu-item>
|
|
7
|
-
</a-menu>
|
|
8
|
-
<a-button :type="type">
|
|
9
|
-
<slot></slot>
|
|
10
|
-
<a-icon :type="icon" />
|
|
11
|
-
</a-button>
|
|
12
|
-
</a-dropdown>
|
|
13
|
-
<a-button :type="type" :icon="icon" @click="handleClick" v-else>
|
|
14
|
-
<slot></slot>
|
|
15
|
-
</a-button>
|
|
16
|
-
</template>
|
|
17
|
-
|
|
18
|
-
<script>
|
|
19
|
-
export default {
|
|
20
|
-
name: 'ele-button',
|
|
21
|
-
props: {
|
|
22
|
-
record: {
|
|
23
|
-
type: Object
|
|
24
|
-
},
|
|
25
|
-
eventName: {
|
|
26
|
-
type: String
|
|
27
|
-
},
|
|
28
|
-
mode: {
|
|
29
|
-
type: String
|
|
30
|
-
},
|
|
31
|
-
dataSource: {
|
|
32
|
-
type: Array,
|
|
33
|
-
default: () => []
|
|
34
|
-
},
|
|
35
|
-
type: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: 'default'
|
|
38
|
-
},
|
|
39
|
-
icon: {
|
|
40
|
-
type: String
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
handleMenuClick (props) {
|
|
45
|
-
const { key } = props
|
|
46
|
-
const currentClickTarget = this.dataSource.find(item => item.value === key)
|
|
47
|
-
const { eventName } = currentClickTarget
|
|
48
|
-
eventName && this.$emit(eventName, { ...currentClickTarget })
|
|
49
|
-
},
|
|
50
|
-
handleClick () {
|
|
51
|
-
this.$emit(this.eventName || 'click', { ...this.record })
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<a-dropdown v-if="mode == 'dropdown'">
|
|
3
|
+
<a-menu slot="overlay" @click="handleMenuClick">
|
|
4
|
+
<a-menu-item :key="opt.value" v-for="opt in dataSource">
|
|
5
|
+
{{ opt.label }}
|
|
6
|
+
</a-menu-item>
|
|
7
|
+
</a-menu>
|
|
8
|
+
<a-button :type="type">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
<a-icon :type="icon" />
|
|
11
|
+
</a-button>
|
|
12
|
+
</a-dropdown>
|
|
13
|
+
<a-button :type="type" :icon="icon" @click="handleClick" v-else>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
</a-button>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'ele-button',
|
|
21
|
+
props: {
|
|
22
|
+
record: {
|
|
23
|
+
type: Object
|
|
24
|
+
},
|
|
25
|
+
eventName: {
|
|
26
|
+
type: String
|
|
27
|
+
},
|
|
28
|
+
mode: {
|
|
29
|
+
type: String
|
|
30
|
+
},
|
|
31
|
+
dataSource: {
|
|
32
|
+
type: Array,
|
|
33
|
+
default: () => []
|
|
34
|
+
},
|
|
35
|
+
type: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'default'
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
type: String
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
handleMenuClick (props) {
|
|
45
|
+
const { key } = props
|
|
46
|
+
const currentClickTarget = this.dataSource.find(item => item.value === key)
|
|
47
|
+
const { eventName } = currentClickTarget
|
|
48
|
+
eventName && this.$emit(eventName, { ...currentClickTarget })
|
|
49
|
+
},
|
|
50
|
+
handleClick () {
|
|
51
|
+
this.$emit(this.eventName || 'click', { ...this.record })
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
55
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import EleCheckbox from './src/index.vue'
|
|
2
|
-
|
|
3
|
-
EleCheckbox.install = Vue => Vue.component(EleCheckbox.name, EleCheckbox)
|
|
4
|
-
|
|
1
|
+
import EleCheckbox from './src/index.vue'
|
|
2
|
+
|
|
3
|
+
EleCheckbox.install = Vue => Vue.component(EleCheckbox.name, EleCheckbox)
|
|
4
|
+
|
|
5
5
|
export default EleCheckbox
|