|
@@ -5,10 +5,10 @@
|
|
|
|
|
|
import React, {Component} from 'react'
|
|
|
import AlbumItem from 'components/AlbumItem'
|
|
|
-import {getStrValue, isObjEmpty} from "../../utils/common";
|
|
|
+import {getIntValue, getStrValue, isObjEmpty} from "../../utils/common";
|
|
|
import {Icon} from 'antd'
|
|
|
import {Picker, List, Toast} from 'antd-mobile'
|
|
|
-import {fetchGet} from "../../utils/fetchRequest";
|
|
|
+import {fetchGet, fetchPost} from "../../utils/fetchRequest";
|
|
|
import {_baseURL, API} from "../../configs/api.config";
|
|
|
import ClassBean from 'model/ClassBean'
|
|
|
import AlbumBean from "../../model/AlbumBean";
|
|
@@ -42,7 +42,6 @@ class ClassAlbum extends Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
- console.log(this.props.userInfo)
|
|
|
document.title = '班级相册'
|
|
|
this.node.scrollIntoView();
|
|
|
|
|
@@ -105,18 +104,19 @@ class ClassAlbum extends Component {
|
|
|
classList.length = 0
|
|
|
|
|
|
let userRole = this.props.userInfo.userRole;
|
|
|
- let params
|
|
|
+ let params, url
|
|
|
if (userRole == 1) {
|
|
|
+ url = API.GET_STU_CLASS_LIST
|
|
|
params = {
|
|
|
- stuId: this.props.userInfo.stuId
|
|
|
+ stuId: this.props.userInfo.user.student.stuId
|
|
|
}
|
|
|
} else {
|
|
|
+ url = API.GET_CLASS_LIST
|
|
|
params = {
|
|
|
- userId: this.props.userInfo.userId
|
|
|
+ teacherId: this.props.userInfo.user.userFunId
|
|
|
}
|
|
|
}
|
|
|
- console.log(params)
|
|
|
- fetchGet(API.GET_CLASS_LIST, params).then(response => {
|
|
|
+ fetchGet(url, params).then(response => {
|
|
|
Toast.hide()
|
|
|
|
|
|
this.analysisClassList(response)
|
|
@@ -131,7 +131,7 @@ class ClassAlbum extends Component {
|
|
|
getAlbumList = classBean => {
|
|
|
this.initAlbumList()
|
|
|
|
|
|
- fetchGet(API.GET_ALBUM_LIST, {
|
|
|
+ fetchPost(API.GET_ALBUM_LIST, {
|
|
|
clazzId: classBean.schId,
|
|
|
albumStatus: 1,
|
|
|
albumType: 1,
|
|
@@ -148,18 +148,18 @@ class ClassAlbum extends Component {
|
|
|
if (dataObject) {
|
|
|
let albumBean = new AlbumBean()
|
|
|
|
|
|
- albumBean.albumId = getStrValue(dataObject, 'picId')
|
|
|
- albumBean.coverImg = getStrValue(dataObject, 'picUrl') ?
|
|
|
- _baseURL + getStrValue(dataObject, 'picUrl') : ''
|
|
|
- albumBean.albumName = getStrValue(dataObject, 'picName')
|
|
|
- albumBean.quantity = getStrValue(dataObject, 'quantity')
|
|
|
- albumBean.albumDate = getStrValue(dataObject, 'picDate')
|
|
|
- albumBean.type = getStrValue(dataObject, 'picType')
|
|
|
- albumBean.status = getStrValue(dataObject, 'picStatus')
|
|
|
- albumBean.remarks = getStrValue(dataObject, 'picStatus')
|
|
|
- albumBean.gradeId = getStrValue(dataObject, 'parentId')
|
|
|
- albumBean.classId = getStrValue(dataObject, 'schId')
|
|
|
- albumBean.classname = getStrValue(dataObject, 'schName')
|
|
|
+ albumBean.albumId = getStrValue(dataObject, 'albumId')
|
|
|
+ albumBean.coverImg = getStrValue(dataObject, 'albumUrl') ?
|
|
|
+ _baseURL + getStrValue(dataObject, 'albumUrl') : ''
|
|
|
+ albumBean.albumName = getStrValue(dataObject, 'albumTitle')
|
|
|
+ albumBean.quantity = getIntValue(dataObject, 'albumCount')
|
|
|
+ albumBean.albumDate = getStrValue(dataObject, 'createDate')
|
|
|
+ albumBean.type = getStrValue(dataObject, 'albumType')
|
|
|
+ albumBean.status = getStrValue(dataObject, 'albumStatus')
|
|
|
+ albumBean.remarks = getStrValue(dataObject, 'albumRemarks')
|
|
|
+ // albumBean.gradeId = getStrValue(dataObject, 'parentId')
|
|
|
+ albumBean.classId = getStrValue(dataObject, 'clazzId')
|
|
|
+ // albumBean.classname = getStrValue(dataObject, 'schName')
|
|
|
|
|
|
albumList.push(albumBean)
|
|
|
}
|
|
@@ -223,14 +223,14 @@ class ClassAlbum extends Component {
|
|
|
if (dataObject) {
|
|
|
let classBean = new ClassBean()
|
|
|
|
|
|
- classBean.label = getStrValue(dataObject, 'parentName') + getStrValue(dataObject, 'schName')
|
|
|
+ classBean.label = getStrValue(dataObject, 'gradeName') + getStrValue(dataObject, 'clazzName')
|
|
|
classBean.value = i
|
|
|
- classBean.schId = getStrValue(dataObject, 'schId')
|
|
|
- classBean.parentId = getStrValue(dataObject, 'parentId')
|
|
|
- classBean.schName = getStrValue(dataObject, 'schName')
|
|
|
- classBean.schStatus = getStrValue(dataObject, 'schStatus')
|
|
|
- classBean.schRemarks = getStrValue(dataObject, 'schRemarks')
|
|
|
- classBean.grade = getStrValue(dataObject, 'parentName')
|
|
|
+ classBean.schId = getStrValue(dataObject, 'clazzId')
|
|
|
+ classBean.parentId = getStrValue(dataObject, 'gradeId')
|
|
|
+ classBean.schName = getStrValue(dataObject, 'clazzName')
|
|
|
+ classBean.schStatus = getStrValue(dataObject, 'clazzStatus')
|
|
|
+ classBean.schRemarks = getStrValue(dataObject, 'clazzRemarks')
|
|
|
+ classBean.grade = getStrValue(dataObject, 'gradeName')
|
|
|
|
|
|
classList.push(classBean)
|
|
|
}
|