Jelajahi Sumber

1、单选情况下的树形选择控件调整
2、作业发布页面添加科目选择
3、作业发布对象改为选择班级

RaoMeng 6 tahun lalu
induk
melakukan
1036cb9981

+ 2 - 2
frontend/wechat-web/src/components/TargetSelect.jsx

@@ -74,13 +74,13 @@ export default class TargetSelect extends Component {
                 width: '100%',
             },
             allowClear: multiple,
-            suffixIcon: (<Icon type="plus-circle" style={{color: '#4197FC', fontSize: '20px', marginTop: '-10px'}}/>)
+            // suffixIcon: (<Icon type="plus-circle" style={{color: '#4197FC', fontSize: '20px', marginTop: '-10px'}}/>)
         }
         return (
             <div>
                 <div style={{padding: '12px'}}>
                     <span className='announce-release-target-title'>{title}</span>
-                    <span className='announce-release-target-count'>(共{targetCount}人)</span>
+                    {multiple ? <span className='announce-release-target-count'>(共{targetCount}人)</span> : ''}
                 </div>
                 <div className='announce-release-target-layout'>
                     <TreeSelect {...targetProps} onFocus={this.onTargetFocus}/>

+ 3 - 0
frontend/wechat-web/src/configs/api.config.js

@@ -205,6 +205,9 @@ export const API = {
     HOMEWORK_DETAIL: _baseURL + '/wxSchool/taskNotify/taskDetail',
     //作业回复
     HOMEWORK_REPLY: _baseURL + '/wxSchool/taskNotify/taskReply',
+
+    //获取科目列表
+    SUBJECT_LIST: _baseURL + '/wxSchool/taskNotify/subjectDOList'
 }
 
 

+ 5 - 2
frontend/wechat-web/src/modules/album/ClassAlbum.jsx

@@ -88,7 +88,7 @@ class ClassAlbum extends Component {
             }
         }
         return (
-            <div ref={node => this.container = node} style={{height:'100vh',overflow:'scroll'}}>
+            <div ref={node => this.container = node} style={{height: '100vh', overflow: 'scroll'}}>
                 <div className='gray-line'></div>
                 <Picker data={classList} title='选择班级' extra='请选择'
                         value={classValue} onChange={this.handleClassChange} cols={1}>
@@ -125,8 +125,11 @@ class ClassAlbum extends Component {
             this.analysisClassList(response)
         }).catch(error => {
             Toast.hide()
+
             if (typeof error === 'string') {
                 Toast.fail(error, 2)
+            } else {
+                Toast.fail('班级获取异常', 2)
             }
         })
     }
@@ -188,7 +191,7 @@ class ClassAlbum extends Component {
             classList: classList,
             classValue: classValue,
         })()
-        console.log('dd',ReactDOM.findDOMNode(this.container))
+        console.log('dd', ReactDOM.findDOMNode(this.container))
         saveListState({
             scrollTop: ReactDOM.findDOMNode(this.container).scrollTop,
         })()

+ 21 - 21
frontend/wechat-web/src/modules/announce/AnnounceRelease.jsx

