瀏覽代碼

模板性别

Luolei 6 年之前
父節點
當前提交
ef798e435a

+ 11 - 6
src/components/CurrentIll/index.jsx

@@ -4,7 +4,7 @@ import {Button,InlineTag,ItemBox,Notify,Textarea} from '@commonComp';
 import TailInlineTag from '@commonComp/TailInlineTag';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
-import {filterDataArr,getPageCoordinate,windowEventHandler} from '@utils/tools'
+import {filterDataArr,getPageCoordinate,windowEventHandler,isIE} from '@utils/tools'
 import $ from 'jquery';
 
 class CurrentIll extends Component{
@@ -82,14 +82,19 @@ class CurrentIll extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      return;
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
+        return;
+      }
+      leftL = ele.offsetLeft+90
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+90,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

+ 10 - 5
src/components/MainSuit/index.jsx

@@ -136,14 +136,19 @@ class MainSuit extends Component{
   handleClick(e){//让搜索框跟随鼠标点击移动
     // e.stopPropagation(); //冒泡到最顶层关闭其他下拉
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      // return;    //主诉清空焦点在div内
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
+        return;
+      }
+      leftL = ele.offsetLeft+60
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+60,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

二進制
src/components/Operation/img/check-circle.png


二進制
src/components/Operation/img/check-right.png


+ 40 - 2
src/components/Operation/index.jsx

@@ -6,6 +6,8 @@ import saveHistory from '@common/images/saveHistory.png';
 import PrintPreviewContainer from '@containers/PrintPreviewContainer';
 import PreviewContainer from '@containers/PreviewContainer';
 import { ConfirmModal, Notify } from '@commonComp';
+import check_circle from './img/check-circle.png';
+import check_right from './img/check-right.png';
 import {getAllDataList,getAllDataStringList,isAllClear,filterArr} from '@utils/tools';
 import store from '@store';
 
@@ -21,7 +23,9 @@ class Operation extends Component {
       oKBg: '',
       msg: '',
       type: '',
-      zIndex:40
+      zIndex:40,
+      sex:'3',
+      radio:[true,false,false]
     }
     this.showPrint = this.showPrint.bind(this);
     this.closePrint = this.closePrint.bind(this);
@@ -31,6 +35,8 @@ class Operation extends Component {
     this.clearAll = this.clearAll.bind(this);
     this.saveHis = this.saveHis.bind(this);
     this.keypress = this.keypress.bind(this);
+    this.changeRadio = this.changeRadio.bind(this);
+    this.getCheckIcon = this.getCheckIcon.bind(this);
   }
 
   showPrint() {
@@ -222,6 +228,14 @@ class Operation extends Component {
       return true
     }
   }
+  getCheckIcon(flg) {
+    alert(flg)
+    if (flg) {
+        return check_right;
+    } else {
+        return check_circle;
+    }
+}
   changeTitle() {
     return <div className={style['box']}>
       <input className={style['ipt']}
@@ -237,8 +251,32 @@ class Operation extends Component {
         onKeyPress={e => this.keypress(e)}
       />
       <div className={style['line']}></div>
+      <div className={style['iptWrap']}>
+      {
+        this.state.radio.map(()=>{
+          
+        })
+      }
+        <label onClick={()=>{this.changeRadio(3)}}><img src={this.getCheckIcon(this.state.radio[0])} alt=""/>通用</label> 
+        <label onClick={()=>{this.changeRadio(1)}}><img src={this.getCheckIcon(this.state.radio[1])} alt=""/>男</label> 
+        <label onClick={()=>{this.changeRadio(2)}}><img src={this.getCheckIcon(this.state.radio[2])} alt=""/>女</label> 
+      </div>
     </div>
   }
+  changeRadio(sex){
+    let radios = [false,false,false]
+    if(sex == 1){
+      radios = [false,true,false]
+    }else if(sex == 2){
+      radios = [false,false,true]
+    }else if(sex == 3){
+      radios = [true,false,false]
+    }
+    this.setState({
+      sex:sex,
+      radio:radios
+    })
+  }
   makeSure() {
     const { save, clear, saveDataAll,diagShowTmp } = this.props;
     const { type } = this.state;
@@ -256,7 +294,7 @@ class Operation extends Component {
         return;
       }
       // diagShowTmp(false)
-      saveDataAll(this.state.title);
+      saveDataAll(this.state.title,this.state.sex);
     }
   }
   closeDiagBox(){

+ 13 - 0
src/components/Operation/index.less

@@ -108,6 +108,19 @@
         margin-bottom: 20px;
     }
 }
