vue2-client 1.9.64 → 1.9.65
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/package.json +1 -1
- package/src/base-client/components/common/XAddReport/XAddReport.vue +2 -1
- package/src/base-client/components/common/XButtons/XButtons.vue +145 -0
- package/src/base-client/components/common/XButtons/index.js +3 -0
- package/src/base-client/components/common/XButtons/index.md +0 -0
- package/src/base-client/components/common/XDataCard/XDataCard.vue +1 -1
- package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -1
- package/src/base-client/components/common/XFormTable/demo.vue +7 -0
- package/src/base-client/components/common/XReportDrawer/XReportDrawer.vue +2 -1
- package/src/base-client/components/common/XReportGrid/XReportTrGroup.vue +1 -1
- package/src/base-client/components/common/XTab/XTab.vue +9 -0
package/package.json
CHANGED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="x-buttons">
|
|
3
|
+
<a-button-group>
|
|
4
|
+
<a-button
|
|
5
|
+
v-for="(button, index) in config"
|
|
6
|
+
:key="index"
|
|
7
|
+
:type="button.type || 'default'"
|
|
8
|
+
:danger="button.danger"
|
|
9
|
+
:disabled="button.disabled"
|
|
10
|
+
:ghost="button.ghost"
|
|
11
|
+
:href="button.href"
|
|
12
|
+
:html-type="button.htmlType"
|
|
13
|
+
:icon="button.icon"
|
|
14
|
+
:loading="button.loading"
|
|
15
|
+
:shape="button.shape"
|
|
16
|
+
:size="button.size"
|
|
17
|
+
:target="button.target"
|
|
18
|
+
@click="handleButtonClick(index)"
|
|
19
|
+
>
|
|
20
|
+
{{ button.label }}
|
|
21
|
+
</a-button>
|
|
22
|
+
</a-button-group>
|
|
23
|
+
</div>
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script>
|
|
27
|
+
import { Button, Icon as AIcon } from 'ant-design-vue'
|
|
28
|
+
import { getConfigByName } from '@vue2-client/services/api/common'
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: 'XButtons',
|
|
32
|
+
components: {
|
|
33
|
+
'a-button': Button,
|
|
34
|
+
'a-icon': AIcon,
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
configName: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: undefined
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
data () {
|
|
43
|
+
return {
|
|
44
|
+
// 配置
|
|
45
|
+
config: [
|
|
46
|
+
{
|
|
47
|
+
label: 'Primary Button',
|
|
48
|
+
type: 'primary',
|
|
49
|
+
icon: 'rocket',
|
|
50
|
+
disabled: false,
|
|
51
|
+
loading: false,
|
|
52
|
+
danger: false,
|
|
53
|
+
ghost: false,
|
|
54
|
+
href: '',
|
|
55
|
+
htmlType: 'button',
|
|
56
|
+
shape: 'default',
|
|
57
|
+
size: 'middle',
|
|
58
|
+
target: '',
|
|
59
|
+
onClick: () => {}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Danger Button',
|
|
63
|
+
type: 'default',
|
|
64
|
+
icon: 'fire',
|
|
65
|
+
disabled: false,
|
|
66
|
+
loading: false,
|
|
67
|
+
danger: true,
|
|
68
|
+
ghost: false,
|
|
69
|
+
href: '',
|
|
70
|
+
htmlType: 'button',
|
|
71
|
+
shape: 'default',
|
|
72
|
+
size: 'middle',
|
|
73
|
+
target: '',
|
|
74
|
+
onClick: () => {}
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: 'Ghost Button',
|
|
78
|
+
type: 'ghost',
|
|
79
|
+
icon: 'ghost',
|
|
80
|
+
disabled: false,
|
|
81
|
+
loading: false,
|
|
82
|
+
danger: false,
|
|
83
|
+
ghost: true,
|
|
84
|
+
href: '',
|
|
85
|
+
htmlType: 'button',
|
|
86
|
+
shape: 'default',
|
|
87
|
+
size: 'middle',
|
|
88
|
+
target: '',
|
|
89
|
+
onClick: () => {}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
label: 'Dashed Button',
|
|
93
|
+
type: 'dashed',
|
|
94
|
+
icon: 'ellipsis',
|
|
95
|
+
disabled: false,
|
|
96
|
+
loading: false,
|
|
97
|
+
danger: false,
|
|
98
|
+
ghost: false,
|
|
99
|
+
href: '',
|
|
100
|
+
htmlType: 'button',
|
|
101
|
+
shape: 'default',
|
|
102
|
+
size: 'middle',
|
|
103
|
+
target: '',
|
|
104
|
+
onClick: () => {}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: 'Link Button',
|
|
108
|
+
type: 'link',
|
|
109
|
+
icon: 'link',
|
|
110
|
+
disabled: false,
|
|
111
|
+
loading: false,
|
|
112
|
+
danger: false,
|
|
113
|
+
ghost: false,
|
|
114
|
+
href: '#',
|
|
115
|
+
htmlType: 'button',
|
|
116
|
+
shape: 'default',
|
|
117
|
+
size: 'middle',
|
|
118
|
+
target: '_blank',
|
|
119
|
+
onClick: () => {}
|
|
120
|
+
}
|
|
121
|
+
],
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
methods: {
|
|
125
|
+
handleButtonClick (index) {
|
|
126
|
+
// 在这里处理点击事件,或者 emit 一个事件到父组件
|
|
127
|
+
this.$emit('button-click', this.config[index])
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
watch: {
|
|
131
|
+
configName: {
|
|
132
|
+
deep: true,
|
|
133
|
+
immediate: true,
|
|
134
|
+
handler (val) {
|
|
135
|
+
console.log('>>>>点击按钮进入')
|
|
136
|
+
if (val) {
|
|
137
|
+
getConfigByName(this.configName, undefined, res => {
|
|
138
|
+
this.config = res.data || this.config
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
}
|
|
145
|
+
</script>
|
|
File without changes
|
|
@@ -138,7 +138,7 @@ export default {
|
|
|
138
138
|
XAddReport,
|
|
139
139
|
XImportExcel
|
|
140
140
|
},
|
|
141
|
-
inject: ['getSelectedId', 'getSelectedData', 'getMixinData', 'getOutEnv'],
|
|
141
|
+
inject: ['getSelectedId', 'getSelectedData', 'getMixinData', 'getOutEnv', 'currUser'],
|
|
142
142
|
data () {
|
|
143
143
|
return {
|
|
144
144
|
// 加载状态
|
|
@@ -26,11 +26,17 @@
|
|
|
26
26
|
<script>
|
|
27
27
|
import XFormTable from '@vue2-client/base-client/components/common/XFormTable/XFormTable.vue'
|
|
28
28
|
import { microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
29
|
+
import { mapState } from 'vuex'
|
|
29
30
|
export default {
|
|
30
31
|
name: 'Demo',
|
|
31
32
|
components: {
|
|
32
33
|
XFormTable
|
|
33
34
|
},
|
|
35
|
+
provide () {
|
|
36
|
+
return {
|
|
37
|
+
currUser: this.currUser
|
|
38
|
+
}
|
|
39
|
+
},
|
|
34
40
|
data () {
|
|
35
41
|
return {
|
|
36
42
|
// 查询配置文件名
|
|
@@ -60,6 +66,7 @@ export default {
|
|
|
60
66
|
}
|
|
61
67
|
},
|
|
62
68
|
computed: {
|
|
69
|
+
...mapState('account', { currUser: 'user' })
|
|
63
70
|
},
|
|
64
71
|
}
|
|
65
72
|
</script>
|
|
@@ -503,7 +503,7 @@ export default {
|
|
|
503
503
|
// tableConfig: {}
|
|
504
504
|
}
|
|
505
505
|
},
|
|
506
|
-
inject: ['openDialog', 'registerComponent', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv'],
|
|
506
|
+
inject: ['openDialog', 'registerComponent', 'getComponentByName', 'runLogic', 'getMixinData', 'getSelectedId', 'isInAModal', 'getConfigByName', 'getSelectedData', 'getOutEnv', 'currUser'],
|
|
507
507
|
methods: {
|
|
508
508
|
getWindow,
|
|
509
509
|
isMicroAppEnv,
|
|
@@ -30,6 +30,7 @@ import { getConfigByName, getConfigByNameAsync, runLogic } from '@vue2-client/se
|
|
|
30
30
|
import { executeStrFunctionByContext } from '@vue2-client/utils/runEvalFunction'
|
|
31
31
|
import { getRealKeyData } from '@vue2-client/utils/util'
|
|
32
32
|
import { getMicroData, getWindow, isMicroAppEnv, microDispatch } from '@vue2-client/utils/microAppUtils'
|
|
33
|
+
import { mapState } from 'vuex'
|
|
33
34
|
|
|
34
35
|
export default {
|
|
35
36
|
name: 'XTab',
|
|
@@ -39,6 +40,11 @@ export default {
|
|
|
39
40
|
XReportGrid: () => import('@vue2-client/base-client/components/common/XReportGrid/XReport.vue')
|
|
40
41
|
},
|
|
41
42
|
inject: ['isInAModal', 'getSelectedId', 'getSelectedData', 'getOutEnv'],
|
|
43
|
+
provide () {
|
|
44
|
+
return {
|
|
45
|
+
currUser: this.currUser
|
|
46
|
+
}
|
|
47
|
+
},
|
|
42
48
|
data () {
|
|
43
49
|
return {
|
|
44
50
|
activeKey: 0,
|
|
@@ -46,6 +52,9 @@ export default {
|
|
|
46
52
|
config: undefined,
|
|
47
53
|
}
|
|
48
54
|
},
|
|
55
|
+
computed: {
|
|
56
|
+
...mapState('account', { currUser: 'user' })
|
|
57
|
+
},
|
|
49
58
|
methods: {
|
|
50
59
|
// 自定义函数中调用的方法 这个不能删
|
|
51
60
|
getWindow,
|