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

346 lines
9.8 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">
2024-08-05 16:16:08 +08:00
<span>Start Date:</span>
2024-03-15 09:21:17 +08:00
<a-range-picker
2024-08-23 10:19:02 +08:00
style="width:250px"
2024-03-15 09:21:17 +08:00
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">
2024-08-05 16:16:08 +08:00
<span>Start Time:</span>
2024-08-23 10:19:02 +08:00
<a-time-range-picker style="width:250px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
2024-03-15 09:21:17 +08:00
</div>
2024-08-23 10:19:02 +08:00
<div class="admin_state_item">
<span>Email:</span>
<input
v-model="email"
placeholder="Please enter email"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>User Name:</span>
<a-select
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
placeholder="Select Item..."
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div>
2024-03-15 09:21:17 +08:00
</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
2024-05-28 11:22:16 +08:00
@resizeColumn="handleResizeColumn"
2024-03-15 09:21:17 +08:00
: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-10-28 09:33:47 +08:00
import { useStore } from "vuex";
2024-03-05 10:33:29 +08:00
import { Https } from "@/tool/https";
export default defineComponent({
components: {
},
setup() {
2024-10-28 09:33:47 +08:00
const store:any = useStore()
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",
2024-03-15 09:21:17 +08:00
dataIndex: "userEmail",
key: "userEmail",
2024-11-08 10:37:46 +08:00
width:200,
fixed: "left",
2024-03-15 09:21:17 +08:00
},
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
2024-11-08 10:37:46 +08:00
width:100,
},
{
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",
2024-11-08 10:37:46 +08:00
width:100,
// 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",
2024-11-08 10:37:46 +08:00
width:100,
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",
2024-11-08 10:37:46 +08:00
width:100,
2024-04-22 13:15:18 +08:00
},
{
title: 'Country',
align: "center",
ellipsis: true,
dataIndex: "country",
key: "country",
2024-11-08 10:37:46 +08:00
width:200,
2024-04-22 13:15:18 +08:00
},
{
title: 'Title',
align: "center",
ellipsis: true,
dataIndex: "title",
key: "title",
2024-11-08 10:37:46 +08:00
width:100,
2024-04-22 13:15:18 +08:00
},
{
title: 'Surname',
align: "center",
ellipsis: true,
dataIndex: "surname",
key: "surname",
2024-11-08 10:37:46 +08:00
width:150,
2024-04-22 13:15:18 +08:00
},
{
title: 'Given Name',
align: "center",
ellipsis: true,
dataIndex: "givenName",
key: "givenName",
2024-11-08 10:37:46 +08:00
width:100,
2024-04-22 13:15:18 +08:00
},
{
title: 'Create Time',
align: "center",
ellipsis: true,
2024-05-28 11:22:16 +08:00
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
2024-04-22 13:15:18 +08:00
dataIndex: "createTime",
key: "createTime",
2024-11-08 10:37:46 +08:00
width:200,
},
{
title: 'Credits',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "credits",
key: "credits",
width:100,
2024-04-22 13:15:18 +08:00
},
{
title: 'Occupation',
align: "center",
ellipsis: true,
2024-05-28 11:22:16 +08:00
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
2024-04-22 13:15:18 +08:00
dataIndex: "occupation",
key: "occupation",
2024-11-08 10:37:46 +08:00
width:100,
2024-04-22 13:15:18 +08:00
},
{
title: 'Trial Order Id',
align: "center",
ellipsis: true,
2024-05-28 11:22:16 +08:00
// width: 150,
// resizable: true,
2024-04-22 13:15:18 +08:00
dataIndex: "trialOrderId",
key: "trialOrderId",
2024-11-08 10:37:46 +08:00
width:100,
},
];
});
2024-10-28 09:33:47 +08:00
let allUserList: any = computed(()=>{
return store.state.adminPage.allUserList
})
2024-08-23 10:19:02 +08:00
let ids = ref([])
let email = ref('')
2024-03-15 09:21:17 +08:00
let dataList: any = ref([]);
let status: any = ref(0);
2024-08-23 10:19:02 +08:00
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 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-08-23 10:19:02 +08:00
allUserList,
ids,
email,
2024-03-05 10:33:29 +08:00
renameData,
status,
2024-08-23 10:19:02 +08:00
filterOption,
};
2024-03-05 10:33:29 +08:00
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
2024-05-28 11:22:16 +08:00
handleResizeColumn: (w:any, col:any) => {
col.width = w;
},
};
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
: "";
2024-08-23 10:19:02 +08:00
let ids = this.ids.join(',')
let data = {
2024-03-15 09:21:17 +08:00
endTime:endDate,
startTime:startDate,
2024-08-23 10:19:02 +08:00
ids:ids,
email:this.email,
}
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>
2024-08-23 10:19:02 +08:00
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>