|
@@ -1,5 +1,5 @@
|
|
import React, { useState, useEffect } from 'react';
|
|
import React, { useState, useEffect } from 'react';
|
|
-import { Form, Input, Button, Table, Modal, Row, Col } from 'antd';
|
|
|
|
|
|
+import { Form, Input, Button, Table, Modal, Row, Col,message } from 'antd';
|
|
import '@common/common.less';
|
|
import '@common/common.less';
|
|
import apiObj from '@api/index';
|
|
import apiObj from '@api/index';
|
|
import "moment/locale/zh-cn"
|
|
import "moment/locale/zh-cn"
|
|
@@ -37,11 +37,24 @@ function DocTemplate() {
|
|
})
|
|
})
|
|
}
|
|
}
|
|
//模板详情
|
|
//模板详情
|
|
- function getTmplInfo(id) {
|
|
|
|
|
|
+ function getTmplInfo(flag,id) {
|
|
|
|
+ if(!flag){
|
|
|
|
+ setVisible(flag);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const hide = message.loading('加载中...',0);
|
|
post(api.getRecordTemplateManage, {id}).then((res) => {
|
|
post(api.getRecordTemplateManage, {id}).then((res) => {
|
|
|
|
+ hide();
|
|
if (res.data.code === 200) {
|
|
if (res.data.code === 200) {
|
|
const data = res.data.data;
|
|
const data = res.data.data;
|
|
- setTmplInfo(data);
|
|
|
|
|
|
+ if(data.contentType==="html"){
|
|
|
|
+ const myWindow=window.open('','','width=800,height=600');
|
|
|
|
+ myWindow.document.write(data.content);
|
|
|
|
+ myWindow.focus();
|
|
|
|
+ }else{
|
|
|
|
+ setVisible(flag);
|
|
|
|
+ setTmplInfo(data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -61,12 +74,11 @@ function DocTemplate() {
|
|
getDocTemplate()
|
|
getDocTemplate()
|
|
}
|
|
}
|
|
//查看模板
|
|
//查看模板
|
|
- function showModal(flag,id){
|
|
|
|
- setVisible(flag);
|
|
|
|
|
|
+ /*function showModal(flag,id){
|
|
if(flag){
|
|
if(flag){
|
|
getTmplInfo(id);
|
|
getTmplInfo(id);
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
const onFinish = (value) => {
|
|
const onFinish = (value) => {
|
|
const param = {
|
|
const param = {
|
|
...data,
|
|
...data,
|
|
@@ -89,8 +101,7 @@ function DocTemplate() {
|
|
{ title: '医院父类模板名称', dataIndex: 'parentName', key: 'parentName' },
|
|
{ title: '医院父类模板名称', dataIndex: 'parentName', key: 'parentName' },
|
|
{
|
|
{
|
|
title: '操作', dataIndex: 'operation', key: 'operation', render: (text, record) =>{
|
|
title: '操作', dataIndex: 'operation', key: 'operation', render: (text, record) =>{
|
|
- console.log(22,text,record)
|
|
|
|
- return <a className="showDetail" onClick={()=>showModal(true,record.id)}>查看</a>
|
|
|
|
|
|
+ return <a className="showDetail" onClick={()=>getTmplInfo(true,record.id)}>查看</a>
|
|
}
|
|
}
|
|
},
|
|
},
|
|
]
|
|
]
|
|
@@ -162,16 +173,17 @@ function DocTemplate() {
|
|
<Modal
|
|
<Modal
|
|
destroyOnClose={true}
|
|
destroyOnClose={true}
|
|
title="查看文书模板"
|
|
title="查看文书模板"
|
|
- footer={[<Button key={1} type="primary" onClick={()=>showModal(false)}>
|
|
|
|
|
|
+ footer={[<Button key={1} type="primary" onClick={()=>setVisible(false)}>
|
|
关闭
|
|
关闭
|
|
</Button>]}
|
|
</Button>]}
|
|
- width={510}
|
|
|
|
|
|
+ width="80%"
|
|
visible={visible}
|
|
visible={visible}
|
|
- onCancel={()=>showModal(false)}
|
|
|
|
|
|
+ onCancel={()=>setVisible(false)}
|
|
/*confirmLoading={confirmLoading}*/
|
|
/*confirmLoading={confirmLoading}*/
|
|
>
|
|
>
|
|
<div>
|
|
<div>
|
|
- <table width='480' height="80">
|
|
|
|
|
|
+ {tmplInfo.content}
|
|
|
|
+ {/*<table width='480' height="80">
|
|
<tbody>
|
|
<tbody>
|
|
<tr>
|
|
<tr>
|
|
<td>医院模板ID:{tmplInfo.code}</td>
|
|
<td>医院模板ID:{tmplInfo.code}</td>
|
|
@@ -185,10 +197,10 @@ function DocTemplate() {
|
|
<td colSpan={2}>模板内容:<span style={{'wordBreak': 'break-all',
|
|
<td colSpan={2}>模板内容:<span style={{'wordBreak': 'break-all',
|
|
'display': 'inline-block',
|
|
'display': 'inline-block',
|
|
'width': '405px',
|
|
'width': '405px',
|
|
- 'verticalAlign': 'text-top'}}>{tmplInfo.content}</span></td>
|
|
|
|
|
|
+ 'verticalAlign': 'text-top'}} dangerouslySetInnerHTML={{__html:tmplInfo.content}}></span></td>
|
|
</tr>
|
|
</tr>
|
|
</tbody>
|
|
</tbody>
|
|
- </table>
|
|
|
|
|
|
+ </table>*/}
|
|
</div>
|
|
</div>
|
|
</Modal>
|
|
</Modal>
|
|
</div >
|
|
</div >
|