Quellcode durchsuchen

平台数据文件结构修改

wyf vor 2 Jahren
Ursprung
Commit
d131ecd0ff

+ 0 - 16
src/api/datamanagement/dataplatform.ts

@@ -1,7 +1,5 @@
 import { http } from '@/utils/http/axios';
 
-
-
 export interface Records {
     deptId: number,
     deptName: string,
@@ -13,7 +11,6 @@ export interface Records {
     userId: number
 }
 
-
 export interface Visits<Records> {
     pageNumber: number,
     pageSize: number,
@@ -22,7 +19,6 @@ export interface Visits<Records> {
     totalRow: number
 }
 
-
 export interface MonthVisit {
     visits: number,
     workshopName: string,
@@ -55,8 +51,6 @@ export interface DepartMentModel {
     treePath: string,
 }
 
-
-
 // 查询访问次数列表
 export function getList(pageNumber: number, pageSize: number) {
     return http.request<Visits<Records>>({
@@ -66,8 +60,6 @@ export function getList(pageNumber: number, pageSize: number) {
     });
 }
 
-
-
 // 查询个人本月访问次数
 export function getMonthVisits(userId: number) {
     return http.request<VisitsModel[]>({
@@ -86,7 +78,6 @@ export function getMonthSumTable(deptIdList: []) {
     });
 }
 
-
 // 查询个人访问次数
 export function getPersonalVisits(pageNumber: number, pageSize: number, staffNo?: string, deptId?: number, nickName?: string) {
     return http.request<Visits<Records>>({
@@ -96,10 +87,6 @@ export function getPersonalVisits(pageNumber: number, pageSize: number, staffNo?
     });
 }
 
-
-
-
-
 // 查询今日访问次数
 export function getTodayVisits(userId: number) {
     return http.request<VisitsModel[]>({
@@ -118,8 +105,6 @@ export function getTodaySumTable(deptIdList: []) {
     });
 }
 
-
-
 // 查询个人累计访问次数
 export function getTotalVisits(userId: number) {
     return http.request<VisitsModel[]>({
@@ -138,7 +123,6 @@ export function getTotalSumTable(deptIdList: []) {
     });
 }
 
-
 // 获取部门列表
 export function getDeptList() {
     return http.request<DepartMentModel[]>({

BIN
src/assets/icons/chart-bar.png


BIN
src/assets/icons/chart-line.png


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

@@ -0,0 +1,110 @@
+<template>
+    <div class="platform-content">
+        <div class="flex platform-head-tabs">
+          <div
+            class="flex justify-center items-center tab-item"
+            :class="{ 'tab-item-active': activeName === 'count' }"
+            @click="activeName = 'count'"
+          >
+            访问次数统计
+          </div>
+          <div
+            class="flex justify-center items-center tab-item"
+            :class="{ 'tab-item-active': activeName === 'score' }"
+            @click="activeName = 'score'"
+          >
+            积分统计
+          </div>
+        </div>
+        <Query v-if="activeName === 'count'" />
+        <Score v-else />
+    </div>
+</template>
+
+<script setup lang="ts">
+import { ref } from 'vue';
+// import type { TabsPaneContext } from 'element-plus';
+import Query from './compoents/query/Query.vue'
+import Score from './compoents/score/Score.vue';
+
+const activeName = ref('count');
+export type LabelType = 'count' | 'score';
+// const currentLabel = ref<LabelType>('count');
+
+// const handleClick = (tab: TabsPaneContext) => {
+//     console.log(tab.paneName);
+//     if (tab.paneName === 'count') {
+//         currentLabel.value = 'count';
+//     } else {
+//         currentLabel.value = 'score';
+//     }
+// };
+</script>
+
+<!-- <style>
+.demo-tabs>.el-tabs__content {
+    padding: 32px;
+    color: #6b778c;
+    font-size: 32px;
+    font-weight: 600;
+}
+/* .el-tabs__content:hover {
+    color
+} */
+
+.el-tabs__item:hover {
+    color: #6b778c;
+    /* color: rgb(53, 120, 220); */
+    /* background-color: rgb(53, 120, 220); */
+}
+
+.el-tabs__item.is-active {
+    /* color: rgb(221, 239, 255); */
+    background-color: rgb(221, 239, 255);
+    border: 1px solid #4693f1;
+}
+</style> -->
+
+<style scoped lang="scss">
+.platform-content {
+    height: calc(100vh - 64px - 12px);
+    background-color: rgba(255, 255, 255, 1);
+    padding: 21px;
+}
+.platform-head {
+    height: 56px;
+
+    &-name {
+      margin-left: 24px;
+      font-size: 16px;
+      font-weight: 500;
+      color: #252525;
+    }
+
+    &-tabs {
+      margin: 18px 0;
+
+      :first-child {
+        border-radius: 8px 0px 0px 8px;
+      }
+
+      :last-child {
+        border-radius: 0px 8px 8px 0px;
+      }
+    }
+  }
+  
+  .tab-item {
+    width: 188px;
+    height: 38px;
+    background: #fafafa;
+    border: 1px solid #d9d9d9;
+    cursor: pointer;
+
+    &-active {
+    color:rgba(22, 119, 255, 1);
+      background: #e2eefe;
+      border: 1px solid #1890ff;
+    }
+  }
+</style>

+ 0 - 0
src/views/datamanager/platformdata/charts/BarChart.vue


+ 0 - 0
src/views/datamanager/platformdata/charts/LineChart.vue


+ 354 - 0
src/views/datamanager/platformdata/compoents/ChartIndex.vue

@@ -0,0 +1,354 @@
+<template>
+    <el-card>
+        <template #header>
+            <div>title</div>
+            <!-- <div v-if="isShowAll === false" style="text-align: center;">
+                <el-button type="text" @click="currentDayChart">今日</el-button>
+                <el-button type="text" @click="currentMonthChart">本月</el-button>
+                <el-button type="text" @click="allDatasChart">累计</el-button>
+            </div>
+            <div v-else>
+                <el-form inline ref="ruleFormRef" :model="form" style="width:600px">
+                    <el-form-item style="margin-top: 20px;">
+                        <el-select v-model="form.workspace" placeholder="请选择车间" style="width: 140px ;text-align: left;">
+                            <el-option v-for="item in departmentList" :key="item.deptId" :value="item.deptName"
+                                :label="item.deptName"></el-option>
+                        </el-select>
+                    </el-form-item>
+                    <el-button style="text-align: left;width: 100px;" type="primary"
+                        @click="getDepartmentData">生成柱状图</el-button>
+                    <el-button style="text-align: left; margin-left: 180px;" type="text"
+                        @click="currentDayChart">今日</el-button>
+                    <el-button style="text-align: left;" type="text" @click="currentMonthChart">本月</el-button>
+                    <el-button style="text-align: left;" type="text" @click="allDatasChart">累计</el-button>
+                </el-form>
+            </div> -->
+        </template>
+        <div id="container" style="width: 600px; height: 470px;margin-left: 20px;"></div>
+    </el-card>
+</template>
+
+<script setup lang="ts">
+// import * as echarts from 'echarts';
+// import { ref, markRaw } from 'vue';
+// import { watch } from 'vue';
+// import { onMounted } from 'vue';
+// import { DepartMentModel, VisitsModel, getDeptList } from '@/api/datamanagement/dataplatform';
+
+// interface DataOption {
+//     title: {},//标题
+//     tooltip: {},//虚线
+//     calculate: Boolean,
+//     xAxis: {},
+//     yAxis: {},
+//     series: SerialModel[]
+// }
+
+// const visible = ref(false);
+// const userId = ref(1);
+// const isShowAll = ref(false);//控制标题是否居中
+// const chart = ref<any>("");
+
+// const departmentList = ref<DepartMentModel[]>([]);
+// const getDepartmentList = () => {
+//     getDeptList().then((res) => {
+//         departmentList.value = res;
+//     });
+// };
+
+// watch(
+//     () => props.dialogVisible,
+//     (newvisible) => {
+//         visible.value = newvisible
+//         console.log('tablechart', visible.value)
+//     },
+//     { immediate: true },
+// )
+// watch(
+//     () => props.userId,
+//     (newuserId) => {
+//         userId.value = newuserId
+//         console.log('tablechart-data:', userId.value)
+//         currentDayChart()
+//     },
+//     { immediate: true },
+// )
+
+// const form = ref({
+//     workspace: '',
+// });
+
+// const props = defineProps<{
+//     stuffNo?: number | string | undefined,
+    
+    // currentDayChart: (d: number) => Promise<VisitsModel[]>,
+    // currentMonthChart: (d: number) => Promise<VisitsModel[]>,
+    // allDatasChart: (d: number) => Promise<VisitsModel[]>,
+    // getDepartmentData: () => Promise<unknown>,
+// }>();
+
+// function initChart(data: DataOption, title: [], series: []) {
+//     data.xAxis = {};
+//     const dataseries = ref<SerialModel[]>([]);
+//     const type = ref('category');
+//     const horidata = ref([]) //todo,获取横坐标
+//     const nameLocation = ref('center');
+//     const axisLabel = { interval: 0, rotate: 30 };
+//     const nameTextStyle = {
+//         color: 'red',
+//         fontSize: 6,
+//     };
+//     horidata.value = title;
+//     data.xAxis = { type: type.value, data: horidata.value, nameLocation: nameLocation.value, axisLabel: axisLabel, nameTextStyle: nameTextStyle }
+//     const seriesdata = ref<SerialModel>({
+//         data: [],//todo,获取数值,
+//         type: 'bar'
+//     })
+//     seriesdata.value.data = series;
+//     dataseries.value.push(seriesdata.value)
+//     data.series = dataseries.value;
+
+//     console.log('data.xAxis.data', data.xAxis);
+//     console.log('data.yAxis.data', data.series)
+//     console.log(data)
+//     createChart(data);
+// }
+
+// // 查看今日数据
+// function currentDayChart() {
+//     isShowAll.value = false;
+//     console.log('table-chart-currentday');
+//     const daytitle = ref();
+//     const seriesdata = ref();
+//     props.currentDayChart(userId.value).then(res => {
+//         daytitle.value = getHorizontalTitle(res);
+//         seriesdata.value = getVorizontalData(res);
+//         console.log('查看今日数据', res);
+//         console.log('查看今日数据', daytitle);
+//         console.log('查看今日数据', seriesdata);
+//         initChart(optionday.value, daytitle.value, seriesdata.value)
+//     })
+
+// };
+
+// // 查看本月数据
+// function currentMonthChart() {
+//     isShowAll.value = false;
+//     console.log('currentmonth:', userId.value);
+//     const monthtitle = ref();
+//     const monthseriesdata = ref()
+//     props.currentMonthChart(userId.value).then(res => {
+//         console.log('table-chart-currentmonth:', res);
+//         monthtitle.value = getHorizontalTitle(res);
+//         monthseriesdata.value = getVorizontalData(res);
+//         console.log('查看今日数据', res);
+//         console.log('查看今日数据', monthtitle);
+//         console.log('查看今日数据', monthseriesdata);
+//         initChart(optionmonth.value, monthtitle.value, monthseriesdata.value)
+//     })
+// };
+
+// // 查看累计数据
+// function allDatasChart() {
+//     isShowAll.value = true;
+//     console.log('alldata:', userId.value);
+//     const alltitle = ref();
+//     const allseriesdata = ref()
+//     props.allDatasChart(userId.value).then(res => {
+//         console.log(res);
+//         alltitle.value = getHorizontalTitle(res);
+//         allseriesdata.value = getVorizontalData(res);
+//         console.log('查看今日数据', res);
+//         console.log('查看今日数据', alltitle);
+//         console.log('查看今日数据', allseriesdata);
+//         initChart(optionall.value, alltitle.value, allseriesdata.value)
+//     })
+// }
+
+// interface SerialModel {
+//     data: [],
+//     type: string,
+// }
+
+// // 创建图表
+// function createChart(option: DataOption) {
+//     chart.value = markRaw(echarts.init(document.getElementById('container') as HTMLDivElement))
+
+//     chart.value.setOption(option);
+
+//     // 大小自适应
+//     window.addEventListener('resize', () => {
+//         chart.value.resize();
+//     })
+// }
+
+// // 创建柱状图
+// function getDepartmentData() {
+//     // todo,原型未定义
+// }
+
+// function getHorizontalTitle(data: VisitsModel[]) {
+//     console.log('getHorizontalTitle:', data)
+//     const title = ref<string[]>([]);
+//     for (var i = 0; i < data.length; i++) {
+//         title.value.push(data[i].workshopName)
+//         console.log('getHorizontalTitle-data-i', data[i].workshopName)
+//     }
+//     console.log('title:', title);
+//     return title;
+// }
+
+// function getVorizontalData(data: VisitsModel[]) {
+//     console.log('getvorizontaldata:', data)
+//     const seriesData = ref<number[]>([]);
+//     for (var i = 0; i < data.length; i++) {
+//         seriesData.value.push(data[i].visits)
+//         console.log('getHorizontalTitle-data-i', data[i].visits)
+//     }
+//     console.log('seriesData:', seriesData);
+//     return seriesData;
+// }
+
+// const optionday = ref();
+// optionday.value = {
+//     title: {
+//         text: '各车间地点访问次数柱状图(天)',
+//         x: "center", //设置标题位置居中
+//         textStyle: {//设置主标题的文字风格
+//             fontSize: 10 //文字大小
+//         },
+//     },//标题
+//     tooltip: {
+//         trigger: 'axis'
+//     },//虚线
+//     calculate: true,//显示数据
+//     xAxis: {
+//         type: 'category',
+//         data: [],//todo,获取横坐标
+//         nameLocation: 'center',
+//         axisLabel: { interval: 0, rotate: 30 },
+//         nameTextStyle: {
+//             color: 'red',
+//             fontSize: 6,
+
+//         }
+//     },
+//     yAxis: {
+//         type: 'value',
+//         name: '访问次数',
+//         nameTextStyle: {
+//             color: 'black',
+//             fontSize: 8,
+//             padding: 0,
+//         }
+
+//     },
+//     series: [
+//         {
+//             data: [],//todo,获取数值,
+//             type: 'bar'
+//         }
+//     ]
+// };
+
+
+// const optionmonth = ref();
+// optionmonth.value = {
+//     title: {
+//         text: '各车间地点访问次数柱状图(月)',
+//         x: "center", //设置标题位置居中
+//         textStyle: {//设置主标题的文字风格
+//             fontSize: 10 //文字大小
+//         },
+
+
+
+//     },//标题
+//     tooltip: {
+//         trigger: 'axis'
+//     },//虚线
+//     calculate: true,//显示数据
+//     xAxis: {
+//         type: 'category',
+//         data: [],//todo,获取横坐标
+//         nameLocation: 'center',
+//         axisLabel: { interval: 0, rotate: 30 },
+//         nameTextStyle: {
+//             color: 'red',
+//             fontSize: 6,
+
+//         }
+//     },
+//     yAxis: {
+//         type: 'value',
+//         name: '访问次数',
+//         nameTextStyle: {
+//             color: 'black',
+//             fontSize: 8,
+//             padding: 0,
+//         }
+
+//     },
+//     series: [
+//         {
+//             data: [],//todo,获取数值,
+//             type: 'bar'
+//         }
+//     ]
+// };
+
+
+// const optionall = ref();
+// optionall.value = {
+//     title: {
+//         text: '各车间地点访问次数柱状图(汇总)',
+//         x: "center", //设置标题位置居中
+//         textStyle: {//设置主标题的文字风格
+//             fontSize: 10 //文字大小
+//         },
+
+
+
+//     },//标题
+//     tooltip: {
+//         trigger: 'axis'
+//     },//虚线
+//     calculate: true,//显示数据
+//     xAxis: {
+//         type: 'category',
+//         data: [],//todo,获取横坐标
+//         nameLocation: 'center',
+//         axisLabel: { interval: 0, rotate: 30 },
+//         nameTextStyle: {
+//             color: 'red',
+//             fontSize: 6,
+
+//         }
+//     },
+//     yAxis: {
+//         type: 'value',
+//         name: '访问次数',
+//         nameTextStyle: {
+//             color: 'black',
+//             fontSize: 8,
+//             padding: 0,
+//         }
+
+//     },
+//     series: [
+//         {
+//             data: [],//todo,获取数值,
+//             type: 'bar'
+//         }
+//     ]
+// };
+
+
+// onMounted(() => {
+//     isShowAll.value = false;
+//     getDepartmentList();
+// })
+
+</script>
+
+<style scoped></style>

+ 262 - 0
src/views/datamanager/platformdata/compoents/query/PlatformTable.vue

@@ -0,0 +1,262 @@
+<template>
+    <div class="form">
+        <!-- <div class="form-content">
+            form
+        </div> -->
+        <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-form-item label="部门:" prop="dept" style="margin-top: 15px;">
+                <el-select v-model="ruleForm.dept" placeholder="请选择部门" style="width: 200px ;">
+                    <el-option v-for="item in departmentList" :key="item.deptId" :value="item.deptName"
+                        :label="item.deptName"></el-option>
+                </el-select>
+            </el-form-item>
+            <el-button type="primary" @click="submitForm(ruleFormRef)"
+                style="width: 110px;position: absolute;margin-top: 15px;right:120px">搜索</el-button>
+            <el-button @click="resetForm(ruleFormRef)"
+                style="position: absolute;right:0;width: 110px;margin-top: 15px">重置</el-button>
+        </el-form>
+        <el-table style="width: 100%;margin-top: 20px;" :data="tableData" highlight-current-row
+            :default-sort="{ prop: 'todayVisits', order: 'descending' }">
+            <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="deptName" align="center"></el-table-column>
+            <el-table-column label="当日访问次数" prop="todayVisits" sortable align="right"></el-table-column>
+            <el-table-column label="本月访问次数" prop="monthVisits" sortable align="right"></el-table-column>
+            <el-table-column label="累计访问次数" prop="totalVisits" sortable align="right"></el-table-column>
+            <el-table-column label="访问次数统计图" align="center">
+                <img style="display: inline-block; margin-right: 33px;" src="@/assets/icons/chart-bar.png" alt="" />
+                <img style="display: inline-block;" src="@/assets/icons/chart-line.png" alt="" />
+            </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> -->
+</template>
+
+<script setup lang="ts">
+
+import { ref } from 'vue';
+import { FormInstance } from 'element-plus';
+import { DepartMentModel } from '@/api/datamanagement/dataplatform';
+// import { DepartMentModel, Records, Visits, VisitsModel, getDeptList } from '@/api/datamanagement/dataplatform';
+
+export interface TableModel {
+    deptId: number,
+    deptName: string,
+    monthVisits: number,
+    nickName: string,
+    staffNo: string,
+    todayVisits: number,
+    totalVisits: number,
+    userId: number,
+}
+
+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 },
+    { deptId: 11, deptName: '部门11', monthVisits: 11, nickName: '赵十三', staffNo: '10011', todayVisits: 11, totalVisits: 11, userId: 10014 },
+])
+
+export interface FormModelCommon {
+    dept: string,
+    nickName: string,
+    staffNo: string,
+}
+
+const ruleForm = ref<FormModelCommon>({
+    dept: '',
+    nickName: '',
+    staffNo: '',
+})
+
+const ruleFormRef = ref<FormInstance>();
+
+const departmentList = ref<DepartMentModel[]>([]);
+
+// 搜索数据
+function submitForm(formE1: FormInstance | undefined) {
+    console.log('搜索数据')
+    if (!formE1) return
+    // formE1.validate((valid, fields) => {
+    //     if (valid) {
+    //         getPersonalVisits(ruleForm.value)
+    //     }
+    //     else {
+    //         console.log('error submit!', fields);s
+    //     }
+    // })
+}
+
+// 重置表单
+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>
+.form {
+    /* width: 1100px; */
+    margin-top: 30px;
+    margin-bottom: 30px;
+}
+
+
+.el-pagination {
+    margin-top: 30px;
+}
+</style>

+ 134 - 0
src/views/datamanager/platformdata/compoents/query/Query.vue

@@ -0,0 +1,134 @@
+<template>
+    <div>
+        <el-button type="primary" @click="showWorkshopData()">车间统计数据</el-button>
+        <el-button type="primary" @click="showCameraData()">相机统计数据</el-button>
+        <PlatformTable />
+        <el-dialog v-model="chartDialogVisible" width="800px" :close-on-click-modal="true" center>
+            <ChartIndex />
+        </el-dialog>
+    </div>
+</template>
+
+<script setup lang="ts">
+
+// import { getList, getMonthVisits, getPersonalVisits, getTodayVisits, getTotalVisits } from '@/api/datamanagement/dataplatform';
+import PlatformTable from './PlatformTable.vue';
+import ChartIndex from '../ChartIndex.vue';
+import { ref } from 'vue';
+// import { ElMessageBox, ElMessage } from 'element-plus';
+
+const chartDialogVisible = ref(false);
+
+const showWorkshopData = () => {
+    chartDialogVisible.value = true;
+}
+
+const showCameraData = () => {
+    chartDialogVisible.value = true;
+}
+
+// // 查询访问次数列表
+// 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();
+//     });
+// }
+
+</script>
+
+<style scoped></style>

+ 3 - 3
src/views/datamanager/systemdata/Score.vue

@@ -1,14 +1,14 @@
 <template>
     <div>
-        <TableCommon :type="type" :query-data="queryData" :current-day-data="getDayData" :current-month-data="getMonthData"
-            :current-all-data="getAllData" :get-personal-visits="getPersonalVisitsData" />
+        <!-- <TableCommon :type="type" :query-data="queryData" :current-day-data="getDayData" :current-month-data="getMonthData"
+            :current-all-data="getAllData" :get-personal-visits="getPersonalVisitsData" /> -->
     </div>
 </template>
 
 <script setup lang="ts">
 
 import { getList, getMonthVisits, getPersonalVisits, getTodayVisits, getTotalVisits } from '@/api/datamanagement/dataplatform';
-import TableCommon from './TableCommon.vue';
+// import TableCommon from './TableCommon.vue';
 import { ref } from 'vue';
 import { ElMessageBox, ElMessage } from 'element-plus'
 const type = ref('积分')

src/views/datamanager/systemdata/config.ts → src/views/datamanager/platformdata/config.ts


+ 0 - 63
src/views/datamanager/systemdata/PlatformData.vue

@@ -1,63 +0,0 @@
-<template>
-    <div style="width: 100%">
-        <div>
-            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
-                <el-tab-pane label="访问次数统计" name="count">
-                    <Table />
-                </el-tab-pane>
-                <el-tab-pane label="积分统计" name="score">
-                    <Score />
-                </el-tab-pane>
-
-            </el-tabs>
-        </div>
-
-
-
-    </div>
-</template>
-
-
-<script setup lang="ts">
-import { ref } from 'vue';
-import type { TabsPaneContext } from 'element-plus';
-import Table from './Table.vue'
-import Score from './Score.vue';
-
-
-
-const activeName = ref('count');
-export type LabelType = 'count' | 'score';
-const currentLabel = ref<LabelType>('count');
-
-const handleClick = (tab: TabsPaneContext) => {
-    console.log(tab.paneName);
-    if (tab.paneName === 'count') {
-        currentLabel.value = 'count';
-    } else {
-
-        currentLabel.value = 'score';
-
-    }
-};
-</script>
-
-<style>
-.demo-tabs>.el-tabs__content {
-    padding: 32px;
-    color: #6b778c;
-    font-size: 32px;
-    font-weight: 600;
-}
-
-.el-tabs__item:hover {
-    /* color: rgb(53, 120, 220); */
-    background-color: rgb(53, 120, 220);
-}
-
-.el-tabs__item.is-active {
-    /* color: rgb(221, 239, 255); */
-    background-color: rgb(221, 239, 255);
-    border: 3px solid #4693f1 !important
-}
-</style>

+ 0 - 129
src/views/datamanager/systemdata/Table.vue

@@ -1,129 +0,0 @@
-<template>
-    <div>
-        <TableCommon :type="type" :query-data="queryData" :current-day-data="getDayData" :current-month-data="getMonthData"
-            :current-all-data="getAllData" :get-personal-visits="getPersonalVisitsData" />
-    </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'
-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 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();
-    });
-}
-
-</script>
-
-<style scoped></style>

+ 0 - 274
src/views/datamanager/systemdata/TableCommon.vue

@@ -1,274 +0,0 @@
-<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-form-item label="部门:" prop="dept" style="margin-top: 15px;">
-                <el-select v-model="ruleForm.dept" placeholder="请选择部门" style="width: 200px ;">
-                    <el-option v-for="item in departmentList" :key="item.deptId" :value="item.deptName"
-                        :label="item.deptName"></el-option>
-                </el-select>
-            </el-form-item>
-
-            <el-button type="primary" @click="submitForm(ruleFormRef)"
-                style="width: 110px;position: absolute;margin-top: 15px;right:120px">搜索</el-button>
-            <el-button @click="resetForm(ruleFormRef)"
-                style="position: absolute;right:0;width: 110px;margin-top: 15px">重置</el-button>
-            <el-form-item>
-
-            </el-form-item>
-
-        </el-form>
-
-        <div>
-            <el-button type="primary">数据总表</el-button>
-
-        </div>
-        <el-table style="width: 100%;margin-top: 20px;" :data="tableData" highlight-current-row
-            :default-sort="{ prop: 'todayVisits', order: 'descending' }">
-
-            <el-table-column label="姓名" prop="nickName"></el-table-column>
-            <el-table-column label="工号" prop="staffNo"></el-table-column>
-            <el-table-column label="部门" prop="deptName"></el-table-column>
-            <el-table-column :label="`当日` + props.type" prop="todayVisits" sortable></el-table-column>
-            <el-table-column :label="`本月` + props.type" prop="monthVisits" sortable></el-table-column>
-            <el-table-column :label="`累计` + props.type" prop="totalVisits" sortable></el-table-column>
-            <el-table-column :label="props.type + '柱状图'">
-                <template #default="scoped">
-                    <img :src="platformData" alt="" @click="openDialog(scoped.row)">
-                </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>
-</template>
-
-<script setup lang="ts">
-
-import { ref, onMounted } from 'vue';
-import { FormInstance } from 'element-plus';
-import TableEcharts from './TableEcharts.vue';
-import platformData from '@/assets/icons/platformdata.png';
-import { DepartMentModel, Records, Visits, VisitsModel, getDeptList } from '../../../api/datamanagement/dataplatform';
-
-export interface TableModel {
-    deptId: number,
-    deptName: string,
-    monthVisits: number,
-    nickName: string,
-    staffNo: string,
-    todayVisits: number,
-    totalVisits: number,
-    userId: number,
-}
-
-// const props = defineProps<{ type: string }>()
-const props = defineProps<{
-    type: string,
-    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(30);
-const tableData = ref<TableModel[]>()
-const userId = ref(10014);
-
-export interface FormModelCommon {
-    dept: string,
-    nickName: string,
-    staffNo: string,
-}
-
-const ruleForm = ref<FormModelCommon>({
-    dept: '',
-    nickName: '',
-    staffNo: '',
-})
-const ruleFormRef = ref<FormInstance>();
-
-
-const departmentList = ref<DepartMentModel[]>([]);
-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 submitForm(formE1: FormInstance | undefined) {
-    console.log('搜索数据')
-    if (!formE1) return
-    formE1.validate((valid, fields) => {
-        if (valid) {
-
-
-            getPersonalVisits(ruleForm.value)
-        }
-        else {
-            console.log('error submit!', fields);
-        }
-    })
-}
-
-// 重置表单
-function resetForm(formE1: FormInstance | undefined) {
-    if (!formE1) return
-    formE1.resetFields()
-    console.log('resetForm')
-    queryData();
-}
-
-// 翻页
-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>
-.form {
-    /* width: 1100px; */
-    margin-top: 30px;
-    margin-bottom: 30px;
-}
-
-
-.el-pagination {
-    margin-top: 30px;
-}
-</style>

+ 0 - 409
src/views/datamanager/systemdata/TableEcharts.vue

@@ -1,409 +0,0 @@
-<template>
-    <div>
-        <el-dialog v-model="visible" :before-close="handleClose" center style="width: 700px;">
-
-            <el-card>
-                <template #header>
-                    <div v-if="isShowAll === false" style="text-align: center;">
-                        <el-button type="text" @click="currentDayChart">今日</el-button>
-                        <el-button type="text" @click="currentMonthChart">本月</el-button>
-                        <el-button type="text" @click="allDatasChart">累计</el-button>
-
-                    </div>
-                    <div v-else>
-                        <el-form inline ref="ruleFormRef" :model="form" style="width:600px">
-                            <el-form-item style="margin-top: 20px;">
-                                <el-select v-model="form.workspace" placeholder="请选择车间"
-                                    style="width: 140px ;text-align: left;">
-                                    <el-option v-for="item in departmentList" :key="item.deptId" :value="item.deptName"
-                                        :label="item.deptName"></el-option>
-                                </el-select>
-                            </el-form-item>
-                            <el-button style="text-align: left;width: 100px;" type="primary"
-                                @click="getDepartmentData">生成柱状图</el-button>
-                            <el-button style="text-align: left; margin-left: 180px;" type="text"
-                                @click="currentDayChart">今日</el-button>
-                            <el-button style="text-align: left;" type="text" @click="currentMonthChart">本月</el-button>
-                            <el-button style="text-align: left;" type="text" @click="allDatasChart">累计</el-button>
-
-                        </el-form>
-
-                    </div>
-                </template>
-                <div id="container" style="width: 600px; height: 470px;margin-left: 20px;"></div>
-            </el-card>
-        </el-dialog>
-    </div>
-</template>
-
-<script setup lang="ts">
-
-import * as echarts from 'echarts';
-import { ref, markRaw } from 'vue';
-// import { ElMessageBox } from 'element-plus';
-// import { BoardDeptList } from './config'
-import { watch } from 'vue';
-import { onMounted } from 'vue';
-import { DepartMentModel, VisitsModel, getDeptList } from '@/api/datamanagement/dataplatform';
-
-interface DataOption {
-    title: {},//标题
-    tooltip: {},//虚线
-    calculate: Boolean,
-    xAxis: {},
-    yAxis: {},
-    series: SerialModel[]
-}
-
-
-
-
-const visible = ref(false);
-const userId = ref(1);
-const isShowAll = ref(false);//控制标题是否居中
-const chart = ref<any>("");
-
-const departmentList = ref<DepartMentModel[]>([]);
-const getDepartmentList = () => {
-    getDeptList().then((res) => {
-        departmentList.value = res;
-    });
-};
-
-
-watch(
-    () => props.dialogVisible,
-    (newvisible) => {
-        visible.value = newvisible
-        console.log('tablechart', visible.value)
-    },
-    { immediate: true },
-)
-watch(
-    () => props.userId,
-    (newuserId) => {
-        userId.value = newuserId
-        console.log('tablechart-data:', userId.value)
-        currentDayChart()
-    },
-    { immediate: true },
-)
-
-const form = ref({
-    workspace: '',
-});
-
-
-const props = defineProps<{
-    dialogVisible: boolean,
-    userId: number,
-    currentDayChart: (d: number) => Promise<VisitsModel[]>,
-    currentMonthChart: (d: number) => Promise<VisitsModel[]>,
-    allDatasChart: (d: number) => Promise<VisitsModel[]>,
-    closeDialog(),
-    // getDepartmentData: () => Promise<unknown>,
-
-}>();
-
-
-
-// 关闭对话框
-function closeDialog() {
-    visible.value = false;
-    props.closeDialog();
-    // emit('closeDialog');
-}
-
-// 关闭对话框
-function handleClose(done: () => void) {
-    // ElMessageBox.confirm('确认关闭?')
-    //     .then(() => {
-
-    //         done()
-    //         closeDialog();//关闭对话框
-    //     })
-    //     .catch(() => {
-
-    //         // catch error
-    //     })
-    done();
-    closeDialog();//关闭对话框
-}
-
-// 查看今日数据
-function currentDayChart() {
-    isShowAll.value = false;
-    console.log('table-chart-currentday');
-    const daytitle = ref();
-    const seriesdata = ref()
-    props.currentDayChart(userId.value).then(res => {
-        daytitle.value = getHorizontalTitle(res);
-        seriesdata.value = getVorizontalData(res);
-        console.log('查看今日数据', res);
-        console.log('查看今日数据', daytitle);
-        console.log('查看今日数据', seriesdata);
-        initChart(optionday.value, daytitle.value, seriesdata.value)
-    })
-
-};
-
-// 查看本月数据
-function currentMonthChart() {
-    isShowAll.value = false;
-    console.log('currentmonth:', userId.value);
-    const monthtitle = ref();
-    const monthseriesdata = ref()
-    props.currentMonthChart(userId.value).then(res => {
-        console.log('table-chart-currentmonth:', res);
-        monthtitle.value = getHorizontalTitle(res);
-        monthseriesdata.value = getVorizontalData(res);
-        console.log('查看今日数据', res);
-        console.log('查看今日数据', monthtitle);
-        console.log('查看今日数据', monthseriesdata);
-        initChart(optionmonth.value, monthtitle.value, monthseriesdata.value)
-    })
-};
-
-
-// 查看累计数据
-function allDatasChart() {
-    isShowAll.value = true;
-    console.log('alldata:', userId.value);
-    const alltitle = ref();
-    const allseriesdata = ref()
-    props.allDatasChart(userId.value).then(res => {
-        console.log(res);
-        alltitle.value = getHorizontalTitle(res);
-        allseriesdata.value = getVorizontalData(res);
-        console.log('查看今日数据', res);
-        console.log('查看今日数据', alltitle);
-        console.log('查看今日数据', allseriesdata);
-        initChart(optionall.value, alltitle.value, allseriesdata.value)
-    })
-}
-
-interface SerialModel {
-    data: [],
-    type: string,
-}
-
-
-function initChart(data: DataOption, title: [], series: []) {
-    data.xAxis = {};
-    const dataseries = ref<SerialModel[]>([]);
-
-    const type = ref('category');
-    const horidata = ref([]) //todo,获取横坐标
-    const nameLocation = ref('center');
-    const axisLabel = { interval: 0, rotate: 30 };
-    const nameTextStyle = {
-        color: 'red',
-        fontSize: 6,
-    };
-    horidata.value = title;
-
-    data.xAxis = { type: type.value, data: horidata.value, nameLocation: nameLocation.value, axisLabel: axisLabel, nameTextStyle: nameTextStyle }
-
-
-    const seriesdata = ref<SerialModel>({
-        data: [],//todo,获取数值,
-        type: 'bar'
-    })
-    seriesdata.value.data = series;
-    dataseries.value.push(seriesdata.value)
-    data.series = dataseries.value;
-
-    console.log('data.xAxis.data', data.xAxis);
-    console.log('data.yAxis.data', data.series)
-    console.log(data)
-    createChart(data);
-
-}
-
-// 创建图表
-function createChart(option: DataOption) {
-    chart.value = markRaw(echarts.init(document.getElementById('container') as HTMLDivElement))
-
-    chart.value.setOption(option);
-
-    // 大小自适应
-    window.addEventListener('resize', () => {
-        chart.value.resize();
-    })
-}
-
-// 创建柱状图
-function getDepartmentData() {
-    // todo,原型未定义
-}
-
-
-
-function getHorizontalTitle(data: VisitsModel[]) {
-    console.log('getHorizontalTitle:', data)
-    const title = ref<string[]>([]);
-    for (var i = 0; i < data.length; i++) {
-        title.value.push(data[i].workshopName)
-        console.log('getHorizontalTitle-data-i', data[i].workshopName)
-    }
-    console.log('title:', title);
-    return title;
-}
-
-function getVorizontalData(data: VisitsModel[]) {
-    console.log('getvorizontaldata:', data)
-    const seriesData = ref<number[]>([]);
-    for (var i = 0; i < data.length; i++) {
-        seriesData.value.push(data[i].visits)
-        console.log('getHorizontalTitle-data-i', data[i].visits)
-    }
-    console.log('seriesData:', seriesData);
-    return seriesData;
-}
-
-const optionday = ref();
-optionday.value = {
-    title: {
-        text: '各车间地点访问次数柱状图(天)',
-        x: "center", //设置标题位置居中
-        textStyle: {//设置主标题的文字风格
-            fontSize: 10 //文字大小
-        },
-
-
-
-    },//标题
-    tooltip: {
-        trigger: 'axis'
-    },//虚线
-    calculate: true,//显示数据
-    xAxis: {
-        type: 'category',
-        data: [],//todo,获取横坐标
-        nameLocation: 'center',
-        axisLabel: { interval: 0, rotate: 30 },
-        nameTextStyle: {
-            color: 'red',
-            fontSize: 6,
-
-        }
-    },
-    yAxis: {
-        type: 'value',
-        name: '访问次数',
-        nameTextStyle: {
-            color: 'black',
-            fontSize: 8,
-            padding: 0,
-        }
-
-    },
-    series: [
-        {
-            data: [],//todo,获取数值,
-            type: 'bar'
-        }
-    ]
-};
-
-
-const optionmonth = ref();
-optionmonth.value = {
-    title: {
-        text: '各车间地点访问次数柱状图(月)',
-        x: "center", //设置标题位置居中
-        textStyle: {//设置主标题的文字风格
-            fontSize: 10 //文字大小
-        },
-
-
-
-    },//标题
-    tooltip: {
-        trigger: 'axis'
-    },//虚线
-    calculate: true,//显示数据
-    xAxis: {
-        type: 'category',
-        data: [],//todo,获取横坐标
-        nameLocation: 'center',
-        axisLabel: { interval: 0, rotate: 30 },
-        nameTextStyle: {
-            color: 'red',
-            fontSize: 6,
-
-        }
-    },
-    yAxis: {
-        type: 'value',
-        name: '访问次数',
-        nameTextStyle: {
-            color: 'black',
-            fontSize: 8,
-            padding: 0,
-        }
-
-    },
-    series: [
-        {
-            data: [],//todo,获取数值,
-            type: 'bar'
-        }
-    ]
-};
-
-
-const optionall = ref();
-optionall.value = {
-    title: {
-        text: '各车间地点访问次数柱状图(汇总)',
-        x: "center", //设置标题位置居中
-        textStyle: {//设置主标题的文字风格
-            fontSize: 10 //文字大小
-        },
-
-
-
-    },//标题
-    tooltip: {
-        trigger: 'axis'
-    },//虚线
-    calculate: true,//显示数据
-    xAxis: {
-        type: 'category',
-        data: [],//todo,获取横坐标
-        nameLocation: 'center',
-        axisLabel: { interval: 0, rotate: 30 },
-        nameTextStyle: {
-            color: 'red',
-            fontSize: 6,
-
-        }
-    },
-    yAxis: {
-        type: 'value',
-        name: '访问次数',
-        nameTextStyle: {
-            color: 'black',
-            fontSize: 8,
-            padding: 0,
-        }
-
-    },
-    series: [
-        {
-            data: [],//todo,获取数值,
-            type: 'bar'
-        }
-    ]
-};
-
-
-onMounted(() => {
-    isShowAll.value = false;
-    getDepartmentList();
-})
-
-</script>
-
-<style scoped></style>