Commit 26a7ee62 by yaxiLiuu

公用图片组件天添加而æ二态åº

parent b348498f
......@@ -2,6 +2,8 @@ import React from 'react';
require('./index.css');
let addIconSrc = UTILPATH.localImg.plusIcon;
let refreshIconSrc = UTILPATH.localImg.refreshIcon;
let addIconDisabledSrc = UTILPATH.localImg.plusIcon_disabled;
let refreshIconDisabledSrc = UTILPATH.localImg.refresh_disabled;
/**
* 组件说明 需要props type 与imgSrc
* type == custom 为要显示的图片
......@@ -19,6 +21,7 @@ export default class ImgToolComponent extends React.Component{
render(){
let props = this.props;
let type = props.type;
let disabled = props.disabled;
let imgSrc = '';
let noCloseBtn = props.noCloseBtn;
let handleClikImgFunc = props.handleClikImgFunc;
......@@ -36,6 +39,12 @@ export default class ImgToolComponent extends React.Component{
break;
}
if(type == "add" && disabled){
imgSrc = addIconDisabledSrc;
}
if(type == "refresh" && disabled){
imgSrc = refreshIconDisabledSrc;
}
return(
<div className={"ImgToolComponent"}>
<div className={"imgItem"}>
......
......@@ -8,7 +8,6 @@
box-sizing: border-box;
margin-right: 25px;
position: relative;
border: 1px solid #e5e5e5;
}
.ImgToolComponent .uploadImgRight{
float: left;
......
......@@ -5,6 +5,9 @@ import refreshIcon from '../image/refresh.png';
import plusIcon from '../image/plusIcon.png';
import clockIcon from '../image/clock.png';
import breakImg from '../image/breakImg.png';
import plusIcon_disabled from '../image/plusIcon_disabled.png';
import refresh_disabled from '../image/refresh_disabled.png';
const localHost = 'http://localhost:7788';
const devHost = 'http://test.mjitech.com';
......@@ -78,6 +81,6 @@ const handleImgLoad = (ref)=>{
return style;
}
const localImg = {headlogo,defaultImg,addIcon,refreshIcon,plusIcon,clockIcon,breakImg}
const localImg = {headlogo,defaultImg,addIcon,refreshIcon,plusIcon,clockIcon,breakImg,refresh_disabled,plusIcon_disabled}
module.exports = {localHost,devHost,masterHost,getPic,handleImgError,handleImgLoad,localImg};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment