Commit 2f2ad2e3 by 李伟康

提交代码

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