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:
parent
f8fb5b187a
commit
168eccbdf1
@ -5,17 +5,22 @@ import { useForm } from '@tachybase/schema';
|
|||||||
|
|
||||||
import { ApprovalStatusEnums } from '../../constants';
|
import { ApprovalStatusEnums } from '../../constants';
|
||||||
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
import { useContextApprovalExecution } from '../../context/ApprovalExecution';
|
||||||
|
import { useResubmit } from '../provider/Resubmit.provider';
|
||||||
|
|
||||||
export function useFormBlockProps() {
|
export function useFormBlockProps() {
|
||||||
const { approval, id } = useContextApprovalExecution();
|
const { approval, id } = useContextApprovalExecution();
|
||||||
const { workflow } = approval;
|
const { workflow } = approval;
|
||||||
const form = useForm();
|
const form = useForm();
|
||||||
const { data } = useCurrentUserContext();
|
const { data } = useCurrentUserContext();
|
||||||
|
const { isResubmit } = useResubmit();
|
||||||
|
|
||||||
const { editable } = ApprovalStatusEnums.find((value) => value.value === approval.status);
|
const { editable } = ApprovalStatusEnums.find((value) => value.value === approval.status);
|
||||||
|
|
||||||
const needEditable =
|
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(() => {
|
useEffect(() => {
|
||||||
if (!approval) {
|
if (!approval) {
|
||||||
|
Loading…
Reference in New Issue
Block a user