소스 검색

输入时间失焦问题

luolei 4 년 전
부모
커밋
77eec6de7f

+ 0 - 99
src/components/AddNewInspect/SlideExcel/index.jsx

@@ -1,99 +0,0 @@
-import React, { Component } from "react";
-import styles from "./index.less";
-import { normalVal, timestampToTime, getStatusImg,setFontColorSize } from '@utils/tools';
-import slideUp from "@common/images/slide-up.png";
-import slideDown from "@common/images/slide-down.png";
-class SlideExcel extends Component {
-  constructor(props) {
-    super(props);
-    this.state = {
-      show: false
-    };
-    this.toTime = this.toTime.bind(this)
-    this.handleSlide = this.handleSlide.bind(this)
-  }
-  toTime(time) {
-    let tmpTim = time.split(',').join('') - 0
-    if (time && tmpTim.toString() != 'NaN') {
-      let date = new Date('1900-01-01');
-      let dateTim = date.getTime();
-      let times = (tmpTim - 2) * 24 * 60 * 60 * 1000;
-      let result = timestampToTime(dateTim + times).split(' ')[0]
-      return result;
-    } else {
-      return time;
-    }
-  }
-  handleSlide() {
-    let tmpShow = this.state.show
-    this.setState({
-      show: !tmpShow
-    })
-  }
-  render() {
-    const { items, item, idx, getInfomation, dateTime } = this.props;
-    const { show } = this.state;
-    return (
-      <li className={`${styles.excelDataLis} clearfix`} style={{ border: items.lisExcelRes.length - 1 == idx ? 0 : '' }}>
-        <span className={styles.excelDataTitle}>
-          <span className={`${styles.tagSpan} ${styles.selectTagSpan}`}>
-            <span className={`${styles.menus} ${setFontColorSize(2)}`}>{item.menus}</span>
-            <span className={styles.imgInfo} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: item.lisExcelItem[0].uniquemealName || '', type: 12, position: 1 })}></span>
-          </span>
-        </span>
-        <table className={`${styles.table} ${setFontColorSize(2)}`}>
-          {show ? (item.lisExcelItem && item.lisExcelItem.map((value, idx) => {
-            return <tr>
-              <td style={{ width: '30%' }}>
-                <span className={styles.tagSpan}>
-                  {value.itemName}
-                  <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}></span>
-                </span>
-              </td>
-              <td style={{ width: '20%' }}>
-                {
-                  getStatusImg(value.type, value.value, 1)
-                }
-                {value.unit}</td>
-              <td style={{ width: '25%' }}>
-                {normalVal(value.min, value.max)}
-              </td>
-              <td style={{ width: '25%' }}>{value.time == '' ? ('导入时间: ' + dateTime) : '检验时间: ' + this.toTime(value.time)}</td>
-            </tr>
-          })) : (item.lisExcelItem && item.lisExcelItem.map((value, idx) => {
-            if (idx < 4) {
-              return <tr>
-                <td style={{ width: '30%' }}>
-                  <span className={styles.tagSpan}>
-                    {value.itemName}
-                    <span className={styles.imgInfo1} title='点击i图标可查看详细说明' onClick={() => getInfomation({ name: value.uniqueName || '', type: 12, position: 1 })}></span>
-                  </span>
-                </td>
-                <td style={{ width: '20%' }}>
-                  {
-                    getStatusImg(value.type, value.value, 1)
-                  }
-                  {value.unit}</td>
-                <td style={{ width: '25%' }}>
-                  {normalVal(value.min, value.max)}
-                </td>
-                <td style={{ width: '25%' }}>{value.time == '' ? ('导入时间: ' + dateTime) : '检验时间: ' + this.toTime(value.time)}</td>
-              </tr>
-            }
-          }))
-          }
-        </table>
-        {
-          item.lisExcelItem && item.lisExcelItem.length > 5 ?
-            <div className={`${styles.slides} ${setFontColorSize(2)}`} onClick={this.handleSlide}>
-              {
-                show ? <span>收起</span> : <span>剩余<span className={styles.num}>{item.lisExcelItem.length - 4}</span>项</span>
-              }
-              <img src={show ? slideUp : slideDown} alt="" />
-            </div> : null
-        }
-      </li>
-    );
-  }
-}
-export default SlideExcel;

+ 0 - 199
src/components/AddNewInspect/SlideExcel/index.less

