|
|
@@ -1,59 +1,61 @@
|
|
|
/**
|
|
|
- * Created by FANGlh on 2018/11/8 14:57.
|
|
|
- * * 创建投票
|
|
|
+ * Created by FANGlh on 2018/11/6 15:47.
|
|
|
*/
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
-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 './SendVote.css';
|
|
|
import 'antd/dist/antd.css';
|
|
|
-import SelectItem from './SelectItem';
|
|
|
-import {Toast, Picker, List, DatePicker} from 'antd-mobile';
|
|
|
-import TargetSelect from '../../../components/TargetSelect';
|
|
|
+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 {_baseURL, API} from '../../../configs/api.config';
|
|
|
+import {API} from '../../../configs/api.config';
|
|
|
+import {Toast, Picker, List, DatePicker} from 'antd-mobile';
|
|
|
import {getIntValue, getStrValue, isObjEmpty} from "../../../utils/common";
|
|
|
-import UploadEnclosure from '../../../components/UploadEnclosure';
|
|
|
+import TargetSelect from '../../../components/TargetSelect';
|
|
|
import {connect} from 'react-redux';
|
|
|
import {clearListState} from "../../../redux/actions/listState";
|
|
|
|
|
|
const Option = Select.Option;
|
|
|
-const {TextArea} = Input;
|
|
|
|
|
|
-class SendVote extends Component {
|
|
|
+class SendMeet extends Component {
|
|
|
componentWillMount() {
|
|
|
- document.title = '发起投票'
|
|
|
+ document.title = '发起会议'
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
this.getOrganization()
|
|
|
}
|
|
|
|
|
|
+ componentWillUnmount() {
|
|
|
+ Toast.hide()
|
|
|
+ clearTimeout(this.backTask)
|
|
|
+ }
|
|
|
+
|
|
|
getOrganization = () => {
|
|
|
Toast.loading('', 0)
|
|
|
|
|
|
- fetchGet(API.USER_GETOBJECT, {
|
|
|
- userId: this.props.userInfo.userId,
|
|
|
- stuId: this.props.userInfo.userId
|
|
|
+ fetchGet(API.getAllTeacher, {
|
|
|
+ // schoolId: this.props.userInfo.schoolId,
|
|
|
+ schoolId:1
|
|
|
}).then(response => {
|
|
|
Toast.hide()
|
|
|
const {targetData} = this.state
|
|
|
targetData.length = 0
|
|
|
if (response && response.data) {
|
|
|
- const schoolArray = response.data.schools
|
|
|
- const teacherArray = response.data.teachers
|
|
|
+ // 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, 'userName'),
|
|
|
- userId: getIntValue(teacherObj, 'userId'),
|
|
|
+ title: getStrValue(teacherObj, 'teacherName'),
|
|
|
+ userId: getIntValue(teacherObj, 'teacherId'),
|
|
|
userPhone: getStrValue(teacherObj, 'userPhone'),
|
|
|
- value: getStrValue(teacherObj, 'userName') + `-1-${index}`,
|
|
|
+ value: getStrValue(teacherObj, 'teacherName') + `-1-${index}`,
|
|
|
key: `1-${index}`,
|
|
|
})
|
|
|
}
|
|
|
@@ -66,43 +68,6 @@ class SendVote extends Component {
|
|
|
children: teacherData,
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- if (!isObjEmpty(schoolArray)) {
|
|
|
- const classData = []
|
|
|
-
|
|
|
- schoolArray.forEach((schoolObj, sIndex) => {
|
|
|
- if (schoolObj) {
|
|
|
- const parentArray = schoolObj.parents
|
|
|
-
|
|
|
- const parentData = []
|
|
|
- if (!isObjEmpty(parentArray)) {
|
|
|
- parentArray.forEach((parentObj, pIndex) => {
|
|
|
- parentData.push({
|
|
|
- title: getStrValue(parentObj, 'userName'),
|
|
|
- userId: getIntValue(parentObj, 'userId'),
|
|
|
- userPhone: getStrValue(parentObj, 'userPhone'),
|
|
|
- value: getStrValue(parentObj, 'userName') + `-0-${sIndex}-${pIndex}`,
|
|
|
- key: `0-${sIndex}-${pIndex}`,
|
|
|
- })
|
|
|
- })
|
|
|
-
|
|
|
- classData.push({
|
|
|
- title: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName'),
|
|
|
- value: getStrValue(schoolObj, 'parentName') + getStrValue(schoolObj, 'schName') + `-0-${sIndex}`,
|
|
|
- key: `0-${sIndex}`,
|
|
|
- children: parentData,
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- targetData.push({
|
|
|
- title: `全体家长`,
|
|
|
- value: `0`,
|
|
|
- key: `0`,
|
|
|
- children: classData,
|
|
|
- })
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
console.log('targetData', targetData)
|
|
|
@@ -120,45 +85,45 @@ class SendVote extends Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- constructor(props) {
|
|
|
- super(props);
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
this.state = {
|
|
|
- voteTitle: null,
|
|
|
- endValue: null,
|
|
|
- voteType: null,
|
|
|
- nonameVote: false,
|
|
|
- voteOptionss: [null, null],
|
|
|
targetList: [],
|
|
|
targetCount: 0,
|
|
|
targetData: [],
|
|
|
- previewVisible: false,
|
|
|
- previewImage: '',
|
|
|
- fileList: [],
|
|
|
- votePerson: [],
|
|
|
- voteMembers: 18,
|
|
|
- typeVote: [{
|
|
|
- label: '单选',
|
|
|
- value: '1'
|
|
|
+ startValue: null,
|
|
|
+ endValue: null,
|
|
|
+ endOpen: false,
|
|
|
+ titleValue: null,
|
|
|
+ contentValue: null,
|
|
|
+ earlyTime: null,
|
|
|
+ meetPerson: [],
|
|
|
+ meetAddress: null,
|
|
|
+ noticeType: [{
|
|
|
+ label: '创建即提醒',
|
|
|
+ value: '0'
|
|
|
}, {
|
|
|
- label: '多选',
|
|
|
- value: '2'
|
|
|
+ label: '会前5分钟',
|
|
|
+ value: 5
|
|
|
+ }, {
|
|
|
+ label: '会前15分钟',
|
|
|
+ value: 15
|
|
|
+ }, {
|
|
|
+ label: '会前25分钟',
|
|
|
+ value: 25
|
|
|
+ }, {
|
|
|
+ label: '会前35分钟',
|
|
|
+ value: 35
|
|
|
}]
|
|
|
- }
|
|
|
+ };
|
|
|
+
|
|
|
}
|
|
|
|
|
|
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)
|
|
|
@@ -167,44 +132,29 @@ class SendVote 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} className='common-column-layout'>
|
|
|
- {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
|
|
|
- : <TargetSelect {...defaultTargetProps}/>}
|
|
|
+ <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 className="comhline_sty"></div>
|
|
|
- <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="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>
|
|
|
<div className="comhline_sty1"></div>
|
|
|
<DatePicker
|
|
|
value={this.state.endValue}
|
|
|
@@ -213,230 +163,175 @@ class SendVote 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.doSendVote}>提交</Button>
|
|
|
- {/*<center><Button type="button" className="btn btn-primary comBtn_sty"*/}
|
|
|
- {/*onClick={this.doSendVote}>提交</Button></center>*/}
|
|
|
+ onClick={this.doSaveClick}>创建</Button>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
- onTargetFocus = (e) => {
|
|
|
- if (isObjEmpty(this.state.targetData)) {
|
|
|
- this.getOrganization()
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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)
|
|
|
- })
|
|
|
- }
|
|
|
+ doSaveClick = (event) => {
|
|
|
console.log('state', this.state)
|
|
|
- if (this.state.votePerson.trim().length == 0) {
|
|
|
- Toast.fail('请选择投票对象...')
|
|
|
+ if (this.state.titleValue == null || this.state.titleValue.trim().length == 0) {
|
|
|
+ Toast.fail('请填写会议主题...')
|
|
|
return
|
|
|
}
|
|
|
- if (this.state.voteTitle.trim().length == 0 || this.state.voteTitle == null) {
|
|
|
- Toast.fail('请填写投票主题...', 1)
|
|
|
+ if (this.state.meetAddress == null || this.state.meetAddress.trim().length == 0) {
|
|
|
+ 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.startValue == null ) {
|
|
|
+ Toast.fail('请选择开始时间...')
|
|
|
+ return
|
|
|
}
|
|
|
- // console.log("已走出for循环")
|
|
|
- // if (this.state.voteOptionss.length < 2) {
|
|
|
- // Toast.show('请输入选项内容...')
|
|
|
- // return
|
|
|
- // }
|
|
|
- if (this.state.voteType == null || this.state.voteType.trim().length == 0) {
|
|
|
- Toast.fail('请选择投票类型...')
|
|
|
+ if (this.state.endValue == null ) {
|
|
|
+ Toast.fail('请选择结束时间...')
|
|
|
return
|
|
|
}
|
|
|
- if (this.state.endValue == null || this.state.endValue.trim().length == 0) {
|
|
|
- Toast.fail('请选择正确结束时间...')
|
|
|
+ if (this.state.earlyTime == null ){
|
|
|
+ Toast.fail('请选择提醒时间...')
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
+ if (this.state.targetList.length == 0) {
|
|
|
+ Toast.fail('请选择与会人...')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const userList = []
|
|
|
+ if (!isObjEmpty(this.checkNodes)) {
|
|
|
+ this.checkNodes.forEach((node, index) => {
|
|
|
+ userList.push(node.userId)
|
|
|
+ })
|
|
|
+ }
|
|
|
var nowT = new Date().getTime()
|
|
|
+ var startT = new Date(this.state.startValue).getTime()
|
|
|
var endT = new Date(this.state.endValue).getTime()
|
|
|
- if (nowT > endT) {
|
|
|
- Toast.fail('当前时间不可大于结束时间', 1)
|
|
|
+
|
|
|
+ console.log('startT', startT)
|
|
|
+ if (nowT > startT) {
|
|
|
+ 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 (startT > endT) {
|
|
|
+ Toast.show('结束时间不可小于开始时间', 1)
|
|
|
+ return
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- const approveFiles = []
|
|
|
- if (this.state.fileList) {
|
|
|
- this.state.fileList.forEach((value, index) => {
|
|
|
- approveFiles.push(value.picUrl)
|
|
|
+ if (!isObjEmpty(this.checkNodes)) {
|
|
|
+ this.checkNodes.forEach((node, index) => {
|
|
|
+ this.state.meetPerson.push(node.userId)
|
|
|
})
|
|
|
}
|
|
|
- var params = {
|
|
|
- creator: this.props.userInfo.userId,
|
|
|
- voteStatus: 1,
|
|
|
- voteRemarks: "这是一个调查",
|
|
|
- voteName: this.state.voteTitle,
|
|
|
- voteFile: approveFiles,
|
|
|
- voter: JSON.stringify(this.state.votePerson),
|
|
|
- voteEndDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- voteType:1,
|
|
|
- topics: [
|
|
|
- {
|
|
|
- topicName: this.state.voteTitle,
|
|
|
- topicStatus: 1,
|
|
|
- options: options,
|
|
|
- topicType: this.state.voteType[0],
|
|
|
- }
|
|
|
- ]
|
|
|
+ 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', {
|
|
|
- voteString: params
|
|
|
- })
|
|
|
- fetchPost(API.voteCreate, {
|
|
|
- voteString: JSON.stringify(params)
|
|
|
+
|
|
|
+ console.log('params', params)
|
|
|
+
|
|
|
+ Toast.loading("会议创建中...", 0)
|
|
|
+ fetchPost(API.createMeeting, {
|
|
|
+ jsonMeeting: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()
|
|
|
}, 1000)
|
|
|
}
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
+ Toast.hide()
|
|
|
+ console.log('error', error)
|
|
|
console.log('error', error)
|
|
|
if (typeof error === 'string') {
|
|
|
Toast.fail(error, 2)
|
|
|
} else {
|
|
|
- Toast.fail('请求异常', 2)
|
|
|
+ if (typeof error === 'string') {
|
|
|
+ Toast.fail(error, 2)
|
|
|
+ } else {
|
|
|
+ Toast.fail('请求异常', 2)
|
|
|
+ }
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- componentWillUnmount() {
|
|
|
- Toast.hide()
|
|
|
- clearTimeout(this.backTask)
|
|
|
- }
|
|
|
-
|
|
|
- removeSItem = (index) => {
|
|
|
- if (this.state.voteOptionss.length == 2) {
|
|
|
- return
|
|
|
+ onTargetFocus = (e) => {
|
|
|
+ if (isObjEmpty(this.state.targetData)) {
|
|
|
+ this.getOrganization()
|
|
|
}
|
|
|
- let voteOptionss = this.state.voteOptionss
|
|
|
- voteOptionss.splice(index, 1)
|
|
|
- this.setState({
|
|
|
- voteOptionss
|
|
|
- })
|
|
|
- }
|
|
|
- handelSItem = (itemdata, index) => {
|
|
|
- console.log('index', index)
|
|
|
- console.log('itemdata', itemdata)
|
|
|
- let voteOptionss = this.state.voteOptionss
|
|
|
- voteOptionss[index] = itemdata
|
|
|
- this.setState({
|
|
|
- voteOptionss
|
|
|
- })
|
|
|
}
|
|
|
|
|
|
- addSelectItem = (event) => {
|
|
|
- let voteOptionss = [...this.state.voteOptionss, null];
|
|
|
+ onTargetChange = (value, label, checkNodes, count) => {
|
|
|
+ this.checkNodes = checkNodes
|
|
|
this.setState({
|
|
|
- voteOptionss
|
|
|
- })
|
|
|
+ targetList: value,
|
|
|
+ targetCount: count
|
|
|
+ });
|
|
|
}
|
|
|
- addAnnex = (event) => {
|
|
|
- console.log('addAnnex')
|
|
|
+ selectPersononChange = (value) => {
|
|
|
+ console.log('selectPersononChange ', value);
|
|
|
+ this.setState({meetPerson: value});
|
|
|
+ }
|
|
|
+ disabledStartDate = (startValue) => {
|
|
|
+ const endValue = this.state.endValue;
|
|
|
+ if (!startValue || !endValue) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return startValue.valueOf() > endValue.valueOf();
|
|
|
}
|
|
|
|
|
|
handleSelectChange = (value) => {
|
|
|
- console.log('voteType', value)
|
|
|
+ console.log(`selected ${value}`);
|
|
|
this.setState({
|
|
|
- voteType: value
|
|
|
+ earlyTime: value
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
handelValueCom = (event) => {
|
|
|
//获取用户名的值
|
|
|
- let voteTitle = this.refs.voteTitle.value;
|
|
|
+ let meetTitle = this.refs.meetTitle.value;
|
|
|
//获得内容的值
|
|
|
- this.setState({
|
|
|
- voteTitle: voteTitle,
|
|
|
- })
|
|
|
- }
|
|
|
+ let meetAddress = this.refs.meetAddress.value;
|
|
|
|
|
|
- switchStatues = (value) => {
|
|
|
- console.log('isOpend?', value)
|
|
|
this.setState({
|
|
|
- nonameVote: value
|
|
|
+ titleValue: meetTitle,
|
|
|
+ meetAddress: meetAddress
|
|
|
})
|
|
|
}
|
|
|
- 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) => ({
|
|
|
@@ -445,4 +340,4 @@ let mapStateToProps = (state) => ({
|
|
|
|
|
|
let mapDispatchToProps = (dispatch) => ({})
|
|
|
|
|
|
-export default connect(mapStateToProps, mapDispatchToProps)(SendVote)
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(SendMeet)
|