/**
*
*/
import React, { Component } from "react";
import { Row, Col, Input, Form, Switch, Checkbox, Icon, message } from "antd";
import {
formItemLayout,
minFormItemLayout,
} from "../../../constants/formItemLayout";
import Record from "../Record/index";
const { TextArea } = Input;
@Form.create()
export default class ModalView extends Component {
constructor(props) {
super(props);
this.state = {
selectedPoints: props.selectedPoints,
dispatchType: props.dispatchType,
schedulingName: '',
schedulingContent: '',
openRecord: false,//是否开启录制按钮
};
}
componentDidMount() { }
componentWillReceiveProps(nextPorps) {
this.setState({
selectedPoints: nextPorps.selectedPoints,
dispatchType: nextPorps.dispatchType,
selectRecordId: '',//选中的人员id
})
}
render() {
const { getFieldDecorator } = this.props.form;
return (
{this.state.selectedPoints.map((item, index) => {
return (
{item.photoUrl ? (

) : (
{item.name
? item.name.substring(
item.name.length - 2,
item.name.length
)
: ""}
)}
{item.name}
);
})}
{
this.state.dispatchType !== "video" &&
注意:请确保所有人员都已经完成基础信息初始化,否则该人员无法成功加入群组
}
{this.state.dispatchType === "text"
? "文字调度"
: this.state.dispatchType === "voice"
? "语音调度"
: this.state.dispatchType === "video"
? "视频调度"
: ""}
{getFieldDecorator("schedulingName", {
rules: [
{
required: true,
message: "请输入调度任务名称",
},
],
})(
{
this.props.schedulingName(e.target.value)
this.setState({
schedulingName: e.target.value,
});
}}
>
)}
{/* 如果是文字调度,需要填调度任务内容 */}
{this.state.dispatchType === "text" ? (
{getFieldDecorator("schedulingContent", {
rules: [
{
required: true,
message: "请输入调度任务内容",
},
],
})(
) : //如果是语音调度,需要有语音弹框
this.state.dispatchType === "voice" ? (
{this.state.showRecord ? (
{
//点击了发送
if (this.state.schedulingName.trim().length === 0) {
message.warning("请输入调度任务名称");
} else {
//创建音频的群组
// this.voiceGroup(url, time);
this.props.voiceGroup(url, time);
}
}}
startRecord={this.state.showRecord}
/>
) : (
{
this.props.showRecord(true);
// this.setState({
// showRecord: true,
// });
}}
>
请点击按钮开始录音
)}
) : (
{/* //视频调度 */}
{getFieldDecorator("record", {
rules: [
{
required: true,
message: "请选择是否开启屏幕录制",
},
],
})(
{
console.log(value);
this.setState({
openRecord: value
})
}}
/>
)}
{
this.state.openRecord &&
{
this.props.onCheckPerRecord(e)
if (e.length > 16) {
message.error("录制人数限制16个以内,请重新选择")
}
}}>
{this.state.selectedPoints.map((item, index) => {
return (
{item.photoUrl ? (
) : (
{item.name
? item.name.substring(
item.name.length - 2,
item.name.length
)
: ""}
)}
{item.name}
);
})}
}
)}
);
}
}