|
|
@@ -1,164 +1,84 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <el-button type="primary">数据总表</el-button>
|
|
|
- <PlatformTable :table-data="tableData" table-label="积分"/>
|
|
|
+ <el-button type="primary" @click="onOpenScoreChart">数据总表</el-button>
|
|
|
+ <ScoreTable
|
|
|
+ v-if="tableData !== undefined"
|
|
|
+ :department-list="departmentList"
|
|
|
+ :table-data="tableData"
|
|
|
+ @table-params-changed="
|
|
|
+ (v) => {
|
|
|
+ tableQueryParams = v;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ />
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialogVisible"
|
|
|
+ width="1000px"
|
|
|
+ title="dialogTitle"
|
|
|
+ :close-on-click-modal="true"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div>各分数段所对应人数折线图</div>
|
|
|
+ <!-- <LineChart :chart-data="chartData.val" :chart-lable="chartData.label" /> -->
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
- // 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';
|
|
|
- import PlatformTable from '../common/PlatformTable.vue';
|
|
|
- import { TableModel } from '@/api/datamanagement/dataplatform';
|
|
|
-
|
|
|
- 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,
|
|
|
- },
|
|
|
- ]);
|
|
|
+ import {
|
|
|
+ type ScoreTableRecord,
|
|
|
+ type ScoreTableQueryBody,
|
|
|
+ getScoreTable,
|
|
|
+ } from '@/api/datamanagement/dataplatform';
|
|
|
+ import { ref, onMounted, watch } from 'vue';
|
|
|
+ import { useSceneInfos } from '@/hooks/useSceneInfos';
|
|
|
+ import ScoreTable from '../common/ScoreTable.vue';
|
|
|
+ // import LineChart from '../../charts/LineChart.vue';
|
|
|
+ import { deptTreeList } from '@/api/auth/dept';
|
|
|
+ // import { formatWorkshopChart, formatTimeChart } from '@/utils/platformUtils';
|
|
|
|
|
|
- // 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();
|
|
|
- // });
|
|
|
- // }
|
|
|
+ const departmentList = ref<any[]>([]);
|
|
|
|
|
|
- // // 查询今日访问次数
|
|
|
- // 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();
|
|
|
- // });
|
|
|
- // }
|
|
|
+ // 下拉菜单车间列表数据
|
|
|
+ const sceneInfos = useSceneInfos();
|
|
|
+ const { getScenesTree, calculateTreeData } = sceneInfos;
|
|
|
+ onMounted(() => {
|
|
|
+ getScenesTree({ level: 1, valueKey: 'code', labelKey: 'name', disabled: true });
|
|
|
+ deptTreeList().then((res) => {
|
|
|
+ departmentList.value = calculateTreeData(
|
|
|
+ res,
|
|
|
+ { level: 3, valueKey: 'deptId', labelKey: 'deptName' },
|
|
|
+ 1,
|
|
|
+ );
|
|
|
+ });
|
|
|
+ });
|
|
|
|
|
|
- // // 查询本月访问次数
|
|
|
- // 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();
|
|
|
- // });
|
|
|
- // }
|
|
|
+ // dialog显示
|
|
|
+ const dialogVisible = ref(false);
|
|
|
+ const onOpenScoreChart = () => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+ };
|
|
|
|
|
|
- // // 查询累计访问次数
|
|
|
- // 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();
|
|
|
- // });
|
|
|
- // }
|
|
|
+ // 请求表格数据
|
|
|
+ const tableQueryParams = ref<ScoreTableQueryBody>({
|
|
|
+ pageNumber: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
+ const tableData = ref<ScoreTableRecord>();
|
|
|
|
|
|
- // // 查询个人访问次数-
|
|
|
- // 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();
|
|
|
- // });
|
|
|
- // }
|
|
|
+ watch(
|
|
|
+ () => tableQueryParams.value,
|
|
|
+ async () => {
|
|
|
+ getScoreTable(tableQueryParams.value).then((res) => {
|
|
|
+ tableData.value = res;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ },
|
|
|
+ );
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
-</style>
|
|
|
+<style scoped></style>
|