@@ -1,199 +0,0 @@
-@import "~@less/variables.less";
-.excelDataLis {
-    // cursor: pointer;
-    color: #767676;
-    position: relative;
-    padding-top: 10px;
-    padding-bottom: 10px;
-    border-bottom:1px dashed #989DA3;
-    i {
-        font-style: normal;
-        display: inline-block;
-        vertical-align: top;
-        padding-top: 3px;
-        &:before {
-            content: '\300C';
-        }
-        &:after {
-            content: '\300D';
-        }
-    }  
-    &>p {
-        cursor: pointer;
-        color: #767676;
-        display: inline-block;
-        position: relative;
-        vertical-align: top;
-    } 
-    .partDel {
-        width: 13px;
-        height: 13px;
-        margin-bottom: 11px;
-        cursor: pointer;
-        display: inline-block;
-        position: absolute;
-        right: 0;
-        top: 12px;
-        background-color: #fff;
-    }
-}
-
-
-.table {
-  color: #000;
-  width: 100%;
-  // display: inline-block;
-  tr {
-    line-height: 18px;
-    height: 18px;
-    width: 100%;
-    font-size: unset;
-    td {
-      padding-top: 3px;
-      font-size: unset;
-      span {
-        font-size: unset;
-      }
-    }
-  }
-}
-
-
-.itemPart {
-    height: 28px;
-    // line-height: 28px;
-    overflow: hidden;
-    padding-top: 0 !important;
-    width: 290px;
-    float: left;
-    padding: 0 15px;
-    box-sizing: border-box;
-    span {
-        display: inline-block;
-    }
-    .itemPartL {
-        max-width: 180px;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-        float: left;
-    }
-    .itemPartR {
-        width: 62px;
-        outline: none;
-        float: right;
-    }
-    .itemPartT {
-        float: right;
-        input {
-            width: 40px;
-            text-align: center;
-        }
-        .unit {
-            display: inline-block;
-        }
-    }
-}
-.itemPartOne {
-    width: 100% !important;
-}
-
-.excelDataLis {
-    padding: 2px 0px;
-    border-bottom: 1px dashed #989DA3;
-    .excelDataTitle {
-        width: 100%;
-        vertical-align: top;
-        padding-left: 10px;
-        float: left;
-        color: #000;
-    }
-    table {
-        width: 100%;
-        tr {
-            height: 16px;
-            line-height: 16px;
-            width: 100%;
-        }
-        td {
-            text-align: left;
-            padding-top: 6px;
-            padding-left: 10px;
-            cursor: default;
-        }
-        .excelUnit {
-            width: auto;
-            margin-left: 5px;
-        }
-    }
-}
-.center {
-    text-align: center;
-    font-size: 16px;
-    padding-top: 10px;
-    padding-bottom: 50px;
-}
-.slides {
-  background-color: #EDEDED;
-  text-align: center;
-  height: 28px;
-  line-height: 28px;
-  margin: 10px 0 8px 0;
-  cursor: pointer;
-  span {
-    color:#7d7d7d;
-    font-size: unset;
-  }
-  img{
-    vertical-align: middle;
-  }
-  .num {
-    color: @blue;
-  }
-}
-.imgInfo {
-  position: relative;
-}
-.imgInfo , .imgInfo1{
-  width: 15px;
-  height: 17px;
-  border-bottom: 0 none !important;
-  background: url('../img/info2.png') no-repeat center center;
-  background-size: 100% auto; 
-  position: absolute;
-  top: -10px;
-  left: 50%;
-  margin-left: -8px;
-  display: none;
-  cursor: pointer;
-}
-.imgInfo1 {
-  top: -13px;
-}
-.imgInfo:hover, .imgInfo1:hover {
-  background: url('../img/info3.png') no-repeat center center;
-  background-size: 100% auto; 
-}
-.excelDataTitle {
-  .tagSpan {
-    display: inline-block;
-    line-height: 28px;
-  }
-}
-.tagSpan {
-  display: inline-block;
-  position: relative;
-}
-.selectTagSpan {
-  // color: #000;
-  // font-weight: bold;
-  // .menus {
-  //   border-bottom: 1px solid #666666;
-  // }
-}
-.tagSpan:hover {
-  .imgInfo, .imgInfo1 {
-    display: block;
-  }
- 
-}

+ 58 - 0
src/components/AddNewInspect/SlideIpt/index.jsx

@@ -0,0 +1,58 @@
+import React, { Component } from "react";
+import styles from "./index.less";
+import $ from 'jquery';
+
+class SlideIpt extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      show:false,
+      activeInd:false,
+      activeName:'',
+      canEdit:true,
+      style:'',
+      value:''
+    };
+    this.setEdit = this.setEdit.bind(this);
+    this.handleBlur = this.handleBlur.bind(this);
+  }
+  
+  componentDidMount(){
+    const {item} = this.props
+    this.setState({value:item.time})
+  }
+  handleInput(e,item,sign){
+    e.stopPropagation();
+    const {setTipValue} = this.props
+    setTipValue(item,e.target.value,sign)
+  }
+  handleInputTime(e){
+    this.setState({value:e.target.value})
+  }
+  handleBlur(e,item,sign){
+    const {handlePush,setTipValue} = this.props;
+    $('.canEdit').attr('disabled','disabled')
+    setTipValue(item,e.target.value,sign)
+    handlePush && handlePush({mode:8});       //右侧推送
+  }
+  setEdit(e){
+    $('.canEdit').blur().attr('disabled','disabled')
+    $(e.target).removeAttr('disabled').focus()
+  }
+  render() {
+    const {item} = this.props;
+    return (
+      <input disabled="disabled" type="text" 
+          class="canEdit" 
+          onDoubleClick={(e)=>this.setEdit(e)}
+          style={{color:'#333'}}
+          placeholder='时间'
+          autoComplete="off"
+          value={this.state.value}
+          onInput={(e)=>{this.handleInputTime(e)}}
+          onBlur={(e)=>{this.handleBlur(e,item,1);}}
+          />
+    );
+  }
+}
+export default SlideIpt;

+ 269 - 0
src/components/AddNewInspect/SlideIpt/index.less

