|
import React from 'react';
|
|
import { Row, Col, Input, DatePicker, Button, Modal, Upload, Table, message, Breadcrumb, TimePicker, Badge, Select, Popconfirm, Spin, Divider } from 'antd';
|
const { TextArea } = Input;
|
import HeadView from '../view/HeadView';
|
import BusDetailView from '../view/BusDetailView';
|
import TableView from '../view/TableView';
|
import ImageBoxView from '../view/ImageBoxView'
|
// 引入编辑器以及编辑器样式
|
import BraftEditor from 'braft-editor'
|
import 'braft-editor/dist/index.css'
|
import Fetch from '../fetch';
|
import moment from 'moment';
|
const format = 'HH:mm';
|
const { Option } = Select;
|
const yearFormat = 'YYYY-MM-DD';
|
const divStyle = {
|
margin: '20px'
|
}
|
const domain = Fetch.domain;
|
|
function typeStatus(type) {
|
switch (type) {
|
case 0:
|
return "未开始";
|
case 1:
|
return "进行中";
|
case 2:
|
return "已结束";
|
case 99:
|
return "暂停";
|
}
|
}
|
export default class CareListEdit extends React.Component {
|
constructor(props) {
|
super(props);
|
this.state = {
|
dateSource: [],
|
savedate: {},
|
modalData: {},
|
formdata: {},
|
fileList: [],
|
previewVisible: false,
|
previewImage: '',
|
visible: false,
|
hitList: [],
|
num: 0,
|
taskType: 1,
|
disabled: true,
|
status: '',
|
loading: false,
|
btlloading: false,
|
socialTaskObject: '',
|
// rowNum: 4,
|
editorState: BraftEditor.createEditorState(null),
|
editorStatetaskProcess: BraftEditor.createEditorState(null),
|
list: []
|
};
|
}
|
|
componentDidMount() {
|
document.title = '社会关护管理详情';
|
this.getDetail();
|
}
|
|
getDetail = () => {
|
const { id } = this.props.match.params;
|
this.setState({ loading: true })
|
Fetch.socialfind(id)
|
.then(res => {
|
console.log(res)
|
let { startTime, endTime } = res;
|
if (startTime == null) {
|
startTime = Date.now();
|
}
|
if (endTime == null) {
|
endTime = Date.now();
|
}
|
this.setState({
|
savedate: {
|
...res,
|
startDate: moment(startTime).format(yearFormat),
|
startHour: moment(startTime).format(format),
|
endDate: moment(endTime).format(yearFormat),
|
endHour: moment(endTime).format(format),
|
taskType: res.taskType || 1
|
},
|
taskType: res.taskType || 1,
|
disabled: res.status ? true : false,
|
list: res.tasks || [],
|
socialTaskObject: res.socialTaskObject ? { id: res.socialTaskObject.objectId, objectName: res.socialTaskObject.objectName, taskReport: res.socialTaskObject.taskReport } : {},
|
loading: false,
|
});
|
})
|
}
|
|
saveInputChange = ({ target: { value, name } }) => {
|
this.setState(({ savedate }) => ({
|
savedate: {
|
...savedate,
|
[name]: value
|
}
|
}))
|
}
|
|
saveModalInputChange = ({ target: { value, name } }) => {
|
this.setState(({ modalData }) => ({
|
modalData: {
|
...modalData,
|
[name]: value
|
}
|
}))
|
}
|
|
selectChange = ({ target: { value, name } }) => {
|
console.log(value, name)
|
this.setState(({ socialTaskObject }) => ({
|
socialTaskObject: {
|
...socialTaskObject,
|
[name]: value
|
}
|
}))
|
}
|
|
submit = () => {
|
const { savedate, socialTaskObject, list } = this.state;
|
savedate.startTime = moment(savedate.startDate + " " + moment(savedate.startHour).format(format), 'YYYY-MM-DD HH:mm')
|
savedate.endTime = moment(savedate.endDate + " " + moment(savedate.endHour).format(format), 'YYYY-MM-DD HH:mm')
|
console.log(savedate);
|
console.log(moment(savedate.startTime).valueOf());
|
console.log(moment(new Date()).valueOf());
|
console.log(socialTaskObject);
|
let data2 = {}
|
if (!savedate.taskTitle) {
|
message.warning("任务标题不能为空");
|
return;
|
}
|
if (moment(savedate.startTime).valueOf() < moment(new Date()).valueOf()) {
|
message.warning("开始时间必须大于当前时间");
|
console.log(moment(savedate.startTime))
|
console.log(moment(new Date()))
|
return;
|
}
|
if (moment(savedate.endTime).valueOf() < moment(savedate.startTime).valueOf()) {
|
message.warning("结束时间必须大于开始时间");
|
return;
|
}
|
if (list.length == 0) {
|
message.warning("请至少添加一个子任务");
|
return;
|
}
|
if (!socialTaskObject.id) {
|
message.warning("请选择任务对象");
|
return;
|
} else {
|
const data = savedate.companies.filter(item => (item.id == socialTaskObject.id))
|
const data1 = { objectId: data[0].id, objectName: data[0].companyName }
|
console.log(data)
|
console.log(data1)
|
data2 = { ...savedate, socialTaskObject: data1, tasks: list }
|
}
|
|
console.log(data2)
|
this.setState({ btlloading: true })
|
Fetch.socialSave(data2)
|
.then(res => {
|
if (res.code === 0) {
|
this.setState({ btlloading: false })
|
message.success("提交成功!");
|
this.props.history.push("/careList")
|
} else {
|
message.error('保存失败,请联系管理员', 2)
|
}
|
});
|
}
|
|
modalhandleOk = () => {
|
const { modalData, taskAddress, list } = this.state;
|
if (!modalData.taskAddress) {
|
message.warning("任务地点不能为空");
|
return;
|
}
|
if (!modalData.taskTitle) {
|
message.warning("任务标题不能为空");
|
return;
|
}
|
if (!modalData.taskRequire) {
|
message.warning("任务要求不能为空");
|
return;
|
}
|
if (!modalData.taskProcess) {
|
message.warning("任务流程不能为空");
|
return;
|
}
|
// 如果数组中存在此对象则删除原对象末尾添加新的对象,如果是新增的对象则直接添加在尾部
|
var newList = list.find(item => item.id == modalData.id) ? list.filter(item => item.id !== modalData.id) : list;
|
newList.push({ ...modalData, status: 0 })
|
console.log('newList', newList)
|
this.setState({
|
modalshowVisible: false,
|
list: newList
|
})
|
}
|
|
cancle = () => {
|
this.props.history.push("/careList");
|
}
|
handlePreview = (file) => {
|
this.setState({
|
previewImage: file.url || file.thumbUrl,
|
previewVisible: true,
|
});
|
}
|
|
showModal = () => {
|
this.setState({
|
visible: true,
|
});
|
}
|
|
handleCancelModel = (e) => {
|
this.setState({
|
visible: false,
|
});
|
}
|
|
handleOk = e => {
|
const { savedate } = this.state;
|
console.log(savedate);
|
|
this.setState({
|
visible: false,
|
});
|
Fetch.socialUpdate(savedate.id, 2)
|
.then(res => {
|
if (res.code === 0) {
|
message.success("结束任务成功!");
|
this.props.history.push("/careList")
|
} else {
|
message.error('保存失败,请联系管理员', 2)
|
}
|
});
|
};
|
|
getNum = (e) => {
|
console.log(e.target.value)
|
this.setState({
|
num: e.target.value
|
})
|
}
|
getPerson = () => {
|
const { num } = this.state;
|
const { id } = this.state.savedate;
|
if (!num) {
|
message.error("请输入摇号数量")
|
return;
|
}
|
if (isNaN(num)) {
|
message.error("请输入数字")
|
return;
|
}
|
Fetch.getActPerson(id, num)
|
.then(res => {
|
this.setState({
|
hitList: res.data
|
})
|
});
|
}
|
|
|
publishResult = () => {
|
const { hitList, savedate } = this.state;
|
Fetch.publishResult(hitList, savedate.id)
|
.then(res => {
|
if (res.code === 0) {
|
message.success("发布成功!");
|
this.setState({
|
visible: false,
|
}, this.getDetail);
|
} else {
|
message.error('发布失败,请联系管理员', 2)
|
}
|
});
|
}
|
|
confirm = (e) => {
|
console.log(e);
|
const data = { id: e, status: 2 };
|
this.setState({ loading: true })
|
Fetch.auditPerson(data).then(res => {
|
if (res.code == 0) {
|
console.log(res)
|
this.setState({ loading: false })
|
message.success('审核通过');
|
this.getDetail();
|
} else {
|
this.setState({ loading: false })
|
message.error('请求失败,请联系管理员', 2)
|
}
|
}
|
)
|
}
|
|
cancel = (e) => {
|
console.log(e);
|
const data = { id: e, status: 4 };
|
this.setState({ loading: true })
|
Fetch.auditPerson(data).then(res => {
|
if (res.code == 0) {
|
console.log(res)
|
this.setState({ loading: false })
|
message.error('审核不通过');
|
this.getDetail();
|
} else {
|
this.setState({ loading: false })
|
message.error('请求失败,请联系管理员', 2)
|
}
|
}
|
)
|
}
|
|
submitContent = () => {
|
// 在编辑器获得焦点时按下ctrl+s会执行此方法
|
// 编辑器内容提交到服务端之前,可直接调用editorState.toHTML()来获取HTML格式的内容
|
const htmlContent = this.state.editorState.toHTML()
|
this.setState(({ savedate }) => ({
|
savedate: {
|
...savedate,
|
taskRequire: htmlContent
|
}
|
}))
|
}
|
|
submitLContent = () => {
|
// 在编辑器获得焦点时按下ctrl+s会执行此方法
|
// 编辑器内容提交到服务端之前,可直接调用editorState.toHTML()来获取HTML格式的内容
|
const htmlContent = this.state.editorStatetaskProcess.toHTML()
|
this.setState(({ savedate }) => ({
|
savedate: {
|
...savedate,
|
taskProcess: htmlContent
|
}
|
}))
|
}
|
|
uploadFn = (param) => {
|
|
const serverURL = domain + 'api/v1/attachment/upload'
|
const xhr = new XMLHttpRequest
|
const fd = new FormData()
|
const successFn = (response) => {
|
// 假设服务端直接返回文件上传后的地址
|
// 上传成功后调用param.success并传入上传后的文件地址
|
//Pz
|
const res = JSON.parse(xhr.responseText);
|
param.success({
|
url: domain + 'api/v1/attachment/image/' + res[0].id,
|
meta: {
|
id: res[0].id,
|
title: res[0].name,
|
alt: res[0].name,
|
loop: true, // 指定音视频是否循环播放
|
autoPlay: true, // 指定音视频是否自动播放
|
controls: true, // 指定音视频是否显示控制栏
|
poster: domain + 'api/v1/attachment/image/' + res[0].id, // 指定视频播放器的封面
|
modalshowVisible: false
|
}
|
})
|
}
|
|
|
const progressFn = (event) => {
|
// 上传进度发生变化时调用param.progress
|
param.progress(event.loaded / event.total * 100)
|
}
|
|
const errorFn = (response) => {
|
// 上传发生错误时调用param.error
|
param.error({
|
msg: 'unable to upload.'
|
})
|
}
|
xhr.upload.addEventListener("progress", progressFn, false)
|
xhr.addEventListener("load", successFn, false)
|
xhr.addEventListener("error", errorFn, false)
|
xhr.addEventListener("abort", errorFn, false)
|
fd.append('file', param.file)
|
xhr.open('POST', serverURL, true)
|
xhr.send(fd)
|
}
|
|
handleEditorChange = (editorState) => {
|
this.setState({ editorState })
|
const htmlContent = editorState.toHTML()
|
console.log(htmlContent)
|
this.setState(({ modalData }) => ({
|
modalData: {
|
...modalData,
|
taskRequire: htmlContent
|
}
|
}))
|
}
|
|
handleEditorLChange = (editorStatetaskProcess) => {
|
this.setState({ editorStatetaskProcess })
|
const htmlContent = editorStatetaskProcess.toHTML()
|
this.setState(({ modalData }) => ({
|
modalData: {
|
...modalData,
|
taskProcess: htmlContent
|
}
|
}))
|
}
|
|
modalshow = () => {
|
this.setState({ modalshowVisible: true, modalData: {} })
|
this.setState({ loading: true })
|
Fetch.socialfind('new')
|
.then(res => {
|
console.log(res)
|
this.setState({
|
modalData: {
|
...res,
|
},
|
editorState: BraftEditor.createEditorState(res.taskRequire),
|
editorStatetaskProcess: BraftEditor.createEditorState(res.taskProcess),
|
modaldisabled: res.status ? true : false,
|
loading: false,
|
});
|
})
|
}
|
|
modalshowCancel = () => {
|
this.setState({ modalshowVisible: false, fileList: [] })
|
}
|
|
handleOk = () => {
|
console.log('success')
|
this.setState({ confirmLoading: true });
|
const { modalData } = this.state;
|
console.log(modalData)
|
|
if (!modalData.taskAddress) {
|
return message.warning("任务地点不能为空");
|
}
|
if (!modalData.taskTitle) {
|
return message.warning("任务标题不能为空");
|
}
|
if (!modalData.taskRequire) {
|
message.warning("任务要求不能为空");
|
return;
|
}
|
if (!modalData.taskProcess) {
|
message.warning("任务流程不能为空");
|
return;
|
}
|
console.log(modalData)
|
//提交完成后关闭弹窗,刷新列表
|
|
// Fetch.addResult({ ...modalData })
|
// .then(res => {
|
// console.log(res)
|
// if (res.code === 0) {
|
// this.setState({
|
// confirmLoading: false,
|
// modal: false,
|
// closeKey: Date.now()
|
// }, this.getData);
|
// message.success("提交成功!")
|
// } else {
|
// message.error('保存失败,请联系管理员', 2)
|
// }
|
// });
|
}
|
|
|
handleCancel = () => this.setState({ previewVisible: false })
|
|
|
renderColumns = () => {
|
return [
|
{
|
title: '编号',
|
dataIndex: 'key',
|
key: 'key',
|
render: (text, record, index) => <span>{index + 1}</span>
|
},
|
{
|
title: '任务地点',
|
dataIndex: 'taskAddress',
|
key: 'taskAddress',
|
},
|
{
|
title: '任务标题',
|
dataIndex: 'taskTitle',
|
key: 'taskTitle',
|
},
|
{
|
title: '状态',
|
dataIndex: 'status',
|
key: 'status',
|
render: (text, record) => <span>{typeStatus(text)}</span>
|
}, {
|
title: '操作',
|
key: 'action',
|
render: (text, record) => (
|
<span>
|
{
|
this.state.disabled ?
|
<label onClick={() => { this.onDetail(text, record) }} className="theme-color">详情</label>
|
:
|
<label onClick={() => { this.onDetail(text, record) }} className="theme-color">编辑</label>
|
}
|
<Divider type="vertical" />
|
<Popconfirm placement="topRight" title={'你确定要删除该条记录吗'} onConfirm={() => { this.onDel(text, record) }} okText="确定" cancelText="取消">
|
<label className="theme-color">删除</label>
|
</Popconfirm>
|
</span>
|
),
|
}
|
]
|
}
|
|
onDel = (_text, _record) => {
|
console.log(_text, _record)
|
const { list } = this.state;
|
this.setState({
|
list: list.filter(({ id }) => (id !== _record.id))
|
})
|
// Fetch.businessDel({ businessId: _text.businessId }).then(res => {
|
// if (res.code == 0) {
|
// message.warning('正在更新列表');
|
// this.onTableChange();
|
// }
|
// }, err => {
|
// message.error(err);
|
// });
|
}
|
|
onDetail = (_text, _record) => {
|
this.setState({
|
modalData: _record,
|
editorState: BraftEditor.createEditorState(_record.taskRequire),
|
editorStatetaskProcess: BraftEditor.createEditorState(_record.taskProcess),
|
fileList: _record.attachments || [],
|
modalshowVisible: true
|
})
|
}
|
|
render() {
|
const { savedate, editorState, socialTaskObject, fileList, editorStatetaskProcess, confirmLoading, btlloading, taskType, disabled, loading, modalData, modalshowVisible, list, modaldisabled } = this.state;
|
console.log(modalData)
|
const props = {
|
action: domain + 'api/v1/attachment/materials?entityId=' + savedate.id,
|
onChange: ({ file, fileList }) => {
|
this.setState({ fileList });
|
},
|
fileList: fileList,
|
onRemove: (file) => {
|
Fetch.deleteAttachment(file.uid)
|
.then(res => {
|
message.success("移除成功!");
|
});
|
this.setState(({ fileList }) => {
|
const index = fileList.indexOf(file);
|
const newFileList = fileList.slice();
|
newFileList.splice(index, 1);
|
return {
|
fileList: newFileList,
|
};
|
});
|
}
|
};
|
const columns = [{
|
title: '姓名',
|
dataIndex: 'proposerName',
|
key: 'proposerName'
|
}, {
|
title: '联系电话',
|
dataIndex: 'proposerPhone',
|
key: 'proposerPhone',
|
}, {
|
title: '是否中奖',
|
dataIndex: 'isHit',
|
key: 'isHit',
|
render: text => ((
|
savedate.activityStatus < 3 ?
|
<span>未开奖</span> :
|
(
|
text == 0 ? <span>未中奖</span> : <Badge count={'中奖'} style={{ backgroundColor: '#52c41a' }} />
|
)
|
)
|
)
|
}];
|
return (
|
<div className="app-page">
|
<Spin spinning={loading}>
|
<HeadView history={this.props.history} />
|
<Breadcrumb style={{ padding: '20px' }}>
|
<Breadcrumb.Item><a href="index.html#/careList">社会关护管理</a></Breadcrumb.Item>
|
<Breadcrumb.Item>社会关护管理活动</Breadcrumb.Item>
|
</Breadcrumb>
|
<BusDetailView type='社会关护管理活动' >
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务类型</span></Col>
|
<Col span={6} push={0} >
|
<Select disabled={disabled} value={savedate.taskType || 1} style={{ width: "300px" }} onChange={(value) => this.saveInputChange({ target: { name: 'taskType', value } })}>
|
<Option value={1}>跟踪帮教</Option>
|
<Option value={2}>合适成年人</Option>
|
<Option value={3}>社会调查</Option>
|
<Option value={4}>心理疏导</Option>
|
<Option value={5}>法律援助</Option>
|
</Select>
|
</Col>
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务标题</span></Col>
|
<Col span={6} push={0} ><Input disabled={disabled} placeholder="请输入任务标题" style={{ width: '300px' }} name='taskTitle' onChange={this.saveInputChange} value={savedate.taskTitle || ""} /></Col>
|
</Row>
|
</div>
|
|
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>开始时间</span></Col>
|
<Col span={6} push={0} >
|
<DatePicker disabled={disabled} style={{ width: '165px' }} onChange={(_, value) => this.saveInputChange({ target: { name: 'startDate', value } })} value={moment(savedate.startDate || new Date(), yearFormat)} format={yearFormat} />
|
<TimePicker disabled={disabled} minuteStep={30} onChange={(value) => this.saveInputChange({ target: { name: 'startHour', value } })} value={moment(savedate.startHour || new Date(), format)} format={format} /></Col>
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>结束时间</span></Col>
|
<Col span={6} push={0} >
|
<DatePicker disabled={disabled} style={{ width: '165px' }} onChange={(_, value) => this.saveInputChange({ target: { name: 'endDate', value } })} value={moment(savedate.endDate || new Date(), yearFormat)} format={yearFormat} />
|
<TimePicker disabled={disabled} minuteStep={30} onChange={(value) => this.saveInputChange({ target: { name: 'endHour', value } })} value={moment(savedate.endHour || new Date(), format)} format={format} /></Col>
|
|
</Row>
|
</div>
|
|
|
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>添加子任务</span></Col>
|
<Col span={6} push={0} >
|
<Button style={{ width: '300px' }} disabled={disabled} onClick={this.modalshow}>请添加</Button>
|
</Col>
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务对象</span></Col>
|
<Col span={6} push={0} >
|
<Select disabled={disabled} value={socialTaskObject ? socialTaskObject.id : ''} style={{ width: "300px" }} onChange={(value) => this.selectChange({ target: { name: 'id', value } })}>
|
{
|
savedate.companies ? savedate.companies.map(item =>
|
<Option value={item.id}>{item.companyName}</Option>
|
) : ''
|
}
|
</Select>
|
</Col>
|
</Row>
|
</div>
|
|
<Table dataSource={list} style={{ margin: '24px' }} pagination={false} columns={this.renderColumns()} />
|
|
|
{
|
|
savedate.status == 2 || savedate.status == 99 ?
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
|
</div>
|
:
|
savedate.status == 1 ?
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<Button style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.showModal}>结束任务</Button>
|
<Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
|
</div> :
|
<div style={{ display: 'flex', justifyContent: 'center' }}>
|
<Button loading={btlloading} style={{ marginRight: '15px', width: '150px' }} type="primary" onClick={this.submit}>提交</Button>
|
<Button style={{ marginLeft: '15px', width: '150px' }} onClick={this.cancle}>返回</Button>
|
</div>
|
}
|
|
</BusDetailView>
|
|
<Modal
|
title="结束任务"
|
visible={this.state.visible}
|
onOk={this.handleOk}
|
onCancel={this.handleCancelModel}
|
width='300px'
|
>
|
<p>确认结束任务吗?</p>
|
</Modal>
|
<Modal
|
width='60%'
|
title="添加"
|
confirmLoading={confirmLoading}
|
visible={modalshowVisible}
|
onOk={this.modalhandleOk}
|
onCancel={this.modalshowCancel}
|
>
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务地点</span></Col>
|
<Col span={6} push={0} ><Input disabled={disabled} placeholder="请输入任务地点" name='taskAddress' onChange={this.saveModalInputChange} value={modalData.taskAddress || ""} /></Col>
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务标题</span></Col>
|
<Col span={6} push={0} ><Input disabled={disabled} placeholder="请输入任务标题" name='taskTitle' onChange={this.saveModalInputChange} value={modalData.taskTitle || ""} /></Col>
|
</Row>
|
</div>
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务要求</span></Col>
|
<Col span={18} push={0} style={{ border: 'solid 1px rgba(0, 0, 0, 0.25)', borderRadius: '5PX' }}>
|
|
<BraftEditor
|
value={editorState}
|
disabled={disabled}
|
placeholder='请输入任务要求'
|
media={{
|
allowPasteImage: true, // 是否允许直接粘贴剪贴板图片(例如QQ截图等)到编辑器
|
image: true, // 开启图片插入功能
|
video: false, // 开启视频插入功能
|
audio: false, // 开启音频插入功能
|
uploadFn: this.uploadFn
|
}}
|
excludeControls={['emoji']}
|
onChange={this.handleEditorChange}
|
onSave={this.submitContent}
|
onBlur={this.submitContent}
|
/>
|
</Col>
|
</Row>
|
</div>
|
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务流程</span></Col>
|
<Col span={18} push={0} style={{ border: 'solid 1px rgba(0, 0, 0, 0.25)', borderRadius: '5PX' }}>
|
|
<BraftEditor
|
value={editorStatetaskProcess}
|
disabled={disabled}
|
placeholder='请输入任务流程'
|
media={{
|
allowPasteImage: true, // 是否允许直接粘贴剪贴板图片(例如QQ截图等)到编辑器
|
image: true, // 开启图片插入功能
|
video: false, // 开启视频插入功能
|
audio: false, // 开启音频插入功能
|
uploadFn: this.uploadFn
|
}}
|
excludeControls={['emoji']}
|
onChange={this.handleEditorLChange}
|
onSave={this.submitLContent}
|
onBlur={this.submitLContent}
|
/>
|
</Col>
|
</Row>
|
</div>
|
{
|
savedate.status == 1 || savedate.status == 2 ?
|
<div style={divStyle}>
|
<Row type="flex" align='middle' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>任务汇报</span></Col>
|
<Col span={18} push={0} >
|
<TextArea disabled={disabled} rows={8} value={socialTaskObject.taskReport || ""} onChange={this.saveModalInputChange} name='taskReport' />
|
</Col>
|
<Col span={12} pull={0}></Col>
|
</Row>
|
</div> : ''
|
}
|
|
{
|
savedate.status == 1 || savedate.status == 2 ?
|
<div style={divStyle}>
|
<div style={divStyle}>
|
<Row type="flex" align='top' justify="space-around">
|
<Col span={6} pull={0} style={{ textAlign: 'center' }}><span>汇报附件</span></Col>
|
<Col span={18} push={0} >
|
<Upload disabled={disabled} listType="picture-card" onPreview={this.handlePreview} {...props}>
|
|
</Upload>
|
</Col>
|
</Row>
|
</div>
|
</div> : ''
|
}
|
</Modal>
|
</Spin>
|
</div>
|
);
|
}
|
|
}
|
|
function ReplaceSeperator(mobiles) {
|
var i;
|
var result = "";
|
var c;
|
for (i = 0; i < mobiles.length; i++) {
|
c = mobiles.substr(i, 1);
|
if (c == "\n")
|
result = result + "<br/>";
|
// else if (c != "\r")
|
// result = result + c;
|
}
|
return result;
|
}
|