|
@@ -1,6 +1,8 @@
|
|
<script setup>
|
|
<script setup>
|
|
import FavChartStatistic from './FavChartStatistic.vue'
|
|
import FavChartStatistic from './FavChartStatistic.vue'
|
|
import { Calendar1Icon } from 'tdesign-icons-vue-next'
|
|
import { Calendar1Icon } from 'tdesign-icons-vue-next'
|
|
|
|
+import {apiCustomerUser} from '@/api/customer'
|
|
|
|
+import moment from 'moment'
|
|
|
|
|
|
const timeType = [
|
|
const timeType = [
|
|
{
|
|
{
|
|
@@ -22,20 +24,53 @@ const timeType = [
|
|
]
|
|
]
|
|
const timeTypeValue = ref('')
|
|
const timeTypeValue = ref('')
|
|
const selectDate = ref([])
|
|
const selectDate = ref([])
|
|
-const selectBusinessValue=ref('')
|
|
|
|
|
|
+const selectBusinessValue=ref([])
|
|
|
|
|
|
const tableData = ref([])
|
|
const tableData = ref([])
|
|
const columns = [
|
|
const columns = [
|
|
- { align: 'center', colKey: '', title: '用户名' },
|
|
|
|
- { align: 'center', colKey: '', title: '客户名' },
|
|
|
|
- { align: 'center', colKey: '', title: '累计收藏图表' },
|
|
|
|
- { align: 'center', colKey: '', title: '最近一次收藏时间', sorter: true, },
|
|
|
|
|
|
+ { align: 'center', colKey: 'RealName', title: '用户名' },
|
|
|
|
+ { align: 'center', colKey: 'BusinessName', title: '客户名' },
|
|
|
|
+ { align: 'center', colKey: 'CollectNum', title: '累计收藏图表' },
|
|
|
|
+ { align: 'center', colKey: 'LastCollectChartTime', title: '最近一次收藏时间', sorter: true, },
|
|
]
|
|
]
|
|
-const tablePagination = {
|
|
|
|
- defaultCurrent: 1,
|
|
|
|
- defaultPageSize: 20,
|
|
|
|
|
|
+const tablePagination = ref({
|
|
|
|
+ current: 1,
|
|
|
|
+ pageSize: 20,
|
|
total: 0,
|
|
total: 0,
|
|
showPageSize: false
|
|
showPageSize: false
|
|
|
|
+})
|
|
|
|
+async function getStatisticList(){
|
|
|
|
+ let StartDate='',EndDate='';
|
|
|
|
+ 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]||'',
|
|
|
|
+ })
|
|
|
|
+ if(res.Ret!==200) return
|
|
|
|
+ tableData.value=res.Data.List||[]
|
|
|
|
+ tablePagination.value.total=res.Data.Paging.Totals
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+getStatisticList()
|
|
|
|
+
|
|
|
|
+function refreshList(){
|
|
|
|
+ tablePagination.value.current=1
|
|
|
|
+ tableData.value=[]
|
|
|
|
+ getStatisticList()
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 日期类型切换
|
|
|
|
+function handleTimeTypeChange(item){
|
|
|
|
+ timeTypeValue.value=item.value
|
|
|
|
+ selectDate.value=[]
|
|
|
|
+ refreshList()
|
|
|
|
+}
|
|
|
|
+// 选择具体日期
|
|
|
|
+function handleSelectDate(){
|
|
|
|
+ timeTypeValue.value=''
|
|
|
|
+ refreshList()
|
|
}
|
|
}
|
|
|
|
|
|
const showFavChart=ref(false)
|
|
const showFavChart=ref(false)
|
|
@@ -44,15 +79,24 @@ const showFavChart=ref(false)
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="flex top-filter">
|
|
<div class="flex top-filter">
|
|
- <select-business placeholder="输入社会信用码或客户名称" filterable v-model="selectBusinessValue" style="width: 240px; margin-right: 50px" />
|
|
|
|
|
|
+ <select-business
|
|
|
|
+ placeholder="输入社会信用码或客户名称"
|
|
|
|
+ filterable
|
|
|
|
+ multiple
|
|
|
|
+ clearable
|
|
|
|
+ v-model="selectBusinessValue"
|
|
|
|
+ style="width: 240px; margin-right: 50px"
|
|
|
|
+ @change="refreshList"
|
|
|
|
+ />
|
|
<t-button
|
|
<t-button
|
|
:variant="timeTypeValue === item.value ? 'base' : 'outline'"
|
|
:variant="timeTypeValue === item.value ? 'base' : 'outline'"
|
|
v-for="item in timeType"
|
|
v-for="item in timeType"
|
|
:key="item.value"
|
|
:key="item.value"
|
|
style="width: 100px"
|
|
style="width: 100px"
|
|
|
|
+ @click="handleTimeTypeChange(item)"
|
|
>{{ item.label }}</t-button
|
|
>{{ item.label }}</t-button
|
|
>
|
|
>
|
|
- <t-date-range-picker v-model="selectDate" clearable style="width: 300px" />
|
|
|
|
|
|
+ <t-date-range-picker v-model="selectDate" clearable style="width: 300px" @change="handleSelectDate"/>
|
|
</div>
|
|
</div>
|
|
<t-table
|
|
<t-table
|
|
rowKey="id"
|
|
rowKey="id"
|
|
@@ -62,7 +106,11 @@ const showFavChart=ref(false)
|
|
:pagination="tablePagination"
|
|
:pagination="tablePagination"
|
|
show-header
|
|
show-header
|
|
resizable
|
|
resizable
|
|
- />
|
|
|
|
|
|
+ >
|
|
|
|
+ <template #CollectNum="{row}">
|
|
|
|
+ <t-button size="small" theme="primary" variant="text">{{row.CollectNum}}</t-button>
|
|
|
|
+ </template>
|
|
|
|
+ </t-table>
|
|
|
|
|
|
<!-- 用户收藏图表 -->
|
|
<!-- 用户收藏图表 -->
|
|
<FavChartStatistic v-model:show="showFavChart"/>
|
|
<FavChartStatistic v-model:show="showFavChart"/>
|