|
@@ -114,6 +114,13 @@ function Detail(props) {
|
|
localStorage['JWT-TOKEN'] = TOKEN;
|
|
localStorage['JWT-TOKEN'] = TOKEN;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const node = useMemo(() => {
|
|
|
|
+ if (version.template_node_id && flowDetail.nodes.length > 0) {
|
|
|
|
+ return flowDetail.nodes.find(item => item.Id == version.template_node_id);
|
|
|
|
+ }
|
|
|
|
+ return null;
|
|
|
|
+ }, [flowDetail, version.template_node_id]);
|
|
|
|
+
|
|
const flow = useMemo(() => {
|
|
const flow = useMemo(() => {
|
|
let data = {
|
|
let data = {
|
|
active: 0,
|
|
active: 0,
|
|
@@ -270,7 +277,7 @@ function Detail(props) {
|
|
await queryDelSheetRecord(params);
|
|
await queryDelSheetRecord(params);
|
|
};
|
|
};
|
|
|
|
|
|
- const onAudit = (data) => {
|
|
|
|
|
|
+ const onAudit = data => {
|
|
const flowNode = flow.currentNode;
|
|
const flowNode = flow.currentNode;
|
|
dispatch({
|
|
dispatch({
|
|
type: 'detail/approve',
|
|
type: 'detail/approve',
|
|
@@ -279,7 +286,7 @@ function Detail(props) {
|
|
project_id: projectId,
|
|
project_id: projectId,
|
|
flow_id: flowNode.flow_id,
|
|
flow_id: flowNode.flow_id,
|
|
node_id: flowNode.seq,
|
|
node_id: flowNode.seq,
|
|
- ...data
|
|
|
|
|
|
+ ...data,
|
|
},
|
|
},
|
|
callback: newVersion => {
|
|
callback: newVersion => {
|
|
setAuditVisible(false);
|
|
setAuditVisible(false);
|
|
@@ -442,11 +449,9 @@ function Detail(props) {
|
|
|
|
|
|
//是否展示psr表上面的按钮
|
|
//是否展示psr表上面的按钮
|
|
const showPsrBtns = useMemo(() => {
|
|
const showPsrBtns = useMemo(() => {
|
|
- let Id = version.template_node_id;
|
|
|
|
- const node = flowDetail.nodes.find?.(item => item.Id == Id);
|
|
|
|
- if (node?.node_type_psr >= 1 && node?.node_type_psr <= 4) return true;
|
|
|
|
|
|
+ if (node?.node_type_psr == 3 || node?.node_type_psr == 4) return true;
|
|
return false;
|
|
return false;
|
|
- }, [flowDetail, version]);
|
|
|
|
|
|
+ }, [node]);
|
|
|
|
|
|
const getUser = newUser => {
|
|
const getUser = newUser => {
|
|
try {
|
|
try {
|
|
@@ -627,6 +632,7 @@ function Detail(props) {
|
|
permissions={currentUser.Permission}
|
|
permissions={currentUser.Permission}
|
|
version={version}
|
|
version={version}
|
|
templateId={templateId}
|
|
templateId={templateId}
|
|
|
|
+ node={node}
|
|
getUser={getUser}
|
|
getUser={getUser}
|
|
onUpdate={onUpdate}
|
|
onUpdate={onUpdate}
|
|
onDelSheet={onDelSheet}
|
|
onDelSheet={onDelSheet}
|