From 8aed1536bd13f807bd2f4e53b1a2933787552e4d Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Fri, 19 Sep 2025 15:56:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=93=8D=E4=BD=9C=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/attendance/statistical.js | 8 +++ src/plugins/DateUtils.js | 44 +++++++++++- .../statistical/DataComparison/index.vue | 69 +++++++++++++++++++ src/views/attendance/statistical/index.vue | 52 +++++++++++++- src/views/personnelMatters/leave/index.vue | 18 ++++- src/views/system/staff/index.vue | 16 ++++- 6 files changed, 200 insertions(+), 7 deletions(-) create mode 100644 src/views/attendance/statistical/DataComparison/index.vue diff --git a/src/api/attendance/statistical.js b/src/api/attendance/statistical.js index 0892515..e7762be 100644 --- a/src/api/attendance/statistical.js +++ b/src/api/attendance/statistical.js @@ -35,3 +35,11 @@ export function updateStatistical(data) { data: data }) } + + +export function getAttendanceOper(id){ + return request({ + url: '/attendance/statistical/oper/' + id, + method: 'get' + }) +} \ No newline at end of file diff --git a/src/plugins/DateUtils.js b/src/plugins/DateUtils.js index 4e7ad3d..3105e85 100644 --- a/src/plugins/DateUtils.js +++ b/src/plugins/DateUtils.js @@ -11,5 +11,47 @@ export default{ lastDay.setMonth(lastDay.getMonth() + 1, 0); // 设置日期为下个月的第一天的前一天,即当前月的最后一天 // 格式化日期为YYYY-MM-DD格式 return lastDay.toISOString().slice(0, 10); - } + }, + + formatDate(date, pattern){ + // 如果是时间戳,先转换为 Date 对象 + if (typeof date === 'number') { + date = new Date(date); + } + // 如果是字符串,尝试转换为 Date 对象 + if (typeof date === 'string') { + date = new Date(date.replace(/-/g, '/')); // 处理 Safari 兼容性 + } + + const options = { + year: 'numeric', + month: '2-digit', + day: '2-digit', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hour12: false // 24小时制 + }; + + // 简单格式直接返回 + if (pattern === 'yyyy-MM-dd HH:mm:ss') { + return date.toLocaleString('zh-CN', options).replace(/\//g, '-'); + } + + // 自定义格式解析(示例支持 yyyy、MM、dd、HH、mm、ss) + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hour = String(date.getHours()).padStart(2, '0'); + const minute = String(date.getMinutes()).padStart(2, '0'); + const second = String(date.getSeconds()).padStart(2, '0'); + + return pattern.replace('yyyy', year) + .replace('MM', month) + .replace('dd', day) + .replace('HH', hour) + .replace('mm', minute) + .replace('ss', second); + + } } \ No newline at end of file diff --git a/src/views/attendance/statistical/DataComparison/index.vue b/src/views/attendance/statistical/DataComparison/index.vue new file mode 100644 index 0000000..8be38bf --- /dev/null +++ b/src/views/attendance/statistical/DataComparison/index.vue @@ -0,0 +1,69 @@ + + + + diff --git a/src/views/attendance/statistical/index.vue b/src/views/attendance/statistical/index.vue index efb375c..9fe7846 100644 --- a/src/views/attendance/statistical/index.vue +++ b/src/views/attendance/statistical/index.vue @@ -6,6 +6,7 @@ + 修改 + 操作记录 @@ -362,11 +370,30 @@ + +
+ + + +
+ 数据修改人: {{activity.operationAccount}} +
+ +
+
+
+
+
+