瀏覽代碼

附件改动

xjj 2 年之前
父節點
當前提交
065ee37517
共有 3 個文件被更改,包括 61 次插入45 次删除
  1. 16 6
      src/pages/Detail/CommitAuditModal.js
  2. 13 13
      src/pages/Detail/Index.js
  3. 32 26
      src/pages/Flow/FlowDetail.json

+ 16 - 6
src/pages/Detail/CommitAuditModal.js

@@ -61,7 +61,7 @@ function CommitAuditModal(props) {
     // uploadProps,
     OSSData,
   } = props;
-  console.log(loading);
+  // console.log(loading);
   const [auditId, setAuditId] = useState();
   const [data, setData] = useState([]);
   const [length, setLength] = useState(1);
@@ -230,15 +230,25 @@ function CommitAuditModal(props) {
     return result || [];
   };
 
+  const nextNodesList = useMemo(() => {
+    if (!auditId && !currentNodeId) return [];
+    return getNextNodes(auditId || currentNodeId, 'custom-rect');
+  }, [auditId, currentNodeId, flowDetail]);
+
   const changeAudit = id => {
     let node = flowDetail.nodes.find?.(item => item.Id == id);
-    setAuditId(node.node_id);
+    setAuditId(node?.node_id);
   };
 
   const onChange = (value, approvalProcess) => {
-    if (!value) return;
-    changeAudit(value[value.length - 1]);
-    setAuditListFun(approvalProcess);
+    if (value) {
+      changeAudit(value[value.length - 1]);
+      setAuditListFun(approvalProcess);
+    } else {
+      changeAudit('');
+      setAuditList([]);
+    }
+    form.setFieldValue('next_template_node_id', '');
   };
 
   const getReComputeAudit = (items, changedValues) => {
@@ -589,7 +599,7 @@ function CommitAuditModal(props) {
           // rules={[{ required: true, message: '请选择业务节点' }]}
         >
           <Select style={{ width: '100%' }}>
-            {getNextNodes(auditId || currentNodeId, 'custom-rect').map(item => (
+            {nextNodesList.map(item => (
               <Option key={item.value}>{item.label}</Option>
             ))}
           </Select>

+ 13 - 13
src/pages/Detail/Index.js

@@ -106,15 +106,15 @@ function Detail(props) {
   const cellPosition = useRef({});
 
   useEffect(() => {
-    if (!version.id) return;
+    if (!version.attachment_id) return;
     dispatch({
       type: 'detail/QueryExcelFiles',
       payload: {
-        file_type: 1,
-        excel_id: version.id,
+        // file_type: 1,
+        excel_id: version.attachment_id,
       },
     });
-  }, [version.id]);
+  }, [version.attachment_id]);
 
   const projectId = parseInt(params.projectId);
   const templateId = parseInt(params.templateId);
@@ -713,7 +713,7 @@ function Detail(props) {
       <Menu.Item key="bomDetail">详情</Menu.Item>,
       <Menu.Item key="export">导出</Menu.Item>,
       <Menu.Item key="compare">比对</Menu.Item>,
-      <Menu.Item key="attachment">附件</Menu.Item>,
+      // <Menu.Item key="attachment">附件</Menu.Item>,
     ];
     // version.audit_status:4 为副本。不可操作
     if (version.audit_status != 4) {
@@ -1180,12 +1180,6 @@ function Detail(props) {
         onClose={() => setVersionTreeVisible(false)}
       />
 
-      <CommentContent
-        title="单元格沟通记录"
-        comment={comment}
-        onSubmit={handleSubmitCell}
-        loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
-      />
       <FormAndFilesNode
         title="表单信息及附件"
         formData={version?.ding_schema}
@@ -1193,6 +1187,12 @@ function Detail(props) {
         loading={loading.effects['detail/QueryExcelFiles']}
         downloadFile={downloadFile}
       />
+      <CommentContent
+        title="单元格沟通记录"
+        comment={comment}
+        onSubmit={handleSubmitCell}
+        loading={loading.effects['detail/queryComment'] || loading.effects['detail/addComment']}
+      />
 
       <RightDrawer
         version={version}
@@ -1232,7 +1232,7 @@ function Detail(props) {
         onClose={() => setAuditVisible(false)}
         onOk={onAudit}
       />
-      <FilesModal
+      {/* <FilesModal
         projectId={projectId}
         typeOptions={typeOptions}
         // loading={getFilesLoading()}
@@ -1243,7 +1243,7 @@ function Detail(props) {
         DeleteFile={deleteFile}
         downloadFile={downloadFile}
         data={fileList}
-      />
+      /> */}
       <VersionModal
         typeOptions={typeOptions}
         loading={getLoading()}

+ 32 - 26
src/pages/Flow/FlowDetail.json

@@ -20,7 +20,7 @@
       "parentKey": "1",
       "x": -580,
       "y": -150,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -45,7 +45,7 @@
       "parentKey": "1",
       "x": -290,
       "y": -170,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 5,
       "node_type": 1,
       "count": 0,
@@ -70,7 +70,7 @@
       "parentKey": "1",
       "x": -138,
       "y": -150,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -93,9 +93,9 @@
       },
       "isCustom": true,
       "parentKey": "1",
-      "x": -369,
+      "x": -335,
       "y": 6,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 9,
       "node_type": 1,
       "count": 0,
@@ -118,13 +118,13 @@
       },
       "isCustom": true,
       "parentKey": "1",
-      "x": -162,
+      "x": -138,
       "y": 26,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
-      "role_list": "147"
+      "role_list": ""
     },
     {
       "id": "5216c5dc",
@@ -145,7 +145,7 @@
       "parentKey": "1",
       "x": -580,
       "y": 26,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -170,7 +170,7 @@
       "parentKey": "1",
       "x": -305,
       "y": -304,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -195,7 +195,7 @@
       "parentKey": "1",
       "x": -138,
       "y": -304,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -220,7 +220,7 @@
       "parentKey": "1",
       "x": 356,
       "y": -324,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 2,
       "node_type": 1,
       "count": 0,
@@ -245,11 +245,11 @@
       "parentKey": "1",
       "x": 446,
       "y": -150,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
-      "role_list": "139"
+      "role_list": ""
     },
     {
       "id": "b57b57c8",
@@ -270,7 +270,7 @@
       "parentKey": "1",
       "x": 621,
       "y": -150,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
@@ -295,11 +295,11 @@
       "parentKey": "1",
       "x": 446,
       "y": 26,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 0,
       "node_type": 0,
       "count": 0,
-      "role_list": "139"
+      "role_list": ""
     },
     {
       "id": "3fb8d302",
@@ -320,7 +320,7 @@
       "parentKey": "1",
       "x": 308,
       "y": -170,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 7,
       "node_type": 1,
       "count": 0,
@@ -343,10 +343,10 @@
       },
       "isCustom": true,
       "parentKey": "1",
-      "x": 42,
+      "x": 173,
       "y": 6,
-      "zIndex": 10,
-      "flow_id": 8,
+      "zIndex": 0,
+      "flow_id": 17,
       "node_type": 1,
       "count": 0,
       "role_list": ""
@@ -370,7 +370,7 @@
       "parentKey": "1",
       "x": -425,
       "y": -224,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 3,
       "node_type": 1,
       "count": 0,
@@ -395,7 +395,7 @@
       "parentKey": "1",
       "x": -425,
       "y": -115,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 4,
       "node_type": 1,
       "count": 0,
@@ -420,7 +420,7 @@
       "parentKey": "1",
       "x": 27,
       "y": -224,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 3,
       "node_type": 1,
       "count": 0,
@@ -445,7 +445,7 @@
       "parentKey": "1",
       "x": 27,
       "y": -115,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 4,
       "node_type": 1,
       "count": 0,
@@ -470,7 +470,7 @@
       "parentKey": "1",
       "x": 173,
       "y": -170,
-      "zIndex": 10,
+      "zIndex": 0,
       "flow_id": 5,
       "node_type": 1,
       "count": 0,
@@ -630,6 +630,12 @@
       },
       "target": { "cell": "3fb8d302", "port": "22d16375" },
       "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
+    },
+    {
+      "id": "c28a18d3:a06aba2c-3631eae9:0f06668a",
+      "source": { "cell": "c28a18d3", "port": "a06aba2c" },
+      "target": { "cell": "3631eae9", "port": "0f06668a" },
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     }
   ]
 }