c3bca151
wesley88
1
|
1
2
3
4
5
6
|
<template>
<div class="policy-selector">
<div class="policy-selector-content">
<div style="border: 1px solid #E5E5E5;padding: 1px" id="huodong">
<div
style="padding: 10px 13px;font-size: 14px;border-bottom: 1px solid #E5E5E5;display: flex;justify-content: space-between;">
|
6eebfba2
wesley88
1
|
7
|
<div style="line-height:200%">选择资源</div>
|
c3bca151
wesley88
1
|
8
|
<div style="display: flex">
|
6eebfba2
wesley88
1
|
9
|
<el-select v-if="!istype" v-model="zytype" placeholder="请选择" style="width: 40%;margin-right: 15px" @change="changzytype">
|
c3bca151
wesley88
1
|
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
<el-option label="商铺" :value="'1'"></el-option>
<el-option label="广告" :value="'2'"></el-option>
<el-option label="场地" :value="'3'"></el-option>
</el-select>
<el-input placeholder="请输入" suffix-icon="el-icon-search" style="margin-right:15px;width: 40%;"
v-model="name">
</el-input>
<el-button @click="onSearch" style="background-color: #3F9B6A;color: #fff">查询
</el-button>
<el-button @click="resetting" class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">重置
</el-button>
</div>
</div>
<div style="padding: 15px;">
<div style="padding: 0px 20px 0px 0px;max-height:40vh;overflow-y: auto;">
<el-table ref="multipleTable" :data="listData" tooltip-effect="dark"
@selection-change="handleSelectionChange"
:header-cell-style="{fontSize: '14px',color:'#0009',fontWeight: 'normal',backgroundColor:'#F2F3F5'}">
<el-table-column label="选择" type="selection" width="55">
</el-table-column>
|
a72e57a5
wesley88
1
|
31
|
<el-table-column label="序号" width="80">
|
c3bca151
wesley88
1
|
32
33
34
35
|
<template slot-scope="scope">
{{scope.$index +1 }}
</template>
</el-table-column>
|
a72e57a5
wesley88
1
|
36
|
<!-- <el-table-column label="编号" prop="id"></el-table-column> -->
|
c3bca151
wesley88
1
|
37
38
39
40
41
|
<el-table-column label="资源名称">
<template slot-scope="scope">
{{scope.row.shopName ? scope.row.shopName : scope.row.advertisingName?scope.row.advertisingName:scope.row.venueName}}
</template>
</el-table-column>
|
a72e57a5
wesley88
1
|
42
|
<el-table-column label="资源类型" width="120">
|
c3bca151
wesley88
1
|
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
|
<template slot-scope="scope">
{{scope.row.shopName ? '商铺' : scope.row.advertisingType?scope.row.advertisingType:'场地'}}
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
<div style="display: flex;justify-content: space-between;margin: 20px 0;" class="bom">
<div style="font-size: 14px;">共 <span style="color: #3F9B6A;">{{total}}</span> 项数据</div>
<el-pagination :current-page="pageindex.pageNumber+1" :page-sizes="[5,10, 20, 50, 100]"
:page-size="pageindex.pageSize" background small layout="prev, pager, next" :total="total"
@size-change="handleSizeChange" @current-change="handleCurrentChange">
</el-pagination>
</div>
<div class="policy-selector-footer" style="display: flex; justify-content: flex-end; align-items: center;">
<el-button @click="confirm" style="background-color: #3F9B6A;color: #fff;">确定</el-button>
<el-button @click="cancel" class="buttonHover"
style="color: #606266;border: 1px solid #dddfe5;background-color: #fff;">取消</el-button>
</div>
</div>
</template>
<script>
import {
cereResourceStrategylist
} from '@/api/newly.js'
import {
ceGetAll
} from '@/api/sam.js'
import {
getAlls,
changAlls
} from '@/api/information.js'
import {
getAlls as map1
} from '@/api/map1.js'
export default {
data() {
return {
name:'',
zytype:'1',
total: 0,
pageindex: {
pageNumber: 0,
pageSize: 5,
|
6abe0316
wesley88
1
|
90
|
// publishStatus:'0'
|
c3bca151
wesley88
1
|
91
92
93
94
95
96
|
},
selectedRows: [],
listData: [],
};
},
async created() {
|
6eebfba2
wesley88
1
|
97
98
99
|
if(this.istype) {
this.zytype = this.istype
}
|
c3bca151
wesley88
1
|
100
101
102
|
await this.getAll()
},
props: {
|
6eebfba2
wesley88
1
|
103
104
105
106
107
108
|
istype: {
type: String,
default: function () {
return null
}
},
|
6abe0316
wesley88
1
|
109
|
publishStatus: {
|
c3bca151
wesley88
1
|
110
111
|
type: String,
default: function () {
|
6abe0316
wesley88
1
|
112
|
return '0'
|
c3bca151
wesley88
1
|
113
|
}
|
6abe0316
wesley88
1
|
114
115
116
117
118
119
120
|
},
maxSelection: {
type: Number,
default: function () {
return 20
}
},
|
c3bca151
wesley88
1
|
121
122
123
124
125
126
127
128
|
},
methods: {
changzytype() {
this.onSearch()
},
async getAll() {
let list = []
if(this.zytype == '1') {
|
6abe0316
wesley88
1
|
129
|
list = await getAlls({shopName: this.name,...this.pageindex,publishStatus:this.publishStatus})
|
c3bca151
wesley88
1
|
130
|
} else if(this.zytype == '2') {
|
6abe0316
wesley88
1
|
131
|
list = await map1({advertisingName: this.name,...this.pageindex,publishStatus:this.publishStatus})
|
c3bca151
wesley88
1
|
132
|
} else if(this.zytype == '3') {
|
6abe0316
wesley88
1
|
133
|
list = await changAlls({venueName: this.name,...this.pageindex,publishStatus:this.publishStatus})
|
c3bca151
wesley88
1
|
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
}
this.listData = list.data.content
this.total = list.data.totalElements
},
async handleCurrentChange(val) {
this.pageindex.pageNumber = val - 1
await this.getAll()
},
handleSizeChange(val) {
this.pageindex.pageSize = val
this.getAll()
},
onSearch() {
this.pageindex.pageNumber = 0
this.getAll()
},
resetting() {
this.pageindex = {
pageNumber: 0,
pageSize: 5,
}
this.name = ''
this.getAll()
},
handleSelectionChange(selection) {
|
6abe0316
wesley88
1
|
160
161
162
163
164
165
166
167
168
|
if (selection.length > this.maxSelection) {
this.$message.warning(`最多只能选择 ${this.maxSelection} 项`);
this.$refs.multipleTable.clearSelection();
selection.slice(0, this.maxSelection).forEach(row => {
this.$refs.multipleTable.toggleRowSelection(row, true);
});
} else {
this.selectedRows = selection;
}
|
c3bca151
wesley88
1
|
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
},
confirm() {
this.$emit('minSev',this.selectedRows);
},
cancel() {
this.$emit('mingClose');
}
}
};
</script>
<style scoped>
.policy-selector {
padding: 20px;
/* padding: 20px;
width: 100%;
margin: 0 auto;
border: 1px solid #ddd; */
/* border-radius: 4px; */
/* box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1); */
}
.policy-selector-header {
text-align: left;
margin-bottom: 20px;
}
.policy-selector-header h3 {
margin: 0;
font-size: 18px;
color: #303133;
}
.policy-selector-content {
margin-bottom: 20px;
}
.policy-selector-footer {
display: flex;
justify-content: flex-end;
align-items: center;
}
::v-deep .el-dialog__body {
padding: 0 0 !important;
}
</style>
|