Commit ac840091 by guomingpang

Merge branch 'dev' of…

Merge branch 'dev' of ssh://xmgit.ixm5.cn:10022/xiaomai-cloud-class/xiaomai-cloud-class-web into dev
parents 3f881d0e c4408618
...@@ -613,10 +613,11 @@ module.exports = function (webpackEnv) { ...@@ -613,10 +613,11 @@ module.exports = function (webpackEnv) {
silent: true, silent: true,
// The formatter is invoked directly in WebpackDevServerUtils during development // The formatter is invoked directly in WebpackDevServerUtils during development
formatter: isEnvProduction ? typescriptFormatter : undefined formatter: isEnvProduction ? typescriptFormatter : undefined
}),
new vConsolePlugin({
enable: (process.env.DEPLOY_ENV === 'prod' || process.env.DEPLOY_ENV === 'beta') ? false : true
}) })
// new vConsolePlugin({
// enable: (process.env.DEPLOY_ENV === 'prod' || process.env.DEPLOY_ENV === 'beta') ? false : true
// })
].filter(Boolean), ].filter(Boolean),
// Some libraries import Node modules but don't use them in the browser. // Some libraries import Node modules but don't use them in the browser.
// Tell webpack to provide empty mocks for them so importing them works. // Tell webpack to provide empty mocks for them so importing them works.
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"bizcharts": "^3.3.0", "bizcharts": "^3.3.0",
"camelcase": "^5.3.1", "camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "2.3.0", "case-sensitive-paths-webpack-plugin": "2.3.0",
"classnames": "^2.2.6", "classnames": "^2.3.1",
"cropper": "^3.1.4", "cropper": "^3.1.4",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"css-loader": "3.4.2", "css-loader": "3.4.2",
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
"@types/jquery": "^3.5.4", "@types/jquery": "^3.5.4",
"ali-oss": "^6.12.0", "ali-oss": "^6.12.0",
"react-sortable-hoc": "^1.11.0", "react-sortable-hoc": "^1.11.0",
"vconsole-webpack-plugin": "^1.5.2" "vconsole-webpack-plugin": "^1.6.1"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Input, Table } from 'antd'; import { Modal, Input } from 'antd';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
// import _ from 'underscore';
import './ChooseMembersModal.less'; import './ChooseMembersModal.less';
import User from '@/common/js/user'; import User from '@/common/js/user'
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { Search } = Input; const { Search } = Input;
class ChooseMembersModal extends React.Component { class ChooseMembersModal extends React.Component {
...@@ -202,10 +204,8 @@ class ChooseMembersModal extends React.Component { ...@@ -202,10 +204,8 @@ class ChooseMembersModal extends React.Component {
title: '全选', // 实际为头像,但在表格上这行要求显示为全选 title: '全选', // 实际为头像,但在表格上这行要求显示为全选
key: 'avatar', key: 'avatar',
dataIndex: 'avatar', dataIndex: 'avatar',
width: '40%',
render: (value, record) => { render: (value, record) => {
const { adminName } = record; const { adminName } = record;
return ( return (
<div className='avatar'> <div className='avatar'>
{ {
...@@ -231,7 +231,7 @@ class ChooseMembersModal extends React.Component { ...@@ -231,7 +231,7 @@ class ChooseMembersModal extends React.Component {
title: '学员名', title: '学员名',
key: 'adminNameRight', key: 'adminNameRight',
dataIndex: 'adminName', dataIndex: 'adminName',
width: '70%', width: '65%',
render: (value, record) => { render: (value, record) => {
const { adminName = '', avatar } = record; const { adminName = '', avatar } = record;
return ( return (
...@@ -292,16 +292,19 @@ class ChooseMembersModal extends React.Component { ...@@ -292,16 +292,19 @@ class ChooseMembersModal extends React.Component {
enterButton={<span className="icon iconfont">&#xe832;</span>} enterButton={<span className="icon iconfont">&#xe832;</span>}
/> />
<div className='container-left-body-table'> <div className='container-left-body-table'>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
rowKey={(record) => record.userId} rowKey={(record) => record.userId}
dataSource={allUserList} dataSource={allUserList}
columns={this.selectedColumnsLeft()} columns={this.selectedColumnsLeft()}
pagination={false} pagination={false}
scroll={{ y: 290}} scroll={{ y: 290}}
// bordered={true}
size={'small'} size={'small'}
rowSelection={{ rowSelection={{
columnWidth : 24, columnWidth : 63,
selectedRowKeys, selectedRowKeys,
onChange : this.onChangeRow, onChange : this.onChangeRow,
getCheckboxProps : this.getCheckboxProps, getCheckboxProps : this.getCheckboxProps,
...@@ -325,7 +328,11 @@ class ChooseMembersModal extends React.Component { ...@@ -325,7 +328,11 @@ class ChooseMembersModal extends React.Component {
<span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span> <span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span>
</div> </div>
<div className='container-right-body'> <div className='container-right-body'>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
rowKey={(record) => record.userId} rowKey={(record) => record.userId}
dataSource={selectUserList} dataSource={selectUserList}
columns={this.selectedColumnsRight()} columns={this.selectedColumnsRight()}
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
>tr >td { >tr >td {
border-bottom: none; border-bottom: none;
background-color: #fff !important; background-color: #fff !important;
padding:8px 8px !important;
} }
} }
} }
...@@ -45,6 +45,14 @@ ...@@ -45,6 +45,14 @@
.ant-empty-normal { .ant-empty-normal {
margin: 100px 0 !important; margin: 100px 0 !important;
} }
.ant-empty {
margin-top: 60px;
}
.ant-empty-description {
color: #999;
}
.avatar{ .avatar{
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -119,6 +127,13 @@ ...@@ -119,6 +127,13 @@
margin: 144px 0 !important; margin: 144px 0 !important;
} }
.ant-empty {
margin-top: 60px;
}
.ant-empty-description {
color: #999;
}
.avatar{ .avatar{
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Button, Breadcrumb, Radio, message } from 'antd'; import { Modal, Button, Breadcrumb, message } from 'antd';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import { FILE_TYPE_ICON_MAP, DEFAULT_SIZE_UNIT } from "@/domains/resource-disk/constants"; import { FILE_TYPE_ICON_MAP, DEFAULT_SIZE_UNIT } from "@/domains/resource-disk/constants";
import { LottieIcon } from 'xiaomai-b-components'; import LottieIcon from '@/components/LottieIcon';
import _ from 'underscore'; import _ from 'underscore';
import { getEllipsText } from "@/domains/basic-domain/utils"; import { getEllipsText } from "@/domains/basic-domain/utils";
import * as lodash from 'lodash'; import * as lodash from 'lodash';
...@@ -334,6 +334,8 @@ class CopyFileModal extends React.Component { ...@@ -334,6 +334,8 @@ class CopyFileModal extends React.Component {
<div className="lottie-box"> <div className="lottie-box">
<LottieIcon <LottieIcon
title={<span className="desc">这个文件夹是空的</span>} title={<span className="desc">这个文件夹是空的</span>}
type="college"
size={150}
/> />
</div> </div>
} }
......
...@@ -57,12 +57,17 @@ ...@@ -57,12 +57,17 @@
} }
} }
.lottie-box { .copy-body {
.lottie-box {
border:1px solid #E8E8E8; border:1px solid #E8E8E8;
border-radius:4px; border-radius:4px;
height: 320px; height: 320px;
} }
.lottie-icon{ .lottie-icon{
margin: 100px 0; margin: 70px 0 !important;
.lottie-icon__title {
color: #999;
}
}
} }
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
.ant-table-row{ .ant-table-row{
background-color: #fff !important; background-color: #fff !important;
} }
tr:first-child{
display: none;
}
.ant-table-row:hover{ .ant-table-row:hover{
background-color: #E9E9E9; background-color: #E9E9E9;
} }
......
...@@ -10,7 +10,7 @@ import React from 'react'; ...@@ -10,7 +10,7 @@ import React from 'react';
import { Modal, Button, Radio, Checkbox, message, Tooltip } from 'antd'; import { Modal, Button, Radio, Checkbox, message, Tooltip } from 'antd';
import _ from 'underscore'; import _ from 'underscore';
import * as lodash from 'lodash'; import * as lodash from 'lodash';
import { LottieIcon } from 'xiaomai-b-components'; import LottieIcon from '@/components/LottieIcon';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import { getEllipsText } from "@/domains/basic-domain/utils"; import { getEllipsText } from "@/domains/basic-domain/utils";
...@@ -647,6 +647,8 @@ class SelectPrepareFileModal extends React.Component { ...@@ -647,6 +647,8 @@ class SelectPrepareFileModal extends React.Component {
<Otherwise> <Otherwise>
<LottieIcon <LottieIcon
title={<span className="desc">这个文件夹是空的</span>} title={<span className="desc">这个文件夹是空的</span>}
type="college"
size={150}
/> />
</Otherwise> </Otherwise>
</Choose> </Choose>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
} }
.lottie-icon { .lottie-icon {
margin: 12px 0 0 0; margin: 0;
border: 1px solid #E8E8E8; border: 1px solid #E8E8E8;
border-radius: 4px; border-radius: 4px;
padding: 100px 0; padding: 69px 0 59px 0;
.desc { .desc {
color: #999; color: #999;
......
...@@ -7,11 +7,12 @@ ...@@ -7,11 +7,12 @@
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios'; import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse, AxiosPromise, AxiosError } from 'axios';
import { message } from 'antd'; import { message, Modal } from 'antd';
import { BASIC_HOST, TIME_OUT, USER_TYPE, VERSION, PROJECT } from '@/domains/basic-domain/constants'; import { BASIC_HOST, TIME_OUT, USER_TYPE, VERSION, PROJECT } from '@/domains/basic-domain/constants';
import User from './user'; import User from './user';
import { content } from 'html2canvas/dist/types/css/property-descriptors/content';
interface FetchParams { interface FetchParams {
url: string, url: string,
...@@ -27,7 +28,8 @@ interface HeadersType{ ...@@ -27,7 +28,8 @@ interface HeadersType{
storeId?:any, storeId?:any,
storeUserId?:any, storeUserId?:any,
userId?:any, userId?:any,
xmtoken?:any xmtoken?:any,
enterpriseId?:string|null
} }
class Axios { class Axios {
static post( static post(
...@@ -51,6 +53,9 @@ class Axios { ...@@ -51,6 +53,9 @@ class Axios {
if(User.getToken()){ if(User.getToken()){
headerObject.xmtoken = User.getToken(); headerObject.xmtoken = User.getToken();
} }
if (User.getEnterpriseId()) {
headerObject.enterpriseId = User.getEnterpriseId();
}
const instance: AxiosInstance = axios.create({ const instance: AxiosInstance = axios.create({
timeout: TIME_OUT, timeout: TIME_OUT,
responseType: 'json', responseType: 'json',
...@@ -84,8 +89,15 @@ class Axios { ...@@ -84,8 +89,15 @@ class Axios {
}) })
instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => { instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => {
const { message: ResMessage, success, resultMsg, resultCode } = response.data; const { message: ResMessage, success, resultMsg, code: resultCode } = response.data;
if (success || resultCode === 0) { const requestStatus = response.status;
if (requestStatus === 10001) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
} else if (success || resultCode === 0) {
return response; return response;
} else if (!options.reject) { } else if (!options.reject) {
message.error(ResMessage || resultMsg); message.error(ResMessage || resultMsg);
...@@ -104,6 +116,13 @@ class Axios { ...@@ -104,6 +116,13 @@ class Axios {
window.RCHistory.replace('/login'); window.RCHistory.replace('/login');
return Promise.reject(); return Promise.reject();
break; break;
case 10001:
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
break;
default: default:
message.error(error.message); message.error(error.message);
break; break;
......
...@@ -11,8 +11,13 @@ import Storage from './storage'; ...@@ -11,8 +11,13 @@ import Storage from './storage';
import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants'; import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants';
class User { class User {
getStoreId() {
return Storage.get(`${PREFIX}_storeId`); getVersion() {
return Storage.getObj(`${PREFIX}_version`)
}
getStoreId(){
return Storage.get(`${PREFIX}_storeId`)
} }
getEnterpriseId() { getEnterpriseId() {
...@@ -49,8 +54,12 @@ class User { ...@@ -49,8 +54,12 @@ class User {
return Storage.get(`${PREFIX}_isAdmin`); return Storage.get(`${PREFIX}_isAdmin`);
} }
setStoreId(value: any) { setVersion(value:any) {
return Storage.set(`${PREFIX}_storeId`, value); return Storage.setObj(`${PREFIX}_version`,value)
}
setStoreId(value:any){
return Storage.set(`${PREFIX}_storeId`,value)
} }
setEnterpriseId(value: any) { setEnterpriseId(value: any) {
......
...@@ -11,3 +11,6 @@ ...@@ -11,3 +11,6 @@
padding: 16px; padding: 16px;
background-color: #F0F2F5; background-color: #F0F2F5;
} }
.ant-tooltip-inner {
max-width: 1000px;
}
\ No newline at end of file
@font-face { @font-face {
font-family: 'iconfont'; /* project id 2223403 */ font-family: 'iconfont'; /* Project id 2223403 */
src: url('//at.alicdn.com/t/font_2223403_boiin24pch6.eot'); src: url('//at.alicdn.com/t/font_2223403_oe5p510553.woff2?t=1624259078391') format('woff2'),
src: url('//at.alicdn.com/t/font_2223403_boiin24pch6.eot?#iefix') format('embedded-opentype'), url('//at.alicdn.com/t/font_2223403_oe5p510553.woff?t=1624259078391') format('woff'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.woff2') format('woff2'), url('//at.alicdn.com/t/font_2223403_oe5p510553.ttf?t=1624259078391') format('truetype');
url('//at.alicdn.com/t/font_2223403_boiin24pch6.woff') format('woff'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.ttf') format('truetype'),
url('//at.alicdn.com/t/font_2223403_boiin24pch6.svg#iconfont') format('svg');
} }
.iconfont{ .iconfont {
font-family:"iconfont" !important; font-family: 'iconfont' !important;
font-size:16px; font-size: 16px;
font-style:normal; font-style: normal;
} }
.lottie-icon{
text-align: center;
margin-top: 200px;
margin-bottom: 50px;
&__title{
font-size:14px;
font-family:PingFangSC-Regular;
font-weight:400;
color:#999;
line-height:20px;
margin-top: 20px;
}
}
\ No newline at end of file
/*
* @Author: wufan
* @Date: 2021-06-15 13:48:35
* @LastEditors: wufan
* @LastEditTime: 2021-06-15 14:24:57
* @Description: Description
*/
import React from 'react';
import Lottie from 'react-lottie';
import student from '@/common/lottie/student.json';
import activity from '@/common/lottie/activity.json';
import teacher from '@/common/lottie/teacher.json';
import college from '@/common/lottie/college.json';
import './LottieIcon.less';
interface LottieIconInterface {
size: number,
type: string,
title: string,
isStopped: boolean,
isPaused: boolean,
}
const ANIMATION_DATA_MAP: {
[key: string]: any,
} = {
student,
activity,
teacher,
college
}
function LottieIcon(props: LottieIconInterface) {
const {
title,
size = 90,
type = 'student',
isPaused = true,
isStopped = true,
} = props;
const options = {
loop: true,
autoplay: true,
animationData: ANIMATION_DATA_MAP[type],
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice'
}
}
return (
<div className="lottie-icon">
<Lottie
options={options}
width={size}
height={size}
isPaused={isPaused}
isStopped={isStopped}
/>
<div className="lottie-icon__title">{title}</div>
</div>
)
}
export default LottieIcon;
\ No newline at end of file
/*
* @Author: wufan
* @Date: 2021-05-26 10:29:56
* @LastEditors: wufan
* @LastEditTime: 2021-06-17 14:15:00
* @Description: Description
*/
import React from "react"; import React from "react";
import { Tag } from 'antd'
import "./WatchDataHeader.less"; import "./WatchDataHeader.less";
interface WatchDataHeaderProps { interface WatchDataHeaderProps {
......
...@@ -14,7 +14,7 @@ export default class WechatApi { ...@@ -14,7 +14,7 @@ export default class WechatApi {
timestamp: res.timestamp, // 必填,生成签名的时间戳 timestamp: res.timestamp, // 必填,生成签名的时间戳
nonceStr: res.nonceStr,// 必填,生成签名的随机串 nonceStr: res.nonceStr,// 必填,生成签名的随机串
signature: res.signature, signature: res.signature,
jsApiList: ['startLiving'], jsApiList: ['startLiving','downloadLivingReplay'],
success: function(res) { success: function(res) {
console.log(res,'agentConfig') console.log(res,'agentConfig')
}, },
......
...@@ -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-16 09:57:18
* @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 moveCategory(params: object) {
return Service.Hades('public/hades/editCategoryTree', params) return Service.Hades('public/hades/moveCategory', 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);
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import User from "@/common/js/user";
export function sendLoginAuthCode(params: object) { export function sendLoginAuthCode(params: object) {
return Service.Hades("anon/hades/sendLoginAuthCode", params); return Service.Hades("anon/hades/sendLoginAuthCode", params);
...@@ -47,6 +48,9 @@ export function getEnterpriseUser(params: object) { ...@@ -47,6 +48,9 @@ export function getEnterpriseUser(params: object) {
export function getWXWorkLoginNoCheck(params: object) { export function getWXWorkLoginNoCheck(params: object) {
return Service.Hades('anon/hades/getWXWorkLoginNoCheck', params); return Service.Hades('anon/hades/getWXWorkLoginNoCheck', params);
} }
export function getLesseeVersionMsg() {
return Service.Hades("public/hades/getLesseeVersionMsg",{enterpriseId:User.getEnterpriseId()})
}
export const getOssClient = ( export const getOssClient = (
data: object, data: object,
instId: string, instId: string,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import User from "@/common/js/user"
export function getEmployeeList(params: object) { export function getEmployeeList(params: object) {
return Service.Hades("public/hades/getStoreUserPage", params); return Service.Hades("public/hades/getStoreUserPage", params);
...@@ -76,3 +77,4 @@ export function getStoreDetail(params: object) { ...@@ -76,3 +77,4 @@ export function getStoreDetail(params: object) {
} }
...@@ -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-16 09:56:46
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -12,7 +12,7 @@ import { ...@@ -12,7 +12,7 @@ import {
addCategory, addCategory,
delCategory, delCategory,
editCategory, editCategory,
editCategoryTree, moveCategory,
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 moveCategory(params: any) {
return editCategoryTree(params) return moveCategory(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);
} }
} }
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode,sendLoginAuthCode,login,getLastedVersion, getEnterpriseUser,getWXWorkLoginNoCheck} from '@/data-source/base/request-apis'; import { getUserStore, getUserPermission ,logout,getStoreUser,sendBizAuthCode,editUserPhone,checkBizAuthCode,sendNewPhoneAuthCode,sendLoginAuthCode,login,getLastedVersion, getEnterpriseUser,getWXWorkLoginNoCheck,getLesseeVersionMsg} from '@/data-source/base/request-apis';
export default class StoreService { export default class StoreService {
// 获取员工列表 // 获取员工列表
...@@ -55,5 +55,8 @@ export default class StoreService { ...@@ -55,5 +55,8 @@ export default class StoreService {
static getWXWorkLoginNoCheck(params: any){ static getWXWorkLoginNoCheck(params: any){
return getWXWorkLoginNoCheck(params); return getWXWorkLoginNoCheck(params);
} }
//获取企业配置的版本信息
static getLesseeVersionMsg() {
return getLesseeVersionMsg();
}
} }
\ No newline at end of file
/* /*
* @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: 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -8,18 +8,19 @@ ...@@ -8,18 +8,19 @@
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import PageControl from "@/components/PageControl"; import { CheckBox, PageControl } from "@/components";
import { CheckBox } from "@/components";
import { Button, Table, Modal, message, Input } from "antd"; import { Button, Table, Modal, message, Input } from "antd";
import Service from '@/common/js/service'; import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import EmployeeAddOrEditModal from "../store-manage/EmployeeAddOrEditModal"; import EmployeeAddOrEditModal from "../store-manage/EmployeeAddOrEditModal";
import User from "@/common/js/user"; import User from "@/common/js/user";
import WechatApi from '@/common/js/wechatApi'; import WechatApi from '@/common/js/wechatApi';
import WWOpenDataCom from '@/components/WWOpenDataCom'; import WWOpenDataCom from '@/components/WWOpenDataCom';
import LimitTip from "./LimitTip";
import "./EmployeeManage.less"; import "./EmployeeManage.less";
import ChooseMembersModal from "./modal/ChooseMembersModal"; import ChooseMembersModal from "./modal/ChooseMembersModal";
import SetEmployeeModal from "./modal/SetEmployeeModal";
const { confirm } = Modal; const { confirm } = Modal;
const { Search } = Input; const { Search } = Input;
...@@ -372,8 +373,13 @@ function EmployeeManage() { ...@@ -372,8 +373,13 @@ function EmployeeManage() {
</Button> </Button>
} }
</div> </div>
<LimitTip type="员工" total={total} tip={()=>{return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>)}}/>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={employeeList} dataSource={employeeList}
......
.limit-tip {
height: 32px;
background: #E9EFFF;
border-radius: 2px;
margin-bottom: 13px;
.always {
display: inline-block;
font-size: 14px;
line-height: 32px;
font-weight: 400;
color: #666666;
margin-left: 16px;
.renew-text {
display: inline-block;
color: #2966FF;
cursor: pointer;
.renew-popover {
display: none;
position: absolute;
z-index: 1000;
width: 276px;
height: 294px;
transform: translate(-98px,13px);
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
background-color: white;
background-image: url(https://image.xiaomaiketang.com/xm/CZ4a752jzi.png);
background-repeat: no-repeat;
background-size: cover;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
.popover-arrow {
position: absolute;
display: block;
width: 8.48528137px;
height: 8.48528137px;
background: 0 0;
border-style: solid;
border-width: 4.24264069px;
left: 50%;
transform: translateX(-50%) rotate(45deg);
top: -4px;
border-top-color: #fff;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: #fff;
box-shadow: -2px -2px 5px #0000000f;
}
.qrcode {
width: 182px;
height: 204px;
background-color: white;
margin: 28px auto 16px auto;
img {
width: 150px;
height: 150px;
margin: 16px 16px 8px 16px;
}
}
}
&:hover .renew-popover {
display: block;
}
}
}
}
\ No newline at end of file
import React, { useEffect, useState } from "react";
import BaseService from "@/domains/basic-domain/baseService";
import { Tooltip } from "antd"
import "./LimitTip.less"
export default function LimitTip(props:{total:number,type:string,tip:() => React.ReactNode}) {
const [isOver, setIsOver] = useState(false)
const [limitUser, setLimitUser] = useState(0)
useEffect(()=> {
BaseService.getLesseeVersionMsg()
.then(res=> {
setIsOver(res.result.surplusUserNum === 0 || res.result.whetherReachUserNum)
setLimitUser(res.result.userNum)
})
},[])
return (
<div className="limit-tip">
<div className="always">本学院{props.type}<span style={{color:"#333333",fontWeight:"bold"}}>{props.total}</span>
<Tooltip overlayStyle={{maxWidth:"587px",width:"fit-content"}} placement="topLeft" arrowPointAtCenter title={props.tip}>
<span className="icon iconfont" style={{cursor:"pointer",marginLeft:"4px",color:"#bfbfbf"}}>&#59449;</span>
</Tooltip>
{
isOver ? (
<>
<div style={{marginLeft:"14px",display:"inline-block"}}>当前企业使用人数已达到上限 (<span style={{color:"#333333",fontWeight:"bold"}}>{limitUser}</span>人),将无法添加新员工、新学员,如需增加人数限制,请联系小麦企学院服务平台。</div>
<div className="renew-text">立即续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span>
<div className="renew-popover">
<div className="popover-arrow"><span className="popover-arrow-content"></span></div>
<div className="qrcode">
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码续费</div>
</div>
<div className="phone"><svg style={{position:"relative",top:"2px",marginRight:"4px"}} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
咨询电话:19157875632</div>
</div>
</div>
</>
) : ("")
}
</div>
</div>
)
}
\ No newline at end of file
...@@ -17,4 +17,5 @@ ...@@ -17,4 +17,5 @@
margin-left: 4px; margin-left: 4px;
} }
} }
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-30 15:57:40 * @LastEditTime: 2021-06-21 11:13:15
* @Description: 学员管理页面 * @Description: 学员管理页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -11,19 +11,25 @@ import React, { useEffect, useState } from "react"; ...@@ -11,19 +11,25 @@ import React, { useEffect, useState } from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import { PageControl } from "@/components"; import { PageControl } from "@/components";
import { Table, Input, DatePicker, Select, Button, message } from "antd"; import { Input, DatePicker, Select, Button, message } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import ChooseMembersModal from "./modal/ChooseMembersModal"; import ChooseMembersModal from "./modal/ChooseMembersModal";
import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
import LimitTip from "./LimitTip"
import "./UserManagePage.less"; import "./UserManagePage.less";
import moment from "moment"; import moment from "moment";
const { Option } = Select; const { Option } = Select;
const { Search } = Input; const { Search } = Input;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
declare var window: any; declare var window: any;
function UserManagePage() { function UserManagePage() {
const [userList, setUserList] = useState([]); const [userList, setUserList] = useState([]);
const [model, setModel] = useState<React.ReactNode>(null); const [model, setModel] = useState<React.ReactNode>(null);
...@@ -197,8 +203,13 @@ function UserManagePage() { ...@@ -197,8 +203,13 @@ function UserManagePage() {
}} }}
>添加学员</Button> >添加学员</Button>
} }
<LimitTip type="学员" total={total} tip={()=>{ return (<div><div>1、数据为当前学院的员工数,若学员存在多个学院,企业人数只统计为1人;</div><div>2、若一个学员既用「企业微信」登录学习又用「微信」登录学习,企业人数将统计为2人。</div></div>)}}/>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={userList} dataSource={userList}
......
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Input, Table, message, Tooltip, Empty } from 'antd'; import { Modal, Input, message, Tooltip } from 'antd';
import { XMTable } from '@/components'; import { XMTable } from '@/components';
import college from '@/common/lottie/college.json';
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 SetEmployeeModal from "./SetEmployeeModal"; import SetEmployeeModal from "./SetEmployeeModal";
...@@ -252,7 +253,6 @@ class ChooseMembersModal extends React.Component { ...@@ -252,7 +253,6 @@ class ChooseMembersModal extends React.Component {
title: '全选', // 实际为头像,但在表格上这行要求显示为全选 title: '全选', // 实际为头像,但在表格上这行要求显示为全选
key: 'avatar', key: 'avatar',
dataIndex: 'avatar', dataIndex: 'avatar',
width: '40%',
render: (value, record) => { render: (value, record) => {
const { name } = record; const { name } = record;
...@@ -363,7 +363,7 @@ class ChooseMembersModal extends React.Component { ...@@ -363,7 +363,7 @@ class ChooseMembersModal extends React.Component {
pagination={false} pagination={false}
scroll={{ y: 290}} scroll={{ y: 290}}
renderEmpty={{ renderEmpty={{
image: searchKey ? search : '', image: searchKey ? search : college,
description: <div> description: <div>
<div style={{ color: '#333' }}>暂无数据</div> <div style={{ color: '#333' }}>暂无数据</div>
<div style={{ color: '#666', padding: '0 32px', fontSize: '12px' }}>需要先将员工添加到企微可见范围后,员工才会出现在这里</div> <div style={{ color: '#666', padding: '0 32px', fontSize: '12px' }}>需要先将员工添加到企微可见范围后,员工才会出现在这里</div>
...@@ -371,7 +371,7 @@ class ChooseMembersModal extends React.Component { ...@@ -371,7 +371,7 @@ class ChooseMembersModal extends React.Component {
}} }}
size={'small'} size={'small'}
rowSelection={{ rowSelection={{
columnWidth : 24, columnWidth : 63,
selectedRowKeys, selectedRowKeys,
onChange : this.onChangeRow, onChange : this.onChangeRow,
getCheckboxProps : this.getCheckboxProps, getCheckboxProps : this.getCheckboxProps,
...@@ -390,7 +390,11 @@ class ChooseMembersModal extends React.Component { ...@@ -390,7 +390,11 @@ class ChooseMembersModal extends React.Component {
<span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span> <span className={ (selectUserList.length > 0) ? 'span-right-l' : null }>清空</span>
</div> </div>
<div className='container-right-body'> <div className='container-right-body'>
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
rowKey={(record) => record.enterpriseVisibleUserId} rowKey={(record) => record.enterpriseVisibleUserId}
dataSource={selectUserList} dataSource={selectUserList}
columns={this.selectedColumnsRight()} columns={this.selectedColumnsRight()}
......
...@@ -125,7 +125,9 @@ ...@@ -125,7 +125,9 @@
.ant-empty-normal { .ant-empty-normal {
margin: 120px 0 !important; margin: 120px 0 !important;
} }
.ant-empty {
margin-top: 76px;
}
.avatar{ .avatar{
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -25,7 +25,7 @@ function CerateQWCourse(props: any) { ...@@ -25,7 +25,7 @@ function CerateQWCourse(props: any) {
const [liveDuration, setLiveDuration] = useState(60); const [liveDuration, setLiveDuration] = useState(60);
const [liveStart, setLiveStart] = useState(0); const [liveStart, setLiveStart] = useState(0);
const [type, setType] = useState('0'); const [type, setType] = useState('0');
const [livingId, setLivingId] = useState(0);
function handleSave() { function handleSave() {
const param = { const param = {
...@@ -42,6 +42,7 @@ function CerateQWCourse(props: any) { ...@@ -42,6 +42,7 @@ function CerateQWCourse(props: any) {
Service.Hades('anon/hades/wxWorkCreateLiveDemo', param).then((res) => { Service.Hades('anon/hades/wxWorkCreateLiveDemo', param).then((res) => {
console.log(22) console.log(22)
handleConvertShortUrl(res.result) handleConvertShortUrl(res.result)
setLivingId(res.result)
wx.invoke('startLiving', { wx.invoke('startLiving', {
"livingId": res.result, "livingId": res.result,
}, function (res: any) { }, function (res: any) {
...@@ -72,6 +73,18 @@ function CerateQWCourse(props: any) { ...@@ -72,6 +73,18 @@ function CerateQWCourse(props: any) {
}) })
} }
function downloadLivingReplay(){
wx.invoke('downloadLivingReplay', {
livingId
}, function(res:any) {
console.log(res,'tyuuioythbn')
if (res.err_msg != "downloadLivingReplay:ok") {
// 错误处理
}
});
}
return <div className="page createQWCourse "> return <div className="page createQWCourse ">
<Breadcrumbs navList={props.type === 'edit' ? "编辑考试" : "新建直播课"} goBack={props.history.goBack} /> <Breadcrumbs navList={props.type === 'edit' ? "编辑考试" : "新建直播课"} goBack={props.history.goBack} />
...@@ -139,6 +152,7 @@ function CerateQWCourse(props: any) { ...@@ -139,6 +152,7 @@ function CerateQWCourse(props: any) {
<div style={{width:100,margin:'0 auto'}} className="qrcode"></div> <div style={{width:100,margin:'0 auto'}} className="qrcode"></div>
</div> </div>
<div className="footer"> <div className="footer">
<Button onClick={downloadLivingReplay}>下载直播回放</Button>
<Button onClick={props.history.goBack}>取消</Button> <Button onClick={props.history.goBack}>取消</Button>
<Button type="primary" onClick={handleSave}>保存</Button> <Button type="primary" onClick={handleSave}>保存</Button>
</div> </div>
......
/* /*
* @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 20:01:05
* @Description: 视频课-列表模块 * @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
*/ */
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
* @Last Modified by: chenshu * @Last Modified by: chenshu
* @Last Modified time: 2021-06-08 18:18:46 * @Last Modified time: 2021-06-08 18:18:46
*/ */
import React, { useEffect, useState } from 'react'; import React from 'react';
import { Modal, Button, Table, Progress, message, Tooltip, Spin, Popconfirm } from 'antd'; import { Modal, Button, Table, message, Tooltip, Spin, Popconfirm } from 'antd';
import { QuestionCircleOutlined,LoadingOutlined} from "@ant-design/icons"; import { QuestionCircleOutlined,LoadingOutlined} from "@ant-design/icons";
import _ from 'underscore'; import _ from 'underscore';
import moment from 'moment'; import moment from 'moment';
import Lottie from "lottie-web"; import Lottie from "lottie-web";
import User from '@/common/js/user'; import User from '@/common/js/user';
import { suffixType, DEFAULT_SIZE_UNIT, SupportFileType } from '@/common/constants/academic/liveEnum'; import { suffixType, DEFAULT_SIZE_UNIT } from '@/common/constants/academic/liveEnum';
import { FileVerifyMap, FileTypeIcon, DISK_MAP } from '@/common/constants/academic/lessonEnum'; import { FileVerifyMap, FileTypeIcon } from '@/common/constants/academic/lessonEnum';
import ScanFileModal from '@/modules/prepare-lesson/modal/ScanFileModal' import ScanFileModal from '@/modules/prepare-lesson/modal/ScanFileModal'
import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal'; import SelectPrepareFileModal from '@/modules/prepare-lesson/modal/SelectPrepareFileModal';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
...@@ -229,14 +229,18 @@ class ManageCoursewareModal extends React.Component { ...@@ -229,14 +229,18 @@ class ManageCoursewareModal extends React.Component {
const antIcon = <LoadingOutlined/>; const antIcon = <LoadingOutlined/>;
const type = FileVerifyMap[fileType].type; const type = FileVerifyMap[fileType].type;
return <div className="courseware-name" onClick={() => this.handleScanFile(item)}> return <div className="courseware-name" onClick={() => this.handleScanFile(item)}>
{(type === 'JPG' || type === 'PNG') && item.progress ? <Choose>
<When condition={(type === 'JPG' || type === 'PNG') && item.progress}>
<Spin indicator={antIcon} /> <Spin indicator={antIcon} />
:<img </When>
<Otherwise>
<img
src={FileTypeIcon[FileVerifyMap[fileType].type] || (item.docUrls[0] || {}).conversionFileUrl} src={FileTypeIcon[FileVerifyMap[fileType].type] || (item.docUrls[0] || {}).conversionFileUrl}
alt="" alt=""
className="item-img" className="item-img"
/> />
} </Otherwise>
</Choose>
<Tooltip title={item.fileName}><span className="name">{item.fileName}</span></Tooltip> <Tooltip title={item.fileName}><span className="name">{item.fileName}</span></Tooltip>
</div> </div>
}, },
...@@ -270,7 +274,7 @@ class ManageCoursewareModal extends React.Component { ...@@ -270,7 +274,7 @@ class ManageCoursewareModal extends React.Component {
width: "16%", width: "16%",
dataIndex: "control", dataIndex: "control",
render: (_value, item) => { render: (_value, item) => {
const { uploadObject, failObject, cancelObject } = this.state; const { failObject } = this.state;
const uploadFail = failObject[item.id]; const uploadFail = failObject[item.id];
// 上课前45分钟/上课中/已结束的情况下都不可操作 // 上课前45分钟/上课中/已结束的情况下都不可操作
...@@ -295,7 +299,7 @@ class ManageCoursewareModal extends React.Component { ...@@ -295,7 +299,7 @@ class ManageCoursewareModal extends React.Component {
const { const {
list, scanFileModal, editData, cancelObject, list, scanFileModal, editData, cancelObject,
showSelectFileModal, selectedFileList, showSelectFileModal, selectedFileList,
diskList, currentRootDisk, isLessonPermission diskList
} = this.state; } = this.state;
const _list = _.reject(list, (item) => cancelObject[item.id]); const _list = _.reject(list, (item) => cancelObject[item.id]);
return ( return (
......
...@@ -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{
background: #FFF;
margin:0;
padding: 20px;
margin-bottom:140px;
.course-name-title { .course-name-title {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
...@@ -83,6 +84,82 @@ ...@@ -83,6 +84,82 @@
} }
} }
} }
#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;
}
.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 {
......
/*
* @Author: 吴文洁
* @Date: 2020-08-05 10:12:45
* @LastEditors: yuananting
* @LastEditTime: 2021-06-02 16:15:55
* @Description: 视频课-列表模块
* @Copyright: 杭州杰竞科技有限公司 版权所有
*/
import React from 'react'; import React from 'react';
import { Table, Modal, message , Tooltip,Switch,Dropdown} from 'antd'; import { Table, Modal, message , Tooltip,Switch,Dropdown} from 'antd';
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
......
import React from 'react'; import React, { useEffect, useState } from 'react';
import { Select, Tooltip } from 'antd'; import { Select, Tooltip } 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';
...@@ -19,10 +19,44 @@ import { ...@@ -19,10 +19,44 @@ import {
} from "bizcharts"; } from "bizcharts";
import moment from 'moment' import moment from 'moment'
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import BaseService from "@/domains/basic-domain/baseService";
import User from '@/common/js/user'; import User from '@/common/js/user';
import './Home.less'; import './Home.less';
const Option = Select.Option; const Option = Select.Option;
function HomeTip() {
const [isOverNum, setIsOverNum] = useState(false)
useEffect(()=> {
BaseService.getLesseeVersionMsg()
.then(res=> {
setIsOverNum(res.result.surplusUserNum === 0)
})
},[])
return isOverNum ? (
<div className="home-tip">
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系小麦企学院服务平台。
<div className="renew-btn">立即续费
<div className="renew-popover">
<div className="popover-arrow"><span class="popover-arrow-content"></span></div>
<div className="qrcode">
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码续费</div>
</div>
<div className="phone"><svg style={{position:"relative",top:"2px",marginRight:"4px"}} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
咨询电话:19157875632</div>
</div>
</div>
</div>
</div>
) : ("")
}
class Home extends React.Component { class Home extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -264,6 +298,7 @@ class Home extends React.Component { ...@@ -264,6 +298,7 @@ class Home extends React.Component {
}; };
return ( return (
<div className="home-page"> <div className="home-page">
<HomeTip />
<div className="data-wrap"> <div className="data-wrap">
<div className="home-title">数据概况</div> <div className="home-title">数据概况</div>
<div className="data-box"> <div className="data-box">
......
...@@ -28,6 +28,81 @@ ...@@ -28,6 +28,81 @@
font-family: 'number'; font-family: 'number';
src: url('https://image.xiaomaiketang.com/xm/n2sADd2jY6.TTF'); src: url('https://image.xiaomaiketang.com/xm/n2sADd2jY6.TTF');
} }
.home-tip {
height: 40px;
background: #FFE7E7;
margin-bottom: 16px;
.content {
font-size: 14px;
color: #666666;
font-weight: 400;
line-height: 40px;
padding-left: 16px;
.renew-btn {
display: inline-block;
width: 80px;
height: 28px;
background: #FF4F4F;
border-radius: 2px;
color: #ffffff;
font-size: 14px;
font-weight: 400;
line-height: 28px;
text-align: center;
cursor: pointer;
.renew-popover {
display: none;
position: absolute;
z-index: 1000;
width: 276px;
height: 294px;
transform: translate(-98px,13px);
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
background-color: white;
background-image: url(https://image.xiaomaiketang.com/xm/CZ4a752jzi.png);
background-repeat: no-repeat;
background-size: cover;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
.popover-arrow {
position: absolute;
display: block;
width: 8.48528137px;
height: 8.48528137px;
background: 0 0;
border-style: solid;
border-width: 4.24264069px;
left: 50%;
transform: translateX(-50%) rotate(45deg);
top: -4px;
border-top-color: #fff;
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: #fff;
box-shadow: -2px -2px 5px #0000000f;
}
.qrcode {
width: 182px;
height: 204px;
background-color: white;
margin: 28px auto 16px auto;
img {
width: 150px;
height: 150px;
margin: 16px 16px 8px 16px;
}
}
}
&:hover .renew-popover {
display: block;
}
}
}
}
.data-wrap{ .data-wrap{
background: #FFF; background: #FFF;
.data-box { .data-box {
......
...@@ -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 杭州杰竞科技有限公司 版权所有
*/ */
......
import React from 'react'; import React from 'react';
import { Button } from 'antd';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import User from '@/common/js/user';
import './ExpiredCourseList.less'; import './ExpiredCourseList.less';
function ExpiredCourseList(props) { function ExpiredCourseList(props) {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* @Description: 大班直播、互动班课列表的筛选组件 * @Description: 大班直播、互动班课列表的筛选组件
*/ */
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { Row, Input, Select ,Tooltip} from 'antd'; import { Row, Input, Select ,Tooltip} from 'antd';
import RangePicker from "@/modules/common/DateRangePicker"; import RangePicker from "@/modules/common/DateRangePicker";
...@@ -86,7 +86,7 @@ function PlanFilter(props) { ...@@ -86,7 +86,7 @@ function PlanFilter(props) {
}; };
StoreService.getStoreUserBasicPage( _query).then((res) => { StoreService.getStoreUserBasicPage( _query).then((res) => {
const { result = {} } = res; const { result = {} } = res;
const { records = [], total = 0, hasNext } = result; const { records = [], hasNext } = result;
const list = current > 1 ? creatorList.concat(records) : records; const list = current > 1 ? creatorList.concat(records) : records;
setHasNext(hasNext); setHasNext(hasNext);
setCreatorList(list); setCreatorList(list);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: zhangleyuan * @Author: zhangleyuan
* @Date: 2021-02-20 16:46:46 * @Date: 2021-02-20 16:46:46
* @LastEditors: fusanqiasng * @LastEditors: fusanqiasng
* @LastEditTime: 2021-06-01 11:45:34 * @LastEditTime: 2021-06-15 14:37:20
* @Description: 描述一下 * @Description: 描述一下
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Table, Modal, message, Tooltip, Switch, Dropdown } from 'antd'; import { Table, Modal, message, Tooltip, Switch, Dropdown } from 'antd';
import { withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
import { PageControl, XMTable } from "@/components"; import { PageControl, XMTable } from '@/components';
import PlanService from '@/domains/plan-domain/planService'; import PlanService from '@/domains/plan-domain/planService';
import SharePlanModal from '../modal/SharePlanModal'; import SharePlanModal from '../modal/SharePlanModal';
import { LIVE_SHARE } from '@/domains/course-domain/constants'; import { LIVE_SHARE } from '@/domains/course-domain/constants';
...@@ -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{
background: #FFF;
margin:0;
padding: 20px;
margin-bottom:140px;
.course-name-title { .course-name-title {
font-size: 14px; font-size: 14px;
color: #333; color: #333;
...@@ -83,6 +84,83 @@ ...@@ -83,6 +84,83 @@
} }
} }
} }
#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;
}
.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: 12px;
color: #999;
font-size: 28px;
line-height: 40px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 100%;
}
}
}
}
.right { .right {
.title { .title {
......
...@@ -7,23 +7,20 @@ ...@@ -7,23 +7,20 @@
*/ */
import React from 'react'; import React from 'react';
import { Modal, Button, Radio, Checkbox, Spin, Upload, message, Tooltip } from 'antd'; import { Modal, Button, Radio, Checkbox, message, Tooltip } from 'antd';
import InfiniteScroll from 'react-infinite-scroller';
import User from '@/common/js/user'; import User from '@/common/js/user';
import { getEllipsText } from "@/core/util"; import { getEllipsText } from "@/core/util";
import DefaultIcon from '@/modules/common/DefaultIcon';
import UploadProgressModal from './UploadProgressModal'; import UploadProgressModal from './UploadProgressModal';
import NonCompliantFileModal from './NonCompliantFileModal'; import NonCompliantFileModal from './NonCompliantFileModal';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import _ from 'underscore'; import _ from 'underscore';
import { import {
DEFAULT_SIZE_UNIT, FileTypeIcon, NonCompliantFileMap, DEFAULT_SIZE_UNIT, FileTypeIcon,
DISK_LIST, SupportFileType, LocalFileType,FileVerifyMap SupportFileType, FileVerifyMap
} from "@/common/constants/academic/lessonEnum"; } from "@/common/constants/academic/lessonEnum";
import { getFileTypeByName } from '../components/FolderManage'; import { getFileTypeByName } from '../components/FolderManage';
import LottieIcon from '@/components/LottieIcon';
import './SelectPrepareFileModal.less'; import './SelectPrepareFileModal.less';
const defaultQuery = { const defaultQuery = {
...@@ -660,9 +657,10 @@ class SelectPrepareFileModal extends React.Component { ...@@ -660,9 +657,10 @@ class SelectPrepareFileModal extends React.Component {
} }
</div> </div>
</div> : </div> :
<DefaultIcon <LottieIcon
type='student'
title={<span className="desc">这个文件夹是空的</span>} title={<span className="desc">这个文件夹是空的</span>}
type="college"
size={150}
/> />
} }
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
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 * as lodash from 'lodash'; import { PageControl } from 'xiaomai-b-components';
import { PageControl, LottieIcon } 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';
...@@ -122,7 +121,7 @@ class FolderList extends React.Component { ...@@ -122,7 +121,7 @@ class FolderList extends React.Component {
break; break;
} }
} }
getYoZoSign = (data,type)=>{ getYoZoSign = (data,type,folderName)=>{
return new Promise((resolve) => { return new Promise((resolve) => {
let uploadParams; let uploadParams;
if(type==="UPLOAD"){ if(type==="UPLOAD"){
...@@ -135,7 +134,8 @@ class FolderList extends React.Component { ...@@ -135,7 +134,8 @@ class FolderList extends React.Component {
uploadParams ={ uploadParams ={
fileVersionId:data, fileVersionId:data,
instId:window.currentUserInstInfo.instId, instId:window.currentUserInstInfo.instId,
yoZoTypeEnum:'VIEW' yoZoTypeEnum:'VIEW',
htmlTitle:folderName
} }
} }
Service.Apollo('public/apollo/getYoZoSign', uploadParams).then(res => { Service.Apollo('public/apollo/getYoZoSign', uploadParams).then(res => {
...@@ -157,7 +157,7 @@ class FolderList extends React.Component { ...@@ -157,7 +157,7 @@ class FolderList extends React.Component {
} }
// 预览文件 // 预览文件
handleScanFile = async (folder) => { handleScanFile = async (folder) => {
const { folderFormat, folderSize, ossUrl,rights,fileVersionId,id} = folder; const { folderFormat, folderSize, ossUrl,rights,fileVersionId,id,folderName} = folder;
const {currentRootDisk } = this.props; const {currentRootDisk } = this.props;
//如果是公共文件且只有查看的权限的用户的预览对接的三方是永中 //如果是公共文件且只有查看的权限的用户的预览对接的三方是永中
const that = this; const that = this;
...@@ -183,8 +183,8 @@ class FolderList extends React.Component { ...@@ -183,8 +183,8 @@ class FolderList extends React.Component {
that.saveYoZoFileVersionId(response.data.data.fileVersionId,id); that.saveYoZoFileVersionId(response.data.data.fileVersionId,id);
const { previewing } = that.state; const { previewing } = that.state;
if(previewing){ if(previewing){
const previewSign = await that.getYoZoSign(response.data.data.fileVersionId,"VIEW"); const previewSign = await that.getYoZoSign(response.data.data.fileVersionId,"VIEW",folderName);
const url = `https://eic.yozocloud.cn/api/view/file?fileVersionId=${response.data.data.fileVersionId}&appId=${appId}&sign=${previewSign}` const url = `https://eic.yozocloud.cn/api/view/file?fileVersionId=${response.data.data.fileVersionId}&appId=${appId}&sign=${previewSign}&htmlTitle=${folderName}`
that.setState({ that.setState({
previewStatus:'UPLOAD_SUCCESS', previewStatus:'UPLOAD_SUCCESS',
url url
...@@ -193,8 +193,8 @@ class FolderList extends React.Component { ...@@ -193,8 +193,8 @@ class FolderList extends React.Component {
}) })
}) })
}else{ }else{
const previewSign = await that.getYoZoSign(fileVersionId,"VIEW"); const previewSign = await that.getYoZoSign(fileVersionId,"VIEW",folderName);
const url = `http://eic.yozocloud.cn/api/view/file?fileVersionId=${fileVersionId}&appId=${appId}&sign=${previewSign}` const url = `http://eic.yozocloud.cn/api/view/file?fileVersionId=${fileVersionId}&appId=${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);
...@@ -278,8 +278,6 @@ class FolderList extends React.Component { ...@@ -278,8 +278,6 @@ class FolderList extends React.Component {
this.handleDataDot(folderFormat); this.handleDataDot(folderFormat);
} }
cancelPreview = ()=>{ cancelPreview = ()=>{
const rightDom = document.querySelector('.right-container');
rightDom.style.zIndex = 1;
this.setState({ this.setState({
previewing:false, previewing:false,
showPreviewModal:false, showPreviewModal:false,
......
...@@ -13,7 +13,7 @@ import _ from 'underscore'; ...@@ -13,7 +13,7 @@ import _ from 'underscore';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import { getEllipsText } from '@/domains/basic-domain/utils'; import { getEllipsText } from '@/domains/basic-domain/utils';
import { DEFAULT_SIZE_UNIT, LOCAL_FILE_TYPE_MAP,FILR_VERIFY_MAP,SUPPORT_FILE_TYPE_MAP} from '@/domains/resource-disk/constants'; import { DEFAULT_SIZE_UNIT,FILR_VERIFY_MAP,SUPPORT_FILE_TYPE_MAP} from '@/domains/resource-disk/constants';
import { getFileTypeByName } from '@/domains/resource-disk/utils'; import { getFileTypeByName } from '@/domains/resource-disk/utils';
import UploadProgressModal from '@/bu-components/UploadProgressModal'; import UploadProgressModal from '@/bu-components/UploadProgressModal';
......
...@@ -29,25 +29,6 @@ class PrepareLessonPage extends React.Component { ...@@ -29,25 +29,6 @@ class PrepareLessonPage extends React.Component {
} }
} }
componentWillMount() {
// this.handleFetchDiskList();
}
handleFetchDiskList = async () => {
const res = await Service.Hades('public/apollo/getUserDisk', {});
const { result = [] } = res;
const diskList = result.map((item) => {
return {
...item,
folderName: DISK_MAP[item.disk]
}
});
this.setState({
diskList,
currentRootDisk: diskList[0] || defaultRootDisk
});
}
handleChangeDisk = (disk) => { handleChangeDisk = (disk) => {
this.setState({ this.setState({
currentRootDisk: disk currentRootDisk: disk
......
import React from 'react'; import React from 'react';
import { Modal, Input, Form, message } from 'antd'; import { Modal, Input, Form } from 'antd';
import ShowTips from '@/bu-components/ShowTip';
import './CreateFolderModal.less'; import './CreateFolderModal.less';
class CreateFolderModal extends React.Component { class CreateFolderModal extends React.Component {
...@@ -107,5 +106,4 @@ class CreateFolderModal extends React.Component { ...@@ -107,5 +106,4 @@ class CreateFolderModal extends React.Component {
} }
} }
// export default Form.create()(CreateFolderModal);
export default CreateFolderModal; export default CreateFolderModal;
\ No newline at end of file
import React from 'react'; import React from 'react';
import { Modal} from 'antd';
import "./PreviewFileModal.less"; import "./PreviewFileModal.less";
import { Spin } from 'antd'
class PreviewFileModal extends React.Component { class PreviewFileModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -26,7 +25,7 @@ class PreviewFileModal extends React.Component { ...@@ -26,7 +25,7 @@ class PreviewFileModal extends React.Component {
<div className="preview-modal-content"> <div className="preview-modal-content">
<div className="load-img-box"> <div className="load-img-box">
{previewStatus === "UPLOAD" && {previewStatus === "UPLOAD" &&
<img className="load-img" src="https://image.xiaomaiketang.com/xm/3j32ashQst.png"></img> <Spin size="large"/>
} }
{previewStatus === "UPLOAD_SUCCESS" && {previewStatus === "UPLOAD_SUCCESS" &&
<img className="load-img" src="https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"></img> <img className="load-img" src="https://image.xiaomaiketang.com/xm/jJRK3bTEdc.png"></img>
......
...@@ -15,6 +15,9 @@ ...@@ -15,6 +15,9 @@
text-align:center; text-align:center;
width:266px; width:266px;
height:174px; height:174px;
.ant-spin-dot-item{
background-color: #FFF;
}
.load-img-box{ .load-img-box{
.load-img{ .load-img{
width:44px; width:44px;
......
...@@ -118,7 +118,6 @@ const App: React.FC = (props: any) => { ...@@ -118,7 +118,6 @@ const App: React.FC = (props: any) => {
setMenuType(!menuType); setMenuType(!menuType);
} }
if (!storeUserId) { if (!storeUserId) {
return <div></div> return <div></div>
} }
...@@ -129,7 +128,7 @@ const App: React.FC = (props: any) => { ...@@ -129,7 +128,7 @@ const App: React.FC = (props: any) => {
<ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}> <ConfigProvider locale={zhCN} autoInsertSpaceInButton={false}>
<Main menuType={menuType} /> <Main menuType={menuType} />
</ConfigProvider> </ConfigProvider>
<Menu menuType={menuType} handleMenuType={handleMenuType}/> <Menu menuType={menuType} handleMenuType={handleMenuType} />
</div> </div>
) )
} }
......
import React from 'react'; import React, { useEffect, useState } from 'react';
import moment from "moment"
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import BaseService from "@/domains/basic-domain/baseService"; import BaseService from "@/domains/basic-domain/baseService";
import User from "@/common/js/user"; import User from "@/common/js/user";
import { LIVE_SHARE } from "@/domains/course-domain/constants"; import { LIVE_SHARE } from "@/domains/course-domain/constants";
import moment from 'moment';
import { Modal, message } from 'antd'; import { Modal, message } from 'antd';
import './CollegeManagePage.less'; import './CollegeManagePage.less';
import storage from '@/common/js/storage';
const roleMap = { const roleMap = {
CloudManager: "管理员", CloudManager: "管理员",
...@@ -14,6 +15,88 @@ const roleMap = { ...@@ -14,6 +15,88 @@ const roleMap = {
CloudOperator: '运营师', CloudOperator: '运营师',
}; };
function ExpirationPopover(props) {
const [showType, setShowType] = useState(0); //0不显示,1剩余30天,2小于等于7天,3已过期
useEffect(()=> {
if (props.surplusDayTime === 0 ) {
//已过期
let loginflag = storage.get("expiration_tip_login")
if (loginflag === null || loginflag === "true") {
//只有登陆进来的时候提示一次
console.log("showtype",showType)
setShowType(3)
}
return
}
//即将过期
if (props.surplusDayTime === 30) {
if (storage.get("expiration_tip"+User.getUserId()+"_thirty") == null || storage.get("expiration_tip"+User.getUserId()+"_thirty") === "true") {
setShowType(1)
}
return
}
if (props.surplusDayTime <= 7) {
let daysflag = storage.getObj("expiration_tip"+User.getUserId()+"_7day");
if (!daysflag) {
setShowType(2)
return
}
if (daysflag[props.surplusDayTime - 1] === 0) {
setShowType(2)
}
}
},[props.endTime,props.surplusDayTime])
function iknow() {
if (props.surplusDayTime === 0 ) {
//已过期
storage.set("expiration_tip_login",false)
} else if (props.surplusDayTime === 30) {
storage.set("expiration_tip"+User.getUserId()+"_thirty",false)
} else if (props.surplusDayTime <= 7) {
let daysflag = [0,0,0,0,0,0,0]
daysflag[props.surplusDayTime - 1] = 1
storage.setObj("expiration_tip"+User.getUserId()+"_7day",daysflag)
}
setShowType(0)
}
if (props.surplusDayTime > 30) {
return ("")
}
return (
<>
{
showType === 0 ? ("") :(
<div className="expirationpopover">
<div className="dialog">
<div className="title">服务到期提醒</div>
{
showType === 3 ? (
<div className="tip-text">当前企业购买的小麦企学院服务已于<span style={{color:"#FF4F4F"}}>{moment(props.endTime).format("YYYY-MM-DD")}</span>到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~</div>
) : (
<div className="tip-text">当前企业购买的小麦企学院服务 <span style={{color:"#FF4F4F"}}>仅剩{props.surplusDayTime}</span>(于<span>{moment(props.endTime).format("YYYY-MM-DD")}</span>到期),为了不影响使用,建议尽快续费购买哦~</div>
)
}
<div className="qrcode">
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码续费</div>
</div>
<div className="phone"><svg style={{position:"relative",top:"2px",marginRight:"4px"}} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
咨询电话:19157875632</div>
<div className="button" onClick={iknow}>我知道了</div>
</div>
</div>
)
}
</>
)
}
export default class CollegeManagePage extends React.Component { export default class CollegeManagePage extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -24,13 +107,16 @@ export default class CollegeManagePage extends React.Component { ...@@ -24,13 +107,16 @@ export default class CollegeManagePage extends React.Component {
enterpriseId: User.getEnterpriseId(), enterpriseId: User.getEnterpriseId(),
isAdmin: false, isAdmin: false,
createStoreList:[], createStoreList:[],
joinStoreList:[] joinStoreList:[],
surplusDayTime:365, //剩余天数
endTime: 0 //有效截至时间
}; };
} }
componentDidMount() { componentDidMount() {
this.getStoreList(); this.getStoreList();
this.getEnterpriseUser(); this.getEnterpriseUser();
this.getVersion()
} }
getEnterpriseUser() { getEnterpriseUser() {
...@@ -45,6 +131,17 @@ export default class CollegeManagePage extends React.Component { ...@@ -45,6 +131,17 @@ export default class CollegeManagePage extends React.Component {
}); });
} }
getVersion() {
BaseService.getLesseeVersionMsg()
.then(res=> {
User.setVersion(res.result)
this.setState({
surplusDayTime: res.result.stateEnum === "YES" ? 0 : res.result.surplusDayTime,
endTime: res.result.validEndTime
})
})
}
getStoreList() { getStoreList() {
const { enterpriseId } = this.state; const { enterpriseId } = this.state;
if (!enterpriseId) return null; if (!enterpriseId) return null;
...@@ -132,6 +229,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -132,6 +229,7 @@ export default class CollegeManagePage extends React.Component {
} = this.state; } = this.state;
return ( return (
<div className="college-manage-page"> <div className="college-manage-page">
<ExpirationPopover surplusDayTime={this.state.surplusDayTime} endTime={this.state.endTime}/>
<div className="college-header"> <div className="college-header">
<div className="box"> <div className="box">
<img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" /> <img className="box-image" src="https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png" />
...@@ -179,6 +277,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -179,6 +277,7 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -196,6 +295,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -196,6 +295,7 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
...@@ -250,6 +350,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -250,6 +350,7 @@ export default class CollegeManagePage extends React.Component {
return null; return null;
}; };
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.RCHistory.push('/home') window.RCHistory.push('/home')
}} }}
> >
...@@ -267,6 +368,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -267,6 +368,7 @@ export default class CollegeManagePage extends React.Component {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
User.setStoreId(item.id); User.setStoreId(item.id);
User.setStoreUserId(item.storeUserId);
window.RCHistory.push('/college-info') window.RCHistory.push('/college-info')
}} }}
>编辑</span> >编辑</span>
......
...@@ -183,4 +183,78 @@ ...@@ -183,4 +183,78 @@
} }
} }
} }
.expirationpopover {
display: flex;
justify-content: center;
align-items: center;
position: absolute;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0,0,0,0.7);
z-index: 1000;
.dialog {
width: 560px;
height: 486px;
background: #FFFFFF;
border-radius: 4px;
.title {
text-align: center;
font-size: 20px;
color: #333333;
font-weight: 500;
margin-top: 40px;
}
.tip-text {
font-size: 16px;
color: #666666;
font-weight: 400;
margin-top: 16px;
margin-right: 40px;
margin-left: 40px;
}
.qrcode {
width: 182px;
height: 204px;
background: #F1F3F6;
border-radius: 2px;
margin-top: 16px;
margin-left: auto;
margin-right: auto;
img {
width: 150px;
height: 150px;
margin: 16px 16px 8px 16px;
}
.des {
text-align: center;
font-size: 14px;
color: #333333;
font-weight: 400;
}
}
.phone {
text-align: center;
font-size: 14px;
color: #333333;
font-weight: 400;
margin-top: 16px;
}
.button {
width: 80px;
height: 32px;
background: #2966FF;
cursor: pointer;
margin-left: auto;
margin-right: auto;
margin-top: 24px;
font-size: 14px;
font-weight: 400;
color: #ffffff;
line-height: 32px;
text-align: center;
}
}
}
} }
\ No newline at end of file
@import "../../core/variables.less"; @import '../../core/variables.less';
@top-height: 60px; @top-height: 60px;
@icon-color: #939393; @icon-color: #939393;
.top-container { .top-container {
...@@ -7,16 +7,23 @@ ...@@ -7,16 +7,23 @@
left: 0; left: 0;
right: 0; right: 0;
height: @top-height; height: @top-height;
background-color: #2966FF; background-color: #2966ff;
// z-index:2; // z-index:2;
&::after{ &::after {
content:''; content: '';
width:100%; width: 100%;
height:60px; height: 60px;
background: linear-gradient(180deg, #2966FF 0%, rgba(41, 102, 255, 0.82) 29%, rgba(41, 102, 255, 0.58) 55%, rgba(41, 102, 255, 0.27) 77%, rgba(7, 78, 255, 0) 100%); background: linear-gradient(
position:absolute; 180deg,
z-index:2; #2966ff 0%,
top:59px; rgba(41, 102, 255, 0.82) 29%,
rgba(41, 102, 255, 0.58) 55%,
rgba(41, 102, 255, 0.27) 77%,
rgba(7, 78, 255, 0) 100%
);
position: absolute;
z-index: 2;
top: 59px;
} }
.logo { .logo {
display: inline-block; display: inline-block;
...@@ -26,7 +33,7 @@ ...@@ -26,7 +33,7 @@
.logo-name { .logo-name {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #2966FF; color: #2966ff;
line-height: 20px; line-height: 20px;
vertical-align: middle; vertical-align: middle;
font-weight: bold; font-weight: bold;
...@@ -204,7 +211,7 @@ ...@@ -204,7 +211,7 @@
cursor: pointer; cursor: pointer;
} }
.college-name { .college-name {
color:#FFFFFF; color: #ffffff;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
...@@ -213,9 +220,9 @@ ...@@ -213,9 +220,9 @@
.icon { .icon {
font-size: 14px; font-size: 14px;
margin-left: 8px; margin-left: 8px;
color: #FFF; color: #fff;
&:hover { &:hover {
color:#FFF; color: #fff;
} }
} }
} }
...@@ -283,7 +290,7 @@ ...@@ -283,7 +290,7 @@
align-items: center; align-items: center;
.store-name { .store-name {
font-size: 14px; font-size: 14px;
color: #FFF; color: #fff;
line-height: 49px; line-height: 49px;
margin-left: 8px; margin-left: 8px;
white-space: nowrap; white-space: nowrap;
...@@ -296,17 +303,17 @@ ...@@ -296,17 +303,17 @@
width: 1px; width: 1px;
height: 16px; height: 16px;
background-color: #f4f4f4; background-color: #f4f4f4;
margin-right:16px; margin-right: 16px;
} }
} }
.right-box { .right-box {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.right-bg-img{ .right-bg-img {
img{ img {
width:277px; width: 277px;
height:60px; height: 60px;
} }
} }
.link-to-store { .link-to-store {
...@@ -315,21 +322,21 @@ ...@@ -315,21 +322,21 @@
line-height: 49px; line-height: 49px;
.text { .text {
font-size: 14px; font-size: 14px;
color: #FFF; color: #fff;
line-height: 49px; line-height: 49px;
margin-left: 7px; margin-left: 7px;
} }
.iconfont { .iconfont {
color: #FFF; color: #fff;
} }
.link { .link {
cursor: pointer; cursor: pointer;
position: relative; position: relative;
.link-btn{ .link-btn {
padding:3px 12px; padding: 3px 12px;
border: 1px solid rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 4px; border-radius: 4px;
&:hover{ &:hover {
border: 1px solid rgba(255, 255, 255, 1); border: 1px solid rgba(255, 255, 255, 1);
} }
} }
...@@ -362,7 +369,7 @@ ...@@ -362,7 +369,7 @@
line-height: 20px; line-height: 20px;
} }
.url-link { .url-link {
color: #2966FF; color: #2966ff;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
} }
...@@ -386,19 +393,20 @@ ...@@ -386,19 +393,20 @@
line-height: 41px; line-height: 41px;
width: 130px; width: 130px;
} }
} }
} }
} }
} }
.share { .share,
.help {
cursor: pointer; cursor: pointer;
margin-left: 16px; margin-left: 16px;
.share-btn{ .share-btn,
padding:3px 12px; .help-btn {
padding: 3px 12px;
border: 1px solid rgba(255, 255, 255, 0.5); border: 1px solid rgba(255, 255, 255, 0.5);
border-radius: 4px; border-radius: 4px;
&:hover{ &:hover {
border: 1px solid rgba(255, 255, 255, 1); border: 1px solid rgba(255, 255, 255, 1);
} }
} }
...@@ -529,7 +537,7 @@ ...@@ -529,7 +537,7 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
color:#FFF; color: #fff;
} }
} }
} }
...@@ -588,7 +596,7 @@ ...@@ -588,7 +596,7 @@
.user-detail { .user-detail {
position: relative; position: relative;
padding-bottom: 16px; padding-bottom: 16px;
border-bottom: 1px solid #E8E8E8; border-bottom: 1px solid #e8e8e8;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -625,7 +633,7 @@ ...@@ -625,7 +633,7 @@
cursor: pointer; cursor: pointer;
color: #333; color: #333;
.menu-before { .menu-before {
color: #BFBFBF; color: #bfbfbf;
margin-right: 8px; margin-right: 8px;
font-size: 14px; font-size: 14px;
} }
......
...@@ -6,6 +6,7 @@ import CheckBeforeSendCode from '../../components/CheckBeforeSendCode' ...@@ -6,6 +6,7 @@ import CheckBeforeSendCode from '../../components/CheckBeforeSendCode'
import User from '@/common/js/user' import User from '@/common/js/user'
import WechatLogin from './WechatLogin' import WechatLogin from './WechatLogin'
import BaseService from '@/domains/basic-domain/baseService' import BaseService from '@/domains/basic-domain/baseService'
import storage from '@/common/js/storage'
import axios from 'axios' import axios from 'axios'
import _ from 'underscore' import _ from 'underscore'
import user from '@/common/js/user' import user from '@/common/js/user'
...@@ -43,6 +44,7 @@ function Login(props) { ...@@ -43,6 +44,7 @@ function Login(props) {
User.removeToken() User.removeToken()
User.removeEnterpriseId() User.removeEnterpriseId()
} }
storage.set("expiration_tip_login",true)
}, []) }, [])
function getWXWorkLoginNoCheck(enterpriseId, userId) { function getWXWorkLoginNoCheck(enterpriseId, userId) {
const params = { const params = {
......
@import '../../core/variables.less'; @import '../../core/variables.less';
@top-height: 60px; @top-height: 0px;
@menu-bakg: #FFF; @menu-bakg: #FFF;
@active-color: #2966FF; @active-color: #2966FF;
.left-container { .left-container {
position: absolute; position: absolute;
z-index: 2; z-index: 10;
top: @top-height; top: @top-height;
left: 0; left: 0;
bottom: 0; bottom: 0;
width: @xm-left-width; width: @xm-left-width;
background: @menu-bakg; background: @menu-bakg;
color: #333; color: #333;
.top-ctrl {
display: flex;
align-items: center;
.topLogo {
height: 60px;
background: rgba(255, 255, 255, 0.5);
.img1 {
width: 138px;
height: 35px;
margin: 15px 0 15px 8px;
}
}
.menu-type-icon{ .menu-type-icon{
margin:4px 0 0px 150px; margin: 8px 14px 0px 4px;
cursor: pointer; cursor: pointer;
.icon{ .icon{
font-size:14px; font-size:14px;
color:#5E606A; color:#5E606A;
} }
} }
}
.ant-menu { .ant-menu {
padding-left: 0 !important; padding-left: 0 !important;
color: #333; color: #333;
...@@ -128,7 +142,153 @@ ...@@ -128,7 +142,153 @@
// display:inline-block; // display:inline-block;
// } // }
// } // }
.version-info {
position: absolute;
height: 74px;
bottom: 0;
width: 100%;
cursor: pointer;
.row-1 {
width: fit-content;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 20px;
margin: 0 auto;
.version-name {
display: inline-block;
width: 58px;
text-align: center;
margin: 0 auto;
border-radius: 2px;
border: 1px solid #E8E8E8;
}
.renew {
display: inline-block;
width: 58px;
color: #2966FF;
margin-left: 8px;
.renew-popover {
display: none;
position: absolute;
width: 276px;
height: 294px;
left: 150px;
bottom: 52px;
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
background-color: white;
background-image: url(https://image.xiaomaiketang.com/xm/CZ4a752jzi.png);
background-repeat: no-repeat;
background-size: cover;
text-align: center;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 22px;
.qrcode {
width: 182px;
height: 204px;
background-color: white;
margin: 28px auto 16px auto;
img {
width: 150px;
height: 150px;
margin: 16px 16px 8px 16px;
}
.des {
}
}
}
.renew-popover-show {
display: block;
}
}
}
.expiration-time {
height: 24px;
text-align: center;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
line-height: 22px;
margin: 6px auto 0 auto;
}
.popover {
display: none;
position: absolute;
z-index: 100;
padding: 16px 22px;
bottom: 22px;
width: 352px;
height: 198px;
right: -342px;
background: #FFFFFF;
box-shadow: 0px 2px 15px 0px rgba(0, 0, 0, 0.06);
.title {
display: inline-block;
width: 68px;
height: 22px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #333333;
line-height: 22px;
margin-right: 8px;
}
.expiration-tag {
display: inline-block;
width: 52px;
height: 18px;
background: #EEEEEE;
border-radius: 2px;
text-align: center;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 17px;
}
&::before {
position: absolute;
content: "";
width: 16px;
height: 16px;
left: -8px;
top: 80%;
border: 8px solid transparent;
box-shadow: 0px 2px 15px 0px rgba(0, 0, 0, 0.06);
}
.content {
margin-top: 24px;
.widget {
display: inline-block;
}
.lable {
font-size: 14px;
font-weight: 400;
color: #999999;
line-height: 22px;
}
.lable-text {
margin-top: 4px;
font-size: 16px;
font-weight: 500;
color: #333333;
line-height: 22px;
}
}
}
.popover-show {
display: block;
}
}
} }
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected { .ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background:@active-color !important; background:@active-color !important;
} }
......
import React, { useContext, useEffect, useState } from 'react'; import React, { useContext, useEffect, useRef, useState } from 'react';
import { import {
withRouter, withRouter,
} from 'react-router-dom'; } from 'react-router-dom';
import { Menu} from 'antd'; import { Menu, Popover, Tooltip } from 'antd';
import { RightOutlined } from '@ant-design/icons'
import { menuList } from '../../routes//config/menuList' import { menuList } from '../../routes//config/menuList'
import { XMContext } from '../../store/context'; import { XMContext } from '../../store/context';
import BaseService from "@/domains/basic-domain/baseService";
import StoreService from '@/domains/store-domain/storeService';
import classNames from 'classnames';
import User from "@/common/js/user"
import _ from 'underscore'; import _ from 'underscore';
import "./Menu.less"; import "./Menu.less";
import { display } from 'html2canvas/dist/types/css/property-descriptors/display';
import moment from 'moment';
const { SubMenu } = Menu; const { SubMenu } = Menu;
interface VersionInfo {
dayTime: number
stateEnum: string
surplusDayTime: number
surplusUserNum: number
userNum: number
validEndTime: string
validStartTime: string
}
function VersionPanel(props:any) {
const [versionName,setVersionName] = useState("标准版")
const [showVersionPopover, setShowVersionPopover] = useState(false)
const [showRenewPopover, setShowRenewPopover] = useState(false)
const [isExpiration, setIsExpiration] = useState(false)
const [versionInfo, setVersionInfo] = useState<any>({})
useEffect(()=> {
BaseService.getLesseeVersionMsg()
.then(res=> {
let version = res.result
User.setVersion(version)
let versioninfo = {
userNum: version.userNum,
surplusUserNum: version.surplusUserNum,
surplusDayTime: version.surplusDayTime,
validEndTime: moment(version.validEndTime).format("YYYY-MM-DD"),
validStartTime: moment(version.validStartTime).format("YYYY-MM-DD"),
}
setVersionInfo(versioninfo)
if (version.surplusDayTime === 0) {
setIsExpiration(true)
}
})
},[])
function onVersionEnter() {
setShowVersionPopover(true)
}
function onVersionLeave() {
setShowVersionPopover(false)
setShowRenewPopover(false)
}
function onRenewClick() {
setShowRenewPopover(true)
setShowVersionPopover(false)
}
const versionPopoverClass = classNames({
'popover':true,
'popover-show':showVersionPopover
})
const renewPopoverClass = classNames({
'renew-popover': true,
'renew-popover-show': showRenewPopover
})
return (
<div className="version-info" onMouseEnter={onVersionEnter} onMouseLeave={onVersionLeave}>
<div className="row-1">
<div className="version-name">{versionName}</div>
<div className="renew" onClick={onRenewClick}>去续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span>
<div className={renewPopoverClass}>
<div className="qrcode">
<img src="https://cdn.xiaomai5.com/qixueyuankehu.png" alt=""></img>
<div className="des">微信/企业微信扫码续费</div>
</div>
<div className="phone"><svg style={{position:"relative",top:"2px",marginRight:"4px"}} viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M512.651 3.78c-281.433 0-509.21 228.324-509.21 509.209 0 281.43 228.325 509.203 509.21 509.203 281.427 0 509.202-228.317 509.202-509.203 0.55-280.885-227.775-509.21-509.202-509.21z m198.205 743.553c-36.14 36.136-169.737 1.641-302.24-130.312-131.953-131.959-165.902-266.104-129.768-301.695 31.211-31.21 68.99-85.417 125.939-14.782 56.943 70.629 29.016 90.34-3.291 122.647-22.449 22.448 24.642 79.392 73.37 128.125 49.283 48.73 105.678 95.818 128.126 73.368 32.306-32.305 52.017-60.23 122.646-3.288 71.182 56.949 16.426 95.276-14.782 125.937z" p-id="4409" fill="#999999"></path></svg>
咨询电话:19157875632</div>
</div>
</div>
</div>
<div className="expiration-time">有效期至{versionInfo.validEndTime}{isExpiration ? "(已过期)" : ""}</div>
<div className={versionPopoverClass}>
<div className="title">版本信息</div>
{isExpiration ? <div className="expiration-tag">已过期</div> : ""}
<div className="content">
<div className="widget" style={{marginRight:"40px",marginBottom:"16px"}}>
<div className="lable">剩余天数</div>
<div className="lable-text">{versionInfo.surplusDayTime}</div>
</div>
<div className="widget" style={{marginBottom:"16px"}}>
<div className="lable">有效起止日期</div>
<div className="lable-text">{versionInfo.validStartTime}~{versionInfo.validEndTime}</div>
</div>
<div className="widget" style={{marginRight:"40px",marginBottom:"8px"}}>
<div className="lable">剩余人数</div>
<div className="lable-text">{versionInfo.surplusUserNum}</div>
</div>
<div className="widget" style={{marginBottom:"8px"}}>
<div className="lable" style={{display:"inline-block"}}>人数限制</div>
<Tooltip overlayStyle={{maxWidth:"587px",width:"587px"}} placement="topLeft" arrowPointAtCenter title={()=>{ return (<div><div>1、若员工/学员存在多个学院,企业人数只统计为1人;</div><div>2、若一个学员既用「企业微信」登录学习又用「微信」登录学习,企业人数将统计为2人。</div></div>)}}>
<div style={{display:"inline-block",position:"relative",top:"2px",marginLeft:"4px"}}><span><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1026" width="14" height="14"><path d="M512 68.266667c245.111467 0 443.733333 198.656 443.733333 443.733333s-198.621867 443.733333-443.733333 443.733333C266.922667 955.733333 68.266667 757.077333 68.266667 512S266.922667 68.266667 512 68.266667z m29.320533 596.548266c0.477867-27.989333 2.4576-48.196267 5.802667-60.654933 3.413333-12.458667 8.567467-23.4496 15.633067-33.0752 6.997333-9.557333 21.9136-24.507733 44.714666-44.714667 33.928533-30.037333 56.797867-55.637333 68.437334-76.5952a139.1616 139.1616 0 0 0 17.5104-68.846933c0-43.008-16.5888-79.701333-49.800534-110.011733-33.1776-30.378667-77.6192-45.533867-133.358933-45.533867-52.6336 0-94.958933 14.1312-126.976 42.3936-31.9488 28.2624-51.268267 68.949333-57.685333 122.094933l71.8848 8.533334c6.212267-39.6288 19.3536-68.778667 39.3216-87.483734 19.933867-18.6368 44.817067-27.989333 74.6496-27.989333 30.788267 0 56.900267 10.308267 78.165333 30.9248 21.265067 20.5824 31.880533 44.544 31.880533 71.748267 0 15.018667-3.618133 28.910933-10.922666 41.608533-7.168 12.731733-22.971733 29.764267-47.240534 51.131733-24.200533 21.367467-41.028267 37.649067-50.346666 48.810667-12.6976 15.291733-21.9136 30.481067-27.613867 45.533867-7.748267 19.933867-11.639467 43.690667-11.639467 71.133866 0 4.676267 0.1024 11.707733 0.341334 21.026134h67.242666z m8.192 140.3904v-79.735466h-79.701333v79.735466h79.701333z" fill="#bfbfbf" p-id="1027"></path></svg></span></div>
</Tooltip>
<div className="lable-text">{versionInfo.userNum}</div>
</div>
</div>
</div>
</div>
)
}
function Aside(props: any) { function Aside(props: any) {
const {menuType,handleMenuType}= props const {menuType,handleMenuType}= props
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [selectKey, setSelectKey] = useState(); const [selectKey, setSelectKey] = useState();
const [openKeys, setOpenKeys] = useState(['']); const [openKeys, setOpenKeys] = useState(['']);
const [topLogoUrl, setTopLogoUrl] = useState("")
const rootSubmenuKeys = _.pluck(menuList, 'groupCode'); const rootSubmenuKeys = _.pluck(menuList, 'groupCode');
useEffect(() => { useEffect(() => {
const link = props.location.pathname; const link = props.location.pathname;
...@@ -31,8 +147,27 @@ function Aside(props: any) { ...@@ -31,8 +147,27 @@ function Aside(props: any) {
return item; return item;
}) })
}, [props.location.pathname]) }, [props.location.pathname])
useEffect(()=> {
getTopLeftLogo()
})
function getTopLeftLogo() {
if (User.getToken()) {
StoreService.getStoreDetail({storeId:User.getStoreId()})
.then(res=> {
if (_.isEmpty(res.result.logo)) {
setTopLogoUrl("https://image.xiaomaiketang.com/xm/fe4NCjr7XF.png")
} else {
setTopLogoUrl(res.result.logo)
}
})
}
}
function toggleMenu(item: any) { function toggleMenu(item: any) {
window.RCHistory.push(item.link) window.RCHistory.push(item.link)
if (!menuType) {
setOpenKeys([])
}
} }
function onOpenChange(key: any) { function onOpenChange(key: any) {
if (openKeys.includes(key)) { if (openKeys.includes(key)) {
...@@ -41,6 +176,16 @@ function Aside(props: any) { ...@@ -41,6 +176,16 @@ function Aside(props: any) {
setOpenKeys([key]); setOpenKeys([key]);
} }
} }
function onOpenChangeForHover(key: any) {
if (menuType) {
return
}
if (openKeys.includes(key)) {
setOpenKeys([]);
} else {
setOpenKeys([key]);
}
}
function handleMenu() { function handleMenu() {
handleMenuType(); handleMenuType();
} }
...@@ -54,6 +199,10 @@ function Aside(props: any) { ...@@ -54,6 +199,10 @@ function Aside(props: any) {
: "left-container left-container-vertical" : "left-container left-container-vertical"
} }
> >
<div className="top-ctrl">
<div className="topLogo">
{ menuType && <img src={topLogoUrl} alt="" className="img1"></img> }
</div>
<div className="menu-type-icon" onClick={handleMenu}> <div className="menu-type-icon" onClick={handleMenu}>
{menuType ? ( {menuType ? (
<span <span
...@@ -69,6 +218,8 @@ function Aside(props: any) { ...@@ -69,6 +218,8 @@ function Aside(props: any) {
</span> </span>
)} )}
</div> </div>
</div>
<div className="left"> <div className="left">
<div className="nav"> <div className="nav">
...@@ -85,7 +236,7 @@ function Aside(props: any) { ...@@ -85,7 +236,7 @@ function Aside(props: any) {
return null; return null;
} }
if (item.children) { if (item.children) {
return <SubMenu key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div > return <SubMenu onTitleMouseEnter={() => onOpenChangeForHover(item.groupCode)} key={item.groupCode} style={{ marginTop: 0 }} className="first-menu-item" title={<div >
{/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */} {/* <span style={{ marginRight: 16 }} className="iconfont icon" dangerouslySetInnerHTML={{ __html:item.icon}}></span> */}
<img src={item.img} className="icon-img"></img> <img src={item.img} className="icon-img"></img>
{menuType && {menuType &&
...@@ -123,7 +274,10 @@ function Aside(props: any) { ...@@ -123,7 +274,10 @@ function Aside(props: any) {
} }
</Menu> </Menu>
</div> </div>
</div> </div>
<VersionPanel />
</div> </div>
); );
} }
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-02-01 14:12:38 * @LastEditTime: 2021-06-21 11:17:44
* @Description: 学院装修页面 * @Description: 学院装修页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useEffect, useState } from "react"; import React, { useState } from "react";
import { withRouter, Switch, Route } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
import { Tabs } from "antd"; import { Tabs } from "antd";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab"; ...@@ -16,9 +16,6 @@ import StoreH5DecorationTab from "./StoreH5DecorationTab";
import StoreWebDecorationTab from "./StoreWebDecorationTab"; import StoreWebDecorationTab from "./StoreWebDecorationTab";
const { TabPane } = Tabs; const { TabPane } = Tabs;
declare var window: any;
interface StoreDecoprationProps { interface StoreDecoprationProps {
match: { match: {
url: string; url: string;
...@@ -27,7 +24,6 @@ interface StoreDecoprationProps { ...@@ -27,7 +24,6 @@ interface StoreDecoprationProps {
function StoreDecorationPage(props: StoreDecoprationProps) { function StoreDecorationPage(props: StoreDecoprationProps) {
const [currentTab, setCurrentTab] = useState("h5"); const [currentTab, setCurrentTab] = useState("h5");
const { match } = props;
return ( return (
<div className="page store-decoration-page"> <div className="page store-decoration-page">
...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) { ...@@ -36,7 +32,6 @@ function StoreDecorationPage(props: StoreDecoprationProps) {
<Tabs <Tabs
onChange={(key) => { onChange={(key) => {
setCurrentTab(key); setCurrentTab(key);
// window.RCHistory.push(`${match.url}/store-decoration/${key}`);
}} }}
activeKey={currentTab} activeKey={currentTab}
> >
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:20:26 * @LastEditTime: 2021-06-21 11:16:21
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component { ...@@ -391,7 +392,11 @@ class StoreH5Decoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: wufan * @Author: wufan
* @Date: 2020-11-30 10:47:38 * @Date: 2020-11-30 10:47:38
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-05-28 16:21:04 * @LastEditTime: 2021-06-21 11:16:31
* @Description: web学院banner页面 * @Description: web学院banner页面
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
...@@ -10,8 +10,7 @@ ...@@ -10,8 +10,7 @@
import React from "react"; import React from "react";
import { withRouter } from "react-router-dom"; import { withRouter } from "react-router-dom";
import _ from "underscore"; import _ from "underscore";
// import PhotoClip from 'photoclip' import { Modal, message, Button } from "antd";
import { Table, Modal, message, Button } from "antd";
import StoreService from "@/domains/store-domain/storeService"; import StoreService from "@/domains/store-domain/storeService";
import { import {
sortableContainer, sortableContainer,
...@@ -24,6 +23,8 @@ import User from "@/common/js/user"; ...@@ -24,6 +23,8 @@ import User from "@/common/js/user";
import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal"; import SelectPrepareFileModal from "@/modules/prepare-lesson/modal/SelectPrepareFileModal";
import "./StoreDecorationPage.less"; import "./StoreDecorationPage.less";
import Upload from "@/core/upload"; import Upload from "@/core/upload";
import { XMTable } from '@/components';
import college from '@/common/lottie/college';
const { confirm } = Modal; const { confirm } = Modal;
const DragHandle = sortableHandle(() => ( const DragHandle = sortableHandle(() => (
...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component { ...@@ -389,7 +390,11 @@ class StoreWebDecoration extends React.Component {
</Button> </Button>
</div> </div>
<div className="box-body"> <div className="box-body">
<Table <XMTable
renderEmpty={{
image: college,
description: '暂无数据'
}}
size={"middle"} size={"middle"}
pagination={false} pagination={false}
dataSource={storeDecorationlist} dataSource={storeDecorationlist}
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
* @Author: yuananting * @Author: yuananting
* @Date: 2021-04-08 15:50:52 * @Date: 2021-04-08 15:50:52
* @LastEditors: wufan * @LastEditors: wufan
* @LastEditTime: 2021-04-24 15:55:19 * @LastEditTime: 2021-06-21 11:24:48
* @Description: 助学工具-考试-答案详情 * @Description: 助学工具-考试-答案详情
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect} from 'react';
import { Route, withRouter } from 'react-router-dom'; import { withRouter } from 'react-router-dom';
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 Lottie from 'lottie-web'; import Lottie from 'lottie-web';
...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', ...@@ -20,7 +20,6 @@ const NUM_TO_WORD_MAP = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
function AnswerDescPage(props) { function AnswerDescPage(props) {
const examId = props.match.params.testId.replace(/\?.+/, ''); const examId = props.match.params.testId.replace(/\?.+/, '');
const paperId = window.getParameterByName('paperId'); const paperId = window.getParameterByName('paperId');
const [customerId, setCustomerId] = useState('');
const [examDetail, setExamDetail] = useState({ const [examDetail, setExamDetail] = useState({
examDesc: '', examDesc: '',
examDuration: 0, examDuration: 0,
...@@ -155,68 +154,10 @@ function AnswerDescPage(props) { ...@@ -155,68 +154,10 @@ function AnswerDescPage(props) {
setIsShowErrorPage(true); setIsShowErrorPage(true);
} }
function handleChangeActiveIndex(isPre) {
if (onlyError) {
if (isPre && activeOrderIndex !== errorQuestionList[0].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex - 1].orderIndex);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== errorQuestionList[errorCount - 1].orderIndex) {
setActiveOrderIndex(errorQuestionList[activeIndex + 1].orderIndex);
setActiveIndex(activeIndex + 1);
}
} else {
if (isPre && activeOrderIndex !== 0) {
setActiveOrderIndex(activeIndex - 1);
setActiveIndex(activeIndex - 1);
} else if (!isPre && activeOrderIndex !== questionList.length - 1) {
setActiveOrderIndex(activeIndex + 1);
setActiveIndex(activeIndex + 1);
}
}
}
function renderFooterText() {
if (onlyError && errorCount > 0) {
// 只看错题
return (
<div className='footer-btn'>
<div className='pre-next'>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[0].orderIndex : 0) ? 'disabled' : ''} pre`}
onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div
className={`${activeOrderIndex === (errorQuestionList.length > 0 ? errorQuestionList[errorCount - 1].orderIndex : 0) ? 'disabled' : ''} next`}
onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
} else if (!onlyError) {
return (
<div className='footer-btn'>
<div className='pre-next'>
<div className={`${activeOrderIndex === 0 ? 'disabled' : ''} pre`} onClick={() => handleChangeActiveIndex(true)}>
<span className='icon iconfont'>&#xe79c;</span>
<div className='text'>上一题</div>
</div>
<div className={`${activeOrderIndex === questionList.length - 1 ? 'disabled' : ''} next`} onClick={() => handleChangeActiveIndex(false)}>
<div className='text'>下一题</div>
<span className='icon iconfont'>&#xe79b;</span>
</div>
</div>
</div>
);
}
}
function handleRenderQuestionItem() { function handleRenderQuestionItem() {
return _.map(questionList, (questionItem, questionIndex) => { return _.map(questionList, (questionItem, questionIndex) => {
const { questionStemList, optionList, gapFillingAnswerList, questionAnswerDescList, questionType, score, questionId, orderIndex } = questionItem; const { questionStemList, optionList, gapFillingAnswerList, questionType, score, questionId, orderIndex } = questionItem;
return ( return (
<div className={`question-info-item`}> <div className={`question-info-item`}>
{renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)} {renderStem(questionItem, questionStemList, questionType, score, orderIndex, questionId, gapFillingAnswerList)}
...@@ -225,7 +166,6 @@ function AnswerDescPage(props) { ...@@ -225,7 +166,6 @@ function AnswerDescPage(props) {
return renderOption(optionItem, optionIndex, questionId); return renderOption(optionItem, optionIndex, questionId);
})} })}
{renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)} {renderAnswerCompare(questionId, questionType, optionList, gapFillingAnswerList)}
{/* {renderAnswerDesc(questionAnswerDescList)} */}
</div> </div>
); );
}); });
...@@ -503,133 +443,6 @@ function AnswerDescPage(props) { ...@@ -503,133 +443,6 @@ function AnswerDescPage(props) {
} }
} }
// 渲染答案解析
function renderAnswerDesc(questionAnswerDescList) {
const textContent = _.filter(questionAnswerDescList, (item) => {
return item.type === 'RICH_TEXT';
});
const mediaContent = _.filter(questionAnswerDescList, (item) => {
return item.type !== 'RICH_TEXT';
});
let content = textContent.length > 0 ? `${textContent[0].content}:` : '';
let textDom = (
<div
key={0}
className='text-dom'
dangerouslySetInnerHTML={{
__html: content,
}}
/>
);
return (
<div className='desc-line__item'>
{textDom}
{renderAnswerDescMedia(mediaContent)}
</div>
);
}
// 渲染答案解析的多媒体
function renderAnswerDescMedia(mediaContent) {
const pictureMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'PICTURE';
});
const voiceMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VOICE';
});
const audioMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'AUDIO';
});
const videoMediaList = _.filter(mediaContent, (mediaItem) => {
return mediaItem.type === 'VIDEO';
});
return (
<div className='desc-media-container'>
{pictureMediaList.length > 0 && (
<div className='desc-picture-box'>
{_.map(pictureMediaList, (pictureItem, pictureIndex) => {
let { content } = pictureItem;
return (
<div className='picture-box' key={pictureIndex}>
<img className='img-box' src={content} onClick={() => handleScanFile('JPG', content)} />
</div>
);
})}
</div>
)}
{audioMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(audioMediaList, (audioItem, audioIndex) => {
let { content, size } = audioItem;
return (
<div className='audio-box' key={audioIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={audioIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{voiceMediaList.length > 0 && (
<div className='desc-audio-box'>
{_.map(voiceMediaList, (voiceItem, voiceIndex) => {
let { content, size } = voiceItem;
return (
<div className='audio-box' key={voiceIndex}>
<XMAudio
forbidParse
url={content}
getDuration={(durationSize) => {
size = durationSize;
}}
index={voiceIndex}
size={size || 1000}
/>
</div>
);
})}
</div>
)}
{videoMediaList.length > 0 && (
<div className='desc-video-box'>
{_.map(videoMediaList, (videoItem, videoIndex) => {
let { content } = videoItem;
return (
<div className='video-box' key={videoIndex}>
<img className='video-box_content' src={`${content}?x-oss-process=video/snapshot,t_0,m_fast`} />
<img className='video-box_btn' src='https://image.xiaomaiketang.com/xm/r5H8cYm4ch.png' onClick={() => handleScanFile('MP4', content)} />
</div>
);
})}
</div>
)}
</div>
);
}
// 答题卡展开和收起
function handleToggleQuestionCardShow() {
setIsShowQuestionCard(!isShowQuestionCard);
}
// 快速跳转题目
function handleQuickActiveQuestion(orderIndex, answerIndex) {
setActiveOrderIndex(orderIndex);
setActiveIndex(answerIndex);
setIsShowQuestionCard(false);
}
// 只选错题 // 只选错题
function chooseErrorAnswer() { function chooseErrorAnswer() {
...@@ -640,8 +453,6 @@ function AnswerDescPage(props) { ...@@ -640,8 +453,6 @@ function AnswerDescPage(props) {
setQuestionList(!onlyError ? errorQuestionList : allQuestionList); setQuestionList(!onlyError ? errorQuestionList : allQuestionList);
} }
const { totalQuestionCount, userCorrectQuestion } = examDetail;
let sortedAnswerList = []; let sortedAnswerList = [];
let userAnswerMap = {}; let userAnswerMap = {};
userAnswerList.forEach((item) => { userAnswerList.forEach((item) => {
...@@ -689,7 +500,6 @@ function AnswerDescPage(props) { ...@@ -689,7 +500,6 @@ function AnswerDescPage(props) {
<div className='question-list-box'>{handleRenderQuestionItem()}</div> <div className='question-list-box'>{handleRenderQuestionItem()}</div>
</div> </div>
</If> </If>
{/* {renderFooterText()} */}
</div> </div>
{showScanFile && ( {showScanFile && (
<ScanFileModal <ScanFileModal
......
/* /*
* @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" && (
<div className="sider-btn">
<Button <Button
onClick={() => { onClick={() => {
window.RCHistory.push({ window.RCHistory.push({
pathname: "/course-category-manage?from=aid", pathname: '/course-category-manage?from=aid',
}); });
}} }}>
>
分类管理 分类管理
</Button> </Button>
</div> </div>
)} )}
<div className="sider-tree"> <div className='sider-tree'>
<DirectoryTree <DirectoryTree
expandedKeys={expandedKeys} expandedKeys={expandedKeys}
autoExpandParent={autoExpandParent} autoExpandParent={autoExpandParent}
......
import React from 'react'; import React from 'react';
import { Modal, Button, message } from 'antd'; import { Modal, message,Button} from 'antd';
import html2canvas from 'html2canvas'; import html2canvas from 'html2canvas';
import User from "../../../common/js/user"; import User from "../../../common/js/user";
import QRCode from '../../../libs/qrcode/qrcode'; import QRCode from '../../../libs/qrcode/qrcode';
...@@ -27,7 +27,6 @@ class ExamShareModal extends React.Component { ...@@ -27,7 +27,6 @@ class ExamShareModal extends React.Component {
handleConvertShortUrl = () => { handleConvertShortUrl = () => {
const longUrl = `${LIVE_SHARE}test_detail/${this.props.data.examId}?id=${User.getStoreId()}` const longUrl = `${LIVE_SHARE}test_detail/${this.props.data.examId}?id=${User.getStoreId()}`
console.log(longUrl)
// 发请求 // 发请求
Service.Sales('public/businessShow/convertShortUrls', { Service.Sales('public/businessShow/convertShortUrls', {
urls: [longUrl] urls: [longUrl]
......
import React, { useState, useRef, useEffect, useContext } from 'react'; import React, { useState, useRef, useEffect, useContext } from 'react';
import { Input, Select, DatePicker, Tooltip, Button, Table, Dropdown, Menu, Modal } from 'antd'; import { Input, Select, DatePicker, Tooltip, Button, Dropdown, Menu, Modal } from 'antd';
import TeacherSelect from '@/modules/common/TeacherSelect'; import TeacherSelect from '@/modules/common/TeacherSelect';
import { Route, withRouter } from 'react-router-dom'; import { Route, withRouter } from 'react-router-dom';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import moment from 'moment'; import moment from 'moment';
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components';
import AddExam from './AddExam'; import AddExam from './AddExam';
import User from "@/common/js/user"; import User from '@/common/js/user';
import { XMContext } from "@/store/context"; import { XMContext } from '@/store/context';
import ExamShareModal from './ExamShareModal' import ExamShareModal from './ExamShareModal';
import DataAnalysic from './DataAnalysic' import DataAnalysic from './DataAnalysic';
import PreviewModal from './PreviewModal' import PreviewModal from './PreviewModal';
import './index.less' import './index.less';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { Search } = Input; const { Search } = Input;
const { Option } = Select;
interface sortType { interface sortType {
type: 'ascend' | 'descend' | null | undefined; type: 'ascend' | 'descend' | null | undefined;
} }
...@@ -42,9 +40,7 @@ function ExaminationManager(props: any) { ...@@ -42,9 +40,7 @@ function ExaminationManager(props: any) {
type: undefined, type: undefined,
}; };
const sortEnum = {};
const { match } = props; const { match } = props;
const sortState: any = false;
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [query, setQuery] = useState(queryInit); const [query, setQuery] = useState(queryInit);
const [expandFilter, setExpandFilter] = useState(false); const [expandFilter, setExpandFilter] = useState(false);
...@@ -53,7 +49,6 @@ function ExaminationManager(props: any) { ...@@ -53,7 +49,6 @@ function ExaminationManager(props: any) {
const [field, setfield] = useState(''); const [field, setfield] = useState('');
const [order, setOrder] = useState(sortStatus.type); const [order, setOrder] = useState(sortStatus.type);
const [modal, setModal] = useState(null); const [modal, setModal] = useState(null);
const [questionCntSort, setQuestionCntSort] = useState(sortState);
const [openPreviewModal, setOpenPreviewModal] = useState(false); const [openPreviewModal, setOpenPreviewModal] = useState(false);
const [info, setInfo] = useState({ examDuration: 0 }); const [info, setInfo] = useState({ examDuration: 0 });
const queryRef = useRef({}); const queryRef = useRef({});
...@@ -76,7 +71,6 @@ function ExaminationManager(props: any) { ...@@ -76,7 +71,6 @@ function ExaminationManager(props: any) {
const columns = [ const columns = [
{ {
title: '考试', title: '考试',
// fixed:fixStr.left,
width: 320, width: 320,
dataIndex: 'examName', dataIndex: 'examName',
render: (text: any, record: any) => { render: (text: any, record: any) => {
...@@ -279,9 +273,6 @@ function ExaminationManager(props: any) { ...@@ -279,9 +273,6 @@ function ExaminationManager(props: any) {
function getList() { function getList() {
const _query = { ...queryRef.current }; const _query = { ...queryRef.current };
// if(_query.examCreator){
// _query.examCreator =parseInt(_query.examCreator)
// }
Service.Hades('public/hades/queryExamPageList', { Service.Hades('public/hades/queryExamPageList', {
..._query, ..._query,
...@@ -434,7 +425,7 @@ function ExaminationManager(props: any) { ...@@ -434,7 +425,7 @@ function ExaminationManager(props: any) {
pagination={false} pagination={false}
style={{ margin: '0px 0 16px' }} style={{ margin: '0px 0 16px' }}
renderEmpty={{ renderEmpty={{
description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span> description: <span style={{ display: 'block', paddingBottom: 24 }}>暂无数据</span>,
}}></XMTable> }}></XMTable>
{total > 0 && ( {total > 0 && (
<PageControl <PageControl
......
...@@ -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>
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-02-25 11:23:47 * @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting * @LastEditors: fusanqiasng
* @LastEditTime: 2021-06-03 17:12:01 * @LastEditTime: 2021-06-15 14:41:18
* @Description: 助学工具-题库-题目列表数据 * @Description: 助学工具-题库-题目列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import React, { Component } from "react"; import React, { Component } from 'react';
import { import { Table, ConfigProvider, Empty, Row, Input, Select, Tooltip, Space, Button, Modal, message, Menu, Dropdown, DatePicker } from 'antd';
Table, import _ from 'underscore';
ConfigProvider, import { Route, withRouter } from 'react-router-dom';
Empty,
Row,
Input,
Select,
Tooltip,
Space,
Button,
Modal,
message,
Menu,
Dropdown,
DatePicker,
} from "antd";
import _ from "underscore";
import { Route, withRouter } from "react-router-dom";
import { DownOutlined } from '@ant-design/icons'; import { DownOutlined } from '@ant-design/icons';
import { PageControl, XMTable } from '@/components'; import { PageControl, XMTable } from '@/components';
import User from '@/common/js/user'; import User from '@/common/js/user';
...@@ -36,7 +21,7 @@ import Bus from '@/core/bus'; ...@@ -36,7 +21,7 @@ import Bus from '@/core/bus';
import moment from 'moment'; import moment from 'moment';
import Service from '@/common/js/service'; import Service from '@/common/js/service';
import MoveModal from '../../modal/MoveModal'; import MoveModal from '../../modal/MoveModal';
import "./QuestionList.less"; import './QuestionList.less';
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const { Search } = Input; const { Search } = Input;
...@@ -686,9 +671,10 @@ class QuestionList extends Component { ...@@ -686,9 +671,10 @@ class QuestionList extends Component {
onChange={this.handleChangeTable} onChange={this.handleChangeTable}
rowSelection={rowSelection} rowSelection={rowSelection}
renderEmpty={{ renderEmpty={{
description: <span style={{ display: 'block', paddingBottom: 24 }}><span>还没有题目</span> description: (
{["CloudManager", "StoreManager"].includes(User.getUserRole()) && <span style={{ display: 'block', paddingBottom: 24 }}>
categoryId && ( <span>还没有题目</span>
{['CloudManager', 'StoreManager'].includes(User.getUserRole()) && categoryId && (
<span> <span>
,快去 ,快去
<span <span
...@@ -702,6 +688,7 @@ class QuestionList extends Component { ...@@ -702,6 +688,7 @@ class QuestionList extends Component {
</span> </span>
)} )}
</span> </span>
),
}} }}
/> />
{total > 0 && ( {total > 0 && (
......
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