|
@@ -1,47 +1,35 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="form">
|
|
<div class="form">
|
|
|
- <el-form ref="ruleFormRef" :model="ruleForm" inline label-width="60px">
|
|
|
|
|
|
|
+ <div class="table-query-form">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="searchValue"
|
|
|
|
|
|
|
+ v-model="tableQueryTypeContent"
|
|
|
style="max-width: 251px; margin-right: 50px"
|
|
style="max-width: 251px; margin-right: 50px"
|
|
|
- :placeholder="'请输入' + searchLabel"
|
|
|
|
|
|
|
+ :placeholder="'请输入' + tableQueryType"
|
|
|
>
|
|
>
|
|
|
<template #prepend>
|
|
<template #prepend>
|
|
|
- <el-select v-model="searchLabel" style="width: 74px">
|
|
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="tableQueryType"
|
|
|
|
|
+ style="width: 74px"
|
|
|
|
|
+ @change="handleTableQueryTypeChange"
|
|
|
|
|
+ >
|
|
|
<el-option value="姓名" />
|
|
<el-option value="姓名" />
|
|
|
<el-option value="工号" />
|
|
<el-option value="工号" />
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</template>
|
|
</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
- <el-form-item label="部门:" prop="dept" style="margin-bottom: 0; margin-right: 0">
|
|
|
|
|
- <el-select
|
|
|
|
|
- multiple
|
|
|
|
|
- clearable
|
|
|
|
|
- collapse-tags
|
|
|
|
|
- placeholder="请添加车间"
|
|
|
|
|
- v-model="ruleForm.dept"
|
|
|
|
|
- :max-collapse-tags="1"
|
|
|
|
|
- style="width: 240px"
|
|
|
|
|
- >
|
|
|
|
|
- <el-option
|
|
|
|
|
- v-for="item in workshopList"
|
|
|
|
|
- :key="item.id"
|
|
|
|
|
- :value="item.id"
|
|
|
|
|
- :label="item.name"
|
|
|
|
|
- >
|
|
|
|
|
- </el-option>
|
|
|
|
|
- </el-select>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
<div style="float: right">
|
|
<div style="float: right">
|
|
|
- <el-button type="primary" @click="submitForm(ruleFormRef)" style="width: 65px; height: 32px"
|
|
|
|
|
|
|
+ <el-button type="primary" @click="submitTableQuery" style="width: 65px; height: 32px"
|
|
|
>搜 索</el-button
|
|
>搜 索</el-button
|
|
|
>
|
|
>
|
|
|
- <el-button @click="resetForm(ruleFormRef)" style="width: 65px; height: 32px"
|
|
|
|
|
- >重 置</el-button
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <el-button @click="resetTable" style="width: 65px; height: 32px">重 置</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
- </el-form>
|
|
|
|
|
- <el-table style="width: 100%; margin-top: 18px" stripe :data="tableData" highlight-current-row>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ style="width: 100%; margin-top: 18px"
|
|
|
|
|
+ stripe
|
|
|
|
|
+ :data="tableData.list"
|
|
|
|
|
+ highlight-current-row
|
|
|
|
|
+ >
|
|
|
<el-table-column label="姓名" prop="nickname" 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="username" align="center"></el-table-column>
|
|
|
<el-table-column label="部门" prop="deptName" align="center"></el-table-column>
|
|
<el-table-column label="部门" prop="deptName" align="center"></el-table-column>
|
|
@@ -80,9 +68,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</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" /> -->
|
|
|
|
|
|
|
+ <el-pagination
|
|
|
|
|
+ v-model="tableQueryParams.pageNumber"
|
|
|
|
|
+ v-model:currentPageSize="tableQueryParams.pageSize"
|
|
|
|
|
+ :total="tableData.total"
|
|
|
|
|
+ :page-sizes="[10, 20, 50, 100, 200]"
|
|
|
|
|
+ layout="->, total,sizes,prev,pager,next,jumper"
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handleCurrentPageChange"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<el-dialog
|
|
<el-dialog
|
|
|
v-model="bargraphVisible"
|
|
v-model="bargraphVisible"
|
|
@@ -111,50 +105,86 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { ref } from 'vue';
|
|
import { ref } from 'vue';
|
|
|
import { defineProps } from 'vue';
|
|
import { defineProps } from 'vue';
|
|
|
- import { FormInstance } from 'element-plus';
|
|
|
|
|
import DialogNavBar from '../common/DialogNavBar.vue';
|
|
import DialogNavBar from '../common/DialogNavBar.vue';
|
|
|
import BarChart from '../../charts/BarChart.vue';
|
|
import BarChart from '../../charts/BarChart.vue';
|
|
|
import LineChart from '../../charts/LineChart.vue';
|
|
import LineChart from '../../charts/LineChart.vue';
|
|
|
- import { UserAccessRecord } from '@/api/datamanagement/dataplatform';
|
|
|
|
|
-
|
|
|
|
|
- const searchLabel = ref('姓名');
|
|
|
|
|
- const searchValue = ref('');
|
|
|
|
|
|
|
+ import {
|
|
|
|
|
+ UserAccessRecordList,
|
|
|
|
|
+ UserAccessRecordQueryParams,
|
|
|
|
|
+ } from '@/api/datamanagement/dataplatform';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
workshopList: any[];
|
|
workshopList: any[];
|
|
|
- tableData: UserAccessRecord[];
|
|
|
|
|
|
|
+ tableData: UserAccessRecordList;
|
|
|
tableLabel: string;
|
|
tableLabel: string;
|
|
|
}>();
|
|
}>();
|
|
|
|
|
|
|
|
- export interface FormModelCommon {
|
|
|
|
|
- dept: string;
|
|
|
|
|
- nickName: string;
|
|
|
|
|
- staffNo: string;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ const tableQueryTypeContent = ref<string>();
|
|
|
|
|
|
|
|
- const ruleForm = ref<FormModelCommon>({
|
|
|
|
|
- dept: '',
|
|
|
|
|
- nickName: '',
|
|
|
|
|
- staffNo: '',
|
|
|
|
|
|
|
+ const tableQueryType = ref<string>('姓名');
|
|
|
|
|
+ const tableQueryParams = ref<UserAccessRecordQueryParams>({
|
|
|
|
|
+ pageNumber: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ // nickname: "",
|
|
|
|
|
+ // username: "",
|
|
|
|
|
+ // sortKey: "",
|
|
|
|
|
+ // sortType: "",
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const ruleFormRef = ref<FormInstance>();
|
|
|
|
|
-
|
|
|
|
|
//柱状图logo
|
|
//柱状图logo
|
|
|
const bargraphVisible = ref(false);
|
|
const bargraphVisible = ref(false);
|
|
|
const bargraphTitle = ref('');
|
|
const bargraphTitle = ref('');
|
|
|
const showBargraph = (rowData) => {
|
|
const showBargraph = (rowData) => {
|
|
|
bargraphVisible.value = true;
|
|
bargraphVisible.value = true;
|
|
|
- bargraphTitle.value = rowData.nickName + '访问车间统计柱状图';
|
|
|
|
|
|
|
+ bargraphTitle.value = rowData.nickname + '访问车间统计柱状图';
|
|
|
};
|
|
};
|
|
|
//折线图logo
|
|
//折线图logo
|
|
|
const linechartVisible = ref(false);
|
|
const linechartVisible = ref(false);
|
|
|
const linechartTitle = ref('');
|
|
const linechartTitle = ref('');
|
|
|
const showLinechart = (rowData) => {
|
|
const showLinechart = (rowData) => {
|
|
|
linechartVisible.value = true;
|
|
linechartVisible.value = true;
|
|
|
- linechartTitle.value = rowData.nickName + '访问车间统计折线图';
|
|
|
|
|
|
|
+ linechartTitle.value = rowData.nickname + '访问车间统计折线图';
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ const handleTableQueryTypeChange = (v: string) => {
|
|
|
|
|
+ if (v === '姓名') {
|
|
|
|
|
+ delete tableQueryParams.value.username;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ delete tableQueryParams.value.nickname;
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleSizeChange = (v: number) => {
|
|
|
|
|
+ tableQueryParams.value.pageSize = v;
|
|
|
|
|
+ emits('tableParamsChanged', tableQueryParams.value);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleCurrentPageChange = (v: number) => {
|
|
|
|
|
+ tableQueryParams.value.pageNumber = v;
|
|
|
|
|
+ emits('tableParamsChanged', tableQueryParams.value);
|
|
|
|
|
+ };
|
|
|
|
|
+ const emits = defineEmits<{
|
|
|
|
|
+ (e: 'tableParamsChanged', parmas: UserAccessRecordQueryParams);
|
|
|
|
|
+ }>();
|
|
|
|
|
+
|
|
|
|
|
+ // 搜索数据
|
|
|
|
|
+ function submitTableQuery() {
|
|
|
|
|
+ if (tableQueryType.value === '姓名') {
|
|
|
|
|
+ tableQueryParams.value.nickname = tableQueryTypeContent.value;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ tableQueryParams.value.username = tableQueryTypeContent.value;
|
|
|
|
|
+ }
|
|
|
|
|
+ emits('tableParamsChanged', tableQueryParams.value);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 重置表单
|
|
|
|
|
+ function resetTable() {
|
|
|
|
|
+ emits('tableParamsChanged', {
|
|
|
|
|
+ pageNumber: 1,
|
|
|
|
|
+ pageSize: 10,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const barData = ref<{
|
|
const barData = ref<{
|
|
|
label: string[];
|
|
label: string[];
|
|
|
val: number[];
|
|
val: number[];
|
|
@@ -170,29 +200,6 @@
|
|
|
label: ['日期1', '日期2', '日期3', '日期4', '日期5', '日期6'],
|
|
label: ['日期1', '日期2', '日期3', '日期4', '日期5', '日期6'],
|
|
|
val: [9, 56, 77, 802, 0, 100],
|
|
val: [9, 56, 77, 802, 0, 100],
|
|
|
});
|
|
});
|
|
|
-
|
|
|
|
|
- // 搜索数据
|
|
|
|
|
- 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();
|
|
|
|
|
- }
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
<style scoped lang="scss">
|
|
@@ -208,4 +215,12 @@
|
|
|
.el-pagination {
|
|
.el-pagination {
|
|
|
margin-top: 30px;
|
|
margin-top: 30px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .table-query-form {
|
|
|
|
|
+ padding-right: 25px;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|