|
@@ -76,16 +76,6 @@ class ChronicInfo extends React.Component{
|
|
|
printContainer: true,
|
|
|
operaSupport: false,
|
|
|
});
|
|
|
- // setTimeout(() => {//把生成的图片和iframe删掉
|
|
|
- // let imgLis = document.querySelectorAll('.canvasImg')
|
|
|
- // let iframe = document.getElementsByTagName('iframe')
|
|
|
- // for(let i = 0;i < imgLis.length;i++){
|
|
|
- // imgLis[i].remove()
|
|
|
- // }
|
|
|
- // for(let i = 0;i < iframe.length;i++){
|
|
|
- // iframe[i].remove()
|
|
|
- // }
|
|
|
- // }, 500);
|
|
|
}
|
|
|
|
|
|
showTableList(id){//量表按钮
|
|
@@ -112,9 +102,6 @@ class ChronicInfo extends React.Component{
|
|
|
type:22,
|
|
|
}
|
|
|
getInfomation&&getInfomation(param);
|
|
|
- /*this.setState({
|
|
|
- infoId:id
|
|
|
- })*/
|
|
|
}
|
|
|
closeInfo(){//关闭静态知识
|
|
|
this.setState({
|
|
@@ -209,27 +196,31 @@ class ChronicInfo extends React.Component{
|
|
|
});
|
|
|
}
|
|
|
handleInputformula(v,i, j,idd, e) {
|
|
|
- const { data, setChronicPush } = this.props;
|
|
|
+ const { data, setChronicPush,calcuValues } = this.props;
|
|
|
+ let data1 = JSON.parse(JSON.stringify(data));
|
|
|
+ if(calcuValues&&calcuValues[data1[i].id]){
|
|
|
+ data1[i].details[j].content=calcuValues&&calcuValues[data1[i].id];
|
|
|
+ }
|
|
|
const text = e.target.value;
|
|
|
- if (data[i].details) {
|
|
|
- data[i].details[j].content.details[idd].value = text
|
|
|
- }
|
|
|
-
|
|
|
- const data1 = JSON.parse(JSON.stringify(data));
|
|
|
-
|
|
|
- setChronicPush(data1)
|
|
|
+ if (data1[i].details) {
|
|
|
+ data1[i].details[j].content.details[idd].value = text
|
|
|
+ }
|
|
|
+
|
|
|
+ setChronicPush(data1,data1[i].id,data1[i].details[j].content)
|
|
|
}
|
|
|
handleForRadio(ii,v,i, j,idd, ind){//计算公式
|
|
|
- const { data, setChronicPush } = this.props;
|
|
|
- if (data[i].details) {
|
|
|
- for(let z = 0; z < data[i].details[j].content.details[idd].details.length; z++) {
|
|
|
- data[i].details[j].content.details[idd].details[z].state = 0
|
|
|
- }
|
|
|
- data[i].details[j].content.details[idd].details[ind].state = 1
|
|
|
- }
|
|
|
-
|
|
|
+ const { data, setChronicPush,calcuValues } = this.props;
|
|
|
const data1 = JSON.parse(JSON.stringify(data));
|
|
|
- setChronicPush(data1)
|
|
|
+ if(calcuValues&&calcuValues[data1[i].id]){
|
|
|
+ data1[i].details[j].content=calcuValues&&calcuValues[data1[i].id];
|
|
|
+ }
|
|
|
+ if (data1[i].details) {
|
|
|
+ for(let z = 0; z < data1[i].details[j].content.details[idd].details.length; z++) {
|
|
|
+ data1[i].details[j].content.details[idd].details[z].state = 0
|
|
|
+ }
|
|
|
+ data1[i].details[j].content.details[idd].details[ind].state = 1
|
|
|
+ }
|
|
|
+ setChronicPush(data1,data1[i].id,data1[i].details[j].content);
|
|
|
}
|
|
|
confirmFormula(){//计算公式确定
|
|
|
this.setState({
|
|
@@ -259,8 +250,13 @@ class ChronicInfo extends React.Component{
|
|
|
radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
|
|
|
})
|
|
|
}
|
|
|
- calcuFormula(it,j, v, i) { //计算公式计算
|
|
|
- const { calcuFormula, data ,chronicPushItems} = this.props;
|
|
|
+ calcuFormula(item,j, v, i) { //计算公式计算
|
|
|
+ const { calcuFormula, data ,chronicPushItems,calcuValues} = this.props;
|
|
|
+ let pushObj = deepClone(chronicPushItems);
|
|
|
+ if(calcuValues&&calcuValues[pushObj[i].id]){
|
|
|
+ pushObj[i].details[j].content=calcuValues&&calcuValues[pushObj[i].id];
|
|
|
+ }
|
|
|
+ let it = pushObj[i].details[j];
|
|
|
let allHasInfo = true;
|
|
|
for (let i = 0; i < it.content.details.length; i++) {
|
|
|
if(it.content.details[i].controlType == 2) { //输入框类型的有没有填值
|
|
@@ -281,15 +277,14 @@ class ChronicInfo extends React.Component{
|
|
|
|
|
|
}
|
|
|
if(allHasInfo) { //所有都有值,则计算
|
|
|
- // delete it.content.resultz
|
|
|
let param = {
|
|
|
type: 2,
|
|
|
data: it,
|
|
|
disId: v.id,
|
|
|
pIndex: j,
|
|
|
ppIndex: i
|
|
|
- }
|
|
|
- calcuFormula({param,chronicPushItems})
|
|
|
+ };
|
|
|
+ calcuFormula({param,chronicPushItems:pushObj})
|
|
|
} else { //不是所有值都填过了
|
|
|
Notify.info('请填写计算公式内容')
|
|
|
}
|
|
@@ -304,12 +299,6 @@ class ChronicInfo extends React.Component{
|
|
|
<img src={infoPic} className={style["infoPic"]} onClick={this.showInfo.bind(this,v.id)}/>
|
|
|
:
|
|
|
</p>:''}
|
|
|
- {/*<MiniToast title='静态知识'
|
|
|
- icon={allTableIcon}
|
|
|
- show={infoId&&infoId==v.id?true:false}
|
|
|
- close={this.closeInfo}>
|
|
|
- {pureText}
|
|
|
- </MiniToast>*/}
|
|
|
{v.details&&v.details.map((it,j)=>{
|
|
|
if(it.type==1){
|
|
|
return <p>
|
|
@@ -329,7 +318,7 @@ class ChronicInfo extends React.Component{
|
|
|
}else if(it.type==2){
|
|
|
const cres = calcuResult&&calcuResult[v.id]||it.content.result;
|
|
|
const result = cres&&cres[1]&&cres[1].text;
|
|
|
- const details = it.content.details;
|
|
|
+ const details = calcuValues&&calcuValues[v.id]&&calcuValues[v.id].details||it.content.details;
|
|
|
return <div className={style["marTop"]}>
|
|
|
<span className={style["limit"]}>
|
|
|
计算公式结果:
|