|
|
|
@ -18,6 +18,7 @@ |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="flow-time" |
|
|
|
class="flow-time" |
|
|
|
:danger="shouldHighlight(item)" |
|
|
|
:danger="shouldHighlight(item)" |
|
|
|
|
|
|
|
:title="getOvertimeTip(item)" |
|
|
|
> |
|
|
|
> |
|
|
|
<span class="second mr-8">用时</span> |
|
|
|
<span class="second mr-8">用时</span> |
|
|
|
<span class="primary">{{ |
|
|
|
<span class="primary">{{ |
|
|
|
@ -68,10 +69,29 @@ catchStore.getDicts(["approveShouldHighlight"]); |
|
|
|
// 在 computed 中通过 store 直接访问 |
|
|
|
// 在 computed 中通过 store 直接访问 |
|
|
|
const highlightKeywords = computed(() => catchStore.dict.approveShouldHighlight || []); |
|
|
|
const highlightKeywords = computed(() => catchStore.dict.approveShouldHighlight || []); |
|
|
|
const shouldHighlight = (item) => { |
|
|
|
const shouldHighlight = (item) => { |
|
|
|
debugger |
|
|
|
|
|
|
|
const keywords = highlightKeywords.value; |
|
|
|
const keywords = highlightKeywords.value; |
|
|
|
const matchKeyword = keywords.some(k => item.actionName?.includes(k.dictLabel)); |
|
|
|
const matchKeyword = keywords.some(k => item.actionName?.includes(k.dictLabel)); |
|
|
|
return item.duration > 86400 && matchKeyword; |
|
|
|
if (!matchKeyword) return false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return item.duration > 86400; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const getOvertimeTip = (item) => { |
|
|
|
|
|
|
|
const keywords = highlightKeywords.value; |
|
|
|
|
|
|
|
const matchKeyword = keywords.some(k => item.actionName?.includes(k.dictLabel)); |
|
|
|
|
|
|
|
if (!matchKeyword || !item.duration) { |
|
|
|
|
|
|
|
return ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (item.duration <= 86400) { |
|
|
|
|
|
|
|
return ''; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const overtimeSeconds = item.duration - 86400; |
|
|
|
|
|
|
|
const days = Math.floor(overtimeSeconds / 86400); |
|
|
|
|
|
|
|
const hours = Math.floor((overtimeSeconds % 86400) / 3600); |
|
|
|
|
|
|
|
const minutes = Math.floor((overtimeSeconds % 3600) / 60); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return `超时 ${days}天${hours}时${minutes}分`; |
|
|
|
} |
|
|
|
} |
|
|
|
const activeHistory = ref({}) |
|
|
|
const activeHistory = ref({}) |
|
|
|
function handleShowDetai(item) { |
|
|
|
function handleShowDetai(item) { |
|
|
|
|