fix(加班申请): 修复加班申请中,和状态机相关的代码的不合理的地方。

This commit is contained in:
dk
2026-06-03 21:04:51 +08:00
parent d3d0830820
commit 9d84b1aae0
2 changed files with 12 additions and 4 deletions

View File

@@ -51,7 +51,15 @@ const reasonLabel = computed(() => {
return map[props.actionType];
});
const reasonRequired = computed(() => props.actionType !== 'approve');
const reasonRequired = computed(() => props.actionType === 'reject');
const reasonPlaceholder = computed(() => {
if (reasonRequired.value) {
return `请输入${reasonLabel.value}`;
}
return props.actionType === 'cancel' ? '可填写撤销原因' : '可填写审核意见';
});
const rules = computed(() => ({
reason: reasonRequired.value
@@ -105,7 +113,7 @@ watch(
:rows="5"
maxlength="1000"
show-word-limit
:placeholder="reasonRequired ? `请输入${reasonLabel}` : '可填写审核意见'"
:placeholder="reasonPlaceholder"
/>
</ElFormItem>
</ElForm>