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
158
159
160
161
162
163
164
165
166
167
168
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
<template>
<div class="app-container">
<el-row>
<el-input v-model="keyword"
placeholder="输入关键词搜索(名称/描述/受众组ID)"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px;width: 300px;" />
<el-button type="primary"
size="small"
@click="search"
v-hasPermi="['system:user:add']">
查询
</el-button>
</el-row>
<el-table v-loading="loading"
:data="userList"
border>
<el-table-column label="受众组ID"
align="center"
prop="dmpId" />
<el-table-column label="更新日期"
align="center"
prop="updateTime" />
<el-table-column label="活跃用户数"
align="center"
prop="audienceNum" />
<el-table-column label="状态"
align="center">
<template slot-scope="scope">
{{ scope.row.status && scope.row.status.value }}
</template>
</el-table-column>
<el-table-column label="提交时间"
align="center"
prop="submitTime"
width="120">
</el-table-column>
<el-table-column label="客户名称"
align="center"
prop="customerName"
width="120" />
<el-table-column label="人群包名称"
align="center"
prop="audienceName"
width="120" />
<!-- <el-table-column label="人群包描述"
align="center"
prop="remark"
width="120" /> -->
<el-table-column label="系统类型"
align="center"
prop="platform"
width="120">
<template slot-scope="scope">
{{ scope.row.platform && scope.row.platform.value }}
</template>
</el-table-column>
<el-table-column label="人群包类型"
align="center"
prop="type"
width="120">
<template slot-scope="scope">
{{ scope.row.type && scope.row.type.value }}
</template>
</el-table-column>
<el-table-column label="操作"
align="center"
width="180"
class-name="small-padding fixed-width opt-wrap">
<template slot-scope="scope">
<!-- v-hasPermi="['system:user:remove']" -->
<el-button size="mini"
type="text"
@click="clickDetail(scope.row)">查看详情</el-button>
<el-button size="mini"
type="text"
:disabled="scope.row.status && (scope.row.status.code === 'IN_FORCE' || scope.row.status.code === 'CUSTOMIZE_ERROR')"
@click="clickDefine(scope.row)">确认人群</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total>0"
:total="total"
:page.sync="current"
:limit.sync="size"
@pagination="search" />
<define :show.sync="showDefine"
:item="item"
:aid="aid"
@success="search"></define>
<detail :show.sync="showDetail"
:item="item"></detail>
</div>
</template>
<script>
import { queryCustomApi, queryDetailApi } from "@/api/audience/featured";
import Define from "./define";
import Detail from "./detail";
export default {
components: { Define, Detail },
data() {
return {
current: 1,
size: 10,
activeName: "featured",
// 遮罩层
loading: false,
userList: [],
keyword: "",
total: 0,
showDel: false,
selectedItem: {},
showDefine: false,
showDetail: false,
item: undefined,
aid: undefined
};
},
methods: {
handleDelete(item) {
this.showDel = true;
this.selectedItem = item;
},
search() {
let params = {
current: this.current,
size: this.size,
param: this.keyword
};
queryCustomApi(params).then(
res => {
let { code, message, data } = res;
if (code === 200) {
this.userList = data.records;
this.total = data.total;
} else {
this.$message({
type: "error",
message
});
}
},
error => {
this.$message({
type: "error",
message: error.message
});
}
);
},
clickDetail(item) {
this.showDetail = true;
this.queryDetail(item.audienceId);
},
clickDefine(item) {
this.showDefine = true;
this.aid = item.audienceId;
this.queryDetail(item.audienceId);
},
queryDetail(aid) {
if (!aid) {
this.$message({
type: "warning",
message: "ID为空"
});
return;
}
queryDetailApi({ audienceId: aid }).then(res => {
let { code, message, data } = res;
if (code === 200) {
this.item = data;
} else {
this.$message({
type: "error",
message
});
}
});
}
},
watch: {},
created() {
this.search();
}
};
</script>
<style lang="scss">
.opt-wrap {
.el-button--mini {
&.is-disabled {
color: #C0C4CC
}
}
}
</style>