selectApplication.vue
4.11 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
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<template>
<div>
<el-dialog title="提示" :visible.sync="dialogVisible" width="70%" :before-close="!dialogVisible">
<span>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">搜索</el-button>
</span>
</glsx-combi-form>
<el-row :gutter="20">
<el-col :span="16">
<GLTable ref="merchantTable" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :tableData="tableData" @selectionTable="selectionTable"></GLTable>
</el-col>
<el-col :span="8">
<div>
<div>
<h4>已选列表</h4>
<el-card class="box-card">
<!-- 展示内容 -->
<div>
<el-tag v-for="(tag, idx) in innerTags" :key="idx" type="info" closable :disable-transitions="false" @close="remove(tag)">
{{ tag.applicationName }}-{{ tag.applicationType }}
</el-tag>
</div>
</el-card>
</div>
</div>
</el-col>
</el-row>
</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'SelectApplication',
data() {
return {
url,
dialogVisible: false,
mutiSelectArr: {},
searchForm: {
merchantName: ''
},
innerTags: [],
searchFormData: [
{
label: '关键字:',
name: 'merchantName',
type: 'input',
maxlength: 20,
placeholder: '请输入应用名称进行搜索',
isClear: true
},
{
label: '应用类型:',
name: 'merchantName',
type: 'select',
maxlength: 20,
placeholder: '全部',
isClear: true
}
],
tableParams: {
listName: 'list',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableColumns: [
{
label: '应用名称',
prop: 'applicationName',
line: 2
},
{
label: '应用类型',
prop: 'applicationType',
line: 2
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableData: [
{
id: 111,
applicationName: '有点东西',
applicationType: '小程序'
},
{
id: 222,
applicationName: '有点东西',
applicationType: '小程序'
},
{
id: 333,
applicationName: '有点东西',
applicationType: '小程序'
},
{
id: 444,
applicationName: '有点东西',
applicationType: '小程序'
},
{
id: 555,
applicationName: '有点东西',
applicationType: '小程序'
}
]
}
},
methods: {
init() {
this.dialogVisible = true
this.mutiSelectArr = {}
},
handleSearch() {
this.$refs.merchantTable.refreshTable()
},
// 多选
selectionTable(val) {
console.log(val)
this.innerTags = val
},
// 提交选择业务应用
handleConfirm() {
// if (!this.mutiSelectArr.length) {
// this.$message({
// message: '请最少选择一条业务应用!',
// type: 'warning'
// })
// }
this.$emit('selectApplication', this.mutiSelectArr)
this.dialogVisible = false
}
}
}
</script>
<style lang="scss" scoped>
h4 {
margin-top: 0;
color: red;
}
.box-card {
height: 120px;
border: 1px solid rgb(61, 60, 60);
}
</style>