zycd.vue
4.96 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
<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;">
<div style="line-height:200%">选择资源</div>
<div style="display: flex">
<el-input placeholder="请输入" suffix-icon="el-icon-search" style="margin-right:15px;width: 40%;"
v-model="pageindex.policyName">
</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 :data="ziyuanData" 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>
<el-table-column label="编号" prop="id">
</el-table-column>
<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>
<el-table-column label="资源类型">
<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 {
getAlls,
changAlls
} from '@/api/information.js'
import {
getAlls as map1
} from '@/api/map1.js'
export default {
name: 'PolicySelector',
data() {
return {
total: 0,
pageindex: {
pageNumber: 0,
pageSize: 5,
policyName: ''
},
selectedRows: [],
ziyuanData: []
};
},
created() {
this.getAll()
},
methods: {
async getAll() {
const ziyuan = await getAlls(this.pageindex)
const ggw = await map1(this.pageindex)
const changdi = await changAlls(this.pageindex)
this.ziyuanData = [...ziyuan.data.content, ...ggw.data.content, ...changdi.data.content]
// console.error(this.ziyuanData)
// this.total = celue.data.totalElements
},
handleCurrentChange(val) {
this.pageindex.pageNumber = val-1
this.getAll()
},
handleSizeChange(val) {
this.pageindex.pageSize = val
},
onSearch() {
this.pageindex.pageNumber = 0
this.getAll()
},
resetting() {
this.pageindex ={
pageNumber: 0,
pageSize: 5,
policyName: ''
}
this.getAll()
},
handleSelectionChange(selection) {
this.selectedRows = selection;
},
confirm() {
this.$emit('minSev', this.selectedRows);
},
cancel() {
this.$emit('mingClose');
}
}
};
</script>
<style scoped>
.policy-selector {
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;
}
</style>