|
@@ -25,6 +25,27 @@ const timeType = [
|
|
|
const timeTypeValue = ref('')
|
|
|
const selectDate = ref([])
|
|
|
const selectBusinessValue=ref([])
|
|
|
+// 获取选择的起止日期值
|
|
|
+function getStartAndEndDate(){
|
|
|
+ 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')
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ StartDate,
|
|
|
+ EndDate
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
const tableData = ref([])
|
|
|
const columns = [
|
|
@@ -41,27 +62,13 @@ const tablePagination = ref({
|
|
|
})
|
|
|
let SortParam='',SortType='';
|
|
|
async function getStatisticList(){
|
|
|
- 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:StartDate,
|
|
|
- EndDate:EndDate,
|
|
|
+ StartDate:getStartAndEndDate().StartDate,
|
|
|
+ EndDate:getStartAndEndDate().EndDate,
|
|
|
SortParam:SortParam,
|
|
|
SortType:SortType
|
|
|
})
|
|
@@ -108,8 +115,10 @@ function handleSelectDate(){
|
|
|
|
|
|
const showFavChart=ref(false)
|
|
|
const activeUser=ref(null)
|
|
|
+const filterDate=ref(null)
|
|
|
function handleShowDetail(item){
|
|
|
activeUser.value=item
|
|
|
+ filterDate.value=getStartAndEndDate()
|
|
|
showFavChart.value=true
|
|
|
}
|
|
|
</script>
|
|
@@ -152,7 +161,11 @@ function handleShowDetail(item){
|
|
|
</t-table>
|
|
|
|
|
|
<!-- 用户收藏图表 -->
|
|
|
- <FavChartStatistic v-model:show="showFavChart" :data="activeUser"/>
|
|
|
+ <FavChartStatistic
|
|
|
+ v-model:show="showFavChart"
|
|
|
+ :data="activeUser"
|
|
|
+ :filterDate="filterDate"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<style lang="scss" scoped>
|