|
|
@@ -17,38 +17,39 @@
|
|
|
>
|
|
|
学生考勤
|
|
|
</div>
|
|
|
- <div
|
|
|
+ <!-- <div
|
|
|
class="button"
|
|
|
:class="currentIndex === 1 ? 'active' : ''"
|
|
|
@click="handleChange(1)"
|
|
|
>
|
|
|
教师考勤
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
+
|
|
|
<!-- 考勤统计区域 -->
|
|
|
<div class="sub_title">考勤统计</div>
|
|
|
<div class="stat_msg">
|
|
|
<div class="msg_change">
|
|
|
<div
|
|
|
class="change_box"
|
|
|
- :class="currentTimeRang === 0 ? 'active' : ''"
|
|
|
- @click="changeTimeRang(0)"
|
|
|
+ :class="currentTimeRang === 3 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang(3)"
|
|
|
>
|
|
|
- 本学期
|
|
|
+ 近7天
|
|
|
</div>
|
|
|
<div
|
|
|
class="change_box"
|
|
|
- :class="currentTimeRang === 1 ? 'active' : ''"
|
|
|
- @click="changeTimeRang(1)"
|
|
|
+ :class="currentTimeRang === 2 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang(2)"
|
|
|
>
|
|
|
- 本周
|
|
|
+ 近30天
|
|
|
</div>
|
|
|
<div
|
|
|
class="change_box"
|
|
|
- :class="currentTimeRang === 2 ? 'active' : ''"
|
|
|
- @click="changeTimeRang(2)"
|
|
|
+ :class="currentTimeRang === 1 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang(1)"
|
|
|
>
|
|
|
- 本月
|
|
|
+ 本学期
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
@@ -82,14 +83,43 @@
|
|
|
<!-- 搜索框区域 -->
|
|
|
<div class="record_search">
|
|
|
<div class="search_input">
|
|
|
- <input type="text" placeholder="请输入部门查询" />
|
|
|
+ <input
|
|
|
+ type="text"
|
|
|
+ placeholder="请输入部门查询"
|
|
|
+ v-model="keyWord"
|
|
|
+ @keyup.enter="handleSerch"
|
|
|
+ />
|
|
|
</div>
|
|
|
<div class="search_btn" @click="handleSerch">查询</div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 筛选框区域 -->
|
|
|
<div class="record_select">
|
|
|
- 时间
|
|
|
+ <div class="select_change">
|
|
|
+ <div
|
|
|
+ class="select_box"
|
|
|
+ :class="currentTimeRang_check === 3 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang_check(3)"
|
|
|
+ >
|
|
|
+ 近7天
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="select_box"
|
|
|
+ :class="currentTimeRang_check === 2 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang_check(2)"
|
|
|
+ >
|
|
|
+ 近30天
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="select_box"
|
|
|
+ :class="currentTimeRang_check === 1 ? 'active' : ''"
|
|
|
+ @click="changeTimeRang_check(1)"
|
|
|
+ >
|
|
|
+ 本学期
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 时间
|
|
|
<el-select
|
|
|
v-model="valueTime"
|
|
|
placeholder="请选择时间"
|
|
|
@@ -114,50 +144,41 @@
|
|
|
:label="item.label"
|
|
|
:value="item.value"
|
|
|
/>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
</div>
|
|
|
|
|
|
<!-- 表格区域 -->
|
|
|
<div class="record_form form">
|
|
|
<el-table :data="tableData">
|
|
|
+ <el-table-column prop="className" label="部门" align="center" />
|
|
|
+
|
|
|
<el-table-column
|
|
|
- prop="class"
|
|
|
- label="部门"
|
|
|
- align="center"
|
|
|
- width="60"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="type"
|
|
|
- label="考勤类别"
|
|
|
- align="center"
|
|
|
- width="60"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="leave"
|
|
|
+ prop="askForLeave"
|
|
|
label="请假"
|
|
|
align="center"
|
|
|
width="50"
|
|
|
/>
|
|
|
+
|
|
|
+ <el-table-column label="超时打卡" align="center" width="60">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ row.clockOut ? row.clockOut : 0 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
- prop="timeout"
|
|
|
- label="超时打卡"
|
|
|
- align="center"
|
|
|
- width="60"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="late"
|
|
|
+ prop="beLate"
|
|
|
label="迟到"
|
|
|
align="center"
|
|
|
width="50"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="not"
|
|
|
+ prop="notClockingIn"
|
|
|
label="未打卡"
|
|
|
align="center"
|
|
|
width="60"
|
|
|
/>
|
|
|
<el-table-column
|
|
|
- prop="normal"
|
|
|
+ prop="punctuality"
|
|
|
label="正常"
|
|
|
align="center"
|
|
|
width="62"
|
|
|
@@ -171,10 +192,11 @@
|
|
|
v-model:current-page="currentPage"
|
|
|
v-model:page-size="pageSize"
|
|
|
layout="prev, pager, next, jumper"
|
|
|
- :total="1000"
|
|
|
+ :total="total"
|
|
|
:pager-count="5"
|
|
|
small
|
|
|
background
|
|
|
+ hide-on-single-page
|
|
|
@current-change="handleCurrentChange"
|
|
|
/>
|
|
|
</div>
|
|
|
@@ -186,12 +208,20 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref, onMounted } from "vue";
|
|
|
import { countUpNum } from "@/utils/countUpNum";
|
|
|
-
|
|
|
-const statValue = ref(50);
|
|
|
-const statValue2 = ref(50);
|
|
|
-const statValue3 = ref(50);
|
|
|
-const statValue4 = ref(50);
|
|
|
-const statValue5 = ref(50);
|
|
|
+import { reqGetStudentCheckin, reqGetCheckList } from "@/api/user/index";
|
|
|
+// 引入解密函数
|
|
|
+import { decryptDes } from "@/utils/des";
|
|
|
+
|
|
|
+// 正常
|
|
|
+const statValue = ref(0);
|
|
|
+// 请假
|
|
|
+const statValue2 = ref(0);
|
|
|
+// 迟到
|
|
|
+const statValue3 = ref(0);
|
|
|
+// 超时打卡
|
|
|
+const statValue4 = ref(0);
|
|
|
+// 未打卡
|
|
|
+const statValue5 = ref(0);
|
|
|
|
|
|
const statDom = ref();
|
|
|
const statDom2 = ref();
|
|
|
@@ -201,163 +231,146 @@ const statDom5 = ref();
|
|
|
|
|
|
// 切换学生教师考勤 0学生 1教师
|
|
|
const currentIndex = ref(0);
|
|
|
-// 切换考勤统计时间 0本学期 1本周 2本月
|
|
|
-const currentTimeRang = ref(0);
|
|
|
+
|
|
|
+// 切换考勤统计时间 1本学期 3近7天 2近30天
|
|
|
+const currentTimeRang = ref(3);
|
|
|
+
|
|
|
+// 切换考勤记录时间 1本学期 3近7天 2近30天
|
|
|
+const currentTimeRang_check = ref(3);
|
|
|
+
|
|
|
+// 搜索框绑定数据
|
|
|
+const keyWord = ref("");
|
|
|
+
|
|
|
// 分页器当前页
|
|
|
const currentPage = ref(1);
|
|
|
// 每页多少条
|
|
|
const pageSize = ref(8);
|
|
|
+// 总条数
|
|
|
+const total = ref(0);
|
|
|
// 时间筛选框绑定数据
|
|
|
-const valueTime = ref("");
|
|
|
+// const valueTime = ref("");
|
|
|
// 类别筛选框绑定数据
|
|
|
-const valueType = ref("");
|
|
|
+// const valueType = ref("");
|
|
|
// 类别筛选框绑定数组
|
|
|
-const optionsType = [
|
|
|
- {
|
|
|
- value: "0",
|
|
|
- label: "全部",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "1",
|
|
|
- label: "请假",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "2",
|
|
|
- label: "迟到",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "3",
|
|
|
- label: "超时打卡",
|
|
|
- },
|
|
|
-];
|
|
|
+// const optionsType = [
|
|
|
+// {
|
|
|
+// value: "0",
|
|
|
+// label: "全部",
|
|
|
+// },
|
|
|
+// {
|
|
|
+// value: "1",
|
|
|
+// label: "请假",
|
|
|
+// },
|
|
|
+// {
|
|
|
+// value: "2",
|
|
|
+// label: "迟到",
|
|
|
+// },
|
|
|
+// {
|
|
|
+// value: "3",
|
|
|
+// label: "超时打卡",
|
|
|
+// },
|
|
|
+// ];
|
|
|
// 时间筛选框绑定数组
|
|
|
-const optionsTime = [
|
|
|
- {
|
|
|
- value: "0",
|
|
|
- label: "今日",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "1",
|
|
|
- label: "本周",
|
|
|
- },
|
|
|
- {
|
|
|
- value: "2",
|
|
|
- label: "本月",
|
|
|
- },
|
|
|
-];
|
|
|
+// const optionsTime = [
|
|
|
+// {
|
|
|
+// value: "0",
|
|
|
+// label: "今日",
|
|
|
+// },
|
|
|
+// {
|
|
|
+// value: "1",
|
|
|
+// label: "本周",
|
|
|
+// },
|
|
|
+// {
|
|
|
+// value: "2",
|
|
|
+// label: "本月",
|
|
|
+// },
|
|
|
+// ];
|
|
|
|
|
|
// 考勤记录表格数据
|
|
|
-const tableData = [
|
|
|
- {
|
|
|
- class: "七(15)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
- {
|
|
|
- class: "七(5)班",
|
|
|
- type: "123",
|
|
|
- leave: "13",
|
|
|
- timeout: "45",
|
|
|
- late: "123",
|
|
|
- not: "41",
|
|
|
- normal: "246",
|
|
|
- },
|
|
|
-];
|
|
|
+const tableData = ref<any>([]);
|
|
|
|
|
|
onMounted(() => {
|
|
|
- getCountUpNum();
|
|
|
+ // 学生考勤统计
|
|
|
+ getStudentCheckin();
|
|
|
+ // 考勤记录列表数据
|
|
|
+ getCheckList();
|
|
|
});
|
|
|
|
|
|
+// 学生考勤统计
|
|
|
+const getStudentCheckin = async () => {
|
|
|
+ const res = await reqGetStudentCheckin({
|
|
|
+ dateTime: currentTimeRang.value,
|
|
|
+ });
|
|
|
+ // console.log(res);
|
|
|
+ if ((res as any).code == 200) {
|
|
|
+ const result = JSON.parse(decryptDes(res.data));
|
|
|
+ // console.log(result);
|
|
|
+
|
|
|
+ statValue.value = result.punctuality;
|
|
|
+ statValue2.value = result.askForLeave;
|
|
|
+ statValue3.value = result.beLate;
|
|
|
+ statValue4.value = result.clockOut;
|
|
|
+ statValue5.value = result.notClockingIn;
|
|
|
+
|
|
|
+ // 让数字跳动
|
|
|
+ getCountUpNum();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 考勤记录列表数据
|
|
|
+const getCheckList = async () => {
|
|
|
+ const res = await reqGetCheckList({
|
|
|
+ dateTime: currentTimeRang_check.value,
|
|
|
+ currentPage: currentPage.value,
|
|
|
+ pageCount: pageSize.value,
|
|
|
+ className: keyWord.value,
|
|
|
+ });
|
|
|
+ // console.log(res);
|
|
|
+ if ((res as any).code == 200) {
|
|
|
+ const result = JSON.parse(decryptDes(res.data));
|
|
|
+ // console.log(result);
|
|
|
+ tableData.value = result.records;
|
|
|
+ total.value = result.total;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
// 学生教师考勤切换按钮回调
|
|
|
const handleChange = (value: number) => {
|
|
|
if (currentIndex.value !== value) {
|
|
|
- if (value === 0) {
|
|
|
- currentIndex.value = 0;
|
|
|
- } else if (value === 1) {
|
|
|
- currentIndex.value = 1;
|
|
|
- }
|
|
|
+ currentIndex.value = value;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 考勤统计切换时间范围按钮回调
|
|
|
const changeTimeRang = (value: number) => {
|
|
|
if (currentTimeRang.value !== value) {
|
|
|
- if (value === 0) {
|
|
|
- currentTimeRang.value = 0;
|
|
|
- } else if (value === 1) {
|
|
|
- currentTimeRang.value = 1;
|
|
|
- } else if (value === 2) {
|
|
|
- currentTimeRang.value = 2;
|
|
|
- }
|
|
|
+ currentTimeRang.value = value;
|
|
|
+ getStudentCheckin();
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 考勤记录切换时间范围按钮回调
|
|
|
+const changeTimeRang_check = (value: number) => {
|
|
|
+ if (currentTimeRang_check.value !== value) {
|
|
|
+ currentTimeRang_check.value = value;
|
|
|
+ tableData.value = [];
|
|
|
+ currentPage.value = 1;
|
|
|
+ getCheckList();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// 改变分页器当前页时的回调
|
|
|
const handleCurrentChange = (value: number) => {
|
|
|
- console.log(value);
|
|
|
+ tableData.value = [];
|
|
|
+ currentPage.value = value;
|
|
|
+ getCheckList();
|
|
|
};
|
|
|
|
|
|
// 查询按钮回调
|
|
|
const handleSerch = () => {
|
|
|
- console.log(111);
|
|
|
+ tableData.value = [];
|
|
|
+ currentPage.value = 1;
|
|
|
+ getCheckList();
|
|
|
};
|
|
|
|
|
|
const getCountUpNum = () => {
|
|
|
@@ -549,6 +562,33 @@ const getCountUpNum = () => {
|
|
|
margin-top: 20px;
|
|
|
height: 32px;
|
|
|
font-size: 14px;
|
|
|
+
|
|
|
+ .select_change {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin: 22px 0 22px 195px;
|
|
|
+ padding: 2px;
|
|
|
+ width: 200px;
|
|
|
+ height: 32px;
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 2px;
|
|
|
+ border: 1px solid #9c9c9c;
|
|
|
+
|
|
|
+ .select_box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 61px;
|
|
|
+ border-radius: 2px;
|
|
|
+ background-color: rgba(114, 151, 179, 0.3);
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ .active {
|
|
|
+ border: 1px solid #70b7fa;
|
|
|
+ background-color: rgba(114, 151, 179, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.record_form {
|