|
@@ -8,16 +8,11 @@ import ajax from 'jquery/src/ajax/xhr.js';
|
|
import $ from 'jquery/src/ajax';
|
|
import $ from 'jquery/src/ajax';
|
|
|
|
|
|
function uploadImg(s) {
|
|
function uploadImg(s) {
|
|
-<<<<<<< HEAD
|
|
|
|
- let myform = new FormData();
|
|
|
|
- myform.append('file', document.getElementById("fileToUpload").files[0]);
|
|
|
|
-=======
|
|
|
|
let myform = new FormData(), file = document.getElementById("fileToUpload").files[0];
|
|
let myform = new FormData(), file = document.getElementById("fileToUpload").files[0];
|
|
if (!file) {
|
|
if (!file) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
myform.append('file', file);
|
|
myform.append('file', file);
|
|
->>>>>>> 6216a1d29e2cfc72eae6df5c9bb1dad2b513a700
|
|
|
|
myform.append('sign', 'news_content_picture');
|
|
myform.append('sign', 'news_content_picture');
|
|
$.ajax({
|
|
$.ajax({
|
|
method: "post",
|
|
method: "post",
|
|
@@ -30,33 +25,20 @@ function uploadImg(s) {
|
|
if (data.error && data.error.length) {
|
|
if (data.error && data.error.length) {
|
|
message.warning(data.error[0].message);
|
|
message.warning(data.error[0].message);
|
|
} else {
|
|
} else {
|
|
-<<<<<<< HEAD
|
|
|
|
- let theUrl = data.data;
|
|
|
|
- const cursorPosition = s.quill.getSelection().index
|
|
|
|
- s.quill.insertEmbed(cursorPosition, 'image', globalConfig.avatarHost + '/upload' + theUrl)
|
|
|
|
-=======
|
|
|
|
const cursorPosition = s.quill.getSelection().index
|
|
const cursorPosition = s.quill.getSelection().index
|
|
s.quill.insertEmbed(cursorPosition, 'image', globalConfig.avatarHost + '/upload' + data.data)
|
|
s.quill.insertEmbed(cursorPosition, 'image', globalConfig.avatarHost + '/upload' + data.data)
|
|
->>>>>>> 6216a1d29e2cfc72eae6df5c9bb1dad2b513a700
|
|
|
|
s.quill.setSelection(cursorPosition + 1)
|
|
s.quill.setSelection(cursorPosition + 1)
|
|
};
|
|
};
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
function fileSelect() {
|
|
function fileSelect() {
|
|
-<<<<<<< HEAD
|
|
|
|
- let uploader = document.getElementById("fileToUpload"), _me = this;
|
|
|
|
- uploader.onchange = () => {
|
|
|
|
- uploadImg(_me);
|
|
|
|
- };
|
|
|
|
-=======
|
|
|
|
let uploader = document.getElementById("fileToUpload");
|
|
let uploader = document.getElementById("fileToUpload");
|
|
if (!uploader.onchange) {
|
|
if (!uploader.onchange) {
|
|
uploader.onchange = () => {
|
|
uploader.onchange = () => {
|
|
uploadImg(this)
|
|
uploadImg(this)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
->>>>>>> 6216a1d29e2cfc72eae6df5c9bb1dad2b513a700
|
|
|
|
uploader.click();
|
|
uploader.click();
|
|
}
|
|
}
|
|
const Avatar = React.createClass({
|
|
const Avatar = React.createClass({
|
|
@@ -533,7 +515,6 @@ const News = React.createClass({
|
|
<Radio value={1}>是</Radio>
|
|
<Radio value={1}>是</Radio>
|
|
</Radio.Group>
|
|
</Radio.Group>
|
|
</div>
|
|
</div>
|
|
-<<<<<<< HEAD
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div className="modal-box">
|
|
<div className="modal-box">
|
|
@@ -548,21 +529,6 @@ const News = React.createClass({
|
|
name="fileToUpload"
|
|
name="fileToUpload"
|
|
id="fileToUpload"
|
|
id="fileToUpload"
|
|
style={{ "display": "none" }} />
|
|
style={{ "display": "none" }} />
|
|
-=======
|
|
|
|
- </Tabs.TabPane>
|
|
|
|
- <Tabs.TabPane tab="详情" key="2">
|
|
|
|
- <ReactQuill theme="snow"
|
|
|
|
- value={this.state.RowData.content}
|
|
|
|
- modules={modules}
|
|
|
|
- formats={formats}
|
|
|
|
- onChange={this.handleRichText} />
|
|
|
|
- <input type="file"
|
|
|
|
- name="fileToUpload"
|
|
|
|
- id="fileToUpload"
|
|
|
|
- style={{ "display": "none" }} />
|
|
|
|
- </Tabs.TabPane>
|
|
|
|
- </Tabs>
|
|
|
|
->>>>>>> 6216a1d29e2cfc72eae6df5c9bb1dad2b513a700
|
|
|
|
<div className="modal-box">
|
|
<div className="modal-box">
|
|
<Button type="primary" onClick={this.submit}>提交</Button>
|
|
<Button type="primary" onClick={this.submit}>提交</Button>
|
|
<Button type="ghost" onClick={() => { this.setState({ visible: false }) }}>取消</Button>
|
|
<Button type="ghost" onClick={() => { this.setState({ visible: false }) }}>取消</Button>
|