|
@@ -2,14 +2,14 @@ import React from 'react';
|
|
|
import AddAssistCheck from '../AddAssistCheck';
|
|
|
import { ItemBox, ConfirmModal, WrapModalContainer } from '@commonComp';
|
|
|
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 } from '@utils/tools.js';
|
|
|
import { dragBox } from '@utils/drag';
|
|
|
import WrapModalBodyPac from '../WrapModalBodyPac';
|
|
|
+import { getExcelList } from '@store/actions/inspect';
|
|
|
+import store from '@store';
|
|
|
+import { host, prefix } from '@utils/config.js';
|
|
|
|
|
|
|
|
|
// (function ($) {
|
|
@@ -48,23 +48,23 @@ class AssistCheck extends React.Component {
|
|
|
importLis:false
|
|
|
}
|
|
|
this.showSlideImport=this.showSlideImport.bind(this)
|
|
|
- this.handleBindFileApi=this.handleBindFileApi.bind(this)
|
|
|
+ // this.handleBindFileApi=this.handleBindFileApi.bind(this)
|
|
|
this.checkSystemIpt=this.checkSystemIpt.bind(this)
|
|
|
this.showInIcss=this.showInIcss.bind(this)
|
|
|
this.onClose=this.onClose.bind(this)
|
|
|
this.handleImportExcel=this.handleImportExcel.bind(this)
|
|
|
}
|
|
|
- componentDidMount() {
|
|
|
- $(document).click((event) => {
|
|
|
- let searchWrap = $('#importExcelBtn')[0]; // 导入按钮按钮
|
|
|
- let searchOption = $('#importExcelList')[0]; // 下拉列表
|
|
|
- if (searchOption) {
|
|
|
- if(searchWrap != event.target){
|
|
|
- this.setState({ importLis: false });
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ // componentDidMount() {
|
|
|
+ // $(document).click((event) => {
|
|
|
+ // let searchWrap = $('#importExcelBtns')[0]; // 导入按钮按钮
|
|
|
+ // let searchOption = $('#importExcelLists')[0]; // 下拉列表
|
|
|
+ // if (searchOption) {
|
|
|
+ // if(searchWrap != event.target){
|
|
|
+ // this.setState({ importLis: false });
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
handleImportExcel() {
|
|
|
this.inputRef.click();
|
|
|
}
|
|
@@ -75,74 +75,74 @@ class AssistCheck extends React.Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- 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");
|
|
|
- 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
|
|
|
- },
|
|
|
- complete: function (err, xhr) {
|
|
|
- if (!err) {
|
|
|
- let res = JSON.parse(xhr.response);
|
|
|
- let message = res.data.messages;
|
|
|
- // store.dispatch(getExcelList(res.data));
|
|
|
- // fetchPushInfos && fetchPushInfos();
|
|
|
- // if (message && message.length != 0) {
|
|
|
- // that.setState({
|
|
|
- // visible: true,
|
|
|
- // dom: message,
|
|
|
- // height: message.length
|
|
|
- // })
|
|
|
- // }
|
|
|
- // $("#choose").val("");
|
|
|
- } else {
|
|
|
- let res = JSON.parse(xhr.response);
|
|
|
- Notify.error(res.msg)
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
+ // 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");
|
|
|
+ // 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
|
|
|
+ // },
|
|
|
+ // complete: function (err, xhr) {
|
|
|
+ // if (!err) {
|
|
|
+ // let res = JSON.parse(xhr.response);
|
|
|
+ // let message = res.data.messages;
|
|
|
+ // // store.dispatch(getExcelList(res.data));
|
|
|
+ // // fetchPushInfos && fetchPushInfos();
|
|
|
+ // // if (message && message.length != 0) {
|
|
|
+ // // that.setState({
|
|
|
+ // // visible: true,
|
|
|
+ // // dom: message,
|
|
|
+ // // height: message.length
|
|
|
+ // // })
|
|
|
+ // // }
|
|
|
+ // // $("#choose").val("");
|
|
|
+ // } else {
|
|
|
+ // let res = JSON.parse(xhr.response);
|
|
|
+ // Notify.error(res.msg)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // }
|
|
|
|
|
|
onClose() {
|
|
|
this.setState({
|
|
@@ -185,9 +185,9 @@ class AssistCheck extends React.Component {
|
|
|
</div> : hospitalMsg.importWayLis == 22 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
|
|
|
检查系统导入
|
|
|
</div> : hospitalMsg.importWayLis == 2 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
|
|
|
- <p id="importExcelBtn" className={styles.importInspectBtn}>导入化验结果</p>
|
|
|
+ <p id="importExcelBtns" className={styles.importInspectBtn}>导入化验结果</p>
|
|
|
{
|
|
|
- importLis?<ul className={styles.importSelect} id="importExcelList">
|
|
|
+ importLis?<ul className={styles.importSelect} id="importExcelLists">
|
|
|
<li className={styles.excelIpt}>
|
|
|
<div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
|
|
|
<input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
|