|
@@ -110,6 +110,7 @@ class MsgComponent extends React.Component {
|
|
});
|
|
});
|
|
}, 1500);
|
|
}, 1500);
|
|
}
|
|
}
|
|
|
|
+
|
|
//上传图片之前验证大小
|
|
//上传图片之前验证大小
|
|
beforeUpload = (file) => {
|
|
beforeUpload = (file) => {
|
|
console.log(file.size);
|
|
console.log(file.size);
|
|
@@ -453,6 +454,10 @@ class MsgComponent extends React.Component {
|
|
}
|
|
}
|
|
render() {
|
|
render() {
|
|
let self = this;
|
|
let self = this;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ let SsoToken = util.auth.getToken();
|
|
|
|
+
|
|
const data = this.state.currentData;
|
|
const data = this.state.currentData;
|
|
const formItemLayout = {
|
|
const formItemLayout = {
|
|
labelCol: {
|
|
labelCol: {
|
|
@@ -475,6 +480,35 @@ class MsgComponent extends React.Component {
|
|
listStyle: "none",
|
|
listStyle: "none",
|
|
overflow: "auto",
|
|
overflow: "auto",
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ let imgUrlText = self.state.imgUrlText;
|
|
|
|
+ if (imgUrlText) {
|
|
|
|
+ let imgSeperator = "?";
|
|
|
|
+ if(imgUrlText.indexOf("?") !== -1 ) imgSeperator = "&";
|
|
|
|
+ if(imgUrlText.indexOf("&") !== -1 ) imgSeperator = "&";
|
|
|
|
+
|
|
|
|
+ imgUrlText = imgUrlText + imgSeperator + 'Sso-Token=' + SsoToken ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let imgUrlNews = self.state.imgUrlNews;
|
|
|
|
+ if (imgUrlNews) {
|
|
|
|
+ let imgSeperator = "?";
|
|
|
|
+ if(imgUrlNews.indexOf("?") !== -1 ) imgSeperator = "&";
|
|
|
|
+ if(imgUrlNews.indexOf("&") !== -1 ) imgSeperator = "&";
|
|
|
|
+
|
|
|
|
+ imgUrlNews = imgUrlNews + imgSeperator + 'Sso-Token=' + SsoToken ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ let imgUrlMini = self.state.imgUrlMini;
|
|
|
|
+ if (imgUrlMini) {
|
|
|
|
+ let imgSeperator = "?";
|
|
|
|
+ if(imgUrlNews.indexOf("?") !== -1 ) imgSeperator = "&";
|
|
|
|
+ if(imgUrlNews.indexOf("&") !== -1 ) imgSeperator = "&";
|
|
|
|
+
|
|
|
|
+ imgUrlMini = imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<div>
|
|
<div>
|
|
<Tabs activeKey={self.state.chooseKey}
|
|
<Tabs activeKey={self.state.chooseKey}
|
|
@@ -528,7 +562,7 @@ class MsgComponent extends React.Component {
|
|
{/* <div>添加图片:</div> */}
|
|
{/* <div>添加图片:</div> */}
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
style={{ position: "relative", display: (this.state.imgUrlText != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
style={{ position: "relative", display: (this.state.imgUrlText != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlText} />
|
|
|
|
|
|
+ <img style={{ width: "100%", height: "100%" }} src={imgUrlText} />
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<span onClick={self.upload1.bind(self)} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={self.upload1.bind(self)} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
@@ -589,7 +623,7 @@ class MsgComponent extends React.Component {
|
|
|
|
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
style={{ position: "relative", display: (this.state.imgUrlNews != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
style={{ position: "relative", display: (this.state.imgUrlNews != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlNews} />
|
|
|
|
|
|
+ <img style={{ width: "100%", height: "100%" }} src={imgUrlNews} />
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
@@ -652,7 +686,7 @@ class MsgComponent extends React.Component {
|
|
|
|
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
<div onMouseOver={this.mouseOver} onMouseOut={this.mouseOut}
|
|
style={{ position: "relative", display: (this.state.imgUrlMini != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
style={{ position: "relative", display: (this.state.imgUrlMini != '') ? "block" : "none", width: "150px", height: "150px", border: "1px solid #D7D7D7", marginLeft: "7px", cursor: "pointer" }}>
|
|
- <img style={{ width: "100%", height: "100%" }} src={this.state.imgUrlMini} />
|
|
|
|
|
|
+ <img style={{ width: "100%", height: "100%" }} src={imgUrlMini} />
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<div style={{ display: this.state.mouseOver ? "block" : "none", width: "150px", height: "150px", lineHeight: "150px", position: "absolute", top: "0px", left: "0px", backgroundColor: "#000", opacity: "0.7", color: "#fff" }}>
|
|
<span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={this.upload1} style={{ marginLeft: "15px" }}>重新上传</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
<span onClick={this.deleteImg1} style={{ marginLeft: "25px" }}>删除</span>
|
|
@@ -736,6 +770,14 @@ class MsgComponent extends React.Component {
|
|
</div>
|
|
</div>
|
|
<div key="" style={{ width: "1050px", display: "flex", flexWrap: "wrap", margin: "0 auto" }}>
|
|
<div key="" style={{ width: "1050px", display: "flex", flexWrap: "wrap", margin: "0 auto" }}>
|
|
{data.map((item, i) => {
|
|
{data.map((item, i) => {
|
|
|
|
+
|
|
|
|
+ if (item.localUrl) {
|
|
|
|
+ let imgSeperator = "?";
|
|
|
|
+ if(item.localUrl.indexOf("?") !== -1 ) imgSeperator = "&";
|
|
|
|
+ if(item.localUrl.indexOf("&") !== -1 ) imgSeperator = "&";
|
|
|
|
+
|
|
|
|
+ item.localUrl = item.localUrl + imgSeperator + 'Sso-Token=' + SsoToken ;
|
|
|
|
+ }
|
|
if (item.localUrl == null || item.localUrl.trim == '' || item.localUrl.startsWith('http://mm')) {
|
|
if (item.localUrl == null || item.localUrl.trim == '' || item.localUrl.startsWith('http://mm')) {
|
|
item.localUrl = 'http://img01.store.sogou.com/net/a/04/link?appid=100520029&url=' + item.materialUrl
|
|
item.localUrl = 'http://img01.store.sogou.com/net/a/04/link?appid=100520029&url=' + item.materialUrl
|
|
}
|
|
}
|