Sfoglia il codice sorgente

优化审批表单显示位置,修复跳转至审批详情页偶尔会出现没有excel详情的问题,修复编辑流程节点时节点属性会被刷新掉的问题

xjj 2 anni fa
parent
commit
1d8eee5605

+ 0 - 1
src/components/AttachmentTable/index.js

@@ -77,7 +77,6 @@ function AttachmentTable(props) {
   return (
     <>
       <Table
-        title={() => '附件列表'}
         rowKey="id"
         loading={loading}
         columns={columns}

+ 7 - 4
src/components/Flow/node/rect/mapServe.tsx

@@ -22,6 +22,7 @@ interface ExcelInfo {
 }
 
 export interface IConfig {
+  id?: string;
   label?: string;
   x?: number;
   y?: number;
@@ -132,10 +133,12 @@ const Component = (props: any) => {
   };
 
   useEffect(() => {
-    setNodeConfig({
-      ...defaultConfig,
-      ...config,
-    });
+    if(config.id != nodeConfig.id) {
+      setNodeConfig({
+        ...defaultConfig,
+        ...config,
+      });
+    }
   }, [config]);
 
   useEffect(() => {

+ 1 - 0
src/models/authList.js

@@ -27,6 +27,7 @@ export default {
             project_id: e.project_id,
             version_name: e.version_name,
             node_name: e.TemplateNodeInfo?.label,
+            node_id: e.TemplateNodeInfo?.Id,
             author: e.AuthorInfo?.CName,
             classify_id: e.classify_id,
             version_id: e.version_id,

+ 2 - 1
src/pages/Auth/Auth.js

@@ -54,6 +54,7 @@ function Auth(props) {
     //调用接口获取version信息
     dispatch({
       type: 'auth/queryVersionByNode',
+      payload: { template_node_id: item.node_id },
       callback: versionList => {
         let version = versionList.find(v => v.id == item.id) || {};
         localStorage.excelItem = JSON.stringify(version);
@@ -79,7 +80,7 @@ function Auth(props) {
           expandable={{ expandedRowRender: record => renderUnauth(record.nodes) }}
           pagination={false}
           rowKey="key"
-          loading={loading.models.auth}
+          loading={loading.effects['auth/queryVersionByNode'] || loading.models.authList}
         />
       </Panel>
       <Panel header="已审批" key="1">

+ 1 - 0
src/pages/Auth/models/auth.js

@@ -27,6 +27,7 @@ export default {
             project_id: e.project_id,
             version_name: e.version_name,
             node_name: e.TemplateNodeInfo?.label,
+            node_id: e.TemplateNodeInfo?.Id,
             author: e.AuthorInfo?.CName,
             classify_id: e.classify_id,
             id: e.id,

+ 18 - 12
src/pages/Detail/FormAndFilesNode.js

@@ -16,18 +16,24 @@ const FormAndFilesNode = props => {
     return renderFrom(formData);
   }, [formData]);
 
-  return (
-    <>
-      <Card title="审批信息">
-        <Row gutter={20}>
-          <Col span={12}>{FormContent}</Col>
-          <Col span={12}>
-            <AttachmentTable version={version} canDelete={version.last_version == 0} />
-          </Col>
-        </Row>
-      </Card>
-    </>
-  );
+  if(formData) {
+    return  <Card title="审批信息">
+      <Row gutter={20}>
+        <Col span={12}>{FormContent}</Col>
+        
+        <Col span={12}>
+          <AttachmentTable version={version} canDelete={version.last_version == 0} />
+        </Col>
+      </Row>
+    </Card>
+  } else {
+    return <Card title="附件信息">
+      
+      <AttachmentTable version={version} canDelete={version.last_version == 0} />
+    </Card>
+  }
+
+
 };
 
 const renderFrom = data => {