Files
aida_front/src/component/Administrator/TestClickData.vue

283 lines
7.6 KiB
Vue
Raw Normal View History

2024-03-05 10:33:29 +08:00
<template>
2024-03-15 09:21:17 +08:00
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>State:</span>
<a-range-picker
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 class="admin_state_item">
<span>Time:</span>
<a-time-range-picker class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
</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="dataList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
:pagination="{
showSizeChanger: true,
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
}"
>
</a-table>
</div>
2024-03-05 10:33:29 +08:00
</div>
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed } from "vue";
2024-03-05 10:33:29 +08:00
import { Https } from "@/tool/https";
export default defineComponent({
components: {
},
setup() {
let rangePickerValue: any = ref([]);
2024-03-15 09:21:17 +08:00
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: 'Email',
align: "center",
ellipsis: true,
2024-03-15 09:21:17 +08:00
dataIndex: "userEmail",
key: "userEmail",
},
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
},
{
2024-03-15 09:21:17 +08:00
title: 'User Name',
align: "center",
ellipsis: 200,
2024-03-15 09:21:17 +08:00
dataIndex: "userName",
key: "userName",
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
2024-03-15 09:21:17 +08:00
title: 'isTrial',
align: "center",
ellipsis: true,
2024-03-15 09:21:17 +08:00
dataIndex: "isTrial",
key: "isTrial",
customRender: (record: any) => {
let str
2024-03-15 09:21:17 +08:00
if(record.value == 1){
str ='Yes'
}else{
str ='No'
}
return str;
},
},
{
2024-03-15 09:21:17 +08:00
title: 'Frequency',
align: "center",
ellipsis: true,
2024-04-22 13:15:18 +08:00
dataIndex: "designTimes",
key: "designTimes",
},
{
title: 'Country',
align: "center",
ellipsis: true,
dataIndex: "country",
key: "country",
},
{
title: 'Title',
align: "center",
ellipsis: true,
dataIndex: "title",
key: "title",
},
{
title: 'Surname',
align: "center",
ellipsis: true,
dataIndex: "surname",
key: "surname",
},
{
title: 'Given Name',
align: "center",
ellipsis: true,
dataIndex: "givenName",
key: "givenName",
},
{
title: 'Create Time',
align: "center",
ellipsis: true,
dataIndex: "createTime",
key: "createTime",
},
{
title: 'Occupation',
align: "center",
ellipsis: true,
dataIndex: "occupation",
key: "occupation",
},
{
title: 'Trial Order Id',
align: "center",
ellipsis: true,
dataIndex: "trialOrderId",
key: "trialOrderId",
},
];
});
let state:any = ref([
{
name:'all',
value:'',
},
{
name:'unprocessed',
value:0,
},
{
name:'pending',
value:1,
},
{
name:'rejected',
value:2,
},
])
2024-03-15 09:21:17 +08:00
let dataList: any = ref([]);
let status: any = ref(0);
2024-03-05 10:33:29 +08:00
return {
rangePickerValue,
2024-03-15 09:21:17 +08:00
rangeTimeValue,
2024-03-05 10:33:29 +08:00
columns,
2024-03-15 09:21:17 +08:00
dataList,
2024-03-05 10:33:29 +08:00
renameData,
status,
state,
};
2024-03-05 10:33:29 +08:00
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
};
2024-03-05 10:33:29 +08:00
},
mounted() {
let historyTable: any = this.$refs.historyTable;
2024-04-22 13:15:18 +08:00
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
2024-03-05 10:33:29 +08:00
},
methods: {
2024-03-05 10:33:29 +08:00
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
2024-03-15 09:21:17 +08:00
// this.gettrialList();
2024-03-05 10:33:29 +08:00
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
2024-03-05 10:33:29 +08:00
},
//获取列表
gettrialList() {
2024-03-15 09:21:17 +08:00
let startTime: any = this.rangeTimeValue[0]
? this.rangeTimeValue[0]
: '00:00:00';
let endTime: any = this.rangeTimeValue[1]
? this.rangeTimeValue[1]
: '00:00:00';
let startDate: any = this.rangePickerValue[0]
2024-03-15 09:21:17 +08:00
? this.rangePickerValue[0]+' '+startTime
: "";
let endDate: any = this.rangePickerValue[1]
2024-03-15 09:21:17 +08:00
? this.rangePickerValue[1]+' '+endTime
: "";
let data = {
2024-03-15 09:21:17 +08:00
endTime:endDate,
startTime:startDate,
}
Https.axiosGet(Https.httpUrls.getDesignStatistic,{params:data}).then((rv: any) => {
if (rv) {
2024-03-15 09:21:17 +08:00
this.dataList = rv
// this.workspaceItem.position = this.singleTypeList[0].label
2024-03-05 10:33:29 +08:00
}
})
},
2024-03-15 09:21:17 +08:00
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
2024-03-15 09:21:17 +08:00
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
2024-03-05 10:33:29 +08:00
</script>
<style lang="less">
</style>