Bläddra i källkod

接口不报错

luolei 4 år sedan
förälder
incheckning
80bea192e2

+ 30 - 1
src/common/components/SearchOption/index.jsx

@@ -90,10 +90,39 @@ class SearchOption extends React.Component {
       this.setState({border:false,val:''})
     }
     render() {
-        const { children,visible } = this.props;
+        const { children,visible,searchType } = this.props;
         const { show } = this.state;
+        console.log(searchType)
         return (
+            searchType == 1?
             <div id="searchOption" className={visible?`${styles.search} ${styles.show} searchOption`:`${styles.search} ${styles.hide} searchOption`}>
+                <img style={{display:show?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
+                <div className={styles.selectLis}>
+                    <span>细项</span>
+                    <ul>
+                        <li>细项</li>
+                        <li>套餐</li>
+                    </ul>
+                </div>
+                <input
+                    className={this.state.border ?`${styles.border}`:`${styles.borderNone}`}
+                    type="text"
+                    maxLength="30"
+                    ref={this.textInput}
+                    onFocus={this.handleFocus}
+                    onBlur={this.handleBlur}
+                    onInput={(e) => { 
+                        this.handleInput(e)
+                    }}
+                    onPropertyChange={(e) => {  // 兼容ie
+                        this.handleInput(e)
+                    }}
+                    placeholder="搜索"
+                />
+                <div className={styles.autoList}>
+                    {children}
+                </div>
+            </div>:<div id="searchOption" className={visible?`${styles.search} ${styles.show} searchOption`:`${styles.search} ${styles.hide} searchOption`}>
                 <img className={styles.searchVal} src={search} alt="搜索" />
                 <img style={{display:show?'block':'none'}} className={styles.clearVal} src={clear} onClick={this.handleClearVal} alt="清空" />
                 <input

+ 9 - 0
src/common/components/SearchOption/index.less

@@ -40,6 +40,15 @@
         cursor: pointer;
         right: 18px;
     }
+
+    .selectLis {
+        position: absolute;
+        left: 0;
+        top:0;
+        ul {
+            display: none;
+        }
+    }
 }
 .show {
     display:block;

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

@@ -411,7 +411,7 @@ class Inspect extends React.Component {
         </div>
         <div style={{ position: "relative", clear: "both", top: "5px" }}>
           <Add showText="添加化验项" handleClick={(e) => this.handleSearchShow(e)} id="searchWrap" />
-          {this.state.show ? <SearchOption windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
+          {this.state.show ? <SearchOption searchType="1" windowHeight={windowHeight} height={280} refreshScroller={refreshScroller} pageTop={pageTop} handleChangeValue={handleChangeValue} visible={true}>
             {list && list.length > 0 ? this.getSearchList(list) : (inspectVal == '' ? '' : <p style={{ padding: '5px 30px', color: '#bfbfbf' }}>暂无筛选项</p>)}
             {
               (list && list.length > 0) || (inspectVal != '') || (inspectList&&inspectList.length==0) ? '' : <div>

+ 2 - 2
src/store/async-actions/assistCheck.js

@@ -10,8 +10,8 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/retrieval/getTagInfos',{
-            type:'6',
+        axios.json('/demo/retrieval/index',{
+            type:'1',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,
             sexType: sex == '男'?'1' : sex == '女'?'2':'3'

+ 5 - 5
src/store/async-actions/diagnosticSearch.js

@@ -6,13 +6,13 @@ import { GET_SEARCH } from '@store/types/emergencyHis';
 export const getSearchList = (val,flag) => {
     if(val.trim() == ''){
         // const data = [];
-        if(flag){//ÀúÊ·²¡Àú
+        if(flag){//��ʷ����
             return (dispatch) =>  dispatch({
                 type: GET_SEARCH,
                 searchResult: []
             })
         }
-        return (dispatch) =>  dispatch({//Õï¶Ï
+        return (dispatch) =>  dispatch({//���
             type: GET_SEARCH_RESULT,
             searchResult: []
         })
@@ -27,7 +27,7 @@ export const getSearchList = (val,flag) => {
                 noIds.push(diagnosticList[i].conceptId)
             }
         }
-        json('/retrieval/getTagInfos',{
+        json('/retrieval/index',{
             type:'7',
             age:state.patInfo.message.patientAge,
             inputStr:val,
@@ -36,12 +36,12 @@ export const getSearchList = (val,flag) => {
         })
         .then((res)=>{
             const data = res.data.data;
-            if(flag){ //ÀúÊ·²¡Àú
+            if(flag){ //��ʷ����
                 dispatch({
                     type: GET_SEARCH,
                     searchResult: data
                 })
-            }else{//Õï¶Ï
+            }else{//���
                 dispatch({
                     type: GET_SEARCH_RESULT,
                     searchResult: data

+ 1 - 1
src/store/async-actions/fetchModules.js

@@ -17,7 +17,7 @@ const api={
   // getSpreadModule:'/questionInfo/getByIds',
   getSpreadModule:'/questionInfo/getByIds2',//优化
   getModule:'/questionInfo/getById',
-  searchURL: '/retrieval/getTagInfos',
+  searchURL: 'retrieval/index',
   getOtherHisRecord: '/inquiryInfo/getLastOther',
   saveMode:'/doctorPageMode/saveDoctorPageModes',
   getSymptomFeature:'/feature/getSymptomFeature',

+ 1 - 1
src/store/async-actions/inspect.js

@@ -11,7 +11,7 @@ export const getSearchList = (val) => {
     let baseList = store.getState();
     let sex = baseList.patInfo.message.patientSex;
     return (dispatch) => {
-        axios.json('/retrieval/getTagInfos',{
+        axios.json('/demo/retrieval/index',{
             type:'5',
             age:baseList.patInfo.message.patientAge,
             inputStr:val,

+ 1 - 1
src/utils/config.js

@@ -10,7 +10,7 @@ const host='http://192.168.2.236:6060';//后端接口访问地址
 const imageUrlPrefix = 'http://192.168.2.241:82';
 module.exports={
     host,
-    prefix:'/api/icss',            //带权限验证的api
+    prefix:'',            //带权限验证的api
     pushPage:'http://192.168.2.241:5488/icssIndex.html',        //右侧推送页面的地址
     imageUrlPrefix
 };