Parcourir la source

导入ie8暂时先灰掉

zhouna il y a 6 ans
Parent
commit
b2e679a35e
2 fichiers modifiés avec 21 ajouts et 3 suppressions
  1. 12 3
      src/components/Inspect/index.jsx
  2. 9 0
      src/components/Inspect/index.less

+ 12 - 3
src/components/Inspect/index.jsx

@@ -7,6 +7,7 @@ import Notify from '@commonComp/Notify';
 import store from '@store';
 import $ from 'jquery';
 import { host } from '@utils/config.js';
+import {isIE} from '@utils/tools.js';
 
 
 (function ($) {
@@ -35,7 +36,8 @@ class Inspect extends React.Component {
         this.state = {
             val: '',
             visible:false,
-            dom:[]
+            dom:[],
+            isIE:isIE()
         }
         this.handleImportExcel = this.handleImportExcel.bind(this)
         this.cancel = this.cancel.bind(this)
@@ -103,6 +105,13 @@ class Inspect extends React.Component {
     cancel(){
         this.setState({visible:false})
     }
+  getStyle(){
+        if(this.state.isIE){
+            return styles.disabledBtn;
+        }else{
+            return styles.button;
+        }
+  }
     getWarings(lis){
         <ul>
             {
@@ -122,8 +131,8 @@ class Inspect extends React.Component {
 
                 <div className={styles.top}>
                     <span>化验结果数据</span>
-                    <div className={styles.button} onClick={this.handleImportExcel}>
-                        <button>导入化验结果</button>    
+                    <div className={this.getStyle()} onClick={this.state.isIE?null:this.handleImportExcel}>
+                        <button disabled={this.state.isIE?true:false}>导入化验结果</button>
                         <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
                     </div>
                 </div>

+ 9 - 0
src/components/Inspect/index.less

@@ -22,6 +22,15 @@
         border: 1px solid @template-color;
         overflow: hidden;
     }
+    .disabledBtn{
+        float: right;
+        border-radius: 5px;
+        border: 1px solid @placeholder-color;
+        overflow: hidden;
+        button{
+            color:@placeholder-color;
+        }
+    }
     button {
         outline: none;
         font-size: 12px;