fix: 修改移动端重新提交后表单状态 (#1357)

Reviewed-on: daoyoucloud/tachybase#1357
Co-authored-by: wjh <wwwjh0710@163.com>
Co-committed-by: wjh <wwwjh0710@163.com>
This commit is contained in:
wjh 2024-07-22 13:47:00 +08:00 committed by bai.zixv
parent f8fb5b187a
commit 168eccbdf1

View File

@ -5,17 +5,22 @@ import { useForm } from '@tachybase/schema';
import { ApprovalStatusEnums } from '../../constants';
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
import { useResubmit } from '../provider/Resubmit.provider';
export function useFormBlockProps() {
const { approval, id } = useContextApprovalExecution();
const { workflow } = approval;
const form = useForm();
const { data } = useCurrentUserContext();
const { isResubmit } = useResubmit();
const { editable } = ApprovalStatusEnums.find((value) => value.value === approval.status);
const needEditable =
editable && approval?.latestExecutionId === id && approval?.createdById === data?.data.id && workflow.enabled;
(isResubmit || editable) &&
approval?.latestExecutionId === id &&
approval?.createdById === data?.data.id &&
workflow.enabled;
useEffect(() => {
if (!approval) {