|
|
@@ -1,138 +1,164 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <!-- <TableCommon :type="type" :query-data="queryData" :current-day-data="getDayData" :current-month-data="getMonthData"
|
|
|
- :current-all-data="getAllData" :get-personal-visits="getPersonalVisitsData" /> -->
|
|
|
+ <el-button type="primary">数据总表</el-button>
|
|
|
+ <PlatformTable :table-data="tableData" table-label="积分"/>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- import {
|
|
|
- getList,
|
|
|
- getMonthVisits,
|
|
|
- getPersonalVisits,
|
|
|
- getTodayVisits,
|
|
|
- getTotalVisits,
|
|
|
- } from '@/api/datamanagement/dataplatform';
|
|
|
+ // import {
|
|
|
+ // getList,
|
|
|
+ // getMonthVisits,
|
|
|
+ // getPersonalVisits,
|
|
|
+ // getTodayVisits,
|
|
|
+ // getTotalVisits,
|
|
|
+ // } from '@/api/datamanagement/dataplatform';
|
|
|
// import TableCommon from './TableCommon.vue';
|
|
|
import { ref } from 'vue';
|
|
|
- import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
- const type = ref('积分');
|
|
|
+ // import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
+ import PlatformTable from '../common/PlatformTable.vue';
|
|
|
+ import { TableModel } from '../query/Query.vue';
|
|
|
+
|
|
|
+ const tableData = ref<TableModel[]>([
|
|
|
+ {
|
|
|
+ deptId: 1,
|
|
|
+ deptName: '部门1',
|
|
|
+ monthVisits: 1,
|
|
|
+ nickName: '张三',
|
|
|
+ staffNo: '10001',
|
|
|
+ todayVisits: 1,
|
|
|
+ totalVisits: 1,
|
|
|
+ userId: 10014,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ deptId: 2,
|
|
|
+ deptName: '部门2',
|
|
|
+ monthVisits: 2,
|
|
|
+ nickName: '李四',
|
|
|
+ staffNo: '10002',
|
|
|
+ todayVisits: 2,
|
|
|
+ totalVisits: 2,
|
|
|
+ userId: 10014,
|
|
|
+ },
|
|
|
+ ]);
|
|
|
|
|
|
- // 查询数据列表
|
|
|
- function queryData(pageNumber: number, pageSize: number) {
|
|
|
- return getList(pageNumber, pageSize)
|
|
|
- .then((res) => {
|
|
|
- console.log('table-querydata:', res);
|
|
|
- return res;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElMessageBox.alert(error, '异常', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- callback: () => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: `查询数据失败`,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- return Promise.reject();
|
|
|
- });
|
|
|
- }
|
|
|
+ // const type = ref('积分');
|
|
|
+ // // 查询数据列表
|
|
|
+ // function queryData(pageNumber: number, pageSize: number) {
|
|
|
+ // return getList(pageNumber, pageSize)
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log('table-querydata:', res);
|
|
|
+ // return res;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElMessageBox.alert(error, '异常', {
|
|
|
+ // confirmButtonText: 'OK',
|
|
|
+ // callback: () => {
|
|
|
+ // ElMessage({
|
|
|
+ // type: 'info',
|
|
|
+ // message: `查询数据失败`,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // return Promise.reject();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
- // 查询今日访问次数
|
|
|
- function getDayData(userId: number) {
|
|
|
- return getTodayVisits(userId)
|
|
|
- .then((res) => {
|
|
|
- console.log('table-getdaydata:', res);
|
|
|
- return res;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElMessageBox.alert(error, '异常', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- callback: () => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: `查询数据失败`,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- return Promise.reject();
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 查询今日访问次数
|
|
|
+ // function getDayData(userId: number) {
|
|
|
+ // return getTodayVisits(userId)
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log('table-getdaydata:', res);
|
|
|
+ // return res;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElMessageBox.alert(error, '异常', {
|
|
|
+ // confirmButtonText: 'OK',
|
|
|
+ // callback: () => {
|
|
|
+ // ElMessage({
|
|
|
+ // type: 'info',
|
|
|
+ // message: `查询数据失败`,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // return Promise.reject();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
- // 查询本月访问次数
|
|
|
- function getMonthData(userId: number) {
|
|
|
- console.log('table-getmonthdata:', userId);
|
|
|
- return getMonthVisits(userId)
|
|
|
- .then((res) => {
|
|
|
- console.log('table-getmonthdata:', res);
|
|
|
- return res;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElMessageBox.alert(error, '异常', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- callback: () => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: `查询数据失败`,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- return Promise.reject();
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 查询本月访问次数
|
|
|
+ // function getMonthData(userId: number) {
|
|
|
+ // console.log('table-getmonthdata:', userId);
|
|
|
+ // return getMonthVisits(userId)
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log('table-getmonthdata:', res);
|
|
|
+ // return res;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElMessageBox.alert(error, '异常', {
|
|
|
+ // confirmButtonText: 'OK',
|
|
|
+ // callback: () => {
|
|
|
+ // ElMessage({
|
|
|
+ // type: 'info',
|
|
|
+ // message: `查询数据失败`,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // return Promise.reject();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
- // 查询累计访问次数
|
|
|
- function getAllData(userId: number) {
|
|
|
- return getTotalVisits(userId)
|
|
|
- .then((res) => {
|
|
|
- console.log('table-getalldata:', res);
|
|
|
- return res;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElMessageBox.alert(error, '异常', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- callback: () => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: `查询数据失败`,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- return Promise.reject();
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 查询累计访问次数
|
|
|
+ // function getAllData(userId: number) {
|
|
|
+ // return getTotalVisits(userId)
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log('table-getalldata:', res);
|
|
|
+ // return res;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElMessageBox.alert(error, '异常', {
|
|
|
+ // confirmButtonText: 'OK',
|
|
|
+ // callback: () => {
|
|
|
+ // ElMessage({
|
|
|
+ // type: 'info',
|
|
|
+ // message: `查询数据失败`,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // return Promise.reject();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
- // 查询个人访问次数-
|
|
|
- function getPersonalVisitsData(
|
|
|
- deptId: number,
|
|
|
- nickName: string,
|
|
|
- pageNumber: number,
|
|
|
- pageSize: number,
|
|
|
- staffNo: string,
|
|
|
- ) {
|
|
|
- console.log('table-getPersonalVisitsData-deptid', deptId);
|
|
|
- console.log('table-getPersonalVisitsData-nama', nickName);
|
|
|
- console.log('table-getPersonalVisitsData', pageNumber, pageSize);
|
|
|
- console.log('table-getPersonalVisitsData-staffno', staffNo);
|
|
|
- return getPersonalVisits(pageNumber, pageSize, staffNo, deptId, nickName)
|
|
|
- .then((res) => {
|
|
|
- console.log('table-getPersonalVisitsData:', res);
|
|
|
- return res;
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElMessageBox.alert(error, '异常', {
|
|
|
- confirmButtonText: 'OK',
|
|
|
- callback: () => {
|
|
|
- ElMessage({
|
|
|
- type: 'info',
|
|
|
- message: `查询数据失败`,
|
|
|
- });
|
|
|
- },
|
|
|
- });
|
|
|
- return Promise.reject();
|
|
|
- });
|
|
|
- }
|
|
|
+ // // 查询个人访问次数-
|
|
|
+ // function getPersonalVisitsData(
|
|
|
+ // deptId: number,
|
|
|
+ // nickName: string,
|
|
|
+ // pageNumber: number,
|
|
|
+ // pageSize: number,
|
|
|
+ // staffNo: string,
|
|
|
+ // ) {
|
|
|
+ // console.log('table-getPersonalVisitsData-deptid', deptId);
|
|
|
+ // console.log('table-getPersonalVisitsData-nama', nickName);
|
|
|
+ // console.log('table-getPersonalVisitsData', pageNumber, pageSize);
|
|
|
+ // console.log('table-getPersonalVisitsData-staffno', staffNo);
|
|
|
+ // return getPersonalVisits(pageNumber, pageSize, staffNo, deptId, nickName)
|
|
|
+ // .then((res) => {
|
|
|
+ // console.log('table-getPersonalVisitsData:', res);
|
|
|
+ // return res;
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElMessageBox.alert(error, '异常', {
|
|
|
+ // confirmButtonText: 'OK',
|
|
|
+ // callback: () => {
|
|
|
+ // ElMessage({
|
|
|
+ // type: 'info',
|
|
|
+ // message: `查询数据失败`,
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // return Promise.reject();
|
|
|
+ // });
|
|
|
+ // }
|
|
|
</script>
|
|
|
|
|
|
-<style scoped></style>
|
|
|
+<style scoped>
|
|
|
+</style>
|