Commit e0eafc54 by guomingpang

docs:线下课重命名线下活动,资源云盘变更为素材库

parent 64195835
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
/> />
<meta <meta
name="keywords" name="keywords"
content="小麦企学院,企业培训,员工培训,企业大学,企业内训,企业外训,培训计划,培训素材,企培,企训,资料云盘,培训课程,培训任务,直播课,线上课,图文课,线下课,知识库,作业,考试,排行榜,培训类别管理,定制培训计划,管理数据,学习数据,企学院,资料共享,培训数字化,数字化培训,培训工具,在线培训,线上培训,培训saas,培训管理,企业微信培训,对客培训,客户培训,直播培训,互联网培训,新员工培训,管理培训,管理者培训,工人培训,制造业培训,餐饮培训,服务业培训,零售培训,门店培训,工厂培训,车间培训,培训补贴,人事培训,财务培训,职场培训,企业学院平台,教育企业学院,教育企业平台,教育平台学院,企业学习,酷学院,小鹅通,企业学院,云学堂,时代光华,云课堂,魔学院,云大学,米知云,授课学堂" content="小麦企学院,企业培训,员工培训,企业大学,企业内训,企业外训,培训计划,培训素材,企培,企训,素材库,培训课程,培训任务,直播课,线上课,图文课,线下活动,知识库,作业,考试,排行榜,培训类别管理,定制培训计划,管理数据,学习数据,企学院,资料共享,培训数字化,数字化培训,培训工具,在线培训,线上培训,培训saas,培训管理,企业微信培训,对客培训,客户培训,直播培训,互联网培训,新员工培训,管理培训,管理者培训,工人培训,制造业培训,餐饮培训,服务业培训,零售培训,门店培训,工厂培训,车间培训,培训补贴,人事培训,财务培训,职场培训,企业学院平台,教育企业学院,教育企业平台,教育平台学院,企业学习,酷学院,小鹅通,企业学院,云学堂,时代光华,云课堂,魔学院,云大学,米知云,授课学堂"
/> />
<!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> --> <!-- <link rel="apple-touch-icon" href="../src/common/images/logo.png" /> -->
<link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" /> <link rel="shortcut icon" href="https://image.xiaomaiketang.com/xm/c4KiP2epBP.png" />
...@@ -62,6 +62,5 @@ ...@@ -62,6 +62,5 @@
To begin the development, run `npm start` or `yarn start`. To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
</body> </body>
</html> </html>
...@@ -101,12 +101,7 @@ class GraphicsCourseList extends React.Component { ...@@ -101,12 +101,7 @@ class GraphicsCourseList extends React.Component {
dataIndex: 'categoryName', dataIndex: 'categoryName',
width: 120, width: 120,
render: (val, record) => { render: (val, record) => {
return ( return <div className='record__item'>{record.categoryName}</div>
<div className='record__item'>
{record.categoryOneName}
{record.categoryTwoName ? `-${record.categoryTwoName}` : ''}
</div>
)
}, },
}, },
{ {
......
...@@ -6,66 +6,54 @@ ...@@ -6,66 +6,54 @@
* @LastEditTime: 2020-12-22 20:30:54 * @LastEditTime: 2020-12-22 20:30:54
*/ */
import React from 'react' import React from 'react'
import { Modal, Button, Table } from "antd"; import { Modal, Button, Table } from 'antd'
import "./AccountChargeModal"; import './AccountChargeModal'
const data = [ const data = [
{ person: "上台人数1v1", price: "3元/人/小时" }, { person: '上台人数1v1', price: '3元/人/小时' },
{ person: "上台人数1v2", price: "3元/人/小时" }, { person: '上台人数1v2', price: '3元/人/小时' },
{ person: "上台人数1v3", price: "3元/人/小时" }, { person: '上台人数1v3', price: '3元/人/小时' },
{ person: "上台人数1v4", price: "3元/人/小时" }, { person: '上台人数1v4', price: '3元/人/小时' },
{ person: "上台人数1v5", price: "3元/人/小时" }, { person: '上台人数1v5', price: '3元/人/小时' },
{ person: "上台人数1v6", price: "3元/人/小时" }, { person: '上台人数1v6', price: '3元/人/小时' },
{ person: "上台人数1v7", price: "4元/人/小时" }, { person: '上台人数1v7', price: '4元/人/小时' },
{ person: "上台人数1v8", price: "4元/人/小时" }, { person: '上台人数1v8', price: '4元/人/小时' },
{ person: "上台人数1v9", price: "8元/人/小时" }, { person: '上台人数1v9', price: '8元/人/小时' },
{ person: "上台人数1v10", price: "8元/人/小时" }, { person: '上台人数1v10', price: '8元/人/小时' },
{ person: "上台人数1v11", price: "8元/人/小时" }, { person: '上台人数1v11', price: '8元/人/小时' },
{ person: "上台人数1v12", price: "8元/人/小时" }, { person: '上台人数1v12', price: '8元/人/小时' },
]; ]
function ChargeExplainModal(props) { function ChargeExplainModal(props) {
return ( return (
<Modal <Modal
title="计费说明" title='计费说明'
visible={true} visible={true}
className="charge-explain-modal" className='charge-explain-modal'
width={880} width={880}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
onCancel={() => { onCancel={() => {
props.close(); props.close()
}} }}
footer={[ footer={[
<Button <Button
type="primary" type='primary'
onClick={() => { onClick={() => {
props.close(); props.close()
}} }}>
>
关闭 关闭
</Button>, </Button>,
]} ]}>
>
<div> <div>
<div className="explain-title">1)直播课时费</div> <div className='explain-title'>1)直播课时费</div>
<p className="main-explain-block"> <p className='main-explain-block'>每节课上课费用 = 上台人数单价 × 有效出勤学生和老师人数 × 排课时长</p>
每节课上课费用 = 上台人数单价 × 有效出勤学生和老师人数 × 排课时长
</p>
<ul> <ul>
<li> <li>1. 上课老师、学生和助教在教室中的累计时长满10分钟即为有效出勤;</li>
1. 上课老师、学生和助教在教室中的累计时长满10分钟即为有效出勤; <li>2. 排课时长指创建课节设置的课节时长,最小计费单位为0.5小时,不足0.5小时按0.5小时计算;</li>
</li> <li>3. 上台人数单价:以排课时设定的上台人数上限为准,不同直播教室类型的课时单价不同。</li>
<li>
2.
排课时长指创建课节设置的课节时长,最小计费单位为0.5小时,不足0.5小时按0.5小时计算;
</li>
<li>
3.
上台人数单价:以排课时设定的上台人数上限为准,不同直播教室类型的课时单价不同。
</li>
</ul> </ul>
<p className="main-explain-text" style={{marginTop: 16,marginBottom: 8}}> <p className='main-explain-text' style={{ marginTop: 16, marginBottom: 8 }}>
温馨提醒:上台人数1vN,1为授课老师,N为同时与老师视频互动学生数;直播课时费将在老师下课后立即结算。 温馨提醒:上台人数1vN,1为授课老师,N为同时与老师视频互动学生数;直播课时费将在老师下课后立即结算。
</p> </p>
<table style={{ width: 333 }}> <table style={{ width: 333 }}>
...@@ -82,47 +70,43 @@ function ChargeExplainModal(props) { ...@@ -82,47 +70,43 @@ function ChargeExplainModal(props) {
<td>{item.person}</td> <td>{item.person}</td>
<td>{item.price}</td> <td>{item.price}</td>
</tr> </tr>
); )
})} })}
</tbody> </tbody>
</table> </table>
<p className="main-explain-text"> <p className='main-explain-text'>
示例:王老师排了一节45分钟的课程,选择的直播教室类型为5人上台,安排了1位助教、12位学生。那么,排课时长45分钟记为1小时;全员累计在线时长≥10min,老师+助教+学生共计1+1+12=14人;课时单价3元/人/小时。所以,此节课的直播课时费=1x14x3=42元 示例:王老师排了一节45分钟的课程,选择的直播教室类型为5人上台,安排了1位助教、12位学生。那么,排课时长45分钟记为1小时;全员累计在线时长≥10min,老师+助教+学生共计1+1+12=14人;课时单价3元/人/小时。所以,此节课的直播课时费=1x14x3=42元
</p> </p>
<div className="explain-title mt16">2)录制费</div> <div className='explain-title mt16'>2)录制费</div>
<p className="main-explain-block">录制费 = 录课单价 × 回放视频时长</p> <p className='main-explain-block'>录制费 = 录课单价 × 回放视频时长</p>
<ul> <ul>
<li>1. 结算时间:从回放视频生成后立即结算</li> <li>1. 结算时间:从回放视频生成后立即结算</li>
<li> 2. 回放视频时长:0.5h起收,不足0.5h的按0.5h结算</li> <li> 2. 回放视频时长:0.5h起收,不足0.5h的按0.5h结算</li>
<li> 3. 单价:2元/小时</li> <li> 3. 单价:2元/小时</li>
</ul> </ul>
<p className="main-explain-text"> <p className='main-explain-text'>示例:生成了49分26秒的回放视频,不足1h按1h计算,总费用=1(h)*2元/h=2元</p>
示例:生成了49分26秒的回放视频,不足1h按1h计算,总费用=1(h)*2元/h=2元 <div className='explain-title mt16'>3)流量费</div>
</p> <p className='main-explain-block'>观看回放视频流量费 = 流量单价 × 回放流量</p>
<div className="explain-title mt16">3)流量费</div> <p className='main-explain-text'>
<p className="main-explain-block">
观看回放视频流量费 = 流量单价 × 回放流量
</p>
<p className="main-explain-text">
目前收费报价:0元(限时免费) 目前收费报价:0元(限时免费)
<br /> 若后续变更收费,将提前30日通告收费方式及价格标准 <br /> 若后续变更收费,将提前30日通告收费方式及价格标准
</p> </p>
<div className="explain-title mt16">4)存储费</div> <div className='explain-title mt16'>4)存储费</div>
<p className="main-explain-block">存储实际扣费 = 存储单价 × 存储文件大小</p> <p className='main-explain-block'>存储实际扣费 = 存储单价 × 存储文件大小</p>
<p className="main-explain-text"> <p className='main-explain-text'>
目前收费报价:0元(限时免费) 目前收费报价:0元(限时免费)
<br /> <br />
若后续变更收费,将提前30日通告收费方式及价格标准 若后续变更收费,将提前30日通告收费方式及价格标准
</p> </p>
<div className="explain-title mt16">5)其他说明</div> <div className='explain-title mt16'>5)其他说明</div>
<div className="main-explain-text"> <div className='main-explain-text'>
余额不足时将限制使用创建直播课、老师和学生进入直播间、老师和学生观看回放视频、在资料云盘或直播间上传文件等功能,请注意及时充值。(余额<300元时将发送短信提醒,请注意查看。) 余额不足时将限制使用创建直播课、老师和学生进入直播间、老师和学生观看回放视频、在素材库或直播间上传文件等功能,请注意及时充值。(余额<300元时将发送短信提醒,请注意查看。)
</div> </div>
</div> </div>
</Modal> </Modal>
); )
} }
export default ChargeExplainModal; export default ChargeExplainModal
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* @Date: 2020-08-05 10:07:47 * @Date: 2020-08-05 10:07:47
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-07-22 18:29:55 * @LastEditTime: 2021-07-22 18:29:55
* @Description: 线下新增/编辑页 * @Description: 线下活动新增/编辑页
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -44,14 +44,14 @@ class AddOfflineCourse extends React.Component { ...@@ -44,14 +44,14 @@ class AddOfflineCourse extends React.Component {
const pageType = window.getParameterByName('type') const pageType = window.getParameterByName('type')
this.state = { this.state = {
courseId, // 线下ID,编辑的时候从URL上带过来 courseId, // 线下活动ID,编辑的时候从URL上带过来
pageType, // 页面类型: add->新建 edit->编辑 pageType, // 页面类型: add->新建 edit->编辑
imageFile: null, // 需要被截取的图片 imageFile: null, // 需要被截取的图片
courseName: null, // 线下名称 courseName: null, // 线下活动名称
courseMedia: '', courseMedia: '',
introduce: '', introduce: '',
coverId: null, // 线下封面的recourceId coverId: null, // 线下封面的recourceId
coverUrl: defaultCoverUrl, // 线下封面 coverUrl: defaultCoverUrl, // 线下活动封面
studentList: [], // 上课学员列表 studentList: [], // 上课学员列表
diskList: [], // 机构可见磁盘目录 diskList: [], // 机构可见磁盘目录
selectedFileList: [], // 已经从资料云盘中勾选的文件 selectedFileList: [], // 已经从资料云盘中勾选的文件
...@@ -149,7 +149,7 @@ class AddOfflineCourse extends React.Component { ...@@ -149,7 +149,7 @@ class AddOfflineCourse extends React.Component {
}) })
} }
// 获取线下详情 // 获取线下活动详情
handleFetchScheudleDetail = (courseId) => { handleFetchScheudleDetail = (courseId) => {
return Service.Hades('public/hades/getOfflineCourseDetail', { return Service.Hades('public/hades/getOfflineCourseDetail', {
courseId, courseId,
...@@ -707,7 +707,7 @@ class AddOfflineCourse extends React.Component { ...@@ -707,7 +707,7 @@ class AddOfflineCourse extends React.Component {
const isDefaultCover = coverUrl === defaultCoverUrl const isDefaultCover = coverUrl === defaultCoverUrl
return ( return (
<div className='page add-offline-course-page'> <div className='page add-offline-course-page'>
<Breadcrumbs navList={pageType === 'add' ? '新建线下课' : '编辑线下课'} goBack={this.handleGoBack} /> <Breadcrumbs navList={pageType === 'add' ? '新建线下活动' : '编辑线下活动'} goBack={this.handleGoBack} />
<div className='box'> <div className='box'>
<div className='show-tips'> <div className='show-tips'>
...@@ -723,7 +723,7 @@ class AddOfflineCourse extends React.Component { ...@@ -723,7 +723,7 @@ class AddOfflineCourse extends React.Component {
</span> </span>
<Input <Input
value={courseName} value={courseName}
placeholder='请输入线下的名称(40字以内)' placeholder='请输入线下活动的名称(40字以内)'
maxLength={40} maxLength={40}
style={{ width: 240 }} style={{ width: 240 }}
onChange={(e) => { onChange={(e) => {
...@@ -1075,7 +1075,7 @@ class AddOfflineCourse extends React.Component { ...@@ -1075,7 +1075,7 @@ class AddOfflineCourse extends React.Component {
<div className='content'> <div className='content'>
<Switch checked={whetherVisitorsJoin === 'NO' ? true : false} onChange={this.whetherVisitorsJoinChange} /> <Switch checked={whetherVisitorsJoin === 'NO' ? true : false} onChange={this.whetherVisitorsJoinChange} />
<div className='desc'> <div className='desc'>
{whetherVisitorsJoin === 'NO' ? '已开启,仅限绑定了手机号的学员报名线下课' : '已关闭,允许未绑定手机号的学员报名线下课'} {whetherVisitorsJoin === 'NO' ? '已开启,仅限绑定了手机号的学员报名线下活动' : '已关闭,允许未绑定手机号的学员报名线下活动'}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -136,10 +136,10 @@ class OfflineCourseFilter extends React.Component { ...@@ -136,10 +136,10 @@ class OfflineCourseFilter extends React.Component {
<Row type='flex' justify='space-between' align='top'> <Row type='flex' justify='space-between' align='top'>
<div className='search-condition'> <div className='search-condition'>
<div className='search-condition__item'> <div className='search-condition__item'>
<span className='search-name'>线下名称:</span> <span className='search-name'>线下活动名称:</span>
<Search <Search
value={courseName} value={courseName}
placeholder='搜索线下名称' placeholder='搜索线下活动名称'
onChange={(e) => { onChange={(e) => {
this.handleChangeQuery('courseName', e.target.value) this.handleChangeQuery('courseName', e.target.value)
}} }}
......
...@@ -6,77 +6,77 @@ ...@@ -6,77 +6,77 @@
* @Description: 线上课-列表模块 * @Description: 线上课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import Service from '@/common/js/service'; import Service from '@/common/js/service'
import User from '@/common/js/user'; import User from '@/common/js/user'
import college from '@/common/lottie/college'; import college from '@/common/lottie/college'
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components'
import { LIVE_SHARE } from '@/domains/course-domain/constants'; import { LIVE_SHARE } from '@/domains/course-domain/constants'
import CourseService from '@/domains/course-domain/CourseService'; import CourseService from '@/domains/course-domain/CourseService'
import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal'; import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal'
import OfflineCourseData from '@/modules/course-manage/offline-course/OfflineCourseData'; import OfflineCourseData from '@/modules/course-manage/offline-course/OfflineCourseData'
import { Dropdown, message, Modal, Switch, Tooltip } from 'antd'; import { Dropdown, message, Modal, Switch, Tooltip } from 'antd'
import moment from 'moment'; import moment from 'moment'
import React from 'react'; import React from 'react'
import { find, reduce, last } from 'underscore'; import { find, reduce, last } from 'underscore'
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom'
import ENUM from '../../../knowledge-base/ENUM.js'; import ENUM from '../../../knowledge-base/ENUM.js'
import PreviewOfflineModal from '../modal/PreviewOfflineModal'; import PreviewOfflineModal from '../modal/PreviewOfflineModal'
import QRCodeModal from '../modal/QRCodeModal'; import QRCodeModal from '../modal/QRCodeModal'
import './OfflineCourseList.less'; import './OfflineCourseList.less'
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png'
class OfflineCourseList extends React.Component { class OfflineCourseList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
id: '', // 线上课ID id: '', // 线上课ID
studentIds: [], studentIds: [],
}; }
} }
componentDidMount() { componentDidMount() {
const videoCourseItem = localStorage.getItem('videoCourseItem'); const videoCourseItem = localStorage.getItem('videoCourseItem')
if (videoCourseItem) { if (videoCourseItem) {
const _videoCourseItem = JSON.parse(videoCourseItem); const _videoCourseItem = JSON.parse(videoCourseItem)
this.handleShowShareModal(_videoCourseItem, true); this.handleShowShareModal(_videoCourseItem, true)
} }
} }
handlePlanName = (planArray) => { handlePlanName = (planArray) => {
let planStr = ''; let planStr = ''
planArray.forEach((item, index) => { planArray.forEach((item, index) => {
if (index < planArray.length - 1) { if (index < planArray.length - 1) {
planStr = planStr + item.planName + '、'; planStr = planStr + item.planName + '、'
} else { } else {
planStr = planStr + item.planName; planStr = planStr + item.planName
}
})
return planStr
} }
});
return planStr;
};
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
const columns = [ const columns = [
{ {
title: '线下', title: '线下活动',
key: 'scheduleName', key: 'scheduleName',
dataIndex: 'scheduleName', dataIndex: 'scheduleName',
width: 321, width: 321,
fixed: 'left', fixed: 'left',
render: (val, record) => { render: (val, record) => {
const { courseMediaVOS, courseName, offlinePlace, calendarTime, startTime, endTime } = record; const { courseMediaVOS, courseName, offlinePlace, calendarTime, startTime, endTime } = record
const coverUrl = (find(courseMediaVOS, (data) => data.contentType === 'COVER') || {}).mediaUrl; const coverUrl = (find(courseMediaVOS, (data) => data.contentType === 'COVER') || {}).mediaUrl
let isContinue = calendarTime.length > 1; let isContinue = calendarTime.length > 1
reduce(calendarTime, (a, b) => { reduce(calendarTime, (a, b) => {
isContinue = isContinue && b - a === 86400000; isContinue = isContinue && b - a === 86400000
return b; return b
}); })
const lastTime = last(calendarTime); const lastTime = last(calendarTime)
const time = `${ const time = `${
!isContinue !isContinue
? calendarTime.map((item) => moment(item).format('MM-DD')).join('、') ? calendarTime.map((item) => moment(item).format('MM-DD')).join('、')
: `${moment(calendarTime[0]).format('MM-DD')}~${moment(lastTime).format('MM-DD')}` : `${moment(calendarTime[0]).format('MM-DD')}~${moment(lastTime).format('MM-DD')}`
} ${moment(startTime).format('HH:mm')} ~ ${moment(endTime).format('HH:mm')}`; } ${moment(startTime).format('HH:mm')} ~ ${moment(endTime).format('HH:mm')}`
return ( return (
<div className='record__item'> <div className='record__item'>
<img className='course-cover' src={coverUrl || defaultCoverUrl} alt='' /> <img className='course-cover' src={coverUrl || defaultCoverUrl} alt='' />
...@@ -92,7 +92,7 @@ class OfflineCourseList extends React.Component { ...@@ -92,7 +92,7 @@ class OfflineCourseList extends React.Component {
</Tooltip> </Tooltip>
</div> </div>
</div> </div>
); )
}, },
}, },
{ {
...@@ -106,7 +106,7 @@ class OfflineCourseList extends React.Component { ...@@ -106,7 +106,7 @@ class OfflineCourseList extends React.Component {
<div style={{ width: 6, height: 6, borderRadius: '50%', background: ENUM.offlineStateShow[val].color, marginRight: 8 }}></div> <div style={{ width: 6, height: 6, borderRadius: '50%', background: ENUM.offlineStateShow[val].color, marginRight: 8 }}></div>
{ENUM.offlineStateShow[val].title} {ENUM.offlineStateShow[val].title}
</div> </div>
); )
}, },
}, },
{ {
...@@ -115,7 +115,7 @@ class OfflineCourseList extends React.Component { ...@@ -115,7 +115,7 @@ class OfflineCourseList extends React.Component {
dataIndex: 'categoryName', dataIndex: 'categoryName',
width: 120, width: 120,
render: (val, record) => { render: (val, record) => {
return <div className='record__item'>{record.categorySonName}</div>; return <div className='record__item'>{record.categoryName}</div>
}, },
}, },
{ {
...@@ -141,7 +141,7 @@ class OfflineCourseList extends React.Component { ...@@ -141,7 +141,7 @@ class OfflineCourseList extends React.Component {
render: (val, item, index) => { render: (val, item, index) => {
return ( return (
<Switch size='small' disabled={item.courseState === 'EXPIRED'} checked={item.shelfState === 'YES'} onChange={() => this.changeShelfState(item)} /> <Switch size='small' disabled={item.courseState === 'EXPIRED'} checked={item.shelfState === 'YES'} onChange={() => this.changeShelfState(item)} />
); )
}, },
}, },
{ {
...@@ -150,7 +150,7 @@ class OfflineCourseList extends React.Component { ...@@ -150,7 +150,7 @@ class OfflineCourseList extends React.Component {
key: 'teacher', key: 'teacher',
dataIndex: 'teacher', dataIndex: 'teacher',
render: (val, item) => { render: (val, item) => {
return <div>{item.teacherName}</div>; return <div>{item.teacherName}</div>
}, },
}, },
{ {
...@@ -178,7 +178,7 @@ class OfflineCourseList extends React.Component { ...@@ -178,7 +178,7 @@ class OfflineCourseList extends React.Component {
</span> </span>
)} )}
</div> </div>
); )
}, },
}, },
{ {
...@@ -188,7 +188,7 @@ class OfflineCourseList extends React.Component { ...@@ -188,7 +188,7 @@ class OfflineCourseList extends React.Component {
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>; return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>
}, },
}, },
{ {
...@@ -219,12 +219,12 @@ class OfflineCourseList extends React.Component { ...@@ -219,12 +219,12 @@ class OfflineCourseList extends React.Component {
</span> </span>
</Dropdown> </Dropdown>
</div> </div>
); )
}, },
}, },
]; ]
return columns; return columns
}; }
// 显示预览弹窗 // 显示预览弹窗
handleShowPreviewModal = (courseId) => { handleShowPreviewModal = (courseId) => {
...@@ -234,12 +234,12 @@ class OfflineCourseList extends React.Component { ...@@ -234,12 +234,12 @@ class OfflineCourseList extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
previewOfflineModal: null, previewOfflineModal: null,
}); })
}} }}
/> />
); )
this.setState({ previewOfflineModal }); this.setState({ previewOfflineModal })
}; }
renderMoreOperate = (item) => { renderMoreOperate = (item) => {
return ( return (
...@@ -249,7 +249,7 @@ class OfflineCourseList extends React.Component { ...@@ -249,7 +249,7 @@ class OfflineCourseList extends React.Component {
className='operate__item' className='operate__item'
key='qrcode' key='qrcode'
onClick={() => { onClick={() => {
this.setState({ openQRCodeModal: true, qrcodeData: item }); this.setState({ openQRCodeModal: true, qrcodeData: item })
}}> }}>
考勤二维码 考勤二维码
</div> </div>
...@@ -258,7 +258,7 @@ class OfflineCourseList extends React.Component { ...@@ -258,7 +258,7 @@ class OfflineCourseList extends React.Component {
className='operate__item' className='operate__item'
key='preview' key='preview'
onClick={() => { onClick={() => {
this.handleShowPreviewModal(item.courseId); this.handleShowPreviewModal(item.courseId)
}}> }}>
预览 预览
</div> </div>
...@@ -268,7 +268,7 @@ class OfflineCourseList extends React.Component { ...@@ -268,7 +268,7 @@ class OfflineCourseList extends React.Component {
className='operate__item' className='operate__item'
key='cancel' key='cancel'
onClick={() => { onClick={() => {
this.handleDeleteOfflineCourse(item.courseId); this.handleDeleteOfflineCourse(item.courseId)
}}> }}>
取消课程 取消课程
</div> </div>
...@@ -278,7 +278,7 @@ class OfflineCourseList extends React.Component { ...@@ -278,7 +278,7 @@ class OfflineCourseList extends React.Component {
className='operate__item' className='operate__item'
key='edit' key='edit'
onClick={() => { onClick={() => {
RCHistory.push(`/create-offline-course?type=edit&id=${item.courseId}`); RCHistory.push(`/create-offline-course?type=edit&id=${item.courseId}`)
}}> }}>
编辑 编辑
</div> </div>
...@@ -289,37 +289,37 @@ class OfflineCourseList extends React.Component { ...@@ -289,37 +289,37 @@ class OfflineCourseList extends React.Component {
</div> </div>
)} )}
</div> </div>
); )
}; }
//改变上架状态 //改变上架状态
changeShelfState = (item) => { changeShelfState = (item) => {
if (!window.ctx.xmState.storeUserPermissionList.includes('EditOfflineClass')) { if (!window.ctx.xmState.storeUserPermissionList.includes('EditOfflineClass')) {
message.warning('无【编辑线下课】权限,请联系管理员'); message.warning('无【编辑线下活动】权限,请联系管理员')
return; return
} }
let _shelfState = item.shelfState; let _shelfState = item.shelfState
if (_shelfState === 'NO') { if (_shelfState === 'NO') {
_shelfState = 'YES'; _shelfState = 'YES'
item.shelfState = 'YES'; item.shelfState = 'YES'
} else { } else {
_shelfState = 'NO'; _shelfState = 'NO'
item.shelfState = 'NO'; item.shelfState = 'NO'
} }
const params = { const params = {
courseId: item.courseId, courseId: item.courseId,
shelfState: _shelfState, shelfState: _shelfState,
}; }
CourseService.changeVideoShelfState(params).then((res) => { CourseService.changeVideoShelfState(params).then((res) => {
if (res.success) { if (res.success) {
if (_shelfState === 'YES') { if (_shelfState === 'YES') {
message.success('已开启展示'); message.success('已开启展示')
} else { } else {
message.success('已取消展示'); message.success('已取消展示')
}
this.props.onChange()
} }
this.props.onChange(); })
} }
});
};
// 删除视频课 // 删除视频课
handleDeleteOfflineCourse = (courseId, isDelete) => { handleDeleteOfflineCourse = (courseId, isDelete) => {
if (isDelete) { if (isDelete) {
...@@ -333,13 +333,13 @@ class OfflineCourseList extends React.Component { ...@@ -333,13 +333,13 @@ class OfflineCourseList extends React.Component {
onOk: () => { onOk: () => {
const param = { const param = {
courseId: courseId, courseId: courseId,
}; }
Service.Hades('public/hades/delOfflineCourse', param).then(() => { Service.Hades('public/hades/delOfflineCourse', param).then(() => {
message.success('删除成功'); message.success('删除成功')
this.props.onChange(); this.props.onChange()
}); })
}, },
}); })
} else { } else {
Modal.confirm({ Modal.confirm({
title: '取消课程', title: '取消课程',
...@@ -350,82 +350,82 @@ class OfflineCourseList extends React.Component { ...@@ -350,82 +350,82 @@ class OfflineCourseList extends React.Component {
onOk: () => { onOk: () => {
const param = { const param = {
courseId: courseId, courseId: courseId,
}; }
Service.Hades('public/hades/cancelOfflineCourse', param).then(() => { Service.Hades('public/hades/cancelOfflineCourse', param).then(() => {
message.success('取消成功'); message.success('取消成功')
this.props.onChange(); this.props.onChange()
}); })
}, },
}); })
}
} }
};
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
const { courseId } = record; const { courseId } = record
const htmlUrl = `${LIVE_SHARE}offline_detail/${courseId}?id=${User.getStoreId()}`; const htmlUrl = `${LIVE_SHARE}offline_detail/${courseId}?id=${User.getStoreId()}`
const longUrl = htmlUrl; const longUrl = htmlUrl
const { courseName, courseMediaVOS } = record; const { courseName, courseMediaVOS } = record
const coverUrl = (_.find(courseMediaVOS, (data) => data.contentType === 'COVER') || {}).mediaUrl; const coverUrl = (_.find(courseMediaVOS, (data) => data.contentType === 'COVER') || {}).mediaUrl
const shareData = { const shareData = {
longUrl, longUrl,
coverUrl, coverUrl,
courseName, courseName,
}; }
const shareLiveModal = ( const shareLiveModal = (
<ShareLiveModal <ShareLiveModal
needStr={needStr} needStr={needStr}
data={shareData} data={shareData}
type='offlineClass' type='offlineClass'
title='线下' title='线下活动'
close={() => { close={() => {
this.setState({ this.setState({
shareLiveModal: null, shareLiveModal: null,
}); })
localStorage.setItem('videoCourseItem', ''); localStorage.setItem('videoCourseItem', '')
}} }}
/> />
); )
this.setState({ shareLiveModal }); this.setState({ shareLiveModal })
}; }
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter
const { query } = this.props; const { query } = this.props
let _columnKey; let _columnKey
let _order; let _order
// 按创建时间升序排序 // 按创建时间升序排序
if (columnKey === 'apply' && order === 'ascend') { if (columnKey === 'apply' && order === 'ascend') {
_columnKey = 'START_APPLY_DESC'; _columnKey = 'START_APPLY_DESC'
_order = 'SORT_ASC'; _order = 'SORT_ASC'
} }
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
_columnKey = 'CREATED'; _columnKey = 'CREATED'
_order = 'SORT_ASC'; _order = 'SORT_ASC'
} }
// 按创建时间降序排序 // 按创建时间降序排序
if (columnKey === 'apply' && order === 'descend') { if (columnKey === 'apply' && order === 'descend') {
_columnKey = 'START_APPLY_DESC'; _columnKey = 'START_APPLY_DESC'
_order = 'SORT_DESC'; _order = 'SORT_DESC'
} }
if (columnKey === 'created' && order === 'descend') { if (columnKey === 'created' && order === 'descend') {
_columnKey = 'CREATED'; _columnKey = 'CREATED'
_order = 'SORT_DESC'; _order = 'SORT_DESC'
} }
const _query = { const _query = {
...query, ...query,
sortMap: {}, sortMap: {},
}; }
_query.sortMap[_columnKey] = _order; _query.sortMap[_columnKey] = _order
this.props.onChange(_query); this.props.onChange(_query)
}; }
render() { render() {
const { openQRCodeModal, qrcodeData } = this.state; const { openQRCodeModal, qrcodeData } = this.state
const { dataSource = [], totalCount, query, match } = this.props; const { dataSource = [], totalCount, query, match } = this.props
const { current, size } = query; const { current, size } = query
return ( return (
<div className='offline-course-list'> <div className='offline-course-list'>
<XMTable <XMTable
...@@ -449,8 +449,8 @@ class OfflineCourseList extends React.Component { ...@@ -449,8 +449,8 @@ class OfflineCourseList extends React.Component {
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
toPage={(page) => { toPage={(page) => {
const _query = { ...query, current: page + 1 }; const _query = { ...query, current: page + 1 }
this.props.onChange(_query); this.props.onChange(_query)
}} }}
/> />
</div> </div>
...@@ -460,13 +460,13 @@ class OfflineCourseList extends React.Component { ...@@ -460,13 +460,13 @@ class OfflineCourseList extends React.Component {
visible={openQRCodeModal} visible={openQRCodeModal}
data={qrcodeData} data={qrcodeData}
onCancel={() => { onCancel={() => {
this.setState({ openQRCodeModal: false }); this.setState({ openQRCodeModal: false })
}} }}
/> />
<Route path={`${match.url}/data`} component={OfflineCourseData} /> <Route path={`${match.url}/data`} component={OfflineCourseData} />
</div> </div>
); )
} }
} }
export default withRouter(OfflineCourseList); export default withRouter(OfflineCourseList)
...@@ -7,22 +7,22 @@ ...@@ -7,22 +7,22 @@
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import React from 'react'; import React from 'react'
import { Button } from 'antd'; import { Button } from 'antd'
import './OfflineCourseOpt.less'; import './OfflineCourseOpt.less'
export default function OfflineCourseOpt() { export default function OfflineCourseOpt() {
return ( return (
<div className="video-course-opt"> <div className='video-course-opt'>
<Button <Button
type="primary" type='primary'
onClick={() => { onClick={() => {
RCHistory.push('/create-offline-course?type=add'); RCHistory.push('/create-offline-course?type=add')
}} }}
className="mr12" className='mr12'>
>新建线下课</Button> 新建线下活动
</Button>
</div> </div>
); )
} }
import React from 'react'; import React from 'react'
import OfflineCourseFilter from './components/OfflineCourseFilter'; import OfflineCourseFilter from './components/OfflineCourseFilter'
import OfflineCourseOpt from './components/OfflineCourseOpt'; import OfflineCourseOpt from './components/OfflineCourseOpt'
import OfflineCourseList from './components/OfflineCourseList'; import OfflineCourseList from './components/OfflineCourseList'
import Service from '@/common/js/service'; import Service from '@/common/js/service'
import User from '@/common/js/user' import User from '@/common/js/user'
class OfflineCoursePage extends React.Component { class OfflineCoursePage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
query: { query: {
size: 10, size: 10,
current: 1, current: 1,
storeId:User.getStoreId() storeId: User.getStoreId(),
}, },
dataSource: [], // 线下课列表 dataSource: [], // 线下课列表
totalCount: 0, // 线下课数据总条数 totalCount: 0, // 线下课数据总条数
...@@ -23,54 +22,47 @@ class OfflineCoursePage extends React.Component { ...@@ -23,54 +22,47 @@ class OfflineCoursePage extends React.Component {
componentWillMount() { componentWillMount() {
// 获取线下课列表 // 获取线下课列表
this.handleFetchScheduleList(); this.handleFetchScheduleList()
} }
// 获取线下课列表 // 获取线下课列表
handleFetchScheduleList = (_query = {}) => { handleFetchScheduleList = (_query = {}) => {
const query = { const query = {
...this.state.query, ...this.state.query,
..._query ..._query,
}; }
// 更新请求参数 // 更新请求参数
this.setState({ query }); this.setState({ query })
Service.Hades('public/hades/getOfflineCoursePage', query).then((res) => { Service.Hades('public/hades/getOfflineCoursePage', query).then((res) => {
const { result = {} } = res || {}; const { result = {} } = res || {}
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result
this.setState({ this.setState({
dataSource: records, dataSource: records,
totalCount: Number(total) totalCount: Number(total),
}); })
}) })
} }
render() { render() {
const { dataSource, totalCount, query } = this.state; const { dataSource, totalCount, query } = this.state
return ( return (
<div className="page video-course-page"> <div className='page video-course-page'>
<div className="content-header">线下课</div> <div className='content-header'>线下活动</div>
<div className="box"> <div className='box'>
{/* 搜索模块 */} {/* 搜索模块 */}
<OfflineCourseFilter <OfflineCourseFilter onChange={this.handleFetchScheduleList} />
onChange={this.handleFetchScheduleList}
/>
{/* 操作模块 */} {/* 操作模块 */}
{window.ctx.xmState.storeUserPermissionList.includes('AddOfflineClass') && <OfflineCourseOpt />} {window.ctx.xmState.storeUserPermissionList.includes('AddOfflineClass') && <OfflineCourseOpt />}
{/* 线下课列表模块 */} {/* 线下课列表模块 */}
<OfflineCourseList <OfflineCourseList query={query} dataSource={dataSource} totalCount={totalCount} onChange={this.handleFetchScheduleList} />
query={query}
dataSource={dataSource}
totalCount={totalCount}
onChange={this.handleFetchScheduleList}
/>
</div> </div>
</div> </div>
) )
} }
} }
export default OfflineCoursePage; export default OfflineCoursePage
import React from 'react'; import React from 'react'
import { Modal } from 'antd'; import { Modal } from 'antd'
import moment from 'moment'; import moment from 'moment'
import $ from 'jquery'; import $ from 'jquery'
import Service from "@/common/js/service"; import Service from '@/common/js/service'
import './PreviewOfflineModal.less'; import './PreviewOfflineModal.less'
import ENUM from '@/modules/knowledge-base/ENUM'; import ENUM from '@/modules/knowledge-base/ENUM'
const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png'; const defaultCoverUrl = 'https://image.xiaomaiketang.com/xm/pxbWKsYA87.png'
class PreviewOfflineModal extends React.Component { class PreviewOfflineModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {}
}
} }
componentDidMount() { componentDidMount() {
const { data } = this.props; const { data } = this.props
_.isEmpty(data) ? this.getCourseDetail() : this.setState({ ...data }); _.isEmpty(data) ? this.getCourseDetail() : this.setState({ ...data })
} }
getCourseDetail = () => { getCourseDetail = () => {
...@@ -26,20 +24,20 @@ class PreviewOfflineModal extends React.Component { ...@@ -26,20 +24,20 @@ class PreviewOfflineModal extends React.Component {
courseId: this.props.courseId, courseId: this.props.courseId,
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
const { result } = res; const { result } = res
let coverUrl = ''; let coverUrl = ''
result.courseMediaVOS.map((item) => { result.courseMediaVOS.map((item) => {
switch (item.contentType){ switch (item.contentType) {
case "COVER": case 'COVER':
coverUrl = item.mediaUrl; coverUrl = item.mediaUrl
break; break
case "INTRO": case 'INTRO':
this.getTextDetail('introduce', item.mediaUrl); this.getTextDetail('introduce', item.mediaUrl)
break; break
default: default:
break; break
} }
return item; return item
}) })
this.setState({ this.setState({
...result, ...result,
...@@ -54,10 +52,10 @@ class PreviewOfflineModal extends React.Component { ...@@ -54,10 +52,10 @@ class PreviewOfflineModal extends React.Component {
data: {}, data: {},
type: 'GET', type: 'GET',
url, url,
contentType:'application/x-www-form-urlencoded; charset=UTF-8', contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
success: (res) => { success: (res) => {
this.setState({ [key]: res, [`load${key}`]: true }); this.setState({ [key]: res, [`load${key}`]: true })
} },
}) })
} }
...@@ -85,79 +83,82 @@ class PreviewOfflineModal extends React.Component { ...@@ -85,79 +83,82 @@ class PreviewOfflineModal extends React.Component {
signOutStartTimeUnit, signOutStartTimeUnit,
signOutEndTimeNum, signOutEndTimeNum,
signOutEndTimeUnit, signOutEndTimeUnit,
} = this.state; } = this.state
const unit = (signInTimeUnit || '').toLocaleLowerCase() + 's'; const unit = (signInTimeUnit || '').toLocaleLowerCase() + 's'
const time = (signInType === 'START_AGO' ? startTime : endTime) && moment(signInType === 'START_AGO' ? startTime : endTime).subtract(signInTimeNum, unit); const time = (signInType === 'START_AGO' ? startTime : endTime) && moment(signInType === 'START_AGO' ? startTime : endTime).subtract(signInTimeNum, unit)
const signInTime = (time && signInTimeNum) && `${moment(time).format('HH:mm')} ~ ${moment(signInType === 'START_AGO' ? startTime : endTime).format('HH:mm')}`; const signInTime = time && signInTimeNum && `${moment(time).format('HH:mm')} ~ ${moment(signInType === 'START_AGO' ? startTime : endTime).format('HH:mm')}`
const endUnit = (signOutEndTimeUnit || '').toLocaleLowerCase() + 's'; const endUnit = (signOutEndTimeUnit || '').toLocaleLowerCase() + 's'
const end = (endTime && signOutEndTimeNum) && moment(endTime).add(signOutEndTimeNum, endUnit); const end = endTime && signOutEndTimeNum && moment(endTime).add(signOutEndTimeNum, endUnit)
let startUnit = ''; let startUnit = ''
let start = ''; let start = ''
if (signOutType === 'START_LATER') { if (signOutType === 'START_LATER') {
startUnit = (signOutStartTimeUnit || '').toLocaleLowerCase() + 's'; startUnit = (signOutStartTimeUnit || '').toLocaleLowerCase() + 's'
start = (startTime && signOutStartTimeNum) && moment(startTime).add(signOutStartTimeNum, startUnit); start = startTime && signOutStartTimeNum && moment(startTime).add(signOutStartTimeNum, startUnit)
} }
console.log(start, end, startTime, endTime, 666666) console.log(start, end, startTime, endTime, 666666)
const signOutTime = (start || end) && (signOutType === 'START_LATER' ? `${moment(start).format('HH:mm')} ~ ${moment(end).format('HH:mm')}` : `${moment(endTime).format('HH:mm')} ~ ${moment(end).format('HH:mm')}`); const signOutTime =
(start || end) &&
(signOutType === 'START_LATER'
? `${moment(start).format('HH:mm')} ~ ${moment(end).format('HH:mm')}`
: `${moment(endTime).format('HH:mm')} ~ ${moment(end).format('HH:mm')}`)
return ( return (
<Modal <Modal
title="预览" title='预览'
visible={true} visible={true}
width={680} width={680}
onCancel={this.props.close} onCancel={this.props.close}
footer={null} footer={null}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
className="preview-offline-modal" className='preview-offline-modal'>
> <div className='container__wrap'>
<div className="container__wrap"> <div className='container'>
<div className="container"> <div className='container__header'>
<div className="container__header"> <div className='cover'></div>
<div className="cover"></div> <img src={coverUrl || defaultCoverUrl} className='course-cover' />
<img src={coverUrl || defaultCoverUrl} className="course-cover" /> <span className='cover-teacher'>主讲人:{teacherName}</span>
<span className="cover-teacher">主讲人:{teacherName}</span> <span className='cover-state' style={{ background: (ENUM.offlineStateShow[courseState] || {}).color }}>
<span className="cover-state" style={{ background: (ENUM.offlineStateShow[courseState] || {}).color }}>{(ENUM.offlineStateShow[courseState] || {}).title}</span> {(ENUM.offlineStateShow[courseState] || {}).title}
</span>
</div> </div>
<div className="container__body"> <div className='container__body'>
<div className="title__name">{courseName}</div> <div className='title__name'>{courseName}</div>
<div className="title__categery"> <div className='title__categery'>
<img className="item-icon" src="https://image.xiaomaiketang.com/xm/cDMwz3jzaX.png" /> <img className='item-icon' src='https://image.xiaomaiketang.com/xm/cDMwz3jzaX.png' />
课程分类:{categoryName} 课程分类:{categoryName}
</div> </div>
<div className="title__categery"> <div className='title__categery'>
<img className="item-icon" src="https://image.xiaomaiketang.com/xm/BfTBK3dGda.png" /> <img className='item-icon' src='https://image.xiaomaiketang.com/xm/BfTBK3dGda.png' />
上课时间:{startTime ? moment(startTime).format('HH:mm') : ''}~{endTime ? moment(endTime).format('HH:mm') : ''} 上课时间:{startTime ? moment(startTime).format('HH:mm') : ''}~{endTime ? moment(endTime).format('HH:mm') : ''}
</div> </div>
<div className="title__categery"> <div className='title__categery'>
<img className="item-icon" src="https://image.xiaomaiketang.com/xm/KhFNBTtAKR.png" /> <img className='item-icon' src='https://image.xiaomaiketang.com/xm/KhFNBTtAKR.png' />
上课地点:{offlinePlace} 上课地点:{offlinePlace}
</div> </div>
</div> </div>
<div className="container__introduction"> <div className='container__introduction'>
<div className="title">线下课简介</div> <div className='title'>线下活动简介</div>
<div className="container__introduction__list editor-box"> <div className='container__introduction__list editor-box'>
{whetherSetApply === 'YES' && <div className="course-time"> {whetherSetApply === 'YES' && (
<div className="time-title">报名时间</div> <div className='course-time'>
<div className="time-text">{startTimeApply && moment(startTimeApply).format('MM-DD HH:mm')} ~ {endTimeApply && moment(endTimeApply).format('MM-DD HH:mm')}</div> <div className='time-title'>报名时间</div>
</div>} <div className='time-text'>
{(whetherSetSignIn === 'YES' || whetherSetSignOut === 'YES') && <div className="course-time"> {startTimeApply && moment(startTimeApply).format('MM-DD HH:mm')} ~ {endTimeApply && moment(endTimeApply).format('MM-DD HH:mm')}
<div className="time-title">考勤时间</div>
{whetherSetSignIn === 'YES' &&
<div className="time-text">
签到:{signInTime}
</div> </div>
}
{whetherSetSignOut === 'YES' &&
<div className="time-text">
签退:{signOutTime}
</div> </div>
} )}
</div>} {(whetherSetSignIn === 'YES' || whetherSetSignOut === 'YES') && (
<div className='course-time'>
<div className='time-title'>考勤时间</div>
{whetherSetSignIn === 'YES' && <div className='time-text'>签到:{signInTime}</div>}
{whetherSetSignOut === 'YES' && <div className='time-text'>签退:{signOutTime}</div>}
</div>
)}
<div <div
className="intro-item text" className='intro-item text'
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: introduce __html: introduce,
}} }}
/> />
</div> </div>
...@@ -169,4 +170,4 @@ class PreviewOfflineModal extends React.Component { ...@@ -169,4 +170,4 @@ class PreviewOfflineModal extends React.Component {
} }
} }
export default PreviewOfflineModal; export default PreviewOfflineModal
...@@ -757,7 +757,7 @@ class AddVideoCourse extends React.Component { ...@@ -757,7 +757,7 @@ class AddVideoCourse extends React.Component {
<Button>选择文件</Button> <Button>选择文件</Button>
</Dropdown> </Dropdown>
</div> </div>
<div className='course-ware--empty'>资料云盘中选择视频</div> <div className='course-ware--empty'>素材库中选择视频</div>
</div> </div>
<div className='tips'> <div className='tips'>
课节数量限制20个,文件规格说明 课节数量限制20个,文件规格说明
......
import React from "react" import React from 'react'
import { Modal, message, Tooltip, Switch, Dropdown } from "antd" import { Modal, message, Tooltip, Switch, Dropdown } from 'antd'
import _ from "underscore" import _ from 'underscore'
import { PageControl } from "@/components" import { PageControl } from '@/components'
import { LIVE_SHARE } from "@/domains/course-domain/constants" import { LIVE_SHARE } from '@/domains/course-domain/constants'
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom'
import ShareLiveModal from "@/modules/course-manage/modal/ShareLiveModal" import ShareLiveModal from '@/modules/course-manage/modal/ShareLiveModal'
import CourseService from "@/domains/course-domain/CourseService" import CourseService from '@/domains/course-domain/CourseService'
import RelatedPlanModal from "../../modal/RelatedPlanModal" import RelatedPlanModal from '../../modal/RelatedPlanModal'
import User from "@/common/js/user" import User from '@/common/js/user'
import VideoCourseDetail from '../VideoCourseDetail'; import VideoCourseDetail from '../VideoCourseDetail'
import WatchData from "./WatchData"; import WatchData from './WatchData'
import { XMTable } from '@/components'; import { XMTable } from '@/components'
import college from '@/common/lottie/college'; import college from '@/common/lottie/college'
import "./VideoCourseList.less" import './VideoCourseList.less'
class VideoCourseList extends React.Component { class VideoCourseList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
id: '', // 视频课ID id: '', // 视频课ID
studentIds: [], studentIds: [],
...@@ -24,54 +24,48 @@ class VideoCourseList extends React.Component { ...@@ -24,54 +24,48 @@ class VideoCourseList extends React.Component {
selectPlanList: {}, selectPlanList: {},
ShelfLoading: false, ShelfLoading: false,
// dataSource: [], // dataSource: [],
}; }
} }
componentDidMount() { componentDidMount() {
const videoCourseItem = localStorage.getItem('videoCourseItem'); const videoCourseItem = localStorage.getItem('videoCourseItem')
if (videoCourseItem) { if (videoCourseItem) {
const _videoCourseItem = JSON.parse(videoCourseItem); const _videoCourseItem = JSON.parse(videoCourseItem)
this.handleShowShareModal(_videoCourseItem, true); this.handleShowShareModal(_videoCourseItem, true)
} }
} }
// 跳转课程详情页 // 跳转课程详情页
handleLinkToCourseDetail = (courseId) => { handleLinkToCourseDetail = (courseId) => {
const { match } = this.props; const { match } = this.props
window.RCHistory.push(`${match.url}/video-course-detail?courseId=${courseId}`) window.RCHistory.push(`${match.url}/video-course-detail?courseId=${courseId}`)
} }
// 观看数据弹窗 // 观看数据弹窗
handleShowWatchDataModal = (item) => { handleShowWatchDataModal = (item) => {
const { match } = this.props; const { match } = this.props
window.RCHistory.push({ window.RCHistory.push({
pathname: `${match.url}/course-data?courseName=${item.courseName}&courseId=${item.id}` pathname: `${match.url}/course-data?courseName=${item.courseName}&courseId=${item.id}`,
}) })
} }
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
const { type } = this.props; const { type } = this.props
const { ShelfLoading } = this.state; const { ShelfLoading } = this.state
const columns = [ const columns = [
{ {
title: "线上课", title: '线上课',
key: "scheduleName", key: 'scheduleName',
dataIndex: "scheduleName", dataIndex: 'scheduleName',
width: 321, width: 321,
fixed: 'left', fixed: 'left',
render: (val, record) => { render: (val, record) => {
const { coverUrl } = record; const { coverUrl } = record
return ( return (
<div className='record__item'> <div className='record__item'>
<img <img className='course-cover' src={coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'} alt='封面图' />
className='course-cover'
src={
coverUrl || 'https://image.xiaomaiketang.com/xm/TwtGPQGE4K.png'
}
alt='封面图'
/>
<Choose> <Choose>
<When condition={record.courseName.length > 25}> <When condition={record.courseName.length > 25}>
<Tooltip title={record.courseName}> <Tooltip title={record.courseName}>
...@@ -83,7 +77,7 @@ class VideoCourseList extends React.Component { ...@@ -83,7 +77,7 @@ class VideoCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
); )
}, },
}, },
{ {
...@@ -99,35 +93,23 @@ class VideoCourseList extends React.Component { ...@@ -99,35 +93,23 @@ class VideoCourseList extends React.Component {
</If> </If>
</span> </span>
), ),
key: "categoryName", key: 'categoryName',
dataIndex: "categoryName", dataIndex: 'categoryName',
width: 150, width: 150,
render: (val, record) => { render: (val, record) => {
return ( return <div className='record__item'>{record.categoryName}</div>
<Choose>
<When condition={type === 'internal'}>
<div className='record__item'>
{record.categoryOneName}
{record.categoryTwoName ? `-${record.categoryTwoName}` : ''}
</div>
</When>
<Otherwise>
<div className='record__item'>{record.categorySonName}</div>
</Otherwise>
</Choose>
);
}, },
}, },
{ {
title: '课节数', title: '课节数',
key: 'chapterNum', key: 'chapterNum',
dataIndex: 'chapterNum', dataIndex: 'chapterNum',
className: "chapterNum", className: 'chapterNum',
width: 100, width: 100,
align: 'right', align: 'right',
render: (val,item) => { render: (val, item) => {
return <div onClick={()=>this.handleLinkToCourseDetail(item.id)}>{val || 1}</div> return <div onClick={() => this.handleLinkToCourseDetail(item.id)}>{val || 1}</div>
} },
}, },
{ {
title: ( title: (
...@@ -158,26 +140,30 @@ class VideoCourseList extends React.Component { ...@@ -158,26 +140,30 @@ class VideoCourseList extends React.Component {
checked={item.shelfState === 'YES'} checked={item.shelfState === 'YES'}
defaultChecked={item.shelfState} defaultChecked={item.shelfState}
onClick={(checked) => { onClick={(checked) => {
this.changeShelfState(checked, item, index); this.changeShelfState(checked, item, index)
}} }}
/> />
); )
}, },
}, },
{ {
title: "观看学员数", title: '观看学员数',
width: 150, width: 150,
key: "watchUserCount", key: 'watchUserCount',
dataIndex: "watchUserCount", dataIndex: 'watchUserCount',
align: 'right', align: 'right',
render: (val, item) => { render: (val, item) => {
return <div className='watchUserCount' onClick={() => this.handleShowWatchDataModal(item)}>{val || 0}</div> return (
} <div className='watchUserCount' onClick={() => this.handleShowWatchDataModal(item)}>
{val || 0}
</div>
)
},
}, },
{ {
title: "创建人", title: '创建人',
key: "createName", key: 'createName',
dataIndex: "createName", dataIndex: 'createName',
width: 100, width: 100,
render: (val) => { render: (val) => {
return ( return (
...@@ -189,7 +175,7 @@ class VideoCourseList extends React.Component { ...@@ -189,7 +175,7 @@ class VideoCourseList extends React.Component {
)} )}
</div> </div>
) )
} },
}, },
{ {
title: '创建时间', title: '创建时间',
...@@ -198,7 +184,7 @@ class VideoCourseList extends React.Component { ...@@ -198,7 +184,7 @@ class VideoCourseList extends React.Component {
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val); return window.formatDate('YYYY-MM-DD H:i', val)
}, },
}, },
{ {
...@@ -208,7 +194,7 @@ class VideoCourseList extends React.Component { ...@@ -208,7 +194,7 @@ class VideoCourseList extends React.Component {
dataIndex: 'updated', dataIndex: 'updated',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val); return window.formatDate('YYYY-MM-DD H:i', val)
}, },
}, },
{ {
...@@ -227,7 +213,7 @@ class VideoCourseList extends React.Component { ...@@ -227,7 +213,7 @@ class VideoCourseList extends React.Component {
<span key={item.planId}> <span key={item.planId}>
{item.planName} {index < record.relatedPlanList.length - 1 && <span></span>} {item.planName} {index < record.relatedPlanList.length - 1 && <span></span>}
</span> </span>
); )
})} })}
</Tooltip> </Tooltip>
</When> </When>
...@@ -236,7 +222,7 @@ class VideoCourseList extends React.Component { ...@@ -236,7 +222,7 @@ class VideoCourseList extends React.Component {
</Otherwise> </Otherwise>
</Choose> </Choose>
</div> </div>
); )
}, },
}, },
{ {
...@@ -248,7 +234,7 @@ class VideoCourseList extends React.Component { ...@@ -248,7 +234,7 @@ class VideoCourseList extends React.Component {
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='operate'> <div className='operate'>
<If condition={type === "internal"}> <If condition={type === 'internal'}>
<div className='operate__item' onClick={() => this.handleShowShareModal(record)}> <div className='operate__item' onClick={() => this.handleShowShareModal(record)}>
分享 分享
</div> </div>
...@@ -263,17 +249,17 @@ class VideoCourseList extends React.Component { ...@@ -263,17 +249,17 @@ class VideoCourseList extends React.Component {
</span> </span>
</Dropdown> </Dropdown>
</div> </div>
); )
}, },
}, },
]; ]
type !== 'internal' && columns.splice(5, 1); type !== 'internal' && columns.splice(5, 1)
return columns; return columns
}; }
renderMoreOperate = (item) => { renderMoreOperate = (item) => {
const { type } = this.props; const { type } = this.props
return ( return (
<div className='live-course-more-menu'> <div className='live-course-more-menu'>
<If condition={type !== 'internal'}> <If condition={type !== 'internal'}>
...@@ -290,7 +276,7 @@ class VideoCourseList extends React.Component { ...@@ -290,7 +276,7 @@ class VideoCourseList extends React.Component {
<div <div
className='operate__item' className='operate__item'
onClick={() => { onClick={() => {
window.RCHistory.push(`/create-video-course?type=edit&id=${item.id}`); window.RCHistory.push(`/create-video-course?type=edit&id=${item.id}`)
}}> }}>
编辑 编辑
</div> </div>
...@@ -299,41 +285,41 @@ class VideoCourseList extends React.Component { ...@@ -299,41 +285,41 @@ class VideoCourseList extends React.Component {
</div> </div>
</If> </If>
</div> </div>
); )
}; }
handlePlanName = (planArray) => { handlePlanName = (planArray) => {
let planStr = ''; let planStr = ''
planArray.forEach((item, index) => { planArray.forEach((item, index) => {
if (index < planArray.length - 1) { if (index < planArray.length - 1) {
planStr = planStr + item.planName + '、'; planStr = planStr + item.planName + '、'
} else { } else {
planStr = planStr + item.planName; planStr = planStr + item.planName
}
})
return planStr
} }
});
return planStr;
};
//改变上架状态 //改变上架状态
changeShelfState = (checked, item, index) => { changeShelfState = (checked, item, index) => {
let _shelfState = checked ? 'YES' : 'NO'; let _shelfState = checked ? 'YES' : 'NO'
if (checked) { if (checked) {
_shelfState = 'YES'; _shelfState = 'YES'
} else { } else {
_shelfState = 'NO'; _shelfState = 'NO'
} }
const params = { const params = {
courseId: item.id, courseId: item.id,
shelfState: _shelfState, shelfState: _shelfState,
}; }
CourseService.changeVideoShelfState(params).then(() => { CourseService.changeVideoShelfState(params).then(() => {
if (_shelfState === 'YES') { if (_shelfState === 'YES') {
message.success('已开启展示'); message.success('已开启展示')
} else { } else {
message.success('已取消展示'); message.success('已取消展示')
}
this.props.changeShelfState(index, _shelfState)
})
} }
this.props.changeShelfState(index, _shelfState);
});
};
// 删除线上课 // 删除线上课
handleDeleteVideoCourse = (scheduleId) => { handleDeleteVideoCourse = (scheduleId) => {
...@@ -348,28 +334,28 @@ class VideoCourseList extends React.Component { ...@@ -348,28 +334,28 @@ class VideoCourseList extends React.Component {
const param = { const param = {
courseId: scheduleId, courseId: scheduleId,
storeId: User.getStoreId(), storeId: User.getStoreId(),
}; }
CourseService.delVideoSchedule(param).then(() => { CourseService.delVideoSchedule(param).then(() => {
message.success('删除成功'); message.success('删除成功')
this.props.onChange(); this.props.onChange()
}); })
}, },
}); })
}; }
// 显示分享弹窗 // 显示分享弹窗
handleShowShareModal = (record, needStr = false) => { handleShowShareModal = (record, needStr = false) => {
const { type } = this.props; const { type } = this.props
const { id, scheduleVideoUrl } = record; const { id, scheduleVideoUrl } = record
const htmlUrl = `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}`; const htmlUrl = `${LIVE_SHARE}video_detail/${id}?id=${User.getStoreId()}`
const longUrl = htmlUrl; const longUrl = htmlUrl
const { coverUrl, courseName } = record; const { coverUrl, courseName } = record
const shareData = { const shareData = {
longUrl, longUrl,
coverUrl, coverUrl,
scheduleVideoUrl, scheduleVideoUrl,
courseName, courseName,
}; }
const shareLiveModal = ( const shareLiveModal = (
<ShareLiveModal <ShareLiveModal
...@@ -381,82 +367,82 @@ class VideoCourseList extends React.Component { ...@@ -381,82 +367,82 @@ class VideoCourseList extends React.Component {
close={() => { close={() => {
this.setState({ this.setState({
shareLiveModal: null, shareLiveModal: null,
}); })
localStorage.setItem('videoCourseItem', ''); localStorage.setItem('videoCourseItem', '')
}} }}
/> />
); )
this.setState({ shareLiveModal }); this.setState({ shareLiveModal })
}; }
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter
const { query } = this.props; const { query } = this.props
let { order: _order } = query; let { order: _order } = query
// 按创建时间升序排序 // 按创建时间升序排序
if (columnKey === 'created' && order === 'ascend') { if (columnKey === 'created' && order === 'ascend') {
_order = 'CREATED_ASC'; _order = 'CREATED_ASC'
} }
// 按创建时间降序排序 // 按创建时间降序排序
if (columnKey === 'created' && order === 'descend') { if (columnKey === 'created' && order === 'descend') {
_order = 'CREATED_DESC'; _order = 'CREATED_DESC'
} }
// 按更新时间升序排序 // 按更新时间升序排序
if (columnKey === 'updated' && order === 'ascend') { if (columnKey === 'updated' && order === 'ascend') {
_order = 'UPDATED_ASC'; _order = 'UPDATED_ASC'
} }
// 按更新时间降序排序 // 按更新时间降序排序
if (columnKey === 'updated' && order === 'descend') { if (columnKey === 'updated' && order === 'descend') {
_order = 'UPDATED_DESC'; _order = 'UPDATED_DESC'
} }
const _query = { const _query = {
...query, ...query,
orderEnum: _order, orderEnum: _order,
}; }
this.props.onChange(_query); this.props.onChange(_query)
}; }
handleRelatedModalShow = (item) => { handleRelatedModalShow = (item) => {
const selectPlanList = {}; const selectPlanList = {}
if (item.relatedPlanList) { if (item.relatedPlanList) {
item.relatedPlanList.map((item, index) => { item.relatedPlanList.map((item, index) => {
selectPlanList[item.planId] = {}; selectPlanList[item.planId] = {}
selectPlanList[item.planId].planId = item.planId; selectPlanList[item.planId].planId = item.planId
selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }]; selectPlanList[item.planId].taskBaseVOList = [{ taskId: item.taskId }]
return item; return item
}); })
} }
this.setState({ this.setState({
RelatedPlanModalVisible: true, RelatedPlanModalVisible: true,
selectCourseId: item.id, selectCourseId: item.id,
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}); })
}; }
closeRelatedPlanModalVisible = () => { closeRelatedPlanModalVisible = () => {
this.setState({ this.setState({
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}); })
}; }
onChangeSelectPlanList = (selectPlanList) => { onChangeSelectPlanList = (selectPlanList) => {
this.setState({ this.setState({
selectPlanList: selectPlanList, selectPlanList: selectPlanList,
}); })
}; }
onConfirmSelectPlanList = () => { onConfirmSelectPlanList = () => {
this.setState( this.setState(
{ {
RelatedPlanModalVisible: false, RelatedPlanModalVisible: false,
}, },
() => { () => {
this.props.onChange(); this.props.onChange()
}
)
} }
);
};
render() { render() {
const { dataSource = [], totalCount, query, type, match } = this.props; const { dataSource = [], totalCount, query, type, match } = this.props
const { current, size } = query; const { current, size } = query
const { RelatedPlanModalVisible, selectPlanList, selectCourseId } = this.state; const { RelatedPlanModalVisible, selectPlanList, selectCourseId } = this.state
return ( return (
<div className={`video-course-list ${type !== 'internal' ? 'video-course-list-mt' : ''}`}> <div className={`video-course-list ${type !== 'internal' ? 'video-course-list-mt' : ''}`}>
<XMTable <XMTable
...@@ -480,8 +466,8 @@ class VideoCourseList extends React.Component { ...@@ -480,8 +466,8 @@ class VideoCourseList extends React.Component {
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
toPage={(page) => { toPage={(page) => {
const _query = { ...query, current: page + 1 }; const _query = { ...query, current: page + 1 }
this.props.onChange(_query); this.props.onChange(_query)
}} }}
/> />
</div> </div>
...@@ -500,8 +486,8 @@ class VideoCourseList extends React.Component { ...@@ -500,8 +486,8 @@ class VideoCourseList extends React.Component {
<Route path={`${match.url}/video-course-detail`} component={VideoCourseDetail} /> <Route path={`${match.url}/video-course-detail`} component={VideoCourseDetail} />
<Route path={`${match.url}/course-data`} component={WatchData} /> <Route path={`${match.url}/course-data`} component={WatchData} />
</div> </div>
); )
} }
} }
export default withRouter(VideoCourseList); export default withRouter(VideoCourseList)
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react'
import { Select, Tooltip, Carousel, Popover } from 'antd'; import { Select, Tooltip, Carousel, Popover } from 'antd'
import DataSet from "@antv/data-set"; import DataSet from '@antv/data-set'
import { Chart as G2Chart } from '@antv/g2'; import { Chart as G2Chart } from '@antv/g2'
import { import { G2, Chart, Geom, Axis, Tooltip as G2Tooltip, Coord, Label, Legend, View, Guide, Shape, Facet, Util } from 'bizcharts'
G2,
Chart,
Geom,
Axis,
Tooltip as G2Tooltip,
Coord,
Label,
Legend,
View,
Guide,
Shape,
Facet,
Util
} from "bizcharts";
import moment from 'moment' import moment from 'moment'
import Service from "@/common/js/service"; import Service from '@/common/js/service'
import User from '@/common/js/user'; import User from '@/common/js/user'
import HomeTip from './HomeTip'; import HomeTip from './HomeTip'
import './Home.less'; import './Home.less'
const Option = Select.Option; const Option = Select.Option
class Home extends React.Component { class Home extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
scheduleType: 'LIVE', scheduleType: 'LIVE',
list: [], list: [],
...@@ -48,54 +34,54 @@ class Home extends React.Component { ...@@ -48,54 +34,54 @@ class Home extends React.Component {
incWeekVisitCustomerNum: 0, incWeekVisitCustomerNum: 0,
courseNum: 0, //课程总数 courseNum: 0, //课程总数
inCourseNum: 0, //本月新增课程总数 inCourseNum: 0, //本月新增课程总数
}; }
this._chart = null; this._chart = null
} }
componentDidMount() { componentDidMount() {
this.getPanelInfo(); this.getPanelInfo()
this.getStudyInfo(); this.getStudyInfo()
this.getHotCourse(); this.getHotCourse()
this.getTrainingInfo(); this.getTrainingInfo()
} }
getTrainingInfo() { getTrainingInfo() {
Service.Hades('public/hades/planOverview', { storeId: User.getStoreId() }).then((res) => { Service.Hades('public/hades/planOverview', { storeId: User.getStoreId() }).then((res) => {
if (res.success) { if (res.success) {
this.setState(res.result); this.setState(res.result)
} }
}); })
} }
getHotCourse() { getHotCourse() {
const { timeRange, scheduleType } = this.state; const { timeRange, scheduleType } = this.state
const data = { const data = {
hotNum: 5, hotNum: 5,
scheduleType, scheduleType,
storeId: User.getStoreId(), storeId: User.getStoreId(),
timeRange, timeRange,
}; }
Service.Hades('public/courseCloud/hotCourse', data).then((res) => { Service.Hades('public/courseCloud/hotCourse', data).then((res) => {
if (res.success) { if (res.success) {
this.setState({ this.setState({
list: res.result, list: res.result,
}); })
} }
}); })
} }
getStudyInfo() { getStudyInfo() {
const { studyTimeRange } = this.state; const { studyTimeRange } = this.state
Service.Hades('public/hades/studyInfo', { storeId: User.getStoreId(), timeRange: studyTimeRange }).then((res) => { Service.Hades('public/hades/studyInfo', { storeId: User.getStoreId(), timeRange: studyTimeRange }).then((res) => {
if (res.success) { if (res.success) {
const dataList = res.result.map((item) => ({ const dataList = res.result.map((item) => ({
time: moment(item.dateline).format('MM-DD'), time: moment(item.dateline).format('MM-DD'),
studyNum: item.studyNum, studyNum: item.studyNum,
studyTime: Math.round(item.studyTime / 6) / 10, studyTime: Math.round(item.studyTime / 6) / 10,
})); }))
this.createChart(dataList); this.createChart(dataList)
} }
}); })
} }
getPanelInfo() { getPanelInfo() {
...@@ -120,22 +106,22 @@ class Home extends React.Component { ...@@ -120,22 +106,22 @@ class Home extends React.Component {
incWeekVisitCustomerNum: res.result.incWeekVisitCustomerNum, incWeekVisitCustomerNum: res.result.incWeekVisitCustomerNum,
courseNum: res.result.videoCourseNum + res.result.liveCourseNum + res.result.pictureCourseNum + res.result.offlineCourseNum, courseNum: res.result.videoCourseNum + res.result.liveCourseNum + res.result.pictureCourseNum + res.result.offlineCourseNum,
inCourseNum: res.result.incLiveCourseNum + res.result.incVideoCourseNum + res.result.incPictureCourseNum + res.result.incOfflineCourseNum, inCourseNum: res.result.incLiveCourseNum + res.result.incVideoCourseNum + res.result.incPictureCourseNum + res.result.incOfflineCourseNum,
}); })
} }
}); })
} }
showNumber(index) { showNumber(index) {
switch (index) { switch (index) {
case 0: case 0:
return 'https://image.xiaomaiketang.com/xm/D64QhNn74S.png'; return 'https://image.xiaomaiketang.com/xm/D64QhNn74S.png'
case 1: case 1:
return 'https://image.xiaomaiketang.com/xm/Qfib4mnGJT.png'; return 'https://image.xiaomaiketang.com/xm/Qfib4mnGJT.png'
case 2: case 2:
return 'https://image.xiaomaiketang.com/xm/8jKXHyrDaG.png'; return 'https://image.xiaomaiketang.com/xm/8jKXHyrDaG.png'
default: default:
return 'https://image.xiaomaiketang.com/xm/D64QhNn74S.png'; return 'https://image.xiaomaiketang.com/xm/D64QhNn74S.png'
} }
} }
...@@ -146,28 +132,28 @@ class Home extends React.Component { ...@@ -146,28 +132,28 @@ class Home extends React.Component {
forceFit: true, forceFit: true,
height: 290, height: 290,
padding: [48, 64], padding: [48, 64],
}); })
} }
this._chart.clear(); this._chart.clear()
this._chart.source(data, { this._chart.source(data, {
studyTime: { studyTime: {
formatter: (val) => { formatter: (val) => {
return val; return val
}, },
tickCount: 5, tickCount: 5,
}, },
time: { time: {
formatter: (val) => { formatter: (val) => {
return `${val}`; return `${val}`
}, },
}, },
studyNum: { studyNum: {
formatter: (val) => { formatter: (val) => {
return val; return val
}, },
tickCount: 5, tickCount: 5,
}, },
}); })
this._chart.axis('time', { this._chart.axis('time', {
label: { label: {
offset: 20, offset: 20,
...@@ -182,7 +168,7 @@ class Home extends React.Component { ...@@ -182,7 +168,7 @@ class Home extends React.Component {
tickLine: { tickLine: {
stroke: '#E8E8E8', stroke: '#E8E8E8',
}, },
}); })
this._chart.axis('submitCount', { this._chart.axis('submitCount', {
label: { label: {
textStyle: { textStyle: {
...@@ -190,7 +176,7 @@ class Home extends React.Component { ...@@ -190,7 +176,7 @@ class Home extends React.Component {
fontSize: 14, fontSize: 14,
}, },
}, },
}); })
this._chart.axis('studyTime', { this._chart.axis('studyTime', {
label: { label: {
textStyle: { textStyle: {
...@@ -198,7 +184,7 @@ class Home extends React.Component { ...@@ -198,7 +184,7 @@ class Home extends React.Component {
fontSize: 14, fontSize: 14,
}, },
}, },
}); })
this._chart this._chart
.line() .line()
.position('time*studyNum') .position('time*studyNum')
...@@ -207,8 +193,8 @@ class Home extends React.Component { ...@@ -207,8 +193,8 @@ class Home extends React.Component {
return { return {
name: '学习人数', name: '学习人数',
value: studyNum + '人', value: studyNum + '人',
}; }
}); })
this._chart this._chart
.line() .line()
.position('time*studyTime') .position('time*studyTime')
...@@ -217,10 +203,10 @@ class Home extends React.Component { ...@@ -217,10 +203,10 @@ class Home extends React.Component {
return { return {
name: '人均学习时长', name: '人均学习时长',
value: studyTime + '分钟', value: studyTime + '分钟',
}; }
}); })
this._chart.legend(false); this._chart.legend(false)
this._chart.tooltip({ this._chart.tooltip({
containerTpl: containerTpl:
'<div class="g2-tooltip" style="background: #fff !important;">' + '<div class="g2-tooltip" style="background: #fff !important;">' +
...@@ -228,9 +214,9 @@ class Home extends React.Component { ...@@ -228,9 +214,9 @@ class Home extends React.Component {
'<ul class="g2-tooltip-list"></ul></div>', // tooltip 容器模板 '<ul class="g2-tooltip-list"></ul></div>', // tooltip 容器模板
itemTpl: itemTpl:
'<li data-index={index}><span style="background-color:{color};width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:8px;"></span>{name}<span style="display: inline-block; float: right; margin-left: 30px;">{value}</span></li>', // tooltip 每项记录的默认模板 '<li data-index={index}><span style="background-color:{color};width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:8px;"></span>{name}<span style="display: inline-block; float: right; margin-left: 30px;">{value}</span></li>', // tooltip 每项记录的默认模板
}); })
this._chart.render(); this._chart.render()
}; }
render() { render() {
const { const {
...@@ -259,7 +245,7 @@ class Home extends React.Component { ...@@ -259,7 +245,7 @@ class Home extends React.Component {
offlineCourseNum, offlineCourseNum,
weekVisitCustomerNum, weekVisitCustomerNum,
incWeekVisitCustomerNum, incWeekVisitCustomerNum,
} = this.state; } = this.state
const data = [ const data = [
{ {
item: '已完成培训', item: '已完成培训',
...@@ -269,26 +255,26 @@ class Home extends React.Component { ...@@ -269,26 +255,26 @@ class Home extends React.Component {
item: '未完成培训', item: '未完成培训',
count: unfinishedNum, count: unfinishedNum,
}, },
]; ]
const { DataView } = DataSet; const { DataView } = DataSet
const { Html } = Guide; const { Html } = Guide
const sum = data[0].count + data[1].count; const sum = data[0].count + data[1].count
const dv = new DataView(); const dv = new DataView()
sum && sum &&
dv.source(data).transform({ dv.source(data).transform({
type: 'percent', type: 'percent',
field: 'count', field: 'count',
dimension: 'item', dimension: 'item',
as: 'percent', as: 'percent',
}); })
const cols = { const cols = {
percent: { percent: {
formatter: (val) => { formatter: (val) => {
val = val * 100 + '%'; val = val * 100 + '%'
return val; return val
}, },
}, },
}; }
return ( return (
<div className='home-page'> <div className='home-page'>
<HomeTip /> <HomeTip />
...@@ -359,7 +345,7 @@ class Home extends React.Component { ...@@ -359,7 +345,7 @@ class Home extends React.Component {
</div> </div>
</div> </div>
<div className='course-item'> <div className='course-item'>
<div className='course-title'>线下</div> <div className='course-title'>线下活动</div>
<div className='data'> <div className='data'>
<span className='course-number'>{offlineCourseNum}</span> <span className='course-number'>{offlineCourseNum}</span>
{incOfflineCourseNum > 0 && <span className='icon iconfont'>&#xe635;</span>} {incOfflineCourseNum > 0 && <span className='icon iconfont'>&#xe635;</span>}
...@@ -409,8 +395,9 @@ class Home extends React.Component { ...@@ -409,8 +395,9 @@ class Home extends React.Component {
</span> </span>
<span <span
className={`tab${scheduleType === 'VOICE' ? ' selected' : ''}`} className={`tab${scheduleType === 'VOICE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'VOICE' }, () => this.getHotCourse())} onClick={() => this.setState({ scheduleType: 'VOICE' }, () => this.getHotCourse())}>
>线上课</span> 线上课
</span>
<span <span
className={`tab${scheduleType === 'PICTURE' ? ' selected' : ''}`} className={`tab${scheduleType === 'PICTURE' ? ' selected' : ''}`}
onClick={() => this.setState({ scheduleType: 'PICTURE' }, () => this.getHotCourse())}> onClick={() => this.setState({ scheduleType: 'PICTURE' }, () => this.getHotCourse())}>
...@@ -429,7 +416,7 @@ class Home extends React.Component { ...@@ -429,7 +416,7 @@ class Home extends React.Component {
style={{ width: 88 }} style={{ width: 88 }}
value={timeRange} value={timeRange}
onChange={(value) => { onChange={(value) => {
this.setState({ timeRange: value }, () => this.getHotCourse()); this.setState({ timeRange: value }, () => this.getHotCourse())
}}> }}>
<Option value='7'>近7天</Option> <Option value='7'>近7天</Option>
<Option value='15'>近15天</Option> <Option value='15'>近15天</Option>
...@@ -509,11 +496,11 @@ class Home extends React.Component { ...@@ -509,11 +496,11 @@ class Home extends React.Component {
tooltip={[ tooltip={[
'item*percent', 'item*percent',
(item, percent) => { (item, percent) => {
percent = Math.round(percent * 100) + '%'; percent = Math.round(percent * 100) + '%'
return { return {
name: item, name: item,
value: percent, value: percent,
}; }
}, },
]} ]}
style={{ style={{
...@@ -567,7 +554,7 @@ class Home extends React.Component { ...@@ -567,7 +554,7 @@ class Home extends React.Component {
style={{ width: 88 }} style={{ width: 88 }}
value={studyTimeRange} value={studyTimeRange}
onChange={(value) => { onChange={(value) => {
this.setState({ studyTimeRange: value }, () => this.getStudyInfo()); this.setState({ studyTimeRange: value }, () => this.getStudyInfo())
}}> }}>
<Option value='7'>近7天</Option> <Option value='7'>近7天</Option>
<Option value='15'>近15天</Option> <Option value='15'>近15天</Option>
...@@ -595,8 +582,8 @@ class Home extends React.Component { ...@@ -595,8 +582,8 @@ class Home extends React.Component {
</div> </div>
</div> </div>
</div> </div>
); )
} }
} }
export default Home; export default Home
...@@ -5,57 +5,43 @@ ...@@ -5,57 +5,43 @@
* @Last Modified time: 2020-06-23 14:54:14 * @Last Modified time: 2020-06-23 14:54:14
* @Description: 网络磁盘(我的文件、公共文件、员工文件) * @Description: 网络磁盘(我的文件、公共文件、员工文件)
*/ */
import React from 'react'; import React from 'react'
import { DISK_MAP } from '@/common/constants/academic/lessonEnum'
import { DISK_MAP } from "@/common/constants/academic/lessonEnum";
function DiskList(props) { function DiskList(props) {
const { diskList, currentRootDisk } = props
const { diskList, currentRootDisk } = props;
return ( return (
<div className="disk-list__wrap"> <div className='disk-list__wrap'>
<div className="disk-list"> <div className='disk-list'>
{ {diskList.map((item) => {
diskList.map((item) => { const isActive = item.disk === currentRootDisk.disk
const isActive = item.disk === currentRootDisk.disk;
return ( return (
<div <div
key={item.disk} key={item.disk}
className={`item ${isActive ? 'active' : ''}`} className={`item ${isActive ? 'active' : ''}`}
onClick={() => { props.onChange(item)}} onClick={() => {
> props.onChange(item)
{ }}>
item.disk === 'MYSELF' && {item.disk === 'MYSELF' && <span className='icon iconfont'>&#xe7a5;</span>}
<span className="icon iconfont">&#xe7a5;</span> {item.disk === 'COMMON' && <span className='icon iconfont'>&#xe79d;</span>}
} {item.disk === 'EMPLOYEE' && <span className='icon iconfont'>&#xe7a3;</span>}
{ <span className='disk-name'>{item.folderName}</span>
item.disk === 'COMMON' &&
<span className="icon iconfont">&#xe79d;</span>
}
{
item.disk === 'EMPLOYEE' &&
<span className="icon iconfont">&#xe7a3;</span>
}
<span className="disk-name">{ item.folderName }</span>
</div> </div>
) )
}) })}
}
</div> </div>
<a <a
className="guide-href" className='guide-href'
href={window.NewVersion ? 'https://mp.weixin.qq.com/s/s0XN0Gk4Xul192SmTd6znw' : 'https://mp.weixin.qq.com/s/2EMWaaa3LQwkJd59bmy8pA'} href={window.NewVersion ? 'https://mp.weixin.qq.com/s/s0XN0Gk4Xul192SmTd6znw' : 'https://mp.weixin.qq.com/s/2EMWaaa3LQwkJd59bmy8pA'}
target="_blank" target='_blank'>
> 进一步了解素材库
进一步了解资料云盘
</a> </a>
</div> </div>
) )
}; }
export default DiskList; export default DiskList
\ No newline at end of file
import React from 'react'; import React from 'react'
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom'
import { Modal, Button } from 'antd'; import { Modal, Button } from 'antd'
import User from '@/common/js/user'; import User from '@/common/js/user'
import FolderManage from './components/FolderManage'; import FolderManage from './components/FolderManage'
import DiskList from './components/DiskList'; import DiskList from './components/DiskList'
import { DISK_MAP } from "@/common/constants/academic/lessonEnum"; import { DISK_MAP } from '@/common/constants/academic/lessonEnum'
import './index.less'; import './index.less'
const { teacherId, gmtCreate } = window.currentUserInstInfo; const { teacherId, gmtCreate } = window.currentUserInstInfo
// 判断是否是5.0或4.0T端 // 判断是否是5.0或4.0T端
const isTeacher = !!teacherId; const isTeacher = !!teacherId
// 判断是新用户还是老用户(gmtCreate小于上线日期的话就是老用户) // 判断是新用户还是老用户(gmtCreate小于上线日期的话就是老用户)
const onlineDate = +new Date('2020-07-17 00:00:00'); const onlineDate = +new Date('2020-07-17 00:00:00')
const isOldUser = gmtCreate <= onlineDate; const isOldUser = gmtCreate <= onlineDate
const defaultRootDisk = { const defaultRootDisk = {
folderName: '我的文件', folderName: '我的文件',
disk: 'MYSELF', disk: 'MYSELF',
uploadPower: false uploadPower: false,
} }
class PrepareLessonPage extends React.Component { class PrepareLessonPage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
const prepareLessonTips = localStorage.getItem('prepare_lesson_tips'); const prepareLessonTips = localStorage.getItem('prepare_lesson_tips')
this.state = { this.state = {
prepareLessonTips, prepareLessonTips,
diskList: [], // 可见磁盘目录 diskList: [], // 可见磁盘目录
currentRootDisk: defaultRootDisk currentRootDisk: defaultRootDisk,
} }
} }
componentWillMount() { componentWillMount() {
this.handleFetchDiskList(); this.handleFetchDiskList()
} }
handleFetchDiskList = async () => { handleFetchDiskList = async () => {
const res = await axios.Apollo('public/apollo/getUserDisk', {}); const res = await axios.Apollo('public/apollo/getUserDisk', {})
const { result = [] } = res; const { result = [] } = res
const diskList = result.map((item) => { const diskList = result.map((item) => {
return { return {
...item, ...item,
folderName: DISK_MAP[item.disk] folderName: DISK_MAP[item.disk],
} }
}); })
this.setState({ this.setState({
diskList, diskList,
currentRootDisk: diskList[0] || defaultRootDisk currentRootDisk: diskList[0] || defaultRootDisk,
}); })
} }
handleChangeDisk = (disk) => { handleChangeDisk = (disk) => {
this.setState({ this.setState({
currentRootDisk: disk currentRootDisk: disk,
}); })
} }
render() { render() {
const { currentRootDisk, prepareLessonTips, diskList } = this.state; const { currentRootDisk, prepareLessonTips, diskList } = this.state
return ( return (
<div className="prepare-lesson-page page"> <div className='prepare-lesson-page page'>
<div className="content-header">资料云盘</div> <div className='content-header'>素材库</div>
<div className="box content-body"> <div className='box content-body'>
<DiskList <DiskList diskList={diskList} currentRootDisk={currentRootDisk} onChange={this.handleChangeDisk} />
diskList={diskList} <FolderManage currentRootDisk={currentRootDisk} />
currentRootDisk={currentRootDisk}
onChange={this.handleChangeDisk}
/>
<FolderManage
currentRootDisk={currentRootDisk}
/>
</div> </div>
{/* 老用户显示弹窗提示 */} {/* 老用户显示弹窗提示 */}
<Modal <Modal
title="备课本改版" title='备课本改版'
visible={!prepareLessonTips && isOldUser} visible={!prepareLessonTips && isOldUser}
footer={null} footer={null}
width={680} width={680}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
className="prepare-lesson-upgrade-modal" className='prepare-lesson-upgrade-modal'
onCancel={() => { onCancel={() => {
this.setState({ this.setState({
prepareLessonTips: true prepareLessonTips: true,
}) })
}} }}>
> <div className='title'>“备课本” 升级为 “素材库” 了!</div>
<div className="title">“备课本” 升级为 “资料云盘” 了!</div> <div className='upgrade-list'>
<div className="upgrade-list"> <div className='upgrade-list__item'>
<div className="upgrade-list__item"> <img src='https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780611301.png' alt='' />
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780611301.png" alt=""/> <div className='item-title'>存储更便捷</div>
<div className="item-title">存储更便捷</div> <div className='item-sub-title'>讲次关联模式升级文件夹模式,存储不再受讲次限制</div>
<div className="item-sub-title">讲次关联模式升级文件夹模式,存储不再受讲次限制</div>
</div> </div>
<div className="upgrade-list__item"> <div className='upgrade-list__item'>
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780629259.png" alt=""/> <img src='https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780629259.png' alt='' />
<div className="item-title">结构更清晰</div> <div className='item-title'>结构更清晰</div>
<div className="item-sub-title">新增“我的文件”“公共文件”“员工文件”,满足机构存储需求</div> <div className='item-sub-title'>新增“我的文件”“公共文件”“员工文件”,满足机构存储需求</div>
</div> </div>
<div className="upgrade-list__item"> <div className='upgrade-list__item'>
<img src="https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780641665.png" alt=""/> <img src='https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594780641665.png' alt='' />
<div className="item-title">同步更方便</div> <div className='item-title'>同步更方便</div>
<div className="item-sub-title">支持主管直接查看员工文件,优质资料一目了然</div> <div className='item-sub-title'>支持主管直接查看员工文件,优质资料一目了然</div>
</div> </div>
</div> </div>
<div <div
className="footer" className='footer'
onClick={() => { onClick={() => {
this.setState({ prepareLessonTips: true }); this.setState({ prepareLessonTips: true })
localStorage.setItem('prepare_lesson_tips', true); localStorage.setItem('prepare_lesson_tips', true)
}} }}>
>我知道了</div> 我知道了
</div>
</Modal> </Modal>
</div> </div>
) )
} }
} }
export default PrepareLessonPage; export default PrepareLessonPage
\ No newline at end of file
...@@ -6,44 +6,43 @@ ...@@ -6,44 +6,43 @@
* @Description: 文件夹列表 * @Description: 文件夹列表
*/ */
import React from 'react'; import React from 'react'
import { Table, Menu, Dropdown, Modal, message,Tooltip } from 'antd'; import { Table, Menu, Dropdown, Modal, message, Tooltip } from 'antd'
import _ from 'underscore'; import _ from 'underscore'
import { PageControl } from 'xiaomai-b-components'; import { PageControl } from 'xiaomai-b-components'
import { XMTable } from '@/components'; import { XMTable } from '@/components'
import Service from '@/common/js/service'; import Service from '@/common/js/service'
import { formatDate } from '@/domains/basic-domain/utils'; import { formatDate } from '@/domains/basic-domain/utils'
import { FILE_TYPE_ICON_MAP, SUPPORT_FILE_TYPE_MAP, DEFAULT_SIZE_UNIT } from '@/domains/resource-disk/constants'; import { FILE_TYPE_ICON_MAP, SUPPORT_FILE_TYPE_MAP, DEFAULT_SIZE_UNIT } from '@/domains/resource-disk/constants'
import { getFileTypeByName } from '@/domains/resource-disk/utils'; import { getFileTypeByName } from '@/domains/resource-disk/utils'
import addData from '../../lottie/addData/data.json'; import addData from '../../lottie/addData/data.json'
import search from '../../lottie/search/data.json'; import search from '../../lottie/search/data.json'
import UploadProgressModal from '@/bu-components/UploadProgressModal'; import UploadProgressModal from '@/bu-components/UploadProgressModal'
import SelectPrepareFileModal from '@/bu-components/SelectPrepareFileModal'; import SelectPrepareFileModal from '@/bu-components/SelectPrepareFileModal'
import CopyFileModal from '@/bu-components/CopyFileModal'; import CopyFileModal from '@/bu-components/CopyFileModal'
import ManagingMembersModal from '@/bu-components/ManagingMembersModal'; import ManagingMembersModal from '@/bu-components/ManagingMembersModal'
import PreviewFileModal from '@/bu-components/PreviewFileModal'; import PreviewFileModal from '@/bu-components/PreviewFileModal'
import {YZ_APPId,YZ_PREVIEW_URL,OFFICE_PREVIEW_URL} from '@/domains/basic-domain/constants'; import { YZ_APPId, YZ_PREVIEW_URL, OFFICE_PREVIEW_URL } from '@/domains/basic-domain/constants'
import BaseService from "@/domains/basic-domain/baseService"; import BaseService from '@/domains/basic-domain/baseService'
import ScanFileModal from '../modal/ScanFileModal'; import ScanFileModal from '../modal/ScanFileModal'
import CreateFolderModal from '../modal/CreateFolderModal'; import CreateFolderModal from '../modal/CreateFolderModal'
import User from '@/common/js/user'; import User from '@/common/js/user'
import axios from 'axios'; import axios from 'axios'
const appId = "yozoqvpO2Hvz8346"; const appId = 'yozoqvpO2Hvz8346'
const DEL_FOLDER_URL_MAP = { const DEL_FOLDER_URL_MAP = {
'MYSELF': 'public/hadesStore/delFolder', MYSELF: 'public/hadesStore/delFolder',
'COMMON': 'public/hadesStore/delFolder' COMMON: 'public/hadesStore/delFolder',
} }
// 支持本地上传的文件类型 // 支持本地上传的文件类型
const loaclFileType = SUPPORT_FILE_TYPE_MAP.join(','); const loaclFileType = SUPPORT_FILE_TYPE_MAP.join(',')
let count = 0; let count = 0
class FolderList extends React.Component { class FolderList extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
localFileList: [], // 本地文件列表(待上传) localFileList: [], // 本地文件列表(待上传)
currentFolder: {}, // 当前文件/文件夹(操作列表中的文件/文件夹的时候需要用到) currentFolder: {}, // 当前文件/文件夹(操作列表中的文件/文件夹的时候需要用到)
...@@ -55,26 +54,26 @@ class FolderList extends React.Component { ...@@ -55,26 +54,26 @@ class FolderList extends React.Component {
showManagingModal: false, // 管理文件查看编辑权限 showManagingModal: false, // 管理文件查看编辑权限
nonCompliantFileList: [], // 不符合上限的文件列表 nonCompliantFileList: [], // 不符合上限的文件列表
parentRights: '', // 继承父级文件夹权限 parentRights: '', // 继承父级文件夹权限
showPreviewModal:false, //是否显示loading showPreviewModal: false, //是否显示loading
previewing:false, //是否正在预览 previewing: false, //是否正在预览
previewStatus:'UPLOAD' //预览文件的生成状态 previewStatus: 'UPLOAD', //预览文件的生成状态
} }
} }
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { folderPathList } = nextProps const { folderPathList } = nextProps
const currentFolder = folderPathList[folderPathList.length - 1]; const currentFolder = folderPathList[folderPathList.length - 1]
this.setState({ this.setState({
currentFolder currentFolder,
}) })
} }
//预览文件 //预览文件
handleSelect = (folder) => { handleSelect = (folder) => {
// 只有文件才有预览功能 // 只有文件才有预览功能
if (folder.folderType === 'FOLDER') { if (folder.folderType === 'FOLDER') {
this.handleSelectFolder(folder); this.handleSelectFolder(folder)
} else { } else {
this.handleScanFile(folder); this.handleScanFile(folder)
} }
} }
...@@ -82,52 +81,52 @@ class FolderList extends React.Component { ...@@ -82,52 +81,52 @@ class FolderList extends React.Component {
handleDataDot = (folderFormat) => { handleDataDot = (folderFormat) => {
switch (folderFormat) { switch (folderFormat) {
case 'PDF': case 'PDF':
window.WEBTRACING('resource_disk_file_preview_pdf', '资料云盘_点击预览_pdf'); window.WEBTRACING('resource_disk_file_preview_pdf', '资料云盘_点击预览_pdf')
break; break
case 'WORD': case 'WORD':
case 'DOCX': case 'DOCX':
case 'DOC': case 'DOC':
window.WEBTRACING('resource_disk_file_preview_word', '资料云盘_点击预览_word'); window.WEBTRACING('resource_disk_file_preview_word', '资料云盘_点击预览_word')
break; break
case 'EXCEL': case 'EXCEL':
window.WEBTRACING('resource_disk_file_preview_excel', '资料云盘_点击预览_excel'); window.WEBTRACING('resource_disk_file_preview_excel', '资料云盘_点击预览_excel')
break; break
case 'PPT': case 'PPT':
case 'PPTX': case 'PPTX':
window.WEBTRACING('resource_disk_file_preview_ppt', '资料云盘_点击预览_ppt'); window.WEBTRACING('resource_disk_file_preview_ppt', '资料云盘_点击预览_ppt')
break; break
default: default:
break; break
} }
} }
handleYZPreviewDataDot =(folderFormat) => { handleYZPreviewDataDot = (folderFormat) => {
switch (folderFormat) { switch (folderFormat) {
case 'PDF': case 'PDF':
window.WEBTRACING('resource_disk_yz_file_preview_pdf', '资料云盘_点击永中预览_pdf'); window.WEBTRACING('resource_disk_yz_file_preview_pdf', '资料云盘_点击永中预览_pdf')
break; break
case 'WORD': case 'WORD':
case 'DOCX': case 'DOCX':
case 'DOC': case 'DOC':
window.WEBTRACING('resource_disk_yz_file_preview_word', '资料云盘_点击永中预览_word'); window.WEBTRACING('resource_disk_yz_file_preview_word', '资料云盘_点击永中预览_word')
break; break
case 'EXCEL': case 'EXCEL':
window.WEBTRACING('resource_disk_yz_file_preview_excel', '资料云盘_点击永中预览_excel'); window.WEBTRACING('resource_disk_yz_file_preview_excel', '资料云盘_点击永中预览_excel')
break; break
case 'PPT': case 'PPT':
case 'PPTX': case 'PPTX':
window.WEBTRACING('resource_disk_yz_file_preview_ppt', '资料云盘_点击永中预览_ppt'); window.WEBTRACING('resource_disk_yz_file_preview_ppt', '资料云盘_点击永中预览_ppt')
break; break
default: default:
break; break
} }
} }
// 预览文件 // 预览文件
handleScanFile = async (folder) => { handleScanFile = async (folder) => {
const { folderFormat, folderSize, ossUrl,rights,fileVersionId,id,folderName} = folder; const { folderFormat, folderSize, ossUrl, rights, fileVersionId, id, folderName } = folder
const {currentRootDisk } = this.props; const { currentRootDisk } = this.props
//如果是公共文件且只有查看的权限的用户的预览对接的三方是永中 //如果是公共文件且只有查看的权限的用户的预览对接的三方是永中
const that = this; const that = this
if(currentRootDisk.disk==="COMMON" && rights==="LOOK"){ if (currentRootDisk.disk === 'COMMON' && rights === 'LOOK') {
switch (folderFormat) { switch (folderFormat) {
case 'PDF': case 'PDF':
case 'WORD': case 'WORD':
...@@ -136,155 +135,160 @@ class FolderList extends React.Component { ...@@ -136,155 +135,160 @@ class FolderList extends React.Component {
case 'EXCEL': case 'EXCEL':
case 'PPT': case 'PPT':
case 'PPTX': case 'PPTX':
that.handleYZPreviewDataDot(folderFormat); that.handleYZPreviewDataDot(folderFormat)
if(!fileVersionId){ if (!fileVersionId) {
this.setState({ this.setState(
previewing:true, {
showPreviewModal:true, previewing: true,
previewStatus:'UPLOAD' showPreviewModal: true,
},async ()=>{ previewStatus: 'UPLOAD',
const uploadParams ={ },
fileUrl:ossUrl, async () => {
instId:User.getStoreId(), const uploadParams = {
yoZoTypeEnum:'UPLOAD' fileUrl: ossUrl,
} instId: User.getStoreId(),
const uploadSign = await BaseService.getYoZoSign(uploadParams); yoZoTypeEnum: 'UPLOAD',
BaseService.yoZoUpload(ossUrl,YZ_APPId,uploadSign).then(async function (response){ }
const saveParams ={ const uploadSign = await BaseService.getYoZoSign(uploadParams)
fileVersionId:response.data.data.fileVersionId, BaseService.yoZoUpload(ossUrl, YZ_APPId, uploadSign).then(async function (response) {
folderId:id, const saveParams = {
instId:User.getStoreId(), fileVersionId: response.data.data.fileVersionId,
} folderId: id,
BaseService.saveYoZoFileVersionId(saveParams); instId: User.getStoreId(),
const { previewing } = that.state; }
if(previewing){ BaseService.saveYoZoFileVersionId(saveParams)
const previewParams ={ const { previewing } = that.state
fileVersionId:response.data.data.fileVersionId, if (previewing) {
instId:User.getStoreId(), const previewParams = {
yoZoTypeEnum:'VIEW', fileVersionId: response.data.data.fileVersionId,
htmlTitle:folderName instId: User.getStoreId(),
} yoZoTypeEnum: 'VIEW',
const previewSign = await BaseService.getYoZoSign(previewParams); htmlTitle: folderName,
}
const previewSign = await BaseService.getYoZoSign(previewParams)
const url = `${YZ_PREVIEW_URL}?fileVersionId=${response.data.data.fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}` const url = `${YZ_PREVIEW_URL}?fileVersionId=${response.data.data.fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}`
that.setState({ that.setState({
previewStatus:'UPLOAD_SUCCESS', previewStatus: 'UPLOAD_SUCCESS',
url url,
}) })
} }
}) })
}
}) )
}else{ } else {
const previewParams ={ const previewParams = {
fileVersionId, fileVersionId,
instId:User.getStoreId(), instId: User.getStoreId(),
yoZoTypeEnum:'VIEW', yoZoTypeEnum: 'VIEW',
htmlTitle:folderName htmlTitle: folderName,
} }
const previewSign = await BaseService.getYoZoSign(previewParams); const previewSign = await BaseService.getYoZoSign(previewParams)
const url = `${YZ_PREVIEW_URL}?fileVersionId=${fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}` const url = `${YZ_PREVIEW_URL}?fileVersionId=${fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}`
const a = document.createElement('a'); const a = document.createElement('a')
document.body.appendChild(a); document.body.appendChild(a)
a.setAttribute('href', url); a.setAttribute('href', url)
a.setAttribute('target', '_blank'); a.setAttribute('target', '_blank')
a.click(); a.click()
document.body.removeChild(a) document.body.removeChild(a)
} }
break; break
default: default:
const scanFileModal = ( const scanFileModal = (
<ScanFileModal <ScanFileModal
fileType={folderFormat} fileType={folderFormat}
item={folder} item={folder}
close={() => { close={() => {
this.setState({ scanFileModal: null }); this.setState({ scanFileModal: null })
}} }}
/> />
); )
this.setState({ scanFileModal }); this.setState({ scanFileModal })
break; break
} }
}else{ } else {
switch (folderFormat) { switch (folderFormat) {
case 'PDF': case 'PDF':
window.open(ossUrl, "_blank"); window.open(ossUrl, '_blank')
break; break
case "WORD": case 'WORD':
case "DOCX": case 'DOCX':
case "DOC": case 'DOC':
case "EXCEL": case 'EXCEL':
case "PPT": case 'PPT':
case "PPTX": case 'PPTX':
case "PDF": case 'PDF':
if ((folderFormat === 'PPT' || folderFormat === 'PPTX' || if (
folderFormat === 'DOCX' || folderFormat === 'WORD' || (folderFormat === 'PPT' || folderFormat === 'PPTX' || folderFormat === 'DOCX' || folderFormat === 'WORD' || folderFormat === 'DOC') &&
folderFormat === 'DOC') && folderSize > 10 * DEFAULT_SIZE_UNIT) { folderSize > 10 * DEFAULT_SIZE_UNIT
) {
Modal.confirm({ Modal.confirm({
title: '抱歉,不能在线预览', title: '抱歉,不能在线预览',
content: '由于文件较大,不支持在线预览,请下载后再查看', content: '由于文件较大,不支持在线预览,请下载后再查看',
okText: "下载", okText: '下载',
onOk: () => { onOk: () => {
const a = document.createElement('a'); const a = document.createElement('a')
a.href = ossUrl; a.href = ossUrl
a.click(); a.click()
} },
}); })
break; break
} }
const prefixUrl = `${OFFICE_PREVIEW_URL}?src=`; const prefixUrl = `${OFFICE_PREVIEW_URL}?src=`
const scanUrl = `${prefixUrl}${encodeURIComponent(ossUrl)}` const scanUrl = `${prefixUrl}${encodeURIComponent(ossUrl)}`
window.open(scanUrl, "_blank"); window.open(scanUrl, '_blank')
break; break
default: default:
const scanFileModal = <ScanFileModal const scanFileModal = (
<ScanFileModal
fileType={folderFormat} fileType={folderFormat}
item={folder} item={folder}
close={() => { close={() => {
this.setState({ scanFileModal: null }) this.setState({ scanFileModal: null })
}} }}
/> />
this.setState({ scanFileModal }); )
break; this.setState({ scanFileModal })
break
} }
} }
// 预览文件埋点 // 预览文件埋点
this.handleDataDot(folderFormat); this.handleDataDot(folderFormat)
} }
cancelPreview = ()=>{ cancelPreview = () => {
this.setState({ this.setState({
previewing:false, previewing: false,
showPreviewModal:false, showPreviewModal: false,
previewStatus:'UPLOAD' previewStatus: 'UPLOAD',
}) })
} }
// 选择文件夹 // 选择文件夹
handleSelectFolder = (folder) => { handleSelectFolder = (folder) => {
const { folderPathList, showResultPage, currentRootDisk } = this.props; const { folderPathList, showResultPage, currentRootDisk } = this.props
// 判断是否是员工文件的根目录 // 判断是否是员工文件的根目录
const employeeDisk = currentRootDisk.disk === 'EMPLOYEE' && folderPathList.length === 1; const employeeDisk = currentRootDisk.disk === 'EMPLOYEE' && folderPathList.length === 1
if (showResultPage) { if (showResultPage) {
folderPathList.pop(); folderPathList.pop()
} }
folderPathList.push({ folderPathList.push({
id: folder.id, id: folder.id,
folderName: folder.folderName folderName: folder.folderName,
}); })
this.setState({ this.setState({
parentRights: folder.rights, parentRights: folder.rights,
}) })
this.props.onChangeFolderPath(folderPathList); this.props.onChangeFolderPath(folderPathList)
this.props.onRefresh({ this.props.onRefresh({
parentId: folder.id, parentId: folder.id,
parentRights: folder.rights, parentRights: folder.rights,
folderIdType: employeeDisk ? 'USER' : 'FOLDER' folderIdType: employeeDisk ? 'USER' : 'FOLDER',
}); })
} }
// 修改文件路径 // 修改文件路径
handleChangeFolderPath = (folder) => { handleChangeFolderPath = (folder) => {
const { instId } = window.currentUserInstInfo; const { instId } = window.currentUserInstInfo
const { id } = folder; const { id } = folder
const { currentRootDisk } = this.props; const { currentRootDisk } = this.props
const params = { const params = {
id, id,
instId, instId,
...@@ -292,16 +296,16 @@ class FolderList extends React.Component { ...@@ -292,16 +296,16 @@ class FolderList extends React.Component {
} }
Service.Hades('public/hadesStore/folderPath', params).then((res) => { Service.Hades('public/hadesStore/folderPath', params).then((res) => {
const { result = [] } = res; const { result = [] } = res
this.props.onChangeFolderPath(result, false); this.props.onChangeFolderPath(result, false)
}) })
} }
parseColumns = () => { parseColumns = () => {
const { currentRootDisk, showResultPage, folderPathList } = this.props; const { currentRootDisk, showResultPage, folderPathList } = this.props
const hasManagementAuthority = currentRootDisk.uploadPower; const hasManagementAuthority = currentRootDisk.uploadPower
// 判断是否是员工文件的根目录 // 判断是否是员工文件的根目录
const employeeDisk = currentRootDisk.disk === 'EMPLOYEE' && folderPathList.length === 1; const employeeDisk = currentRootDisk.disk === 'EMPLOYEE' && folderPathList.length === 1
const columns = [ const columns = [
{ {
...@@ -309,81 +313,66 @@ class FolderList extends React.Component { ...@@ -309,81 +313,66 @@ class FolderList extends React.Component {
key: 'folderName', key: 'folderName',
dataIndex: 'folderName', dataIndex: 'folderName',
width: '28%', width: '28%',
sorter: (employeeDisk || !hasManagementAuthority) ? false : true, sorter: employeeDisk || !hasManagementAuthority ? false : true,
render: (value, record) => { render: (value, record) => {
const { folderType, folderFormat } = record; const { folderType, folderFormat } = record
const isFolder = folderType === 'FOLDER'; const isFolder = folderType === 'FOLDER'
let imgSrc = !isFolder ? let imgSrc = !isFolder ? FILE_TYPE_ICON_MAP[folderFormat] : 'https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594871430788.png'
FILE_TYPE_ICON_MAP[folderFormat] :
'https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594871430788.png';
if (employeeDisk) { if (employeeDisk) {
imgSrc = 'https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594871440736.png' imgSrc = 'https://xiaomai-image.oss-cn-hangzhou.aliyuncs.com/1594871440736.png'
} }
return ( return (
<div <div className='file-name' onClick={() => this.handleSelect(record)}>
className="file-name" {<img alt='img-src' className='file-name__icon' src={imgSrc} />}
onClick={() => this.handleSelect(record)} <span className={`file-name__text ${!isFolder ? 'highlight' : ''}`}>{value}</span>
>
{
<img
alt="img-src"
className="file-name__icon"
src={imgSrc}
/>
}
<span
className={`file-name__text ${!isFolder ? 'highlight' : ''}`}
>
{value}
</span>
</div> </div>
) )
} },
}, },
{ {
title: '更新时间', title: '更新时间',
key: 'updated', key: 'updated',
dataIndex: 'updated', dataIndex: 'updated',
sorter: (employeeDisk || !hasManagementAuthority) ? false : true, sorter: employeeDisk || !hasManagementAuthority ? false : true,
render: (value) => { render: (value) => {
return <span>{formatDate('YYYY-MM-DD H:i', value)}</span> return <span>{formatDate('YYYY-MM-DD H:i', value)}</span>
} },
}, },
{ {
title: '大小', title: '大小',
key: 'folderSize', key: 'folderSize',
dataIndex: 'folderSize', dataIndex: 'folderSize',
width: '10%', width: '10%',
sorter: (employeeDisk || !hasManagementAuthority) ? false : true, sorter: employeeDisk || !hasManagementAuthority ? false : true,
render: (value, record) => { render: (value, record) => {
const { folderType } = record; const { folderType } = record
const _fileSize = Number(value); const _fileSize = Number(value)
let _size = `${(_fileSize / DEFAULT_SIZE_UNIT).toFixed(1)}M`; let _size = `${(_fileSize / DEFAULT_SIZE_UNIT).toFixed(1)}M`
if (_fileSize < 0.1 * DEFAULT_SIZE_UNIT) { if (_fileSize < 0.1 * DEFAULT_SIZE_UNIT) {
_size = `${(_fileSize / 1024).toFixed(1)}kb`; _size = `${(_fileSize / 1024).toFixed(1)}kb`
}
return (
<span>{folderType === 'FILE' ? _size : '-'}</span>
)
} }
return <span>{folderType === 'FILE' ? _size : '-'}</span>
},
}, },
{ {
title: '操作', title: '操作',
key: 'operate', key: 'operate',
render: (value, record) => { render: (value, record) => {
if ((!(currentRootDisk.disk === 'COMMON' && (folderPathList.length === 1 || record.folderType === 'FOLDER')) || if (
hasManagementAuthority) && !(record.rights==="LOOK") ){ (!(currentRootDisk.disk === 'COMMON' && (folderPathList.length === 1 || record.folderType === 'FOLDER')) || hasManagementAuthority) &&
!(record.rights === 'LOOK')
) {
return ( return (
<Dropdown overlay={this.renderMenu(record)} trigger={['hover']}> <Dropdown overlay={this.renderMenu(record)} trigger={['hover']}>
<span className="icon iconfont">&#xe62c;</span> <span className='icon iconfont'>&#xe62c;</span>
</Dropdown> </Dropdown>
) )
} }
return <span>-</span> return <span>-</span>
} },
} },
] ]
// 公共文件需要显示创建者 // 公共文件需要显示创建者
...@@ -391,8 +380,8 @@ class FolderList extends React.Component { ...@@ -391,8 +380,8 @@ class FolderList extends React.Component {
columns.splice(1, 0, { columns.splice(1, 0, {
title: '创建者', title: '创建者',
key: 'createName', key: 'createName',
dataIndex: 'createName' dataIndex: 'createName',
}); })
} }
// 搜索结果需要显示所在目录 // 搜索结果需要显示所在目录
...@@ -402,38 +391,39 @@ class FolderList extends React.Component { ...@@ -402,38 +391,39 @@ class FolderList extends React.Component {
key: 'parentName', key: 'parentName',
dataIndex: 'parentName', dataIndex: 'parentName',
render: (value, record) => { render: (value, record) => {
return <span return (
className="file-path" <span className='file-path' onClick={() => this.handleChangeFolderPath(record)}>
onClick={() => this.handleChangeFolderPath(record)}
>
{value || currentRootDisk.folderName} {value || currentRootDisk.folderName}
</span> </span>
} )
},
}) })
} }
return columns; return columns
} }
// 删除文件 // 删除文件
handleDeleteFolder = (folder) => { handleDeleteFolder = (folder) => {
const { currentRootDisk: { disk } } = this.props; const {
currentRootDisk: { disk },
} = this.props
Modal.confirm({ Modal.confirm({
title: '确认删除所选的文件吗?', title: '确认删除所选的文件吗?',
content: '删除后,数据将无法恢复。', content: '删除后,数据将无法恢复。',
icon:<span className="icon iconfont default-confirm-icon">&#xe839; </span>, icon: <span className='icon iconfont default-confirm-icon'>&#xe839; </span>,
okType: 'danger', okType: 'danger',
onOk: () => { onOk: () => {
const { currentFolder } = this.state; const { currentFolder } = this.state
Service.Hades(DEL_FOLDER_URL_MAP[disk], { Service.Hades(DEL_FOLDER_URL_MAP[disk], {
operatorId: User.getUserId(), operatorId: User.getUserId(),
storeId: User.getStoreId(), storeId: User.getStoreId(),
ids: [folder.id], ids: [folder.id],
}).then(() => { }).then(() => {
message.success('删除成功'); message.success('删除成功')
this.props.onRefresh({ parentId: currentFolder.id || null }); this.props.onRefresh({ parentId: currentFolder.id || null })
})
},
}) })
}
});
} }
// 重命名 // 重命名
...@@ -443,90 +433,90 @@ class FolderList extends React.Component { ...@@ -443,90 +433,90 @@ class FolderList extends React.Component {
visible: true, visible: true,
id: folder.id, id: folder.id,
folderName: folder.folderName, folderName: folder.folderName,
} },
}); })
} }
// 重命名完成或者取消重命名之后隐藏重命名弹窗 // 重命名完成或者取消重命名之后隐藏重命名弹窗
handleRenameDone = (folderName) => { handleRenameDone = (folderName) => {
return new Promise((resolve) => { return new Promise((resolve) => {
const { renameModalData, currentFolder } = this.state; const { renameModalData, currentFolder } = this.state
const { folderPathList } = this.props; const { folderPathList } = this.props
// 名称未修改不发送请求 // 名称未修改不发送请求
if (folderName === renameModalData.folderName) { if (folderName === renameModalData.folderName) {
this.setState({ renameModalData: {} }); this.setState({ renameModalData: {} })
return; return
} }
// 判断是否有同名文件 // 判断是否有同名文件
this.handleGetSameNameFiles(folderName).then((res) => { this.handleGetSameNameFiles(folderName).then((res) => {
if ((!!res) || (res && Object.keys(res).length)) { if (!!res || (res && Object.keys(res).length)) {
if (!res.isLook && folderPathList.length === 1) { if (!res.isLook && folderPathList.length === 1) {
message.warning('此目录下已存在同名文件,有疑问请联系机构校长'); message.warning('此目录下已存在同名文件,有疑问请联系机构校长')
} else { } else {
message.warning('此目录下已存在同名文件'); message.warning('此目录下已存在同名文件')
} }
return; return
} }
Service.Hades('public/hadesStore/renameFolder', { Service.Hades('public/hadesStore/renameFolder', {
id: renameModalData.id, id: renameModalData.id,
name: folderName name: folderName,
}).then(res2 => { }).then((res2) => {
if (!res2.success) { if (!res2.success) {
const errorMessage = '此目录下已存在同名文件'; const errorMessage = '此目录下已存在同名文件'
message.warning(errorMessage); message.warning(errorMessage)
return; return
} else { } else {
message.success('重命名成功'); message.success('重命名成功')
this.setState({ renameModalData: {} }); this.setState({ renameModalData: {} })
this.props.onRefresh({ parentId: currentFolder.id || null }); this.props.onRefresh({ parentId: currentFolder.id || null })
} }
}); })
}); })
}) })
} }
// 获取同名文件 // 获取同名文件
handleGetSameNameFiles = async (folderName) => { handleGetSameNameFiles = async (folderName) => {
const { currentRootDisk, folderPathList } = this.props; const { currentRootDisk, folderPathList } = this.props
const currentFolder = folderPathList[folderPathList.length - 1]; const currentFolder = folderPathList[folderPathList.length - 1]
const { instId } = window.currentUserInstInfo; const { instId } = window.currentUserInstInfo
const params = { const params = {
createId:User.getUserId(), createId: User.getUserId(),
name: folderName, name: folderName,
disk: currentRootDisk.disk, disk: currentRootDisk.disk,
parentId: currentFolder.id, parentId: currentFolder.id,
folderType: 'FOLDER', folderType: 'FOLDER',
} }
const res = await Service.Hades('public/hadesStore/sameNameFile', params); const res = await Service.Hades('public/hadesStore/sameNameFile', params)
const { result } = res; const { result } = res
return result; return result
} }
// 显示移动文件弹窗 // 显示移动文件弹窗
handleShowSelectFileModal = (file) => { handleShowSelectFileModal = (file) => {
this.setState({ this.setState({
currentFile: file, currentFile: file,
showSelectFileModal: true showSelectFileModal: true,
}); })
} }
// 显示复制文件弹窗 // 显示复制文件弹窗
handleShowCopyFileModal = (file) => { handleShowCopyFileModal = (file) => {
this.setState({ this.setState({
currentFile: file, currentFile: file,
showCopyFileModal: true showCopyFileModal: true,
}); })
} }
// 显示管理成员弹窗 // 显示管理成员弹窗
handleShowManagingModal = (file) => { handleShowManagingModal = (file) => {
this.setState({ this.setState({
currentFile: file, currentFile: file,
showManagingModal: true showManagingModal: true,
}); })
} }
getBlob = (url) => { getBlob = (url) => {
...@@ -584,40 +574,40 @@ class FolderList extends React.Component { ...@@ -584,40 +574,40 @@ class FolderList extends React.Component {
// return; // return;
// } // }
const dom = document.querySelector('#detailFileInput'); const dom = document.querySelector('#detailFileInput')
dom.click(); dom.click()
} }
// 准备上传 // 准备上传
handleUpload = (event) => { handleUpload = (event) => {
const fileList = event.target.files; const fileList = event.target.files
// 判断文件的大小是否超出了限制 // 判断文件的大小是否超出了限制
const nonCompliantFileList = []; const nonCompliantFileList = []
const _fileList = [...fileList]; const _fileList = [...fileList]
_fileList.map((file, index) => { _fileList.map((file, index) => {
let { size, type, name } = file; let { size, type, name } = file
if (!type) { if (!type) {
type = getFileTypeByName(name); type = getFileTypeByName(name)
} }
if (type.indexOf('image') > -1 && size > 50 * DEFAULT_SIZE_UNIT) { if (type.indexOf('image') > -1 && size > 50 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file); nonCompliantFileList.push(file)
_fileList.splice(index, 1); _fileList.splice(index, 1)
} }
if (type.indexOf('audio') > -1 && size > 50 * DEFAULT_SIZE_UNIT) { if (type.indexOf('audio') > -1 && size > 50 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file); nonCompliantFileList.push(file)
_fileList.splice(index, 1); _fileList.splice(index, 1)
} }
if (type.indexOf('video') > -1 && size > 2000 * DEFAULT_SIZE_UNIT) { if (type.indexOf('video') > -1 && size > 2000 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file); nonCompliantFileList.push(file)
_fileList.splice(index, 1); _fileList.splice(index, 1)
} }
if (loaclFileType.indexOf(type) > -1 && size > 100 * DEFAULT_SIZE_UNIT) { if (loaclFileType.indexOf(type) > -1 && size > 100 * DEFAULT_SIZE_UNIT) {
nonCompliantFileList.push(file); nonCompliantFileList.push(file)
_fileList.splice(index, 1); _fileList.splice(index, 1)
} }
file.key = count++; file.key = count++
return file; return file
}); })
// 不符合规则的文件列表 // 不符合规则的文件列表
if (nonCompliantFileList.length > 0) { if (nonCompliantFileList.length > 0) {
this.setState({ this.setState({
...@@ -625,38 +615,38 @@ class FolderList extends React.Component { ...@@ -625,38 +615,38 @@ class FolderList extends React.Component {
showNonCompliantFileModal: true, showNonCompliantFileModal: true,
}) })
} else { } else {
this.handleShowUploadModal(_fileList); this.handleShowUploadModal(_fileList)
} }
// 清空文件,防止第二次无法上传同一个文件 // 清空文件,防止第二次无法上传同一个文件
const dom = document.querySelector('#detailFileInput'); const dom = document.querySelector('#detailFileInput')
dom.value = ''; dom.value = ''
} }
// 显示上传进度弹窗 // 显示上传进度弹窗
handleShowUploadModal = (fileList) => { handleShowUploadModal = (fileList) => {
// 保存当前路径 // 保存当前路径
const { folderPathList } = this.props; const { folderPathList } = this.props
if (fileList.length) { if (fileList.length) {
this.setState({ this.setState({
showUploadModal: true, showUploadModal: true,
localFileList: fileList, localFileList: fileList,
uploadFolderPath: folderPathList[folderPathList.length - 1] uploadFolderPath: folderPathList[folderPathList.length - 1],
}); })
} }
} }
// 上传成功 // 上传成功
handleUploadDone = (file, resourceId) => { handleUploadDone = (file, resourceId) => {
this.props.onCreate(file, resourceId); this.props.onCreate(file, resourceId)
} }
// 取消上传 // 取消上传
handleHiddenUploadModal = () => { handleHiddenUploadModal = () => {
this.setState({ this.setState({
showUploadModal: false, showUploadModal: false,
localFileList: [] localFileList: [],
}); })
} }
// 余额欠费提示弹窗 // 余额欠费提示弹窗
...@@ -664,111 +654,123 @@ class FolderList extends React.Component { ...@@ -664,111 +654,123 @@ class FolderList extends React.Component {
Modal.info({ Modal.info({
title: '无法继续操作', title: '无法继续操作',
content: '直播系统已升级,请联系运营老师。', content: '直播系统已升级,请联系运营老师。',
icon: <span className="icon iconfont default-confirm-icon">&#xe6f4;</span> icon: <span className='icon iconfont default-confirm-icon'>&#xe6f4;</span>,
}) })
} }
// 排序 // 排序
handleChangeTable = (pagination, filters, sorter) => { handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter
let sort = null; let sort = null
if (columnKey === 'folderName' && order === 'ascend') { sort = 'NAME_ASC'; } if (columnKey === 'folderName' && order === 'ascend') {
if (columnKey === 'folderName' && order === 'descend') { sort = 'NAME_DESC'; } sort = 'NAME_ASC'
if (columnKey === 'folderSize' && order === 'ascend') { sort = 'SIZE_ASC'; } }
if (columnKey === 'folderSize' && order === 'descend') { sort = 'SIZE_DESC'; } if (columnKey === 'folderName' && order === 'descend') {
if (columnKey === 'updated' && order === 'ascend') { sort = 'UPDATE_ASC'; } sort = 'NAME_DESC'
if (columnKey === 'updated' && order === 'descend') { sort = 'UPDATE_DESC'; } }
if (columnKey === 'folderSize' && order === 'ascend') {
sort = 'SIZE_ASC'
}
if (columnKey === 'folderSize' && order === 'descend') {
sort = 'SIZE_DESC'
}
if (columnKey === 'updated' && order === 'ascend') {
sort = 'UPDATE_ASC'
}
if (columnKey === 'updated' && order === 'descend') {
sort = 'UPDATE_DESC'
}
const { currentFolder } = this.state; const { currentFolder } = this.state
this.props.onRefresh({ this.props.onRefresh({
sort, sort,
parentId: currentFolder.id || null parentId: currentFolder.id || null,
}); })
} }
// 操作选项 // 操作选项
renderMenu = (record) => { renderMenu = (record) => {
const { currentRootDisk } = this.props; const { currentRootDisk } = this.props
// 是否有编辑权限 // 是否有编辑权限
const hasManagementAuthority = currentRootDisk.uploadPower; const hasManagementAuthority = currentRootDisk.uploadPower
// 公共文件权限和复制权限 // 公共文件权限和复制权限
const { folderType, rights } = record; const { folderType, rights } = record
const menu = ( const menu = (
<Menu> <Menu>
{ {rights === 'EDIT' &&
rights === "EDIT" && !record.parentId && !record.parentId && [
[ <Menu.Item key='administration'>
<Menu.Item key="administration">
<span onClick={() => this.handleShowManagingModal(record)}>权限管理</span> <span onClick={() => this.handleShowManagingModal(record)}>权限管理</span>
</Menu.Item>, </Menu.Item>,
<Menu.Divider key="administration-bottom"/> <Menu.Divider key='administration-bottom' />,
] ]}
} {folderType === 'FILE' && (rights === 'LOOK_DOWNLOAD' || rights === 'EDIT') && (
{(folderType === 'FILE' && (rights === "LOOK_DOWNLOAD" || rights === 'EDIT') ) && <Menu.Item key='download'>
<Menu.Item key="download"> <span
<span onClick={() => { this.handleDownload(record) }}>下载</span> onClick={() => {
this.handleDownload(record)
}}>
下载
</span>
</Menu.Item> </Menu.Item>
} )}
{(rights === "LOOK_DOWNLOAD" || rights === 'EDIT') && {(rights === 'LOOK_DOWNLOAD' || rights === 'EDIT') && (
<Menu.Item key='copy'>
<Menu.Item key="copy">
<span onClick={() => this.handleShowCopyFileModal(record)}>复制到</span> <span onClick={() => this.handleShowCopyFileModal(record)}>复制到</span>
</Menu.Item> </Menu.Item>
} )}
{ {hasManagementAuthority &&
hasManagementAuthority && rights === "EDIT" && rights === 'EDIT' && [
[ <Menu.Item key='move'>
<Menu.Item key="move">
<span onClick={() => this.handleShowSelectFileModal(record)}>移动到</span> <span onClick={() => this.handleShowSelectFileModal(record)}>移动到</span>
</Menu.Item>, </Menu.Item>,
<Menu.Item key="rename"> <Menu.Item key='rename'>
<span onClick={() => this.handleRename(record)}>重命名</span> <span onClick={() => this.handleRename(record)}>重命名</span>
</Menu.Item>, </Menu.Item>,
<Menu.Divider key="administration-top"/>, <Menu.Divider key='administration-top' />,
<Menu.Item key="delete"> <Menu.Item key='delete'>
<span onClick={() => this.handleDeleteFolder(record)}>删除</span> <span onClick={() => this.handleDeleteFolder(record)}>删除</span>
</Menu.Item> </Menu.Item>,
] ]}
}
</Menu> </Menu>
); )
return menu; return menu
} }
render() { render() {
const {
currentFolder, currentFile, renameModalData, showSelectFileModal,
showUploadModal, localFileList, showCopyFileModal, showManagingModal,
showPreviewModal, previewStatus,url
} = this.state;
const { const {
selectedFileIds, folderList, showResultPage, currentFolder,
currentRootDisk, query, totalCount, folderPathList currentFile,
} = this.props; renameModalData,
const _disk = folderPathList[0].disk; showSelectFileModal,
showUploadModal,
localFileList,
showCopyFileModal,
showManagingModal,
showPreviewModal,
previewStatus,
url,
} = this.state
const { selectedFileIds, folderList, showResultPage, currentRootDisk, query, totalCount, folderPathList } = this.props
const _disk = folderPathList[0].disk
// 是否有编辑权限 // 是否有编辑权限
const hasManagementAuthority = currentRootDisk.uploadPower; const hasManagementAuthority = currentRootDisk.uploadPower
return ( return (
<div className="file-list"> <div className='file-list'>
<Choose> <Choose>
<When condition={!_.isEmpty(folderList)}> <When condition={!_.isEmpty(folderList)}>
<Table <Table
key="table" key='table'
rowKey={(record) => record.id} rowKey={(record) => record.id}
columns={this.parseColumns()} columns={this.parseColumns()}
showSorterTooltip={false} showSorterTooltip={false}
dataSource={folderList} dataSource={folderList}
rowSelection={ rowSelection={{
{
selectedRowKeys: selectedFileIds, selectedRowKeys: selectedFileIds,
onChange: this.props.onChangeRow onChange: this.props.onChangeRow,
} }}
}
pagination={false} pagination={false}
onChange={this.handleChangeTable} onChange={this.handleChangeTable}
/> />
...@@ -778,42 +780,43 @@ class FolderList extends React.Component { ...@@ -778,42 +780,43 @@ class FolderList extends React.Component {
total={totalCount} total={totalCount}
showSizeChanger={true} showSizeChanger={true}
toPage={(page) => { toPage={(page) => {
this.props.onChangePage('current', page + 1); this.props.onChangePage('current', page + 1)
}} }}
onShowSizeChange={(current, size) => { onShowSizeChange={(current, size) => {
const that = this; const that = this
setTimeout(()=>{ setTimeout(() => {
this.props.onChangePage('size', size) this.props.onChangePage('size', size)
},1000) }, 1000)
}} }}
/> />
</When> </When>
<Otherwise> <Otherwise>
<XMTable <XMTable
className="add-empty" className='add-empty'
renderEmpty={{ renderEmpty={{
image: !showResultPage ? addData : search, image: !showResultPage ? addData : search,
description: <Choose> description: (
<Choose>
<When condition={!showResultPage}> <When condition={!showResultPage}>
<input <input
multiple multiple
type="file" type='file'
style={{ display: 'none' }} style={{ display: 'none' }}
id="detailFileInput" id='detailFileInput'
accept=".ppt,.pptx,.doc,.docx,.pdf,.jpg,.jpeg,.png,.mp3,.mp4,.xlsx,.xls" accept='.ppt,.pptx,.doc,.docx,.pdf,.jpg,.jpeg,.png,.mp3,.mp4,.xlsx,.xls'
onChange={(e) => this.handleUpload(e)} onChange={(e) => this.handleUpload(e)}
/> />
{ {
<Choose> <Choose>
<When condition={hasManagementAuthority}> <When condition={hasManagementAuthority}>
<div className="lottie-icon-title">你还没有上传文件,点击 <div className='lottie-icon-title'>
<Tooltip title="支持文件类型:ppt、word、excel、pdf、jpg、mp3、mp4,上传后默认私密,可邀请其他成员协作,支持批量上传文件"> 你还没有上传文件,点击
<span <Tooltip title='支持文件类型:ppt、word、excel、pdf、jpg、mp3、mp4,上传后默认私密,可邀请其他成员协作,支持批量上传文件'>
className="upload-btn" <span className='upload-btn' onClick={this.handleChooseFile}>
onClick={this.handleChooseFile} 上传文件
>上传文件</span> </span>
</Tooltip> </Tooltip>
按钮 按钮
</div> </div>
...@@ -825,9 +828,10 @@ class FolderList extends React.Component { ...@@ -825,9 +828,10 @@ class FolderList extends React.Component {
} }
</When> </When>
<Otherwise> <Otherwise>
<div className="desc">搜索无结果</div> <div className='desc'>搜索无结果</div>
</Otherwise> </Otherwise>
</Choose> </Choose>
),
}} }}
/> />
</Otherwise> </Otherwise>
...@@ -839,12 +843,11 @@ class FolderList extends React.Component { ...@@ -839,12 +843,11 @@ class FolderList extends React.Component {
folderPathList={folderPathList} folderPathList={folderPathList}
isOpen={renameModalData.visible} isOpen={renameModalData.visible}
onClose={() => { onClose={() => {
this.setState({ renameModalData: {} }); this.setState({ renameModalData: {} })
}} }}
onOk={this.handleRenameDone} onOk={this.handleRenameDone}
/> />
<UploadProgressModal <UploadProgressModal
isOpen={showUploadModal} isOpen={showUploadModal}
currentFolder={currentFolder} currentFolder={currentFolder}
...@@ -857,43 +860,39 @@ class FolderList extends React.Component { ...@@ -857,43 +860,39 @@ class FolderList extends React.Component {
isOpen={showSelectFileModal} isOpen={showSelectFileModal}
currentRootDisk={currentRootDisk} currentRootDisk={currentRootDisk}
onClose={() => { onClose={() => {
this.setState({ showSelectFileModal: false }); this.setState({ showSelectFileModal: false })
}} }}
onMove={(query) => { onMove={(query) => {
this.setState({ showSelectFileModal: false }); this.setState({ showSelectFileModal: false })
this.props.onMove(query, [currentFile.id],[currentFile.folderType]); this.props.onMove(query, [currentFile.id], [currentFile.folderType])
}} }}
/> />
{ {showCopyFileModal && (
showCopyFileModal &&
<CopyFileModal <CopyFileModal
isOpen={showCopyFileModal} isOpen={showCopyFileModal}
dataInfo={currentFile} dataInfo={currentFile}
currentRootDisk={currentRootDisk} currentRootDisk={currentRootDisk}
onClose={() => { onClose={() => {
this.setState({ showCopyFileModal: false }); this.setState({ showCopyFileModal: false })
}} }}
/> />
} )}
{ {showManagingModal && (
showManagingModal &&
<ManagingMembersModal <ManagingMembersModal
isOpen={showManagingModal} isOpen={showManagingModal}
dataInfo={currentFile} dataInfo={currentFile}
disk={_disk} disk={_disk}
onClose={() => { onClose={() => {
this.setState({ showManagingModal: false }); this.setState({ showManagingModal: false })
}} }}
/> />
} )}
{ showPreviewModal && {showPreviewModal && <PreviewFileModal onCancel={() => this.cancelPreview()} previewStatus={previewStatus} url={url} />}
<PreviewFileModal onCancel={()=>this.cancelPreview()} previewStatus={previewStatus} url={url}/> {this.state.scanFileModal}
} {this.state.chargeModal}
{ this.state.scanFileModal }
{ this.state.chargeModal }
</div> </div>
) )
} }
} }
export default FolderList; export default FolderList
\ No newline at end of file
import React from 'react'; import React from 'react'
import Service from '@/common/js/service'; import Service from '@/common/js/service'
import { DISK_MAP } from '@/domains/resource-disk/constants'; import { DISK_MAP } from '@/domains/resource-disk/constants'
import FolderManage from './components/FolderManage'; import FolderManage from './components/FolderManage'
import DiskList from './components/DiskList'; import DiskList from './components/DiskList'
import './index.less'; import './index.less'
const defaultRootDisk = { const defaultRootDisk = {
folderName: '公共文件', folderName: '公共文件',
disk: 'COMMON', disk: 'COMMON',
uploadPower: true uploadPower: true,
} }
class PrepareLessonPage extends React.Component { class PrepareLessonPage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props)
this.state = { this.state = {
// 目前只有公共文件,先由前端定义 // 目前只有公共文件,先由前端定义
diskList: [ diskList: [
{ {
folderName: '公共文件', folderName: '公共文件',
disk: 'COMMON', disk: 'COMMON',
uploadPower: true uploadPower: true,
} },
], // 可见磁盘目录 ], // 可见磁盘目录
currentRootDisk: defaultRootDisk currentRootDisk: defaultRootDisk,
} }
} }
handleChangeDisk = (disk) => { handleChangeDisk = (disk) => {
this.setState({ this.setState({
currentRootDisk: disk currentRootDisk: disk,
}); })
} }
render() { render() {
const { currentRootDisk, diskList } = this.state; const { currentRootDisk, diskList } = this.state
console.log('currentRootDisk',currentRootDisk); console.log('currentRootDisk', currentRootDisk)
return ( return (
<div className="prepare-lesson-page page"> <div className='prepare-lesson-page page'>
<div className="content-header">资料云盘</div> <div className='content-header'>素材库</div>
<div className="box content-body"> <div className='box content-body'>
<DiskList <DiskList diskList={diskList} currentRootDisk={currentRootDisk} onChange={this.handleChangeDisk} />
diskList={diskList} <FolderManage currentRootDisk={currentRootDisk} />
currentRootDisk={currentRootDisk}
onChange={this.handleChangeDisk}
/>
<FolderManage
currentRootDisk={currentRootDisk}
/>
</div> </div>
</div> </div>
) )
} }
} }
export default PrepareLessonPage; export default PrepareLessonPage
\ No newline at end of file
...@@ -5,37 +5,37 @@ ...@@ -5,37 +5,37 @@
* @LastEditTime: 2021-05-13 16:39:51 * @LastEditTime: 2021-05-13 16:39:51
* @Description: 内容线路由配置 * @Description: 内容线路由配置
*/ */
import Home from '@/modules/home/Home'; import Home from '@/modules/home/Home'
import EmployeesManagePage from '@/modules/store-manage/EmployeesManagePage'; import EmployeesManagePage from '@/modules/store-manage/EmployeesManagePage'
import EmployeeManage from '@/modules/college-manage/EmployeeManage'; import EmployeeManage from '@/modules/college-manage/EmployeeManage'
import personalInfoPage from '@/modules/personalInfo'; import personalInfoPage from '@/modules/personalInfo'
import UserManagePage from '@/modules/store-manage/UserManagePage'; import UserManagePage from '@/modules/store-manage/UserManagePage'
import UserManage from '@/modules/college-manage/UserManagePage'; import UserManage from '@/modules/college-manage/UserManagePage'
import StoreDecorationPage from '@/modules/store-manage/StoreDecorationPage'; import StoreDecorationPage from '@/modules/store-manage/StoreDecorationPage'
import CourseCatalogPage from '@/modules/store-manage/CourseCatalogPage'; import CourseCatalogPage from '@/modules/store-manage/CourseCatalogPage'
import LiveCoursePage from '@/modules/course-manage/LiveCoursePage'; import LiveCoursePage from '@/modules/course-manage/LiveCoursePage'
import AddLivePage from '@/modules/course-manage/AddLive'; import AddLivePage from '@/modules/course-manage/AddLive'
import VideoCoursePage from '@/modules/course-manage/video-course'; import VideoCoursePage from '@/modules/course-manage/video-course'
import GraphicsCoursePage from '@/modules/course-manage/graphics-course'; import GraphicsCoursePage from '@/modules/course-manage/graphics-course'
import OfflineCoursePage from '@/modules/course-manage/offline-course'; import OfflineCoursePage from '@/modules/course-manage/offline-course'
import AddVideoCoursePage from '@/modules/course-manage/video-course/AddVideoCourse'; import AddVideoCoursePage from '@/modules/course-manage/video-course/AddVideoCourse'
import AddGraphicsCoursePage from '@/modules/course-manage/graphics-course/AddGraphicsCourse'; import AddGraphicsCoursePage from '@/modules/course-manage/graphics-course/AddGraphicsCourse'
import AddOfflineCoursePage from '@/modules/course-manage/offline-course/AddOfflineCourse'; import AddOfflineCoursePage from '@/modules/course-manage/offline-course/AddOfflineCourse'
// import DataList from '@/modules/course-manage/DataList/DataList'; // import DataList from '@/modules/course-manage/DataList/DataList';
// import ClassBook from '@/modules/resource-disk'; // import ClassBook from '@/modules/resource-disk';
import ResourceDisk from '@/modules/resource-disk'; import ResourceDisk from '@/modules/resource-disk'
import SwitchRoute from '@/modules/root/SwitchRoute'; import SwitchRoute from '@/modules/root/SwitchRoute'
import PlanPage from '@/modules/plan-manage/PlanPage'; import PlanPage from '@/modules/plan-manage/PlanPage'
import AddPlanPage from '@/modules/plan-manage/AddPlan'; import AddPlanPage from '@/modules/plan-manage/AddPlan'
import LearningDataPage from '@/modules/plan-manage/LearningData'; import LearningDataPage from '@/modules/plan-manage/LearningData'
import StoreInfoPage from '@/modules/store-manage/StoreInfo'; import StoreInfoPage from '@/modules/store-manage/StoreInfo'
import CourseCategoryManage from '@/modules/teach-tool/components/CourseCategoryManage'; import CourseCategoryManage from '@/modules/teach-tool/components/CourseCategoryManage'
import QuestionManageIndex from '@/modules/teach-tool/question-manage/Index'; import QuestionManageIndex from '@/modules/teach-tool/question-manage/Index'
import PaperManageIndex from '@/modules/teach-tool/paper-manage/Index'; import PaperManageIndex from '@/modules/teach-tool/paper-manage/Index'
import ExaminationManagerIndex from '@/modules/teach-tool/examination-manager/Index'; import ExaminationManagerIndex from '@/modules/teach-tool/examination-manager/Index'
import ExaminationManagerTestDetail from '@/modules/teach-tool/examination-manager/TestDetailPage'; import ExaminationManagerTestDetail from '@/modules/teach-tool/examination-manager/TestDetailPage'
import KnowledgeBase from '@/modules/knowledge-base/index'; import KnowledgeBase from '@/modules/knowledge-base/index'
import CollegeInfoPage from '@/modules/college-manage/CollegeInfoPage'; import CollegeInfoPage from '@/modules/college-manage/CollegeInfoPage'
const mainRoutes = [ const mainRoutes = [
{ {
...@@ -91,7 +91,7 @@ const mainRoutes = [ ...@@ -91,7 +91,7 @@ const mainRoutes = [
{ {
path: '/offline-course', path: '/offline-course',
component: OfflineCoursePage, component: OfflineCoursePage,
name: '线下', name: '线下活动',
}, },
{ {
path: '/create-live-course', path: '/create-live-course',
...@@ -117,12 +117,12 @@ const mainRoutes = [ ...@@ -117,12 +117,12 @@ const mainRoutes = [
{ {
path: '/create-offline-course', path: '/create-offline-course',
component: AddOfflineCoursePage, component: AddOfflineCoursePage,
name: '创建线下', name: '创建线下活动',
}, },
{ {
path: '/resource-disk', path: '/resource-disk',
component: ResourceDisk, component: ResourceDisk,
name: '资料云盘', name: '素材库',
}, },
{ {
path: '/question-manage-index', path: '/question-manage-index',
...@@ -180,6 +180,6 @@ const mainRoutes = [ ...@@ -180,6 +180,6 @@ const mainRoutes = [
component: LearningDataPage, component: LearningDataPage,
name: '学习数据', name: '学习数据',
}, },
]; ]
export default mainRoutes; export default mainRoutes
...@@ -28,8 +28,8 @@ export const menuList: any = [ ...@@ -28,8 +28,8 @@ export const menuList: any = [
link: '/live-course', link: '/live-course',
}, },
{ {
groupName: "线上课", groupName: '线上课',
groupCode: "CourseVideoClass", groupCode: 'CourseVideoClass',
link: '/video-course', link: '/video-course',
}, },
{ {
...@@ -38,7 +38,7 @@ export const menuList: any = [ ...@@ -38,7 +38,7 @@ export const menuList: any = [
link: '/graphics-course', link: '/graphics-course',
}, },
{ {
groupName: '线下', groupName: '线下活动',
groupCode: 'OfflineClass', groupCode: 'OfflineClass',
link: '/offline-course', link: '/offline-course',
}, },
...@@ -91,7 +91,7 @@ export const menuList: any = [ ...@@ -91,7 +91,7 @@ export const menuList: any = [
selectImg: 'https://image.xiaomaiketang.com/xm/hJKCfibC22.png', selectImg: 'https://image.xiaomaiketang.com/xm/hJKCfibC22.png',
}, },
{ {
groupName: '资料云盘', groupName: '素材库',
groupCode: 'CloudDisk', groupCode: 'CloudDisk',
icon: '&#xe8aa;', icon: '&#xe8aa;',
link: '/resource-disk', link: '/resource-disk',
...@@ -151,4 +151,4 @@ export const menuList: any = [ ...@@ -151,4 +151,4 @@ export const menuList: any = [
}, },
], ],
}, },
]; ]
import LiveCoursePage from "@/modules/course-manage/LiveCoursePage"; import LiveCoursePage from '@/modules/course-manage/LiveCoursePage'
import ResourceDisk from "@/modules/resource-disk"; import ResourceDisk from '@/modules/resource-disk'
const redirectRoutes = [ const redirectRoutes = [
{ {
path: "/redirect-to-live-course", path: '/redirect-to-live-course',
component: LiveCoursePage, component: LiveCoursePage,
name: "课程管理", name: '课程管理',
}, },
{ {
path: "/redirect-to-resource-disk", path: '/redirect-to-resource-disk',
component: ResourceDisk, component: ResourceDisk,
name: "资料云盘", name: '素材库',
}, },
]; ]
export default redirectRoutes; export default redirectRoutes
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