|
|
@@ -13,7 +13,6 @@
|
|
|
style="max-width: 251px; margin-right: 50px"
|
|
|
:placeholder="'请输入' + searchLabel"
|
|
|
>
|
|
|
-
|
|
|
<template #prepend>
|
|
|
<el-select v-model="searchLabel" style="width: 74px">
|
|
|
<el-option value="姓名" />
|
|
|
@@ -33,27 +32,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm(ruleFormRef)"
|
|
|
- style="width: 65px; height: 32px; position: absolute; right: 134px"
|
|
|
- >搜 索</el-button
|
|
|
- >
|
|
|
- <el-button
|
|
|
- @click="resetForm(ruleFormRef)"
|
|
|
- style="width: 65px; height: 32px; position: absolute; right: 57px"
|
|
|
- >重 置</el-button
|
|
|
- >
|
|
|
+ <div style="float: right">
|
|
|
+ <el-button type="primary" @click="submitForm(ruleFormRef)" style="width: 65px; height: 32px"
|
|
|
+ >搜 索</el-button
|
|
|
+ >
|
|
|
+ <el-button @click="resetForm(ruleFormRef)" style="width: 65px; height: 32px"
|
|
|
+ >重 置</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
|
|
|
- <el-table
|
|
|
- style="width: 100%; margin-top: 18px"
|
|
|
- stripe
|
|
|
- :data="tableData"
|
|
|
- highlight-current-row
|
|
|
- :default-sort="{ prop: 'todayVisits', order: 'descending' }"
|
|
|
- >
|
|
|
+ <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="deptName" align="center"></el-table-column>
|
|
|
@@ -76,17 +65,20 @@
|
|
|
align="right"
|
|
|
></el-table-column>
|
|
|
<el-table-column v-if="tableLabel === '访问次数'" label="访问次数统计图" align="center">
|
|
|
- <img
|
|
|
- style="display: inline-block; margin-right: 20px"
|
|
|
- src="@/assets/icons/chart-bar.png"
|
|
|
- alt=""
|
|
|
- @click="showBargraph()"
|
|
|
- />
|
|
|
- <img
|
|
|
- style="display: inline-block"
|
|
|
- src="@/assets/icons/chart-line.png"
|
|
|
- alt=""
|
|
|
- @click="showLinechart()" />
|
|
|
+ <template #default="scope">
|
|
|
+ <img
|
|
|
+ style="display: inline-block; margin-right: 20px"
|
|
|
+ src="@/assets/icons/chart-bar.png"
|
|
|
+ alt=""
|
|
|
+ @click="showBargraph(scope.row)"
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ style="display: inline-block"
|
|
|
+ src="@/assets/icons/chart-line.png"
|
|
|
+ alt=""
|
|
|
+ @click="showLinechart(scope.row)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
@@ -100,26 +92,29 @@
|
|
|
:close-dialog="closeDialog">
|
|
|
</TableEcharts> -->
|
|
|
|
|
|
- <el-dialog
|
|
|
- v-model="bargraphVisible"
|
|
|
- :title="bargraphTitle"
|
|
|
- :close-on-click-modal="true"
|
|
|
- width="1000px"
|
|
|
- center
|
|
|
- >
|
|
|
- <div class="testbox"></div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
- <el-dialog
|
|
|
- v-model="linechartVisible"
|
|
|
- :title="linechartTitle"
|
|
|
- :close-on-click-modal="true"
|
|
|
- width="1000px"
|
|
|
- center
|
|
|
- >
|
|
|
- <div class="testbox"></div>
|
|
|
- </el-dialog>
|
|
|
-
|
|
|
+ <el-dialog
|
|
|
+ v-model="bargraphVisible"
|
|
|
+ :title="bargraphTitle"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ width="1000px"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <DialogNavBar :need-workshop="false" @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"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ width="1000px"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <DialogNavBar :need-workshop="true" @params-changed="(v) => console.log(v)" />
|
|
|
+ <LineChart :chart-data="LineData.val" :chart-lable="LineData.label" />
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
@@ -128,6 +123,9 @@
|
|
|
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';
|
|
|
|
|
|
const searchLabel = ref('姓名');
|
|
|
@@ -157,18 +155,33 @@
|
|
|
//柱状图logo
|
|
|
const bargraphVisible = ref(false);
|
|
|
const bargraphTitle = ref('');
|
|
|
- const showBargraph = () => {
|
|
|
+ const showBargraph = (rowData) => {
|
|
|
bargraphVisible.value = true;
|
|
|
- bargraphTitle.value = '张三访问车间统计柱状图';
|
|
|
-
|
|
|
- }
|
|
|
+ bargraphTitle.value = rowData.nickName + '访问车间统计柱状图';
|
|
|
+ };
|
|
|
//折线图logo
|
|
|
const linechartVisible = ref(false);
|
|
|
const linechartTitle = ref('');
|
|
|
- const showLinechart = () => {
|
|
|
+ const showLinechart = (rowData) => {
|
|
|
linechartVisible.value = true;
|
|
|
- linechartTitle.value = '张三访问车间统计折线图'
|
|
|
- }
|
|
|
+ linechartTitle.value = rowData.nickName + '访问车间统计折线图';
|
|
|
+ };
|
|
|
+
|
|
|
+ const barData = ref<{
|
|
|
+ label: string[];
|
|
|
+ val: number[];
|
|
|
+ }>({
|
|
|
+ label: ['车间1', '车间2', '车间3', '车间4', '车间5', '车间6'],
|
|
|
+ val: [9, 66, 77, 82, 35, 100],
|
|
|
+ });
|
|
|
+
|
|
|
+ const LineData = ref<{
|
|
|
+ label: string[];
|
|
|
+ val: number[];
|
|
|
+ }>({
|
|
|
+ label: ['日期1', '日期2', '日期3', '日期4', '日期5', '日期6'],
|
|
|
+ val: [9, 56, 77, 802, 0, 100],
|
|
|
+ });
|
|
|
|
|
|
// 搜索数据
|
|
|
function submitForm(formE1: FormInstance | undefined) {
|