Browse Source

feat: 添加平台数据接口

wyf 2 years ago
parent
commit
cdf7c4b0c2

+ 138 - 129
src/api/datamanagement/dataplatform.ts

@@ -1,143 +1,152 @@
 import { http } from '@/utils/http/axios';
 
-export interface Records {
-    deptId: number,
-    deptName: string,
-    monthVisits: number,
-    nickName: string,
-    staffNo: string,
-    todayVisits: number,
-    totalVisits: number,
-    userId: number
+/**
+ * @description: 获取用户访问记录接口参数
+ */
+export interface UserAccessRecordQuery {
+  /**
+   * @description: 页码
+   */
+  pageNumber: number;
+  /**
+   * @description: 页面大小
+   */
+  pageSize: number;
+  /**
+   * @description: 查询员工姓名
+   */
+  nickname?: string;
+  /**
+   * @description: 查询工号
+   */
+  username?: number;
+  /**
+   * @description: 查询部门ID
+   */
+  deptId?: string;
+  /**
+   * @description: 设置排序字段
+   */
+  sortKey?: string;
+  /**
+   * @description: 设置排序方式
+   */
+  sortType?: string;
 }
 
-export interface Visits<Records> {
-    pageNumber: number,
-    pageSize: number,
-    records: Records[],
-    totalPage: number,
-    totalRow: number
+/**
+ * @description: 用户访问记录表格数据
+ */
+export interface UserAccessRecord {
+  userId: number;
+  username: string;
+  nickname: string;
+  deptId: number;
+  deptName: string;
+  statisticDay: number;
+  statisticMonth: number;
+  statisticAll: number;
 }
 
-export interface MonthVisit {
-    visits: number,
-    workshopName: string,
+/**
+ * @description: 获取用户访问记录
+ */
+export const getUserAccessRecords = (data: UserAccessRecordQuery) => {
+  return http.request<UserAccessRecord[]>({
+    url: '/skyeye-admin-platform-api/getList',
+    method: 'get',
+    data,
+  });
+};
+
+/**
+ * @description: 绘图时间段&员工&车间查询参数
+ */
+export interface ChartQuery {
+  /**
+   * @description: 开始时间
+   */
+  startTime: Date;
+  /**
+   * @description: 结束时间
+   */
+  endTime: Date;
+  /**
+   * @description: 员工id
+  */
+  userId?: string;
+  /**
+   * @description: 车间id
+   */
+  workshopId?: string;
 }
 
-export interface DayVisit {
-    visits: number,
-    workshopName: string,
+/**
+ * @description: 车间被访问次数数据
+ */
+export interface WorkshopVisitedTimes {
+  workshopId: number;
+  workshopName: string;
+  count: number;
 }
 
-export interface AllVisit {
-    visits: number,
-    workshopName: string,
+/**
+ * @description: 获取车间被访问次数数据
+ */
+export const getWorkshopVisitedTimes = (data: ChartQuery) => {
+  return http.request<WorkshopVisitedTimes[]>({
+    url: '/skyeye-admin-platform-api/statisticByWorkshop ',
+    method: 'post',
+    params: data,
+  });
+};
+
+/**
+ * @description: 相机被访问次数数据
+ */
+export interface CameraVisitedTimes {
+  cameraCode: string;
+  cameraName: string;
+  count: number;
 }
 
-export interface VisitsModel {
-    workshopName: string,
-    visits: number,
+/**
+ * @description: 获取相机被访问次数数据
+ */
+export const getCameraVisitedTimes = (data: ChartQuery) => {
+  return http.request<CameraVisitedTimes[]>({
+    url: '/skyeye-admin-platform-api/statisticByCamera',
+    method: 'post',
+    params: data,
+  });
+};
+
+/**
+ * @description: 获取员工访问车间次数数据
+ */
+export const getUserVisitTimes = (data: ChartQuery) => {
+  return http.request<WorkshopVisitedTimes[]>({
+    url: '/skyeye-admin-platform-api/statisticByWorkshopPerUser ',
+    method: 'post',
+    params: data,
+  });
+};
+
+/**
+ * @description: 员工日访问车间次数数据
+ */
+export interface UserDailyVisitTimes {
+  time: string;
+  count: number;
 }
 
-export interface DepartMentModel {
-    createDate: string,
-    deptId: number,
-    deptName: string,
-    grade: number,
-    isEnable: boolean,
-    modifyDate: string,
-    orderNum: number,
-    parent: number,
-    treePath: string,
-}
-
-export interface TableModel {
-    deptId: number;
-    deptName: string;
-    monthVisits: number;
-    nickName: string;
-    staffNo: string;
-    todayVisits: number;
-    totalVisits: number;
-    userId: number;
-  }
-
-// 查询访问次数列表
-export function getList(pageNumber: number, pageSize: number) {
-    return http.request<Visits<Records>>({
-        url: '/platformData/getList',
-        method: 'get',
-        params: { pageNumber: pageNumber, pageSize: pageSize },
-    });
-}
-
-// 查询个人本月访问次数
-export function getMonthVisits(userId: number) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getMonthVisits',
-        method: 'get',
-        params: { userId: userId },
-    });
-}
-
-// 查询本月数据总表
-export function getMonthSumTable(deptIdList: []) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getMonthSumTable',
-        method: 'post',
-        params: { deptIdList: deptIdList },
-    });
-}
-
-// 查询个人访问次数
-export function getPersonalVisits(pageNumber: number, pageSize: number, staffNo?: string, deptId?: number, nickName?: string) {
-    return http.request<Visits<Records>>({
-        url: '/platformData/getPersonalVisits',
-        method: 'get',
-        params: { pageNumber: pageNumber, pageSize: pageSize, staffNo: staffNo, deptId: deptId, nickName: nickName },
-    });
-}
-
-// 查询今日访问次数
-export function getTodayVisits(userId: number) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getTodayVisits',
-        method: 'get',
-        params: { userId: userId },
-    });
-}
-
-// 查询今日数据总表
-export function getTodaySumTable(deptIdList: []) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getTodaySumTable',
-        method: 'post',
-        params: { deptIdList: deptIdList },
-    });
-}
-
-// 查询个人累计访问次数
-export function getTotalVisits(userId: number) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getTotalVisits',
-        method: 'get',
-        params: { userId: userId },
-    });
-}
-
-// 查询累计数据总表
-export function getTotalSumTable(deptIdList: []) {
-    return http.request<VisitsModel[]>({
-        url: '/platformData/getTotalSumTable',
-        method: 'post',
-        params: { deptIdList: deptIdList },
-    });
-}
-
-// 获取部门列表
-export function getDeptList() {
-    return http.request<DepartMentModel[]>({
-        url: '/platformData/getDeptList',
-        method: 'get',
-    })
-}
+/**
+ * @description: 获取员工日访问车间次数数据
+ */
+export const getUserDailyVisitTimes = (data: ChartQuery) => {
+  return http.request<UserDailyVisitTimes[]>({
+    url: '/skyeye-admin-platform-api/statisticByWorkshopPerDay',
+    method: 'post',
+    params: data,
+  });
+};

