瀏覽代碼

修改bom审批节点不能刷新

Renxy 2 年之前
父節點
當前提交
d0c9460d43

+ 15 - 33
src/components/Flow/node/control-map-service/components/edge.tsx

@@ -1,17 +1,7 @@
 import React, { useState, useEffect } from 'react';
 import { FlowchartFormWrapper } from '@antv/xflow';
-import {
-  ColorPicker,
-  InputNumberFiled,
-  InputFiled,
-  SelectField,
-} from '../../fields';
-import {
-  PREFIX,
-  DefaultEdgeConfig,
-  ArrowStrokeMaps,
-  ArrowMaps,
-} from '../../constants';
+import { ColorPicker, InputNumberFiled, InputFiled, SelectField } from '../../fields';
+import { PREFIX, DefaultEdgeConfig, ArrowStrokeMaps, ArrowMaps } from '../../constants';
 
 export type MarkerCfg = {
   width?: number;
@@ -43,7 +33,7 @@ const EdgeComponent = (props: any) => {
     ...DefaultEdgeConfig,
     ...config,
   });
-  console.log(DefaultEdgeConfig, config);
+  console.log(edgeConfig);
 
   useEffect(() => {
     setEdgeConfig({
@@ -75,15 +65,13 @@ const EdgeComponent = (props: any) => {
   const getSrokeDashValue = () => {
     const { attrs = {} } = edgeConfig;
     const { line = {} } = attrs;
-    return line.strokeDasharray && line.strokeDasharray[0] == 5
-      ? 'dash'
-      : 'solid';
+    return line.strokeDasharray && line.strokeDasharray[0] == 5 ? 'dash' : 'solid';
   };
 
   const onEdgeConfigChange = (
     key: string,
     value: number | string | object,
-    type: string = 'line',
+    type: string = 'line'
   ) => {
     /** 全量更新,简化逻辑 */
     if (key === 'arrow') {
@@ -116,7 +104,7 @@ const EdgeComponent = (props: any) => {
         [key]: value,
       },
       type,
-      key === 'arrow' ? 'arrow' : '',
+      key === 'arrow' ? 'arrow' : ''
     );
   };
 
@@ -127,7 +115,7 @@ const EdgeComponent = (props: any) => {
         <InputFiled
           label="标签"
           value={edgeConfig.label}
-          onChange={(value) => {
+          onChange={value => {
             onEdgeConfigChange('label', value);
           }}
         />
@@ -157,12 +145,8 @@ const EdgeComponent = (props: any) => {
               value: 'none',
             },
           ]}
-          onChange={(value) => {
-            onEdgeConfigChange(
-              'arrow',
-              ArrowMaps[value as keyof typeof ArrowMaps],
-              'line',
-            );
+          onChange={value => {
+            onEdgeConfigChange('arrow', ArrowMaps[value as keyof typeof ArrowMaps], 'line');
           }}
         />
 
@@ -181,18 +165,18 @@ const EdgeComponent = (props: any) => {
                 value: 'dash',
               },
             ]}
-            onChange={(value) => {
+            onChange={value => {
               onEdgeConfigChange(
                 'strokeDasharray',
                 ArrowStrokeMaps[value as keyof typeof ArrowStrokeMaps],
-                'line',
+                'line'
               );
             }}
           />
           <InputNumberFiled
             value={getAttrs('strokeWidth')}
             min={1}
-            onChange={(value) => {
+            onChange={value => {
               onEdgeConfigChange('strokeWidth', value, 'line');
             }}
           />
@@ -213,7 +197,7 @@ const EdgeComponent = (props: any) => {
             min={10}
             width={68}
             value={getAttrs('fontSize', 'text') || 12}
-            onChange={(value) => {
+            onChange={value => {
               onEdgeConfigChange('fontSize', value, 'text');
             }}
           />
@@ -228,12 +212,10 @@ const EdgeComponent = (props: any) => {
     </div>
   );
 };
-export const EdgeService: React.FC<any> = (props) => {
+export const EdgeService: React.FC<any> = props => {
   return (
     <FlowchartFormWrapper {...props} type="edge">
-      {(config, plugin) => (
-        <EdgeComponent {...props} plugin={plugin} config={config} />
-      )}
+      {(config, plugin) => <EdgeComponent {...props} plugin={plugin} config={config} />}
     </FlowchartFormWrapper>
   );
 };

+ 116 - 87
src/pages/PurchaseAdmin/PurchaseList/Detail/CommitAuditModal.js

@@ -13,58 +13,59 @@ const { Option } = Select;
 function CommitAuditModal(props) {
   const { visible, onClose, onOk, loading, version, versionList, flowDetail } = props;
   const [auditId, setAuditId] = useState();
-  const [data, setData] = useState([])
-  const [length, setLength] = useState(1)
-  const [formData, setFromData] = useState({})
+  const [data, setData] = useState([]);
+  const [length, setLength] = useState(1);
+  const [formData, setFromData] = useState({});
   const [form] = Form.useForm();
   useEffect(() => {
     const { edges, nodes } = flowDetail;
     let Id = version.template_node_id;
-    const currentId = flowDetail.nodes.find?.(item => item.Id == Id)?.node_id
-    const data = treeData(currentId)
-    if(data.length <= 0) setAuditId(currentId)
-    setData(data)
-  }, [auditId, version.template_node_id])
-  
-  useEffect(()=>{
-    form.resetFields()
-  },[visible])
+    const currentId = flowDetail.nodes.find?.(item => item.Id == Id)?.node_id;
+    const data = treeData(currentId);
+    if (data.length <= 0) setAuditId(currentId);
+    setData(data);
+  }, [auditId, version.template_node_id]);
 
-  const treeData = (currentId) => {
-    const list = getNextNodes(currentId,'custom-circle');
-    const fun = (nodes) => {
-      const re = nodes?.forEach((item, idx)=>{
-        const data = getNextNodes(item.Id,'custom-circle');
-        if(data || data.length > 0) list.push(...data);
-        fun(data)
-      })
-    }
-    fun(list)
-    console.log(list)
-    const fun2 = (list) => {
-      const parents = list.filter(item=>list.findIndex(node=>node.Id == item.parentId) == -1)
+  useEffect(() => {
+    form.resetFields();
+  }, [visible]);
+
+  const treeData = currentId => {
+    const list = getNextNodes(currentId, 'custom-circle');
+    const fun = nodes => {
+      const re = nodes?.forEach((item, idx) => {
+        const data = getNextNodes(item.Id, 'custom-circle');
+        if (data || data.length > 0) list.push(...data);
+        fun(data);
+      });
+    };
+    fun(list);
+    console.log(list);
+    const fun2 = list => {
+      const parents = list.filter(item => list.findIndex(node => node.Id == item.parentId) == -1);
       let translator = (parents, children) => {
-        setLength(length+1)
-        parents.forEach((parent) => {
-            children.forEach((current, index) => {
-                if (current.parentId === parent.Id) {
-                    let temp = JSON.parse(JSON.stringify(children))
-                    temp.splice(index, 1)
-                    translator([current], temp)
-                    if(!parent.children.find(item=>item.Id == current.Id))parent.children.push(current)
-                }
-            })
-        })
-      }   
-      translator(parents, list)   
-      return parents
-    } 
-    return fun2(list)
-  }
+        setLength(length + 1);
+        parents.forEach(parent => {
+          children.forEach((current, index) => {
+            if (current.parentId === parent.Id) {
+              let temp = JSON.parse(JSON.stringify(children));
+              temp.splice(index, 1);
+              translator([current], temp);
+              if (!parent.children.find(item => item.Id == current.Id))
+                parent.children.push(current);
+            }
+          });
+        });
+      };
+      translator(parents, list);
+      return parents;
+    };
+    return fun2(list);
+  };
 
   const currentNodeId = useMemo(() => {
     let Id = version.template_node_id;
-    setAuditId(currentNodeId)
+    setAuditId(currentNodeId);
     return flowDetail.nodes.find?.(item => item.Id == Id)?.node_id;
   }, [flowDetail, version]);
   /**
@@ -76,17 +77,32 @@ function CommitAuditModal(props) {
   const getNextNodes = (currentId, type) => {
     const { edges, nodes } = flowDetail;
     if (!currentId) return [];
+    //删除虚线通向的节点
+    // let targetIds = edges
+    //   .filter(edge => {
+    //     let line = edge.attrs?.line?.strokeDasharray?.split(' ');
+    //     return edge.source.cell == currentId && line && line[0] == '0';
+    //   })
+    //   .map(item => item.target.cell);
     let targetIds = edges
       .filter(edge => edge.source.cell == currentId)
       .map(item => item.target.cell);
-    edges.filter(edge =>  edge.source.cell == currentId)
+    console.log(edges.filter(edge => edge.source.cell == currentId));
     let auditNodes = nodes.filter(node => {
       if (type && node.name != type) {
         return false;
       }
       return targetIds.indexOf(node.id) != -1;
     });
-    const result = auditNodes.map(item=>{return { label:item.label, value:item.Id, Id:item.node_id,parentId:currentId, children:[]}})
+    const result = auditNodes.map(item => {
+      return {
+        label: item.label,
+        value: item.Id,
+        Id: item.node_id,
+        parentId: currentId,
+        children: [],
+      };
+    });
     return result || [];
   };
 
@@ -95,18 +111,19 @@ function CommitAuditModal(props) {
     setAuditId(node.node_id);
   };
 
-  const onChange = (value) => {
-    changeAudit(value[value.length-1])
+  const onChange = value => {
+    changeAudit(value[value.length - 1]);
   };
 
-  const onFinish = async() => {
+  const onFinish = async () => {
     var fieldsValue = await form.validateFields();
 
-    const getFlowPath = (node) => { //[134, 135]
-      let itemData = {}
-      const Function = (curId,index) => {
-        if(!curId) return;
-        let data = {}
+    const getFlowPath = node => {
+      //[134, 135]
+      let itemData = {};
+      const Function = (curId, index) => {
+        if (!curId) return;
+        let data = {};
         let approvalNode = flowDetail.nodes.find?.(item => item.Id == curId);
         data.template_id = version.template_id;
         data.flow_id = approvalNode?.flow_id || 0;
@@ -114,18 +131,20 @@ function CommitAuditModal(props) {
         data.template_node_id = approvalNode?.Id;
         index++;
         const res = Function(node[index], index);
-        if(res) {
-          data.flow_path = [res]
+        if (res) {
+          data.flow_path = [res];
         }
-        return data
-      }
-      itemData = Function(node[0], 0)
-      return itemData
-    }
-    let  result = Object.values(fieldsValue).map(item=> {if(item && Array.isArray(item)) return item}).filter(item=>item)
-    let serviceNode = flowDetail.nodes.find?.(
-      item => item.Id == fieldsValue.next_template_node_id
-    );
+        return data;
+      };
+      itemData = Function(node[0], 0);
+      return itemData;
+    };
+    let result = Object.values(fieldsValue)
+      .map(item => {
+        if (item && Array.isArray(item)) return item;
+      })
+      .filter(item => item);
+    let serviceNode = flowDetail.nodes.find?.(item => item.Id == fieldsValue.next_template_node_id);
     let params = {
       desc: fieldsValue.desc,
       // 审核流程id
@@ -143,39 +162,44 @@ function CommitAuditModal(props) {
       cur_template_id: version.template_id,
       next_template_id: version.template_id,
     };
-    if(result.length <= 0){
+    if (result.length <= 0) {
       //直接走业务节点
-    }else if(result.length <= 1 && result[0]?.length <= 1){
+    } else if (result.length <= 1 && result[0]?.length <= 1) {
       //单个审批节点
       let approvalNode = flowDetail.nodes.find?.(item => item.Id == result[0][0]);
       params.flow_id = approvalNode?.flow_id || 0;
       params.node_level_id = approvalNode?.flow_id ? 1 : 0;
       params.template_node_id = result[0][0]; // 将要流转的节点审批节点
-    }else{
+    } else {
       //多节点审批
       params.template_node_id = result[0][0]; // 将要流转的节点审批节点
-      params.flow_path = result.map(item=>getFlowPath(item));
+      params.flow_path = result.map(item => getFlowPath(item));
     }
 
-    
     //   if (approvalNode?.Id) {
     //     if (!approvalNode?.flow_id) {
     //       message.error('审批节点未绑定审批流程!请联系管理员。');
     //       return;
     //     }
     //   }
-    
+
     // setAuditId();
     onOk(params);
-  }
+  };
 
-  const CascaderNode = (index) => {
-    return(
-      <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label={`审批节点${index+1}`} name={`circle${index}`} key={`circle${index}`}>
-        <Cascader style={{ width: '100%' }}  options={data} onChange={onChange} />
+  const CascaderNode = index => {
+    return (
+      <Form.Item
+        labelCol={{ span: 7 }}
+        wrapperCol={{ span: 15 }}
+        label={`审批节点${index + 1}`}
+        name={`circle${index}`}
+        key={`circle${index}`}
+      >
+        <Cascader style={{ width: '100%' }} options={data} onChange={onChange} />
       </Form.Item>
-    )
-  }
+    );
+  };
 
   return (
     <Modal
@@ -188,20 +212,25 @@ function CommitAuditModal(props) {
         onClose();
       }}
       onOk={onFinish}
-    > 
-    <Form form={form}>
-      {data.map((item, idx)=>  data.length == 1? CascaderNode(''): CascaderNode(idx) )}
-      <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label="业务节点" name='next_template_node_id' >
+    >
+      <Form form={form}>
+        {data.map((item, idx) => (data.length == 1 ? CascaderNode('') : CascaderNode(idx)))}
+        <Form.Item
+          labelCol={{ span: 7 }}
+          wrapperCol={{ span: 15 }}
+          label="业务节点"
+          name="next_template_node_id"
+        >
           <Select style={{ width: '100%' }}>
-            {getNextNodes(data.length < 0 ?currentNodeId : auditId,  'custom-rect' ).map(item => (
+            {getNextNodes(data.length < 0 ? currentNodeId : auditId, 'custom-rect').map(item => (
               <Option key={item.value}>{item.label}</Option>
             ))}
           </Select>
-      </Form.Item>
-      <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label="备注信息" name="desc">
-        <Input.TextArea />
-      </Form.Item>
-    </Form>
+        </Form.Item>
+        <Form.Item labelCol={{ span: 7 }} wrapperCol={{ span: 15 }} label="备注信息" name="desc">
+          <Input.TextArea />
+        </Form.Item>
+      </Form>
     </Modal>
   );
 }

+ 5 - 3
src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js

@@ -77,7 +77,7 @@ function FlowModal(props) {
           data = [...data, arr];
         }
       });
-      data.sort((a, b) => a.id - b.id);
+      data.sort((a, b) => b.id - a.id);
       data.forEach((item, id) => {
         //解决key报错问题
         data[id].key = `${id}-${item.name}`;
@@ -128,7 +128,6 @@ function FlowModal(props) {
   const handleChangeClick = item => {
     let file = isOut ? 'newList' : 'detail';
     let type = item.flow_id ? '/queryAuditRecord' : '/queryAuditExcel';
-    console.log(`${file}${type}`, item);
     dispatch({
       type: `${file}${type}`,
       payload: {
@@ -148,7 +147,9 @@ function FlowModal(props) {
         // width: '33%',
         render: item => (
           <span style={{ color: item.audit_status != 0 ? '#9b9b9b' : '' }}>
-            {item.id == version.id && <CheckOutlined style={{ marginRight: 10 }} />}
+            {item.id == version.id && !item.isParent && (
+              <CheckOutlined style={{ marginRight: 10 }} />
+            )}
             {item.version_no && !item.isParent
               ? `${item.version_name}.${item.version_no}`
               : item.version_name}
@@ -195,6 +196,7 @@ function FlowModal(props) {
           item.id != version.id && (
             <a
               onClick={() => {
+                console.log(item);
                 onChangeVersion(item);
                 onClose();
               }}

+ 4 - 1
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -743,6 +743,7 @@ function Detail(props) {
     if (typeof id == 'object') {
       version = id;
       localStorage.excelId = version.id;
+      localStorage.excelItem = JSON.stringify(version);
     } else {
       version = versionList.find(item => item.id == id);
       if (!version) return;
@@ -860,7 +861,9 @@ function Detail(props) {
   useEffect(() => {
     if (versionList.length == 0) return;
     if (!version.id) {
-      const excelId = localStorage.excelId;
+      const excelId = localStorage.excelItem
+        ? JSON.parse(localStorage.excelItem)
+        : localStorage.excelId;
       changeVersion(excelId);
     } else {
       changeVersion(version.id);

+ 28 - 28
src/pages/PurchaseAdmin/PurchaseList/Flow/FlowDetail.json

@@ -401,7 +401,7 @@
       "id": "3fb8d302",
       "renderKey": "custom-circle",
       "name": "custom-circle",
-      "label": "三级审批",
+      "label": "三级审批4",
       "width": 90,
       "height": 90,
       "ports": {
@@ -533,7 +533,7 @@
       "id": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db",
       "renderKey": "custom-circle",
       "name": "custom-circle",
-      "label": "审批节点",
+      "label": "审批节点1",
       "width": 90,
       "height": 90,
       "ports": {
@@ -557,7 +557,7 @@
         ]
       },
       "isCustom": true,
-      "parentKey": "custom",
+      "parentKey": "1",
       "x": 27,
       "y": -224,
       "zIndex": 10
@@ -566,7 +566,7 @@
       "id": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8",
       "renderKey": "custom-circle",
       "name": "custom-circle",
-      "label": "审批节点",
+      "label": "审批节点2",
       "width": 90,
       "height": 90,
       "ports": {
@@ -590,7 +590,7 @@
         ]
       },
       "isCustom": true,
-      "parentKey": "custom",
+      "parentKey": "1",
       "x": 27,
       "y": -115,
       "zIndex": 10
@@ -599,7 +599,7 @@
       "id": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
       "renderKey": "custom-circle",
       "name": "custom-circle",
-      "label": "审批节点",
+      "label": "审批节点3",
       "width": 90,
       "height": 90,
       "ports": {
@@ -623,7 +623,7 @@
         ]
       },
       "isCustom": true,
-      "parentKey": "custom",
+      "parentKey": "1",
       "x": 173,
       "y": -170,
       "zIndex": 10
@@ -640,7 +640,7 @@
         "cell": "8c1f18d0",
         "port": "89c0bc16"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "8c1f18d0:a3adcac9-41561012:293a90b5",
@@ -652,7 +652,7 @@
         "cell": "41561012",
         "port": "293a90b5"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "5764f3ce:4b4d9fa6-1aed14d1:d348b56a",
@@ -676,7 +676,7 @@
         "cell": "4651130e",
         "port": "94f485b5"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "3fb8d302:205f1437-a48131e0:bac7962b",
@@ -688,7 +688,7 @@
         "cell": "a48131e0",
         "port": "bac7962b"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "a48131e0:4dee75d9-b57b57c8:73307680",
@@ -712,7 +712,7 @@
         "cell": "3631eae9",
         "port": "2aae2a71"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "3631eae9:8e0bff55-399bddb7:0bccd839",
@@ -724,7 +724,7 @@
         "cell": "399bddb7",
         "port": "0bccd839"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "399bddb7:58f52f2c-c28a18d3:e67dc19c",
@@ -736,7 +736,7 @@
         "cell": "c28a18d3",
         "port": "e67dc19c"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "c28a18d3:b578cc26-5359e23c:ff6724ee",
@@ -748,7 +748,7 @@
         "cell": "5359e23c",
         "port": "ff6724ee"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "5359e23c:34c9dbc6-5216c5dc:d2030f1b",
@@ -760,7 +760,7 @@
         "cell": "5216c5dc",
         "port": "d2030f1b"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "b57b57c8:04c81e99-4651130e:1eb352b0",
@@ -772,7 +772,7 @@
         "cell": "4651130e",
         "port": "1eb352b0"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "41561012:92334433-2427bf29:6bbf9ae4",
@@ -784,7 +784,7 @@
         "cell": "2427bf29",
         "port": "6bbf9ae4"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "41561012:92334433-be25fe75:a705e7ed",
@@ -796,7 +796,7 @@
         "cell": "be25fe75",
         "port": "a705e7ed"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "2427bf29:e1a1ecea-975bf288:15d1b217",
@@ -808,7 +808,7 @@
         "cell": "975bf288",
         "port": "15d1b217"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "be25fe75:ce651308-975bf288:15d1b217",
@@ -820,7 +820,7 @@
         "cell": "975bf288",
         "port": "15d1b217"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "975bf288:821f59c0-5764f3ce:c29d7b43",
@@ -832,7 +832,7 @@
         "cell": "5764f3ce",
         "port": "c29d7b43"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "5764f3ce:ce88d7e2-node-186a9d31-0bd3-4b36-b61f-6b5380c824db:6d880b9d-7d7e-4357-94dd-caf7d73b5f80",
@@ -844,7 +844,7 @@
         "cell": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db",
         "port": "6d880b9d-7d7e-4357-94dd-caf7d73b5f80"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "5764f3ce:ce88d7e2-node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8:8637b869-7924-416a-b938-30a7ca932901",
@@ -856,7 +856,7 @@
         "cell": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8",
         "port": "8637b869-7924-416a-b938-30a7ca932901"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "node-186a9d31-0bd3-4b36-b61f-6b5380c824db:e134d65d-a197-4116-ad74-f47dbbb727d1-node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:2408c946-a670-48b5-a676-d882946b8e36",
@@ -868,7 +868,7 @@
         "cell": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
         "port": "2408c946-a670-48b5-a676-d882946b8e36"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "node-c5171e2d-1cd8-4019-83dc-9f2ed0cab6e8:6316d87e-2eb3-4ff6-bd8e-0cfd11bff4ce-node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:2408c946-a670-48b5-a676-d882946b8e36",
@@ -880,7 +880,7 @@
         "cell": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862",
         "port": "2408c946-a670-48b5-a676-d882946b8e36"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     },
     {
       "id": "node-2b3fc359-de49-4f9d-adb5-4eb70b6ba862:1ab6b2a4-dccd-41e9-83c6-d1642c9ad844-3fb8d302:22d16375",
@@ -892,7 +892,7 @@
         "cell": "3fb8d302",
         "port": "22d16375"
       },
-      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":\"5 5\",\"strokeWidth\":1}}"
+      "attr": "{\"line\":{\"stroke\":\"#A2B1C3\",\"targetMarker\":{\"name\":\"block\",\"width\":12,\"height\":8},\"strokeDasharray\":[0,0],\"strokeWidth\":1}}"
     }
   ]
-}
+}

+ 1 - 1
src/pages/PurchaseAdmin/PurchaseList/List/NewList.js

@@ -76,7 +76,7 @@ function List(props) {
 
   const changeVersion = item => {
     if (typeof item == 'object') {
-      localStorage.excelId = item.id;
+      localStorage.excelItem = JSON.stringify(item);
     }
     router.push(`/home/detail/${item.project_id}/${item.template_id}`);
   };