whiteList.vue
1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<GLDialog
mode="big"
class="muti link"
bigTitle="白名单"
:hasFooter="true"
:before-close="handleClose"
:visible.sync="whiteListObj.show"
@onOk="handleConfirm"
@onCancel="handleClose"
>
<div class="tabs">
<GLTabs
v-model="currentComponent"
:tabPaneList="tabPaneList"
@tab-click="handleClick"
></GLTabs>
</div>
<div class="component">
<component
:is="currentComponent"
:DetailObj="whiteListObj"
v-if="currentComponent"
ref="componentRef"
></component>
</div>
</GLDialog>
</template>
<script type='text/ecmascript-6'>
import WhiteListImport from "./whiteListImport";
import WhiteListSearch from "./whiteListSearch";
export default {
name: '',
components: {
WhiteListSearch,
WhiteListImport },
props: {
whiteListObj: {
type: Object,
default: () => { }
}
},
data () {
return {
currentComponent: 'WhiteListSearch',
tabPaneList: [
{
label: '白名单列表',
name: 'WhiteListSearch'
},
{
label: '导入白名单',
name: 'WhiteListImport'
},
],
}
},
mounted () {
// this.currentComponent = this.tabPaneList[0].name;
},
methods: {
handleConfirm(){
if (this.currentComponent == 'WhiteListSearch'){
this.$message.success('确定成功')
this.handleClose()
}
if (this.currentComponent == 'WhiteListImport'){
this.$refs.componentRef.handleConfirm()
}
},
handleClose () {
this.$emit('update:whiteListObj', {
id:this.whiteListObj.id,
show:false
})
this.currentComponent = this.tabPaneList[0].name;
},
}
}
</script>
<style scoped lang='scss'>
.link {
/deep/.el-form-item--small {
width: fit-content;
}
}
</style>