+ 0 - 1
src/views/datamanager/platformdata/PlatformData.vue

@@ -27,7 +27,6 @@
   import Score from './compoents/score/Score.vue';
 
   const activeName = ref('count');
-  export type LabelType = 'count' | 'score';
 </script>
 
 <style scoped lang="scss">

+ 14 - 51
src/views/datamanager/platformdata/compoents/common/DialogNavBar.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="timenation">
-    <div v-if="needWorkshop" class="workshop-select">
+    <div v-if="workshopList !== undefined" class="workshop-select">
       <el-select
         v-model="selectedWorkshop"
         multiple
@@ -13,12 +13,7 @@
         <el-checkbox v-model="checkAll" :indeterminate="false" @change="handleCheckAll">
           全选
         </el-checkbox>
-        <el-option
-          v-for="shop in workshops"
-          :key="shop.value"
-          :label="shop.label"
-          :value="shop.value"
-        >
+        <el-option v-for="shop in workshopList" :key="shop.id" :label="shop.name" :value="shop.id">
           <!-- <el-checkbox :label="shop.label"> </el-checkbox> -->
         </el-option>
       </el-select>
@@ -47,30 +42,29 @@
   const dateRange = ref<Date[]>();
   const selectedWorkshop = ref<string[]>();
 
+  const props = defineProps<{
+    workshopList?: any[] | undefined;
+  }>();
+
+  const emits = defineEmits<{
+    (e: 'paramsChanged', parmas: DialogParams);
+  }>();
+
   export interface DialogParams {
     date: Date[] | undefined;
     workshops?: string[] | undefined;
   }
   const serchParams = ref<DialogParams>({
     date: undefined,
-    // workshops: undefined,
   });
 
