|
|
|
@ -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({}) |
|
|
|
|