@@ -0,0 +1,269 @@
+@import "~@less/variables.less";
+.slideLi {
+    // cursor: pointer;
+    // color: #767676;
+    position: relative;
+    padding: 10px 0px 10px 0;
+    border-bottom:1px dashed #989DA3;
+    margin-top: 5px;
+    span {
+        display: inline-block;
+        padding: 0 5px;
+        box-sizing: border-box;
+    }
+    i {
+        font-style: normal;
+        display: inline-block;
+        vertical-align: top;
+        padding-top: 3px;
+        // &:before {
+        //     content: '\300C';
+        // }
+        // &:after {
+        //     content: '\300D';
+        // }
+    }  
+    &>p {
+        cursor: pointer;
+        color: #767676;
+        display: inline-block;
+        position: relative;
+        vertical-align: top;
+    } 
+    .partDel {
+        width: 15px;
+        height: 15px;
+        margin-bottom: 11px;
+        cursor: pointer;
+        display: inline-block;
+        position: absolute;
+        right: -4px;
+        top: 0px;
+        background: @closeIcon;
+        background-color: #fff;
+        background-size: 100% 100%;
+    }
+    .bigname {
+        width: 35%;
+        font-weight: bold;
+    }
+    .smallname {
+        width: 15%;
+    }
+    .edit {
+        width: 25%;
+        input {
+            width: 100%;
+        }
+        i {
+            
+        }
+    }
+    .maxmin {
+        width: 15%;
+    }
+    .pass {
+        text-align: right;
+        padding-left: 15px;
+        box-sizing: border-box;
+    }
+    .imgCheck {
+        position: relative;
+        top: 2px;
+        margin: 0 3px 0 5px;
+        cursor: pointer;
+    }
+}
+.slideLi:hover{
+    background:#F2F2F2;
+    border-radius: 4px;
+       .partDel{
+        background: @closeHor;
+        background-color: #fff;
+        background-size: 100% 100%;
+      } 
+}
+.staticTagActive {
+    cursor: pointer;
+    color: #333;
+    // display: inline-block;
+    position: relative;
+    vertical-align: top;
+    padding: 2px 10px 10px 10px;
+    box-sizing: border-box;
+    width: 100%;
+    float: left;
+    span {
+        border-bottom: 1px solid #666666 ;
+    }
+}
+
+.staticTag {
+    cursor: pointer;
+    // color: #767676;
+    color: @blue;
+    padding-top: 10px;
+    display: inline-block;
+    position: relative;
+    /* &:before {
+        content: '\300C';
+    }
+    &:after {
+        content: '\300D';
+    } */
+}
+.table {
+    color: #000;
+    width: 100%;
+    tr {
+        line-height: 18px;
+        height: 18px;
+        width: 100%;
+        font-size: unset;
+        td {
+          cursor: default;
+          padding-top: 3px;
+          font-size: unset;
+          span {
+              font-size: unset;
+          }
+        }
+    }
+    tr > td {
+        padding: 0 10px;
+        box-sizing: border-box;
+    }
+}
+
+.searchResult {
+    .searchResultT {
+        img {
+            float: right;
+        }
+    }
+}
+
+.excelDataLists {
+    position: relative;
+    background-color: #f1f1f1;
+    border: 1px solid #ccc;
+    .close {
+        width: 13px;
+        height: 13px;
+        position: absolute;
+        top: -5px;
+        right: -5px;
+        z-index: 30;
+        background-color: #fff;
+        border-radius: 50%;
+    }
+    .excelDataLis {
+        padding: 2px 0px;
+        border-bottom: 1px dashed #989DA3;
+        .excelDataTitle {
+            display: inline-block;
+            width: 20%;
+            vertical-align: top;
+            padding-left: 10px;
+            float: left;
+        }
+        table {
+            width: 80%;
+            tr {
+                height: 16px;
+                line-height: 16px;
+                width: 100%;
+            }
+            td {
+                text-align: left;
+                padding-top: 6px;
+                cursor: default;
+            }
+            .excelUnit {
+                width: auto;
+                margin-left: 5px;
+            }
+        }
+    }
+}
+.center {
+    text-align: center;
+    font-size: 16px;
+    padding-top: 10px;
+    padding-bottom: 50px;
+}
+.slides {
+  background-color: #EDEDED;
+  text-align: center;
+  height: 28px;
+  line-height: 28px;
+  margin: 10px 0 8px 0;
+  cursor: pointer;
+  span {
+    color:#7d7d7d;
+  }
+  img{
+    vertical-align: middle;
+  }
+  .num {
+    color: @blue;
+  }
+}
+.imgInfo {
+  position: relative;
+}
+.imgInfo, .imgInfo1 {
+  width: 15px;
+  height: 17px;
+  border-bottom: 0 none !important;
+  background: url('../img/info2.png') no-repeat center center;
+  background-size: 100% auto; 
+  position: absolute;
+  top: -10px;
+  left: 50%;
+  margin-left: -8px;
+  display: none;
+  cursor: pointer;
+}
+.imgInfo1 {
+    top: -13px;
+  }
+  .imgInfo:hover, .imgInfo1:hover {
+    background: url('../img/info3.png') no-repeat center center;
+    background-size: 100% auto; 
+  }
+.tagSpan {
+  display: inline-block;
+  position: relative;
+}
+.tagSpanS {
+    font-weight: bold;
+    color: #000;
+}
+.selectTagSpan {
+  color: #000;
+  font-weight: bold;
+}
+.tagSpan:hover {
+    .imgInfo, .imgInfo1 {
+        display: block;
+      }
+}
+.iptValue {
+    width: 60px;
+    color: #3B9ED0;
+    font-size: 12px;
+}
+.iptValueBtn {
+    color: #3B9ED0;
+    width: 60px;
+    height: 22px;
+    line-height: 22px;
+    background-color: #EDF8FF;
+    text-align: center;
+    display: inline-block;
+    font-size: 12px;
+    border-radius: 4px;
+    border-bottom: 0 !important;
+    margin-left: 10px;
+}

+ 5 - 19
src/components/AddNewInspect/SlidePic/index.jsx

@@ -4,6 +4,8 @@ import {  Notify,DelToast} from '@commonComp';
 import $ from 'jquery';
 import checkOff from '@common/images/check_off.png';
 import checkOn from '@common/images/check_on.png';
+import SlideIpt from '../SlideIpt';
+
 
 class SlidePic extends Component {
   constructor(props) {
@@ -32,13 +34,6 @@ class SlidePic extends Component {
       }
     });
   }
