|
|
@@ -139,6 +139,7 @@
|
|
|
getUserDailyVisitTimes,
|
|
|
} from '@/api/datamanagement/dataplatform';
|
|
|
import { formatWorkshopChart, formatTimeChart } from '@/utils/platformUtils';
|
|
|
+ import { PaginationRequest } from '@/types/common/type';
|
|
|
|
|
|
const queryTableRef = ref();
|
|
|
|
|
|
@@ -151,16 +152,20 @@
|
|
|
}>();
|
|
|
|
|
|
// 表格查询参数和修改事件
|
|
|
- const tableQueryParams = ref<UserAccessRecordQueryParams>({
|
|
|
+ const tableQueryParams = ref<PaginationRequest & { queryParam: UserAccessRecordQueryParams }>({
|
|
|
pageNumber: 1,
|
|
|
pageSize: 10,
|
|
|
+ queryParam: {},
|
|
|
// nickname: "",
|
|
|
// username: "",
|
|
|
// sortKey: "",
|
|
|
// sortType: "",
|
|
|
});
|
|
|
const emits = defineEmits<{
|
|
|
- (e: 'tableParamsChanged', parmas: UserAccessRecordQueryParams);
|
|
|
+ (
|
|
|
+ e: 'tableParamsChanged',
|
|
|
+ parmas: PaginationRequest & { queryParam: UserAccessRecordQueryParams },
|
|
|
+ );
|
|
|
}>();
|
|
|
|
|
|
// 页码导航栏修改事件
|
|
|
@@ -176,11 +181,11 @@
|
|
|
// 表格排序事件
|
|
|
const handleSortChange = (data: any) => {
|
|
|
if (data.order !== null) {
|
|
|
- tableQueryParams.value.sortKey = data.prop;
|
|
|
- tableQueryParams.value.sortType = data.order.includes('a') ? 'asc' : 'desc';
|
|
|
+ tableQueryParams.value.queryParam.sortKey = data.prop;
|
|
|
+ tableQueryParams.value.queryParam.sortType = data.order.includes('a') ? 'asc' : 'desc';
|
|
|
} else {
|
|
|
- delete tableQueryParams.value.sortKey;
|
|
|
- delete tableQueryParams.value.sortType;
|
|
|
+ delete tableQueryParams.value.queryParam.sortKey;
|
|
|
+ delete tableQueryParams.value.queryParam.sortType;
|
|
|
}
|
|
|
tableQueryParams.value.pageNumber = 1;
|
|
|
emits('tableParamsChanged', tableQueryParams.value);
|
|
|
@@ -190,25 +195,25 @@
|
|
|
const tableQueryType = ref<string>('姓名');
|
|
|
const handleTableQueryTypeChange = (v: string) => {
|
|
|
if (v === '姓名') {
|
|
|
- delete tableQueryParams.value.staffNo;
|
|
|
+ delete tableQueryParams.value.queryParam.staffNo;
|
|
|
} else {
|
|
|
- delete tableQueryParams.value.nickname;
|
|
|
+ delete tableQueryParams.value.queryParam.nickname;
|
|
|
}
|
|
|
tableQueryTypeContent.value = '';
|
|
|
};
|
|
|
|
|
|
// 部门筛选框变化
|
|
|
const handleDeptChange = (v: string) => {
|
|
|
- tableQueryParams.value.deptId = v;
|
|
|
+ tableQueryParams.value.queryParam.deptId = v;
|
|
|
};
|
|
|
|
|
|
// 复用输入框绑定内容、提交事件、重置事件
|
|
|
const tableQueryTypeContent = ref<string>();
|
|
|
function submitTableQuery() {
|
|
|
if (tableQueryType.value === '姓名') {
|
|
|
- tableQueryParams.value.nickname = tableQueryTypeContent.value;
|
|
|
+ tableQueryParams.value.queryParam.nickname = tableQueryTypeContent.value;
|
|
|
} else {
|
|
|
- tableQueryParams.value.staffNo = tableQueryTypeContent.value;
|
|
|
+ tableQueryParams.value.queryParam.staffNo = tableQueryTypeContent.value;
|
|
|
}
|
|
|
emits('tableParamsChanged', tableQueryParams.value);
|
|
|
}
|
|
|
@@ -219,6 +224,7 @@
|
|
|
tableQueryParams.value = {
|
|
|
pageNumber: 1,
|
|
|
pageSize: 10,
|
|
|
+ queryParam: {},
|
|
|
};
|
|
|
emits('tableParamsChanged', tableQueryParams.value);
|
|
|
}
|