|
|
@@ -35,33 +35,33 @@ class SendVote extends Component {
|
|
|
Toast.loading('', 0)
|
|
|
|
|
|
fetchGet(API.getClazzByTeacherId, {
|
|
|
- teacherId: this.props.userInfo.userId,
|
|
|
+ teacherId: this.props.userInfo.user.userFunId,
|
|
|
}).then(response => {
|
|
|
Toast.hide()
|
|
|
const {targetData} = this.state
|
|
|
targetData.length = 0
|
|
|
if (response && response.data) {
|
|
|
- response.data.forEach((dataObj,data_index) =>{
|
|
|
- const parentsDOSArray = dataObj.parentsDOS
|
|
|
+ response.data.forEach((dataObj, data_index) => {
|
|
|
+ const stusDOSArray = dataObj.studentDOS
|
|
|
const teacherDOSArray = dataObj.teacherDOS
|
|
|
- if (!isObjEmpty(parentsDOSArray)) {
|
|
|
+ if (!isObjEmpty(stusDOSArray)) {
|
|
|
const classData = []
|
|
|
- parentsDOSArray.forEach((parentObj, index) => {
|
|
|
- if (parentObj) {
|
|
|
+ stusDOSArray.forEach((stuObj, index) => {
|
|
|
+ if (stuObj) {
|
|
|
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}`,
|
|
|
+ title: getStrValue(stuObj, 'stuName'),
|
|
|
+ userId: getIntValue(stuObj, 'stuId'),
|
|
|
+ userPhone: getStrValue(stuObj, 'userPhone'),
|
|
|
+ value: `2-${data_index}-${index}-` + getStrValue(stuObj, 'stuName'),
|
|
|
+ key: `2-${data_index}-${index}`,
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
|
|
|
targetData.push({
|
|
|
- title: dataObj.gradeName+dataObj.clazzName + '全部家长',
|
|
|
- value: `${data_index}-0`,
|
|
|
- key: `${data_index}-0`,
|
|
|
+ title: dataObj.gradeName + dataObj.clazzName + '全体学生',
|
|
|
+ value: `2-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体学生',
|
|
|
+ key: `2-${data_index}`,
|
|
|
children: classData,
|
|
|
})
|
|
|
}
|
|
|
@@ -74,22 +74,21 @@ class SendVote extends Component {
|
|
|
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}`,
|
|
|
+ value: `0-${data_index}-${index}-` + getStrValue(teacherObj, 'teacherName'),
|
|
|
+ key: `0-${data_index}-${index}`,
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
|
|
|
targetData.push({
|
|
|
- title: dataObj.gradeName+dataObj.clazzName + '全部老师',
|
|
|
- value: `${data_index}-1`,
|
|
|
- key: `${data_index}-1`,
|
|
|
+ title: dataObj.gradeName + dataObj.clazzName + '全体老师',
|
|
|
+ value: `0-${data_index}-` + dataObj.gradeName + dataObj.clazzName + '全体老师',
|
|
|
+ key: `0-${data_index}`,
|
|
|
children: teacherData,
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- console.log('targetData', targetData)
|
|
|
this.setState({
|
|
|
targetData,
|
|
|
})
|
|
|
@@ -260,8 +259,8 @@ class SendVote extends Component {
|
|
|
Toast.fail('请填写投票主题...', 1)
|
|
|
return
|
|
|
}
|
|
|
- for(let i=0;i<this.state.voteOptionss.length;i++){
|
|
|
- if(this.state.voteOptionss[i] == null || this.state.voteOptionss[i].trim().length == 0 ){
|
|
|
+ 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
|
|
|
}
|
|
|
@@ -271,7 +270,7 @@ class SendVote extends Component {
|
|
|
Toast.fail('请选择投票类型...')
|
|
|
return
|
|
|
}
|
|
|
- if (this.state.endValue == null ) {
|
|
|
+ if (this.state.endValue == null) {
|
|
|
Toast.fail('请选择正确结束时间...')
|
|
|
return
|
|
|
}
|
|
|
@@ -302,7 +301,7 @@ class SendVote extends Component {
|
|
|
|
|
|
var params = {
|
|
|
topicName: this.state.voteTitle,
|
|
|
- topicType:this.state.voteType[0],
|
|
|
+ topicType: this.state.voteType[0],
|
|
|
topicFiles: approveFiles,
|
|
|
creator: this.props.userInfo.userId,
|
|
|
|
|
|
@@ -311,7 +310,7 @@ class SendVote extends Component {
|
|
|
voteName: this.state.voteTitle,
|
|
|
voter: JSON.stringify(this.state.votePerson),
|
|
|
voteEndDate: moment(this.state.endValue).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
- voteType:1,
|
|
|
+ voteType: 1,
|
|
|
optionName: [
|
|
|
{
|
|
|
optionStatus: 1,
|