This commit is contained in:
X1627315083
2024-12-18 17:38:43 +08:00
90 changed files with 3220 additions and 865 deletions

View File

@@ -77,11 +77,13 @@
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
export default defineComponent({
components: {
},
setup() {
const store:any = useStore()
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
@@ -90,9 +92,10 @@ export default defineComponent({
{
title: 'Email',
align: "center",
ellipsis: true,
dataIndex: "userEmail",
key: "userEmail",
width:200,
fixed: "left",
},
{
title: 'User Id',
@@ -100,6 +103,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width:100,
},
{
title: 'User Name',
@@ -107,6 +111,7 @@ export default defineComponent({
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width:100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
@@ -121,6 +126,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "isTrial",
key: "isTrial",
width:100,
customRender: (record: any) => {
let str
if(record.value == 1){
@@ -137,6 +143,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width:100,
},
{
title: 'Country',
@@ -144,6 +151,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "country",
key: "country",
width:200,
},
{
title: 'Title',
@@ -151,6 +159,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "title",
key: "title",
width:100,
},
{
title: 'Surname',
@@ -158,6 +167,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "surname",
key: "surname",
width:150,
},
{
title: 'Given Name',
@@ -165,6 +175,7 @@ export default defineComponent({
ellipsis: true,
dataIndex: "givenName",
key: "givenName",
width:100,
},
{
title: 'Create Time',
@@ -176,6 +187,19 @@ export default defineComponent({
// resizable: true,
dataIndex: "createTime",
key: "createTime",
width:200,
},
{
title: 'Credits',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "credits",
key: "credits",
width:100,
},
{
title: 'Occupation',
@@ -187,6 +211,7 @@ export default defineComponent({
// resizable: true,
dataIndex: "occupation",
key: "occupation",
width:100,
},
{
title: 'Trial Order Id',
@@ -196,11 +221,14 @@ export default defineComponent({
// resizable: true,
dataIndex: "trialOrderId",
key: "trialOrderId",
width:100,
},
];
});
let allUserList: any = ref([]);
let allUserList: any = computed(()=>{
return store.state.adminPage.allUserList
})
let ids = ref([])
let email = ref('')
let dataList: any = ref([]);
@@ -237,10 +265,6 @@ export default defineComponent({
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
let allUserList: any = sessionStorage.getItem("allUserList");
if (allUserList) {
this.allUserList = JSON.parse(allUserList);
}
},
methods: {
//改变页码

View File

@@ -0,0 +1,306 @@
<template>
<div class="admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Start Time:</span>
<a-range-picker
style="width:280px"
class="range_picker"
v-model:value="rangePickerValue"
:allowClear="false"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
valueFormat="YYYY-MM-DD"
>
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
</div>
<div class="admin_state_item">
<span>State:</span>
<a-select v-model:value="currentState.value" size="large" style="width:280px" optionFilterProp="label" :options="state" placeholder="Please select" allowClear show-search></a-select>
</div>
<div class="admin_state_item">
<span>Affiliate Id:</span>
<input
style="width:280px"
v-model="affiliateId"
placeholder="Please enter Affiliate Id"
@keydown.enter="gettrialList"
type="text"
/>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
</div>
<div class="admin_table_content" ref="historyTable">
<a-table
:columns="columns"
:data-source="collectionList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
>
<template
#bodyCell="{ column, text, record, index }"
>
<div
class="operate_list"
v-if="column?.Operations && record.status == 'Pending'"
>
<div v-show="status == 0" class="operate_item" @click="setAgree(record, true)">
agree
</div>
<div v-show="status == 0" class="operate_item" @click="setAgree(record, false)" >
refuse
</div>
</div>
<div v-else-if="column?.Operations">
{{ record.status }}
</div>
<div v-else-if="column?.openType" @click="openDetail(record,column?.openType)">
{{ text }} HDK
</div>
</template>
</a-table>
</div>
<itemAffiliateDetail ref="itemAffiliateDetail"></itemAffiliateDetail>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed } from "vue";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
import itemAffiliateDetail from "./itemAffiliateDetail.vue";
export default defineComponent({
components: {
itemAffiliateDetail,
},
setup() {
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: 'Id',
align: "center",
width: 50,
dataIndex: "id",
key: "id",
fixed: "left",
},
{
title: 'Create Time',
align: "center",
width: 200,
dataIndex: "createTime",
key: "createTime",
sorter: true,
},{
title: 'State',
align: "center",
ellipsis: true,
width: 100,
dataIndex: "status",
key: "status",
},{
title: 'Updata Time',
align: "center",
width: 200,
dataIndex: "updateTime",
key: "updateTime",
},{
title: 'Total income',
align: "center",
ellipsis: true,
width: 100,
dataIndex: "totalEarnings",
key: "totalEarnings",
openType:'month',
},{
title: 'Monthly income',
align: "center",
ellipsis: true,
width: 100,
dataIndex: "monthlyEarnings",
key: "monthlyEarnings",
openType:'all',
},{
title: 'Invitation Link',
align: "center",
ellipsis: true,
width: 250,
dataIndex: "link",
key: "link",
},{
title: 'Unpaid amount',
align: "center",
ellipsis: true,
width: 100,
dataIndex: "unpaidEarnings",
key: "unpaidEarnings",
},
{
title: 'Operations',
key: "operation",
align: "center",
fixed: "right",
width: 130,
// slots:{customRender:'action'}
Operations: true,
},
];
});
let currentState = ref({
label:'All',
value:'',
state:false,
},)
let state:any = ref([
{
label:'All',
value:'',
},
{
label:'Pending',
value:'Pending',
},
{
label:'Active',
value:'Active',
},
{
label:'Inactive',
value:'Inactive',
},
{
label:'Refused',
value:'Refused',
},
])
const itemAffiliateDetail = ref()
let collectionList: any = ref([]);
let status: any = ref(0);
const openDetail = (value:any,openType:string)=>{
console.log(value,openType);
let data = {
id:value.id,
type:openType
}
itemAffiliateDetail.value.init(data)
}
return {
columns,
collectionList,
renameData,
status,
currentState,
itemAffiliateDetail,
state,
openDetail,
};
},
data() {
return {
rangePickerValue:[],
currentPage: 1,
pageSize: 10,
total: 0,
order:'',
affiliateId:'',
historyTableHeight: 0,
newCollectionName: "",
renameVisivle: false, //修改名字弹窗
collectionName: "", //选中的名字
searchCollectionName: "",
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any, filters:any, sorter:any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.order = sorter.order == "descend" ? "DESC" : "ASC";
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
let startDate: any = this.rangePickerValue?.[0]
? this.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = this.rangePickerValue?.[1]
? this.rangePickerValue[1]+' '+'00:00:00'
: "";
let data = {
page: this.currentPage,
size: this.pageSize,
order: this.order,
status: this.currentState.value,
startTime:startDate,
endTime:endDate,
affiliateId:this.affiliateId
};
Https.axiosPost(Https.httpUrls.affiliateList, data).then(
(rv: any) => {
this.collectionList = rv.records;
this.total=rv.total
}
);
},
setAgree(record: any, boolean: boolean){
// const formData = new FormData()
// formData.append('id',record.id)
// formData.append('isApproved ',boolean+'')
let data = {
id:record.id,
isApproved: boolean,
}
let config:any = {headers:{'Content-Type':'multipart/form-data','Accept':'*/*' }}
Https.axiosGet(Https.httpUrls.affiliateApproval, {params:data}).then(
(rv: any) => {
if(boolean){
message.success('同意成功~')
}else{
message.success('拒绝成功~')
}
this.gettrialList();
}
);
},
setState(){
this.currentState.state = true
},
setStateItem(item:any){
this.currentState = item
this.currentState.state = false
},
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_content .operate_list{
justify-content: space-between;
}
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div class="itemAffiliateDetail" ref="itemAffiliateDetail"></div>
<a-modal class="generalModel"
v-model:visible="itemAffiliateDetailShow"
:footer="null"
:get-container="() => $refs.itemAffiliateDetail"
width="75%"
:maskClosable="false"
:centered="true"
:closable="false"
:mask="true"
wrapClassName="#app"
>
<div class="generalModel_btn">
<div class="generalModel_closeIcon" @click.stop="cancelDsign()">
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="23" cy="23" r="23" fill="white" fill-opacity="0.3"/>
<rect x="32.5063" y="12" width="3" height="29" rx="1.5" transform="rotate(45 32.5063 12)" fill="white"/>
<rect x="34.6274" y="32.5059" width="3" height="29" rx="1.5" transform="rotate(135 34.6274 32.5059)" fill="white"/>
</svg>
</div>
</div>
<div class="admin_page">
<div class="admin_state_item">
<span>Start Time:</span>
<a-range-picker
style="width:280px"
class="range_picker"
v-model:value="rangePickerValue"
:allowClear="false"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
valueFormat="YYYY-MM-DD"
>
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
<div class="gallery_btn" @click="getDetailList" style="margin-left: 2rem;">Search</div>
</div>
<div class="itemAffiliateDetail_content generalModel_table_content" ref="historyTable">
<a-table
:columns="columns"
:data-source="collectionList"
:scroll="{ y: 200 }"
@change="changePage"
:pagination="{
showSizeChanger: true,
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
}"
>
</a-table>
</div>
</div>
</a-modal>
<div class="mark_loading" v-show="loadingShow">
<a-spin size="large" />
</div>
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed, reactive, toRefs, nextTick } from "vue";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
export default defineComponent({
components: {
},
setup() {
let renameData: any = ref({}); //修改名字选中的数据
const itemAffiliateDom = reactive({
historyTable:null as any,
})
const itemAffiliateDetail = reactive({
itemAffiliateDetailShow:false,
loadingShow:false,
rangePickerValue:[] as any,
itemId:-1,
collectionList:[],
currentPage: 1,
pageSize: 10,
order:'',
total: 0,
historyTableHeight:0,
columns:computed(() => {
return [
{
title: 'Id',
align: "center",
width: 50,
dataIndex: "accountId",
key: "accountId",
fixed: "left",
},{
title: 'User Name',
key: "username",
dataIndex: "username",
align: "center",
width: 150,
},
{
title: 'Time',
align: "center",
width: 200,
dataIndex: "time",
key: "time",
sorter: true,
},{
title: 'First Subscription Payment Amount',
align: "center",
width: 200,
dataIndex: "firstSubscriptionPaymentAmount",
key: "firstSubscriptionPaymentAmount",
},{
title: 'Commission',
align: "center",
ellipsis: true,
width: 150,
dataIndex: "commission",
key: "commission",
fixed: "right",
}
];
})
})
const init = (value:any)=>{
itemAffiliateDetail.itemAffiliateDetailShow = true
getCurrentMonthStart(value.type)
nextTick(()=>{
itemAffiliateDetail.historyTableHeight = itemAffiliateDom.historyTable.clientHeight - 40;
itemAffiliateDetail.itemId = value.id
getDetailList()
})
}
const cancelDsign = () =>{
itemAffiliateDetail.itemAffiliateDetailShow = false
itemAffiliateDetail.loadingShow = false
}
const getCurrentMonthStart = (type:any) => {
const now = new Date(); // 获取当前日期
const year = now.getFullYear(); // 获取当前年份
const month = now.getMonth(); // 获取当前月份0 - 11
let startOfPeriod:any, endOfPeriod:any;
if (type === 'month') {
startOfPeriod = new Date(year, month, 1);
endOfPeriod = new Date(year, month + 1, 0); // 下个月的第0天即为当前月的最后一天
startOfPeriod.setHours(0, 0, 0, 0);
endOfPeriod.setHours(23, 59, 59, 999); // 设置为最后一天的23:59:59.999
} else if (type === 'year') {
startOfPeriod = new Date(year, 0, 1);
endOfPeriod = new Date(year, 11, 31);
}
const formatDate = (date:any) => {
return date.getFullYear() + '-' +
String(date.getMonth() + 1).padStart(2, '0') + '-' +
String(date.getDate()).padStart(2, '0') + ' ' +
String(date.getHours()).padStart(2, '0') + ':' +
String(date.getMinutes()).padStart(2, '0') + ':' +
String(date.getSeconds()).padStart(2, '0');
};
if (type === 'month')itemAffiliateDetail.rangePickerValue = [formatDate(startOfPeriod),formatDate(endOfPeriod)]
}
const changePage = (e: any, filters:any, sorter:any)=>{
itemAffiliateDetail.currentPage = e.current;
itemAffiliateDetail.pageSize = e.pageSize;
itemAffiliateDetail.order = sorter.order == "descend" ? "DESC" : "ASC";
getDetailList();
}
const getDetailList = ()=>{
itemAffiliateDetail.loadingShow = true
let startDate: any = itemAffiliateDetail.rangePickerValue?.[0]
? itemAffiliateDetail.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = itemAffiliateDetail.rangePickerValue?.[1]
? itemAffiliateDetail.rangePickerValue[1]+' '+'00:00:00'
: "";
let data = {
affiliateId:itemAffiliateDetail.itemId,
endTime:endDate,
startTime:startDate,
order:itemAffiliateDetail.order,
page: itemAffiliateDetail.currentPage,
size: itemAffiliateDetail.pageSize,
}
Https.axiosPost(Https.httpUrls.getEachAffiliateGeneratedRevenue,data).then((rv:any)=>{
console.log(rv);
itemAffiliateDetail.collectionList = rv.records
itemAffiliateDetail.loadingShow = false
itemAffiliateDetail.total=rv.total
}).catch((err:any)=>{
itemAffiliateDetail.loadingShow = false
})
}
return {
...toRefs(itemAffiliateDom),
...toRefs(itemAffiliateDetail),
init,
cancelDsign,
changePage,
getDetailList,
};
},
});
</script>
<style lang="less" scoped>
.itemAffiliateDetail{
.itemAffiliateDetail_content{
margin-top: 2rem;
}
.admin_page .admin_table_content .operate_list{
justify-content: space-between;
}
}
</style>

View File

@@ -88,7 +88,7 @@
class="admin_state_list_item"
@click="lastGeTrialList('year')"
>
Last year
Nearly a year
</div>
<div
class="admin_state_list_item"

View File

@@ -41,7 +41,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -28,7 +28,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -29,7 +29,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -32,7 +32,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -32,7 +32,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -63,7 +63,7 @@
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Last year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>

View File

@@ -41,7 +41,7 @@
<div
v-show="status == 0"
class="operate_item"
@click="setAagree(record, index)"
@click="setAgree(record, index)"
>
agree
</div>
@@ -67,7 +67,6 @@
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed } from "vue";
import { setCookie, getCookie, WriteCookie } from "@/tool/cookie";
import { Https } from "@/tool/https";
import { Modal, message } from "ant-design-vue";
export default defineComponent({
@@ -184,14 +183,12 @@ export default defineComponent({
},
])
let collectionList: any = ref([]);
let userInfo: any = {};
let status: any = ref(0);
let voluntarily: any = ref(false);
return {
columns,
collectionList,
renameData,
userInfo,
status,
currentState,
state,
@@ -214,8 +211,6 @@ export default defineComponent({
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
let userInfo:any = getCookie("userInfo")
this.userInfo = JSON.parse(userInfo);
this.getIsAutoApproval()
},
methods: {

View File

@@ -2,10 +2,34 @@
<div class="recentNewUserChart admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Select Time:</span>
<a-range-picker
style="width:250px"
class="range_picker"
v-model:value="rangePickerValue"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
valueFormat="YYYY-MM-DD"
>
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
</div>
</div>
<div class="admin_search">
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>
</div>
<div class="admin_table_content" ref="pageChartDom"></div>
@@ -43,9 +67,34 @@ export default defineComponent({
let searchHistoryList = () => {
gettrialList();
};
let lastGeTrialList = (str:string)=>{
let currentDate = new Date();
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
// 计算30天前的时间戳
let thirtyDaysAgoTimestamp
if(str == 'year'){
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
}else if(str == 'month'){
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
}else if(str == 'week'){
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
}
filterData.rangePickerValue = [formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD'),formatTime(currentTimestamp,'YYYY-MM-DD')]
gettrialList();
}
//获取列表
let gettrialList = async () => {
Https.axiosGet(Https.httpUrls.conversionRate).then((rv: any) => {
let startDate: any = filterData.rangePickerValue?.[0]
? filterData.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = filterData.rangePickerValue?.[1]
? filterData.rangePickerValue[1]+' '+'00:00:00'
: "";
let data = {
endTime:endDate,
startTime:startDate,
}
Https.axiosGet(Https.httpUrls.conversionRate,{params:data}).then((rv: any) => {
if (rv) {
let entries:any = Object.entries(rv);
let data: any = [];
@@ -99,7 +148,8 @@ export default defineComponent({
},
legend: {
top: '10%',
left: 'center'
left: 'center',
// formatter: '{a} <br/>{b}'
},
series: [
{
@@ -120,10 +170,10 @@ export default defineComponent({
show: true,
fontSize: 30,
fontWeight: 'bold'
}
},
},
labelLine: {
show: false
show: false,
},
data: data
}
@@ -141,6 +191,7 @@ export default defineComponent({
return {
...toRefs(filter),
...toRefs(filterData),
lastGeTrialList,
searchHistoryList,
gettrialList,
pageChartDom,

View File

@@ -1,11 +1,35 @@
<template>
<div class="recentNewUserChart admin_page">
<div class="admin_table_search">
<div class="admin_state">
</div>
<div class="admin_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Select Time:</span>
<a-range-picker
style="width:250px"
class="range_picker"
v-model:value="rangePickerValue"
:placeholder="[
$t('HistoryPage.StartDate'),
$t('HistoryPage.EndDate'),
]"
valueFormat="YYYY-MM-DD"
>
<template #suffixIcon>
<span
class="icon iconfont range_picker_icon icon-rili"
></span>
</template>
</a-range-picker>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
</div>
<div class="admin_state_list">
<div class="admin_state_list_item" @click="lastGeTrialList('year')">Nearly a year</div>
<div class="admin_state_list_item" @click="lastGeTrialList('month')">Last month</div>
<div class="admin_state_list_item" @click="lastGeTrialList('week')">Last week</div>
</div>
</div>
<div class="admin_table_content" ref="pageChartDom"></div>
@@ -61,9 +85,34 @@ export default defineComponent({
let searchHistoryList = () => {
gettrialList();
};
let lastGeTrialList = (str:string)=>{
let currentDate = new Date();
let currentTimestamp = Math.floor(currentDate.getTime() / 1000);
// 计算30天前的时间戳
let thirtyDaysAgoTimestamp
if(str == 'year'){
thirtyDaysAgoTimestamp = currentTimestamp - (360 * 24 * 60 * 60);
}else if(str == 'month'){
thirtyDaysAgoTimestamp = currentTimestamp - (30 * 24 * 60 * 60);
}else if(str == 'week'){
thirtyDaysAgoTimestamp = currentTimestamp - (7 * 24 * 60 * 60);
}
filterData.rangePickerValue = [formatTime(thirtyDaysAgoTimestamp,'YYYY-MM-DD'),formatTime(currentTimestamp,'YYYY-MM-DD')]
gettrialList();
}
//获取列表
let gettrialList = async () => {
Https.axiosGet(Https.httpUrls.trialUserCountry).then((rv: any) => {
let startDate: any = filterData.rangePickerValue?.[0]
? filterData.rangePickerValue[0]+' '+'00:00:00'
: "";
let endDate: any = filterData.rangePickerValue?.[1]
? filterData.rangePickerValue[1]+' '+'00:00:00'
: "";
let data = {
endTime:endDate,
startTime:startDate,
}
Https.axiosGet(Https.httpUrls.trialUserCountry,{params:data}).then((rv: any) => {
if (rv) {
let data: any = [];
rv.names.forEach((item: any, index: number) => {
@@ -137,6 +186,7 @@ export default defineComponent({
return {
...toRefs(filter),
...toRefs(filterData),
lastGeTrialList,
state,
searchHistoryList,
gettrialList,