Commit dada4189 by guomingpang
parents 70fdad21 88dbb461
...@@ -155,7 +155,7 @@ class ChooseMembersModal extends React.Component { ...@@ -155,7 +155,7 @@ class ChooseMembersModal extends React.Component {
let rightsList = []; // 保存新加进去的成员 let rightsList = []; // 保存新加进去的成员
selectUserList.map((item) => { selectUserList.map((item) => {
rightsList.push({ rightsList.push({
rights: "LOOK_DOWNLOAD", rights: "LOOK",
userId: item.userId userId: item.userId
}) })
return rightsList return rightsList
......
...@@ -19,7 +19,7 @@ class ManagingMembersModal extends React.Component { ...@@ -19,7 +19,7 @@ class ManagingMembersModal extends React.Component {
addManagingMember: false, // 是否点击了添加成员 addManagingMember: false, // 是否点击了添加成员
storeId :User.getStoreId() , // 学院Id storeId :User.getStoreId() , // 学院Id
iconRotateList: [], iconRotateList: [],
userAuthority : ['可编辑', '可查看/下载', '仅可查看', '', '创建者', '学院管理员'] , // 空 代表删除 userAuthority : ['可编辑', '可下载', '可查看', '', '创建者', '学院管理员'] , // 空 代表删除
} }
} }
componentDidMount() { componentDidMount() {
...@@ -64,7 +64,7 @@ class ManagingMembersModal extends React.Component { ...@@ -64,7 +64,7 @@ class ManagingMembersModal extends React.Component {
// 修改成员权限 // 修改成员权限
updateFileUserAuthority = (params, newRights = 1) => { updateFileUserAuthority = (params, newRights = 1) => {
const rightList = ['EDIT', 'LOOK_DOWNLOAD', '']; const rightList = ['EDIT', 'LOOK_DOWNLOAD', 'LOOK'];
let { iconRotateList } = this.state; let { iconRotateList } = this.state;
let _params = params; let _params = params;
_params.rights = rightList[newRights]; _params.rights = rightList[newRights];
...@@ -173,10 +173,10 @@ class ManagingMembersModal extends React.Component { ...@@ -173,10 +173,10 @@ class ManagingMembersModal extends React.Component {
<span className='menu-bottom'>下载、复制</span> <span className='menu-bottom'>下载、复制</span>
</div> </div>
</Menu.Item> </Menu.Item>
{/* <Menu.Item key="LOOK" > <Menu.Item key="LOOK" >
<div onClick={() => this.updateFileUserAuthority(params, 2)}>仅可查看</div> <div onClick={() => this.updateFileUserAuthority(params, 2)}>{userAuthority[2]}</div>
<span className='menu-bottom'>{userAuthority[2]}</span> <span className='menu-bottom'>查看</span>
</Menu.Item> */} </Menu.Item>
<Menu.Divider key='LINE'/> <Menu.Divider key='LINE'/>
<Menu.Item key="REMOVE" > <Menu.Item key="REMOVE" >
<div className='remove' onClick={() => this.removeUser(params, userAuthority[3])}>移除</div> <div className='remove' onClick={() => this.removeUser(params, userAuthority[3])}>移除</div>
...@@ -247,6 +247,8 @@ class ManagingMembersModal extends React.Component { ...@@ -247,6 +247,8 @@ class ManagingMembersModal extends React.Component {
num = 1; num = 1;
} else if (record.rights === "EDIT") { } else if (record.rights === "EDIT") {
num = 0; num = 0;
}else if(record.rights=="LOOK"){
num = 2;
} }
} }
return ( return (
......
...@@ -2,89 +2,89 @@ ...@@ -2,89 +2,89 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-03 15:13:12 * @Date: 2021-03-03 15:13:12
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-25 10:07:03 * @LastEditTime: 2021-06-15 17:54:04
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from '@/common/js/service' import Service from '@/common/js/service';
export function queryExternalCategoryTree(params: object) { export function queryExternalCategoryTree(params: object) {
return Service.Hades('public/externalHades/queryCategoryTree', params) return Service.Hades('public/externalHades/queryCategoryTree', params);
} }
export function queryCategoryTree(params: object) { export function queryCategoryTree(params: object) {
return Service.Hades('public/hades/queryCategoryTree', params) return Service.Hades('public/hades/queryCategoryTree', params);
} }
export function addCategory(params: object) { export function addCategory(params: object) {
return Service.Hades('public/hades/addCategory', params) return Service.Hades('public/hades/addCategory', params);
} }
export function delCategory(params: object) { export function delCategory(params: object) {
return Service.Hades('public/hades/delCategory', params) return Service.Hades('public/hades/delCategory', params);
} }
export function editCategory(params: object) { export function editCategory(params: object) {
return Service.Hades('public/hades/editCategory', params) return Service.Hades('public/hades/editCategory', params);
} }
export function editCategoryTree(params: object) { export function moveCategoryTree(params: object) {
return Service.Hades('public/hades/editCategoryTree', params) return Service.Hades('public/hades/editCategoryTree', params);
} }
export function queryQuestionPageList(params: object) { export function queryQuestionPageList(params: object) {
return Service.Hades('public/hades/queryQuestionPageList', params) return Service.Hades('public/hades/queryQuestionPageList', params);
} }
export function addQuestion(params: object) { export function addQuestion(params: object) {
return Service.Hades('public/hades/addQuestion', params) return Service.Hades('public/hades/addQuestion', params);
} }
export function deleteQuestion(params: object) { export function deleteQuestion(params: object) {
return Service.Hades('public/hades/deleteQuestion', params) return Service.Hades('public/hades/deleteQuestion', params);
} }
export function queryQuestionDetails(params: object) { export function queryQuestionDetails(params: object) {
return Service.Hades('public/hades/queryQuestionDetails', params) return Service.Hades('public/hades/queryQuestionDetails', params);
} }
export function editQuestion(params: object) { export function editQuestion(params: object) {
return Service.Hades('public/hades/editQuestion', params) return Service.Hades('public/hades/editQuestion', params);
} }
export function batchImport(params: object) { export function batchImport(params: object) {
return Service.Hades('public/hades/batchImport', params) return Service.Hades('public/hades/batchImport', params);
} }
export function createPaper(params: object) { export function createPaper(params: object) {
return Service.Hades('public/hades/createPaper', params) return Service.Hades('public/hades/createPaper', params);
} }
export function queryPaperPageList(params: object) { export function queryPaperPageList(params: object) {
return Service.Hades('public/hades/queryPaperPageList', params) return Service.Hades('public/hades/queryPaperPageList', params);
} }
export function deletePaper(params: object) { export function deletePaper(params: object) {
return Service.Hades('public/hades/deletePaper', params) return Service.Hades('public/hades/deletePaper', params);
} }
export function queryPaperDetail(params: object) { export function queryPaperDetail(params: object) {
return Service.Hades('public/hades/queryPaperDetail', params) return Service.Hades('public/hades/queryPaperDetail', params);
} }
export function viewPaper(params: object) { export function viewPaper(params: object) {
return Service.Hades('public/hades/viewPaper', params) return Service.Hades('public/hades/viewPaper', params);
} }
export function editPaper(params: object) { export function editPaper(params: object) {
return Service.Hades('public/hades/editPaper', params) return Service.Hades('public/hades/editPaper', params);
} }
export function batchQueryQuestionDetails(params: object) { export function batchQueryQuestionDetails(params: object) {
return Service.Hades('public/hades/batchQueryQuestionDetails', params) return Service.Hades('public/hades/batchQueryQuestionDetails', params);
} }
export function queryQuestionPageListWithContent(params: object) { export function queryQuestionPageListWithContent(params: object) {
return Service.Hades('public/hades/queryQuestionPageListWithContent', params) return Service.Hades('public/hades/queryQuestionPageListWithContent', params);
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-11 11:34:37 * @Date: 2021-03-11 11:34:37
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-24 23:44:39 * @LastEditTime: 2021-06-15 11:25:18
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
addCategory, addCategory,
delCategory, delCategory,
editCategory, editCategory,
editCategoryTree, moveCategoryTree,
addQuestion, addQuestion,
queryQuestionPageList, queryQuestionPageList,
deleteQuestion, deleteQuestion,
...@@ -26,8 +26,8 @@ import { ...@@ -26,8 +26,8 @@ import {
viewPaper, viewPaper,
editPaper, editPaper,
batchQueryQuestionDetails, batchQueryQuestionDetails,
queryQuestionPageListWithContent queryQuestionPageListWithContent,
} from '@/data-source/aidTool/request-apis' } from '@/data-source/aidTool/request-apis';
export default class AidToolService { export default class AidToolService {
/** /**
* 查询运营端分类书 * 查询运营端分类书
...@@ -35,101 +35,101 @@ export default class AidToolService { ...@@ -35,101 +35,101 @@ export default class AidToolService {
* @returns * @returns
*/ */
static queryExternalCategoryTree(parmas: any) { static queryExternalCategoryTree(parmas: any) {
return queryExternalCategoryTree(parmas) return queryExternalCategoryTree(parmas);
} }
// 获取题目分类树 // 获取题目分类树
static queryCategoryTree(params: any) { static queryCategoryTree(params: any) {
return queryCategoryTree(params) return queryCategoryTree(params);
} }
// 新增题目分类 // 新增题目分类
static addCategory(params: any) { static addCategory(params: any) {
return addCategory(params) return addCategory(params);
} }
// 删除分类 // 删除分类
static delCategory(params: any) { static delCategory(params: any) {
return delCategory(params) return delCategory(params);
} }
// 编辑分类 // 编辑分类
static editCategory(params: any) { static editCategory(params: any) {
return editCategory(params) return editCategory(params);
} }
// 编辑分类树(拖拽) // 拖拽移动分类树
static editCategoryTree(params: any) { static moveCategoryTree(params: any) {
return editCategoryTree(params) return moveCategoryTree(params);
} }
// 查询题目列表 // 查询题目列表
static queryQuestionPageList(params: any) { static queryQuestionPageList(params: any) {
return queryQuestionPageList(params) return queryQuestionPageList(params);
} }
// 添加题目 // 添加题目
static addQuestion(params: any) { static addQuestion(params: any) {
return addQuestion(params) return addQuestion(params);
} }
// 删除题目 // 删除题目
static deleteQuestion(params: any) { static deleteQuestion(params: any) {
return deleteQuestion(params) return deleteQuestion(params);
} }
// 预览题目 // 预览题目
static queryQuestionDetails(params: any) { static queryQuestionDetails(params: any) {
return queryQuestionDetails(params) return queryQuestionDetails(params);
} }
// 编辑题目 // 编辑题目
static editQuestion(params: any) { static editQuestion(params: any) {
return editQuestion(params) return editQuestion(params);
} }
// 批量导入 // 批量导入
static batchImport(params: any) { static batchImport(params: any) {
return batchImport(params) return batchImport(params);
} }
// 创建试卷 // 创建试卷
static createPaper(params: any) { static createPaper(params: any) {
return createPaper(params) return createPaper(params);
} }
// 查询试卷列表 // 查询试卷列表
static queryPaperPageList(params: any) { static queryPaperPageList(params: any) {
return queryPaperPageList(params) return queryPaperPageList(params);
} }
// 删除试卷 // 删除试卷
static deletePaper(params: any) { static deletePaper(params: any) {
return deletePaper(params) return deletePaper(params);
} }
// 编辑前查询试卷信息 // 编辑前查询试卷信息
static queryPaperDetail(params: any) { static queryPaperDetail(params: any) {
return queryPaperDetail(params) return queryPaperDetail(params);
} }
// 预览试卷 // 预览试卷
static viewPaper(params: any) { static viewPaper(params: any) {
return viewPaper(params) return viewPaper(params);
} }
// 编辑试卷 // 编辑试卷
static editPaper(params: any) { static editPaper(params: any) {
return editPaper(params) return editPaper(params);
} }
// 操作试卷-预览查询多题目信息 // 操作试卷-预览查询多题目信息
static batchQueryQuestionDetails(params: any) { static batchQueryQuestionDetails(params: any) {
return batchQueryQuestionDetails(params) return batchQueryQuestionDetails(params);
} }
// 操作试卷-选择题目列表带题目详情 // 操作试卷-选择题目列表带题目详情
static queryQuestionPageListWithContent(params: any) { static queryQuestionPageListWithContent(params: any) {
return queryQuestionPageListWithContent(params) return queryQuestionPageListWithContent(params);
} }
} }
/* /*
* @Author: 陈剑宇 * @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01 * @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-05-28 15:20:40 * @LastEditTime: 2021-06-11 16:44:17
* @LastEditors: fusanqiasng * @LastEditors: Please set LastEditors
* @Description: * @Description:
* @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts * @FilePath: /wheat-web-demo/src/domains/basic-domain/constants.ts
*/ */
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-20 09:21:40 * @Date: 2020-08-20 09:21:40
* @LastEditors: zhangleyuan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-02-20 17:08:58 * @LastEditTime: 2021-06-11 15:17:56
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-02 15:05:54 * @LastEditTime: 2021-06-15 11:22:25
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -52,6 +52,13 @@ class ShareLiveModal extends React.Component { ...@@ -52,6 +52,13 @@ class ShareLiveModal extends React.Component {
size: 98, size: 98,
}) })
qrcodeWrapDom.appendChild(qrcodeNode) qrcodeWrapDom.appendChild(qrcodeNode)
const qrcodeWrapDomDownload = document.querySelector('#qrcodeWrap-dowload')
const qrcodeNodeDownLoad = new qrcode({
text: this.state.shareUrl,
size: 196,
})
qrcodeWrapDomDownload.appendChild(qrcodeNodeDownLoad)
} }
) )
}) })
...@@ -72,13 +79,12 @@ class ShareLiveModal extends React.Component { ...@@ -72,13 +79,12 @@ class ShareLiveModal extends React.Component {
() => { () => {
this.setState({ time: new Date().valueOf() }, () => { this.setState({ time: new Date().valueOf() }, () => {
setTimeout(() => { setTimeout(() => {
let node = document.getElementById('poster') let node = document.getElementById('poster-dowload')
domtoimage.toPng(node).then((imgData) => { domtoimage.toPng(node).then((imgData) => {
console.log(imgData) console.log(imgData)
const download = document.createElement('a') const download = document.createElement('a')
const { courseName } = this.props.data const { courseName } = this.props.data
$(download).attr('href', imgData).attr('download', `${courseName}.png`).get(0).click() $(download).attr('href', imgData).attr('download', `${courseName}.png`).get(0).click()
// this.props.close()
}) })
}, 1000) }, 1000)
}) })
...@@ -158,6 +164,29 @@ class ShareLiveModal extends React.Component { ...@@ -158,6 +164,29 @@ class ShareLiveModal extends React.Component {
<div className='qrcode-wrap__right' id='qrcodeWrap'></div> <div className='qrcode-wrap__right' id='qrcodeWrap'></div>
</div> </div>
</div> </div>
<div id='poster-dowload'>
<div className='store-name'>
<span className='text'>{User.getStoreName()}</span>
</div>
<div className='course-name-title'>{type === 'videoClass' ? `${courseName}开课啦` : `邀请你观看直播:`}</div>
{type === 'liveClass' && <div class='live-couse-name'>{courseName}</div>}
<Choose>
<When condition={showImg}>
<img crossOrigin='*' src={coverImgSrc + `?=${time}`} className='course-cover' alt='' />
</When>
<Otherwise>
<img src={coverImgSrc + `?=${time}`} className='course-cover' alt='' />
</Otherwise>
</Choose>
<div className='qrcode-wrap'>
<div className='qrcode-wrap__left'>
<div className='text'>长按识别二维码进入观看</div>
<img className='finger' src='https://image.xiaomaiketang.com/xm/thpkWDwJsC.png' alt='' />
</div>
<div className='qrcode-wrap__right' id='qrcodeWrap-dowload'></div>
</div>
</div>
</div> </div>
<div className='right'> <div className='right'>
<div className='share-poster right__item'> <div className='share-poster right__item'>
......
.share-live-modal { .share-live-modal {
.ant-modal-body { .ant-modal-body {
display: flex; display: flex;
#poster{ height:510px !important;
background: #FFF; overflow: hidden !important;
margin:0;
padding: 20px;
}
.left { .left {
width: 303px; width: 303px;
margin: 0 32px 0 16px; margin: 0 32px 0 16px;
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05); box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05);
border-radius: 12px; border-radius: 12px;
#poster{
.course-name-title { background: #FFF;
font-size: 14px; margin:0;
color: #333; padding: 20px;
line-height: 20px; margin-bottom:140px;
margin-bottom: 4px; .course-name-title {
} font-size: 14px;
.live-couse-name{
font-size:16px;
color:#333333;
font-weight: 600;
}
.course-name {
color: #333; color: #333;
font-size: 16px;
font-weight: 600;
line-height: 20px; line-height: 20px;
} margin-bottom: 4px;
}
.course-cover { .live-couse-name{
width: 263px; font-size:16px;
height: 143px; color:#333333;
border-radius: 6px; font-weight: 600;
margin-top: 8px; }
} .course-name {
color: #333;
font-size: 16px;
font-weight: 600;
line-height: 20px;
}
.course-cover {
width: 263px;
height: 143px;
border-radius: 6px;
margin-top: 8px;
}
.qrcode-wrap { .qrcode-wrap {
padding: 0 16px; padding: 0 16px;
display: flex; display: flex;
align-items: center; align-items: center;
margin: 24px 0 16px 0; margin: 24px 0 16px 0;
&__left { &__left {
width: 98px; width: 98px;
text-align: center; text-align: center;
margin-right: 22px; margin-right: 22px;
.text { .text {
line-height: 20px; line-height: 20px;
}
.finger {
width: 40px;
height: 40px;
margin-top: 8px;
}
} }
.finger { &__right {
width: 40px; width: 110px;
height: 40px; height: 110px;
margin-top: 8px; padding: 6px
} }
} }
&__right { .store-name {
width: 110px; // padding: 8px 16px;
height: 110px; display: flex;
padding: 6px align-items: center;
margin-bottom: 8px;
.text {
font-size: 12px;
color: #999;
font-size: 14px;
line-height: 20px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
}
} }
} }
#poster-dowload{
.store-name { background: #FFF;
// padding: 8px 16px; margin:0;
display: flex; padding: 40px;
align-items: center; width:606px;
.course-name-title {
font-size: 28px;
color: #333;
line-height: 40px;
margin-bottom: 8px; margin-bottom: 8px;
.text { }
font-size: 12px; .live-couse-name{
color: #999; font-size:32px;
font-size: 14px; color:#333333;
line-height: 20px; font-weight: 600;
text-overflow: ellipsis; }
overflow: hidden; .course-name {
white-space: nowrap; color: #333;
width: 100%; font-size: 32px;
font-weight: 600;
line-height: 40px;
}
.course-cover {
width: 526px;
height: 286px;
border-radius: 6px;
margin-top: 16px;
}
.qrcode-wrap {
padding: 0 32px;
display: flex;
align-items: center;
margin: 48px 0 32px 0;
&__left {
width: 196px;
text-align: center;
margin-right: 44px;
.text {
line-height: 40px;
}
.finger {
width: 80px;
height: 80px;
margin-top: 16px;
}
}
&__right {
width: 220px;
height: 220px;
padding: 12px
}
}
.store-name {
// padding: 8px 16px;
display: flex;
align-items: center;
margin-bottom: 16px;
.text {
font-size: 24px;
color: #999;
font-size: 28px;
line-height: 40px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
}
} }
} }
} }
.right { .right {
.title { .title {
color: #333; color: #333;
......
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-05 10:12:45 * @Date: 2020-08-05 10:12:45
* @LastEditors: yuananting * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-02 16:15:55 * @LastEditTime: 2021-06-11 16:44:42
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-19 18:05:23 * @Date: 2021-03-19 18:05:23
* @LastEditors: wufan * @LastEditors: fusanqiasng
* @LastEditTime: 2021-05-30 16:48:46 * @LastEditTime: 2021-06-15 11:20:24
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from 'react';
import { Input, Button, Tree } from "antd"; import { Input, Button, Tree } from 'antd';
import "./Classification.less"; import './Classification.less';
import User from "@/common/js/user"; import User from '@/common/js/user';
import KnowledgeAPI from "@/data-source/knowledge/request-api"; import KnowledgeAPI from '@/data-source/knowledge/request-api';
import Bus from "@/core/bus"; import Bus from '@/core/bus';
const { Search } = Input; const { Search } = Input;
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
...@@ -21,7 +21,7 @@ class Classification extends Component { ...@@ -21,7 +21,7 @@ class Classification extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedKeys: props.selectedKeys ? [props.selectedKeys] : ["0"], selectedKeys: props.selectedKeys ? [props.selectedKeys] : ['0'],
searchValue: null, searchValue: null,
NewEditQuestionBankCategory: null, //新增或编辑分类模态框 NewEditQuestionBankCategory: null, //新增或编辑分类模态框
ImportCourseCategory: null, // 引用课程分类模态框 ImportCourseCategory: null, // 引用课程分类模态框
...@@ -32,11 +32,11 @@ class Classification extends Component { ...@@ -32,11 +32,11 @@ class Classification extends Component {
componentDidMount() { componentDidMount() {
this.queryCategoryTree(); this.queryCategoryTree();
Bus.bind('knowledgeCategoryTree', this.queryCategoryTree) Bus.bind('knowledgeCategoryTree', this.queryCategoryTree);
} }
componentWillUnmount() { componentWillUnmount() {
Bus.unbind('knowledgeCategoryTree', this.queryCategoryTree) Bus.unbind('knowledgeCategoryTree', this.queryCategoryTree);
} }
shouldComponentUpdate = (nextProps, nextState) => { shouldComponentUpdate = (nextProps, nextState) => {
...@@ -79,7 +79,7 @@ class Classification extends Component { ...@@ -79,7 +79,7 @@ class Classification extends Component {
}; };
KnowledgeAPI.getCategoryTree(query).then((res) => { KnowledgeAPI.getCategoryTree(query).then((res) => {
const { categoryList = [], noCategoryCnt = 0 } = res.result; const { categoryList = [], noCategoryCnt = 0 } = res.result;
let str = "未分类"; let str = '未分类';
if (categoryName) { if (categoryName) {
this.setState({ autoExpandParent: true }); this.setState({ autoExpandParent: true });
if (str.indexOf(categoryName) < 0) { if (str.indexOf(categoryName) < 0) {
...@@ -93,8 +93,8 @@ class Classification extends Component { ...@@ -93,8 +93,8 @@ class Classification extends Component {
this.setState({ expandedKeys: nodeId }); this.setState({ expandedKeys: nodeId });
} else { } else {
const defaultNode = { const defaultNode = {
id: "0", id: '0',
categoryName: "未分类", categoryName: '未分类',
categoryCount: noCategoryCnt, categoryCount: noCategoryCnt,
}; };
categoryList.unshift(defaultNode); categoryList.unshift(defaultNode);
...@@ -110,8 +110,8 @@ class Classification extends Component { ...@@ -110,8 +110,8 @@ class Classification extends Component {
} else { } else {
this.setState({ autoExpandParent: false }); this.setState({ autoExpandParent: false });
const defaultNode = { const defaultNode = {
id: "0", id: '0',
categoryName: "未分类", categoryName: '未分类',
categoryCount: noCategoryCnt, categoryCount: noCategoryCnt,
}; };
categoryList.unshift(defaultNode); categoryList.unshift(defaultNode);
...@@ -140,39 +140,35 @@ class Classification extends Component { ...@@ -140,39 +140,35 @@ class Classification extends Component {
item.title = item.title =
!value || (value && item.categoryName.indexOf(value) > -1) ? ( !value || (value && item.categoryName.indexOf(value) > -1) ? (
<span> <span>
{item.categoryName}{item.categoryCount} {item.categoryName}
{item.categoryCount > 0 && <span>{item.categoryCount}</span>}
</span> </span>
) : ( ) : (
<span style={{ opacity: 0.5 }}> <span style={{ opacity: 0.5 }}>
{item.categoryName}{item.categoryCount} {item.categoryName}
{item.categoryCount > 0 && <span>{item.categoryCount}</span>}
</span> </span>
); );
item.icon = item.icon =
item.categoryName === "未分类" ? ( item.categoryName === '未分类' ? (
<img <img
style={{ style={{
width: "24px", width: '24px',
height: "24px", height: '24px',
opacity: opacity: !value || (value && item.categoryName.indexOf(value) > -1) ? 1 : 0.5,
!value || (value && item.categoryName.indexOf(value) > -1)
? 1
: 0.5,
}} }}
src="https://image.xiaomaiketang.com/xm/defaultCategory.png" src='https://image.xiaomaiketang.com/xm/defaultCategory.png'
alt="" alt=''
/> />
) : ( ) : (
<img <img
style={{ style={{
width: "24px", width: '24px',
height: "24px", height: '24px',
opacity: opacity: !value || (value && item.categoryName.indexOf(value) > -1) ? 1 : 0.5,
!value || (value && item.categoryName.indexOf(value) > -1)
? 1
: 0.5,
}} }}
src="https://image.xiaomaiketang.com/xm/hasCategory.png" src='https://image.xiaomaiketang.com/xm/hasCategory.png'
alt="" alt=''
/> />
); );
if (item.sonCategoryList) { if (item.sonCategoryList) {
...@@ -186,36 +182,30 @@ class Classification extends Component { ...@@ -186,36 +182,30 @@ class Classification extends Component {
}; };
render() { render() {
const { const { treeData, expandedKeys, selectedKeys, autoExpandParent } = this.state;
treeData,
expandedKeys,
selectedKeys,
autoExpandParent,
} = this.state;
return ( return (
<div className="question-bank-sider"> <div className='question-bank-sider'>
<div className="sider-title">知识分类</div> <div className='sider-title'>知识分类</div>
<Search <Search
className="sider-search" className='sider-search'
placeholder="搜索名称分类" placeholder='搜索名称分类'
onSearch={(value) => { onSearch={(value) => {
this.queryCategoryTree(value); this.queryCategoryTree(value);
}} }}
enterButton={<span className="icon iconfont">&#xe832;</span>} enterButton={<span className='icon iconfont'>&#xe832;</span>}
style={{width: 230}} style={{ width: 230 }}
/> />
<div className="sider-btn"> <div className='sider-btn'>
<Button <Button
onClick={() => { onClick={() => {
window.RCHistory.push({ window.RCHistory.push({
pathname: "/course-category-manage?from=knowledge", pathname: '/course-category-manage?from=knowledge',
}); });
}} }}>
>
分类管理 分类管理
</Button> </Button>
</div> </div>
<div className="sider-tree"> <div className='sider-tree'>
<DirectoryTree <DirectoryTree
expandedKeys={expandedKeys} expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent} autoExpandParent={autoExpandParent}
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-12 14:49:40 * @Date: 2021-03-12 14:49:40
* @LastEditors: wufan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-05-30 20:37:42 * @LastEditTime: 2021-06-11 16:44:59
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* @Description: * @Description:
* @Author: zangsuyun * @Author: zangsuyun
* @Date: 2021-03-13 09:54:26 * @Date: 2021-03-13 09:54:26
* @LastEditors: yuananting * @LastEditors: fusanqiasng
* @LastEditTime: 2021-06-07 18:28:31 * @LastEditTime: 2021-06-15 17:19:12
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -317,7 +317,7 @@ function PlanList(props) { ...@@ -317,7 +317,7 @@ function PlanList(props) {
scroll={{ x: 1400 }} scroll={{ x: 1400 }}
className='plan-list-table' className='plan-list-table'
renderEmpty={{ renderEmpty={{
description: <span style={{ display: 'block', paddingBottom: 24 }}>还没有试卷</span> description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span>
}} }}
/> />
<div className='box-footer'> <div className='box-footer'>
......
...@@ -51,6 +51,13 @@ class ShareLiveModal extends React.Component { ...@@ -51,6 +51,13 @@ class ShareLiveModal extends React.Component {
size: 98, size: 98,
}) })
qrcodeWrapDom.appendChild(qrcodeNode) qrcodeWrapDom.appendChild(qrcodeNode)
const qrcodeWrapDomDownload = document.querySelector('#qrcodeWrap-dowload')
const qrcodeNodeDownLoad = new qrcode({
text: this.state.shareUrl,
size: 196,
})
qrcodeWrapDomDownload.appendChild(qrcodeNodeDownLoad)
} }
) )
}) })
...@@ -70,9 +77,8 @@ class ShareLiveModal extends React.Component { ...@@ -70,9 +77,8 @@ class ShareLiveModal extends React.Component {
}, },
() => { () => {
this.setState({ time: new Date().valueOf() }, () => { this.setState({ time: new Date().valueOf() }, () => {
let node = document.getElementById('poster') let node = document.getElementById('poster-dowload')
domtoimage.toPng(node).then((imgData) => { domtoimage.toPng(node).then((imgData) => {
console.log(imgData)
const download = document.createElement('a') const download = document.createElement('a')
const { planName } = this.props.data const { planName } = this.props.data
$(download).attr('href', imgData).attr('download', `${planName}.png`).get(0).click() $(download).attr('href', imgData).attr('download', `${planName}.png`).get(0).click()
...@@ -112,7 +118,7 @@ class ShareLiveModal extends React.Component { ...@@ -112,7 +118,7 @@ class ShareLiveModal extends React.Component {
<div className='course-name-title'>邀请你参与培训:</div> <div className='course-name-title'>邀请你参与培训:</div>
<div class='live-couse-name'>{planName}</div> <div className='live-couse-name'>{planName}</div>
<Choose> <Choose>
<When condition={showImg}> <When condition={showImg}>
<img crossOrigin='*' src={coverUrl + `?=${time}`} className='course-cover' alt='' /> <img crossOrigin='*' src={coverUrl + `?=${time}`} className='course-cover' alt='' />
...@@ -130,6 +136,31 @@ class ShareLiveModal extends React.Component { ...@@ -130,6 +136,31 @@ class ShareLiveModal extends React.Component {
<div className='qrcode-wrap__right' id='qrcodeWrap'></div> <div className='qrcode-wrap__right' id='qrcodeWrap'></div>
</div> </div>
</div> </div>
<div id='poster-dowload'>
<div className='store-name'>
<span className='text'>{User.getStoreName()}</span>
</div>
<div className='course-name-title'>邀请你参与培训:</div>
<div className='live-couse-name'>{planName}</div>
<Choose>
<When condition={showImg}>
<img crossOrigin='*' src={coverUrl + `?=${time}`} className='course-cover' alt='' />
</When>
<Otherwise>
<img src={coverUrl + `?=${time}`} className='course-cover' alt='' />
</Otherwise>
</Choose>
<div className='qrcode-wrap'>
<div className='qrcode-wrap__left'>
<div className='text'>长按识别二维码进入观看</div>
<img className='finger' src='https://image.xiaomaiketang.com/xm/thpkWDwJsC.png' alt='' />
</div>
<div className='qrcode-wrap__right' id='qrcodeWrap-dowload'></div>
</div>
</div>
</div> </div>
<div className='right'> <div className='right'>
<div className='share-poster right__item'> <div className='share-poster right__item'>
......
.share-live-modal { .share-live-modal {
.ant-modal-body { .ant-modal-body {
display: flex; display: flex;
#poster{ height:510px !important;
background: #FFF; overflow: hidden !important;
margin:0;
padding: 20px;
}
.left { .left {
width: 303px; width: 303px;
margin: 0 32px 0 16px; margin: 0 32px 0 16px;
box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05); box-shadow:0px 2px 10px 0px rgba(0,0,0,0.05);
border-radius: 12px; border-radius: 12px;
#poster{
.course-name-title { background: #FFF;
font-size: 14px; margin:0;
color: #333; padding: 20px;
line-height: 20px; margin-bottom:140px;
margin-bottom: 4px; .course-name-title {
} font-size: 14px;
.live-couse-name{ color: #333;
font-size:16px; line-height: 20px;
color:#333333; margin-bottom: 4px;
font-weight: 600; }
} .live-couse-name{
.course-name { font-size:16px;
color: #333; color:#333333;
font-size: 16px; font-weight: 600;
font-weight: 600; }
line-height: 20px; .course-name {
} color: #333;
font-size: 16px;
.course-cover { font-weight: 600;
width: 263px; line-height: 20px;
height: 143px; }
border-radius: 6px;
margin-top: 8px; .course-cover {
} width: 263px;
height: 143px;
border-radius: 6px;
margin-top: 8px;
}
.qrcode-wrap { .qrcode-wrap {
padding: 0 16px; padding: 0 16px;
display: flex; display: flex;
align-items: center; align-items: center;
margin: 24px 0 16px 0; margin: 24px 0 16px 0;
&__left { &__left {
width: 98px; width: 98px;
text-align: center; text-align: center;
margin-right: 22px; margin-right: 22px;
.text { .text {
line-height: 20px; line-height: 20px;
}
.finger {
width: 40px;
height: 40px;
margin-top: 8px;
}
} }
.finger { &__right {
width: 40px; width: 110px;
height: 40px; height: 110px;
margin-top: 8px; padding: 6px
} }
} }
&__right { .store-name {
width: 110px; // padding: 8px 16px;
height: 110px; display: flex;
padding: 6px align-items: center;
margin-bottom: 8px;
.text {
font-size: 12px;
color: #999;
font-size: 14px;
line-height: 20px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
}
} }
} }
#poster-dowload{
background: #FFF;
margin:0;
padding: 40px;
width:606px;
.course-name-title {
font-size: 28px;
color: #333;
line-height: 40px;
margin-bottom: 8px;
}
.live-couse-name{
font-size:32px;
color:#333333;
font-weight: 600;
}
.course-name {
color: #333;
font-size: 32px;
font-weight: 600;
line-height: 40px;
}
.course-cover {
width: 526px;
height: 286px;
border-radius: 6px;
margin-top: 16px;
}
.store-name { .qrcode-wrap {
// padding: 8px 16px; padding: 0 32px;
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 8px; margin: 48px 0 32px 0;
.text {
font-size: 12px; &__left {
color: #999; width: 196px;
font-size: 14px; text-align: center;
line-height: 20px; margin-right: 44px;
text-overflow: ellipsis;
overflow: hidden; .text {
white-space: nowrap; line-height: 40px;
width: 100%; }
.finger {
width: 80px;
height: 80px;
margin-top: 16px;
}
}
&__right {
width: 220px;
height: 220px;
padding: 12px
}
}
.store-name {
// padding: 8px 16px;
display: flex;
align-items: center;
margin-bottom: 16px;
.text {
font-size: 12px;
color: #999;
font-size: 28px;
line-height: 40px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
}
} }
} }
} }
......
import React from 'react';
import "./PreviewFileModal.less";
import { Spin } from 'antd'
class PreviewFileModal extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
cancelPreView = ()=>{
this.props.onCancel();
}
toPreView = (url)=>{
const a = document.createElement('a');
document.body.appendChild(a);
a.setAttribute('href', url);
a.setAttribute('target', '_blank');
a.click();
document.body.removeChild(a);
this.props.onCancel();
}
render() {
const { previewStatus,url} = this.props
return (
<div className="preview-modal">
<div className="preview-modal-content">
<div className="load-img-box">
{previewStatus === "UPLOAD" &&
<Spin size="large"/>
}
{previewStatus === "UPLOAD_SUCCESS" &&
<img className="load-img" src="https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"></img>
}
</div>
<div className="load-text-box">
{previewStatus === "UPLOAD" &&
<div className="load-text-box-title">预览生成中</div>
}
{previewStatus === "UPLOAD_SUCCESS" &&
<div className="load-text-box-title">预览生成成功</div>
}
</div>
<div className="operate">
<span className="btn cancel-preview-btn" onClick={()=>this.cancelPreView()}>取消预览</span>
{previewStatus === "UPLOAD" &&
<span className="btn to-preview-btn__disabled to-preview-btn">去查看</span>
}
{previewStatus === "UPLOAD_SUCCESS" &&
<span className="btn to-preview-btn" onClick={()=>this.toPreView(url)}>去查看</span>
}
</div>
</div>
</div>
);
}
}
export default PreviewFileModal;
.preview-modal{
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 102;
height: 100%;
background: rgba(0, 0, 0, 0.7);
.preview-modal-content{
position:absolute;
left:calc(50% - 133px);
top:calc(50% - 87px);
color:#FFF;
text-align:center;
width:266px;
height:174px;
.ant-spin-dot-item{
background-color: #FFF;
}
.load-img-box{
.load-img{
width:44px;
height:44px;
}
}
.load-text-box{
margin-top:23px;
font-size:16px;
color:#FFF;
.load-text-box-title{
margin-bottom:8px;
}
}
.operate{
margin-top:24px;
.btn {
padding:5px 12px;
border:1px solid #E8E8E8;
border-radius:2px;
}
.cancel-preview-btn{
margin-right:8px;
}
.to-preview-btn__disabled{
border:1px solid #E8E8E8;
opacity: 0.4;
}
}
}
}
\ No newline at end of file
...@@ -11,6 +11,7 @@ import { Radio, Button, Dropdown, Modal, Tooltip, message } from "antd"; ...@@ -11,6 +11,7 @@ import { Radio, Button, Dropdown, Modal, Tooltip, message } from "antd";
import { LIVE_SHARE } from "@/domains/course-domain/constants"; import { LIVE_SHARE } from "@/domains/course-domain/constants";
import User from "@/common/js/user"; import User from "@/common/js/user";
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import StoreService from "@/domains/store-domain/storeService";
import BaseService from "@/domains/basic-domain/baseService"; import BaseService from "@/domains/basic-domain/baseService";
import { XMContext } from "@/store/context"; import { XMContext } from "@/store/context";
import logoImg from "@/common/images/logo.png"; import logoImg from "@/common/images/logo.png";
...@@ -18,6 +19,7 @@ import CourseService from "@/domains/course-domain/CourseService"; ...@@ -18,6 +19,7 @@ import CourseService from "@/domains/course-domain/CourseService";
import qrcode from "@/libs/qrcode/qrcode.js"; import qrcode from "@/libs/qrcode/qrcode.js";
import Bus from '@/core/tbus'; import Bus from '@/core/tbus';
import ClickOutside from '../../components/ClickOutside'; import ClickOutside from '../../components/ClickOutside';
import _ from "underscore";
const baseImg = "https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png"; const baseImg = "https://image.xiaomaiketang.com/xm/rJeQaZxtc7.png";
const { confirm } = Modal; const { confirm } = Modal;
...@@ -33,6 +35,7 @@ function Header(props) { ...@@ -33,6 +35,7 @@ function Header(props) {
const [list, setList] = useState([]); const [list, setList] = useState([]);
const [openDropdown, setOpenDropdown] = useState(false); const [openDropdown, setOpenDropdown] = useState(false);
const [instScroll, setInstScroll] = useState(false); const [instScroll, setInstScroll] = useState(false);
const [topLeftLogo, setTopLeftLogo] = useState("https://image.xiaomaiketang.com/xm/WEsMPAYxAs.png")
const ctx = useContext(XMContext); const ctx = useContext(XMContext);
const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`; const htmlUrl = `${LIVE_SHARE}store/index?id=${User.getStoreId()}&userId=${User.getUserId()}&from=work_weixin`;
const storeUserId = User.getStoreUserId(); const storeUserId = User.getStoreUserId();
...@@ -47,6 +50,7 @@ function Header(props) { ...@@ -47,6 +50,7 @@ function Header(props) {
setStoreName(value); setStoreName(value);
}); });
getStoreList(); getStoreList();
getTopLeftLogo()
}, []); }, []);
useEffect(() => { useEffect(() => {
...@@ -77,6 +81,15 @@ function Header(props) { ...@@ -77,6 +81,15 @@ function Header(props) {
}); });
} }
function getTopLeftLogo() {
if (User.getToken()) {
StoreService.getStoreDetail({storeId:User.getStoreId()})
.then(res=> {
setTopLeftLogo(res.result.logo)
})
}
}
function getStoreList() { function getStoreList() {
if (!enterpriseId) return null; if (!enterpriseId) return null;
const params = { const params = {
...@@ -219,7 +232,7 @@ function Header(props) { ...@@ -219,7 +232,7 @@ function Header(props) {
<div id="top-container" className="top-container"> <div id="top-container" className="top-container">
<div className="top top-nav"> <div className="top top-nav">
<div> <div>
<img src='https://image.xiaomaiketang.com/xm/WEsMPAYxAs.png' className="logo" alt="" /> <img src={topLeftLogo} className="logo" alt="" />
</div> </div>
<div className="message-help"> <div className="message-help">
{list.length ? ( {list.length ? (
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-22 10:59:43 * @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting * @LastEditors: fusanqiasng
* @LastEditTime: 2021-04-13 13:55:37 * @LastEditTime: 2021-06-15 11:20:48
* @Description: 助学工具-侧边课程分类树 * @Description: 助学工具-侧边课程分类树
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from 'react';
import { Input, Button, Tree } from "antd"; import { Input, Button, Tree } from 'antd';
import "./CourseCategorySiderTree.less"; import './CourseCategorySiderTree.less';
import User from "@/common/js/user"; import User from '@/common/js/user';
import AidToolService from "@/domains/aid-tool-domain/AidToolService"; import AidToolService from '@/domains/aid-tool-domain/AidToolService';
import Bus from "@/core/bus"; import Bus from '@/core/bus';
const { Search } = Input; const { Search } = Input;
const { DirectoryTree } = Tree; const { DirectoryTree } = Tree;
...@@ -20,31 +20,25 @@ class CourseCategorySiderTree extends Component { ...@@ -20,31 +20,25 @@ class CourseCategorySiderTree extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
selectedKeys: ["QUESTION_INDEX", "PAPER_INDEX"].includes(props.fromModule) selectedKeys: ['QUESTION_INDEX', 'PAPER_INDEX'].includes(props.fromModule) ? [getParameterByName('categoryId') || 'null'] : ['null'],
? [getParameterByName("categoryId") || "null"]
: ["null"],
treeData: props.treeData || [], treeData: props.treeData || [],
autoExpandParent: false, autoExpandParent: false,
}; };
} }
componentDidMount() { componentDidMount() {
this.queryCategoryTree("init"); this.queryCategoryTree('init');
Bus.bind("queryCategoryTree", this.queryCategoryTree); Bus.bind('queryCategoryTree', this.queryCategoryTree);
} }
componentWillUnmount() { componentWillUnmount() {
Bus.unbind("queryCategoryTree", this.queryCategoryTree); Bus.unbind('queryCategoryTree', this.queryCategoryTree);
} }
// 查询分类树 // 查询分类树
queryCategoryTree = (type = "init", categoryName) => { queryCategoryTree = (type = 'init', categoryName) => {
let query = { let query = {
bizType: ["QUESTION_INDEX", "QUESTION_MODAL"].includes( bizType: ['QUESTION_INDEX', 'QUESTION_MODAL'].includes(this.props.fromModule) ? 'QUESTION' : 'PAPER',
this.props.fromModule
)
? "QUESTION"
: "PAPER",
categoryName, categoryName,
count: true, count: true,
source: 0, source: 0,
...@@ -53,7 +47,7 @@ class CourseCategorySiderTree extends Component { ...@@ -53,7 +47,7 @@ class CourseCategorySiderTree extends Component {
}; };
AidToolService.queryCategoryTree(query).then((res) => { AidToolService.queryCategoryTree(query).then((res) => {
const { categoryList = [], noCategoryCnt = 0 } = res.result; const { categoryList = [], noCategoryCnt = 0 } = res.result;
let str = "未分类"; let str = '未分类';
if (categoryName) { if (categoryName) {
this.setState({ autoExpandParent: true }); this.setState({ autoExpandParent: true });
if (str.indexOf(categoryName) < 0) { if (str.indexOf(categoryName) < 0) {
...@@ -64,15 +58,15 @@ class CourseCategorySiderTree extends Component { ...@@ -64,15 +58,15 @@ class CourseCategorySiderTree extends Component {
Object.keys(this.state.treeMap).forEach((item) => { Object.keys(this.state.treeMap).forEach((item) => {
nodeId.push(item); nodeId.push(item);
}); });
if (type === "init") { if (type === 'init') {
this.setState({ expandedKeys: nodeId }); this.setState({ expandedKeys: nodeId });
} }
} else { } else {
const defaultNode = { const defaultNode = {
id: "null", id: 'null',
categoryName: "未分类", categoryName: '未分类',
categoryCount: noCategoryCnt, categoryCount: noCategoryCnt,
parentId: "0", parentId: '0',
categoryLevel: 0, categoryLevel: 0,
}; };
categoryList.unshift(defaultNode); categoryList.unshift(defaultNode);
...@@ -83,24 +77,24 @@ class CourseCategorySiderTree extends Component { ...@@ -83,24 +77,24 @@ class CourseCategorySiderTree extends Component {
Object.keys(this.state.treeMap).forEach((item) => { Object.keys(this.state.treeMap).forEach((item) => {
nodeId.push(item); nodeId.push(item);
}); });
if (type === "init") { if (type === 'init') {
this.setState({ expandedKeys: nodeId }); this.setState({ expandedKeys: nodeId });
} }
} }
} else { } else {
this.setState({ autoExpandParent: false }); this.setState({ autoExpandParent: false });
const defaultNode = { const defaultNode = {
id: "null", id: 'null',
categoryName: "未分类", categoryName: '未分类',
categoryCount: noCategoryCnt, categoryCount: noCategoryCnt,
parentId: "0", parentId: '0',
categoryLevel: 0, categoryLevel: 0,
}; };
categoryList.unshift(defaultNode); categoryList.unshift(defaultNode);
this.setState({ this.setState({
treeData: this.renderTreeNodes(categoryList, categoryName), treeData: this.renderTreeNodes(categoryList, categoryName),
}); });
if (type === "init") { if (type === 'init') {
this.setState({ expandedKeys: [] }); this.setState({ expandedKeys: [] });
} }
} }
...@@ -126,12 +120,12 @@ class CourseCategorySiderTree extends Component { ...@@ -126,12 +120,12 @@ class CourseCategorySiderTree extends Component {
// 树状选中事件 // 树状选中事件
onSelect = (selectedKeys) => { onSelect = (selectedKeys) => {
this.setState({ selectedKeys }, () => { this.setState({ selectedKeys }, () => {
if (this.props.fromModule === "QUESTION_INDEX") { if (this.props.fromModule === 'QUESTION_INDEX') {
Bus.trigger("queryQuestionPageList", selectedKeys[0]); Bus.trigger('queryQuestionPageList', selectedKeys[0]);
} else if (this.props.fromModule === "QUESTION_MODAL") { } else if (this.props.fromModule === 'QUESTION_MODAL') {
Bus.trigger("queryQuestionPageListWithContent", selectedKeys[0]); Bus.trigger('queryQuestionPageListWithContent', selectedKeys[0]);
} else { } else {
Bus.trigger("queryPaperPageList", selectedKeys[0], 0); Bus.trigger('queryPaperPageList', selectedKeys[0], 0);
} }
}); });
}; };
...@@ -144,39 +138,35 @@ class CourseCategorySiderTree extends Component { ...@@ -144,39 +138,35 @@ class CourseCategorySiderTree extends Component {
item.title = item.title =
!value || (value && item.categoryName.indexOf(value) > -1) ? ( !value || (value && item.categoryName.indexOf(value) > -1) ? (
<span> <span>
{item.categoryName}{item.categoryCount} {item.categoryName}
{item.categoryCount > 0 && <span>{item.categoryCount}</span>}
</span> </span>
) : ( ) : (
<span style={{ opacity: 0.5 }}> <span style={{ opacity: 0.5 }}>
{item.categoryName}{item.categoryCount} {item.categoryName}
{item.categoryCount > 0 && <span>{item.categoryCount}</span>}
</span> </span>
); );
item.icon = item.icon =
item.categoryName === "未分类" ? ( item.categoryName === '未分类' ? (
<img <img
style={{ style={{
width: "24px", width: '24px',
height: "24px", height: '24px',
opacity: opacity: !value || (value && item.categoryName.indexOf(value) > -1) ? 1 : 0.5,
!value || (value && item.categoryName.indexOf(value) > -1)
? 1
: 0.5,
}} }}
src="https://image.xiaomaiketang.com/xm/defaultCategory.png" src='https://image.xiaomaiketang.com/xm/defaultCategory.png'
alt="" alt=''
/> />
) : ( ) : (
<img <img
style={{ style={{
width: "24px", width: '24px',
height: "24px", height: '24px',
opacity: opacity: !value || (value && item.categoryName.indexOf(value) > -1) ? 1 : 0.5,
!value || (value && item.categoryName.indexOf(value) > -1)
? 1
: 0.5,
}} }}
src="https://image.xiaomaiketang.com/xm/hasCategory.png" src='https://image.xiaomaiketang.com/xm/hasCategory.png'
alt="" alt=''
/> />
); );
if (item.sonCategoryList) { if (item.sonCategoryList) {
...@@ -190,46 +180,34 @@ class CourseCategorySiderTree extends Component { ...@@ -190,46 +180,34 @@ class CourseCategorySiderTree extends Component {
}; };
render() { render() {
const { const { treeData, expandedKeys, selectedKeys, autoExpandParent } = this.state;
treeData,
expandedKeys,
selectedKeys,
autoExpandParent,
} = this.state;
return ( return (
<div className="category-tree-sider"> <div className='category-tree-sider'>
{["QUESTION_INDEX", "PAPER_INDEX"].includes(this.props.fromModule) && ( {['QUESTION_INDEX', 'PAPER_INDEX'].includes(this.props.fromModule) && (
<div className="sider-title"> <div className='sider-title'>{this.props.fromModule === 'QUESTION_INDEX' ? '题目分类' : '试卷分类'}</div>
{this.props.fromModule === "QUESTION_INDEX"
? "题目分类"
: "试卷分类"}
</div>
)} )}
<Search <Search
className="sider-search" className='sider-search'
placeholder="搜索名称分类" placeholder='搜索名称分类'
onSearch={(value) => { onSearch={(value) => {
this.queryCategoryTree("init", value); this.queryCategoryTree('init', value);
}} }}
enterButton={<span className="icon iconfont">&#xe832;</span>} enterButton={<span className='icon iconfont'>&#xe832;</span>}
/> />
{["QUESTION_INDEX", "PAPER_INDEX"].includes(this.props.fromModule) && {['QUESTION_INDEX', 'PAPER_INDEX'].includes(this.props.fromModule) && User.getUserRole() !== 'CloudLecturer' && this.props.type !== 'modal-select' && (
User.getUserRole() !== "CloudLecturer" && <div className='sider-btn'>
this.props.type !== "modal-select" && ( <Button
<div className="sider-btn"> onClick={() => {
<Button window.RCHistory.push({
onClick={() => { pathname: '/course-category-manage?from=aid',
window.RCHistory.push({ });
pathname: "/course-category-manage?from=aid", }}>
}); 分类管理
}} </Button>
> </div>
分类管理 )}
</Button> <div className='sider-tree'>
</div>
)}
<div className="sider-tree">
<DirectoryTree <DirectoryTree
expandedKeys={expandedKeys} expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent} autoExpandParent={autoExpandParent}
......
...@@ -184,7 +184,7 @@ function DataAnalysic(props: any) { ...@@ -184,7 +184,7 @@ function DataAnalysic(props: any) {
onClick={() => { onClick={() => {
checkAnswerDetail(record); checkAnswerDetail(record);
}}> }}>
答题详情 答题详情
</div> </div>
</When> </When>
<Otherwise>-</Otherwise> <Otherwise>-</Otherwise>
......
...@@ -277,7 +277,7 @@ class PreviewPaperModal extends Component { ...@@ -277,7 +277,7 @@ class PreviewPaperModal extends Component {
/> />
</div> </div>
} }
description={<span style={{ display: 'block', paddingBottom: 24 }}>暂无内容</span>} description={<span style={{ display: 'block', paddingBottom: 24, marginTop: 50 }}>暂无内容</span>}
></Empty> ></Empty>
); );
}; };
......
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