个人管理员添加新查询参数

This commit is contained in:
李志鹏
2025-10-09 09:51:24 +08:00
parent 6619b1485b
commit 52a2a75752
3 changed files with 838 additions and 721 deletions

View File

@@ -1,12 +1,11 @@
<template>
<div class="test_cli admin_page">
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>{{ $t('admin.StartDate') }}:</span>
<span>{{ $t("admin.StartDate") }}:</span>
<a-range-picker
style="width:250px"
style="width: 250px"
class="range_picker"
v-model:value="rangePickerValue"
:placeholder="[
@@ -23,35 +22,56 @@
</a-range-picker>
</div>
<div class="admin_state_item">
<span>{{ $t('admin.StartTime') }}:</span>
<a-time-range-picker style="width:250px" :placeholder="[$t('admin.startTime'), $t('admin.endTime'),]" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
<span>{{ $t("admin.StartTime") }}:</span>
<a-time-range-picker
style="width: 250px"
:placeholder="[
$t('admin.startTime'),
$t('admin.endTime'),
]"
class="range_picker"
valueFormat="HH:mm:ss"
v-model:value="rangeTimeValue"
/>
</div>
<div class="admin_state_item">
<span>{{ $t('admin.Email') }}:</span>
<input
v-model="email"
:placeholder="$t('admin.enterEmail')"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
<span>{{ $t("admin.Email") }}:</span>
<input
v-model="email"
:placeholder="$t('admin.enterEmail')"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
<div class="admin_state_item">
<span>{{ $t('admin.UserName') }}:</span>
<a-select
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
:placeholder="$t('admin.selectUserName')"
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div>
<span>{{ $t("admin.UserName") }}:</span>
<a-select
v-model:value="ids"
mode="multiple"
style="width: 250px"
:filter-option="filterOption"
:placeholder="$t('admin.selectUserName')"
max-tag-count="responsive"
:options="allUserList"
@keydown.enter="gettrialList"
></a-select>
</div>
<div class="admin_state_item">
<span>Organization Name:</span>
<input
v-model="organizationName"
placeholder="Please enter Organization Name"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">{{ $t('admin.search') }}</div>
<div class="admin_search_item" @click="searchHistoryList">
{{ $t("admin.search") }}
</div>
</div>
</div>
@@ -73,205 +93,207 @@
>
</a-table>
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, createVNode, computed } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { useI18n } from 'vue-i18n'
export default defineComponent({
components: {
},
setup() {
const store:any = useStore()
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const {t} = useI18n()
const columns: any = computed(() => {
return [
{
title: t('admin.Email'),
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width:200,
fixed: "left",
},
{
title: t('admin.UserId'),
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width:100,
},
{
title: t('admin.UserName'),
align: "center",
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width:100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: t('admin.Frequency'),
align: "center",
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width:100,
},
{
title: t('admin.CreateTime'),
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "createTime",
key: "createTime",
width:200,
},
{
title: t('admin.Credits'),
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "credits",
key: "credits",
width:100,
},
];
});
import { defineComponent, ref, createVNode, computed } from "vue";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { useI18n } from "vue-i18n";
export default defineComponent({
components: {},
setup() {
const store: any = useStore();
let rangePickerValue: any = ref([]);
let rangeTimeValue: any = ref([]);
let renameData: any = ref({}); //修改名字选中的数据
const { t } = useI18n();
const columns: any = computed(() => {
return [
{
title: t("admin.Email"),
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width: 200,
fixed: "left",
},
{
title: t("admin.UserId"),
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width: 100,
},
{
title: t("admin.UserName"),
align: "center",
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width: 100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: t("admin.Frequency"),
align: "center",
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width: 100,
},
{
title: t("admin.CreateTime"),
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "createTime",
key: "createTime",
width: 200,
},
{
title: t("admin.Credits"),
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "credits",
key: "credits",
width: 100,
},
];
});
let allUserList: any = computed(()=>{
return store.state.adminPage.allUserList
})
let ids = ref([])
let email = ref('')
let dataList: any = ref([]);
let status: any = ref(0);
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
return {
rangePickerValue,
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,
status,
filterOption,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
handleResizeColumn: (w:any, col:any) => {
col.width = w;
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]);
let email = ref("");
let dataList: any = ref([]);
let status: any = ref(0);
let organizationName: any = ref("");
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
return {
rangePickerValue,
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,
status,
filterOption,
organizationName,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
handleResizeColumn: (w: any, col: any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue?.[0]
? this.rangeTimeValue[0]
: '00:00:00';
let endTime: any = this.rangeTimeValue?.[1]
? this.rangeTimeValue[1]
: '23:59:59';
let startDate: any = this.rangePickerValue?.[0]
? this.rangePickerValue[0]+' '+startTime
: "";
let endDate: any = this.rangePickerValue?.[1]
? this.rangePickerValue[1]+' '+endTime
: "";
let ids = this.ids.join(',')
let data = {
endTime:endDate,
startTime:startDate,
ids:ids,
email:this.email.trim(),
}
Https.axiosGet(Https.httpUrls.getDesignStatistic,{params:data}).then((rv: any) => {
if (rv) {
this.dataList = rv
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
},
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue?.[0]
? this.rangeTimeValue[0]
: "00:00:00";
let endTime: any = this.rangeTimeValue?.[1]
? this.rangeTimeValue[1]
: "23:59:59";
let startDate: any = this.rangePickerValue?.[0]
? this.rangePickerValue[0] + " " + startTime
: "";
let endDate: any = this.rangePickerValue?.[1]
? this.rangePickerValue[1] + " " + endTime
: "";
let ids = this.ids.join(",");
let data = {
endTime: endDate,
startTime: startDate,
ids: ids,
email: this.email.trim(),
organizationName: this.organizationName,
};
Https.axiosGet(Https.httpUrls.getDesignStatistic, {
params: data,
}).then((rv: any) => {
if (rv) {
this.dataList = rv;
// this.workspaceItem.position = this.singleTypeList[0].label
}
});
},
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>

View File

@@ -1,12 +1,11 @@
<template>
<div class="test_cli admin_page">
<div class="test_cli admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Start Date:</span>
<a-range-picker
style="width:250px"
style="width: 250px"
class="range_picker"
v-model:value="rangePickerValue"
:placeholder="[
@@ -24,34 +23,51 @@
</div>
<div class="admin_state_item">
<span>Start Time:</span>
<a-time-range-picker style="width:250px" class="range_picker" valueFormat="HH:mm:ss" v-model:value="rangeTimeValue" />
<a-time-range-picker
style="width: 250px"
class="range_picker"
valueFormat="HH:mm:ss"
v-model:value="rangeTimeValue"
/>
</div>
<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>
<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>
<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>
<div class="admin_state_item">
<span>Organization Name:</span>
<input
v-model="organizationName"
placeholder="Please enter Organization Name"
@keydown.enter="gettrialList"
type="text"
style="width: 250px"
/>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">Search</div>
<div class="admin_search_item" @click="searchHistoryList">
Search
</div>
</div>
</div>
@@ -73,270 +89,272 @@
>
</a-table>
</div>
</div>
</div>
</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({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: 'Email',
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width:200,
fixed: "left",
},
{
title: 'User Id',
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width:100,
},
{
title: 'User Name',
align: "center",
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width:100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: 'isTrial',
align: "center",
ellipsis: true,
dataIndex: "isTrial",
key: "isTrial",
width:100,
customRender: (record: any) => {
let str
if(record.value == 1){
str ='Yes'
}else{
str ='No'
}
return str;
},
},
{
title: 'Frequency',
align: "center",
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width:100,
},
{
title: 'Country',
align: "center",
ellipsis: true,
dataIndex: "country",
key: "country",
width:200,
},
{
title: 'Title',
align: "center",
ellipsis: true,
dataIndex: "title",
key: "title",
width:100,
},
{
title: 'Surname',
align: "center",
ellipsis: true,
dataIndex: "surname",
key: "surname",
width:150,
},
{
title: 'Given Name',
align: "center",
ellipsis: true,
dataIndex: "givenName",
key: "givenName",
width:100,
},
{
title: 'Create Time',
align: "center",
ellipsis: 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',
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "occupation",
key: "occupation",
width:100,
},
{
title: 'Trial Order Id',
align: "center",
ellipsis: true,
// width: 150,
// resizable: true,
dataIndex: "trialOrderId",
key: "trialOrderId",
width:100,
},
];
});
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({}); //修改名字选中的数据
let organizationName: any = ref("");
const columns: any = computed(() => {
return [
{
title: "Email",
align: "center",
dataIndex: "userEmail",
key: "userEmail",
width: 200,
fixed: "left",
},
{
title: "User Id",
align: "center",
ellipsis: true,
dataIndex: "accountId",
key: "accountId",
width: 100,
},
{
title: "User Name",
align: "center",
ellipsis: 200,
dataIndex: "userName",
key: "userName",
width: 100,
// customRender: (record: any) => {
// let time = formatTime(
// record.text / 1000,
// "YYYY-MM-DD hh:mm:ss"
// );
// return time;
// },
},
{
title: "isTrial",
align: "center",
ellipsis: true,
dataIndex: "isTrial",
key: "isTrial",
width: 100,
customRender: (record: any) => {
let str;
if (record.value == 1) {
str = "Yes";
} else {
str = "No";
}
return str;
},
},
{
title: "Frequency",
align: "center",
ellipsis: true,
dataIndex: "designTimes",
key: "designTimes",
width: 100,
},
{
title: "Country",
align: "center",
ellipsis: true,
dataIndex: "country",
key: "country",
width: 200,
},
{
title: "Title",
align: "center",
ellipsis: true,
dataIndex: "title",
key: "title",
width: 100,
},
{
title: "Surname",
align: "center",
ellipsis: true,
dataIndex: "surname",
key: "surname",
width: 150,
},
{
title: "Given Name",
align: "center",
ellipsis: true,
dataIndex: "givenName",
key: "givenName",
width: 100,
},
{
title: "Create Time",
align: "center",
ellipsis: 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",
align: "center",
ellipsis: true,
// width: 150,
// minWidth: 100,
// maxWidth: 200,
// resizable: true,
dataIndex: "occupation",
key: "occupation",
width: 100,
},
{
title: "Trial Order Id",
align: "center",
ellipsis: true,
// width: 150,
// resizable: true,
dataIndex: "trialOrderId",
key: "trialOrderId",
width: 100,
},
];
});
let allUserList: any = computed(()=>{
return store.state.adminPage.allUserList
})
let ids = ref([])
let email = ref('')
let dataList: any = ref([]);
let status: any = ref(0);
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
return {
rangePickerValue,
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,
status,
filterOption,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
handleResizeColumn: (w:any, col:any) => {
col.width = w;
let allUserList: any = computed(() => {
return store.state.adminPage.allUserList;
});
let ids = ref([]);
let email = ref("");
let dataList: any = ref([]);
let status: any = ref(0);
let filterOption = (input: any, option: any) => {
// 使用 option.label 进行搜索
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
};
return {
rangePickerValue,
organizationName,
rangeTimeValue,
columns,
dataList,
allUserList,
ids,
email,
renameData,
status,
filterOption,
};
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
historyTableHeight: 0,
handleResizeColumn: (w: any, col: any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
this.gettrialList();
},
methods: {
//改变页码
changePage(e: any) {
this.currentPage = e.current;
this.pageSize = e.pageSize;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//查询列表
searchHistoryList() {
this.currentPage = 1;
this.gettrialList();
},
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue?.[0]
? this.rangeTimeValue?.[0]
: '00:00:00';
let endTime: any = this.rangeTimeValue[1]
? this.rangeTimeValue[1]
: '23:59:59';
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0]+' '+startTime
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1]+' '+endTime
: "";
let ids = this.ids.join(',')
let data = {
endTime:endDate,
startTime:startDate,
ids:ids,
email:this.email.trim(),
}
Https.axiosGet(Https.httpUrls.getDesignStatistic,{params:data}).then((rv: any) => {
if (rv) {
this.dataList = rv
// this.workspaceItem.position = this.singleTypeList[0].label
}
})
},
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
//获取列表
gettrialList() {
let startTime: any = this.rangeTimeValue?.[0]
? this.rangeTimeValue?.[0]
: "00:00:00";
let endTime: any = this.rangeTimeValue[1]
? this.rangeTimeValue[1]
: "23:59:59";
let startDate: any = this.rangePickerValue[0]
? this.rangePickerValue[0] + " " + startTime
: "";
let endDate: any = this.rangePickerValue[1]
? this.rangePickerValue[1] + " " + endTime
: "";
let ids = this.ids.join(",");
let data = {
endTime: endDate,
startTime: startDate,
ids: ids,
email: this.email.trim(),
organizationName: this.organizationName,
};
Https.axiosGet(Https.httpUrls.getDesignStatistic, {
params: data,
}).then((rv: any) => {
if (rv) {
this.dataList = rv;
// this.workspaceItem.position = this.singleTypeList[0].label
}
});
},
//删除分组
// deleteGroup(record: any, index: number) {
// let deleteGroupFun = (id: any, index: number) => {
// let data = {
// userGroupId: id,
// };
// Https.axiosPost(Https.httpUrls.deleteUserGroup, data).then(
// (rv: any) => {
// this.dataList.splice(index, 1);
// }
// );
// };
// Modal.confirm({
// title: "",
// icon: createVNode(ExclamationCircleOutlined),
// okText: "Yes",
// cancelText: "No",
// centered: true,
// mask: false,
// onOk() {
// deleteGroupFun(record.id, index);
// },
// });
// },
},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
</style>

View File

@@ -1,228 +1,305 @@
<template>
<div class="admin_page">
<div class="admin_table_search" >
<div class="admin_state">
<div class="admin_page">
<div class="admin_table_search">
<div class="admin_state">
<div class="admin_state_item">
<span>Status:</span>
<a-select
v-model:value="status"
size="large"
style="width: 250px"
optionFilterProp="label"
:options="statusList"
placeholder="Please select"
allowClear
show-search
></a-select>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">
Search
</div>
<div class="admin_search_item" @click="addhHistoryList">
Add
</div>
</div>
</div>
<div class="admin_table_content" ref="historyTable">
<a-table
@resizeColumn="handleResizeColumn"
:loading="tableLoading"
:columns="columns"
:data-source="dataList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
:showSorterTooltip='false'
:pagination="{
showSizeChanger: true,
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
}"
>
</a-table>
</div>
<span>Create 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 class="admin_state_item">
<span>Status:</span>
<a-select
v-model:value="status"
size="large"
style="width: 250px"
optionFilterProp="label"
:options="statusList"
placeholder="Please select"
@change="changeStatus"
allowClear
show-search
></a-select>
</div>
<div class="admin_state_item">
<span>School:</span>
<a-select
v-model:value="school"
size="large"
style="width: 250px"
optionFilterProp="label"
:options="schoolList"
placeholder="Please select"
allowClear
show-search
@focus="handleFocus"
></a-select>
</div>
</div>
<div class="admin_search">
<div class="admin_search_item" @click="searchHistoryList">
Search
</div>
<div class="admin_search_item" @click="addhHistoryList">
Add
</div>
</div>
</div>
<div class="admin_table_content" ref="historyTable">
<a-table
@resizeColumn="handleResizeColumn"
:loading="tableLoading"
:columns="columns"
:data-source="dataList"
:scroll="{ y: historyTableHeight }"
@change="changePage"
:showSorterTooltip="false"
:pagination="{
showSizeChanger: true,
current: currentPage,
pageSize: pageSize,
total: total,
showQuickJumper: true,
bordered: false,
}"
>
</a-table>
</div>
<add ref="add" @searchHistoryList="searchHistoryList"></add>
</div>
</div>
</template>
<script lang="ts">
import {
defineComponent,
ref,
createVNode,
computed,
reactive,
toRefs,
onMounted,
} from "vue";
import { formatTime } from "@/tool/util";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import {getCookie,clonAllCookie} from '@/tool/cookie'
import add from './add.vue'
export default defineComponent({
components: {add},
setup() {
const store:any = useStore()
let filter: any = reactive({
dataList: [],
tableLoading: false,
countryList: computed(()=>{
return store.state.adminPage.country
}),
add:null as any,
status:'',
});
let filterData: any = reactive({
currentPage: 1,
pageSize: 10,
total: 0,
country: "",
status: "",
type: "",
});
let selectList=reactive({
statusList:[
{
label: "all",
value: "",
import {
defineComponent,
ref,
createVNode,
computed,
reactive,
toRefs,
onMounted,
} from "vue";
import { formatTime } from "@/tool/util";
import { useStore } from "vuex";
import { Https } from "@/tool/https";
import { getCookie, clonAllCookie } from "@/tool/cookie";
import add from "./add.vue";
export default defineComponent({
components: { add },
setup() {
const store: any = useStore();
let filter: any = reactive({
dataList: [],
tableLoading: false,
countryList: computed(() => {
return store.state.adminPage.country;
}),
add: null as any,
});
let filterData: any = reactive({
currentPage: 1,
pageSize: 10,
total: 0,
country: "",
status: "",
school: "",
rangePickerValue: [],
});
let selectList = reactive({
statusList: [
{
label: "all",
value: "",
},
{
label: "Enterprise",
value: "Enterprise",
},
{
label: "Education",
value: "Education",
},
],
schoolList: [],
});
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: "Id",
align: "center",
dataIndex: "id",
key: "id",
width: 150,
ellipsis: true,
},
{
title: "Name",
align: "center",
dataIndex: "name",
key: "name",
width: 150,
ellipsis: true,
},
{
title: "Create Time",
align: "center",
dataIndex: "createTime",
key: "createTime",
width: 150,
ellipsis: true,
},
{
title: "Type",
align: "center",
dataIndex: "type",
key: "type",
width: 150,
ellipsis: true,
},
];
});
//改变页码
let changePage = (e: any, filters: any, sorter: any) => {
filterData.currentPage = e.current;
filterData.pageSize = e.pageSize;
gettrialList();
};
const filterOption = (e: any) => {
let type = filterData.status;
if (type == "Education") type = "School";
let params = {
name: e,
type,
};
Https.axiosPost(
Https.httpUrls.organizationNameSearch,
{},
{ params: params }
).then((rv: any) => {
if (rv.length == 0) return (selectList.schoolList = []);
selectList.schoolList = rv.map((item: any) => {
return {
label: item,
value: item,
};
});
});
};
//查询列表
let searchHistoryList = () => {
filterData.currentPage = 1;
gettrialList();
};
//获取列表
let gettrialList = () => {
filter.tableLoading = true;
const dateArr = filterData.rangePickerValue;
const startDate = dateArr?.[0] ? dateArr[0] + " " + "00:00:00" : "";
const endDate = dateArr?.[1] ? dateArr[1] + " " + "23:59:59" : "";
const params = {
startTime: startDate,
endTime: endDate,
id: "",
name: filterData.school,
type: filterData.status,
size: filterData.pageSize,
page: filterData.currentPage,
}; //type: "Enterprise"
Https.axiosPost(Https.httpUrls.queryOrganization, params).then(
(rv: any) => {
if (rv) {
console.log(rv);
// filter.dataList = rv;
filter.dataList = rv.records;
filterData.total = rv.total;
filter.tableLoading = false;
// this.workspaceItem.position = this.singleTypeList[0].label
}
}
);
};
let addhHistoryList = () => {
filter.add.init("Add", "");
};
const handleFocus = () => {
if (selectList.schoolList.length == 0) {
filterOption("");
}
};
const changeStatus = () => {
filterData.school = "";
selectList.schoolList = [];
};
onMounted(() => {
gettrialList();
});
return {
...toRefs(filter),
...toRefs(filterData),
...toRefs(selectList),
columns,
renameData,
changePage,
searchHistoryList,
gettrialList,
addhHistoryList,
handleFocus,
changeStatus,
};
},
data() {
return {
historyTableHeight: 0,
handleResizeColumn: (w: any, col: any) => {
col.width = w;
},
{
label:'Enterprise',
value:'Enterprise',
},
{
label:'Education',
value:'Education',
},
],
})
let renameData: any = ref({}); //修改名字选中的数据
const columns: any = computed(() => {
return [
{
title: "Id",
align: "center",
dataIndex: "id",
key: "id",
width:150,
ellipsis:true
},
{
title: "Name",
align: "center",
dataIndex: "name",
key: "name",
width:150,
ellipsis:true
},
{
title: "Create Time",
align: "center",
dataIndex: "createTime",
key: "createTime",
width:150,
ellipsis:true
},
{
title: "Type",
align: "center",
dataIndex: "type",
key: "type",
width:150,
ellipsis:true,
},
];
});
//改变页码
let changePage = (e: any, filters:any, sorter:any) => {
filterData.currentPage = e.current;
filterData.pageSize = e.pageSize;
gettrialList();
};
//查询列表
let searchHistoryList = () => {
filterData.currentPage = 1;
gettrialList();
};
//获取列表
let gettrialList = () => {
filter.tableLoading = true;
Https.axiosGet(Https.httpUrls.queryOrganization, {params:{type:'Enterprise'}}).then(
(rv: any) => {
if (rv) {
console.log(rv)
filter.dataList = rv
// filter.dataList = rv.content;
// filterData.total = rv.total;
filter.tableLoading = false;
// this.workspaceItem.position = this.singleTypeList[0].label
}
}
);
};
let addhHistoryList = () => {
filter.add.init('Add','')
};
onMounted(() => {
gettrialList();
});
return {
...toRefs(filter),
...toRefs(filterData),
...toRefs(selectList),
columns,
renameData,
changePage,
searchHistoryList,
gettrialList,
addhHistoryList,
};
},
data() {
return {
historyTableHeight: 0,
handleResizeColumn: (w: any, col: any) => {
col.width = w;
},
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
},
methods: {},
});
};
},
mounted() {
let historyTable: any = this.$refs.historyTable;
this.historyTableHeight = historyTable.clientHeight - 200;
},
methods: {},
});
</script>
<style lang="less" scoped>
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
:deep(.operate_list){
.fi{
font-size: 2rem;
margin-right: 1rem;
.admin_page .admin_table_search .admin_state {
display: flex;
flex-wrap: wrap;
}
.success{
.fi-ss-check-circle{
color: #3ab45c;
:deep(.operate_list) {
.fi {
font-size: 2rem;
margin-right: 1rem;
}
.success {
.fi-ss-check-circle {
color: #3ab45c;
}
}
.pending {
.fi-ss-check-circle {
color: #ffc628;
}
}
.fail {
.fi-ss-check-circle {
color: #ff0000;
}
}
}
.pending{
.fi-ss-check-circle{
color: #ffc628;
}
}
.fail{
.fi-ss-check-circle{
color: #ff0000;
}
}
}
</style>