|
@@ -39,14 +39,31 @@ const tablePagination = ref({
|
|
|
total: 0,
|
|
|
showPageSize: false
|
|
|
})
|
|
|
+let SortParam='',SortType='';
|
|
|
async function getStatisticList(){
|
|
|
- let StartDate='',EndDate='';
|
|
|
+ let StartDate=selectDate.value?.[0]||'',EndDate=selectDate.value?.[1]||'';
|
|
|
+ if(timeTypeValue.value==='今天'){
|
|
|
+ StartDate=moment().format('YYYY-MM-DD')
|
|
|
+ EndDate=moment().format('YYYY-MM-DD')
|
|
|
+ }else if(timeTypeValue.value==='过去3天'){
|
|
|
+ EndDate=moment().format('YYYY-MM-DD')
|
|
|
+ StartDate=moment().subtract(3,'days').format('YYYY-MM-DD')
|
|
|
+ }else if(timeTypeValue.value==='过去一周'){
|
|
|
+ EndDate=moment().format('YYYY-MM-DD')
|
|
|
+ StartDate=moment().subtract(7,'days').format('YYYY-MM-DD')
|
|
|
+ }else if(timeTypeValue.value==='过去一月'){
|
|
|
+ EndDate=moment().format('YYYY-MM-DD')
|
|
|
+ StartDate=moment().subtract(30,'days').format('YYYY-MM-DD')
|
|
|
+ }
|
|
|
+
|
|
|
const res=await apiCustomerUser.getUserActionStatistic({
|
|
|
CurrentIndex:tablePagination.value.current,
|
|
|
PageSize:tablePagination.value.pageSize,
|
|
|
EtaBusinessIds:selectBusinessValue.value.join(','),
|
|
|
- StartDate:selectDate.value?.[0]||'',
|
|
|
- EndDate:selectDate.value?.[1]||'',
|
|
|
+ StartDate:StartDate,
|
|
|
+ EndDate:EndDate,
|
|
|
+ SortParam:SortParam,
|
|
|
+ SortType:SortType
|
|
|
})
|
|
|
if(res.Ret!==200) return
|
|
|
tableData.value=res.Data.List||[]
|
|
@@ -54,6 +71,22 @@ async function getStatisticList(){
|
|
|
|
|
|
}
|
|
|
getStatisticList()
|
|
|
+function handlePageChange(e){
|
|
|
+ tablePagination.value.current=e.current
|
|
|
+ getStatisticList()
|
|
|
+}
|
|
|
+// 排序 sort undefined descending:true|false
|
|
|
+function handleSortChange(sort,options){
|
|
|
+ console.log(sort,options);
|
|
|
+ if(sort){
|
|
|
+ SortParam=sort.sortBy
|
|
|
+ SortType=sort.descending?'desc':'asc'
|
|
|
+ }else{
|
|
|
+ SortParam=''
|
|
|
+ SortType=''
|
|
|
+ }
|
|
|
+ refreshList()
|
|
|
+}
|
|
|
|
|
|
function refreshList(){
|
|
|
tablePagination.value.current=1
|
|
@@ -74,7 +107,11 @@ function handleSelectDate(){
|
|
|
}
|
|
|
|
|
|
const showFavChart=ref(false)
|
|
|
-
|
|
|
+const activeUser=ref(null)
|
|
|
+function handleShowDetail(item){
|
|
|
+ activeUser.value=item
|
|
|
+ showFavChart.value=true
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -106,14 +143,16 @@ const showFavChart=ref(false)
|
|
|
:pagination="tablePagination"
|
|
|
show-header
|
|
|
resizable
|
|
|
+ @page-change="handlePageChange"
|
|
|
+ @sort-change="handleSortChange"
|
|
|
>
|
|
|
<template #CollectNum="{row}">
|
|
|
- <t-button size="small" theme="primary" variant="text">{{row.CollectNum}}</t-button>
|
|
|
+ <t-button size="small" theme="primary" variant="text" @click="handleShowDetail(row)">{{row.CollectNum}}</t-button>
|
|
|
</template>
|
|
|
</t-table>
|
|
|
|
|
|
<!-- 用户收藏图表 -->
|
|
|
- <FavChartStatistic v-model:show="showFavChart"/>
|
|
|
+ <FavChartStatistic v-model:show="showFavChart" :data="activeUser"/>
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|