1178232204@qq.com vor 3 Jahren
Ursprung
Commit
02c84df6a9

+ 2 - 2
src/common/components/SearchOption/index.jsx

@@ -57,6 +57,7 @@ class SearchOption extends React.Component {
             val:'',
             show:false
         });
+        
         handleChangeValue('','clear');
     }
     detailClick(val,txt){
@@ -64,7 +65,7 @@ class SearchOption extends React.Component {
         detailClick(val)
         this.setState({txt:txt})
         let value = this.textInput.current.value||''
-
+        
         if(value.trim() == ''){
             this.setState({
                 show:false
@@ -107,7 +108,6 @@ class SearchOption extends React.Component {
       }
     }
     handleBlur(){
-
       this.setState({border:false,val:''})
     }
     render() {

+ 1 - 0
src/components/AddAssistCheck/index.jsx

@@ -321,6 +321,7 @@ class AddAssistCheck extends React.Component {
   render() {
     const { handleChangeValue, list, assistVal, windowHeight, assistList, refreshScroller } = this.props;
     const { visible, pageTop } = this.state;
+    console.log(this.state,444);
     const contStyle = {
       opacity: '0.4',
       right: '0',

+ 1 - 1
src/components/AddGuage/Textarea/index.jsx

@@ -97,7 +97,7 @@ class Textarea extends Component {
   handleFocus() {     //ie8下提示语挡住输入框,导致输入框无法聚焦
     this.textInput.current.previousSibling.focus();
     store.dispatch(embedPush({
-      action: "other",
+      action: "diag",
       mode: 1
     }))
     // this.textInput.current.previousSibling.focus();

+ 47 - 3
src/components/AddGuage/index.jsx

@@ -32,6 +32,50 @@ class AddGuage extends React.Component {
     this.timeSure = this.timeSure.bind(this)
   }
 
+  componentDidMount() {
+    $(document).click((event) => {
+      let _con = $('#searchWrapScale');   // 设置目标区域
+      let _cons = $('#datePick');   // 设置目标区域
+      let _conClick = $('#assistCheck');   // 点击的按钮
+      let _del = document.getElementById("delBox");   // 删除弹窗
+      let _close = document.getElementById("assiClose");   // 删除icon
+      let _closeTil = $('#delTit')[0];   // 弹窗标题
+      if (!this.isBar) {//onMousedown的目标为滚动条时,子项弹窗不关闭)
+        if ($(event.target).attr('id') == 'searchWrapScale' || _con && _con != event.target && !_con.is(event.target) && _con.has(event.target).length === 0) { // Mark 1
+          if (this.state.show) {
+            this.props.setHighter(48)
+          }
+          this.setState({ show: false });
+        }
+        if (!_cons.is(event.target) && !_conClick && _cons.has(event.target).length === 0 || event.target.isEqualNode(_close)) { // Mark 1
+          this.setState({ date: false });
+        }
+        if ($(event.target).attr("contenteditable") || event.target.textContent == '量表结果') {
+          this.setState({ date: false });
+        }
+
+        if (_del) {
+          if ($(event.target).attr('id') != 'assiClose' && !event.target.isEqualNode(_close) && !event.target.isEqualNode(_del) && event.target.parentNode != _del && !event.target.isEqualNode(_closeTil)) {
+            this.setState({
+              visible: false,
+              id: null,
+              activeName: ''
+            })
+          }
+        }
+      }
+    });
+    const that = this;
+    document.addEventListener('mousedown', function (e) {
+      //onMousedown的目标为滚动条时,标签填写单不关闭
+      if (e.target.className == 'scrollbar') {
+        that.isBar = true;
+      } else {
+        that.isBar = false;
+      }
+    });
+    getCurrentDate(1);
+  }
   handleDelClick(id, item) {
     this.setState({
       visible: true,
@@ -205,15 +249,15 @@ class AddGuage extends React.Component {
     </React.Fragment>
   }
   render() {
-    const { handleChangeValue, list, assistVal, windowHeight, refreshScroller } = this.props;
+    const { handleChangeValue, list, guageVal, windowHeight, refreshScroller } = this.props;
     const { pageTop } = this.state;
     return (
       <div className={styles.wrapper}>
         {this.getGuageLabel()}
-        <div id="aaaa" style={{ position: "relative", clear: 'both' }}>
+        <div id="searchWrapScale" style={{ position: "relative", clear: 'both' }}>
           <Add showText="添加量表项" handleClick={(e) => this.handleSearchShow(e)} id="guage" />
           {this.state.show ? <SearchOption windowHeight={windowHeight} refreshScroller={refreshScroller} searchTop={40} pageTop={pageTop} height={280} handleChangeValue={handleChangeValue} visible={true}>
-            {list && list.length > 0 ? this.getSearchList(list) : (assistVal == '' ? '' : <p style={{ padding: '42px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
+            {list && list.length > 0 ? this.getSearchList(list) : (guageVal == '' ? '' : <p style={{ padding: '42px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
           </SearchOption> : ''}
         </div>
       </div>

+ 1 - 1
src/containers/Guage.js

@@ -82,7 +82,7 @@ function mapDispatchToProps(dispatch, store) {
     },
     //右侧推送
     fetchPushInfos(obj) {
-      obj.action = 'other'
+      obj.action = 'diag'
       //调右侧推送
       dispatch(embedPush(obj));
     },