Commit 1a27722f by wufan

Merge branch 'fixed/pangguoming/2021/0530/Video_Course_list_share' into 'master'

Fixed/pangguoming/2021/0530/video course list share

See merge request !30
parents f6e60ffd b60095b4
......@@ -2,8 +2,8 @@
* @Description:
* @Author: zangsuyun
* @Date: 2021-03-13 09:54:26
* @LastEditors: wufan
* @LastEditTime: 2021-05-30 20:38:03
* @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-30 23:59:36
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/
......@@ -24,24 +24,24 @@ const { TabPane } = Tabs
const courseStateShow = {
UN_START: {
code: 1,
title: "待开课",
color: "#FFB129",
title: '待开课',
color: '#FFB129'
},
STARTING: {
code: 2,
title: '上课中',
color: '#238FFF',
color: '#238FFF'
},
FINISH: {
code: 3,
title: '已完成',
color: '#3BBDAA',
color: '#3BBDAA'
},
EXPIRED: {
code: 4,
title: '未成功开课',
color: '#999',
},
color: '#999'
}
}
class AddCourse extends React.Component {
......@@ -55,7 +55,7 @@ class AddCourse extends React.Component {
excludeUsed: true,
courseType: 'LIVE',
storeId: User.getStoreId(),
toRefKnowledgeCategoryId: this.props.categoryId,
toRefKnowledgeCategoryId: this.props.categoryId
},
liveTotalCount: 0,
selectLive: [], //弹窗内已选择的直播课程
......@@ -63,21 +63,21 @@ class AddCourse extends React.Component {
videoCourseDivision: 'internal',
videoDataSource: {
external: [],
internal: [],
internal: []
},
videoSize: {
external: 10,
internal: 10,
internal: 10
},
videoSearchDefalt: {
external: {
categoryId: '',
courseName: '',
courseName: ''
},
internal: {
categoryId: '',
courseName: '',
},
courseName: ''
}
},
videoQuery: {
......@@ -88,7 +88,7 @@ class AddCourse extends React.Component {
courseType: 'VOICE',
excludeUsed: true,
storeId: User.getStoreId(),
toRefKnowledgeCategoryId: this.props.categoryId,
toRefKnowledgeCategoryId: this.props.categoryId
},
internal: {
categoryId: '',
......@@ -97,20 +97,20 @@ class AddCourse extends React.Component {
courseType: 'VOICE',
excludeUsed: true,
storeId: User.getStoreId(),
toRefKnowledgeCategoryId: this.props.categoryId,
},
toRefKnowledgeCategoryId: this.props.categoryId
}
},
videoTotalCount: {
external: 0,
internal: 0,
internal: 0
},
selectVideo: {
external: [],
internal: [],
internal: []
}, //弹窗内已选择的视频课程
currentVideoCourseListData: {
external: [],
internal: [],
internal: []
}, //页面中已关联的视频课程
pictureDataSource: [],
......@@ -120,12 +120,12 @@ class AddCourse extends React.Component {
excludeUsed: true,
courseType: 'PICTURE',
storeId: User.getStoreId(),
toRefKnowledgeCategoryId: this.props.categoryId,
toRefKnowledgeCategoryId: this.props.categoryId
},
pictureTotalCount: 0,
selectPicture: [], //弹窗内已选择的图文课程
categoryList: [], //内部分类列表
categoryListExternal: [], //外部分类列表
categoryListExternal: [] //外部分类列表
}
}
componentDidMount() {
......@@ -139,25 +139,25 @@ class AddCourse extends React.Component {
queryCategoryTree = (categoryName) => {
let query = {
storeId: User.getStoreId(),
withCount: false,
withCount: false
}
let queryInternal = {
bizType: 'QUESTION',
source: 2,
tenantId: User.getStoreId(),
userId: User.getStoreUserId(),
count: false,
count: false
}
AidToolService.queryExternalCategoryTree(queryInternal).then((res) => {
const { categoryList = [] } = res.result
this.setState({
categoryListExternal: this.renderTreeNodes(categoryList),
categoryListExternal: this.renderTreeNodes(categoryList)
})
})
KnowledgeAPI.getCategoryTree(query).then((res) => {
const { categoryList = [] } = res.result
this.setState({
categoryList: this.renderTreeNodes(categoryList),
categoryList: this.renderTreeNodes(categoryList)
})
})
}
......@@ -187,7 +187,7 @@ class AddCourse extends React.Component {
const params = {
...liveQuery,
size: liveSize,
size: liveSize
}
// CourseService.getLiveCloudCoursePage(params).then((res) => {
......@@ -196,7 +196,7 @@ class AddCourse extends React.Component {
const { records = [], total = 0 } = result
this.setState({
liveDataSource: records,
liveTotalCount: Number(total),
liveTotalCount: Number(total)
})
})
}
......@@ -208,7 +208,7 @@ class AddCourse extends React.Component {
const params = {
...videoQuery[videoCourseDivision],
size: videoSize[videoCourseDivision],
courseDivision: videoCourseDivision === 'internal' ? 'INTERNAL' : 'EXTERNAL',
courseDivision: videoCourseDivision === 'internal' ? 'INTERNAL' : 'EXTERNAL'
}
// CourseService.videoSchedulePage(query).then((res) => {
......@@ -218,12 +218,12 @@ class AddCourse extends React.Component {
this.setState({
videoDataSource: {
...videoDataSource,
[videoCourseDivision]: records,
[videoCourseDivision]: records
},
videoTotalCount: {
...videoTotalCount,
[videoCourseDivision]: Number(total),
},
[videoCourseDivision]: Number(total)
}
})
})
}
......@@ -234,7 +234,7 @@ class AddCourse extends React.Component {
const params = {
...pictureQuery,
size: pictureSize,
size: pictureSize
}
// CourseService.pictureSchedulePage(query).then((res) => {
......@@ -243,7 +243,7 @@ class AddCourse extends React.Component {
const { records = [], total = 0 } = result
this.setState({
pictureDataSource: records,
pictureTotalCount: Number(total),
pictureTotalCount: Number(total)
})
})
}
......@@ -254,7 +254,7 @@ class AddCourse extends React.Component {
}
this.setState(
{
liveSize: size,
liveSize: size
},
() => {
this.handleFetchLiveList()
......@@ -268,7 +268,7 @@ class AddCourse extends React.Component {
}
this.setState(
{
videoSize: size,
videoSize: size
},
() => {
this.handleFetchVideoList()
......@@ -282,7 +282,7 @@ class AddCourse extends React.Component {
}
this.setState(
{
pictureSize: size,
pictureSize: size
},
() => {
this.handleFetchPictureList()
......@@ -300,13 +300,12 @@ class AddCourse extends React.Component {
<i
className='icon iconfont'
style={{
marginLeft: "5px",
cursor: "pointer",
color: "#bfbfbf",
fontSize: "14px",
fontWeight:"400"
}}
>
marginLeft: '5px',
cursor: 'pointer',
color: '#bfbfbf',
fontSize: '14px',
fontWeight: '400'
}}>
&#xe61d;
</i>
</Tooltip>
......@@ -342,7 +341,7 @@ class AddCourse extends React.Component {
className='course-status'
style={{
color: courseStateShow[record.courseState].color,
border: `1px solid ${courseStateShow[record.courseState].color}`,
border: `1px solid ${courseStateShow[record.courseState].color}`
}}>
{courseStateShow[record.courseState].title}
</span>
......@@ -350,7 +349,7 @@ class AddCourse extends React.Component {
</div>
</div>
)
},
}
},
{
title: '上课时间',
......@@ -364,7 +363,7 @@ class AddCourse extends React.Component {
{formatDate('H:i', parseInt(item.startTime))}~{formatDate('H:i', parseInt(item.endTime))}
</span>
)
},
}
},
{
......@@ -379,8 +378,8 @@ class AddCourse extends React.Component {
{record.categoryTwoName ? `-${record.categoryTwoName}` : ''}
</div>
)
},
},
}
}
]
return columns
......@@ -397,13 +396,12 @@ class AddCourse extends React.Component {
<i
className='icon iconfont'
style={{
marginLeft: "5px",
cursor: "pointer",
color: "#bfbfbf",
fontSize: "14px",
fontWeight:"400"
}}
>
marginLeft: '5px',
cursor: 'pointer',
color: '#bfbfbf',
fontSize: '14px',
fontWeight: '400'
}}>
&#xe61d;
</i>
</Tooltip>
......@@ -439,7 +437,7 @@ class AddCourse extends React.Component {
</Choose>
</div>
)
},
}
},
{
title: '课程时长',
......@@ -448,7 +446,7 @@ class AddCourse extends React.Component {
dataIndex: 'videoDuration',
render: (text, item) => {
return <span>{text ? dealTimeDuration(text) : '-'}</span>
},
}
},
{
......@@ -469,8 +467,8 @@ class AddCourse extends React.Component {
</Otherwise>
</Choose>
)
},
},
}
}
]
return columns
}
......@@ -485,13 +483,12 @@ class AddCourse extends React.Component {
<i
className='icon iconfont'
style={{
marginLeft: "5px",
cursor: "pointer",
color: "#bfbfbf",
fontSize: "14px",
fontWeight:"400"
}}
>
marginLeft: '5px',
cursor: 'pointer',
color: '#bfbfbf',
fontSize: '14px',
fontWeight: '400'
}}>
&#xe61d;
</i>
</Tooltip>
......@@ -518,7 +515,7 @@ class AddCourse extends React.Component {
</Choose>
</div>
)
},
}
},
{
title: '课程分类',
......@@ -531,8 +528,8 @@ class AddCourse extends React.Component {
{record.categoryTwoName ? `-${record.categoryTwoName}` : ''}
</div>
)
},
},
}
}
]
return columns
}
......@@ -563,8 +560,8 @@ class AddCourse extends React.Component {
this.setState({
selectVideo: {
...selectVideo,
[videoCourseDivision]: _list,
},
[videoCourseDivision]: _list
}
})
}
......@@ -592,7 +589,7 @@ class AddCourse extends React.Component {
this.setState(
{
videoQuery,
videoSearchDefalt,
videoSearchDefalt
},
() => {
this.handleFetchVideoList()
......@@ -604,7 +601,7 @@ class AddCourse extends React.Component {
const { videoSearchDefalt, videoCourseDivision } = this.state
videoSearchDefalt[videoCourseDivision].courseName = e.target.value
this.setState({
videoSearchDefalt,
videoSearchDefalt
})
}
......@@ -614,7 +611,7 @@ class AddCourse extends React.Component {
liveQuery.current = 1
this.setState(
{
liveQuery,
liveQuery
},
() => {
this.handleFetchLiveList()
......@@ -628,7 +625,7 @@ class AddCourse extends React.Component {
pictureQuery.current = 1
this.setState(
{
pictureQuery,
pictureQuery
},
() => {
this.handleFetchPictureList()
......@@ -644,7 +641,7 @@ class AddCourse extends React.Component {
refIds: _.pluck(selectVideo.external, 'id'),
storeId: User.getStoreId(),
type: 'VOICE',
createId: User.getStoreUserId(),
createId: User.getStoreUserId()
})
}
if (selectVideo.internal.length) {
......@@ -653,7 +650,7 @@ class AddCourse extends React.Component {
refIds: _.pluck(selectVideo.internal, 'id'),
storeId: User.getStoreId(),
type: 'VOICE',
createId: User.getStoreUserId(),
createId: User.getStoreUserId()
})
}
if (selectLive.length) {
......@@ -662,7 +659,7 @@ class AddCourse extends React.Component {
refIds: _.pluck(selectLive, 'liveCourseId'),
storeId: User.getStoreId(),
type: 'LIVE',
createId: User.getStoreUserId(),
createId: User.getStoreUserId()
})
}
if (selectPicture.length) {
......@@ -671,7 +668,7 @@ class AddCourse extends React.Component {
refIds: _.pluck(selectPicture, 'id'),
storeId: User.getStoreId(),
type: 'PICTURE',
createId: User.getStoreUserId(),
createId: User.getStoreUserId()
})
}
......@@ -693,9 +690,9 @@ class AddCourse extends React.Component {
...videoSearchDefalt,
[e.target.value]: {
courseName: videoQuery[e.target.value].courseName,
categoryId: videoQuery[e.target.value].categoryId,
},
},
categoryId: videoQuery[e.target.value].categoryId
}
}
},
() => {
this.handleFetchVideoList()
......@@ -738,7 +735,7 @@ class AddCourse extends React.Component {
selectPicture,
videoSearchDefalt,
categoryList,
categoryListExternal,
categoryListExternal
} = this.state
const LiveSelection = {
......@@ -752,7 +749,7 @@ class AddCourse extends React.Component {
_list = _.reject(selectLive, (item) => _.find(changeRows, (data) => data.liveCourseId === item.liveCourseId))
}
this.setState({ selectLive: _list })
},
}
}
const VideoSelection = {
......@@ -768,10 +765,10 @@ class AddCourse extends React.Component {
this.setState({
selectVideo: {
...selectVideo,
[videoCourseDivision]: _list,
},
[videoCourseDivision]: _list
}
})
},
}
}
const PictureSelection = {
......@@ -785,7 +782,7 @@ class AddCourse extends React.Component {
_list = _.reject(selectPicture, (item) => _.find(changeRows, (data) => data.id === item.id))
}
this.setState({ selectPicture: _list })
},
}
}
return (
......@@ -829,10 +826,10 @@ class AddCourse extends React.Component {
this.setState({
selectVideo: {
internal: [],
external: [],
external: []
},
selectLive: [],
selectPicture: [],
selectPicture: []
})
}}
/>
......@@ -857,7 +854,7 @@ class AddCourse extends React.Component {
const _query = { ...liveQuery, current: page + 1 }
this.setState(
{
liveQuery: _query,
liveQuery: _query
},
() => {
this.handleFetchLiveList()
......@@ -896,6 +893,7 @@ class AddCourse extends React.Component {
<TreeSelect
treeNodeFilterProp='categoryName'
showSearch
value={videoQuery[videoCourseDivision].categoryId}
style={{ minWidth: 'calc(100% - 75px)' }}
dropdownMatchSelectWidth={false}
dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
......@@ -915,10 +913,10 @@ class AddCourse extends React.Component {
this.setState({
selectVideo: {
internal: [],
external: [],
external: []
},
selectLive: [],
selectPicture: [],
selectPicture: []
})
}}
/>
......@@ -947,8 +945,8 @@ class AddCourse extends React.Component {
{
videoQuery: {
...videoQuery,
[videoCourseDivision]: _query,
},
[videoCourseDivision]: _query
}
},
() => {
this.handleFetchVideoList()
......@@ -1000,10 +998,10 @@ class AddCourse extends React.Component {
this.setState({
selectVideo: {
internal: [],
external: [],
external: []
},
selectLive: [],
selectPicture: [],
selectPicture: []
})
}}
/>
......@@ -1028,7 +1026,7 @@ class AddCourse extends React.Component {
const _query = { ...pictureQuery, current: page + 1 }
this.setState(
{
pictureQuery: _query,
pictureQuery: _query
},
() => {
this.handleFetchPictureList()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment