Selaa lähdekoodia

bug2799,2786,2783,2780

luolei 5 vuotta sitten
vanhempi
commit
b92c64897d

+ 1 - 2
src/common/components/ItemBox/index.jsx

@@ -28,7 +28,6 @@ class ItemBox extends Component {
     const sty = {width:boxWidth?boxWidth:undefined,height:boxHeight?boxHeight:undefined,lineHeight:boxLineHeight?boxLineHeight:'22px',marginTop:marginTop,backgroundColor:backgroundColor?backgroundColor:''};
     return style?Object.assign(style,sty):sty;
   }
-
   handleClick(e){
     e.stopPropagation();
     const {handleClick} = this.props;
@@ -61,7 +60,7 @@ componentWillReceiveProps(nextP){
     }
 }
 setFontColorSize(){
-  const {data,saveText} = this.props;
+  const {data,saveText,title} = this.props;
   if(data&&data.length==0&&saveText&&saveText[0]){
     return setFontColorSize(2,7)
   }

+ 0 - 1
src/components/Operation/Search/index.jsx

@@ -71,7 +71,6 @@ class SearchList extends React.Component {
       this.setState({border:false,val:''})
     }
     componentWillReceiveProps(next){
-        console.log(next.value)
         if(next.value&&(next.value != this.props.value)){
             this.textInput.current.value = next.value;
         }

+ 50 - 43
src/components/Operation/index.jsx

@@ -10,7 +10,7 @@ import { ConfirmModal, Notify } from '@commonComp';
 import Search from './Search';
 import check_circle from './img/check-circle.png';
 import check_right from './img/check-right.png';
-import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory} from '@utils/tools';
+import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory,checkDeptContent} from '@utils/tools';
 
 import {dragBox} from '@utils/drag';
 import store from '@store';
@@ -136,57 +136,44 @@ class Operation extends Component {
   }
   saveHis(type) {
     const { diagShowTmp } = this.props;
-    let flg = this.getAllData();
-    if(flg){
-      this.setState({
-        title: '',
-        sex:'3',
-        type: type,
-        okText: '保存',
-        borderColor: '#3B9ED0',
-        okColor: '#fff',
-        oKBg: '#3B9ED0',
-        msg: this.changeTitle()
-      })
-      diagShowTmp(true)
-    }
-  }
-  getAllData(){
     let baseList = store.getState();
-    let jsonData = getAllDataList(baseList);
     let jsonStr = getAllDataStringList(baseList);
-    let whichSign = baseList.typeConfig.mode;
     let tmpLis = [];
     let flg = isAllClear(jsonStr);
     if(!flg){
-      Notify.info('模板数据不能为空')
-      return false
+      Notify.info('模板数据不能为空');
+      return false;
     }
-    // console.log(jsonStr.chief,'文本')
-    // console.log(jsonData,'结构')       //测试需要用到,不要删了
-    // console.log(tmpLis,'接口返回的')
-    if(this.props.admin){
-      tmpLis = baseList.tabTemplate.adminItems;
-    }else{
+    if(!this.props.admin){
       tmpLis = baseList.tabTemplate.items;
-    }
-    for(let i = 0;i <tmpLis.length;i++){
-      let dataStr = tmpLis[i].preview;
-      if(
-        filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
-        filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
-        filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
-        filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
-        jsonStr.lis == JSON.parse(dataStr).lis &&
-        jsonStr.pacs == JSON.parse(dataStr).pacs &&
-        jsonStr.diag == JSON.parse(dataStr).diag &&
-        jsonStr.advice == JSON.parse(dataStr).advice
-      ){
-        Notify.info('该模板已保存');
-        return false;
+      for(let i = 0;i <tmpLis.length;i++){
+        let dataStr = tmpLis[i].preview;
+        if(
+          filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+          filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+          filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+          filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+          jsonStr.lis == JSON.parse(dataStr).lis &&
+          jsonStr.pacs == JSON.parse(dataStr).pacs &&
+          jsonStr.diag == JSON.parse(dataStr).diag &&
+          jsonStr.advice == JSON.parse(dataStr).advice
+        ){
+          Notify.info('该模板已保存');
+          return false;
+        }
       }
     }
-    return true;
+    this.setState({
+      title: '',
+      sex:'3',
+      type: type,
+      okText: '保存',
+      borderColor: '#3B9ED0',
+      okColor: '#fff',
+      oKBg: '#3B9ED0',
+      msg: this.changeTitle()
+    })
+    diagShowTmp(true)
   }
   changeTitle() {
     return <div className={style['box']}>
@@ -272,6 +259,26 @@ class Operation extends Component {
         return;
       }
       if(admin){
+        let baseList = store.getState();
+        let tmpLis = baseList.tabTemplate.adminItems||[];
+        let jsonStr = getAllDataStringList(baseList);
+        for(let i = 0;i <tmpLis.length;i++){
+          let dataStr = tmpLis[i].preview;
+          if(
+            filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+            filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+            filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+            filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+            jsonStr.lis == JSON.parse(dataStr).lis &&
+            jsonStr.pacs == JSON.parse(dataStr).pacs &&
+            jsonStr.diag == JSON.parse(dataStr).diag &&
+            jsonStr.advice == JSON.parse(dataStr).advice&&
+            deptId == tmpLis[i].hospitalDeptId
+          ){
+            Notify.info('该模板已保存');
+            return false;
+          }
+        }
         saveDataAlls(title,sex,deptId);
       }else{
         saveDataAll(title,sex);

BIN
src/components/PreInIcss/RotateImg copy/img/closeImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/imgBgActive.png


BIN
src/components/PreInIcss/RotateImg copy/img/nextImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/plus.png


BIN
src/components/PreInIcss/RotateImg copy/img/prevImg.png


BIN
src/components/PreInIcss/RotateImg copy/img/reduce.png


BIN
src/components/PreInIcss/RotateImg copy/img/rotated.png


+ 229 - 0
src/components/PreInIcss/RotateImg copy/index.jsx

@@ -0,0 +1,229 @@
+import React, { Component } from "react";
+import $ from "jquery";
+import style from "./index.less";
+import ReactDom from "react-dom";
+import closeImg from "./img/closeImg.png";
+import imgBgActive from "./img/imgBgActive.png";
+import plus from "./img/plus.png";
+import reduce from "./img/reduce.png";
+import nextImg from "./img/nextImg.png";
+import prevImg from "./img/prevImg.png";
+import rotated from "./img/rotated.png";
+import {imgDragMove} from '@utils/drag';
+
+class RotateImg extends Component {
+  constructor(props){
+    super(props);
+    this.state={
+      de:0,
+      current:0,
+      length:0,
+      imgWidth:'auto',
+      imgHeight:'auto',
+      mgLeft:'',
+      mgTop:'',
+      left:'50%',
+      top:'50%'
+    }
+    this.handlePrev = this.handlePrev.bind(this)
+    this.handleNext = this.handleNext.bind(this)
+    this.handleRotate = this.handleRotate.bind(this)
+    this.handlePlus = this.handlePlus.bind(this)
+    this.handleReduce = this.handleReduce.bind(this)
+  }
+  componentWillReceiveProps(next){
+    console.log(next.windowHeight,this.props.windowHeight)
+  }
+  componentDidMount(){
+    imgDragMove('add')
+    const { idx,imgLis } = this.props;
+    let currentImg = imgLis[idx];
+    let width = currentImg.width,height = currentImg.height;
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    this.setState({
+      current:idx,
+      length:imgLis.length,
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2
+    })
+  }
+  getStyle(){
+    const { imgDetail,idx,imgLis } = this.props;
+    let currentImg = imgLis[this.state.current];
+    let width = currentImg.width,height = currentImg.height;
+    let isLorR = width > height;
+    return {
+      width:width,
+      height:height,
+      marginLeft:-width/2,
+      marginTop:-height/2
+    }
+  }
+  handleNext(){
+    this.props.setMove(false)
+    const { imgLis,isMove } = this.props;
+    let tmpIdx = this.state.current;
+    let tmpLen = this.state.length,width,height;
+    if(tmpIdx == tmpLen-1){
+      width = imgLis[0].width
+      height = imgLis[0].height
+    }else{
+      width = imgLis[tmpIdx+1].width
+      height = imgLis[tmpIdx+1].height
+    }
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    let imgDom = this.refs.rotateImg.getDOMNode();
+    $(imgDom).css({
+      left:'50%',
+      top:'50%'
+    })
+    this.setState({
+      current:tmpIdx == tmpLen-1?0:(tmpIdx+1),
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2,
+      de:0
+    })
+  }
+  handlePrev(){
+    const { imgLis } = this.props;
+    let tmpIdx = this.state.current;
+    let tmpLen = this.state.length,width,height;
+    if(tmpIdx == 0){
+      width = imgLis[tmpLen-1].width
+      height = imgLis[tmpLen-1].height
+    }else{
+      width = imgLis[tmpIdx-1].width
+      height = imgLis[tmpIdx-1].height
+    }
+    if(width>height){
+      if(width > 750){
+        width=750
+        height=height*750/width
+      }
+    }else{
+      if(height > 750){
+        height = 750
+        width = width*750/height
+      }
+    }
+    let imgDom = this.refs.rotateImg.getDOMNode();
+    $(imgDom).css({
+      left:'50%',
+      top:'50%'
+    })
+    this.setState({
+      current:tmpIdx == 0?tmpLen-1:tmpIdx-1,
+      imgWidth:width,
+      imgHeight:height,
+      mgLeft:-width/2,
+      mgTop:-height/2,
+      de:0
+    })
+    this.props.setMove(false)
+  }
+  handlePlus(){
+    const {imgWidth,imgHeight,isMove} = this.state;
+    if(this.props.isMove){
+      this.setState({
+        imgWidth:1.2*imgWidth,
+        imgHeight:1.2*imgHeight
+      })
+      return;
+    }
+    this.setState({
+      imgWidth:1.2*imgWidth,
+      imgHeight:1.2*imgHeight,
+      mgLeft:-imgWidth*1.2/2,
+      mgTop:-imgHeight*1.2/2
+    })
+  }
+  handleReduce(){
+    const {imgWidth,imgHeight} = this.state;
+    if(this.props.isMove){
+      this.setState({
+        imgWidth:imgWidth*0.8,
+        imgHeight:imgHeight*0.8
+      })
+      return;
+    }
+    this.setState({
+      imgWidth:imgWidth*0.8,
+      imgHeight:imgHeight*0.8,
+      mgLeft:-imgWidth*0.8/2,
+      mgTop:-imgHeight*0.8/2
+    })
+  }
+  handleRotate(flg){
+    let deg = this.state.de;
+    if(flg){
+      deg = deg-90
+    }else{
+      deg = deg-0+90
+    }
+    this.setState({
+      de:deg
+    })
+  }
+
+  render() {
+    const { imgLis,handleClose } = this.props;
+    const { current,imgWidth,imgHeight,mgLeft,mgTop,de,left,top } = this.state;
+
+    const domNode = document.getElementById('root');
+    return ReactDom.createPortal(<div className={style.preImgWrap}>
+      <div className={style.modal} onClick={handleClose}></div>
+      <div className={style.mainWrap}>
+        <div className={style.imgWrap} id="previewWrapper">
+            <img className={style.rotateImg}
+              id="drugImg"
+              ref="rotateImg" 
+              src={imgLis[current].originalImage} 
+              style={{
+                width:imgWidth+'px',
+                height:imgHeight+'px',
+                marginLeft:mgLeft+'px',
+                marginTop:mgTop+'px',
+                transform:"rotate(" + de + "deg)",
+                left:left,
+                top:top,
+              }}
+              alt="预览图片"/>
+          <div className={style.activeBar}>
+            <img className={style.plus} src={plus} onClick={this.handlePlus} alt="图片放大"/>
+            <img className={style.reduce} src={reduce} onClick={this.handleReduce} alt="图片缩小"/>
+            <img className={style.rotate} src={rotated} onClick={this.handleRotate} alt="图片旋转"/>
+          </div>
+          <img src={closeImg} onClick={handleClose} className={style.close} alt="close"/>
+        </div>
+          <img src={nextImg} className={style.next} onClick={this.handleNext} alt="下一张"/>
+          <img src={prevImg} className={style.prev} onClick={this.handlePrev} alt="上一张"/>
+      </div>
+    </div>,domNode)
+  }
+}
+
+export default RotateImg;

+ 104 - 0
src/components/PreInIcss/RotateImg copy/index.less

@@ -0,0 +1,104 @@
+.preImgWrap {
+  .modal {
+    position: fixed;
+    left: 0;
+    top: 0;
+    z-index: 100;
+    width: 100%;
+    height: 100%;
+    background-color: #000;
+    opacity: 0.6;
+    filter: alpha(opacity=60);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=60);";
+  }
+  .imgWrap {
+    // margin-left: -500px;
+    // left: 50%;
+    // width: 1000px;
+    // top: 7%;
+    // bottom: 7%;
+    // height: 86%;
+    z-index: 100;
+    position: fixed;
+    width: 750px;
+    height: 750px;
+    left: 50%;
+    top: 50%;
+    margin-left: -375px;
+    margin-top: -375px;
+    background-color: #fff;
+    overflow: hidden;
+    .close {
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      cursor: pointer;
+    }
+    .imgDiv {
+      position: absolute;
+      width: 750px;
+      height: 750px;
+      left: 50%;
+      top: 50%;
+      margin-left: -375px;
+      margin-top: -375px;
+      overflow: hidden;
+    }
+    .rotateImg {
+      position: absolute;
+      cursor: move;
+      // left: 50%;
+      // top: 50%;
+      // transform: translateX(-50%) translateY(-50%);
+    }
+    .activeBar {
+      width: 400px;
+      height: 40px;
+      background-color: #9B979A;
+      position: absolute;
+      bottom: 0;
+      left: 50%;
+      margin-left: -200px;
+      border-radius: 4px 4px 0 0;
+      text-align: center;
+      // display: none;
+      img {
+        margin: 10px 0px;
+        padding: 3px 20px;
+        cursor: pointer;
+      }
+      
+      .rotate {
+    
+      }  
+      .plus,.reduce {
+        border-right: 1px solid #7A7779;
+      }  
+    }
+  }
+  .mainWrap {
+    position: absolute;
+    width: 900px;
+    height: 900px;
+    left: 50%;
+    top: 50%;
+    margin-left: -450px;
+    margin-top: -450px;
+    .next {
+      cursor: pointer;
+      position: absolute;
+      z-index: 102;
+      top: 50%;
+      margin-top: -20px;
+      right: 0;
+    }
+    .prev {
+      cursor: pointer;
+      position: absolute;
+      z-index: 102;
+      top: 50%;
+      margin-top: -20px;
+      left: 0;
+    }
+  }
+}

+ 37 - 23
src/components/PreInIcss/RotateImg/index.jsx

@@ -31,20 +31,24 @@ class RotateImg extends Component {
     this.handlePlus = this.handlePlus.bind(this)
     this.handleReduce = this.handleReduce.bind(this)
   }
+  componentWillReceiveProps(next){
+    console.log(next.windowHeight,this.props.windowHeight)
+  }
   componentDidMount(){
     imgDragMove('add')
-    const { idx,imgLis } = this.props;
+    const { idx,imgLis,windowHeight } = this.props;
     let currentImg = imgLis[idx];
+    let scaleHeight = windowHeight*0.8;
     let width = currentImg.width,height = currentImg.height;
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        width=scaleHeight
+        height=height*scaleHeight/width
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        height = scaleHeight
+        width = width*scaleHeight/height
       }
     }
     this.setState({
@@ -70,7 +74,8 @@ class RotateImg extends Component {
   }
   handleNext(){
     this.props.setMove(false)
-    const { imgLis,isMove } = this.props;
+    const { imgLis,isMove,windowHeight } = this.props;
+    let scaleHeight = windowHeight*0.8;
     let tmpIdx = this.state.current;
     let tmpLen = this.state.length,width,height;
     if(tmpIdx == tmpLen-1){
@@ -81,14 +86,14 @@ class RotateImg extends Component {
       height = imgLis[tmpIdx+1].height
     }
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        width=scaleHeight
+        height=height*scaleHeight/width
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        height = scaleHeight
+        width = width*scaleHeight/height
       }
     }
     let imgDom = this.refs.rotateImg.getDOMNode();
@@ -106,7 +111,8 @@ class RotateImg extends Component {
     })
   }
   handlePrev(){
-    const { imgLis } = this.props;
+    const { imgLis,windowHeight } = this.props;
+    let scaleHeight = windowHeight*0.8;
     let tmpIdx = this.state.current;
     let tmpLen = this.state.length,width,height;
     if(tmpIdx == 0){
@@ -117,14 +123,14 @@ class RotateImg extends Component {
       height = imgLis[tmpIdx-1].height
     }
     if(width>height){
-      if(width > 750){
-        width=750
-        height=height*750/width
+      if(width > scaleHeight){
+        width=scaleHeight
+        height=height*scaleHeight/width
       }
     }else{
-      if(height > 750){
-        height = 750
-        width = width*750/height
+      if(height > scaleHeight){
+        height = scaleHeight
+        width = width*scaleHeight/height
       }
     }
     let imgDom = this.refs.rotateImg.getDOMNode();
@@ -185,15 +191,23 @@ class RotateImg extends Component {
       de:deg
     })
   }
+
   render() {
-    const { imgLis,handleClose } = this.props;
+    const { imgLis,handleClose,windowHeight } = this.props;
     const { current,imgWidth,imgHeight,mgLeft,mgTop,de,left,top } = this.state;
 
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(<div className={style.preImgWrap}>
       <div className={style.modal} onClick={handleClose}></div>
       <div className={style.mainWrap}>
-        <div className={style.imgWrap} id="previewWrapper">
+        <div className={style.imgWrap}
+          id="previewWrapper"
+          style={{
+            width:0.8*windowHeight+'px',
+            height:0.8*windowHeight+'px',
+            marginLeft:-0.8*windowHeight/2+'px',
+            marginTop:-0.8*windowHeight/2+'px'
+          }}>
             <img className={style.rotateImg}
               id="drugImg"
               ref="rotateImg" 

+ 2 - 1
src/components/PreInIcss/SliddleTgl/index.jsx

@@ -62,7 +62,7 @@ class SlideTgl extends Component {
     })
   }
   render() {
-    const { item,showPre,isMove,setMove } = this.props;
+    const { item,showPre,isMove,setMove,windowHeight } = this.props;
     return <li>
     <div className={style.current} ref="current" style={{height:this.state.slide?'18px':'auto'}}>
       <p className={style.curStyle}><span>现病史:</span>{item.detail.xbs}</p>
@@ -93,6 +93,7 @@ class SlideTgl extends Component {
         imgShow={this.state.imgShow}
         imgLis={this.state.imgList}
         isMove = {isMove}
+        windowHeight = {windowHeight}
         setMove = {setMove}
         handleClose={this.handleClose}
         idx={this.state.idx}></RotateImg>:null}

+ 1 - 1
src/components/PreInIcss/index.jsx

@@ -25,7 +25,7 @@ class PreIcss extends Component {
                 <li><span>录入选择医院:</span>{item.sonHospitalName?item.sonHospitalName:item.hospitalName}</li>
                 <li><span>科室:</span>{item.hospitalDeptName}</li>
                 <li><span>主诉:</span>{item.detail.chiefComplaint}</li>
-                <SlideTgl showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
+                <SlideTgl windowHeight={windowHeight} showPre={showPre} item={item} isMove={isMove} setMove={setMove}></SlideTgl>
               </ul>
             </div>
           })

+ 0 - 1
src/store/async-actions/tabTemplate.js

@@ -368,7 +368,6 @@ export const getDepartments = (value) => { //获取模板结构化数据
     }).then((res) => {
       let data = res.data;
       if (data.code == 0) {
-        console.log(data)
         dispatch(getDptLis(data.data))
       } else {
         Notify.error(data.msg);

+ 2 - 2
src/utils/config.js

@@ -1,8 +1,8 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.121:5050';//后端接口访问地址
-const host='http://192.168.2.236:5050';//后端接口访问地址
-// const host='http://192.168.2.241:5050';//后端接口访问地址
+// const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:5050'; //周铁刚

+ 29 - 4
src/utils/tools.js

@@ -1443,7 +1443,7 @@ const setFontColorSize = (flg,pacs) => {
         }else if(pacs == 6){
           classStr = `largeFontSize selectColor`
         }else if(pacs == 7){
-          classStr = `largeFontSize fontWeight`
+          classStr = `largeFontSize fontWeight selectColor`
         }else{
           classStr = `largeFontSize`
         }
@@ -1457,7 +1457,7 @@ const setFontColorSize = (flg,pacs) => {
         if(pacs == 6){
           classStr = `simpleFontSize selectColor`
         }else if(pacs == 7){
-          classStr = `simpleFontSize fontWeight`
+          classStr = `simpleFontSize fontWeight selectColor`
         }else{
           classStr = `simpleFontSize`
         }
@@ -1490,7 +1490,11 @@ const setFontColorSize = (flg,pacs) => {
       }
     }else{//都是标准的
       if(flg == 2){
-        classStr = `simpleFontSize`
+        if(pacs == 7){
+          classStr = `simpleFontSize fontWeight`
+        }else{
+          classStr = `simpleFontSize`
+        }
       }else if(pacs == 7){
         classStr = `simpleFontSize fontWeight`
       }else if(flg == 1){
@@ -1529,6 +1533,26 @@ function removeRepeat(arr1,arr2){     //arr1被完全保留的数组
   return arr;
 }
 
+//判断不同科室内容是否相同
+function checkDeptContent(jsonStr,tmpLis){
+  for(let i = 0;i <tmpLis.length;i++){
+    let dataStr = tmpLis[i].preview;
+    if(
+      filterDataArr(JSON.parse(jsonStr.chief)) == filterDataArr(eval('('+JSON.parse(dataStr).chief+')')) && 
+      filterDataArr(JSON.parse(jsonStr.present)) == filterDataArr(eval('('+JSON.parse(dataStr).present+')')) && 
+      filterDataArr(JSON.parse(jsonStr.other)) == filterDataArr(eval('('+JSON.parse(dataStr).other+')')) && 
+      filterDataArr(JSON.parse(jsonStr.vital)) == filterDataArr(eval('('+JSON.parse(dataStr).vital+')')) &&
+      jsonStr.lis == JSON.parse(dataStr).lis &&
+      jsonStr.pacs == JSON.parse(dataStr).pacs &&
+      jsonStr.diag == JSON.parse(dataStr).diag &&
+      jsonStr.advice == JSON.parse(dataStr).advice
+    ){
+      // Notify.info('该模板已保存');
+      return false;
+    }
+  }
+}
+
 module.exports = {
     getIds,
     getWindowInnerWidth,
@@ -1583,5 +1607,6 @@ module.exports = {
     moveEnd,
     setFontColorSize,
     getValuedLabels,
-    removeRepeat
+    removeRepeat,
+    checkDeptContent
 };