-  // shouldComponentUpdate(nextProps,nextState){
-  //   console.log(this.props.item.time , nextProps.item.time,nextState)
-  //   if(this.props.item.time == nextProps.item.time){
-  //     return false
-  //   }
-  //   return true
-  // }
   handleDel(time){
     const {handleDelClick,item} = this.props;
     this.setState({
@@ -64,8 +59,8 @@ class SlidePic extends Component {
     })
   }
   handleInput(e,item,sign){
+    e.stopPropagation();
     const {setTipValue} = this.props
-    console.log(item,e.target.value)
     setTipValue(item,e.target.value,sign)
   }
   handleBlur(){
@@ -83,7 +78,7 @@ class SlidePic extends Component {
     $(e.target).removeAttr('disabled').focus()
   }
   render() {
-    const {item,time} = this.props;
+    const {item,time,setTipValue} = this.props;
     const {canEdit,activeInd,activeName,value,style} = this.state;
     return (
       <li key={item.time} className={`${styles.slideLi} clearfix`}> 
@@ -106,16 +101,7 @@ class SlidePic extends Component {
             }
           </span>
           <span className={styles.pass}>
-            <input disabled="disabled" type="text" 
-                class="canEdit" 
-                onDoubleClick={(e)=>this.setEdit(e)}
-                style={{color:'#333'}}
-                placeholder='时间'
-                autoComplete="off"
-                value={item.time}
-                onChange={(e)=>{this.handleInput(e,item,1)}}
-                onBlur={(e)=>{this.handleBlur();}}
-                />
+            <SlideIpt item={item} setTipValue={setTipValue}/> 
           </span>
           <span id="addClose" className={styles.partDel} onClick={()=>{this.handleDel(item.time)}}></span>
           <DelToast show={time==item.time&&activeInd?true:false}

+ 15 - 239
src/components/AddNewInspect/index.jsx

@@ -1,11 +1,8 @@
 import React from 'react';
 import { SearchOption, InspectCommon, Calendar, Notify, ConfirmModal, Add, DelToast } from '@commonComp';
-import SlideExcel from './SlideExcel';
 import SlidePic from './SlidePic';
 import { deepClone, getPageCoordinate, getStatusImg,getDomUpDown ,getCurrentDate,setPosition,getCalendarDate} from '@utils/tools';
 import styles from './index.less';
-import ScrollArea from 'react-scrollbar';
-import store from '@store';
 import $ from 'jquery';
 class AddNewInspect extends React.Component {
   constructor(props) {
@@ -15,7 +12,6 @@ class AddNewInspect extends React.Component {
       showFill: false,
       date: false,
       currentIdx: '',
-      dateTime: "",
       currentData: {},
       numPlus: 0,     //判断是否所有的填写单都是空
       num: 0,            //暂存数据,获取一次,不能每次都是新的数据
@@ -25,54 +21,11 @@ class AddNewInspect extends React.Component {
       // tmpIds: [],      //内层外层
       impId: null
     }
-    this.$ul = React.createRef();
-    this.handleChangeDate = this.handleChangeDate.bind(this)
-    this.handleShowDate = this.handleShowDate.bind(this)
-    this.getItemList = this.getItemList.bind(this)
     this.getSearchList = this.getSearchList.bind(this)
-    this.getCommonList = this.getCommonList.bind(this)
-    this.changeActivePart = this.changeActivePart.bind(this)
-    this.showDetails = this.showDetails.bind(this)
     this.handleDelConfirm = this.handleDelConfirm.bind(this)
-    this.handleCancel = this.handleCancel.bind(this)
     this.handleSearchAdvice = this.handleSearchAdvice.bind(this)
-    this.changeShowFill = this.changeShowFill.bind(this)
-    this.handleFillShow = this.handleFillShow.bind(this)
     this.handleDelClick = this.handleDelClick.bind(this)
   }
-  handleDelConfirm() {//弹窗确定
-    const { delPartItem, handleCloseExcel, handlePush } = this.props;
-    const { type, id, impId } = this.state;
-    if (type == 1) {
-      delPartItem(id)
-    } else if (type == 2) {
-      handleCloseExcel(impId)
-    }
-    Notify.success("删除成功");
-    handlePush && handlePush({mode:8});       //右侧推送
-  }
-  handleDelClick(type, time) {
-    if (type == 2) {
-      this.setState({
-        impId: idx,
-        type: type,
-        id: null
-      })
-    } else {
-      this.setState({
-        type: type,
-        time: time,
-        impId: null
-      })
-    }
-  }
-  handleCancel() {
-    this.setState({
-      type: null,
-      id: null,
-      impId: null
-    })
-  }
   componentDidMount() {
     $(document).click((event) => {
       let searchWrap = document.getElementById("searchWrapAdvice");   // 搜索按钮
@@ -112,29 +65,24 @@ class AddNewInspect extends React.Component {
         }
       }
     });
-    const that = this;
-    document.addEventListener('mousedown',function(e){
-      //onMousedown的目标为滚动条时,标签填写单不关闭
-      if(e.target.className=='scrollbar'){
-        that.isBar = true;
-      }else{
-        that.isBar = false;
-      }
-    });
-    // this.setState({ dateTime: getCurrentDate(1) })
   }
-  componentWillReceiveProps(nextProps) {
-    if (nextProps.fillActive.name != this.props.fillActive.name) {
-      this.setState({ num: 0 })
+  handleDelConfirm() {//弹窗确定
+    const { delPartItem, handleCloseExcel, handlePush } = this.props;
+    const { type, id, impId } = this.state;
+    if (type == 1) {
+      delPartItem(id)
+    } else if (type == 2) {
+      handleCloseExcel(impId)
     }
+    Notify.success("删除成功");
+    handlePush && handlePush({mode:8});       //右侧推送
   }
-  changeShowFill() {
-    this.setState({ showFill: false })
-    this.props.setHighter(80)
-  }
-  handleChangeDate(info) {
-    let date = getCalendarDate(info);
-    this.setState({ dateTime: date, date: false })
+  handleDelClick(type, time) {
+    this.setState({
+      type: type,
+      time: time,
+      impId: null
+    })
   }
   handleSearchAdvice(e) {
     let tmpShow = this.state.show;
@@ -149,131 +97,12 @@ class AddNewInspect extends React.Component {
       setPosition(e,"#searchOption",this.props.setHighter)
     }
   }
-  handleFillShow(e, idx) {
-    let tmpShow = this.state.showFill;
-    let baseList = store.getState().inspect.fillActive;
-    this.setState({
-      showFill: !tmpShow,
-      currentIdx: idx,
-      currentData: baseList,
-      dateTime: baseList.time ? baseList.time : getCurrentDate(1)
-    })
-    // e.stopPropagation();
-  }
-  handleShowDate() {
-    this.setState({
-      date: !this.state.date
-    })
-  }
-  changeActivePart(idx, val, clear) {
-    let nums = this.state.num;
-    let fillActive;
-    if (nums == 0) {
-      fillActive = this.props.fillActive;
-    } else {
-      fillActive = this.state.currentData;
-    }
-    ++nums;
-    this.setState({ num: nums });
-    let tempArr = deepClone(fillActive);
-
-    if (clear) {    //点击清空按钮,至清初输入的数字
-      for (let i = 0; i < tempArr.details.length; i++) {
-        tempArr.details[i].value = ''
-        tempArr.show = false;
-      }
-      tempArr.time = getCurrentDate(1);
-      this.setState({ currentData: tempArr })
-      return;
-    } else {
-      let tempNumPlus = 0;
-      for (let i = 0; i < tempArr.details.length; i++) {
-        if (i == idx) {
-          tempArr.details[i].value = val
-        }
-        if (tempArr.details[i].value != undefined && tempArr.details[i].value != '') {
-          tempArr.show = true;
-        } else {
-          ++tempNumPlus;
-          if (tempNumPlus == tempArr.details.length) {
-            tempArr.show = false;
-          }
-        }
-      }
-      tempArr.time = this.state.dateTime;
-      this.setState({ currentData: tempArr })
-    }
-  }
-  getItemList() {        //填写单展示
-    let number = this.state.num;
-    let fillActive;
-    if (number == 0) {
-      fillActive = this.props.fillActive;
-    } else {
-      fillActive = this.state.currentData;
-    }
-    return <ul className={styles.searchLis} ref={this.$ul}>
-      {
-        fillActive && fillActive.details && fillActive.details.map((item, idx) => {
-          if (item.controlType == 1) {
-            return (
-              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
-                <span className={styles.itemPartL}>{item.name}</span>
-                <span className={styles.itemPartT}>
-                  <select className={styles.itemPartR} onChange={(e) => {
-                    if (e.target.value == '请选择') {
-                      this.changeActivePart(idx, '')
-                      return;
-                    }
-                    this.changeActivePart(idx, e.target.value);
-                  }}
-                  >
-                    <option value="请选择">请选择</option>
-                    {
-                      (item.questionDetailList).map((val) => {
-                        return <option value={val.name}
-                          selected={val.name == item.value ? true : false}
-                        >{val.name}</option>
-                      })
-                    }
-                  </select>
-                </span>
-              </li>
-            )
-          } else if (item.controlType == 6) {
-            return (
-              <li className={`${styles.itemPart} ${fillActive.details.length > 1 ? '' : styles.itemPartOne}`}>
-                <span className={styles.itemPartL} title={item.name}>{item.name}</span>
-                <span className={styles.itemPartT}>
-                  <input type="text"
-                    placeholder="(填写)"
-                    value={item.value}
-                    onKeyUp={(e) => { this.changeActivePart(idx, e.target.value.trim()) }}
-                  />
-                  <p className={styles.unit} title={item.labelSuffix}>{item.labelSuffix}</p>
-                </span>
-              </li>
-            )
-          }
-        })
-      }
-    </ul>
-  }
   handleSign(item,idx){
     const { handleSign,handlePush } = this.props;
     handleSign(item,idx)
     handlePush && handlePush({mode:8});       //右侧推送
   }
   getSearchList(list) {//搜索列表
-    const { handleSign } = this.props;
-    const contStyle={
-      opacity:'0.4',
-      right:'0',
-      top:'1px',
-      zIndex:'15',
-      width:'14px',
-      background:'#f1f1f1'};
-    const barStyle={background:'#777',width:'100%'};
     return <ul className={`${styles.searchLiUl} ${styles.searchIsp}`} style={{height:'205px',width:'302px',overflow:'auto'}}>
       {
         list && list.map((item, idx) => {
@@ -292,42 +121,7 @@ class AddNewInspect extends React.Component {
       }
       </ul>;
   }
-  getCommonList() {//常用列表
-    const { handleSign, inspectList } = this.props;
-    return <ul className={styles.searchLiUl}>
-      {
-        inspectList && inspectList.map((item, idx) => {
-          return <li key={idx}
-            className={styles.searchLi}
-            title={item.name}
-            onClick={() => {
-              this.props.setHighter(80)
-              handleSign(item.questionId, idx, 'common');
-              this.setState({ show: false })
-            }}
-          >
-            {item.name}
-          </li>
-        })
-      }
-    </ul>
-  }
-  showDetails(val) {
-    let min = val.minValue, max = val.maxValue, value = val.value, dom = '';
-    dom = getDomUpDown(min,max,value)
-    if (val.questionDetailList.length > 0) {
-      return val.questionDetailList.map((item) => {
-        if (val.value == item.name) {
-          return <td style={{ width: '20%' }} className={item.abnormal != '0' ? "red" : ''}>{val.value}</td>
-        }
-      })
-    } else {
-      // return <td style={{ width: '20%' }}><span className={(val.value - 0).toString() == 'NaN' ? "red" : (val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue ? "red" : '') : ''}>{val.value}</span> {val.labelSuffix}</td>
-      return <td style={{ width: '20%' }}>{dom} {val.labelSuffix}</td>
-    }
-  }
   render() {
-    console.log(99)
     const {labelListBlood,setHighter,refreshScroller,checkOnOff, getInfomation,setTipValue, handleChangeValue,labelListSmall,inspectList, inspectVal, list, labelListBig, windowHeight, windowWidth,detailClick, handleLabelSub, handleClear, handleConfirm, fillActive, getExcelDataList, handleCloseExcel, handlePush,handleDelConfirm } = this.props;
     const { tmpId, tmpIdx, time, pageTop, impId } = this.state;
     const contStyle={
@@ -337,7 +131,6 @@ class AddNewInspect extends React.Component {
       zIndex:'15',
       width:'14px',
       background:'#f1f1f1'};
-    const barStyle={background:'#777',width:'100%'};
     return (
       <div className={styles.wrapper}>
         <div className={styles.check}>
@@ -388,23 +181,6 @@ class AddNewInspect extends React.Component {
           <Add showText="添加医嘱" handleClick={(e) => this.handleSearchAdvice(e)} id="searchWrapAdvice" />
           {this.state.show ? <SearchOption searchType="2" detailClick={detailClick} windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
             {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 136px', color: '#bfbfbf' }}>暂无筛选项</p>)}
-            {/* {
-              (list && list.length > 0) || (inspectVal != '') || (inspectList&&inspectList.length==0) ? '' : <div>
-                <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>常用检验项</p>
-                <ScrollArea speed={0.8}
-                            horizontal={false}
-                            stopScrollPropagation={true}
-                            style={{height:'225px'}}
-                            className={styles["area"]}
-                            verticalContainerStyle={contStyle}
-                            verticalScrollbarStyle={barStyle}
-                            contentClassName="content">
-                {
-                  this.getCommonList()
-                }
-                </ScrollArea>
-              </div>
-            } */}
           </SearchOption> : ''}
         </div>
       </div>

+ 0 - 2
src/components/InfoTitle/index.jsx

@@ -21,8 +21,6 @@ class InfoTitle extends Component {
         this.showHistoryBox = this.showHistoryBox.bind(this)
     }
     showHistoryBox(){
-
-        console.log('关闭');
         const {showLoading,hideLoading}=this.props;
         showLoading();
         // 底部页面禁止滚动

BIN
src/components/NewAdvice/dists/FileAPI.flash.camera.swf


BIN
src/components/NewAdvice/dists/FileAPI.flash.image.swf


BIN
src/components/NewAdvice/dists/FileAPI.flash.swf


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 3608
src/components/NewAdvice/dists/FileAPI.html5.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
src/components/NewAdvice/dists/FileAPI.html5.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 4418
src/components/NewAdvice/dists/FileAPI.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
src/components/NewAdvice/dists/FileAPI.min.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 11008
src/components/NewAdvice/dists/jQuery.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 4
src/components/NewAdvice/dists/jq.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
src/components/NewAdvice/dists/jquery.fileapi.min.js


+ 2 - 230
src/components/NewAdvice/index.jsx

@@ -2,40 +2,9 @@ import React from 'react';
 import { ItemBox, ConfirmModal, WrapModalContainer } from '@commonComp';
 import AddNewInspect from '../AddNewInspect';
 import styles from './index.less';
-import { getExcelList } from '@store/actions/inspect';
-import Notify from '@commonComp/Notify';
-import store from '@store';
 import $ from 'jquery';
-import { host, prefix } from '@utils/config.js';
-import { isIE, getUrlArgObject,getCurrentDate,setFontColorSize } from '@utils/tools.js';
+import { isIE } from '@utils/tools.js';
 import { dragBox } from '@utils/drag';
-import WrapModalBody from '@containers/WrapModalBody';
-import {getMRAnalyse} from '@store/async-actions/pushMessage';
-import {SET_CURRENT_MODULE} from '@types/homePage';
-
-
-(function ($) {
-  var FileAPI = {
-    // @default: "./dist/"
-    staticPath: './dists/',
-
-    // @default: FileAPI.staticPath + "FileAPI.flash.swf"
-    flashUrl: './dists/FileAPI.flash.swf',
-
-    // @default: FileAPI.staticPath + "FileAPI.flash.image.swf"
-    flashImageUrl: './dists/FileAPI.flash.image.swf'
-  };
-  return FileAPI
-})($)
-
-import "./dists/FileAPI.js";
-
-const isLocal = window.location.hostname.indexOf('localhost') != -1;
-const qhost = isLocal ? host + prefix : prefix;
-const api = { 
-  upload: qhost + '/lisExcelRes/lisExcelAnalysis'
-};
-let numFlg = 0;
 
 class NewAdvice extends React.Component {
   constructor(props) {
@@ -50,14 +19,8 @@ class NewAdvice extends React.Component {
       hide: false,
       importLis:false
     }
-    this.handleImportExcel = this.handleImportExcel.bind(this);
     this.cancel = this.cancel.bind(this);
-    this.getWarings = this.getWarings.bind(this);
-    this.checkSystemIpt = this.checkSystemIpt.bind(this);
     this.onClose = this.onClose.bind(this);
-    this.handleBindFileApi = this.handleBindFileApi.bind(this);
-    this.closeInIcss = this.closeInIcss.bind(this);
-    this.showSlideImport = this.showSlideImport.bind(this);
     this.refreshScroller = this.refreshScroller.bind(this);
   }  
   componentDidMount() {
@@ -72,166 +35,15 @@ class NewAdvice extends React.Component {
     });
     this.props.setContext(this.context)
   }
-  handleBindFileApi(){
-    const {message} = this.props;
-    var ua = navigator.userAgent;
-    var _isIE = ua.indexOf("MSIE") > -1;
-    if (_isIE) {
-      let version = ua.match(/MSIE ([\d.]+)/)[1];
-      this.setState({
-        ieVersion: version
-      })
-    }
-    $('iframe').bind('load', function () { })
-    const { fetchPushInfos } = this.props;
-    // FileAPI.debug = true
-    $.support.cors = true;
-    const that = this;
-    var choose = document.getElementById('choose');
-    FileAPI.event.on(choose, 'change', function (evt) {
-      var files = FileAPI.getFiles(evt);
-      FileAPI.filterFiles(files, function (file, info) {
-        let name = file.name;
-        // if( name.split('.')[1] == 'xlsx' || name.split('.')[1] == 'xls' ){
-        //     Notify.error('请选择正确的excel表格')
-        //     return false;
-        // }else{
-        //     return true;
-        //   }
-          return true;
-      },
-        function (files, rejected) {
-          if (files.length) {
-            //console.log(files[0])
-            const securityCode = getUrlArgObject("code");
-            const appKeyId = getUrlArgObject("appI");
-            const appKeySecret = getUrlArgObject("appS");
-            const productId = getUrlArgObject("productId");
-            FileAPI.upload({
-              // url: '/api/icss/lisExcelRes/lisExcelAnalysis',
-              url: api.upload,
-              data: { hospitalCode: message == '{}' ? '' : message.hospitalCode },
-              files: { uploadfile: files[0] },
-              headers: {
-                appKeyId: appKeyId,
-                appKeySecret: appKeySecret,
-                securityCode: securityCode,
-                productId: productId
-              },
-              complete: function (err, xhr) {
-                if (!err) {
-                  let res = JSON.parse(xhr.response);
-                  if(res.code == 0){
-                    let message = res.data.messages;
-                    if(res.data.lisExcelRes){
-                      for(let i = 0;i < res.data.lisExcelRes.length;i++){
-                        let tmpLisExcelItem = res.data.lisExcelRes[i]
-                        if(tmpLisExcelItem.lisExcelItem){
-                          for(let j = 0;j < tmpLisExcelItem.lisExcelItem.length;j++){
-                            tmpLisExcelItem.lisExcelItem[j].time = tmpLisExcelItem.lisExcelItem[j].time||getCurrentDate(1)
-                          }
-                        }
-                      }
-                    }
-                    store.dispatch(getExcelList(res.data));
-                    store.dispatch(getMRAnalyse());
-                    fetchPushInfos && fetchPushInfos({mode:8});
-                    if (message && message.length != 0) {
-                      that.setState({
-                        visible: true,
-                        dom: message,
-                        height: message.length
-                      })
-                    }
-                  }else{
-                    Notify.error(res.msg)
-                  }
-                  $("#choose").val("");
-                } else {
-                  let res = JSON.parse(xhr.response);
-                  Notify.error(res.msg)
-                  $("#choose").val("");
-                }
-              }
-            });
-          }
-        });
-    });
-  }
-  handleImportExcel() {
-    this.inputRef.click();
-    const storeState = store.getState()
-    const {moduleName} = storeState.homePage
-    if(moduleName != '检验') {
-      store.dispatch({
-        type: SET_CURRENT_MODULE,
-        moduleName:'检验'
-      });
-      store.dispatch(getMRAnalyse());
-    }
-  }
   cancel() {
     this.setState({ visible: false })
   }
-  getStyle() {
-    const { ieVersion } = this.state;
-    if (ieVersion && ieVersion <= 9) {
-      return styles.disabledBtn;
-    } else {
-      return styles.button;
-    }
-  }
-  getWarings(lis) {
-    <ul>
-      {
-        lis.length > 0 && lis.map((val) => {
-          return <li>
-            {val}
-          </li>
-        })
-      }
-    </ul>
-  }
-  checkSystemIpt() {
-    this.setState({
-      hide: true
-    })
-    const storeState = store.getState()
-    const {moduleName} = storeState.homePage
-    if(moduleName != '检验') {
-      store.dispatch({
-        type: SET_CURRENT_MODULE,
-        moduleName:'检验'
-      });
-      store.dispatch(getMRAnalyse());
-    }
-  }
   onClose() {
     this.setState({
       hide: false
     })
     dragBox('previewWrapper', 'previewStatic', 'del')
   }
-  closeInIcss(){
-    this.setState({
-      hide: false
-    })
-  }
-  showSlideImport(){
-    let flg = this.state.importLis
-    this.setState({
-      importLis:!flg
-    })
-    const storeState = store.getState()
-    const {moduleName} = storeState.homePage
-    if(moduleName != '检验') {
-      store.dispatch({
-        type: SET_CURRENT_MODULE,
-        moduleName:'检验'
-      });
-      store.dispatch(getMRAnalyse());
-    }
-  }
   refreshScroller(){
     //滚动条对象
     return this.context.scrollArea;
@@ -241,51 +53,12 @@ class NewAdvice extends React.Component {
   }
   render() {
     const {hideAllDrop,setHighter,labelListBig, fetchPushInfos,getInfomation,labelListSmall, hospitalMsg, inspectVal, windowHeight, windowWidth,setTipValue, handleCloseExcel, handleChangeValue, labelListActive, list, handleSign, labelList, handleLabelSub, handleClear, handleConfirm, fillActive, changeActivePart, getExcelDataList, delPartItem, inspectList,detailClick,handleDelConfirm,checkOnOff ,labelListBlood} = this.props;
-    const { ieVersion, isIE, hide,importLis } = this.state;
-    const { checkSystemIpt, onClose,handleBindFileApi,closeInIcss,showSlideImport } = this;
-    if(JSON.stringify(hospitalMsg) != {} && document.getElementById("choose")){//动态绑定只绑定一次
-      ++numFlg
-      numFlg == 1?handleBindFileApi():null
-    }
+
     return (
       <div className={styles.wrapper}>
         {/* 导入功能插件,ie8/9权限问题暂未解决,先隐藏 */}
         <div className={styles.top}>
           <span id="inspectResultData" className={styles.newAdviceTitle}> </span>
-          {/* <div className={this.getStyle()} onClick={ieVersion&&ieVersion<=9?null:this.handleImportExcel}> */}
-          {/* <div className={this.getStyle()} style={{ display: hospitalMsg.import_way_lis == 0||hospitalMsg.import_way_lis ==undefined ? 'none' : 'block' }}> */}
-            {/* <button disabled={ieVersion&&ieVersion>9?true:false}onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>导入检验结果</button>
-            <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
-            {/* {0没有,1本地,2医院,3本地和医院} */}
-            {/* {
-              hospitalMsg.import_way_lis == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
-                <p className={styles.importInspectBtn}>导入检验结果</p>
-                <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
-              </div> : hospitalMsg.import_way_lis == 2 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
-                <p className={styles.importInspectBtn}>导入检验结果</p>
-              </div> : hospitalMsg.import_way_lis == 3 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
-                <p id="importInspectBtn" className={styles.importInspectBtn}>导入检验结果</p>
-                {
-                  <ul className={styles.importSelect} style={{display:importLis?'block':'none'}} id="importList">
-                    <li className={styles.excelIpt}>
-                      <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
-                      <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
-                    </li>
-                    <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>从设备导入</li>
-                  </ul>
-                }
-              </div> : null
-            } */}
-
-            {/* {
-              hide ? <WrapModalContainer title={'导入检验数据'} width={1000} height={570} onClose={onClose}>
-                <WrapModalBody
-                  height={570}
-                  closeInIcss={closeInIcss}
-                ></WrapModalBody>
-              </WrapModalContainer> : null
-            } */}
-          {/* </div> */}
         </div>
         <ItemBox
           hideAllDrop={hideAllDrop}
@@ -293,7 +66,6 @@ class NewAdvice extends React.Component {
           title={'医嘱'}
           editable={false}
           border={true}
-          // style={{marginRight:'0'}}
           marginTop={'0px'}
         >
           <div style={{ padding: '0px 10px 10px 10px', boxSizing: 'border-box',color:'#000' }} >

+ 0 - 2
src/store/async-actions/print.js

@@ -39,12 +39,10 @@ export const getConceptDetails = (bool) => {
         if (data.code == 0) {
             realSaveData(bool,data.data)
         } else {
-            console.log(res)
             realSaveData(bool)
         }
     }).catch((err)=>{
         realSaveData(bool)
-        console.log(err)
     })
 }
 export const saveMessage = (bool) =>{

+ 1 - 0
src/store/reducers/assistCheck.js

@@ -135,6 +135,7 @@ export default (state = initSearchList, action) => {
     for (let i = 0; i < tempArr.length; i++) {
       if (i == action.idx) {
         tempArr[i].value = action.val
+        tempArr[i].result = action.val
         newState.assistLabel = [...tempArr]
       }
     }

+ 8 - 8
src/store/reducers/newAdvice.js

@@ -116,10 +116,11 @@ export default (state = initSearchList, action) => {
         let tempArrs = newState.labelListSmall;
         let tmpArr = newState.labelListBlood;
         let tmpLis = action.item
-        if(tmpLis.flg == 5){
+        // console.log(action,1111111)
+        if(tmpLis.flg == 5){//药品
             for(let i= 0;i < tempArr.length;i++){
                 if(tmpLis.time == tempArr[i].time){
-                    if(action.sign == 1){
+                    if(action.sign == 1){//时间
                         tempArr[i].time = action.value
                         tempArr[i].dateValue = action.value
                     }else{
@@ -127,14 +128,16 @@ export default (state = initSearchList, action) => {
                     }
                 }
             }
-        }else if(tmpLis.flg == 6){
+            newState.labelListBig = [...tempArr]
+        }else if(tmpLis.flg == 6){//手术
             for(let i= 0;i < tempArrs.length;i++){
                 if(tmpLis.time == tempArrs[i].time){
                     tempArrs[i].time = action.value
                     tempArrs[i].dateValue = action.value
                 }
             }
-        }if(tmpLis.flg == 8){
+            newState.labelListSmall = [...tempArrs]
+        }if(tmpLis.flg == 8){//输血
             for(let i= 0;i < tmpArr.length;i++){
                 if(tmpLis.time == tmpArr[i].time){
                     if(action.sign == 1){
@@ -145,10 +148,8 @@ export default (state = initSearchList, action) => {
                     }
                 }
             }
+            newState.labelListBlood = [...tmpArr]
         }
-        newState.labelListBig = [...tempArr]
-        newState.labelListSmall = [...tempArrs]
-        newState.labelListBlood = [...tmpArr]
         return newState;
     }
     if (action.type == SEARCH_TYPE_NEW) {
@@ -162,7 +163,6 @@ export default (state = initSearchList, action) => {
         const tempArrs = newState.labelListSmall;
         const tmpArr = newState.labelListBlood;
         let tmpLis = action.list
-        console.log(action,555555)
         tmpLis['time'] = getCurrentDate(1)
         tmpLis['dateValue'] = getCurrentDate(1)
         if(tmpLis.flg == 5){