Browse Source

fix: 标红时长为2、3天的版本

master
parent
commit
c880608464
  1. 27
      src/components/negative/action-history.vue

27
src/components/negative/action-history.vue

@ -63,34 +63,21 @@ function getConsumingTime(crtTime, index) {
} }
return moment(crtTime).diff(moment(actionHistory.value[index - 1].crtTime), "seconds") return moment(crtTime).diff(moment(actionHistory.value[index - 1].crtTime), "seconds")
} }
const catchStore = useCatchStore();
//
catchStore.getDicts(["approveShouldHighlight"]);
// computed store 访
const highlightKeywords = computed(() => catchStore.dict.approveShouldHighlight || []);
const shouldHighlight = (item) => {
const keywords = highlightKeywords.value;
const matchKeyword = keywords.some(k => item.actionName?.includes(k.dictLabel));
if (!matchKeyword) return false;
return item.duration > 86400; // 使 timeoutFlag
} const shouldHighlight = (item) => {
const getOvertimeTip = (item) => { return item.timeoutFlag === true;
const keywords = highlightKeywords.value;
const matchKeyword = keywords.some(k => item.actionName?.includes(k.dictLabel));
if (!matchKeyword || !item.duration) {
return '';
} }
if (item.duration <= 86400) { // 使 overtimeStatus overtimeDuration
const getOvertimeTip = (item) => {
if (!item.timeoutFlag || !item.duration) {
return ''; return '';
} }
const overtimeSeconds = item.overtimeDuration || 0;
const overtimeSeconds = item.duration - 86400;
const days = Math.floor(overtimeSeconds / 86400); const days = Math.floor(overtimeSeconds / 86400);
const hours = Math.floor((overtimeSeconds % 86400) / 3600); const hours = Math.floor((overtimeSeconds % 86400) / 3600);
const minutes = Math.floor((overtimeSeconds % 3600) / 60); const minutes = Math.floor((overtimeSeconds % 3600) / 60);
return `超时 ${days}${hours}${minutes}`; return `超时 ${days}${hours}${minutes}`;
} }
const activeHistory = ref({}) const activeHistory = ref({})

Loading…
Cancel
Save