Merge pull request '优化 赴校任务超时时间' (#19) from dev into staging

Reviewed-on: #19
This commit is contained in:
hy 2025-09-25 16:41:34 +08:00
commit de8c416266
5 changed files with 16 additions and 11 deletions

View File

@ -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, //

View File

@ -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, //

View File

@ -93,9 +93,9 @@
</el-col>
<el-col :span="12">
<div>
提示:到期前<span class="text-yellow-500">{3}</span>会黄色警告, 小于<span
class="text-red-500"
>{1}</span
提示:离赴校时间超过<span class="text-yellow-500">{ {{ warningDay }}}</span
>黄色警告, 超过预计完成时间<span class="text-red-500"
>{ {{ errorDay }}}</span
>红色警告
</div>
</el-col>
@ -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 }>();

View File

@ -0,0 +1,4 @@
/** 赴校后超时时间 */
export const warningDay = 8;
/** 赴校任务过期时间 */
export const errorDay = 2;

View File

@ -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 "";