@@ -38,7 +38,7 @@ class AnnounceRelease extends Component {
     componentDidMount() {
         document.title = '发布通知公告'
 
-        this.getOrganization()
+        // this.getOrganization()
     }
 
     componentWillUnmount() {
@@ -49,7 +49,7 @@ class AnnounceRelease extends Component {
 
     render() {
         const {announceTitle, announceContent, targetCount, targetList, fileList, targetData} = this.state
-        const targetProps = {
+        /*const targetProps = {
             targetData: targetData,
             targetValues: targetList,
             title: '通知对象',
@@ -65,12 +65,12 @@ class AnnounceRelease extends Component {
             targetCount: targetCount,
             onTargetChange: this.onTargetChange.bind(this),
             onTargetFocus: this.onTargetFocus.bind(this)
-        }
+        }*/
         return (
             <div className='common-column-layout'>
-                <div className='gray-line'></div>
+                {/*<div className='gray-line'></div>
                 {targetData.length > 0 ? <TargetSelect {...targetProps}/>
-                    : <TargetSelect {...defaultTargetProps}/>}
+                    : <TargetSelect {...defaultTargetProps}/>}*/}
                 <div className='gray-line'></div>
                 <input className='titleInput' placeholder='请输入通知标题'
                        value={announceTitle} onChange={this.titleChange}/>
@@ -183,10 +183,10 @@ class AnnounceRelease extends Component {
             Toast.fail('请输入通知内容')
             return
         }
-        if (isObjEmpty(this.checkNodes)) {
-            Toast.fail('请选择通知对象')
-            return
-        }
+        // if (isObjEmpty(this.checkNodes)) {
+        //     Toast.fail('请选择通知对象')
+        //     return
+        // }
 
         if (announceTitle.length > 50) {
             Toast.fail('通知标题过长')
@@ -206,16 +206,16 @@ class AnnounceRelease extends Component {
                 }
             })
         }
-        const stuList = [], teacherList = []
-        if (!isObjEmpty(this.checkNodes)) {
-            this.checkNodes.forEach((node, index) => {
-                if (node.value.startWith('0')) {
-                    teacherList.push(node.userId)
-                } else if (node.value.startWith('2')) {
-                    stuList.push(node.userId)
-                }
-            })
-        }
+        // const stuList = [], teacherList = []
+        // if (!isObjEmpty(this.checkNodes)) {
+        //     this.checkNodes.forEach((node, index) => {
+        //         if (node.value.startWith('0')) {
+        //             teacherList.push(node.userId)
+        //         } else if (node.value.startWith('2')) {
+        //             stuList.push(node.userId)
+        //         }
+        //     })
+        // }
 
         const paramObj = {
             notifyTitle: announceTitle,
@@ -225,8 +225,8 @@ class AnnounceRelease extends Component {
             notifyStatus: 1,
             notifyFiles: JSON.stringify(fileUrls),
             notifyRemarks: '',
-            notifyTeacher: JSON.stringify(teacherList),
-            notifyStu: JSON.stringify(stuList),
+            // notifyTeacher: JSON.stringify(teacherList),
+            // notifyStu: JSON.stringify(stuList),
         }
 
         console.log(paramObj)

+ 137 - 123
frontend/wechat-web/src/modules/hiPages/score-inquiry/ScoreInquiry.js

@@ -1,158 +1,172 @@
 /**
-*   Created by FANGlh on 2018/11/12 18:19.
-*/
+ *   Created by FANGlh on 2018/11/12 18:19.
+ */
 
-import React,{Component} from 'react';
+import React, {Component} from 'react';
 import './ScoreInquiry.css';
-import { Select  } from 'antd';
+import {Select} from 'antd';
 import ScoreData from './ScoreData';
-import {fetchPost,fetchGet,fetchGetNoSession} from '../../../utils/fetchRequest';
+import {fetchPost, fetchGet, fetchGetNoSession} from '../../../utils/fetchRequest';
 import {API} from '../../../configs/api.config';
-import {Toast,Picker,List} from 'antd-mobile';
+import {Toast, Picker, List} from 'antd-mobile';
 import {connect} from 'react-redux';
-import {getIntValue, getStrValue, isObjEmpty,getSearchParams} from "../../../utils/common";
+import {getIntValue, getStrValue, isObjEmpty, getSearchParams} from "../../../utils/common";
 
 
 const Option = Select.Option;
+
 function OptionS(props) {
-    return(
+    return (
         <div>
             {
-                props.optionsName!= ""  ?<Option value={props.optionsName} >{props.optionsName}</Option>:""
+                props.optionsName != "" ? <Option value={props.optionsName}>{props.optionsName}</Option> : ""
             }
         </div>
     )
 }
-class ScoreInquiry extends Component{
-    constructor(){
+
+class ScoreInquiry extends Component {
+    constructor() {
         super();
         this.state = {
-            selectClass:null,
-            selectTime:null,
-            ScoreDataList:[
-
-            ],
-            scoreNames:[],
-            scoreTypes:[]
+            selectClass: null,
+            selectTime: null,
+            ScoreDataList: [],
+            scoreNames: [],
+            scoreTypes: []
         }
     }
-    render(){
-        return(
-            <div className="this_contaior" >
-               <div className="header_select_sty">
-                   <div style={{width:"50%",}}>
-                       <Select  defaultValue="单科查询-请选择" style={{ width:'100%'}} onChange={this.handleSelectClass}>
-                           <Option value={null} >该项不选</Option>
-                           {
-                               this.state.scoreNames[0]!= ""   ?<Option value={this.state.scoreNames[0]} >{this.state.scoreNames[0]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[1]!= ""   ?<Option value={this.state.scoreNames[1]} >{this.state.scoreNames[1]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[2]!= ""  ?<Option value={this.state.scoreNames[2]} >{this.state.scoreNames[2]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[3]!= ""  ?<Option value={this.state.scoreNames[3]} >{this.state.scoreNames[3]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[4]!= ""  ?<Option value={this.state.scoreNames[4]} >{this.state.scoreNames[4]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[5]!= ""  ?<Option value={this.state.scoreNames[5]} >{this.state.scoreNames[5]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[6]!= ""  ?<Option value={this.state.scoreNames[6]} >{this.state.scoreNames[6]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[7]!= ""  ?<Option value={this.state.scoreNames[7]} >{this.state.scoreNames[7]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[8]!= ""  ?<Option value={this.state.scoreNames[8]} >{this.state.scoreNames[8]}</Option>:""
-                           }
-                           {
-                               this.state.scoreNames[9]!= ""  ?<Option value={this.state.scoreNames[9]} >{this.state.scoreNames[9]}</Option>:''
-                           }
 
-                       </Select>
-                   </div>
-                   <div style={{width:"50%"}}>
-                       <Select defaultValue="阶段查询-请选择" style={{width:"100%"}} onChange={this.handleSelectTime}>
-                           <Option value={null}>该项不选</Option>
-                           <Option value={this.state.scoreTypes[0]} >{this.state.scoreTypes[0]}</Option>
-                           <Option value={this.state.scoreTypes[1]} >{this.state.scoreTypes[1]}</Option>
-                           <Option value={this.state.scoreTypes[2]} >{this.state.scoreTypes[2]}</Option>
-                           <Option value={this.state.scoreTypes[3]} >{this.state.scoreTypes[3]}</Option>
-                           <Option value={this.state.scoreTypes[4]} >{this.state.scoreTypes[4]}</Option>
-                           <Option value={this.state.scoreTypes[5]} >{this.state.scoreTypes[5]}</Option>
-                           <Option value={this.state.scoreTypes[6]} >{this.state.scoreTypes[6]}</Option>
-                           <Option value={this.state.scoreTypes[7]} >{this.state.scoreTypes[7]}</Option>
-                           <Option value={this.state.scoreTypes[8]} >{this.state.scoreTypes[8]}</Option>
-                           <Option value={this.state.scoreTypes[9]} >{this.state.scoreTypes[9]}</Option>
-                       </Select>
-                   </div>
-               </div>
+    render() {
+        return (
+            <div className="this_contaior">
+                <div className="header_select_sty">
+                    <div style={{width: "50%",}}>
+                        <Select defaultValue="单科查询-请选择" style={{width: '100%'}} onChange={this.handleSelectClass}>
+                            <Option value={null}>该项不选</Option>
+                            {
+                                this.state.scoreNames[0] != "" ?
+                                    <Option value={this.state.scoreNames[0]}>{this.state.scoreNames[0]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[1] != "" ?
+                                    <Option value={this.state.scoreNames[1]}>{this.state.scoreNames[1]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[2] != "" ?
+                                    <Option value={this.state.scoreNames[2]}>{this.state.scoreNames[2]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[3] != "" ?
+                                    <Option value={this.state.scoreNames[3]}>{this.state.scoreNames[3]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[4] != "" ?
+                                    <Option value={this.state.scoreNames[4]}>{this.state.scoreNames[4]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[5] != "" ?
+                                    <Option value={this.state.scoreNames[5]}>{this.state.scoreNames[5]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[6] != "" ?
+                                    <Option value={this.state.scoreNames[6]}>{this.state.scoreNames[6]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[7] != "" ?
+                                    <Option value={this.state.scoreNames[7]}>{this.state.scoreNames[7]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[8] != "" ?
+                                    <Option value={this.state.scoreNames[8]}>{this.state.scoreNames[8]}</Option> : ""
+                            }
+                            {
+                                this.state.scoreNames[9] != "" ?
+                                    <Option value={this.state.scoreNames[9]}>{this.state.scoreNames[9]}</Option> : ''
+                            }
 
-                <div style={{marginTop:20}}>
-                    <div style={{width:'100%',height:10,backgroundColor:'#F2F2F2'}}></div>
+                        </Select>
+                    </div>
+                    <div style={{width: "50%"}}>
+                        <Select defaultValue="阶段查询-请选择" style={{width: "100%"}} onChange={this.handleSelectTime}>
+                            <Option value={null}>该项不选</Option>
+                            <Option value={this.state.scoreTypes[0]}>{this.state.scoreTypes[0]}</Option>
+                            <Option value={this.state.scoreTypes[1]}>{this.state.scoreTypes[1]}</Option>
+                            <Option value={this.state.scoreTypes[2]}>{this.state.scoreTypes[2]}</Option>
+                            <Option value={this.state.scoreTypes[3]}>{this.state.scoreTypes[3]}</Option>
+                            <Option value={this.state.scoreTypes[4]}>{this.state.scoreTypes[4]}</Option>
+                            <Option value={this.state.scoreTypes[5]}>{this.state.scoreTypes[5]}</Option>
+                            <Option value={this.state.scoreTypes[6]}>{this.state.scoreTypes[6]}</Option>
+                            <Option value={this.state.scoreTypes[7]}>{this.state.scoreTypes[7]}</Option>
+                            <Option value={this.state.scoreTypes[8]}>{this.state.scoreTypes[8]}</Option>
+                            <Option value={this.state.scoreTypes[9]}>{this.state.scoreTypes[9]}</Option>
+                        </Select>
+                    </div>
+                </div>
+
+                <div style={{marginTop: 20}}>
+                    <div style={{width: '100%', height: 10, backgroundColor: '#F2F2F2'}}></div>
                     <div>
-                        {this.state.ScoreDataList.map((itemdata,index) => <ScoreData key={index} itemdata = {itemdata}></ScoreData>)}
+                        {this.state.ScoreDataList.map((itemdata, index) => <ScoreData key={index}
+                                                                                      itemdata={itemdata}></ScoreData>)}
                     </div>
                 </div>
             </div>
         )
     }
-    getScoreData =(selectClas,selectTime)=>{
+
+    getScoreData = (selectClas, selectTime) => {
         let params = {
             stuId: this.stuId,
             // stuId:10003,
-            scoreType:selectTime,
-            scoreName:selectClas
+            scoreType: selectTime,
+            scoreName: selectClas
         }
-        fetchGet(API.getScoreByStuId,params,{})
-            .then((response)=>{
-                console.log('response',response)
-                if(response.success && response.data[0].schoolAverage !=  "NaN"){
+        fetchGet(API.getScoreByStuId, params, {})
+            .then((response) => {
+                console.log('response', response)
+                if (response.success && response.data[0].schoolAverage != "NaN") {
                     this.setState({
-                        ScoreDataList:response.data
+                        ScoreDataList: response.data
                     })
-                }else {
-                    Toast.fail('暂无数据', 2)
+                } else {
                     this.setState({
-                        ScoreDataList:[]
+                        ScoreDataList: []
                     })
                 }
-            }).catch((error) =>{
-                console.log('error',error)
-                this.setState({
-                    ScoreDataList:[]
-                })
-                if (typeof error === 'string') {
-                    Toast.fail(error, 2)
-                } else {
-                    Toast.fail('请求异常', 2)
-                }
+            }).catch((error) => {
+            console.log('error', error)
+            this.setState({
+                ScoreDataList: []
             })
+            if (typeof error === 'string') {
+                Toast.fail(error, 2)
+            } else {
+                Toast.fail('请求异常', 2)
+            }
+        })
     }
-    handleSelectClass =(value) =>{
-        console.log(`selected`,value);
+    handleSelectClass = (value) => {
+        console.log(`selected`, value);
         this.setState({
-            selectClass:value
-        },function () {
-            this.getScoreData(this.state.selectClass,this.state.selectTime)
+            selectClass: value
+        }, function () {
+            this.getScoreData(this.state.selectClass, this.state.selectTime)
         })
     }
-    handleSelectTime =(value) =>{
-        console.log(`selected`,value);
+    handleSelectTime = (value) => {
+        console.log(`selected`, value);
         this.setState({
-           selectTime:value
-        },function () {
-            this.getScoreData(this.state.selectClass,this.state.selectTime)
+            selectTime: value
+        }, function () {
+            this.getScoreData(this.state.selectClass, this.state.selectTime)
         })
     }
+
     componentWillMount() {
         document.title = '成绩查询'
     }
+
     componentDidMount() {
         this.searchParams = getSearchParams(this.props.location.search)
         this.stuId = this.props.userInfo.user.student.stuId
@@ -163,43 +177,43 @@ class ScoreInquiry extends Component{
             stuId: this.stuId
             // stuId:10003,
         }
-        fetchGet(API.getCurr,params,{})
-            .then((response)=>{
-                console.log('response',response)
-                if(response.success ){
+        fetchGet(API.getCurr, params, {})
+            .then((response) => {
+                console.log('response', response)
+                if (response.success) {
                     this.setState({
-                        scoreNames:response.data.scoreNames,
-                        scoreTypes:response.data.scoreTypes
+                        scoreNames: response.data.scoreNames,
+                        scoreTypes: response.data.scoreTypes
                     })
                     return
                     const scoreNames = []
                     const scoreTypes = []
-                    if(response.data.scoreNames){
-                        response.data.scoreNames.forEach((value,index) =>{
+                    if (response.data.scoreNames) {
+                        response.data.scoreNames.forEach((value, index) => {
                             const item = {}
                             item.value = response.data.scoreNames[index]
                             item.label = response.data.scoreNames[index]
                             scoreNames.push(item)
                         })
                     }
-                    if(response.data.scoreTypes){
-                        response.data.scoreTypes.forEach((value,index) =>{
+                    if (response.data.scoreTypes) {
+                        response.data.scoreTypes.forEach((value, index) => {
                             const item = {}
                             item.value = response.data.scoreTypes[index]
                             item.label = response.data.scoreTypes[index]
                             scoreTypes.push(item)
                         })
                     }
-                    console.log('scoreNames',scoreNames)
-                    console.log('scoreTypes',scoreTypes)
+                    console.log('scoreNames', scoreNames)
+                    console.log('scoreTypes', scoreTypes)
                     this.setState({
-                        scoreNames:scoreNames,
-                        scoreTypes:scoreTypes
+                        scoreNames: scoreNames,
+                        scoreTypes: scoreTypes
                     })
                 }
             })
-            .catch((error) =>{
-                console.log('error',error)
+            .catch((error) => {
+                console.log('error', error)
                 if (typeof error === 'string') {
                     Toast.fail(error, 2)
                 } else {

+ 11 - 13
frontend/wechat-web/src/modules/hiPages/scorenotification/ScoreNotification.js

@@ -92,7 +92,6 @@ class ScoreNotification extends Component {
         console.log('params', params)
         fetchPost(API.getScoreByStu, params, {})
             .then((response) => {
-                console.log('response', response)
                 if (response.success && response.data[0].schoolAverage != "NaN") {
                     if (pageIndex == 1) {
                         this.setState({
@@ -104,25 +103,24 @@ class ScoreNotification extends Component {
                         })
                     }
 
+                }
+
+                this.setState({
+                    isRefreshing: false,
+                    isLoading: false
+                })
+            })
+            .catch((error) => {
+                if (typeof error === 'string') {
+                    Toast.fail(error, 2)
                 } else {
-                    Toast.fail('暂无数据', 2)
+                    Toast.fail('请求异常', 2)
                 }
                 this.setState({
                     isRefreshing: false,
                     isLoading: false
                 })
-            }).catch((error) => {
-            console.log('error', error)
-            if (typeof error === 'string') {
-                Toast.fail(error, 2)
-            } else {
-                Toast.fail('请求异常', 2)
-            }
-            this.setState({
-                isRefreshing: false,
-                isLoading: false
             })
-        })
     }
 
 }

+ 92 - 19
frontend/wechat-web/src/modules/homework/ReleaseAssignmentPage.js

@@ -14,7 +14,7 @@ import {_baseURL, API} from '../../configs/api.config';
 import {isObjEmpty, getIntValue, getStrValue} from '../../utils/common';
 import UploadEnclosure from 'components/UploadEnclosure'
 
-import {Toast, DatePicker, List} from 'antd-mobile'
+import {Toast, DatePicker, List, Picker} from 'antd-mobile'
 import {connect} from 'react-redux'
 
 const {TextArea} = Input;
@@ -37,6 +37,8 @@ class ReleaseAssignmentPage extends React.Component {
             endDate: '',//截止时间
             taskTitle: '',
             taskContent: '',
+            courseList: [],
+            courseValue: [],
         }
     }
 
@@ -68,6 +70,7 @@ class ReleaseAssignmentPage extends React.Component {
 
     componentDidMount() {
         this.getOrganization();
+        this.getSubjectList();
     }
 
 
@@ -103,7 +106,7 @@ class ReleaseAssignmentPage extends React.Component {
     }
 
     commitAction = () => {
-        const {taskTitle, taskContent, endDate, fileList} = this.state
+        const {taskTitle, taskContent, endDate, fileList, courseValue} = this.state
 
         if (isObjEmpty(taskTitle)) {
             Toast.fail("请输入作业名称");
@@ -122,6 +125,10 @@ class ReleaseAssignmentPage extends React.Component {
             Toast.fail("请输入截止时间");
             return;
         }
+        if (isObjEmpty(courseValue)) {
+            Toast.fail("请选择作业科目");
+            return;
+        }
         if (isObjEmpty(this.checkNodes)) {
             Toast.fail("请选择抄送对象");
             return;
@@ -129,7 +136,7 @@ class ReleaseAssignmentPage extends React.Component {
         let personArrays = [];
         if (!isObjEmpty(this.checkNodes)) {
             this.checkNodes.forEach((node) => {
-                personArrays.push(node.userId)
+                personArrays.push(node.classId)
             })
         }
         const fileUrls = []
@@ -187,7 +194,7 @@ class ReleaseAssignmentPage extends React.Component {
 
 
     render() {
-        const {targetCount, targetList, targetData, fileList} = this.state
+        const {targetCount, targetList, targetData, fileList, courseList, courseValue} = this.state
         const targetProps = {
             placeholder: '请选择抄送对象',
             targetData: targetData,
@@ -195,7 +202,8 @@ class ReleaseAssignmentPage extends React.Component {
             title: '抄送对象',
             targetCount: targetCount,
             onTargetChange: this.onTargetChange.bind(this),
-            onTargetFocus: this.onTargetFocus.bind(this)
+            onTargetFocus: this.onTargetFocus.bind(this),
+            multiple: false,
         }
 
         const defaultTargetProps = {
@@ -204,7 +212,8 @@ class ReleaseAssignmentPage extends React.Component {
             title: '抄送对象',
             targetCount: this.state.targetCount,
             onTargetChange: this.onTargetChange.bind(this),
-            onTargetFocus: this.onTargetFocus.bind(this)
+            onTargetFocus: this.onTargetFocus.bind(this),
+            multiple: false,
         }
 
         return <div className='common-column-layout' style={{paddingBottom: '40px'}}>
@@ -212,15 +221,10 @@ class ReleaseAssignmentPage extends React.Component {
             {this.state.targetData.length > 0 ? <TargetSelect {...targetProps}/>
                 : <TargetSelect {...defaultTargetProps}/>}
             <div className='gray-line'></div>
-            <DatePicker
-                value={this.state.endDate}
-                locale={{
-                    okText: '确定',
-                    dismissText: '取消'
-                }}
-                onChange={date => this.setState({endDate: date})}>
-                <List.Item arrow="horizontal">截止时间</List.Item>
-            </DatePicker>
+            <Picker data={courseList} title='选择科目' extra='请选择'
+                    value={courseValue} onChange={this.handleCourseChange} cols={1}>
+                <List.Item arrow="horizontal">选择科目</List.Item>
+            </Picker>
             <div className='gray-line'></div>
             <input placeholder="请输入作业名称" defaultValue={this.state.taskTitle}
                    onChange={this.changeName}
@@ -232,6 +236,16 @@ class ReleaseAssignmentPage extends React.Component {
                       className='contentInput'
                       placeholder="请输入作业内容"/>
             <div className='gray-line'></div>
+            <DatePicker
+                value={this.state.endDate}
+                locale={{
+                    okText: '确定',
+                    dismissText: '取消'
+                }}
+                onChange={date => this.setState({endDate: date})}>
+                <List.Item arrow="horizontal">截止时间</List.Item>
+            </DatePicker>
+            <div className='gray-line'></div>
             <UploadEnclosure
                 action={API.UPLOAD_FILE}
                 fileList={fileList}
@@ -242,7 +256,7 @@ class ReleaseAssignmentPage extends React.Component {
             />
 
             <Button type="primary" onClick={this.commitAction}
-                    style={{margin: '35px 35px 16px',borderRadius:30}}
+                    style={{margin: '35px 35px 16px', borderRadius: 30}}
                     className='commonButton'>发布作业</Button>
 
             {/*<span className='announce-release-history' onClick={this.goListAction}>历史发布</span>*/}
@@ -265,10 +279,14 @@ class ReleaseAssignmentPage extends React.Component {
         })
     }
 
+    handleCourseChange = (v) => {
+        this.setState({courseValue: v})
+    }
+
     getOrganization = () => {
         Toast.loading('', 0)
 
-        fetchGet(API.getClazzByTeacherId, {
+        fetchGet(API.GET_CLASS_LIST, {
             teacherId: this.props.userInfo.user.userFunId,
         }).then(response => {
             Toast.hide()
@@ -276,7 +294,14 @@ class ReleaseAssignmentPage extends React.Component {
             targetData.length = 0
             if (response && response.data) {
                 response.data.forEach((dataObj, data_index) => {
-                    const stusDOSArray = dataObj.studentDOS
+                    targetData.push({
+                        classId: dataObj.clazzId,
+                        title: getStrValue(dataObj, 'gradeName') + getStrValue(dataObj, 'clazzName'),
+                        value: `4-${data_index}` + getStrValue(dataObj, 'gradeName') + getStrValue(dataObj, 'clazzName'),
+                        key: `4-${data_index}`,
+                    })
+
+                    /*const stusDOSArray = dataObj.studentDOS
                     if (!isObjEmpty(stusDOSArray)) {
                         const classData = []
                         stusDOSArray.forEach((stuObj, index) => {
@@ -297,7 +322,7 @@ class ReleaseAssignmentPage extends React.Component {
                             key: `2-${data_index}`,
                             children: classData,
                         })
-                    }
+                    }*/
                 })
             }
             this.setState({
@@ -313,6 +338,54 @@ class ReleaseAssignmentPage extends React.Component {
             }
         })
     }
+
+    getSubjectList() {
+        // Toast.loading('', 0)
+
+        fetchPost(API.SUBJECT_LIST, {
+            teacherId: this.props.userInfo.user.userFunId,
+            subjectStatus: 1
+        }).then(response => {
+            Toast.hide()
+            const {courseList, courseValue} = this.state
+            courseList.length = 0
+            courseValue.length = 0
+
+            let dataArray = response.data
+            if (dataArray) {
+                for (let i = 0; i < dataArray.length; i++) {
+                    let dataObject = dataArray[i]
+                    if (dataObject) {
+                        let subjectBean = {}
+
+                        subjectBean.subjectId = getStrValue(dataObject, 'subjectId')
+                        subjectBean.subjectName = getStrValue(dataObject, 'subjectName')
+                        subjectBean.subjectStatus = getStrValue(dataObject, 'subjectStatus')
+                        subjectBean.schoolId = getStrValue(dataObject, 'schoolId')
+                        subjectBean.value = i
+
+                        courseList.push(subjectBean)
+                    }
+                }
+
+                if (courseList.length > 0) {
+                    courseValue.push(courseList[0].value)
+                    this.setState({
+                        courseList,
+                        courseValue
+                    })
+                }
+            }
+        }).catch(error => {
+            Toast.hide()
+
+            if (typeof error === 'string') {
+                Toast.fail(error, 2)
+            } else {
+                Toast.fail('获取科目异常', 2)
+            }
+        })
+    }
 }
 
 let mapStateToProps = (state) => ({

+ 4 - 4
frontend/wechat-web/src/modules/leave/LeaveItem.js

@@ -37,13 +37,13 @@ export default class LeaveItem extends Component {
                             </div>
                         </div>
                         <div className="leave_row_sty" style={{marginTop:5}}>
-                            <div  style={{fontSize: 14, color: "#999999",width:'21%'}}>请假时间:</div>
-                            <div style={{fontSize: 14, color: "#666666",width:'79%'}}>{item.startTime}—{item.endTime}</div>
+                            <div  style={{fontSize: 14, color: "#999999",width:'25%'}}>请假时间:</div>
+                            <div style={{fontSize: 14, color: "#666666",width:'75%'}}>{item.startTime}—{item.endTime}</div>
                         </div>
 
                         <div className="leave_row_sty" style={{marginTop:5}}>
-                            <div style={{fontSize: 14, color: "#999999",width:'21%'}}>请假事由:</div>
-                            <div style={{fontSize: 14, color: "#666666",width:'79%',wordWrap:'break-word'}}>{item.content}</div>
+                            <div style={{fontSize: 14, color: "#999999",width:'25%'}}>请假事由:</div>
+                            <div style={{fontSize: 14, color: "#666666",width:'75%',wordWrap:'break-word'}}>{item.content}</div>
                         </div>
                     </div>
                 </Link>

+ 4 - 4
frontend/wechat-web/src/style/css/announce.css

@@ -18,10 +18,10 @@
     border-top: 1px solid #F2F2F2;
 }
 
-.announce-release-target-layout span.ant-select-arrow {
-    font-size: 20px !important;
-    margin-top: -10px !important;
-}
+/*.announce-release-target-layout span.ant-select-arrow {*/
+    /*font-size: 20px !important;*/
+    /*margin-top: -10px !important;*/
+/*}*/
 
 .announce-release-target-layout .ant-select-selection {
     border: none;