Commit 1cfef73a authored by yaya's avatar yaya

feat: 添加用户分析页面

parent 9f6b6076
...@@ -423,18 +423,18 @@ export const asyncRouterMap = [ ...@@ -423,18 +423,18 @@ export const asyncRouterMap = [
icon: 'user', icon: 'user',
noCache: true noCache: true
} }
},
{
path: 'analysisList',
component: () => import('@/views/redData/analysisList'),
name: 'analysisList',
meta: {
perms: ['POST /admin/sysIM/sendChatMsg'],
title: '用户评论分析',
icon: 'form',
noCache: true
}
} }
// {
// path: 'list',
// component: () => import('@/views/customerService/chatList'),
// name: 'chatList',
// meta: {
// perms: ['POST /admin/sysIM/sendChatMsg'],
// title: '会话记录',
// icon: 'form',
// noCache: true
// }
// }
] ]
}, },
{ {
......
<template>
<div class="page_invite">
<div class="filter-container">
<div class="filter-item">
<el-input v-model="listQuery.keyword" clearable size="mini" class="filter-item" style="width: 200px;margin-right: 10px" placeholder="请输入关键词"/>
<el-button size="mini" class="filter-item" type="primary" @click="getList">查询</el-button>
</div>
<div class="filter-item">
<div class="filter-item__title" style="margin-right: 10px">笔记分类:</div>
<div class="filter-item__category">
<div v-for="item in categoryList" :key="item.name" :class="{active: item.name === listQuery.category}" class="filter-item__category__content" @click="handlerSelectCateGory(item.name)">
{{ item.name }}
</div>
</div>
</div>
</div>
<!-- 查询结果 -->
<el-table
v-loading="listLoading"
:data="list"
size="small"
element-loading-text="正在查询中..."
border
fit
highlight-current-row>
<el-table-column align="center" label="排行" width="100px" type="index" />
<el-table-column align="center" label="笔记信息" prop="title" />
<el-table-column align="center" label="累计出现次数" prop="num" sortable />
<!-- <el-table-column align="center" label="分享数" prop="differSharedNum"/>-->
<!-- <el-table-column align="center" label="操作" width="250" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- type="text"-->
<!-- size="mini"-->
<!-- @click="handleToDetail(scope.row)">详情-->
<!-- </el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<Pagination
v-show="total>0"
:total="total"
:page.sync="listQuery.page"
:limit.sync="listQuery.limit"
@pagination="getList" />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import axios from 'axios'
export default {
name: 'SoringList',
components: {
Pagination
},
data() {
return {
hit: false,
baColor: '#fffffff',
listLoading: true,
listQuery: {
page: 1,
size: 20,
category: '',
keyword: ''
},
list: [],
total: 0,
categoryList: []
}
},
created() {
this.handleGetCategory()
},
methods: {
// 切换时间周期
handlerChange(e) {
console.log('---切换时间周期--', e)
if (e === '近1天') {
this.listQuery.cycle = 1
} else if (e === '近7天') {
this.listQuery.cycle = 2
} else if (e === '近1月') {
this.listQuery.cycle = 3
}
this.handleGetCategory()
},
handlerSelectCateGory(categoryStr) {
if (categoryStr === this.listQuery.category) {
return
}
this.listQuery.category = categoryStr
this.getList()
},
handleClose() {
this.showDetail = false
},
handleReset() {
this.listQuery = {
page: 1,
limit: 20
}
this.getList()
},
/**
* 获取类目列表
**/
handleGetCategory() {
axios.post('http://xhs-py.wanwudezhi.work/getCategory')
.then(res => {
console.log('===类目列表', res.data)
this.categoryList = res.data.data
debugger
if (this.categoryList && this.categoryList.length > 0) {
this.listQuery.category = this.categoryList[0].name
}
this.getList()
})
},
handleToDetail(row) {
this.fromAccount = row.fromAccount
this.toAccount = row.toAccount
this.showDetail = true
},
getList() {
this.listLoading = true
// this.listLoading = true
// findNoteSoareData(this.listQuery).then(response => {
// this.list = response.data.data.dataList
// this.total = response.data.data.total
// this.listLoading = false
// }).catch((e) => {
// this.list = []
// this.total = 0
// this.listLoading = false
// })
axios.post('http://xhs-py.wanwudezhi.work/countKeyword',
this.listQuery)
.then(res => {
this.listLoading = false
this.list = res.data.data.data
this.total = res.data.data.total
console.log(res.data)
}).catch((e) => {
this.listLoading = false
})
}
}
}
</script>
<style lang="scss" scoped>
/deep/ .el-tag {
margin-right: 10px;
background: white;
border: white;
}
.page_invite {
padding: 20px;
}
.filter-container {
display: flex;
flex-direction: column;
}
.filter-item {
display: flex;
flex-direction: row;
align-items: center;
}
.filter-item__category {
display: flex;
flex-direction: row;
align-items: center;
.filter-item__category__content {
background-color: white;
display: inline-block;
padding: 0 10px;
height: 32px;
line-height: 30px;
font-size: 12px;
color: #606266;
border-radius: 4px;
box-sizing: border-box;
border: 0px solid rgba(64,158,255,.2);
white-space: nowrap;
&.active {
border: 1px solid rgba(64,158,255,.2);
color: #409eff;
background-color: rgba(64,158,255,.1);
//background-color: #1890ff;
}
}
}
</style>
...@@ -72,7 +72,7 @@ export default { ...@@ -72,7 +72,7 @@ export default {
return { return {
hit: false, hit: false,
baColor: '#fffffff', baColor: '#fffffff',
listLoading: false, listLoading: true,
listQuery: { listQuery: {
page: 1, page: 1,
size: 20, size: 20,
...@@ -83,9 +83,6 @@ export default { ...@@ -83,9 +83,6 @@ export default {
list: [], list: [],
total: 0, total: 0,
categoryList: [], categoryList: [],
showDetail: false,
fromAccount: '',
toAccount: '',
checkboxDate: '近1天', checkboxDate: '近1天',
dateOptions: ['近1天', '近7天', '近1月'] dateOptions: ['近1天', '近7天', '近1月']
} }
...@@ -139,12 +136,6 @@ export default { ...@@ -139,12 +136,6 @@ export default {
}) })
}, },
handleToDetail(row) {
this.fromAccount = row.fromAccount
this.toAccount = row.toAccount
this.showDetail = true
},
getList() { getList() {
// this.listLoading = true // this.listLoading = true
// findNoteSoareData(this.listQuery).then(response => { // findNoteSoareData(this.listQuery).then(response => {
...@@ -156,12 +147,16 @@ export default { ...@@ -156,12 +147,16 @@ export default {
// this.total = 0 // this.total = 0
// this.listLoading = false // this.listLoading = false
// }) // })
this.listLoading = true
axios.post('http://xhs-py.wanwudezhi.work/findNoteSoareData', axios.post('http://xhs-py.wanwudezhi.work/findNoteSoareData',
this.listQuery) this.listQuery)
.then(res => { .then(res => {
this.list = res.data.data.data this.list = res.data.data.data
this.total = res.data.data.total this.total = res.data.data.total
this.listLoading = false
console.log(res.data) console.log(res.data)
}).catch((e) => {
this.listLoading = false
}) })
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment