Commit 2f2ad2e3 by 李伟康

提交代码

1 parent db62914d
......@@ -148,4 +148,34 @@ const getLiveListApi = params => {
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi }
/**数据看板员工排名 */
const getRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.page'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
// 数据看板员工-导出
const exportRankListApi = params => {
params.method = 'scrm.api.shopmall.activity.ranking.export'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
/**数据看板 */
const getDataBoardApi = params => {
params.method = 'scrm.api.shopmall.activity.statdata'
return http({
url: 'rop-scrm-shopmall/router',
method: 'GET',
data: params,
sign: true
})
}
export default { getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi }
......@@ -252,7 +252,7 @@ export default {
this.$router.push({
path: '/seckillActivity/dataBoard',
query: {
id: row.id
activityId: row.id
}
})
}
......
......@@ -32,15 +32,15 @@
/>
</el-popover>
</div>
<div class="value">10086</div>
<div class="value">{{dataBoard[item.key] || 0}}</div>
<template v-if="item.half">
<div class="half">
日环比:
<img
src="@/assets/dataBoard/icon-half-up.png"
class="icon"
/>
<span class="num">14%</span>
<div :class="['icon',
{'up':dataBoard[item.half]>0},
{'down':dataBoard[item.half]<0}
]"></div>
<span class="num">{{Math.abs(dataBoard[item.half]) || 0}}</span>
</div>
</template>
</div>
......@@ -89,12 +89,12 @@ import { exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
const dataList = [
{ name: '新增浏览量', key: '', tips: '统计时间内,新增页面被浏览的次数(一人多次访问计为多次)', half: true },
{ name: '新增访客数', key: '', tips: '统计时间内访问页面的人数(一人多次访问计为一次)', half: true },
{ name: '新增订单数', key: '', tips: '统计时间内,新增订单数(只记录已付款的订单)', half: true },
{ name: '累计浏览量', key: '', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: '', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: '', tips: '累计订单总数(只记录已付款的订单)' }
{ name: '新增浏览量', key: 'browseCount', tips: '统计时间内,新增页面被浏览的次数(一人多次访问计为多次)', half: 'browseRingRatio' },
{ name: '新增访客数', key: 'fansCount', tips: '统计时间内访问页面的人数(一人多次访问计为一次)', half: 'fansRingRatio' },
{ name: '新增订单数', key: 'orderCount', tips: '统计时间内,新增订单数(只记录已付款的订单)', half: 'orderRingRatio' },
{ name: '累计浏览量', key: 'totalBrowseCount', tips: '页面被浏览的总次数(一人多次访问计为多次)' },
{ name: '累计访客数', key: 'totalFansCount', tips: '访问页面的总人数(一人多次访问计为一次)' },
{ name: '累计订单数', key: 'totalOrderCount', tips: '累计订单总数(只记录已付款的订单)' }
], optionList = [
{ confId: '1', confName: '转发次数' },
{ confId: '2', confName: '访客总数' },
......@@ -110,24 +110,24 @@ export default {
url,
dataList,
searchForm: {
day: dayjs().format('YYYY-MM-DD')
statDate: dayjs().format('YYYY-MM-DD')
},
searchFormData: [
{
label: '统计日期',
name: 'day',
name: 'statDate',
type: 'datePicker',
dateType: 'date',
pickerOptions: 'beforeRangePickerOptions'
}
],
searchRankForm: {
type: '1'
statDimension: '1'
},
searchFormRankData: [
{
label: '统计维度',
name: 'type',
name: 'statDimension',
type: 'select',
width: '215px',
optionList,
......@@ -136,18 +136,15 @@ export default {
optionsName: 'statusList'
}
],
getListApi: this.$apis.seckillActivity.getCrowdfundListApi,
getListApi: this.$apis.seckillActivity.getRankListApi,
tableSearchForm: {},
tableParams: {
listName: 'list',
tableColumns: [
// {
// label: '排名',
// formatter: cellValue => {
// console.log(cellValue,arguments)
// return ''
// }
// },
{
label: '排名',
prop: 'rankNumber',
},
{
label: '员工',
prop: 'activityName',
......@@ -155,36 +152,36 @@ export default {
},
{
label: '转发次数',
prop: 'activityImg',
addHtml: 'activityImg'
prop: 'forwardCount',
addHtml: 'forwardCount'
},
{
label: '访客总数',
prop: 'viewAmount',
addHtml: 'linkText',
prop: 'fansCount',
width: 140
},
{
label: '浏览总数',
prop: 'fansAmount',
addHtml: 'linkText'
prop: 'browseCount',
},
{
label: '成交单量',
prop: 'shareAmount',
addHtml: 'linkText'
prop: 'orderCount',
},
{
label: '转化率',
prop: 'saleAmount'
prop: 'orderCount'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
dataBoard: {}
}
},
created () {
this.getDataBoardApi()
},
mounted () {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'),
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
......@@ -193,18 +190,28 @@ export default {
},
methods: {
getDataBoardApi () {
let { activityId } = this.$route.query,
{ statDate } = this.searchForm
this.$apis.seckillActivity.getDataBoardApi({ activityId, statDate }).then(res => {
this.dataBoard = res || {}
})
},
getParams () {
let params = JSON.parse(JSON.stringify(this.searchRankForm))
let { activityId } = this.$route.query,
params = JSON.parse(JSON.stringify(this.searchRankForm))
params.activityId = activityId
return params
},
handleSearch () {
this.getDataBoardApi()
},
handleSearchRank () {
this.$refs.dataTableRef.refreshTable()
},
handleExport () {
let params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
this.$apis.seckillActivity.exportRankListApi(params).then(res => {
exportFn(res)
})
},
......@@ -216,7 +223,7 @@ export default {
},
setTableFinishFun () {
//接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
this.$refs.dataTableRef.data.length ? (this.$refs.dataTableRef.tableHeightValues = '') : this.$refs.dataTableRef.setTableHeightFun()
}
},
};
......@@ -268,6 +275,14 @@ export default {
.icon {
width: 16px;
height: 16px;
background-image: url(../../assets/dataBoard/icon-half-default.png);
background-size: 16px 16px;
}
.up{
background-image: url(../../assets/dataBoard/icon-half-up.png);
}
.down{
background-image: url(../../assets/dataBoard/icon-half-down.png);
}
.num {
margin-left: 4px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!