+.iptWrap {
+  width: 170px;
+  height: 20px;
+  line-height: 18px;
+  margin: 15px auto;
+  label {
+    margin-right: 5px;
+  }
+  input {
+    width: 30px;
+    height: 30px;
+  }
+}
 .msg {
     text-align: center;
     font-size: 16px;

+ 11 - 7
src/components/OtherHistory/index.jsx

@@ -2,7 +2,7 @@ import React,{Component} from 'react';
 import {Button,InlineTag,ItemBox,Textarea,Notify} from '@commonComp';
 import chooseType from '@containers/eleType.js';
 import SearchDrop from '@components/SearchDrop';
-import {filterDataArr,getPageCoordinate,windowEventHandler} from '@utils/tools'
+import {filterDataArr,getPageCoordinate,windowEventHandler,isIE} from '@utils/tools'
 import $ from 'jquery';
 import style from './index.less';
 
@@ -74,15 +74,19 @@ class OtherHistory extends Component{
     const {fetchPushInfos} = this.props;
     //fetchPushInfos&&fetchPushInfos();
     //若使用e.target,因为是onClick事件中,值可能是itembox的而不是span因此会有bug
-    const ele = document.activeElement;
-
-    if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
-      return;
+    let leftL=0;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
+    if(isIE()){
+      leftL = getPageCoordinate(e).boxLeft
+    }else{
+      const ele = document.activeElement;
+      if(ele.toString().indexOf('HTMLSpanElement') == -1){     //点击的不是span无法聚焦就不再设置位置
+        return;
+      }
+      leftL = ele.offsetLeft+90
     }
-    const leftL = ele.offsetLeft;      //用焦点元素的左边距替换鼠标点击的左边距,高度还是鼠标点击的位置
     this.setState({
       // boxLeft:getPageCoordinate(e).boxLeft,
-      boxLeft:leftL+90,
+      boxLeft:leftL,
       boxTop:getPageCoordinate(e).boxTop,
       tmpScroll: $("#addScrollEvent")[0].scrollTop,
       tmpTop:getPageCoordinate(e).boxTop

+ 2 - 2
src/containers/OperationContainer.js

@@ -47,8 +47,8 @@ function mapDispatchToProps(dispatch) {
         clear: () => {
             clearMessages()
         },
-        saveDataAll(val){
-          dispatch(saveTemplateDetail(val))
+        saveDataAll(val,sex){
+          dispatch(saveTemplateDetail(val,sex))
         },
         diagShowTmp(bool){
           dispatch({

+ 2 - 3
src/store/async-actions/tabTemplate.js

@@ -37,13 +37,12 @@ export const initItemList = (type) => { //初始化数据
   }
 };
 
-export const saveTemplateDetail = (val) => { //保存为模板
+export const saveTemplateDetail = (val,sex) => { //保存为模板
   let baseList = store.getState();
   let jsonData = getAllDataList(baseList);
   let jsonStr = getAllDataStringList(baseList);
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
-  console.log(state)
   let preview = {
     "chief": jsonStr.chief,
     "present": jsonStr.present,
@@ -63,7 +62,7 @@ export const saveTemplateDetail = (val) => { //保存为模板
       "modeName": val,
       "modeType": whichSign,
       "preview": idx ? JSON.stringify(preview):preview,
-      "sex":state.sex
+      "sex":sex
     }
     return tmpObj;
   }