-  const props = defineProps<{
-    needWorkshop: boolean;
-  }>();
-
-  const emits = defineEmits<{
-    (e: 'paramsChanged', parmas: DialogParams);
-  }>();
-
   const onSearch = () => {
     if (!dateRange.value) {
       ElMessage.error('请选择时间范围');
       return;
     }
     serchParams.value.date = dateRange.value;
-    if (props.needWorkshop) {
+    if (props.workshopList !== undefined) {
       if (!selectedWorkshop.value || !selectedWorkshop.value.length) {
         ElMessage.error('请至少选择一个车间');
         return;
@@ -103,40 +97,9 @@
     },
   ];
 
-  const workshops = [
-    {
-      value: '车间1',
-      label: '车间1',
-    },
-    {
-      value: '车间sskkccvnzzzzzz',
-      label: '车间sskkccvnzzzzzz',
-    },
-    {
-      value: '55669',
-      label: '55669',
-    },
-    {
-      value: '车间',
-      label: '车间',
-    },
-    {
-      value: '车间17896541236554123265849654',
-      label: '车间17896541236554123265849654',
-    },
-    {
-      value: 'workshop',
-      label: 'workshop',
-    },
-    {
-      value: '车间2',
-      label: '车间2',
-    },
-  ];
-
   const handleCheckAll = (val: boolean) => {
     if (val) {
-      selectedWorkshop.value = workshops.map((item) => item.value);
+      selectedWorkshop.value = props.workshopList!.map((item) => item.id);
     } else {
       selectedWorkshop.value = [];
     }
@@ -145,7 +108,7 @@
     () => selectedWorkshop.value,
     (val) => {
       if (val !== undefined) {
-        if (val.length === workshops.length) {
+        if (val.length === props.workshopList!.length) {
           checkAll.value = true;
         } else {
           checkAll.value = false;
@@ -156,7 +119,7 @@
   );
 
   onMounted(() => {
-    selectedWorkshop.value = workshops.map((item) => item.value);
+    selectedWorkshop.value = props.workshopList!.map((item) => item.id);
     dateRange.value = [new Date(0), new Date()];
   });
 </script>

+ 25 - 167
src/views/datamanager/platformdata/compoents/common/PlatformTable.vue

@@ -1,13 +1,6 @@
 <template>
   <div class="form">
     <el-form ref="ruleFormRef" :model="ruleForm" inline label-width="60px">
-      <!-- <el-form-item label="姓名:" prop="nickName" style="margin-top: 15px;">
-                <el-input v-model="ruleForm.nickName" placeholder="请输入姓名!" style="width: 150px;"></el-input>
-            </el-form-item>
-            <el-form-item label="工号:" prop="staffNo" style="margin-top: 15px;">
-                <el-input v-model="ruleForm.staffNo" placeholder="请输入工号!" style="width: 150px;"></el-input>
-            </el-form-item> -->
-
       <el-input
         v-model="searchValue"
         style="max-width: 251px; margin-right: 50px"
@@ -20,14 +13,21 @@
           </el-select>
         </template>
       </el-input>
-
       <el-form-item label="部门:" prop="dept" style="margin-bottom: 0; margin-right: 0">
-        <el-select v-model="ruleForm.dept" placeholder="请选择部门" style="width: 200px">
+        <el-select
+          multiple
+          clearable
+          collapse-tags
+          placeholder="请添加车间"
+          v-model="ruleForm.dept"
+          :max-collapse-tags="1"
+          style="width: 240px"
+        >
           <el-option
-            v-for="item in departmentList"
-            :key="item.deptId"
-            :value="item.deptName"
-            :label="item.deptName"
+            v-for="item in workshopList"
+            :key="item.id"
+            :value="item.id"
+            :label="item.name"
           >
           </el-option>
         </el-select>
@@ -41,26 +41,25 @@
         >
       </div>
     </el-form>
-
     <el-table style="width: 100%; margin-top: 18px" stripe :data="tableData" highlight-current-row>
-      <el-table-column label="姓名" prop="nickName" align="center"></el-table-column>
-      <el-table-column label="工号" prop="staffNo" align="center"></el-table-column>
+      <el-table-column label="姓名" prop="nickname" align="center"></el-table-column>
+      <el-table-column label="工号" prop="username" align="center"></el-table-column>
       <el-table-column label="部门" prop="deptName" align="center"></el-table-column>
       <el-table-column
         :label="'当日' + props.tableLabel"
-        prop="todayVisits"
+        prop="statisticDay"
         sortable
         align="right"
       ></el-table-column>
       <el-table-column
         :label="'本月' + tableLabel"
-        prop="monthVisits"
+        prop="statisticMonth"
         sortable
         align="right"
       ></el-table-column>
       <el-table-column
         :label="'累计' + tableLabel"
-        prop="totalVisits"
+        prop="statisticAll"
         sortable
         align="right"
       ></el-table-column>
@@ -81,38 +80,30 @@
         </template>
       </el-table-column>
     </el-table>
-
     <!-- <el-pagination v-model="currentPage" v-model:currentPageSize="currentPageSize" :page-sizes="[10, 20, 50, 100, 200]"
             layout="->, total,sizes,prev,pager,next,jumper" :total="total" @size-change="handeSizeChange"
             @current-change="handleCurrentPageChange" /> -->
   </div>
-
-  <!-- <TableEcharts v-model="dialogVisible" :dialog-visible="dialogVisible" :userId="userId"
-        :current-day-chart="currentDayData" :current-month-chart="currentMonthData" :all-datas-chart="currentAllData"
-        :close-dialog="closeDialog">
-    </TableEcharts> -->
-
   <el-dialog
     v-model="bargraphVisible"
     :title="bargraphTitle"
-    :close-on-click-modal="false"
+    :close-on-click-modal="true"
     :destroy-on-close="true"
     width="1000px"
     center
   >
-    <DialogNavBar :need-workshop="false" @params-changed="(v) => console.log(v)" />
+    <DialogNavBar @params-changed="(v) => console.log(v)" />
     <BarChart :chart-data="barData.val" :chart-lable="barData.label" />
   </el-dialog>
-
   <el-dialog
     v-model="linechartVisible"
     :title="linechartTitle"
-    :close-on-click-modal="false"
+    :close-on-click-modal="true"
     :destroy-on-close="true"
     width="1000px"
     center
   >
-    <DialogNavBar :need-workshop="true" @params-changed="(v) => console.log(v)" />
+    <DialogNavBar :workshop-list="workshopList" @params-changed="(v) => console.log(v)" />
     <LineChart :chart-data="LineData.val" :chart-lable="LineData.label" />
   </el-dialog>
 </template>
@@ -121,18 +112,17 @@
   import { ref } from 'vue';
   import { defineProps } from 'vue';
   import { FormInstance } from 'element-plus';
-  import { DepartMentModel } from '@/api/datamanagement/dataplatform';
-  import { TableModel } from '@/api/datamanagement/dataplatform';
   import DialogNavBar from '../common/DialogNavBar.vue';
   import BarChart from '../../charts/BarChart.vue';
   import LineChart from '../../charts/LineChart.vue';
-  // import { DepartMentModel, Records, Visits, VisitsModel, getDeptList } from '@/api/datamanagement/dataplatform';
+  import { UserAccessRecord } from '@/api/datamanagement/dataplatform';
 
   const searchLabel = ref('姓名');
   const searchValue = ref('');
 
   const props = defineProps<{
-    tableData: TableModel[];
+    workshopList: any[];
+    tableData: UserAccessRecord[];
     tableLabel: string;
   }>();
 
@@ -150,8 +140,6 @@
 
   const ruleFormRef = ref<FormInstance>();
 
-  const departmentList = ref<DepartMentModel[]>([]);
-
   //柱状图logo
   const bargraphVisible = ref(false);
   const bargraphTitle = ref('');
@@ -186,7 +174,6 @@
   // 搜索数据
   function submitForm(formE1: FormInstance | undefined) {
     console.log('搜索数据');
-
     if (!formE1) return;
     // formE1.validate((valid, fields) => {
     //     if (valid) {
@@ -201,140 +188,11 @@
   // 重置表单
   function resetForm(formE1: FormInstance | undefined) {
     console.log('重置表单');
-
     if (!formE1) return;
     // formE1.resetFields()
     // console.log('resetForm')
     // queryData();
   }
-
-  // const props = defineProps<{ type: string }>()
-  // const props = defineProps<{
-  // queryData: (d1: number, d2: number) => Promise<Visits<Records>>,
-  // currentDayData: (d: number) => Promise<VisitsModel[]>,
-  // currentMonthData: (d: number) => Promise<VisitsModel[]>,
-  // currentAllData: (d: number) => Promise<VisitsModel[]>,
-  // getPersonalVisits: (d1: number | undefined, d2: string, d3: number, d4: number, d5: string) => Promise<Visits<Records>>,
-  // }>();
-
-  // const dialogVisible = ref(false);//控制弹框显示
-  // const currentPage = ref(1);
-  // const currentPageSize = ref(10);
-  // const total = ref(11);
-  // const tableData = ref<TableModel[]>()
-  // const userId = ref(10014);
-
-  // const getDepartmentList = () => {
-  //     getDeptList().then((res) => {
-  //         departmentList.value = res;
-  //         console.log('department:', res)
-  //     });
-  // };
-
-  // 查询数据列表
-  // async function queryData() {
-  //     const res = await props.queryData(currentPage.value, currentPageSize.value);
-  //     console.log('tablecommon-querydata:', res);
-  //     tableData.value = res.records;
-  //     console.log('tablecommon-querydata1:', tableData.value);
-  //     total.value = res.totalRow;
-  // }
-
-  // 根据指定参数查询数据-搜索数据
-  // function queryDataByParams() {
-  //     props.queryDataByParams().then(res => {
-  //         console.log(res)
-  //     })
-  //     // emit('queryDataByParams', data);
-  // }
-
-  // interface FormTable {
-  //     text: string,
-  //     dept: string,
-  // }
-
-  // // 翻页
-  // function handleCurrentPageChange(val: number) {
-  //     currentPage.value = val
-  //     console.log('currentPage:' + currentPage.value)
-  //     queryData();
-  // }
-
-  // // 页数
-  // function handeSizeChange(val: number) {
-  //     currentPageSize.value = val
-  //     console.log('currentPageSize:' + currentPageSize.value)
-  //     queryData()
-  // }
-
-  // function closeDialog() {
-  //     dialogVisible.value = false;
-  // }
-
-  // // 查询今日访问次数
-  // function currentDayData(userId: number) {
-  //     console.log('table-common-currentDayData:', userId)
-  //     return props.currentDayData(userId).then(res => {
-  //         console.log('table-common-currentdaydata:', res)
-  //         return res
-  //     })
-  // }
-
-  // // 查询本月访问次数
-  // function currentMonthData(userId: number) {
-  //     console.log('table-common-currentMonthData:', userId)
-  //     return props.currentMonthData(userId).then(res => {
-  //         console.log('table-common-currentmonthdata:', res);
-  //         return res
-  //     })
-  // }
-
-  // // 查询累计访问次数
-  // function currentAllData(userId: number) {
-  //     return props.currentAllData(userId).then(res => {
-  //         console.log('table-common:', res);
-  //         return res;
-  //     })
-  // }
-
-  // // 查询个人访问次数-搜索数据
-  // function getPersonalVisits(data: FormModelCommon) {
-  //     const departId = ref();
-  //     departmentList.value.forEach(item => {
-  //         if (item.deptName === data.dept) {
-  //             departId.value = item.deptId;
-  //         }
-  //     })
-  //     const newParam = {
-  //         pageNumber: currentPage.value,
-  //         pageSize: currentPageSize.value,
-  //         nickName: data.nickName,
-  //         // deptId: data.dept === BoardDeptEnum.all ? undefined : data.dept,
-  //         deptId: departId.value,
-  //         staffNo: data.staffNo,
-  //     }
-  //     console.log('getPersonalVisits:', newParam);
-  //     props.getPersonalVisits(newParam.deptId, newParam.nickName, newParam.pageNumber, newParam.pageSize, newParam.staffNo).then(res => {
-  //         console.log('table-common-getPersonalVisits:', res)
-  //         tableData.value = res.records;
-
-  //     })
-  // }
-
-  // // 打开数据表
-  // function openDialog(row: TableModel) {
-  //     console.log('tablecommon-opendialog');
-  //     console.log(row.userId);
-  //     // tbData.value=row;
-  //     userId.value = row.userId;
-  //     dialogVisible.value = true;
-  //     // currentDayData();
-  // }
-
-  // onMounted(() => {
-  //     queryData()
-  //     getDepartmentList();
-  // })
 </script>
 
 <style scoped lang="scss">

+ 19 - 221
src/views/datamanager/platformdata/compoents/query/Query.vue

@@ -2,17 +2,21 @@
   <div>
     <el-button type="primary" @click="showWorkshopData()">车间统计数据</el-button>
     <el-button type="primary" @click="showCameraData()">相机统计数据</el-button>
-    <PlatformTable :table-data="tableData" table-label="访问次数" />
+    <PlatformTable
+      :workshop-list="flattenedWorkshops"
+      :table-data="tableData"
+      table-label="访问次数"
+    />
     <el-dialog
       v-model="dialogVisible"
       width="1000px"
       :title="dialogTitle"
-      :close-on-click-modal="false"
+      :close-on-click-modal="true"
       :destroy-on-close="true"
       center
     >
       <DialogNavBar
-        :need-workshop="dialogTitle === '相机统计数据'"
+        :workshop-list="dialogTitle === '相机统计数据' ? flattenedWorkshops : undefined"
         @params-changed="(v) => console.log(v)"
       />
       <BarChart :chart-data="chartData.val" :chart-lable="chartData.label" />
@@ -21,13 +25,19 @@
 </template>
 
 <script setup lang="ts">
-  // import { getList, getMonthVisits, getPersonalVisits, getTodayVisits, getTotalVisits } from '@/api/datamanagement/dataplatform';
-  // import { ElMessageBox, ElMessage } from 'element-plus';
   import PlatformTable from '../common/PlatformTable.vue';
   import { ref } from 'vue';
-  import { TableModel } from '@/api/datamanagement/dataplatform';
+  import { UserAccessRecord } from '@/api/datamanagement/dataplatform';
   import DialogNavBar from '../common/DialogNavBar.vue';
   import BarChart from '../../charts/BarChart.vue';
+  import { useSceneInfos } from '@/hooks/useSceneInfos';
+  import { onBeforeMount } from 'vue';
+
+  const sceneInfos = useSceneInfos();
+  const { flattenedWorkshops, getScenesTree } = sceneInfos;
+  onBeforeMount(() => {
+    getScenesTree({ level: 1, valueKey: 'code', labelKey: 'name', disabled: true });
+  });
 
   const dialogVisible = ref(false);
   const chartData = ref();
@@ -45,229 +55,17 @@
     dialogTitle.value = '相机统计数据';
   };
 
-  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,
-    },
-    {
-      deptId: 3,
-      deptName: '部门3',
-      monthVisits: 3,
-      nickName: '王五',
-      staffNo: '10003',
-      todayVisits: 3,
-      totalVisits: 3,
-      userId: 10014,
-    },
-    {
-      deptId: 4,
-      deptName: '部门4',
-      monthVisits: 4,
-      nickName: '赵六',
-      staffNo: '10004',
-      todayVisits: 4,
-      totalVisits: 4,
-      userId: 10014,
-    },
-    {
-      deptId: 5,
-      deptName: '部门5',
-      monthVisits: 5,
-      nickName: '孙七',
-      staffNo: '10005',
-      todayVisits: 5,
-      totalVisits: 5,
-      userId: 10014,
-    },
-    {
-      deptId: 6,
-      deptName: '部门6',
-      monthVisits: 6,
-      nickName: '周八',
-      staffNo: '10006',
-      todayVisits: 6,
-      totalVisits: 6,
-      userId: 10014,
-    },
-    {
-      deptId: 7,
-      deptName: '部门7',
-      monthVisits: 7,
-      nickName: '吴九',
-      staffNo: '10007',
-      todayVisits: 7,
-      totalVisits: 7,
-      userId: 10014,
-    },
-    {
-      deptId: 8,
-      deptName: '部门8',
-      monthVisits: 8,
-      nickName: '郑十',
-      staffNo: '10008',
-      todayVisits: 8,
-      totalVisits: 8,
-      userId: 10014,
-    },
-    {
-      deptId: 9,
-      deptName: '部门9',
-      monthVisits: 9,
-      nickName: '王十一',
-      staffNo: '10009',
-      todayVisits: 9,
-      totalVisits: 9,
-      userId: 10014,
-    },
-    {
-      deptId: 10,
-      deptName: '部门10',
-      monthVisits: 10,
-      nickName: '李十二',
-      staffNo: '10010',
-      todayVisits: 10,
-      totalVisits: 10,
-      userId: 10014,
-    },
-  ]);
+  const tableData = ref<UserAccessRecord[]>([]);
 
-  const workshopData = ref<{
-    label: string[];
-    val: number[];
-  }>({
+  const workshopData = ref({
     label: ['车间1', '车间2', '车间3', '车间4', '车间5', '车间6'],
     val: [9, 66, 77, 82, 35, 100],
   });
 
-  const cameraData = ref<{
-    label: string[];
-    val: number[];
-  }>({
+  const cameraData = ref({
     label: ['相机1', '相机2', '相机3', '相机4', '相机5', '相机6'],
     val: [99, 66, 77, 82, 35, 1],
   });
-
-  // // 查询访问次数列表
-  // 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 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 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();
-  //     });
-  // }
-  // :deep(.el-dialog__header) {
-  //   padding: 0;
-  // }
 </script>
 
 <style scoped lang="scss">