Browse Source

诊断导入目录修改

mfmf 3 years ago
parent
commit
1eab3abcf6
1 changed files with 23 additions and 4 deletions
  1. 23 4
      src/components/DiagManager/index.js

+ 23 - 4
src/components/DiagManager/index.js

@@ -1,5 +1,5 @@
 import React, { useState, useEffect, useRef } from 'react';
-import { Form, Input, Button, Table, Select, Pagination, Space, Modal,  message, Row, Col } from 'antd';
+import { Form, Input, Button, Table, Select, Pagination, Space, Modal,  message, Row, Col, Upload } from 'antd';
 import { PlusOutlined } from '@ant-design/icons';
 import AddDiag from './addDiag'
 import MatchDiag from './MatchDiag.js'
@@ -204,6 +204,25 @@ function DiagManager() {
 	  setDiagid(selectedRowKeys)
     }
   };
+  //导入模板
+  const props = {
+    name: 'file',
+    action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
+    headers: {
+      authorization: 'authorization-text',
+    },
+    onChange(info) {
+		console.log(info);
+      if (info.file.status !== 'uploading') {
+        console.log(info);
+      }
+      if (info.file.status === 'done') {
+        message.success(`${info.file.name} file uploaded successfully`);
+      } else if (info.file.status === 'error') {
+        message.error(`${info.file.name} file upload failed.`);
+      }
+    },
+  };
   
   const columns = [
     { title: '序号', dataIndex: 'id',},
@@ -283,10 +302,10 @@ function DiagManager() {
               <Button type="primary" icon={<PlusOutlined />} onClick={e => showModal('新增', true, 1)}>新增</Button>
 		    </Col>
 			<Col key={1}>
-		      <Button icon={<PlusOutlined />} onClick={e => messageBox()} className="delete" >删除</Button>
+		      <Button  onClick={e => messageBox()} className="delete" >删除</Button>
 		    </Col>
 			<Col key={2}>
-			  <Button type="primary" icon={<PlusOutlined />} onClick={e => ImportBox()}>导入</Button>
+			  <Button type="primary"  onClick={e => ImportBox()}>导入</Button>
 			</Col>
 		  </Row>
         </div>
@@ -356,7 +375,7 @@ function DiagManager() {
 		footer={<Button key="back" onClick={handleCancel1}>取消</Button>}
 	  >
 	    <div style={{marginBottom: 10 + 'px'}}>
-			<span>诊断信息导入:</span><Button type="primary" onClick={handleCancel1}>导入目录</Button>
+			<span>诊断信息导入:</span><Upload {...props}><Button type="primary" >导入目录</Button></Upload>
 		</div>
 		<span style={{color: 'red'}}>提示:EXCEL导入,模板样式及数据请在【朗通云平台-CDSS数据维护-医学术语关联维护】中导出获取。</span>
 	  </Modal>