|
|
@@ -1,82 +1,100 @@
|
|
|
/**
|
|
|
- * Created by FANGlh on 2018/11/6 15:47.
|
|
|
+ * Created by FANGlh on 2018/11/8 14:57.
|
|
|
+ * * 创建投票
|
|
|
*/
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
-import nextArrowimg from '../../../style/imgs/next_arrow.png';
|
|
|
import './SendVote.css';
|
|
|
+import {Select, Switch, Upload, Icon, Modal, TreeSelect, Button, Input} from 'antd';
|
|
|
+import nextArrowimg from '../../../style/imgs/next_arrow.png';
|
|
|
+import moment from 'moment'
|
|
|
import 'antd/dist/antd.css';
|
|
|
-import {Select, TreeSelect, Icon, Button} from 'antd';
|
|
|
-import moment from 'moment';
|
|
|
-import add_newimg from '../../../style/imgs/add_new.png';
|
|
|
-import {fetchPost, fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
|
|
|
-import {API} from '../../../configs/api.config';
|
|
|
+import SelectItem from './SelectItem';
|
|
|
import {Toast, Picker, List, DatePicker} from 'antd-mobile';
|
|
|
-import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
|
|
|
import TargetSelect from '../../../components/TargetSelect';
|
|
|
+import {fetchPost, fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
|
|
|
+import {_baseURL, API} from '../../../configs/api.config';
|
|
|
+import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
|
|
|
+import UploadEnclosure from '../../../components/UploadEnclosure';
|
|
|
import {connect} from 'react-redux';
|
|
|
import {clearListState} from "../../../redux/actions/listState";
|
|
|
|
|
|
const Option = Select.Option;
|
|
|
+const {TextArea} = Input;
|
|
|
|
|
|
-class SendMeet extends Component {
|
|
|
+class SendVote extends Component {
|
|
|
componentWillMount() {
|
|
|
- document.title = '发起会议'
|
|
|
+ document.title = '发起投票'
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.getOrganization()
|
|
|
}
|
|
|
|
|
|
- componentWillUnmount() {
|
|
|
- Toast.hide()
|
|
|
- clearTimeout(this.backTask)
|
|
|
- }
|
|
|
-
|
|
|
getOrganization = () => {
|
|
|
Toast.loading('', 0)
|
|
|
|
|
|
- fetchGet(API.getAllTeacher, {
|
|
|
- // schoolId: this.props.userInfo.schoolId,
|
|
|
- schoolId:1
|
|
|
+ fetchGet(API.getClazzByTeacherId, {
|
|
|
+ teacherId: this.props.userInfo.userId,
|
|
|
}).then(response => {
|
|
|
Toast.hide()
|
|
|
const {targetData} = this.state
|
|
|
targetData.length = 0
|
|
|
if (response && response.data) {
|
|
|
- // const schoolArray = response.data.schools
|
|
|
- const teacherArray = response.data
|
|
|
-
|
|
|
- if (!isObjEmpty(teacherArray)) {
|
|
|
- const teacherData = []
|
|
|
- teacherArray.forEach((teacherObj, index) => {
|
|
|
- if (teacherObj) {
|
|
|
- teacherData.push({
|
|
|
- title: getStrValue(teacherObj, 'teacherName'),
|
|
|
- userId: getIntValue(teacherObj, 'teacherId'),
|
|
|
- userPhone: getStrValue(teacherObj, 'userPhone'),
|
|
|
- value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
|
|
|
- key: `1-${index}`,
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- targetData.push({
|
|
|
- title: `全体老师`,
|
|
|
- value: `1`,
|
|
|
- key: `1`,
|
|
|
- children: teacherData,
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ response.data.forEach((dataObj,data_index) =>{
|
|
|
+ const parentsDOSArray = dataObj.parentsDOS
|
|
|
+ const teacherDOSArray = dataObj.teacherDOS
|
|
|
+ if (!isObjEmpty(parentsDOSArray)) {
|
|
|
+ const classData = []
|
|
|
+ parentsDOSArray.forEach((parentObj, index) => {
|
|
|
+ if (parentObj) {
|
|
|
+ classData.push({
|
|
|
+ title: getStrValue(parentObj, 'parentsName'),
|
|
|
+ userId: getIntValue(parentObj, 'parentId'),
|
|
|
+ userPhone: getStrValue(parentObj, 'userPhone'),
|
|
|
+ value: getStrValue(parentObj, 'parentsName') + `-${data_index}-0-${index}`,
|
|
|
+ key: `${data_index}-0-${index}`,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
+ targetData.push({
|
|
|
+ title: dataObj.gradeName+dataObj.clazzName + '全部家长',
|
|
|
+ value: `${data_index}-0`,
|
|
|
+ key: `${data_index}-0`,
|
|
|
+ children: classData,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!isObjEmpty(teacherDOSArray)) {
|
|
|
+ const teacherData = []
|
|
|
+ teacherDOSArray.forEach((teacherObj, index) => {
|
|
|
+ if (teacherObj) {
|
|
|
+ teacherData.push({
|
|
|
+ title: getStrValue(teacherObj, 'teacherName'),
|
|
|
+ userId: getIntValue(teacherObj, 'teacherId'),
|
|
|
+ userPhone: getStrValue(teacherObj, 'userPhone'),
|
|
|
+ value: getStrValue(teacherObj, 'teacherName') + `${data_index}-1-${index}`,
|
|
|
+ key: `${data_index}-1-${index}`,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ targetData.push({
|
|
|
+ title: dataObj.gradeName+dataObj.clazzName + '全部老师',
|
|
|
+ value: `${data_index}-1`,
|
|
|
+ key: `${data_index}-1`,
|
|
|
+ children: teacherData,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
console.log('targetData', targetData)
|
|
|
this.setState({
|
|
|
targetData,
|
|
|
})
|
|
|
}).catch(error => {
|
|
|
Toast.hide()
|
|
|
-
|
|
|
if (typeof error === 'string') {
|
|
|
Toast.fail(error, 2)
|
|
|
} else {
|
|
|
@@ -85,45 +103,45 @@ class SendMeet extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- constructor() {
|
|
|
- super();
|
|
|
+ constructor(props) {
|
|
|
+ super(props);
|
|
|
this.state = {
|
|
|
+ voteTitle: null,
|
|
|
+ endValue: null,
|
|
|
+ voteType: null,
|
|
|
+ nonameVote: false,
|
|
|
+ voteOptionss: [null, null],
|
|
|
targetList: [],
|
|
|
targetCount: 0,
|
|
|
targetData: [],
|
|
|
- startValue: null,
|
|
|
- endValue: null,
|
|
|
- endOpen: false,
|
|
|
- titleValue: null,
|
|
|
- contentValue: null,
|
|
|
- earlyTime: null,
|
|
|
- meetPerson: [],
|
|
|
- meetAddress: null,
|
|
|
- noticeType: [{
|
|
|
- label: '创建即提醒',
|
|
|
- value: '0'
|
|
|
- }, {
|
|
|
- label: '会前5分钟',
|
|
|
- value: 5
|
|
|
- }, {
|
|
|
- label: '会前15分钟',
|
|
|
- value: 15
|
|
|
+ previewVisible: false,
|
|
|
+ previewImage: '',
|
|
|
+ fileList: [],
|
|
|
+ votePerson: [],
|
|
|
+ voteMembers: 18,
|
|
|
+ typeVote: [{
|
|
|
+ label: '单选',
|
|
|
+ value: '1'
|
|
|
}, {
|
|
|
- label: '会前25分钟',
|
|
|
- value: 25
|
|
|
- }, {
|
|
|
- label: '会前35分钟',
|
|
|
- value: 35
|
|
|
+ label: '多选',
|
|
|
+ value: '2'
|
|
|
}]
|
|
|
- };
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
+
|
|
|
+ //添加附件按钮
|
|
|
+ const uploadButton = (
|
|
|
+ <div>
|
|
|
+ <Icon type="plus"/>
|
|
|
+ <div className="ant-upload-text">Upload</div>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
const targetProps = {
|
|
|
targetData: this.state.targetData,
|
|
|
targetValues: this.state.targetList,
|
|
|
- title: '与会人',
|
|
|
+ title: '发布对象',
|
|
|
targetCount: this.state.targetCount,
|
|
|
onTargetChange: this.onTargetChange.bind(this),
|
|
|
onTargetFocus: this.onTargetFocus.bind(this)
|
|
|
@@ -132,29 +150,44 @@ class SendMeet extends Component {
|
|
|
const defaultTargetProps = {
|
|
|
targetData: [],
|
|
|
targetValues: this.state.targetList,
|
|
|
- title: '与会人',
|
|
|
+ title: '发布对象',
|
|
|
targetCount: this.state.targetCount,
|
|
|
onTargetChange: this.onTargetChange.bind(this),
|
|
|
onTargetFocus: this.onTargetFocus.bind(this)
|
|
|
}
|
|
|
return (
|
|
|
- <div onChange={this.handelValueCom} style={{fontFamily: "PingFangSC-Regular", letterSpacing: 2.5}} className='common-column-layout'>
|
|
|
- {/*<p>{new Date().getTime()}</p>*/}
|
|
|
- <textarea autoFocus="autoFocus" ref='meetTitle' className="form-control textarea_sty" rows="2"
|
|
|
- placeholder="请填写会议主题…"></textarea>
|
|
|
- <textarea ref='meetAddress' className="form-control textarea_sty" rows="3"
|
|
|
- placeholder="请填写会议地址…"></textarea>
|
|
|
+
|
|
|
+ <div onChange={this.handelValueCom} className='common-column-layout'>
|
|
|
+ {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
|
|
|
+ : <TargetSelect {...defaultTargetProps}/>}
|
|
|
<div className="comhline_sty"></div>
|
|
|
- <div className="common-column-layout" style={{fontSize: 15}}>
|
|
|
- <DatePicker
|
|
|
- value={this.state.startValue}
|
|
|
- locale={{
|
|
|
- okText: '确定',
|
|
|
- dismissText: '取消'
|
|
|
- }}
|
|
|
- onChange={date => this.setState({startValue: date})}>
|
|
|
- <List.Item arrow="horizontal">会议开始时间</List.Item>
|
|
|
- </DatePicker>
|
|
|
+ <textarea autoFocus="autoFocus" ref='voteTitle' className="form-control textarea_sty"
|
|
|
+ rows="2" placeholder="请填写投票主题…" style={{resize: 'none'}}></textarea>
|
|
|
+ <div className="comhline_sty"></div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ {this.state.voteOptionss.map((itemata, index) => <SelectItem index={index} itemata={itemata}
|
|
|
+ handelSItem={this.handelSItem}
|
|
|
+ removeSItem={this.removeSItem}></SelectItem>)}
|
|
|
+ <div onClick={this.addSelectItem} className="text-center"
|
|
|
+ style={{color: "#0CE11D", fontSize: 12, margin: 10,}}>+ <span
|
|
|
+ style={{borderBottom: "1px #0CE11D solid"}}>添加选项</span></div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="comhline_sty"></div>
|
|
|
+ <div className="common-column-layout">
|
|
|
+ <Picker
|
|
|
+ data={this.state.typeVote} title='投票类型' extra='请选择'
|
|
|
+ value={this.state.voteType}
|
|
|
+ onChange={this.handleSelectChange}
|
|
|
+ onOk={this.handleSelectChange} cols={1}>
|
|
|
+ <List.Item arrow="horizontal">投票类型</List.Item>
|
|
|
+ </Picker>
|
|
|
+ {/*<Select defaultValue="请选择" style={{ width:100 }} onChange={this.handleSelectChange}>*/}
|
|
|
+ {/*<Option value="1">单选</Option>*/}
|
|
|
+ {/*<Option value="2">多选</Option>*/}
|
|
|
+ {/*</Select>*/}
|
|
|
+ {/*<img src={nextArrowimg} className="nextarr_sty"/>*/}
|
|
|
<div className="comhline_sty1"></div>
|
|
|
<DatePicker
|
|
|
value={this.state.endValue}
|
|
|
@@ -163,175 +196,233 @@ class SendMeet extends Component {
|
|
|
dismissText: '取消'
|
|
|
}}
|
|
|
onChange={date => this.setState({endValue: date})}>
|
|
|
- <List.Item arrow="horizontal">会议结束时间</List.Item>
|
|
|
+ <List.Item arrow="horizontal">结束时间</List.Item>
|
|
|
</DatePicker>
|
|
|
- <div className="comhline_sty1"></div>
|
|
|
- <Picker
|
|
|
- data={this.state.noticeType} title='提醒时间' extra='请选择'
|
|
|
- value={this.state.earlyTime}
|
|
|
- onChange={this.handleSelectChange}
|
|
|
- onOk={this.handleSelectChange} cols={1}>
|
|
|
- <List.Item arrow="horizontal">提醒时间</List.Item>
|
|
|
- </Picker>
|
|
|
</div>
|
|
|
|
|
|
<div className="comhline_sty1"></div>
|
|
|
- {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
|
|
|
- : <TargetSelect {...defaultTargetProps}/>}
|
|
|
- {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
|
|
|
- {/*onClick={this.doSaveClick}>创建</Button></center>*/}
|
|
|
|
|
|
+ <div className="item_sty">
|
|
|
+ <div style={{width: 150, fontSize: 15, color: "#333333"}}>匿名投票:</div>
|
|
|
+ <div className="text-right" style={{width: "100%",}}>
|
|
|
+ <Switch checkedChildren="开" unCheckedChildren="关" defaultunchecked="false"
|
|
|
+ onChange={this.switchStatues}/>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div className="comhline_sty1"></div>
|
|
|
+
|
|
|
+ <UploadEnclosure
|
|
|
+ action={API.UPLOAD_FILE}
|
|
|
+ fileList={this.state.fileList}
|
|
|
+ count={9}
|
|
|
+ multiple={true}
|
|
|
+ beforeUpload={this.beforeUpload.bind(this)}
|
|
|
+ handleChange={this.handleChange.bind(this)}
|
|
|
+ />
|
|
|
<Button className='commonButton' type='primary' style={{margin: '35px'}}
|
|
|
- onClick={this.doSaveClick}>创建</Button>
|
|
|
+ onClick={this.doSendVote}>提交</Button>
|
|
|
+ {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
|
|
|
+ {/*onClick={this.doSendVote}>提交</Button></center>*/}
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- doSaveClick = (event) => {
|
|
|
- console.log('state', this.state)
|
|
|
- if (this.state.titleValue == null || this.state.titleValue.trim().length == 0) {
|
|
|
- Toast.fail('请填写会议主题...')
|
|
|
- return
|
|
|
+ onTargetFocus = (e) => {
|
|
|
+ if (isObjEmpty(this.state.targetData)) {
|
|
|
+ this.getOrganization()
|
|
|
}
|
|
|
- if (this.state.meetAddress == null || this.state.meetAddress.trim().length == 0) {
|
|
|
- Toast.fail('请填写会议地址...')
|
|
|
- return
|
|
|
+ }
|
|
|
+
|
|
|
+ onTargetChange = (value, label, checkNodes, count) => {
|
|
|
+ this.checkNodes = checkNodes
|
|
|
+ this.setState({
|
|
|
+ targetList: value,
|
|
|
+ targetCount: count
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //发布提交
|
|
|
+ doSendVote = (event) => {
|
|
|
+ if (!isObjEmpty(this.checkNodes)) {
|
|
|
+ this.checkNodes.forEach((node, index) => {
|
|
|
+ this.state.votePerson.push(node.userId)
|
|
|
+ })
|
|
|
}
|
|
|
- if (this.state.startValue == null ) {
|
|
|
- Toast.fail('请选择开始时间...')
|
|
|
+ // this.setState({
|
|
|
+ // votePerson:[1,2,3,10001,10002,10003]
|
|
|
+ // })
|
|
|
+ console.log('state', this.state)
|
|
|
+
|
|
|
+ if (this.state.votePerson.length == 0) {
|
|
|
+ Toast.fail('请选择投票对象...')
|
|
|
return
|
|
|
}
|
|
|
- if (this.state.endValue == null ) {
|
|
|
- Toast.fail('请选择结束时间...')
|
|
|
+ if (this.state.voteTitle == null || this.state.voteTitle.trim().length == 0) {
|
|
|
+ Toast.fail('请填写投票主题...', 1)
|
|
|
return
|
|
|
}
|
|
|
- if (this.state.earlyTime == null ){
|
|
|
- Toast.fail('请选择提醒时间...')
|
|
|
- return
|
|
|
+ for(let i=0;i<this.state.voteOptionss.length;i++){
|
|
|
+ if(this.state.voteOptionss[i] == null || this.state.voteOptionss[i].trim().length == 0 ){
|
|
|
+ Toast.fail('存在选项内容为空...')
|
|
|
+ return
|
|
|
+ }
|
|
|
}
|
|
|
- if (this.state.targetList.length == 0) {
|
|
|
- Toast.fail('请选择与会人...')
|
|
|
+
|
|
|
+ if (this.state.voteType == null) {
|
|
|
+ Toast.fail('请选择投票类型...')
|
|
|
return
|
|
|
}
|
|
|
- const userList = []
|
|
|
- if (!isObjEmpty(this.checkNodes)) {
|
|
|
- this.checkNodes.forEach((node, index) => {
|
|
|
- userList.push(node.userId)
|
|
|
- })
|
|
|
+ if (this.state.endValue == null ) {
|
|
|
+ Toast.fail('请选择正确结束时间...')
|
|
|
+ return
|
|
|
}
|
|
|
+
|
|
|
var nowT = new Date().getTime()
|
|
|
- var startT = new Date(this.state.startValue).getTime()
|
|
|
var endT = new Date(this.state.endValue).getTime()
|
|
|
-
|
|
|
- console.log('startT', startT)
|
|
|
- if (nowT > startT) {
|
|
|
- Toast.show('开始时间不可小于当前时间', 1)
|
|
|
+ if (nowT > endT) {
|
|
|
+ Toast.fail('当前时间不可大于结束时间', 1)
|
|
|
return
|
|
|
}
|
|
|
- if (startT > endT) {
|
|
|
- Toast.show('结束时间不可小于开始时间', 1)
|
|
|
- return
|
|
|
+
|
|
|
+ var options = []
|
|
|
+ for (let i = 0; i < this.state.voteOptionss.length; i++) {
|
|
|
+ const item = {
|
|
|
+ optionName: this.state.voteOptionss[i],
|
|
|
+ optionStatus: 1
|
|
|
+ }
|
|
|
+ options[i] = item
|
|
|
}
|
|
|
- if (!isObjEmpty(this.checkNodes)) {
|
|
|
- this.checkNodes.forEach((node, index) => {
|
|
|
- this.state.meetPerson.push(node.userId)
|
|
|
+
|
|
|
+
|
|
|
+ const approveFiles = []
|
|
|
+ if (this.state.fileList) {
|
|
|
+ this.state.fileList.forEach((value, index) => {
|
|
|
+ approveFiles.push(value.picUrl)
|
|
|
})
|
|
|
}
|
|
|
- var noticeT = startT - this.state.earlyTime * 1000 * 60
|
|
|
- console.log('noticeT', noticeT)
|
|
|
- console.log('noticeT', new Date(noticeT))
|
|
|
-
|
|
|
- let params = {
|
|
|
- // meetingCreator: this.props.userInfo.userId,
|
|
|
- meetingCreator:this.props.userInfo.userId,
|
|
|
- meetingStatus: 1,
|
|
|
- meetingName: this.state.titleValue,
|
|
|
- meetingAddress: this.state.meetAddress,
|
|
|
- startDate: moment(this.state.startValue).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- endDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- reminderDate: moment(new Date(noticeT)).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- meetingNotifier: JSON.stringify(userList),
|
|
|
- meetingRemarks: "会议备注",
|
|
|
- meetingFiles:"[]",
|
|
|
- meetingDetails: "一定要参加",
|
|
|
- }
|
|
|
|
|
|
- console.log('params', params)
|
|
|
+ var params = {
|
|
|
+ topicName: this.state.voteTitle,
|
|
|
+ topicType:this.state.voteType[0],
|
|
|
+ topicFiles: approveFiles,
|
|
|
+ creator: this.props.userInfo.userId,
|
|
|
|
|
|
- Toast.loading("会议创建中...", 0)
|
|
|
- fetchPost(API.createMeeting, {
|
|
|
- jsonMeeting:JSON.stringify(params)
|
|
|
+ topicStatus: 1,
|
|
|
+ voteRemarks: "这是一个调查",
|
|
|
+ voteName: this.state.voteTitle,
|
|
|
+ voter: JSON.stringify(this.state.votePerson),
|
|
|
+ voteEndDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
+ voteType:1,
|
|
|
+ optionName: [
|
|
|
+ {
|
|
|
+ optionStatus: 1,
|
|
|
+ options: options,
|
|
|
+ topicType: this.state.voteType[0],
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ console.log('params', {
|
|
|
+ voteString: params
|
|
|
+ })
|
|
|
+ fetchPost(API.voteCreate, {
|
|
|
+ voteTopicDOS: JSON.stringify(params)
|
|
|
}, {})
|
|
|
.then((response) => {
|
|
|
- Toast.hide()
|
|
|
- console.log('response', response)
|
|
|
if (response.success) {
|
|
|
+ Toast.success('发布成功', 1)
|
|
|
clearListState()()
|
|
|
- Toast.show('创建成功', 1)
|
|
|
-
|
|
|
this.backTask = setTimeout(() => {
|
|
|
- this.props.history.goBack()
|
|
|
+ // this.props.history.goBack()
|
|
|
}, 1000)
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- Toast.hide()
|
|
|
- console.log('error', error)
|
|
|
console.log('error', error)
|
|
|
if (typeof error === 'string') {
|
|
|
Toast.fail(error, 2)
|
|
|
} else {
|
|
|
- if (typeof error === 'string') {
|
|
|
- Toast.fail(error, 2)
|
|
|
- } else {
|
|
|
- Toast.fail('请求异常', 2)
|
|
|
- }
|
|
|
+ Toast.fail('请求异常', 2)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- onTargetFocus = (e) => {
|
|
|
- if (isObjEmpty(this.state.targetData)) {
|
|
|
- this.getOrganization()
|
|
|
- }
|
|
|
+
|
|
|
+ componentWillUnmount() {
|
|
|
+ Toast.hide()
|
|
|
+ clearTimeout(this.backTask)
|
|
|
}
|
|
|
|
|
|
- onTargetChange = (value, label, checkNodes, count) => {
|
|
|
- this.checkNodes = checkNodes
|
|
|
+ removeSItem = (index) => {
|
|
|
+ if (this.state.voteOptionss.length == 2) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let voteOptionss = this.state.voteOptionss
|
|
|
+ voteOptionss.splice(index, 1)
|
|
|
this.setState({
|
|
|
- targetList: value,
|
|
|
- targetCount: count
|
|
|
- });
|
|
|
+ voteOptionss
|
|
|
+ })
|
|
|
}
|
|
|
- selectPersononChange = (value) => {
|
|
|
- console.log('selectPersononChange ', value);
|
|
|
- this.setState({meetPerson: value});
|
|
|
+ handelSItem = (itemdata, index) => {
|
|
|
+ console.log('index', index)
|
|
|
+ console.log('itemdata', itemdata)
|
|
|
+ let voteOptionss = this.state.voteOptionss
|
|
|
+ voteOptionss[index] = itemdata
|
|
|
+ this.setState({
|
|
|
+ voteOptionss
|
|
|
+ })
|
|
|
}
|
|
|
- disabledStartDate = (startValue) => {
|
|
|
- const endValue = this.state.endValue;
|
|
|
- if (!startValue || !endValue) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- return startValue.valueOf() > endValue.valueOf();
|
|
|
+
|
|
|
+ addSelectItem = (event) => {
|
|
|
+ let voteOptionss = [...this.state.voteOptionss, null];
|
|
|
+ this.setState({
|
|
|
+ voteOptionss
|
|
|
+ })
|
|
|
+ }
|
|
|
+ addAnnex = (event) => {
|
|
|
+ console.log('addAnnex')
|
|
|
}
|
|
|
|
|
|
handleSelectChange = (value) => {
|
|
|
- console.log(`selected ${value}`);
|
|
|
+ console.log('voteType', value)
|
|
|
this.setState({
|
|
|
- earlyTime: value
|
|
|
+ voteType: value
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
handelValueCom = (event) => {
|
|
|
//获取用户名的值
|
|
|
- let meetTitle = this.refs.meetTitle.value;
|
|
|
+ let voteTitle = this.refs.voteTitle.value;
|
|
|
//获得内容的值
|
|
|
- let meetAddress = this.refs.meetAddress.value;
|
|
|
+ this.setState({
|
|
|
+ voteTitle: voteTitle,
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
+ switchStatues = (value) => {
|
|
|
+ console.log('isOpend?', value)
|
|
|
this.setState({
|
|
|
- titleValue: meetTitle,
|
|
|
- meetAddress: meetAddress
|
|
|
+ nonameVote: value
|
|
|
})
|
|
|
}
|
|
|
+ handleCancel = () => this.setState({previewVisible: false})
|
|
|
+
|
|
|
+ handlePreview = (file) => {
|
|
|
+ this.setState({
|
|
|
+ previewImage: file.url || file.thumbUrl,
|
|
|
+ previewVisible: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ beforeUpload = (file, fileList) => {
|
|
|
+
|
|
|
+ }
|
|
|
+ handleChange = fileList => {
|
|
|
+ if (fileList) {
|
|
|
+ fileList.forEach((value, index) => {
|
|
|
+ value.url = value.response ? (_baseURL + value.response.data) : value.url
|
|
|
+ value.picUrl = value.response ? value.response.data : value.picUrl
|
|
|
+ })
|
|
|
+
|
|
|
+ this.setState({fileList})
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
let mapStateToProps = (state) => ({
|
|
|
@@ -340,4 +431,4 @@ let mapStateToProps = (state) => ({
|
|
|
|
|
|
let mapDispatchToProps = (dispatch) => ({})
|
|
|
|
|
|
-export default connect(mapStateToProps, mapDispatchToProps)(SendMeet)
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(SendVote)
|