From e5b5958b972bacb0d4bf1162b82d998e1767ef2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Thu, 25 Sep 2025 16:38:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=B5=B4=E6=A0=A1?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/exam/classDetails.vue | 2 +- src/views/exam/index.vue | 2 +- src/views/toschoolinfomanage/addModal.vue | 7 ++++--- src/views/toschoolinfomanage/config.ts | 4 ++++ src/views/toschoolinfomanage/index.vue | 12 ++++++------ 5 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 src/views/toschoolinfomanage/config.ts diff --git a/src/views/exam/classDetails.vue b/src/views/exam/classDetails.vue index 1389c58..8644ce0 100644 --- a/src/views/exam/classDetails.vue +++ b/src/views/exam/classDetails.vue @@ -53,7 +53,7 @@ const tableData: TableConfig = intTableData({ show: true, label: "删除", click: deleteInfo, - btnStyle: "danger", // topBtn: true才生效 success danger + btnStyle: "warning", // topBtn: true才生效 success danger }, { topBtn: false, // 头部按钮 diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue index 3ed049c..0993ed2 100644 --- a/src/views/exam/index.vue +++ b/src/views/exam/index.vue @@ -96,7 +96,7 @@ const tableData: TableConfig = intTableData({ show: true, label: "录入成绩", click: entryExam, - btnStyle: "primary", // topBtn: true才生效 success danger + btnStyle: "warning", // topBtn: true才生效 success danger }, { topBtn: true, // 头部按钮 diff --git a/src/views/toschoolinfomanage/addModal.vue b/src/views/toschoolinfomanage/addModal.vue index 7819f76..cee1f21 100644 --- a/src/views/toschoolinfomanage/addModal.vue +++ b/src/views/toschoolinfomanage/addModal.vue @@ -93,9 +93,9 @@
- 提示:到期前{3天}会黄色警告, 小于{1天}{ {{ warningDay }}天}黄色警告, 超过预计完成时间{ {{ errorDay }}天}红色警告
@@ -184,6 +184,7 @@ import { ref, reactive, computed, defineProps, defineEmits, watch } from "vue"; import type { FormInstance, FormRules } from "element-plus"; import { ElMessage } from "element-plus"; import { getSchoolData } from "@/api/userCenter"; +import { errorDay, warningDay } from "./config"; import { getSchoolBusinessPeopleListApi, addOrEditApi } from "@/api/toschoolinfomanage"; const props = defineProps<{ visible: boolean }>(); // const emit = defineEmits<{ (e: "update:visible", value: boolean): void }>(); diff --git a/src/views/toschoolinfomanage/config.ts b/src/views/toschoolinfomanage/config.ts new file mode 100644 index 0000000..54aae9c --- /dev/null +++ b/src/views/toschoolinfomanage/config.ts @@ -0,0 +1,4 @@ +/** 赴校后超时时间 */ +export const warningDay = 8; +/** 赴校任务过期时间 */ +export const errorDay = 2; \ No newline at end of file diff --git a/src/views/toschoolinfomanage/index.vue b/src/views/toschoolinfomanage/index.vue index 7802a43..b8f3aeb 100644 --- a/src/views/toschoolinfomanage/index.vue +++ b/src/views/toschoolinfomanage/index.vue @@ -198,6 +198,7 @@ import AddModal from "./addModal.vue"; import { Check, Search } from "@element-plus/icons-vue"; import EditModal from "./editModal.vue"; import { message } from "@/utils/message"; +import { errorDay, warningDay } from "./config"; interface TableItem { id: number; school: string; @@ -223,13 +224,12 @@ const tableRowClassName = ({ row, rowIndex }: { row: TableItem; rowIndex: number const nD = new Date(); const d = new Date(row.endTime + " "); const startTime = new Date(row.times + " "); - const daysDiff1 = Math.floor( - (nD.getTime() - startTime.getTime()) / (1000 * 60 * 60 * 24) - ); - const daysDiff = Math.floor((d.getTime() - nD.getTime()) / (1000 * 60 * 60 * 24)); - if (daysDiff < -1) { + const daysDiff1 = (nD.getTime() - startTime.getTime()) / (1000 * 60 * 60 * 24); + debugger; + const daysDiff = (d.getTime() - nD.getTime()) / (1000 * 60 * 60 * 24); + if (daysDiff <= -errorDay) { return "error-row"; - } else if (daysDiff1 > 7) { + } else if (daysDiff1 >= warningDay) { return "warning-row"; } return ""; -- 2.40.1