Commit d719be39 by zhangleyuan

feat:解决合并代码后的冲突

parents c6f1064c 377cc37b
...@@ -12,7 +12,6 @@ npm-shrinkwrap.json ...@@ -12,7 +12,6 @@ npm-shrinkwrap.json
.DS_Store .DS_Store
.AppleDouble .AppleDouble
.LSOverride .LSOverride
yarn.lock
yarn-error.lock yarn-error.lock
# IntelliJ project files # IntelliJ project files
...@@ -57,7 +56,6 @@ npm-debug.log ...@@ -57,7 +56,6 @@ npm-debug.log
*.zip *.zip
build/vendor.js.map build/vendor.js.map
package-lock.json
.vscode/* .vscode/*
demo.js demo.js
debug.log debug.log
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
"@typescript-eslint/eslint-plugin": "^2.10.0", "@typescript-eslint/eslint-plugin": "^2.10.0",
"@typescript-eslint/parser": "^2.10.0", "@typescript-eslint/parser": "^2.10.0",
"ali-oss": "^6.12.0", "ali-oss": "^6.12.0",
"antd": "^4.9.4", "antd": "^4.16.3",
"array-move": "^3.0.1", "array-move": "^3.0.1",
"axios": "^0.20.0", "axios": "^0.20.0",
"babel-eslint": "10.1.0", "babel-eslint": "10.1.0",
...@@ -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",
......
...@@ -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,14 @@ class Axios { ...@@ -84,8 +89,14 @@ class Axios {
}) })
instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => { instance.interceptors.response.use((response: AxiosResponse): AxiosResponse | AxiosPromise => {
const { message: ResMessage, success, resultMsg, resultCode,code} = response.data; const { message: ResMessage, success, resultMsg, code: resultCode } = response.data;
if (success || resultCode === 0) { if (resultCode === "CROP_DEPLOY_PAST_BETTER") {
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);
......
...@@ -12,6 +12,10 @@ import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants'; ...@@ -12,6 +12,10 @@ import { PREFIX, USER_PREFIX } from '@/domains/basic-domain/constants';
declare var window:any; declare var window:any;
class User { class User {
getExpirationTime() {
return Storage.get(`${PREFIX}_expiration_time`)
}
getVersion() { getVersion() {
return Storage.getObj(`${PREFIX}_version`) return Storage.getObj(`${PREFIX}_version`)
} }
...@@ -56,8 +60,16 @@ class User { ...@@ -56,8 +60,16 @@ class User {
return Storage.get(`${PREFIX}_isAdmin`); return Storage.get(`${PREFIX}_isAdmin`);
} }
setStoreId(value: any) { setExpirationTime(value:number) {
return Storage.set(`${PREFIX}_storeId`, value); return Storage.set(`${PREFIX}_expiration_time`,value)
}
setVersion(value:any) {
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
.ant-popover .ant-popover-content .ant-popover-inner {
box-shadow: 0px 2px 20px 0px rgba(0, 0, 0, 0.06);
.ant-popover-inner-content {
padding: 0;
}
}
.contact-widget {
width: 276px;
height: 294px;
overflow: hidden;
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;
}
}
}
\ No newline at end of file
import React, { ReactElement } from "react";
import { Popover } from "antd";
import { TooltipPlacement } from "antd/lib/tooltip";
import { ActionType } from "rc-trigger/lib/interface";
import "./ContactWidget.less"
interface ContactWidgetProps {
placement: TooltipPlacement
children: React.ReactElement
visible?: boolean
trigger: ActionType | ActionType[]
}
function Content() {
return (
<div className="contact-widget">
<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>
)
}
export default function ContactWidget(props:ContactWidgetProps) {
return <Popover
placement={props.placement}
arrowPointAtCenter
content={Content}
visible={props.visible}
trigger={props.trigger}
>
{props.children}
</Popover>
}
\ No newline at end of file
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
min-height: 100%; min-height: 100%;
overflow: hidden;
.page { .page {
position: fixed; position: fixed;
top: 60px; top: 60px;
...@@ -21,6 +22,7 @@ ...@@ -21,6 +22,7 @@
z-index: 102; z-index: 102;
overflow: auto; overflow: auto;
margin: 0 16px; margin: 0 16px;
.box { .box {
&:first-child { &:first-child {
margin-bottom: 8px; margin-bottom: 8px;
......
/* /*
* @Author: yuananting * @Author: yuananting
* @Date: 2021-03-03 15:13:12 * @Date: 2021-03-03 15:13:12
* @LastEditors: fusanqiasng * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-06-16 09:57:18 * @LastEditTime: 2021-06-22 14:31:46
* @Description: 助学工具接口 * @Description: 助学工具接口
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
......
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:21:21 * @Date: 2020-12-01 17:21:21
* @LastEditors: zhangleyuan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-04-09 14:28:09 * @LastEditTime: 2021-06-22 14:56:34
* @Description: Description * @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/ */
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import User from "@/common/js/user";
import axios from 'axios';
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 +49,19 @@ export function getEnterpriseUser(params: object) { ...@@ -47,6 +49,19 @@ 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/customerHades/getLesseeVersionMsg",{enterpriseId:User.getEnterpriseId()})
}
export function getYoZoSign(params: object) {
return Service.Apollo('public/apollo/getYoZoSign', params);
}
export function saveYoZoFileVersionId(params: object) {
return Service.Apollo('public/apollo/saveYoZoFileVersionId', params);
}
export function yoZoUpload(ossUrl:String,appId:String,uploadSign:String){
return axios.post(`https://dmc.yozocloud.cn/api/file/http?fileUrl=${ossUrl}&appId=${appId}&sign=${uploadSign}`)
}
export const getOssClient = ( export const getOssClient = (
data: object, data: object,
instId: string, instId: string,
...@@ -63,3 +78,4 @@ export const getOssClient = ( ...@@ -63,3 +78,4 @@ export const getOssClient = (
}); });
} }
...@@ -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) {
} }
/* /*
* @Author: wufan * @Author: wufan
* @Date: 2020-12-01 17:20:49 * @Date: 2020-12-01 17:20:49
* @LastEditors: zhangleyuan * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-04-09 14:28:59 * @LastEditTime: 2021-06-22 14:57:01
* @Description: Description * @Description: Description
* @@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,getYoZoSign,saveYoZoFileVersionId,yoZoUpload} from '@/data-source/base/request-apis';
export default class StoreService { export default class StoreService {
// 获取员工列表 // 获取员工列表
...@@ -55,5 +55,22 @@ export default class StoreService { ...@@ -55,5 +55,22 @@ export default class StoreService {
static getWXWorkLoginNoCheck(params: any){ static getWXWorkLoginNoCheck(params: any){
return getWXWorkLoginNoCheck(params); return getWXWorkLoginNoCheck(params);
} }
//获取企业配置的版本信息
static getLesseeVersionMsg() {
return getLesseeVersionMsg();
}
static getYoZoSign(params:any){
return new Promise((resolve) => {
getYoZoSign(params).then(res => {
const { result = [] } = res;
resolve(result)
});
})
}
static saveYoZoFileVersionId(params: any){
return saveYoZoFileVersionId(params);
}
static yoZoUpload(ossUrl:String,appId:String,uploadSign:String){
return yoZoUpload(ossUrl,appId,uploadSign);
}
} }
\ No newline at end of file
/* /*
* @Author: 陈剑宇 * @Author: 陈剑宇
* @Date: 2020-05-07 14:43:01 * @Date: 2020-05-07 14:43:01
* @LastEditTime: 2021-06-11 16:44:17 * @LastEditTime: 2021-06-22 16:49:06
* @LastEditors: Please set LastEditors * @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
...@@ -26,6 +26,10 @@ const PATH_MAP: MapInterface = { ...@@ -26,6 +26,10 @@ const PATH_MAP: MapInterface = {
prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html', prod: 'https://res.xiaomai0.com/xiaomai-cloud-class-web/h5.html',
} }
export const YZ_APPId = "yozoqvpO2Hvz8346";
export const YZ_PREVIEW_URL: string = 'http://eic.yozocloud.cn/api/view/file'
export const OFFICE_PREVIEW_URL: string = 'https://view.officeapps.live.com/op/view.aspx'
// axios headers config // axios headers config
export const TIME_OUT: number = 20000 export const TIME_OUT: number = 20000
export const USER_TYPE: string = 'B' export const USER_TYPE: string = 'B'
...@@ -37,3 +41,4 @@ export const USER_PREFIX = 'store-live' ...@@ -37,3 +41,4 @@ export const USER_PREFIX = 'store-live'
// host // host
export const BASIC_HOST: string = BASIC_HOST_MAP[ENV] export const BASIC_HOST: string = BASIC_HOST_MAP[ENV]
export const PATH: string = PATH_MAP[ENV] export const PATH: string = PATH_MAP[ENV]
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-04-27 20:35:34 * @Date: 2020-04-27 20:35:34
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @LastEditTime: 2021-07-04 16:59:14 * @LastEditTime: 2021-07-08 19:22:18
* @Description: * @Description:
*/ */
...@@ -22,6 +22,7 @@ import '@/core/function'; ...@@ -22,6 +22,7 @@ import '@/core/function';
import '@/core/xmTD'; import '@/core/xmTD';
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 BaseService from '@/domains/basic-domain/baseService';
declare var getParameterByName: any; declare var getParameterByName: any;
declare var window: any; declare var window: any;
...@@ -72,7 +73,27 @@ if (getParameterByName('code') && isWeiXin()) { ...@@ -72,7 +73,27 @@ if (getParameterByName('code') && isWeiXin()) {
window.currentStoreUserInfo.enterpriseId = res.result.enterpriseId; window.currentStoreUserInfo.enterpriseId = res.result.enterpriseId;
mount() mount()
}) })
} else { } else if(getParameterByName('from') === 'customer' && getParameterByName('enterpriseId') && getParameterByName('userId')){
User.setCustomerStoreId(getParameterByName('storeId'));
getWXWorkLoginNoCheck(getParameterByName('enterpriseId'),getParameterByName('userId')); //从C端跳转过来的学院自动执行免登录
}else{
mount() mount()
} }
function getWXWorkLoginNoCheck(enterpriseId:string,userId:string) {
const params = {
appTermEnum: 'XIAOMAI_CLOUD_CLASS_PC_WEB_ADMIN',
enterpriseId,
userId,
};
BaseService.getWXWorkLoginNoCheck(params).then((res:any) => {
User.setUserId(res.result.loginInfo.userId)
User.setToken(res.result.loginInfo.xmToken)
User.setEnterpriseId(res.result.enterpriseId)
window.currentStoreUserInfo = {}
window.currentStoreUserInfo.userId = res.result.loginInfo.userId;
window.currentStoreUserInfo.token = res.result.loginInfo.xmToken;
window.currentStoreUserInfo.enterpriseId = res.result.enterpriseId;
User.setIdentifier(res.result.identifier)
mount();
});
}
...@@ -15,6 +15,7 @@ import college from '@/common/lottie/college.json'; ...@@ -15,6 +15,7 @@ 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 LimitTip from "./LimitTip";
import "./EmployeeManage.less"; import "./EmployeeManage.less";
import ChooseMembersModal from "./modal/ChooseMembersModal"; import ChooseMembersModal from "./modal/ChooseMembersModal";
...@@ -68,6 +69,7 @@ function EmployeeManage() { ...@@ -68,6 +69,7 @@ function EmployeeManage() {
}); });
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [realTotal, setRealTotal] = useState(0)
const [model, setModel] = useState<React.ReactNode>(null); const [model, setModel] = useState<React.ReactNode>(null);
const [employeeModal, setEmployeeModal] = useState(false); const [employeeModal, setEmployeeModal] = useState(false);
const [choosedItem, setChooseItem] = useState<ChoosedItemType>({ const [choosedItem, setChooseItem] = useState<ChoosedItemType>({
...@@ -85,6 +87,17 @@ function EmployeeManage() { ...@@ -85,6 +87,17 @@ function EmployeeManage() {
if (!User.getEnterpriseId()) { if (!User.getEnterpriseId()) {
window.RCHistory.replace('/employees-manage'); window.RCHistory.replace('/employees-manage');
} }
//获取员工数
const _query = {
current: 0,
size: 10,
nickName: "",
phone: "",
roleCodes: [],
}
StoreService.getEmployeeList(_query).then((res: any) => {
setRealTotal(res.result.total);
});
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -362,6 +375,7 @@ function EmployeeManage() { ...@@ -362,6 +375,7 @@ function EmployeeManage() {
</Button> </Button>
} }
</div> </div>
<LimitTip type="员工" total={realTotal} tip={()=>{return (<div>数据为当前学院的员工数,若员工存在多个学院,企业人数只统计为1人</div>)}}/>
<div className="box-body"> <div className="box-body">
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
......
.limit-tip {
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;
}
}
}
\ No newline at end of file
import React, { useContext, useEffect, useState } from "react";
import { Tooltip } from "antd"
import { VersionContext } from "@/store/context";
import ContactWidget from "@/components/ContactWidget";
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")
const versionInfo = useContext(VersionContext)
useEffect(()=> {
if (versionInfo) {
setIsOver(versionInfo.userNum === -1 ? false : versionInfo.whetherReachUserNum)
setLimitUser(versionInfo.userNum === -1 ? "不限人数" : String(versionInfo.userNum))
}
},[versionInfo])
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>
<ContactWidget trigger="hover" placement="bottom">
<div className="renew-text">立即续费<span className="icon iconfont" style={{fontSize:"10px"}}>&#59291;</span></div>
</ContactWidget>
</>
) : ("")
}
</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
...@@ -15,6 +15,8 @@ import { Input, DatePicker, Select, Button, message } from "antd"; ...@@ -15,6 +15,8 @@ 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 LimitTip from "./LimitTip"
import { XMTable } from '@/components'; import { XMTable } from '@/components';
import college from '@/common/lottie/college.json'; import college from '@/common/lottie/college.json';
import "./UserManagePage.less"; import "./UserManagePage.less";
...@@ -26,6 +28,8 @@ const { RangePicker } = DatePicker; ...@@ -26,6 +28,8 @@ 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);
...@@ -39,11 +43,25 @@ function UserManagePage() { ...@@ -39,11 +43,25 @@ function UserManagePage() {
sourceEnum: undefined, sourceEnum: undefined,
}); });
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [realTotal, setRealTotal] = useState(0)
useEffect(() => { useEffect(() => {
if (!User.getEnterpriseId()) { if (!User.getEnterpriseId()) {
window.RCHistory.replace('/user-manage'); window.RCHistory.replace('/user-manage');
} }
//获取学员数
const _query = {
current: 0,
size: 10,
nickName: "",
phone: "",
registerBegin: null,
registerEnd: null,
sourceEnum: undefined,
}
StoreService.getUserList(_query).then((res: any) => {
setRealTotal(res.result.total);
});
}, []) }, [])
useEffect(() => { useEffect(() => {
...@@ -125,9 +143,6 @@ function UserManagePage() { ...@@ -125,9 +143,6 @@ function UserManagePage() {
<div className="header-item"> <div className="header-item">
<span className="item-name">搜索学员:</span> <span className="item-name">搜索学员:</span>
<Search <Search
style={{
width: 300,
}}
placeholder="搜索学员姓名/手机号" placeholder="搜索学员姓名/手机号"
onSearch={(value) => { onSearch={(value) => {
const _query = { ...query }; const _query = { ...query };
...@@ -199,6 +214,7 @@ function UserManagePage() { ...@@ -199,6 +214,7 @@ function UserManagePage() {
}} }}
>添加学员</Button> >添加学员</Button>
} }
<LimitTip type="学员" total={realTotal} tip={()=>{ return (<div><div>1、数据为当前学院的员工数,若学员存在多个学院,企业人数只统计为1人;</div><div>2、若一个学员既用「企业微信」登录学习又用「微信」登录学习,企业人数将统计为2人。</div></div>)}}/>
<div className="box-body"> <div className="box-body">
<XMTable <XMTable
renderEmpty={{ renderEmpty={{
......
...@@ -285,6 +285,10 @@ class ChooseMembersModal extends React.Component { ...@@ -285,6 +285,10 @@ class ChooseMembersModal extends React.Component {
visible={isOpen} visible={isOpen}
onCancel={() => this.handleClose()} onCancel={() => this.handleClose()}
onOk={() => { onOk={() => {
if (User.getVersion() && User.getVersion().whetherReachUserNum) {
message.error("添加失败,企业使用人数超出限制")
return
}
if (_.isEmpty(selectUserList)) { if (_.isEmpty(selectUserList)) {
message.warning(type === 'USER' ? '请选择员工' : '请选择学员') message.warning(type === 'USER' ? '请选择员工' : '请选择学员')
return null; return null;
......
...@@ -269,6 +269,15 @@ handleChangeBasicInfo = (field, value) => { ...@@ -269,6 +269,15 @@ handleChangeBasicInfo = (field, value) => {
// 完成创建/编辑 // 完成创建/编辑
handleSubmit = () => { handleSubmit = () => {
//过期判断
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
return
}
const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, id, isEdit, type } = this.state; const { addLiveBasicInfo, addLiveClassInfo, addLiveIntroInfo, id, isEdit, type } = this.state;
const {liveDate, timeHorizonStart} = addLiveClassInfo; const {liveDate, timeHorizonStart} = addLiveClassInfo;
const _liveDate = moment(liveDate).format("YYYY-MM-DD"); const _liveDate = moment(liveDate).format("YYYY-MM-DD");
......
import User from '@/common/js/user';
import college from '@/common/lottie/college';
import { PageControl, XMTable } from '@/components';
import CourseService from '@/domains/course-domain/CourseService';
import { Button, message } from 'antd';
import React from 'react'; import React from 'react';
import { withRouter } from "react-router-dom"; import { withRouter } from 'react-router-dom';
import { Table, Button, Modal, message } from 'antd';
import dealTimeDuration from '../utils/dealTimeDuration'; import dealTimeDuration from '../utils/dealTimeDuration';
import { PageControl } from "@/components";
import './DataList.less'; import './DataList.less';
import CourseService from "@/domains/course-domain/CourseService";
import User from '@/common/js/user';
const liveTypeMap = { const liveTypeMap = {
USER: "普通用户", USER: '普通用户',
ANCHOR: "讲师", ANCHOR: '讲师',
ADMIN: "管理员(助教)", ADMIN: '管理员(助教)',
GUEST: "游客" GUEST: '游客',
}; };
class PlaybackData extends React.Component { class PlaybackData extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const courseId = getParameterByName("id"); // 课程ID const courseId = getParameterByName('id'); // 课程ID
this.state = { this.state = {
playbackData: [], playbackData: [],
...@@ -24,8 +25,8 @@ class PlaybackData extends React.Component { ...@@ -24,8 +25,8 @@ class PlaybackData extends React.Component {
size: 10, size: 10,
total: 0, total: 0,
liveCourseId: courseId, liveCourseId: courseId,
storeId: User.getStoreId() storeId: User.getStoreId(),
} };
} }
componentDidMount() { componentDidMount() {
...@@ -33,12 +34,12 @@ class PlaybackData extends React.Component { ...@@ -33,12 +34,12 @@ class PlaybackData extends React.Component {
} }
fetchPlaybackList = (page = 1) => { fetchPlaybackList = (page = 1) => {
const { size, liveCourseId } = this.state const { size, liveCourseId } = this.state;
const params = { const params = {
liveCourseId, liveCourseId,
current: page, current: page,
size size,
} };
CourseService.fetchPlaybackList(params).then((res) => { CourseService.fetchPlaybackList(params).then((res) => {
if (res.result) { if (res.result) {
...@@ -47,38 +48,35 @@ class PlaybackData extends React.Component { ...@@ -47,38 +48,35 @@ class PlaybackData extends React.Component {
playbackData: records, playbackData: records,
current, current,
size, size,
total total,
}); });
} }
}); });
}; };
getPlaybackColumns() { getPlaybackColumns() {
const columns = [ const columns = [
{ {
title: "观看学员", title: '观看学员',
dataIndex: "userName", dataIndex: 'userName',
}, },
{ {
title: "手机号", title: '手机号',
dataIndex: "phone" dataIndex: 'phone',
}, },
{ {
title: "观看者类型", title: '观看者类型',
dataIndex: "userRole", dataIndex: 'userRole',
render: (text) => <span>{liveTypeMap[text]}</span>, render: (text) => <span>{liveTypeMap[text]}</span>,
}, },
{ {
title: "开始观看时间", title: '开始观看时间',
dataIndex: "entryTime", dataIndex: 'entryTime',
render: (text) => ( render: (text) => <span>{text ? formatDate('YYYY-MM-DD H:i', parseInt(text)) : '-'}</span>,
<span>{text ? formatDate("YYYY-MM-DD H:i", parseInt(text)) : '-'}</span>
),
}, },
{ {
title: "观看时长", title: '观看时长',
dataIndex: "lookingDuration", dataIndex: 'lookingDuration',
render: (text) => { render: (text) => {
return <span>{text ? dealTimeDuration(text) : '-'}</span>; return <span>{text ? dealTimeDuration(text) : '-'}</span>;
}, },
...@@ -92,53 +90,55 @@ class PlaybackData extends React.Component { ...@@ -92,53 +90,55 @@ class PlaybackData extends React.Component {
CourseService.exportPlayBackCourseData({ CourseService.exportPlayBackCourseData({
liveCourseId, liveCourseId,
exportLiveType: "PLAY_BACK", exportLiveType: 'PLAY_BACK',
storeId storeId,
}).then((res) => { }).then((res) => {
const link = res.result; const link = res.result;
this.setState({ this.setState({
link link,
}); });
document.getElementById("load-play-back-excel").click(); document.getElementById('load-play-back-excel').click();
if(res.success){ if (res.success) {
message.success("导出成功!") message.success('导出成功!');
} }
}) });
} }
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return; return;
} }
this.setState({ size }, this.fetchUserData) this.setState({ size }, this.fetchUserData);
} };
render() { render() {
const { playbackData, total, current, size, link} = this.state const { playbackData, total, current, size, link } = this.state;
return ( return (
<div> <div>
<a <a href={link} target='_blank' download id='load-play-back-excel' style={{ position: 'absolute', left: '-10000px' }}>
href={link}
target="_blank"
download
id="load-play-back-excel"
style={{ position: "absolute", left: "-10000px" }}
>
111 111
</a> </a>
<Button onClick={() => {this.handleplaybackExport()}}>导出</Button> <Button
<Table onClick={() => {
this.handleplaybackExport();
}}>
导出
</Button>
<XMTable
renderEmpty={{
image: college,
description: '暂无数据',
}}
bordered bordered
size="small" size='small'
columns={this.getPlaybackColumns()} columns={this.getPlaybackColumns()}
dataSource={playbackData} dataSource={playbackData}
pagination={false} pagination={false}
style={{ margin: '16px 0' }}> style={{ margin: '16px 0' }}></XMTable>
</Table> {total > 0 && (
{ total > 0 &&
<PageControl <PageControl
size="small" size='small'
current={current - 1} current={current - 1}
pageSize={size} pageSize={size}
total={total} total={total}
...@@ -147,9 +147,9 @@ class PlaybackData extends React.Component { ...@@ -147,9 +147,9 @@ class PlaybackData extends React.Component {
this.fetchPlaybackList(page + 1); this.fetchPlaybackList(page + 1);
}} }}
/> />
} )}
</div> </div>
) );
} }
} }
......
...@@ -22,6 +22,13 @@ class LiveCoursePage extends React.Component { ...@@ -22,6 +22,13 @@ class LiveCoursePage extends React.Component {
componentWillMount() { componentWillMount() {
this.handleFetchLiveList(this.state.query); this.handleFetchLiveList(this.state.query);
} }
changeShelfState = (index, shelfState) => {
const { courseList } = this.state;
courseList[index].shelfState = shelfState;
this.setState({
courseList,
});
};
// 获取直播课列表 // 获取直播课列表
handleFetchLiveList = (_query) => { handleFetchLiveList = (_query) => {
const { query } = this.state; const { query } = this.state;
...@@ -54,6 +61,7 @@ class LiveCoursePage extends React.Component { ...@@ -54,6 +61,7 @@ class LiveCoursePage extends React.Component {
total={total} total={total}
courseList={courseList} courseList={courseList}
onChange={this.handleFetchLiveList} onChange={this.handleFetchLiveList}
changeShelfState={this.changeShelfState}
/> />
</div> </div>
</div> </div>
......
.live-course-list { .live-course-list {
margin-top: 12px; margin-top: 12px;
.record__item { .record__item {
overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
.course-cover { .course-cover {
...@@ -11,63 +11,61 @@ ...@@ -11,63 +11,61 @@
border-radius: 2px; border-radius: 2px;
margin-right: 8px; margin-right: 8px;
} }
.course-name{ .course-name {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
max-width:244px; max-width: 200px;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.course-time{ .course-time {
font-size: 12px; font-size: 12px;
font-weight: 400; font-weight: 400;
color: #666666; color: #666666;
line-height: 20px; line-height: 20px;
} }
.course-status { .course-status {
font-size:12px; font-size: 12px;
line-height:18px; line-height: 18px;
display:inline-block; display: inline-block;
border-radius:2px; border-radius: 2px;
padding:0 8px; padding: 0 8px;
margin-left:4px; margin-left: 4px;
} }
.teacher-assistant{ .teacher-assistant {
display:flex; display: flex;
.teacher{ .teacher {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
max-width: 96px; max-width: 96px;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
display:inline-block; display: inline-block;
padding-top:2px; padding-top: 2px;
} }
.assistant{ .assistant {
font-size: 12px; font-size: 12px;
color: #666666; color: #666666;
max-width: 96px; max-width: 96px;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
display:inline-block; display: inline-block;
padding-top:2px; padding-top: 2px;
} }
.split { .split {
margin: 0 4px; margin: 0 4px;
color: #BFBFBF; color: #bfbfbf;
display: inline-blcok; display: inline-blcok;
} }
} }
} }
.related-task{ .related-task {
text-overflow: -o-ellipsis-lastline; text-overflow: -o-ellipsis-lastline;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
...@@ -76,37 +74,37 @@ ...@@ -76,37 +74,37 @@
line-clamp: 2; line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
} }
.categoryName{ .categoryName {
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
line-height: 20px; line-height: 20px;
} }
.courseware{ .courseware {
font-size: 14px; font-size: 14px;
color: #2966FF; color: #2966ff;
line-height: 20px; line-height: 20px;
text-align:right; text-align: right;
cursor:pointer; cursor: pointer;
} }
.quota-icon{ .quota-icon {
color:#2966FF; color: #2966ff;
cursor:pointer; cursor: pointer;
} }
.operate { .operate {
display: flex; display: flex;
align-items: center; align-items: center;
flex-wrap: wrap; flex-wrap: wrap;
.operate__item { .operate__item {
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
&.split { &.split {
margin: 0 8px; margin: 0 8px;
color: #BFBFBF; color: #bfbfbf;
} }
} }
} }
.operate-text { .operate-text {
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
} }
.course-start-end { .course-start-end {
...@@ -135,7 +133,27 @@ ...@@ -135,7 +133,27 @@
font-size: 12px; font-size: 12px;
} }
} }
tbody {
tr {
&:nth-child(even) {
background: transparent !important;
td {
background: #fff !important;
}
}
&:nth-child(odd) {
background: #fafafa !important;
td {
background: #fafafa !important;
}
}
&:hover {
td {
background: #f3f6fa !important;
}
}
}
}
} }
.live-course-more-menu { .live-course-more-menu {
background: white; background: white;
......
...@@ -53,7 +53,7 @@ class LiveCourseOpt extends React.Component { ...@@ -53,7 +53,7 @@ class LiveCourseOpt extends React.Component {
{ userRole !== "CloudLecturer" && { userRole !== "CloudLecturer" &&
<Button type="primary" onClick={this.handleCreateLiveCouese}>新建直播课</Button> <Button type="primary" onClick={this.handleCreateLiveCouese}>新建直播课</Button>
} }
{!this.state.isMac && <Button onClick={this.handleDownloadClient}>下载直播客户端</Button>} <Button onClick={this.handleDownloadClient}>下载直播客户端</Button>
</div> </div>
</div> </div>
) )
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
import React from 'react'; import React from 'react';
import { Button, Input, Radio, message, Modal, Cascader } from 'antd'; import { Button, Input, Radio, message, Modal, Cascader } from 'antd';
import $ from 'jquery'; import $ from 'jquery';
import moment from 'moment';
import { DISK_MAP, FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum'; import { DISK_MAP, FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum';
import { ImgCutModalNew } from '@/components'; import { ImgCutModalNew } from '@/components';
import ShowTips from '@/components/ShowTips'; import ShowTips from '@/components/ShowTips';
...@@ -312,6 +312,15 @@ class AddGraphicsCourse extends React.Component { ...@@ -312,6 +312,15 @@ class AddGraphicsCourse extends React.Component {
// 保存 // 保存
handleSubmit = () => { handleSubmit = () => {
//过期判断
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
return
}
const { id, coverId, pageType, courseName, courseMedia, introduce, categoryId, shelfState, whetherVisitorsJoin } = this.state; const { id, coverId, pageType, courseName, courseMedia, introduce, categoryId, shelfState, whetherVisitorsJoin } = this.state;
const commonParams = { const commonParams = {
......
...@@ -27,6 +27,13 @@ class GraphicsCourse extends React.Component { ...@@ -27,6 +27,13 @@ class GraphicsCourse extends React.Component {
this.handleFetchScheduleList(); this.handleFetchScheduleList();
} }
changeShelfState = (index, shelfState) => {
const { dataSource } = this.state;
dataSource[index].shelfState = shelfState;
this.setState({
dataSource,
});
};
// 获取视频课列表 // 获取视频课列表
handleFetchScheduleList = (_query = {}) => { handleFetchScheduleList = (_query = {}) => {
const query = { const query = {
...@@ -75,6 +82,7 @@ class GraphicsCourse extends React.Component { ...@@ -75,6 +82,7 @@ class GraphicsCourse extends React.Component {
dataSource={dataSource} dataSource={dataSource}
totalCount={totalCount} totalCount={totalCount}
onChange={this.handleFetchScheduleList} onChange={this.handleFetchScheduleList}
changeShelfState={this.changeShelfState}
/> />
</div> </div>
</div> </div>
......
...@@ -6,79 +6,85 @@ ...@@ -6,79 +6,85 @@
* @Description 余额异常弹窗 * @Description 余额异常弹窗
*/ */
import React from 'react'; import React from 'react';
import {Table, Modal,Input} from 'antd'; import { Modal, Input } from 'antd';
import { PageControl } from "@/components"; import college from '@/common/lottie/college';
import Service from "@/common/js/service"; import { PageControl, XMTable } from '@/components';
import User from '@/common/js/user' import Service from '@/common/js/service';
import User from '@/common/js/user';
import './WatchDataModal.less'; import './WatchDataModal.less';
import dealTimeDuration from "../../utils/dealTimeDuration"; import dealTimeDuration from '../../utils/dealTimeDuration';
const { Search } = Input; const { Search } = Input;
class WatchDataModal extends React.Component { class WatchDataModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
visible:true, visible: true,
dataSource:[], dataSource: [],
size:10, size: 10,
query: { query: {
current: 1, current: 1,
}, },
totalCount:0 totalCount: 0,
}; };
} }
componentDidMount() { componentDidMount() {
this.handleFetchDataList(); this.handleFetchDataList();
} }
onClose = () =>{ onClose = () => {
this.props.close(); this.props.close();
} };
// 获取观看视频数据列表 // 获取观看视频数据列表
handleFetchDataList = () => { handleFetchDataList = () => {
const {query,size,totalCount} = this.state const { query, size, totalCount } = this.state;
const { id } = this.props.data; const { id } = this.props.data;
const params ={ const params = {
...query, ...query,
size, size,
courseId:id, courseId: id,
storeId:User.getStoreId() storeId: User.getStoreId(),
} };
Service.Hades('public/hades/mediaCourseWatchInfo', params).then((res) => { Service.Hades('public/hades/mediaCourseWatchInfo', params).then((res) => {
const { result = {} } = res ; const { result = {} } = res;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
this.setState({ this.setState({
dataSource: records, dataSource: records,
totalCount: Number(total) totalCount: Number(total),
}); });
}); });
} };
handleChangNickname = (value)=>{ handleChangNickname = (value) => {
const isPhone = (value || '').match(/^\d+$/); const isPhone = (value || '').match(/^\d+$/);
const { query } = this.state; const { query } = this.state;
if(isPhone){ if (isPhone) {
query.phone = value; query.phone = value;
query.nickName = null; query.nickName = null;
}else{ } else {
query.nickName = value; query.nickName = value;
query.phone = null; query.phone = null;
} }
query.current = 1; query.current = 1;
this.setState({ this.setState({
query query,
}) });
} };
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return return;
} }
this.setState({ this.setState(
size {
},()=>{this.handleFetchDataList()}) size,
},
() => {
this.handleFetchDataList();
} }
);
};
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
...@@ -86,91 +92,109 @@ class WatchDataModal extends React.Component { ...@@ -86,91 +92,109 @@ class WatchDataModal extends React.Component {
{ {
title: '观看学员', title: '观看学员',
key: 'name', key: 'name',
dataIndex: 'name' dataIndex: 'name',
}, },
{ {
title: '手机号', title: '手机号',
key: 'phone', key: 'phone',
dataIndex: 'phone' dataIndex: 'phone',
}, },
{ {
title: '观看者类型', title: '观看者类型',
key: 'userRole', key: 'userRole',
dataIndex: 'userRole' dataIndex: 'userRole',
}, },
{ {
title: '首次观看时间', title: '首次观看时间',
key: 'firstWatch', key: 'firstWatch',
dataIndex: 'firstWatch', dataIndex: 'firstWatch',
render: (val) => { render: (val) => {
return formatDate('YYYY-MM-DD H:i', val) return formatDate('YYYY-MM-DD H:i', val);
} },
}, },
{ {
title: '观看总时长', title: '观看总时长',
key: 'watchDuration', key: 'watchDuration',
dataIndex: 'watchDuration', dataIndex: 'watchDuration',
render: (val) => { render: (val) => {
return <span>{val ? dealTimeDuration(val) : "00:00:00" }</span> return <span>{val ? dealTimeDuration(val) : '00:00:00'}</span>;
} },
}, },
{ {
title: '学习进度', title: '学习进度',
key: 'progress', key: 'progress',
dataIndex: 'progress', dataIndex: 'progress',
render: (val) => { render: (val) => {
return <span>{val === 100 ? '已完成' : `${val || 0}%`}</span> return <span>{val === 100 ? '已完成' : `${val || 0}%`}</span>;
} },
} },
]; ];
return columns; return columns;
} };
render() { render() {
const { visible,size,dataSource,totalCount,query} = this.state; const { visible, size, dataSource, totalCount, query } = this.state;
return ( return (
<Modal <Modal
title="图文课观看数据" title='图文课观看数据'
visible={visible} visible={visible}
footer={null} footer={null}
onCancel={this.onClose} onCancel={this.onClose}
maskClosable={false} maskClosable={false}
className="watch-data-modal" className='watch-data-modal'
closable={true} closable={true}
width={800} width={800}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}>
> <div className='search-container'>
<div className="search-container"> <Search
<Search placeholder="搜索学员姓名/手机号" style={{ width: 200 }} onChange={(e) => { this.handleChangNickname(e.target.value)}} onSearch={ () => { this.handleFetchDataList()}} enterButton={<span className="icon iconfont">&#xe832;</span>}/> placeholder='搜索学员姓名/手机号'
style={{ width: 200 }}
onChange={(e) => {
this.handleChangNickname(e.target.value);
}}
onSearch={() => {
this.handleFetchDataList();
}}
enterButton={<span className='icon iconfont'>&#xe832;</span>}
/>
</div> </div>
<div> <div>
<Table <XMTable
rowKey={record => record.id} renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.id}
dataSource={dataSource} dataSource={dataSource}
columns={this.parseColumns()} columns={this.parseColumns()}
pagination={false} pagination={false}
bordered bordered
/> />
{dataSource.length >0 && {dataSource.length > 0 && (
<div className="box-footer"> <div className='box-footer'>
<PageControl <PageControl
current={query.current - 1} current={query.current - 1}
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
size="small" size='small'
toPage={(page) => { toPage={(page) => {
const _query = {...query, current: page + 1}; const _query = { ...query, current: page + 1 };
this.setState({ this.setState(
query:_query {
},()=>{ this.handleFetchDataList()}) query: _query,
},
() => {
this.handleFetchDataList();
}
);
}} }}
onShowSizeChange={this.onShowSizeChange} onShowSizeChange={this.onShowSizeChange}
/> />
</div> </div>
} )}
</div> </div>
</Modal> </Modal>
) );
} }
} }
......
import college from '@/common/lottie/college';
import { XMTable } from '@/components';
import { Modal } from 'antd';
import React from 'react'; import React from 'react';
import { Modal, Table } from "antd"; import './AccountChargeModal.less';
import ChargeArgeement from "./ChargeArgeement"; import ChargeArgeement from './ChargeArgeement';
import "./AccountChargeModal.less"; class AccountChargeRecords extends React.Component {
class AccountChargeRecords extends React.Component{
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
...@@ -15,9 +17,7 @@ class AccountChargeRecords extends React.Component{ ...@@ -15,9 +17,7 @@ class AccountChargeRecords extends React.Component{
getList = () => { getList = () => {
const { instId } = window.currentUserInstInfo; const { instId } = window.currentUserInstInfo;
axios axios.Business('public/liveAssets/rechargeProtocol', { instId }).then((res) => {
.Business("public/liveAssets/rechargeProtocol", { instId })
.then((res) => {
const list = res.result; const list = res.result;
this.setState({ this.setState({
list, list,
...@@ -42,29 +42,28 @@ class AccountChargeRecords extends React.Component{ ...@@ -42,29 +42,28 @@ class AccountChargeRecords extends React.Component{
render() { render() {
const columns = [ const columns = [
{ {
title: "签订人", title: '签订人',
dataIndex: "operatorName", dataIndex: 'operatorName',
width: 140 width: 140,
}, },
{ title: "关联订单ID", dataIndex: "orderId" }, { title: '关联订单ID', dataIndex: 'orderId' },
{ {
title: "签订时间", title: '签订时间',
dataIndex: "createTime", dataIndex: 'createTime',
render: (text, record) => { render: (text, record) => {
return <span>{formatDate("YYYY-MM-DD H:i", parseInt(text))}</span>; return <span>{formatDate('YYYY-MM-DD H:i', parseInt(text))}</span>;
}, },
}, },
{ {
title: "签订协议", title: '签订协议',
dataIndex: "operate", dataIndex: 'operate',
render: (text, record) => { render: (text, record) => {
return ( return (
<div <div
style={{ cursor: "pointer", color: "#FC9C6B" }} style={{ cursor: 'pointer', color: '#FC9C6B' }}
onClick={() => { onClick={() => {
this.handleProtcol(record.protocolId); this.handleProtcol(record.protocolId);
}} }}>
>
《服务协议》 《服务协议》
</div> </div>
); );
...@@ -74,29 +73,31 @@ class AccountChargeRecords extends React.Component{ ...@@ -74,29 +73,31 @@ class AccountChargeRecords extends React.Component{
const { list } = this.state; const { list } = this.state;
return ( return (
<Modal <Modal
title="服务协议签订记录" title='服务协议签订记录'
visible={true} visible={true}
width={680} width={680}
footer={null} footer={null}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
onCancel={() => { onCancel={() => {
this.props.close(); this.props.close();
}} }}>
>
<div> <div>
<div <div
style={{ style={{
fontSize: "14px", fontSize: '14px',
color: "#666666", color: '#666666',
lineHeight: "20px", lineHeight: '20px',
marginBottom: 16, marginBottom: 16,
}} }}>
>
以下是本校区自助充值时签订协议的记录 以下是本校区自助充值时签订协议的记录
</div> </div>
<Table <XMTable
size="middle" renderEmpty={{
image: college,
description: '暂无数据',
}}
size='middle'
columns={columns} columns={columns}
dataSource={list} dataSource={list}
pagination={false} pagination={false}
......
import college from '@/common/lottie/college';
import { PageControl, XMTable } from '@/components';
import { Modal, Tooltip } from 'antd';
import React from 'react'; import React from 'react';
import { Modal, Table, Tooltip } from "antd"; import './AccountChargeModal.less';
import { ShowTips, PageControl } from "@/components";
import "./AccountChargeModal.less";
class ChargingDetailModal extends React.Component { class ChargingDetailModal extends React.Component {
constructor(props) { constructor(props) {
...@@ -25,9 +26,7 @@ class ChargingDetailModal extends React.Component { ...@@ -25,9 +26,7 @@ class ChargingDetailModal extends React.Component {
handleToPage = (page = 1) => { handleToPage = (page = 1) => {
const params = _.clone(this.state.query); const params = _.clone(this.state.query);
params.current = page; params.current = page;
axios axios.Apollo('public/businessLive/queryStudentVisitData', params).then((res) => {
.Apollo("public/businessLive/queryStudentVisitData", params)
.then((res) => {
if (res.result) { if (res.result) {
const { records = [], total } = res.result; const { records = [], total } = res.result;
this.setState({ this.setState({
...@@ -40,7 +39,7 @@ class ChargingDetailModal extends React.Component { ...@@ -40,7 +39,7 @@ class ChargingDetailModal extends React.Component {
}; };
getTeacherData = () => { getTeacherData = () => {
window.axios window.axios
.Apollo("public/businessLive/queryTeacherVisitData", { .Apollo('public/businessLive/queryTeacherVisitData', {
liveCourseId: this.props.liveCourseId, liveCourseId: this.props.liveCourseId,
}) })
.then((res) => { .then((res) => {
...@@ -57,27 +56,27 @@ class ChargingDetailModal extends React.Component { ...@@ -57,27 +56,27 @@ class ChargingDetailModal extends React.Component {
let hours = Math.floor(time / 3600); let hours = Math.floor(time / 3600);
let mins = Math.floor(diff / 60); let mins = Math.floor(diff / 60);
let seconds = Math.floor(time % 60); let seconds = Math.floor(time % 60);
hours = hours < 10 ? "0" + hours : hours; hours = hours < 10 ? '0' + hours : hours;
mins = mins < 10 ? "0" + mins : mins; mins = mins < 10 ? '0' + mins : mins;
seconds = seconds < 10 ? "0" + seconds : seconds; seconds = seconds < 10 ? '0' + seconds : seconds;
return hours + ":" + mins + ":" + seconds; return hours + ':' + mins + ':' + seconds;
}; };
getColumns = (type) => { getColumns = (type) => {
const columns = [ const columns = [
{ {
title: type == "student" ? "学生姓名" : "老师姓名", title: type == 'student' ? '学生姓名' : '老师姓名',
dataIndex: "userName", dataIndex: 'userName',
}, },
{ {
title: "手机号", title: '手机号',
dataIndex: "phone", dataIndex: 'phone',
render: (text, record) => { render: (text, record) => {
return <p>{text}</p>; return <p>{text}</p>;
}, },
}, },
{ {
title: "累计在线时长", title: '累计在线时长',
dataIndex: "totalDuration", dataIndex: 'totalDuration',
render: (text, record) => { render: (text, record) => {
return <span>{text ? this.dealTimeDuration(text) : '-'}</span>; return <span>{text ? this.dealTimeDuration(text) : '-'}</span>;
}, },
...@@ -86,14 +85,14 @@ class ChargingDetailModal extends React.Component { ...@@ -86,14 +85,14 @@ class ChargingDetailModal extends React.Component {
title: ( title: (
<span> <span>
是否计费&nbsp; 是否计费&nbsp;
<Tooltip title="仅对累计在线时长≥10分钟的老师或学员计费"> <Tooltip title='仅对累计在线时长≥10分钟的老师或学员计费'>
<span className="icon iconfont">&#xe6f2;</span> <span className='icon iconfont'>&#xe6f2;</span>
</Tooltip> </Tooltip>
</span> </span>
), ),
dataIndex: "type", dataIndex: 'type',
render: (text, record) => { render: (text, record) => {
return <span>{record.totalDuration > 600 ? "计费" : "不计费"}</span>; //大于十分钟的计费 return <span>{record.totalDuration > 600 ? '计费' : '不计费'}</span>; //大于十分钟的计费
}, },
}, },
]; ];
...@@ -103,38 +102,45 @@ class ChargingDetailModal extends React.Component { ...@@ -103,38 +102,45 @@ class ChargingDetailModal extends React.Component {
const { list, query, totalCount, teacherList } = this.state; const { list, query, totalCount, teacherList } = this.state;
return ( return (
<Modal <Modal
title="计费人数详情" title='计费人数详情'
visible={true} visible={true}
width={680} width={680}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
className="charging-detail-modal" className='charging-detail-modal'
footer={null} footer={null}
onCancel={() => { onCancel={() => {
this.props.close(); this.props.close();
}} }}>
>
<div> <div>
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<div className="detail-title">老师详情</div> <div className='detail-title'>老师详情</div>
<Table <XMTable
size="middle" renderEmpty={{
columns={this.getColumns("teacher")} image: college,
description: '暂无数据',
}}
size='middle'
columns={this.getColumns('teacher')}
dataSource={teacherList} dataSource={teacherList}
pagination={false} pagination={false}
bordered bordered
/> />
</div> </div>
<div className="detail-title">学生详情</div> <div className='detail-title'>学生详情</div>
<Table <XMTable
size="middle" renderEmpty={{
columns={this.getColumns("student")} image: college,
description: '暂无数据',
}}
size='middle'
columns={this.getColumns('student')}
dataSource={list} dataSource={list}
pagination={false} pagination={false}
bordered bordered
/> />
<PageControl <PageControl
size="small" size='small'
current={query.current - 1} current={query.current - 1}
pageSize={query.size} pageSize={query.size}
total={totalCount} total={totalCount}
......
...@@ -6,21 +6,19 @@ ...@@ -6,21 +6,19 @@
* @LastEditTime: 2021-02-01 14:00:36 * @LastEditTime: 2021-02-01 14:00:36
*/ */
import React, { useState, useEffect } from "react"; import college from '@/common/lottie/college';
import { Modal, Table, Button, message } from "antd"; import { PageControl, XMTable } from '@/components';
import Bus from '@/core/bus'; import Bus from '@/core/bus';
import { PageControl } from "@/components"; import { Button, message, Modal } from 'antd';
import React from 'react';
import hasExportPermission from '../utils/hasExportPermission';
import dealTimeDuration from '../utils/dealTimeDuration'; import dealTimeDuration from '../utils/dealTimeDuration';
import hasExportPermission from '../utils/hasExportPermission';
import "./ClassRecordModal.less"; import './ClassRecordModal.less';
const liveTypeMap = { const liveTypeMap = {
USER: "学生", USER: '学生',
ANCHOR: "老师", ANCHOR: '老师',
ADMIN: "助教", ADMIN: '助教',
}; };
class PlayBackRecordModal extends React.Component { class PlayBackRecordModal extends React.Component {
...@@ -46,9 +44,7 @@ class PlayBackRecordModal extends React.Component { ...@@ -46,9 +44,7 @@ class PlayBackRecordModal extends React.Component {
fetchPlayBackList = (page = 1) => { fetchPlayBackList = (page = 1) => {
const params = _.clone(this.state.query); const params = _.clone(this.state.query);
params.current = page; params.current = page;
window.axios window.axios.Apollo('public/businessLive/queryUserReplayRecordPage', params).then((res) => {
.Apollo("public/businessLive/queryUserReplayRecordPage", params)
.then((res) => {
const { records = [], total } = res.result; const { records = [], total } = res.result;
this.setState({ this.setState({
query: params, query: params,
...@@ -61,7 +57,7 @@ class PlayBackRecordModal extends React.Component { ...@@ -61,7 +57,7 @@ class PlayBackRecordModal extends React.Component {
fetchAllStatistics = () => { fetchAllStatistics = () => {
const { liveCourseId } = this.props.liveItem; const { liveCourseId } = this.props.liveItem;
window.axios window.axios
.Apollo("public/businessLive/queryReplayStatistics", { .Apollo('public/businessLive/queryReplayStatistics', {
liveCourseId, liveCourseId,
}) })
.then((res) => { .then((res) => {
...@@ -80,7 +76,7 @@ class PlayBackRecordModal extends React.Component { ...@@ -80,7 +76,7 @@ class PlayBackRecordModal extends React.Component {
const hours = Math.floor(time / 3600); const hours = Math.floor(time / 3600);
const mins = Math.floor(diff / 60); const mins = Math.floor(diff / 60);
const seconds = Math.floor(time % 60); const seconds = Math.floor(time % 60);
return hours + "小时" + mins + "分"; return hours + '小时' + mins + '分';
}; };
// 导出 // 导出
...@@ -88,10 +84,12 @@ class PlayBackRecordModal extends React.Component { ...@@ -88,10 +84,12 @@ class PlayBackRecordModal extends React.Component {
const { liveItem, type } = this.props; const { liveItem, type } = this.props;
const { liveCourseId } = liveItem; const { liveCourseId } = liveItem;
const url = !type ? 'api-b/b/lesson/exportLargeClassLiveAsync' : 'api-b/b/lesson/exportClassInteractionLiveSync'; const url = !type ? 'api-b/b/lesson/exportLargeClassLiveAsync' : 'api-b/b/lesson/exportClassInteractionLiveSync';
window.axios.post(url, { window.axios
.post(url, {
liveCourseId, liveCourseId,
exportLiveType: 0 exportLiveType: 0,
}).then((res) => { })
.then((res) => {
Bus.trigger('get_download_count'); Bus.trigger('get_download_count');
Modal.success({ Modal.success({
title: '导出任务提交成功', title: '导出任务提交成功',
...@@ -99,16 +97,18 @@ class PlayBackRecordModal extends React.Component { ...@@ -99,16 +97,18 @@ class PlayBackRecordModal extends React.Component {
okText: '我知道了', okText: '我知道了',
}); });
}); });
} };
handleExportV5 = () => { handleExportV5 = () => {
const { liveItem, type } = this.props; const { liveItem, type } = this.props;
const { liveCourseId } = liveItem; const { liveCourseId } = liveItem;
const url = !type ? 'public/businessLive/exportLargeClassLiveAsync' : 'public/businessLive/exportClassInteractionLiveSync'; const url = !type ? 'public/businessLive/exportLargeClassLiveAsync' : 'public/businessLive/exportClassInteractionLiveSync';
window.axios.Apollo(url, { window.axios
.Apollo(url, {
liveCourseId, liveCourseId,
exportLiveType: 'PLAY_BACK' exportLiveType: 'PLAY_BACK',
}).then((res) => { })
.then((res) => {
Bus.trigger('get_download_count'); Bus.trigger('get_download_count');
Modal.success({ Modal.success({
title: '导出任务提交成功', title: '导出任务提交成功',
...@@ -116,78 +116,67 @@ class PlayBackRecordModal extends React.Component { ...@@ -116,78 +116,67 @@ class PlayBackRecordModal extends React.Component {
okText: '我知道了', okText: '我知道了',
}); });
}); });
} };
render() { render() {
const columns = [ const columns = [
{ {
title: "观看者姓名", title: '观看者姓名',
dataIndex: "userName", dataIndex: 'userName',
}, },
{ {
title: "观看者手机号", title: '观看者手机号',
dataIndex: "phone", dataIndex: 'phone',
render: (text, record) => { render: (text, record) => {
return ( return (
<p> <p>
{!( {!((!window.NewVersion && !window.currentUserInstInfo.teacherId) || (window.NewVersion && Permission.hasEduStudentPhone()))
(!window.NewVersion && !window.currentUserInstInfo.teacherId) || ? (text || '').replace(/(\d{3})(\d{4})(\d{4})/, '$1****$3')
(window.NewVersion && Permission.hasEduStudentPhone())
)
? (text || "").replace(/(\d{3})(\d{4})(\d{4})/, "$1****$3")
: text} : text}
</p> </p>
); );
}, },
}, },
{ {
title: "观看者类型", title: '观看者类型',
dataIndex: "liveRole", dataIndex: 'liveRole',
key: "liveRole", key: 'liveRole',
render: (text) => <span>{liveTypeMap[text]}</span>, render: (text) => <span>{liveTypeMap[text]}</span>,
}, },
{ {
title: "开始观看时间", title: '开始观看时间',
dataIndex: "entryTime", dataIndex: 'entryTime',
key: "entryTime", key: 'entryTime',
render: (text) => ( render: (text) => <span>{text ? formatDate('YYYY-MM-DD H:i', parseInt(text)) : '-'}</span>,
<span>{text ? formatDate("YYYY-MM-DD H:i", parseInt(text)) : '-'}</span>
),
}, },
{ {
title: "观看时长", title: '观看时长',
dataIndex: "lookingDuration", dataIndex: 'lookingDuration',
key: "lookingDuration", key: 'lookingDuration',
render: (text) => { render: (text) => {
return <span>{text ? dealTimeDuration(text) : '-'}</span>; return <span>{text ? dealTimeDuration(text) : '-'}</span>;
}, },
}, },
]; ];
const { const { query, total, playBackList, totalWatchNum, recordDuration } = this.state;
query,
total,
playBackList,
totalWatchNum,
recordDuration,
} = this.state;
const { type } = this.props; const { type } = this.props;
return ( return (
<Modal <Modal
title="回放记录" title='回放记录'
className="play-back-modal" className='play-back-modal'
width={680} width={680}
visible={true} visible={true}
maskClosable={false} maskClosable={false}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}
footer={null} footer={null}
onCancel={() => { onCancel={() => {
this.props.close(); this.props.close();
}} }}>
> {hasExportPermission(type) && (
{ <Button
hasExportPermission(type) && onClick={_.debounce(
<Button onClick={_.debounce(() => { () => {
if (!playBackList.length) { if (!playBackList.length) {
message.warning('暂无数据可导出'); message.warning('暂无数据可导出');
return; return;
...@@ -197,17 +186,26 @@ class PlayBackRecordModal extends React.Component { ...@@ -197,17 +186,26 @@ class PlayBackRecordModal extends React.Component {
} else { } else {
this.handleExport(); this.handleExport();
} }
}, 500, true)}>导出</Button> },
} 500,
<Table true
size="small" )}>
导出
</Button>
)}
<XMTable
renderEmpty={{
image: college,
description: '暂无数据',
}}
size='small'
columns={columns} columns={columns}
dataSource={playBackList} dataSource={playBackList}
pagination={false} pagination={false}
className="table-no-scrollbar" className='table-no-scrollbar'
/> />
<PageControl <PageControl
size="small" size='small'
current={query.current - 1} current={query.current - 1}
pageSize={query.size} pageSize={query.size}
total={total} total={total}
......
...@@ -6,67 +6,67 @@ ...@@ -6,67 +6,67 @@
* @Description: 大班直播分享弹窗 * @Description: 大班直播分享弹窗
*/ */
import React from 'react' import React from 'react';
import { Modal, Button, message } from 'antd' import { Modal, Button, message } from 'antd';
import domtoimage from 'dom-to-image' import domtoimage from 'dom-to-image';
import qrcode from '@/libs/qrcode/qrcode.js' import qrcode from '@/libs/qrcode/qrcode.js';
import User from '@/common/js/user' import User from '@/common/js/user';
import $ from 'jquery' import $ from 'jquery';
import _ from 'underscore' import _ from 'underscore';
import CourseService from '@/domains/course-domain/CourseService' import CourseService from '@/domains/course-domain/CourseService';
import './ShareLiveModal.less' import './ShareLiveModal.less';
class ShareLiveModal extends React.Component { class ShareLiveModal extends React.Component {
constructor(props) { constructor(props) {
super(props) super(props);
this.state = { this.state = {
shareUrl: 'https://xiaomai5.com/liveShare?courseId=12', shareUrl: 'https://xiaomai5.com/liveShare?courseId=12',
} };
} }
componentDidMount() { componentDidMount() {
// 获取短链接 // 获取短链接
this.handleConvertShortUrl() this.handleConvertShortUrl();
} }
handleConvertShortUrl = () => { handleConvertShortUrl = () => {
const { longUrl } = this.props.data const { longUrl } = this.props.data;
// 发请求 // 发请求
CourseService.getQrcode({ CourseService.getQrcode({
urls: [longUrl], urls: [longUrl],
}).then((res) => { }).then((res) => {
const { result = [] } = res const { result = [] } = res;
this.setState( this.setState(
{ {
shareUrl: result[0].shortUrl, shareUrl: result[0].shortUrl,
}, },
() => { () => {
const qrcodeWrapDom = document.querySelector('#qrcodeWrap') const qrcodeWrapDom = document.querySelector('#qrcodeWrap');
const qrcodeNode = new qrcode({ const qrcodeNode = new qrcode({
text: this.state.shareUrl, text: this.state.shareUrl,
size: 98, size: 98,
}) });
qrcodeWrapDom.appendChild(qrcodeNode) qrcodeWrapDom.appendChild(qrcodeNode);
const qrcodeWrapDomDownload = document.querySelector('#qrcodeWrap-dowload') const qrcodeWrapDomDownload = document.querySelector('#qrcodeWrap-dowload');
const qrcodeNodeDownLoad = new qrcode({ const qrcodeNodeDownLoad = new qrcode({
text: this.state.shareUrl, text: this.state.shareUrl,
size: 196, size: 196,
}) });
qrcodeWrapDomDownload.appendChild(qrcodeNodeDownLoad) qrcodeWrapDomDownload.appendChild(qrcodeNodeDownLoad);
}
)
})
} }
);
});
};
componentWillUnmount() { componentWillUnmount() {
// 页面销毁之前清空定时器 // 页面销毁之前清空定时器
clearTimeout(this.timer) clearTimeout(this.timer);
} }
// 下载海报 // 下载海报
...@@ -79,47 +79,48 @@ class ShareLiveModal extends React.Component { ...@@ -79,47 +79,48 @@ class ShareLiveModal extends React.Component {
() => { () => {
this.setState({ time: new Date().valueOf() }, () => { this.setState({ time: new Date().valueOf() }, () => {
setTimeout(() => { setTimeout(() => {
let node = document.getElementById('poster-dowload') 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();
}) });
}, 1000) }, 1000);
}) });
}
)
} }
);
};
// 复制分享链接 // 复制分享链接
handleCopy = () => { handleCopy = () => {
const textContent = document.getElementById('shareUrl').innerText const textContent = document.getElementById('shareUrl').innerText;
window.copyText(textContent) window.copyText(textContent);
message.success('复制成功!') message.success('复制成功!');
} };
render() { render() {
const { courseDivision, data, type, title } = this.props const { courseDivision, data, type, title } = this.props;
const { courseName, scheduleVideoUrl, courseMediaVOS, coverUrl } = data const { courseName, scheduleVideoUrl, courseMediaVOS, coverUrl } = data;
const { shareUrl, showImg, time } = this.state const { shareUrl, showImg, time } = this.state;
// 判断是否是默认图, 默认图不需要在URL后面增加字符串 // 判断是否是默认图, 默认图不需要在URL后面增加字符串
let coverImgSrc = ''; let coverImgSrc = '';
switch (type) { switch (type) {
case 'liveClass': // 直播课 case 'liveClass': // 直播课
if (courseMediaVOS && courseMediaVOS.length > 0) { if (courseMediaVOS && courseMediaVOS.length > 0) {
data.courseMediaVOS.map((item, index) => { const coverItem = courseMediaVOS.filter((item) => item.contentType === 'COVER');
if (item.contentType === 'COVER') { coverImgSrc = coverItem.length === 0 ? 'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png' : coverItem[0].mediaUrl;
coverImgSrc = item.mediaUrl
}
})
} else { } else {
coverImgSrc = 'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png'; coverImgSrc = 'https://image.xiaomaiketang.com/xm/Yip2YtFDwH.png';
} }
break; break;
case 'videoClass': // 视频课 case 'videoClass': // 视频课
coverImgSrc = coverUrl || (courseDivision === 'internal' ? `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring` : 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png') coverImgSrc =
coverUrl ||
(courseDivision === 'internal'
? `${scheduleVideoUrl}?x-oss-process=video/snapshot,t_0,m_fast&anystring=anystring`
: 'https://image.xiaomaiketang.com/xm/mt3ZQRxGKB.png');
break; break;
case 'graphicsClass': // 图文课 case 'graphicsClass': // 图文课
coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png'; coverImgSrc = coverUrl || 'https://image.xiaomaiketang.com/xm/wFnpZtp2yB.png';
...@@ -214,8 +215,8 @@ class ShareLiveModal extends React.Component { ...@@ -214,8 +215,8 @@ class ShareLiveModal extends React.Component {
</div> </div>
</div> </div>
</Modal> </Modal>
) );
} }
} }
export default ShareLiveModal export default ShareLiveModal;
...@@ -386,6 +386,15 @@ class AddOfflineCourse extends React.Component { ...@@ -386,6 +386,15 @@ class AddOfflineCourse extends React.Component {
} }
preSubmit = () => { preSubmit = () => {
//过期判断
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
return
}
const { courseId } = this.state; const { courseId } = this.state;
if (courseId) { if (courseId) {
this.checkDetail(courseId).then(bool => bool ? this.handleSubmit() : message.warning('课程已开始,无法继续编辑')) this.checkDetail(courseId).then(bool => bool ? this.handleSubmit() : message.warning('课程已开始,无法继续编辑'))
......
...@@ -13,7 +13,7 @@ import { Button, Input, Radio, message, Modal, Cascader } from 'antd' ...@@ -13,7 +13,7 @@ import { Button, Input, Radio, message, Modal, Cascader } from 'antd'
import { DISK_MAP, FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum' import { DISK_MAP, FileTypeIcon, FileVerifyMap } from '@/common/constants/academic/lessonEnum'
import ShowTips from '@/components/ShowTips' import ShowTips from '@/components/ShowTips'
import Breadcrumbs from '@/components/Breadcrumbs' import Breadcrumbs from '@/components/Breadcrumbs'
import moment from 'moment'
import AddVideoIntro from './components/AddVideoIntro' import AddVideoIntro from './components/AddVideoIntro'
import SelectStudent from '../modal/select-student' import SelectStudent from '../modal/select-student'
import SelectPrepareFileModal from '../../prepare-lesson/modal/SelectPrepareFileModal' import SelectPrepareFileModal from '../../prepare-lesson/modal/SelectPrepareFileModal'
...@@ -320,6 +320,15 @@ class AddVideoCourse extends React.Component { ...@@ -320,6 +320,15 @@ class AddVideoCourse extends React.Component {
// 保存 // 保存
handleSubmit = () => { handleSubmit = () => {
//过期判断
if (User.getExpirationTime() && moment().valueOf() > Number(User.getExpirationTime())) {
Modal.warning({
title:"服务已到期",
content: "当前企业购买的小麦企学院服务已到期,如需继续使用学院功能,请尽快续费购买",
okText: "我知道了"
})
return
}
const { instId, adminId } = window.currentUserInstInfo const { instId, adminId } = window.currentUserInstInfo
const { const {
......
...@@ -5,80 +5,86 @@ ...@@ -5,80 +5,86 @@
* @Last Modified time: 2020-05-25 16:50:47 * @Last Modified time: 2020-05-25 16:50:47
* @Description 余额异常弹窗 * @Description 余额异常弹窗
*/ */
import User from '@/common/js/user';
import { PageControl, XMTable } from '@/components';
import CourseService from '@/domains/course-domain/CourseService';
import { Input, Modal } from 'antd';
import college from '@/common/lottie/college';
import React from 'react'; import React from 'react';
import {Table, Modal,Input} from 'antd'; import dealTimeDuration from '../../utils/dealTimeDuration';
import { PageControl } from "@/components";
import CourseService from "@/domains/course-domain/CourseService";
import User from '@/common/js/user'
import './WatchDataModal.less'; import './WatchDataModal.less';
import dealTimeDuration from "../../utils/dealTimeDuration";
const { Search } = Input; const { Search } = Input;
class WatchDataModal extends React.Component { class WatchDataModal extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
visible:true, visible: true,
dataSource:[], dataSource: [],
size:10, size: 10,
query: { query: {
current: 1, current: 1,
}, },
totalCount:0 totalCount: 0,
}; };
} }
componentDidMount() { componentDidMount() {
this.handleFetchDataList(); this.handleFetchDataList();
} }
onClose = () =>{ onClose = () => {
this.props.close(); this.props.close();
} };
// 获取观看视频数据列表 // 获取观看视频数据列表
handleFetchDataList = () => { handleFetchDataList = () => {
const {query,size,totalCount} = this.state const { query, size, totalCount } = this.state;
const { id } = this.props.data; const { id } = this.props.data;
const params ={ const params = {
...query, ...query,
size, size,
courseId:id, courseId: id,
storeId:User.getStoreId() storeId: User.getStoreId(),
} };
CourseService.videoWatchInfo(params).then((res) => { CourseService.videoWatchInfo(params).then((res) => {
const { result = {} } = res ; const { result = {} } = res;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
this.setState({ this.setState({
dataSource: records, dataSource: records,
totalCount: Number(total) totalCount: Number(total),
}); });
}); });
} };
handleChangNickname = (value)=>{ handleChangNickname = (value) => {
const isPhone = (value || '').match(/^\d+$/); const isPhone = (value || '').match(/^\d+$/);
const { query } = this.state; const { query } = this.state;
if(isPhone){ if (isPhone) {
query.phone = value; query.phone = value;
query.nickName = null; query.nickName = null;
}else{ } else {
query.nickName = value; query.nickName = value;
query.phone = null; query.phone = null;
} }
query.current = 1; query.current = 1;
this.setState({ this.setState({
query query,
}) });
} };
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return return;
} }
this.setState({ this.setState(
size {
},()=>{this.handleFetchDataList()}) size,
},
() => {
this.handleFetchDataList();
} }
);
};
// 请求表头 // 请求表头
parseColumns = () => { parseColumns = () => {
...@@ -86,83 +92,101 @@ class WatchDataModal extends React.Component { ...@@ -86,83 +92,101 @@ class WatchDataModal extends React.Component {
{ {
title: '观看学员', title: '观看学员',
key: 'name', key: 'name',
dataIndex: 'name' dataIndex: 'name',
}, },
{ {
title: '手机号', title: '手机号',
key: 'phone', key: 'phone',
dataIndex: 'phone' dataIndex: 'phone',
}, },
{ {
title: '观看者类型', title: '观看者类型',
key: 'userRole', key: 'userRole',
dataIndex: 'userRole' dataIndex: 'userRole',
}, },
{ {
title: '首次观看时间', title: '首次观看时间',
key: 'firstWatch', key: 'firstWatch',
dataIndex: 'firstWatch', dataIndex: 'firstWatch',
render: (val) => { render: (val) => {
return formatDate('YYYY-MM-DD H:i', val) return formatDate('YYYY-MM-DD H:i', val);
} },
}, },
{ {
title: '观看时长', title: '观看时长',
key: 'watchDuration', key: 'watchDuration',
dataIndex: 'watchDuration', dataIndex: 'watchDuration',
render: (val) => { render: (val) => {
return <span>{val ? dealTimeDuration(val) : "00:00:00" }</span> return <span>{val ? dealTimeDuration(val) : '00:00:00'}</span>;
} },
} },
]; ];
return columns; return columns;
} };
render() { render() {
const { visible,size,dataSource,totalCount,query} = this.state; const { visible, size, dataSource, totalCount, query } = this.state;
return ( return (
<Modal <Modal
title="视频课观看数据" title='视频课观看数据'
visible={visible} visible={visible}
footer={null} footer={null}
onCancel={this.onClose} onCancel={this.onClose}
maskClosable={false} maskClosable={false}
className="watch-data-modal" className='watch-data-modal'
closable={true} closable={true}
width={800} width={800}
closeIcon={<span className="icon iconfont modal-close-icon">&#xe6ef;</span>} closeIcon={<span className='icon iconfont modal-close-icon'>&#xe6ef;</span>}>
> <div className='search-container'>
<div className="search-container"> <Search
<Search placeholder="搜索学员姓名/手机号" style={{ width: 200 }} onChange={(e) => { this.handleChangNickname(e.target.value)}} onSearch={ () => { this.handleFetchDataList()}} enterButton={<span className="icon iconfont">&#xe832;</span>}/> placeholder='搜索学员姓名/手机号'
style={{ width: 200 }}
onChange={(e) => {
this.handleChangNickname(e.target.value);
}}
onSearch={() => {
this.handleFetchDataList();
}}
enterButton={<span className='icon iconfont'>&#xe832;</span>}
/>
</div> </div>
<div> <div>
<Table <XMTable
rowKey={record => record.id} renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.id}
dataSource={dataSource} dataSource={dataSource}
columns={this.parseColumns()} columns={this.parseColumns()}
pagination={false} pagination={false}
bordered bordered
/> />
{dataSource.length >0 && {dataSource.length > 0 && (
<div className="box-footer"> <div className='box-footer'>
<PageControl <PageControl
current={query.current - 1} current={query.current - 1}
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
size="small" size='small'
toPage={(page) => { toPage={(page) => {
const _query = {...query, current: page + 1}; const _query = { ...query, current: page + 1 };
this.setState({ this.setState(
query:_query {
},()=>{ this.handleFetchDataList()}) query: _query,
},
() => {
this.handleFetchDataList();
}
);
}} }}
onShowSizeChange={this.onShowSizeChange} onShowSizeChange={this.onShowSizeChange}
/> />
</div> </div>
} )}
</div> </div>
</Modal> </Modal>
) );
} }
} }
......
...@@ -2,34 +2,35 @@ ...@@ -2,34 +2,35 @@
// padding: 0 16px 16px; // padding: 0 16px 16px;
min-width: 1100px; min-width: 1100px;
position: relative; position: relative;
z-index:3; z-index: 3;
.g2-tooltip-marker { .g2-tooltip-marker {
border-radius: 50% !important; border-radius: 50% !important;
} }
.home-title { .home-title {
color: #333; color: #333;
padding-left:28px; padding-left: 28px;
font-size:16px; font-size: 16px;
font-weight:bold; font-weight: bold;
position: relative; position: relative;
padding-top:16px; padding-top: 16px;
&::before{ &::before {
width:4px; width: 4px;
height:12px; height: 12px;
content:''; content: '';
background-image: linear-gradient(#2966FF 83.5%, #0ACCA4 16.5%); background-image: linear-gradient(#2966ff 83.5%, #0acca4 16.5%);
display:inline-block; display: inline-block;
position: absolute; position: absolute;
left:16px; left: 16px;
top:22px; top: 22px;
} }
} }
@font-face { @font-face {
font-family: 'number'; font-family: 'number';
src: url('https://image.xiaomaiketang.com/xm/n2sADd2jY6.TTF'); src: url('https://image.xiaomaiketang.com/xm/n2sADd2jY6.TTF');
} }
.data-wrap{ .data-wrap {
background: #FFF; background: #fff;
padding-bottom: 25px;
.data-box { .data-box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
width: ~'calc(16.67% - 8px)'; width: ~'calc(16.67% - 8px)';
padding: 16px; padding: 16px;
&.course-data { &.course-data {
width: ~'calc(50% - 24px)'; width: 33%;
} }
.header { .header {
display: flex; display: flex;
...@@ -55,7 +56,7 @@ ...@@ -55,7 +56,7 @@
font-size: 14px; font-size: 14px;
line-height: 18px; line-height: 18px;
color: #333; color: #333;
font-weight:500; font-weight: 500;
} }
} }
.data-number { .data-number {
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
.iconfont { .iconfont {
font-size: 12px; font-size: 12px;
margin-right: 4px; margin-right: 4px;
color: #EC4B35; color: #ec4b35;
} }
.footer-number { .footer-number {
font-size: 12px; font-size: 12px;
...@@ -83,17 +84,17 @@ ...@@ -83,17 +84,17 @@
} }
.course-box { .course-box {
border-radius: 4px; border-radius: 4px;
background: #FAFAFA; background: #fafafa;
height: 124px; height: 124px;
width: 66%; width: 60%;
position: absolute; position: absolute;
right: 16px; right: 16px;
top: 16px; top: 28px;
padding: 8px 24px 0; padding: 8px 0 0;
.course-item { .course-item {
display: inline-block; display: inline-block;
width: 50%; width: 50%;
padding: 4px 0 12px; padding: 4px 24px 12px;
.course-title { .course-title {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
...@@ -105,6 +106,7 @@ ...@@ -105,6 +106,7 @@
font-size: 16px; font-size: 16px;
font-family: 'number'; font-family: 'number';
margin-right: 16px; margin-right: 16px;
white-space: nowrap;
} }
.course-word { .course-word {
font-size: 12px; font-size: 12px;
...@@ -114,11 +116,12 @@ ...@@ -114,11 +116,12 @@
.iconfont { .iconfont {
font-size: 12px; font-size: 12px;
margin-right: 4px; margin-right: 4px;
color: #EC4B35; color: #ec4b35;
} }
.add-number { .add-number {
font-size: 12px; font-size: 12px;
color: #999; color: #999;
white-space: nowrap;
} }
} }
} }
...@@ -126,9 +129,9 @@ ...@@ -126,9 +129,9 @@
} }
} }
} }
.study-wrap{ .study-wrap {
background: #FFF; background: #fff;
margin-top:16px; margin-top: 16px;
.study-box { .study-box {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
...@@ -148,7 +151,7 @@ ...@@ -148,7 +151,7 @@
margin-bottom: 12px; margin-bottom: 12px;
.iconfont { .iconfont {
font-size: 14px; font-size: 14px;
color: #BFBFBF; color: #bfbfbf;
margin-left: 4px; margin-left: 4px;
} }
.tip { .tip {
...@@ -169,13 +172,13 @@ ...@@ -169,13 +172,13 @@
color: #666; color: #666;
cursor: pointer; cursor: pointer;
&.selected { &.selected {
color: #2966FF; color: #2966ff;
&::after { &::after {
position: absolute; position: absolute;
width: 24px; width: 24px;
height: 2px; height: 2px;
content: ''; content: '';
background: #2966FF; background: #2966ff;
border-radius: 1px; border-radius: 1px;
left: 9px; left: 9px;
bottom: -4px; bottom: -4px;
...@@ -196,7 +199,7 @@ ...@@ -196,7 +199,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
&.odd { &.odd {
background: #FAFAFA; background: #fafafa;
} }
.table-image { .table-image {
width: 24px; width: 24px;
...@@ -257,7 +260,7 @@ ...@@ -257,7 +260,7 @@
width: 204px; width: 204px;
height: 204px; height: 204px;
border-radius: 102px; border-radius: 102px;
background: #F1F3F6; background: #f1f3f6;
margin-top: -20px; margin-top: -20px;
.small-circle { .small-circle {
display: flex; display: flex;
...@@ -280,13 +283,13 @@ ...@@ -280,13 +283,13 @@
&.unfinished { &.unfinished {
top: 152px; top: 152px;
.spot { .spot {
background: #2966FF; background: #2966ff;
} }
} }
&.finished { &.finished {
top: 232px; top: 232px;
.spot { .spot {
background: #FFBB54; background: #ffbb54;
} }
} }
.spot { .spot {
...@@ -352,14 +355,14 @@ ...@@ -352,14 +355,14 @@
align-items: center; align-items: center;
color: #666; color: #666;
.student-dot { .student-dot {
background: #2966FF; background: #2966ff;
height: 8px; height: 8px;
width: 8px; width: 8px;
border-radius: 50%; border-radius: 50%;
margin-right: 8px; margin-right: 8px;
} }
.time-dot { .time-dot {
background: #FEB613; background: #feb613;
height: 8px; height: 8px;
width: 8px; width: 8px;
border-radius: 50%; border-radius: 50%;
...@@ -382,7 +385,8 @@ ...@@ -382,7 +385,8 @@
font-size: 14px; font-size: 14px;
} }
.g2-tooltip-list { .g2-tooltip-list {
li,span { li,
span {
display: flex; display: flex;
align-items: center; align-items: center;
font-size: 14px; font-size: 14px;
......
.home-tip {
.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;
margin-left: 8px;
}
}
}
}
\ No newline at end of file
import React, { useContext, useEffect, useState, version } from "react";
import "./HomeTip.less"
import { VersionContext } from "@/store/context";
import ContactWidget from '@/components/ContactWidget';
import { Carousel } from "antd";
import moment from "moment";
export default function HomeTip() {
const [isOverNum, setIsOverNum] = useState<boolean>(false)
const [tipType, setTipType] = useState(0) //0不显示1即将过期2已过期
const [expirationTime, setExpirationTime] = useState("")
const [surplusDay, setSurplusDay] = useState(0)
const versionInfo = useContext(VersionContext)
useEffect(()=> {
if (versionInfo) {
setIsOverNum(versionInfo.userNum === -1 ? false : versionInfo.whetherReachUserNum)
setSurplusDay(versionInfo.surplusDayTime)
setExpirationTime(versionInfo.validEndTime)
if (versionInfo.stateEnum === "NO") {
setTipType(2)
} else if (versionInfo.surplusDayTime === 30 || versionInfo.surplusDayTime <= 7) {
setTipType(1)
}
}
},[versionInfo])
return (
<div className="home-tip">
{
(isOverNum || tipType !== 0) &&
<div className="tip">
<Carousel dotPosition="left" dots={false} autoplay={true} autoplaySpeed={5000}>
{
isOverNum && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>温馨提示:企业使用人数已达上限,将无法新增员工、学员,如需增加人数限制,请联系小麦企学院服务平台。
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
}
{
tipType === 2 && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>版本到期提醒:当前企业购买的小麦企学院服务已于{moment(versionInfo?.validEndTimeST).format("YYYY-MM-DD HH:mm:ss")}到期,到期后仍可访问,但功能不可使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
}
{
tipType === 1 && (
<div className="content">
<span className="icon iconfont" style={{color:"#FF4F4F",marginRight:"8px"}}>&#xe61d;</span>当前企业购买的小麦企学院服务仅剩{surplusDay}天(于{expirationTime}到期),为了不影响使用,建议尽快续费购买哦~
<ContactWidget placement="bottom" trigger="hover"><div className="renew-btn">立即续费</div></ContactWidget>
</div>
)
}
</Carousel>
</div>
}
</div>
)
}
\ No newline at end of file
import React from 'react'; import React from 'react';
import { withRouter } from "react-router-dom"; import { withRouter } from 'react-router-dom';
import {Table, Modal,Input,message} from 'antd'; import { Input } from 'antd';
import { PageControl } from "@/components"; import { PageControl, XMTable } from '@/components';
import PlanService from '@/domains/plan-domain/planService' import college from '@/common/lottie/college';
import PlanService from '@/domains/plan-domain/planService';
import User from '@/common/js/user'; import User from '@/common/js/user';
import Bus from '@/core/bus'; import Bus from '@/core/bus';
import './EmployeeShareData.less'; import './EmployeeShareData.less';
...@@ -10,103 +11,129 @@ import './EmployeeShareData.less'; ...@@ -10,103 +11,129 @@ import './EmployeeShareData.less';
const { Search } = Input; const { Search } = Input;
const UserRole = { const UserRole = {
Store_Manager: { Store_Manager: {
text: "学院管理员" text: '学院管理员',
}, },
Cloud_Manager: { Cloud_Manager: {
text:"管理员" text: '管理员',
}, },
Cloud_Operator: { Cloud_Operator: {
text:'运营师' text: '运营师',
}, },
Cloud_Lecture: { Cloud_Lecture: {
text:"讲师" text: '讲师',
}, },
}; };
class EmployeeShareData extends React.Component { class EmployeeShareData extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const id = getParameterByName("id"); const id = getParameterByName('id');
this.state = { this.state = {
id, id,
dataSource:[], dataSource: [],
size:10, size: 10,
query: { query: {
current: 1, current: 1,
}, },
totalCount:0, totalCount: 0,
} };
} }
componentDidMount(){ componentDidMount() {
this.handleFetchDataList(); this.handleFetchDataList();
} }
handleFetchDataList = ()=>{ handleFetchDataList = () => {
const { query ,size,id} = this.state; const { query, size, id } = this.state;
const params ={ const params = {
...query, ...query,
size, size,
planId:id, planId: id,
storeId:User.getStoreId(), storeId: User.getStoreId(),
} };
PlanService.getPlanUserRecordPage(params).then((res) => { PlanService.getPlanUserRecordPage(params).then((res) => {
const { result = {} } = res ; const { result = {} } = res;
const { records = [], total = 0 } = result; const { records = [], total = 0 } = result;
this.setState({ this.setState({
dataSource: records, dataSource: records,
totalCount: Number(total) totalCount: Number(total),
}); });
}); });
} };
onShowSizeChange = (current, size) => { onShowSizeChange = (current, size) => {
if (current == size) { if (current == size) {
return return;
} }
this.setState({ this.setState(
size {
},()=>{this.handleFetchDataList()}) size,
},
() => {
this.handleFetchDataList();
} }
handleChangeTable = (pagination, filters, sorter)=> { );
};
handleChangeTable = (pagination, filters, sorter) => {
const { columnKey, order } = sorter; const { columnKey, order } = sorter;
const { query } = this.state; const { query } = this.state;
let _columnKey; let _columnKey;
let _order; let _order;
if (columnKey === 'learnNum' && order === 'ascend') { _columnKey="LEARN_NUM"; _order = 'SORT_ASC'; } if (columnKey === 'learnNum' && order === 'ascend') {
if (columnKey === 'learnNum' && order === 'descend') { _columnKey="LEARN_NUM"; _order = 'SORT_DESC'; } _columnKey = 'LEARN_NUM';
_order = 'SORT_ASC';
}
if (columnKey === 'learnNum' && order === 'descend') {
_columnKey = 'LEARN_NUM';
_order = 'SORT_DESC';
}
if (columnKey === 'learnFinishNum' && order === 'ascend') { _columnKey="FINISH_NUM"; _order = 'SORT_ASC'; } if (columnKey === 'learnFinishNum' && order === 'ascend') {
if (columnKey === 'learnFinishNum' && order === 'descend') { _columnKey="FINISH_NUM"; _order = 'SORT_DESC'; } _columnKey = 'FINISH_NUM';
_order = 'SORT_ASC';
}
if (columnKey === 'learnFinishNum' && order === 'descend') {
_columnKey = 'FINISH_NUM';
_order = 'SORT_DESC';
}
if (columnKey === 'learnNoFinishNum' && order === 'ascend') { _columnKey="NOT_NUM"; _order = 'SORT_ASC'; } if (columnKey === 'learnNoFinishNum' && order === 'ascend') {
if (columnKey === 'learnNoFinishNum' && order === 'descend') { _columnKey="NOT_NUM"; _order = 'SORT_DESC'; } _columnKey = 'NOT_NUM';
_order = 'SORT_ASC';
}
if (columnKey === 'learnNoFinishNum' && order === 'descend') {
_columnKey = 'NOT_NUM';
_order = 'SORT_DESC';
}
const _query = { const _query = {
...query, ...query,
sortMap:{} sortMap: {},
}; };
_query.sortMap[_columnKey]=_order; _query.sortMap[_columnKey] = _order;
this.setState({ this.setState(
query:_query {
},()=>this.handleFetchDataList()) query: _query,
} },
handleChangNickname = (value)=>{ () => this.handleFetchDataList()
);
};
handleChangNickname = (value) => {
const isPhone = (value || '').match(/^\d+$/); const isPhone = (value || '').match(/^\d+$/);
const { query } = this.state; const { query } = this.state;
if(isPhone){ if (isPhone) {
query.userPhone = value; query.userPhone = value;
query.userName = null; query.userName = null;
}else{ } else {
query.userName = value; query.userName = value;
query.userPhone = null; query.userPhone = null;
} }
query.current = 1; query.current = 1;
this.setState({ this.setState({
query query,
}) });
} };
watchDataView = (record)=>{ watchDataView = (record) => {
Bus.trigger('watchDataView',record); Bus.trigger('watchDataView', record);
} };
// 请求表头 // 请求表头
parselumns = () => { parselumns = () => {
const columns = [ const columns = [
...@@ -115,24 +142,16 @@ class EmployeeShareData extends React.Component { ...@@ -115,24 +142,16 @@ class EmployeeShareData extends React.Component {
key: 'storeUserName', key: 'storeUserName',
dataIndex: 'storeUserName', dataIndex: 'storeUserName',
render: (val, record) => { render: (val, record) => {
return ( return <div>{val}</div>;
<div> },
{val}
</div>
)
}
}, },
{ {
title: '角色', title: '角色',
key: 'roleEnum', key: 'roleEnum',
dataIndex: 'roleEnum', dataIndex: 'roleEnum',
render: (val, record) => { render: (val, record) => {
return ( return <div>{UserRole[record.roleEnum].text}</div>;
<div> },
{UserRole[record.roleEnum].text}
</div>
)
}
}, },
//产品暂时性隐藏 //产品暂时性隐藏
// { // {
...@@ -151,28 +170,20 @@ class EmployeeShareData extends React.Component { ...@@ -151,28 +170,20 @@ class EmployeeShareData extends React.Component {
title: '最近分享成功时间', title: '最近分享成功时间',
key: 'recentlyForwardTime', key: 'recentlyForwardTime',
dataIndex: 'recentlyForwardTime', dataIndex: 'recentlyForwardTime',
width:240, width: 240,
render: (val, record) => { render: (val, record) => {
return ( return <div>{formatDate('YYYY-MM-DD H:i', val)}</div>;
<div> },
{formatDate('YYYY-MM-DD H:i', val)}
</div>
)
}
}, },
{ {
title: '学习人数', title: '学习人数',
key: 'learnNum', key: 'learnNum',
dataIndex: 'learnNum', dataIndex: 'learnNum',
width:110, width: 110,
sorter:true, sorter: true,
render: (val, record) => { render: (val, record) => {
return ( return <div className='learn-num'>{val}</div>;
<div className="learn-num"> },
{val}
</div>
)
}
}, },
// { // {
// title: '已学完', // title: '已学完',
...@@ -208,24 +219,39 @@ class EmployeeShareData extends React.Component { ...@@ -208,24 +219,39 @@ class EmployeeShareData extends React.Component {
dataIndex: 'operate', dataIndex: 'operate',
render: (val, record) => { render: (val, record) => {
return ( return (
<span className="operate-item" onClick={()=>this.watchDataView(record)}>数据详情</span> <span className='operate-item' onClick={() => this.watchDataView(record)}>
) 数据详情
} </span>
} );
},
},
]; ];
return columns; return columns;
} };
render() { render() {
const { dataSource,query,size,totalCount} = this.state; const { dataSource, query, size, totalCount } = this.state;
return ( return (
<div className="employee-share-data"> <div className='employee-share-data'>
<div className="search-container"> <div className='search-container'>
<Search placeholder="搜索员工姓名或手机号" onChange={(e) => { this.handleChangNickname(e.target.value)}} onSearch={ () => { this.handleFetchDataList()}} style={{ width: 200 }} enterButton={<span className="icon iconfont">&#xe832;</span>}/> <Search
placeholder='搜索员工姓名或手机号'
onChange={(e) => {
this.handleChangNickname(e.target.value);
}}
onSearch={() => {
this.handleFetchDataList();
}}
style={{ width: 200 }}
enterButton={<span className='icon iconfont'>&#xe832;</span>}
/>
</div> </div>
<div> <div>
<Table <XMTable
rowKey={record => record.id} renderEmpty={{
image: college,
description: '暂无数据',
}}
rowKey={(record) => record.id}
dataSource={dataSource} dataSource={dataSource}
columns={this.parselumns()} columns={this.parselumns()}
pagination={false} pagination={false}
...@@ -233,25 +259,30 @@ class EmployeeShareData extends React.Component { ...@@ -233,25 +259,30 @@ class EmployeeShareData extends React.Component {
showSorterTooltip={false} showSorterTooltip={false}
bordered bordered
/> />
{dataSource.length >0 && {dataSource.length > 0 && (
<div className="box-footer"> <div className='box-footer'>
<PageControl <PageControl
current={query.current - 1} current={query.current - 1}
pageSize={size} pageSize={size}
total={totalCount} total={totalCount}
toPage={(page) => { toPage={(page) => {
const _query = {...query, current: page + 1}; const _query = { ...query, current: page + 1 };
this.setState({ this.setState(
query:_query {
},()=>{ this.handleFetchDataList()}) query: _query,
},
() => {
this.handleFetchDataList();
}
);
}} }}
onShowSizeChange={this.onShowSizeChange} onShowSizeChange={this.onShowSizeChange}
/> />
</div> </div>
} )}
</div> </div>
</div> </div>
) );
} }
} }
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
*/ */
import React, { useState } from 'react'; import React, { useState } from 'react';
import { Table, Modal, message, Tooltip, Switch, Dropdown } from 'antd'; import { 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';
...@@ -29,6 +29,7 @@ function PlanList(props) { ...@@ -29,6 +29,7 @@ function PlanList(props) {
key: 'planName', key: 'planName',
dataIndex: 'planName', dataIndex: 'planName',
width: '18%', width: '18%',
fixed: 'left',
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='plan_name_item'> <div className='plan_name_item'>
...@@ -86,7 +87,7 @@ function PlanList(props) { ...@@ -86,7 +87,7 @@ function PlanList(props) {
dataIndex: 'created', dataIndex: 'created',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val); return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>;
}, },
}, },
{ {
...@@ -96,12 +97,12 @@ function PlanList(props) { ...@@ -96,12 +97,12 @@ function PlanList(props) {
dataIndex: 'updated', dataIndex: 'updated',
sorter: true, sorter: true,
render: (val) => { render: (val) => {
return window.formatDate('YYYY-MM-DD H:i', val); return <span style={{ whiteSpace: 'nowrap' }}>{window.formatDate('YYYY-MM-DD H:i', val)}</span>;
}, },
}, },
{ {
title: '参培人数', title: '参培人数',
width: 76, width: '10%',
key: 'cultureCustomerNum', key: 'cultureCustomerNum',
dataIndex: 'cultureCustomerNum', dataIndex: 'cultureCustomerNum',
sorter: true, sorter: true,
...@@ -114,7 +115,7 @@ function PlanList(props) { ...@@ -114,7 +115,7 @@ function PlanList(props) {
key: 'operate', key: 'operate',
dataIndex: 'operate', dataIndex: 'operate',
fixed: 'right', fixed: 'right',
width: 176, width: '14.5%',
render: (val, record) => { render: (val, record) => {
return ( return (
<div className='operate'> <div className='operate'>
...@@ -317,7 +318,7 @@ function PlanList(props) { ...@@ -317,7 +318,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'>
......
.training-task{ .training-task {
thead{ thead {
display:none; display: none;
} }
.ant-form-item{ .ant-form-item {
margin-bottom:0 !important; margin-bottom: 0 !important;
} }
.add-task-con{ .add-task-con {
height: 52px; height: 52px;
background: #F7F8F9; background: #f7f8f9;
border-radius: 2px; border-radius: 2px;
padding:16px; padding: 16px;
margin-top:16px; margin-top: 16px;
.add-task-btn-disabled{ .add-task-btn-disabled {
color:#CCCCCC; color: #cccccc;
font-size:14px; font-size: 14px;
} }
.add-task-btn{ .add-task-btn {
color: #2966FF; color: #2966ff;
font-size:14px; font-size: 14px;
} }
} }
} }
.plan-sort-task-item{ .plan-sort-task-item {
.task-con{ .task-con {
display:flex; display: flex;
padding:16px; padding: 16px;
background: #F7F8F9; background: #f7f8f9;
border-radius: 2px; border-radius: 2px;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.task-instro{ .task-instro {
display:flex; display: flex;
align-items: center; align-items: center;
.open-icon{ .open-icon {
color:#999999; color: #999999;
font-size:10px; font-size: 10px;
} }
.task-name-con{ .task-name-con {
display:flex; display: flex;
align-items: center; align-items: center;
color:#333333; color: #333333;
font-size:14px; font-size: 14px;
.number{ .number {
margin-right:10px; margin-right: 10px;
margin-left:10px; margin-left: 10px;
} }
.task-name-input{ .task-name-input {
width: 300px; width: 300px;
height: 32px; height: 32px;
background: #FFFFFF; background: #ffffff;
border-radius: 4px; border-radius: 4px;
} }
} }
} }
.operate{ .operate {
display: none; display: none;
.operate__item{ .operate__item {
cursor:pointer; cursor: pointer;
margin-left:16px; margin-left: 16px;
color:#666666; color: #666666;
font-size:14px; font-size: 14px;
.icon{ .icon {
font-size:14px; font-size: 14px;
color:#999; color: #999;
} }
.text{ .text {
margin-left:8px; margin-left: 8px;
} }
} }
} }
&:hover{ &:hover {
.operate{ .operate {
display:block; display: block;
} }
} }
} }
.course-box{ .course-box {
.add-course-con{ .add-course-con {
padding:16px 51px; padding: 16px 51px;
color: #2966FF; color: #2966ff;
font-size:14px; font-size: 14px;
.add-course-btn-disabled{ .add-course-btn-disabled {
font-size:14px; font-size: 14px;
color:#ccc; color: #ccc;
pointer-events: none;
} }
} }
} }
} }
.plan-course-sort-item{ .plan-course-sort-item {
display:flex; display: flex;
padding:16px 16px 16px 0px; padding: 16px 16px 16px 0px;
margin-left:51px; margin-left: 51px;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
border-bottom:1px dotted #E8E8E8; border-bottom: 1px dotted #e8e8e8;
&:hover{ &:hover {
.course-operate{ .course-operate {
display:block; display: block;
} }
} }
.course-operate{ .course-operate {
display: none; display: none;
.operate__item{ .operate__item {
cursor:pointer; cursor: pointer;
margin-left:16px; margin-left: 16px;
color:#666666; color: #666666;
font-size:14px; font-size: 14px;
.icon{ .icon {
font-size:14px; font-size: 14px;
color:#999; color: #999;
} }
.text{ .text {
margin-left:8px; margin-left: 8px;
} }
} }
} }
.course-info{ .course-info {
.ant-form{ .ant-form {
display:inline-block; display: inline-block;
} }
.course-name-input{ .course-name-input {
margin-right:8px; margin-right: 8px;
} }
.course-type{ .course-type {
font-size:11px; font-size: 11px;
color:#666666; color: #666666;
padding:0px 6px; padding: 0px 6px;
border: 1px solid #999999; border: 1px solid #999999;
margin-right:4px; margin-right: 4px;
border-radius: 2px; border-radius: 2px;
line-height: 16px; line-height: 16px;
} }
.course-name{ .course-name {
color:#666666; color: #666666;
font-size:14px; font-size: 14px;
margin-right:8px; margin-right: 8px;
} }
.tip{ .tip {
font-size:14px; font-size: 14px;
color:#FF4F4F; color: #ff4f4f;
margin-right:2px; margin-right: 2px;
} }
.course-state{ .course-state {
color:#999; color: #999;
font-size:14px; font-size: 14px;
} }
} }
} }
...@@ -13,7 +13,6 @@ import { Spin, message } from 'antd'; ...@@ -13,7 +13,6 @@ import { Spin, message } from 'antd';
import User from '@/common/js/user'; import User from '@/common/js/user';
import OperateArea from './OperateArea'; import OperateArea from './OperateArea';
import FolderList from './FolderList';
import { DISK_MAP, suffixMap } from "@/common/constants/academic/lessonEnum"; import { DISK_MAP, suffixMap } from "@/common/constants/academic/lessonEnum";
...@@ -301,27 +300,6 @@ class FolderManage extends React.Component { ...@@ -301,27 +300,6 @@ class FolderManage extends React.Component {
onChangeFolderPath={this.handleChangeFolderPath} onChangeFolderPath={this.handleChangeFolderPath}
onRefresh={this.handleFetchFolderList} onRefresh={this.handleFetchFolderList}
/> />
{/* 文件夹列表 */}
<FolderList
query={query}
totalCount={totalCount}
balance={balance}
showResultPage={showResultPage}
currentRootDisk={currentRootDisk}
hasManagementAuthority={hasManagementAuthority}
folderList={folderList}
folderPathList={folderPathList}
selectedFileIds={selectedFileIds}
onChangeRow={this.handleChangeRow}
onChangeFolderPath={this.handleChangeFolderPath}
onMove={this.handleMove}
onUpload={this.handleUploadDone}
onChangePage={this.handleChangePage}
onRefresh={this.handleFetchFolderList}
/>
</div> </div>
</Spin> </Spin>
......
...@@ -21,9 +21,9 @@ import UploadProgressModal from '@/bu-components/UploadProgressModal'; ...@@ -21,9 +21,9 @@ import UploadProgressModal from '@/bu-components/UploadProgressModal';
import SelectPrepareFileModal from '@/bu-components/SelectPrepareFileModal'; import SelectPrepareFileModal from '@/bu-components/SelectPrepareFileModal';
import CopyFileModal from '@/bu-components/CopyFileModal'; import CopyFileModal from '@/bu-components/CopyFileModal';
import ManagingMembersModal from '@/bu-components/ManagingMembersModal'; import ManagingMembersModal from '@/bu-components/ManagingMembersModal';
import PreviewFileModal from '../modal/PreviewFileModal' import PreviewFileModal from '@/bu-components/PreviewFileModal';
import {YZ_APPId,YZ_PREVIEW_URL,OFFICE_PREVIEW_URL} from '@/domains/basic-domain/constants';
import BaseService from "@/domains/basic-domain/baseService";
import ScanFileModal from '../modal/ScanFileModal'; import ScanFileModal from '../modal/ScanFileModal';
import CreateFolderModal from '../modal/CreateFolderModal'; import CreateFolderModal from '../modal/CreateFolderModal';
import User from '@/common/js/user'; import User from '@/common/js/user';
...@@ -121,40 +121,6 @@ class FolderList extends React.Component { ...@@ -121,40 +121,6 @@ class FolderList extends React.Component {
break; break;
} }
} }
getYoZoSign = (data,type,folderName)=>{
return new Promise((resolve) => {
let uploadParams;
if(type==="UPLOAD"){
uploadParams ={
fileUrl:data,
instId:window.currentUserInstInfo.instId,
yoZoTypeEnum:'UPLOAD'
}
}else{
uploadParams ={
fileVersionId:data,
instId:window.currentUserInstInfo.instId,
yoZoTypeEnum:'VIEW',
htmlTitle:folderName
}
}
Service.Apollo('public/apollo/getYoZoSign', uploadParams).then(res => {
const { result = [] } = res;
resolve(result)
});
})
}
saveYoZoFileVersionId = (fileVersionId,folderId)=>{
const params ={
fileVersionId,
folderId,
instId: window.currentUserInstInfo.instId,
}
Service.Apollo('public/apollo/saveYoZoFileVersionId', params).then(res => {
});
}
// 预览文件 // 预览文件
handleScanFile = async (folder) => { handleScanFile = async (folder) => {
const { folderFormat, folderSize, ossUrl,rights,fileVersionId,id,folderName} = folder; const { folderFormat, folderSize, ossUrl,rights,fileVersionId,id,folderName} = folder;
...@@ -177,24 +143,46 @@ class FolderList extends React.Component { ...@@ -177,24 +143,46 @@ class FolderList extends React.Component {
showPreviewModal:true, showPreviewModal:true,
previewStatus:'UPLOAD' previewStatus:'UPLOAD'
},async ()=>{ },async ()=>{
const uploadSign = await that.getYoZoSign(ossUrl,"UPLOAD"); const uploadParams ={
axios.post(`https://dmc.yozocloud.cn/api/file/http?fileUrl=${ossUrl}&appId=${appId}&sign=${uploadSign}`) fileUrl:ossUrl,
.then(async function (response){ instId:User.getStoreId(),
that.saveYoZoFileVersionId(response.data.data.fileVersionId,id); yoZoTypeEnum:'UPLOAD'
}
const uploadSign = await BaseService.getYoZoSign(uploadParams);
BaseService.yoZoUpload(ossUrl,YZ_APPId,uploadSign).then(async function (response){
const saveParams ={
fileVersionId:response.data.data.fileVersionId,
folderId:id,
instId:User.getStoreId(),
}
BaseService.saveYoZoFileVersionId(saveParams);
const { previewing } = that.state; const { previewing } = that.state;
if(previewing){ if(previewing){
const previewSign = await that.getYoZoSign(response.data.data.fileVersionId,"VIEW",folderName); const previewParams ={
const url = `https://eic.yozocloud.cn/api/view/file?fileVersionId=${response.data.data.fileVersionId}&appId=${appId}&sign=${previewSign}&htmlTitle=${folderName}` fileVersionId:response.data.data.fileVersionId,
instId:User.getStoreId(),
yoZoTypeEnum:'VIEW',
htmlTitle:folderName
}
const previewSign = await BaseService.getYoZoSign(previewParams);
const url = `${YZ_PREVIEW_URL}?fileVersionId=${response.data.data.fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}`
that.setState({ that.setState({
previewStatus:'UPLOAD_SUCCESS', previewStatus:'UPLOAD_SUCCESS',
url url
}) })
} }
}) })
}) })
}else{ }else{
const previewSign = await that.getYoZoSign(fileVersionId,"VIEW",folderName); const previewParams ={
const url = `http://eic.yozocloud.cn/api/view/file?fileVersionId=${fileVersionId}&appId=${appId}&sign=${previewSign}&htmlTitle=${folderName}` fileVersionId,
instId:User.getStoreId(),
yoZoTypeEnum:'VIEW',
htmlTitle:folderName
}
const previewSign = await BaseService.getYoZoSign(previewParams);
const url = `${YZ_PREVIEW_URL}?fileVersionId=${fileVersionId}&appId=${YZ_APPId}&sign=${previewSign}&htmlTitle=${folderName}`
const a = document.createElement('a'); const a = document.createElement('a');
document.body.appendChild(a); document.body.appendChild(a);
a.setAttribute('href', url); a.setAttribute('href', url);
...@@ -234,7 +222,6 @@ class FolderList extends React.Component { ...@@ -234,7 +222,6 @@ class FolderList extends React.Component {
Modal.confirm({ Modal.confirm({
title: '抱歉,不能在线预览', title: '抱歉,不能在线预览',
content: '由于文件较大,不支持在线预览,请下载后再查看', content: '由于文件较大,不支持在线预览,请下载后再查看',
// icon: <Icon type="question-circle" theme="filled" style={{ color: '#FF8534' }}></Icon>,
okText: "下载", okText: "下载",
onOk: () => { onOk: () => {
const a = document.createElement('a'); const a = document.createElement('a');
...@@ -244,21 +231,7 @@ class FolderList extends React.Component { ...@@ -244,21 +231,7 @@ class FolderList extends React.Component {
}); });
break; break;
} }
// if (folderFormat === 'EXCEL') { const prefixUrl = `${OFFICE_PREVIEW_URL}?src=`;
// Modal.confirm({
// title: '抱歉,不能在线预览',
// content: ' 该文件类型不支持在线预览,请下载后再查看',
// // icon: <Icon type="question-circle" theme="filled" style={{ color: '#FF8534' }}></Icon>,
// okText: "下载",
// onOk: () => {
// const a = document.createElement('a');
// a.href = ossUrl;
// a.click();
// }
// });
// break;
// }
const prefixUrl = "https://view.officeapps.live.com/op/view.aspx?src=";
const scanUrl = `${prefixUrl}${encodeURIComponent(ossUrl)}` const scanUrl = `${prefixUrl}${encodeURIComponent(ossUrl)}`
window.open(scanUrl, "_blank"); window.open(scanUrl, "_blank");
break; break;
......
...@@ -14,7 +14,8 @@ import Main from './Main' ...@@ -14,7 +14,8 @@ import Main from './Main'
import zhCN from 'antd/es/locale/zh_CN' import zhCN from 'antd/es/locale/zh_CN'
import User from '@/common/js/user'; import User from '@/common/js/user';
import BaseService from "@/domains/basic-domain/baseService"; import BaseService from "@/domains/basic-domain/baseService";
import { XMContext } from '@/store/context'; import moment from 'moment';
import { VersionContext, VersionInfo, XMContext } from '@/store/context';
import { setStoreGroupPermission, setStorePermission, setStoreGroupList, setStoreList } from '@/store/actions/index'; import { setStoreGroupPermission, setStorePermission, setStoreGroupList, setStoreList } from '@/store/actions/index';
import Service from "@/common/js/service"; import Service from "@/common/js/service";
import Bus from '@/core/tbus'; import Bus from '@/core/tbus';
...@@ -27,6 +28,7 @@ declare var window: any; ...@@ -27,6 +28,7 @@ declare var window: any;
const App: React.FC = (props: any) => { const App: React.FC = (props: any) => {
const [storeUserId, setStoreUserId] = useState('') const [storeUserId, setStoreUserId] = useState('')
const ctx: any = useContext(XMContext); const ctx: any = useContext(XMContext);
const [versionInfo, setVersionInfo] = useState<VersionInfo|null>(null)
const userId = User.getUserId(); const userId = User.getUserId();
const [menuType, setMenuType] = useState(true); const [menuType, setMenuType] = useState(true);
const enterpriseId = User.getEnterpriseId(); const enterpriseId = User.getEnterpriseId();
...@@ -35,6 +37,7 @@ const App: React.FC = (props: any) => { ...@@ -35,6 +37,7 @@ const App: React.FC = (props: any) => {
useEffect(() => { useEffect(() => {
getStoreAndUserInfo(); getStoreAndUserInfo();
getVersion();
if (window.location.hash === "#/") { if (window.location.hash === "#/") {
window.RCHistory.replace({ window.RCHistory.replace({
pathname: '/home', pathname: '/home',
...@@ -58,6 +61,26 @@ const App: React.FC = (props: any) => { ...@@ -58,6 +61,26 @@ const App: React.FC = (props: any) => {
} }
}); });
} }
function getVersion() {
BaseService.getLesseeVersionMsg().then((res) => {
let version = res.result;
User.setVersion(version);
User.setExpirationTime(res.result.validEndTime)
let versioninfo:VersionInfo = {
dayTime: version.dayTime,
stateEnum: version.stateEnum,
userNum: version.userNum === -1 ? '不限人数' : version.userNum,
surplusUserNum: version.userNum === -1 ? '不限人数' : version.surplusUserNum,
surplusDayTime: version.surplusDayTime,
validEndTime: moment(version.validEndTime).format('YYYY-MM-DD'),
validStartTime: moment(version.validStartTime).format('YYYY-MM-DD'),
validEndTimeST: version.validEndTime,
validStartTimeST: version.validStartTime,
whetherReachUserNum: version.whetherReachUserNum,
};
setVersionInfo(versioninfo)
});
}
async function getStoreAndUserInfo() { async function getStoreAndUserInfo() {
await (enterpriseId ? getStoreInfo() : getStoreGroupAndStoreList()); await (enterpriseId ? getStoreInfo() : getStoreGroupAndStoreList());
...@@ -147,10 +170,13 @@ const App: React.FC = (props: any) => { ...@@ -147,10 +170,13 @@ const App: React.FC = (props: any) => {
</Layout> </Layout>
</Layout> */} </Layout> */}
<Header id="app" handleMenuType={handleMenuType} menuType={menuType} /> <Header id="app" handleMenuType={handleMenuType} menuType={menuType} />
<VersionContext.Provider value={versionInfo}>
<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} />
</VersionContext.Provider>
</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,97 @@ const roleMap = { ...@@ -14,6 +15,97 @@ 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") {
//只有登陆进来的时候提示一次
setShowType(3)
}
return
}
//即将过期
if (props.surplusDayTime === 30 || props.surplusDayTime <= 7) {
let daysflag = storage.get("expiration_tip"+User.getUserId()+"_days")
if (daysflag === null || daysflag !== moment().format("YYYYMMDD")) {
setShowType(2)
}
}
// 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() {
storage.set("expiration_tip_login",false)
storage.set("expiration_tip"+User.getUserId()+"_days",moment().format("YYYYMMDD"))
/*
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">{props.surplusDayTime === 0 ? "服务已到期":"服务到期提醒"}</div>
{
showType === 3 ? (
<div className="tip-text">当前企业购买的小麦企学院服务已于<span style={{color:"#FF4F4F"}}>{moment(props.endTime).format("YYYY-MM-DD HH:mm:ss")}</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 +116,16 @@ export default class CollegeManagePage extends React.Component { ...@@ -24,13 +116,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 +140,18 @@ export default class CollegeManagePage extends React.Component { ...@@ -45,6 +140,18 @@ export default class CollegeManagePage extends React.Component {
}); });
} }
getVersion() {
BaseService.getLesseeVersionMsg()
.then(res=> {
User.setVersion(res.result)
User.setExpirationTime(res.result.validEndTime)
this.setState({
surplusDayTime: res.result.stateEnum === "NO" ? 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 +239,7 @@ export default class CollegeManagePage extends React.Component { ...@@ -132,6 +239,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" />
......
...@@ -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
/* /*
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2019-09-10 18:26:03 * @Date: 2019-09-10 18:26:03
* @LastEditors: Please set LastEditors * @LastEditors: yuananting
* @LastEditTime: 2021-06-24 19:28:14 * @LastEditTime: 2021-07-06 14:37:49
* @Description: * @Description:
*/ */
import React, { useRef, useContext, useEffect, useState } from 'react'; import React, { useRef, useContext, useEffect, useState } from 'react';
...@@ -271,14 +271,14 @@ function Header(props) { ...@@ -271,14 +271,14 @@ function Header(props) {
onChange={(e) => { onChange={(e) => {
setStoreId(e.target.value); setStoreId(e.target.value);
User.setStoreId(e.target.value); User.setStoreId(e.target.value);
list.map((item)=>{ list.map((item) => {
if(item.id === e.target.value){ if (item.id === e.target.value) {
User.setStoreUserId(item.storeUserId); User.setStoreUserId(item.storeUserId);
} }
}) });
User.setUserId(User.getUserId()); User.setUserId(User.getUserId());
User.setToken(User.getToken()); User.setToken(User.getToken());
User.setEnterpriseId(User.getEnterpriseId()) User.setEnterpriseId(User.getEnterpriseId());
window.RCHistory.push('/home'); window.RCHistory.push('/home');
window.location.reload(); window.location.reload();
}} }}
...@@ -320,10 +320,10 @@ function Header(props) { ...@@ -320,10 +320,10 @@ function Header(props) {
</div> </div>
)} )}
<div className='right-box'> <div className='right-box'>
<div className='link-to-store'>
<div className='right-bg-img'> <div className='right-bg-img'>
<img src='https://image.xiaomaiketang.com/xm/WCwjyyXYda.png'></img> <img src='https://image.xiaomaiketang.com/xm/WCwjyyXYda.png'></img>
</div> </div>
<div className='link-to-store'>
<div className='link'> <div className='link'>
<span className='link-btn'> <span className='link-btn'>
<span className='icon iconfont tool-tip-right'>&#xe85d;</span> <span className='icon iconfont tool-tip-right'>&#xe85d;</span>
......
...@@ -196,7 +196,6 @@ ...@@ -196,7 +196,6 @@
margin-left: 62px; margin-left: 62px;
.college-container { .college-container {
position: relative; position: relative;
width: 360px;
height: 50px; height: 50px;
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -310,13 +309,9 @@ ...@@ -310,13 +309,9 @@
display: flex; display: flex;
align-items: center; align-items: center;
} }
.right-bg-img {
img {
width: 277px;
height: 60px;
}
}
.link-to-store { .link-to-store {
position: relative;
display: flex; display: flex;
height: 49px; height: 49px;
line-height: 49px; line-height: 49px;
...@@ -329,6 +324,14 @@ ...@@ -329,6 +324,14 @@
.iconfont { .iconfont {
color: #fff; color: #fff;
} }
.right-bg-img {
position: absolute;
right: 347px;
img {
width: 277px;
height: 60px;
}
}
.link { .link {
cursor: pointer; cursor: pointer;
position: relative; position: relative;
...@@ -346,7 +349,7 @@ ...@@ -346,7 +349,7 @@
width: 216px; width: 216px;
height: 260px; height: 260px;
top: 49px; top: 49px;
left: 0; left: -50px;
background-color: #fff; background-color: #fff;
flex-wrap: wrap; flex-wrap: wrap;
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
......
...@@ -7,6 +7,7 @@ import User from '@/common/js/user'; ...@@ -7,6 +7,7 @@ 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 axios from 'axios'; import axios from 'axios';
import storage from '@/common/js/storage';
import _ from 'underscore'; import _ from 'underscore';
import user from '@/common/js/user'; import user from '@/common/js/user';
const { TabPane } = Tabs; const { TabPane } = Tabs;
...@@ -31,26 +32,10 @@ function Login(props) { ...@@ -31,26 +32,10 @@ function Login(props) {
*/ */
useEffect(() => { useEffect(() => {
const enterpriseId = getParameterByName('enterpriseId');
const userId = getParameterByName('userId');
const from = getParameterByName('from');
const storeId = getParameterByName('storeId');
if (storeId) {
User.setCustomerStoreId(storeId);
}
if (from === 'customer' && enterpriseId && userId) {
if (!user.getToken() || enterpriseId !== user.getEnterpriseId() || userId !== User.getUserId()) {
getWXWorkLoginNoCheck(enterpriseId, userId);
} else {
window.RCHistory.push({
pathname: `/switch-route`,
});
}
} else {
User.removeUserId(); User.removeUserId();
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: 0px; @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;
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
margin: 15px 0 15px 8px; margin: 15px 0 15px 8px;
} }
} }
.menu-type-icon{ .menu-type-icon {
margin: 8px 14px 0px 4px; margin: 8px 14px 0px 4px;
cursor: pointer; cursor: pointer;
.icon{ .icon {
font-size:14px; font-size: 14px;
color:#5E606A; color: #5e606a;
} }
} }
} }
...@@ -37,7 +37,10 @@ ...@@ -37,7 +37,10 @@
.ant-menu { .ant-menu {
padding-left: 0 !important; padding-left: 0 !important;
color: #333; color: #333;
background: #FFF !important; background: #fff !important;
.ant-menu-title-content {
margin-left: 0 !important;
}
} }
.left { .left {
-webkit-user-select: none; -webkit-user-select: none;
...@@ -48,76 +51,202 @@ ...@@ -48,76 +51,202 @@
display: -webkit-flex; display: -webkit-flex;
flex-direction: column; flex-direction: column;
-webkit-flex-direction: column; -webkit-flex-direction: column;
height: calc(~'100% - 60px');
.nav { .nav {
-webkit-flex: 1; -webkit-flex: 1;
cursor: default; cursor: default;
font-size: 16px; font-size: 16px;
height: calc(~'100% - 72px'); height: calc(~'100% - 84px');
overflow: auto; overflow: auto;
&::-webkit-scrollbar { &::-webkit-scrollbar {
display: none; display: none;
} }
.icon { .icon {
margin-right: 20px margin-right: 20px;
}
.icon-img-box {
// display: flex;
display: inline-block;
width: 40px;
height: 40px;
.icon-img {
margin-left: 12px;
}
margin-right: 0 !important;
}
.icon-img-title {
margin-left: 0 !important;
} }
.icon-img{ .icon-img {
width:18px; width: 18px;
height:18px; height: 18px;
margin-right:6px;
} }
.listType { .listType {
width: 5px; width: 5px;
height: 5px; height: 5px;
background: #9A9DA7; background: #9a9da7;
border-radius: 50%; border-radius: 50%;
top: 18px; top: 18px;
left: 38px; left: 38px;
position: absolute; position: absolute;
} }
.ant-menu-item{ .ant-menu-item {
padding-left: 13px !important; padding-left: 0 !important;
padding-right: 0px; padding-right: 0px;
margin: 6px 8px; margin: 6px 8px;
width: calc(100% - 15px); width: calc(100% - 15px);
&:hover{ &:hover {
background: #F3F6FA; background: #f3f6fa;
border-radius: 2px; border-radius: 2px;
color:#333; color: #333;
} }
} }
.ant-menu-item-selected{ .ant-menu-item-selected {
background-color:@active-color; background-color: @active-color;
color:#FFF; color: #fff;
border-radius:2px; border-radius: 2px;
&:hover{ &:hover {
color:#FFF; color: #fff;
} }
} }
.ant-menu-submenu{ .ant-menu-submenu {
.ant-menu-submenu-title{ .ant-menu-submenu-title {
margin:6px 8px; margin: 6px 8px;
padding-left:13px !important; padding-left: 0 !important;
} }
.ant-menu-item{ .ant-menu-item {
padding-left:46px !important; padding-left: 46px !important;
} }
} }
.ant-menu-submenu-selected{ .ant-menu-submenu-selected {
color:@active-color; color: @active-color;
.ant-menu-item-selected{ .ant-menu-item-selected {
color:#FFF; color: #fff;
.listType { .listType {
background: @active-color; background: @active-color;
} }
} }
}
.ant-menu-submenu-arrow {
right: 22px;
color: #5e606a;
}
}
.version-info {
// position: absolute;
height: 84px;
bottom: 0;
width: 180px;
cursor: pointer;
// z-index: 10;
padding-top: 10px;
background-color: white;
.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;
color: #333333;
margin: 0 auto;
border-radius: 2px;
border: 1px solid #E8E8E8;
}
.renew {
display: inline-block;
width: 58px;
color: #2966FF;
margin-left: 8px;
}
}
.expiration-time {
height: 24px;
text-align: center;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
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;
}
} }
.ant-menu-submenu-arrow{ }
right:22px; .popover-show {
color:#5E606A; display: block;
} }
} }
...@@ -125,12 +254,12 @@ ...@@ -125,12 +254,12 @@
&.left-container-vertical { &.left-container-vertical {
width: 56px; width: 56px;
.menu-type-icon{ .menu-type-icon {
margin:4px 0 0px 22px; margin: 4px 0 0px 22px;
} }
.left { .left {
.ant-menu-submenu-arrow{ .ant-menu-submenu-arrow {
display:none !important; display: none !important;
} }
} }
} }
...@@ -142,17 +271,21 @@ ...@@ -142,17 +271,21 @@
// display:inline-block; // display:inline-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;
} }
.ant-menu.ant-menu-dark, .ant-menu-dark .ant-menu-sub, .ant-menu.ant-menu-dark .ant-menu-sub{ .ant-menu.ant-menu-dark,
.ant-menu-dark .ant-menu-sub,
.ant-menu.ant-menu-dark .ant-menu-sub {
background: @menu-bakg !important; background: @menu-bakg !important;
} }
.ant-menu-submenu-popup{ .ant-menu-submenu-popup {
left:67px !important; left: 67px !important;
} }
.ant-menu-submenu-popup>.ant-menu { .ant-menu-submenu-popup > .ant-menu {
background: @menu-bakg !important; background: @menu-bakg !important;
color: #333; color: #333;
width: 132px; width: 132px;
...@@ -160,18 +293,18 @@ ...@@ -160,18 +293,18 @@
li { li {
width: calc(100% - 16px); width: calc(100% - 16px);
padding-left: 20px; padding-left: 20px;
margin:12px 8px !important; margin: 12px 8px !important;
&:hover{ &:hover {
background: #F3F6FA; background: #f3f6fa;
border-radius: 2px; border-radius: 2px;
color:#333 !important; color: #333 !important;
} }
} }
.ant-menu-item-selected { .ant-menu-item-selected {
background: @active-color; background: @active-color;
color: #fff; color: #fff;
&:hover{ &:hover {
color: #fff !important; color: #fff !important;
} }
} }
......
...@@ -134,11 +134,12 @@ function ExaminationManager(props: any) { ...@@ -134,11 +134,12 @@ function ExaminationManager(props: any) {
}, },
{ {
title: '创建时间', title: '创建时间',
width: 150,
dataIndex: 'examCreateTime', dataIndex: 'examCreateTime',
align: fixStr.right, align: fixStr.right,
sorter: true, sorter: true,
sortOrder: field === 'examCreateTime' ? order : sortStatus.type, sortOrder: field === 'examCreateTime' ? order : sortStatus.type,
render: (text: any, record: any) => <span>{moment(text).format('YYYY-MM-DD HH:mm')}</span>, render: (text: any, record: any) => <span style={{ whiteSpace: 'nowrap' }}>{moment(text).format('YYYY-MM-DD HH:mm')}</span>,
}, },
{ {
title: '操作', title: '操作',
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
} }
.table-style { .table-style {
border: 1px solid #f0f0f0 !important; border: 1px solid #f0f0f0 !important;
margin-bottom: 70px;
max-height: calc(~'100vh - 465px');
overflow: scroll;
} }
.ant-tabs { .ant-tabs {
color: #666666; color: #666666;
......
.batchscore {
.content {
.item {
display: flex;
width: 612px;
height: 48px;
background: #F7F8F9;
font-size: 14px;
line-height: 48px;
font-weight: 400;
color: #333333;
padding-left: 16px;
.type {
width: 112px;
}
.score {
margin-left: 8px;
margin-right: 29px;
width: 258px;
}
}
.item:not(:last-of-type) {
margin-bottom: 8px;
}
}
}
\ No newline at end of file
import React, { useEffect, useState} from "react";
import { Modal, Button, InputNumber, message } from 'antd';
import "./BatchScore.less"
import _ from "underscore";
interface Rule {
typeKey: "GAP_FILLING"|"INDEFINITE_CHOICE"| "JUDGE"|"MULTI_CHOICE"|"SINGLE_CHOICE",
score: number,
portionScore: number,
totalQuestion: number,
}
interface BatchScoreProps {
visible:boolean,
rules: Rule[],
onOK: (rules:Rule[]) => void,
onCancel: () => void,
}
export default function BatchScore(props:BatchScoreProps) {
const [rules, setRules] = useState<Rule[]>(_.sortBy(props.rules,"typeKey"))
const [singleCount, setSingleCount] = useState<number[]>([0])
const [multiCount, setMultiCount] = useState<number[]>([0])
const [judgeCount, setJudgeCount] = useState<number[]>([0])
const [gapCount, setgapCount] = useState<number[]>([0])
const [indefiniteCount, setIndefiniteCount] = useState<number[]>([0])
useEffect(()=> {
_.map(props.rules,(item)=> {
//更新分数统计
switch(item.typeKey) {
case "SINGLE_CHOICE":
setSingleCount([item.totalQuestion,item.totalQuestion*item.score])
break;
case "MULTI_CHOICE":
setMultiCount([item.totalQuestion,item.totalQuestion*item.score])
break;
case "JUDGE":
setJudgeCount([item.totalQuestion,item.totalQuestion*item.score])
break;
case "GAP_FILLING":
setgapCount([item.totalQuestion,item.totalQuestion*item.score])
break;
case "INDEFINITE_CHOICE":
setIndefiniteCount([item.totalQuestion,item.totalQuestion*item.score])
break;
default:
break;
}
})
},[props.rules,rules])
if (!props.visible) {
return ("")
}
function onOk() {
for (let i = 0;i < rules.length;++i) {
if (rules[i].score <= 0 || rules[i].score > 100) {
message.error("分值设置错误")
return;
}
}
props.onOK(rules)
}
function onCancel() {
props.onCancel()
}
const inputNumberStyle = {width:"57px",margin:"0 8px"}
return (
<Modal
className="batchscore"
title="批量设置分数"
onCancel={onCancel}
onOk={onOk}
visible={props.visible}
maskClosable={false}
width={660}
>
<div className="content">
<div className="item">
<span className="type">【单选题】</span>
<span className="score">每题
<InputNumber
min={1}
max={100}
value={rules[4].score}
defaultValue={rules[4].score}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
let _rules = [...rules]
rules[4].score = v
setRules(_rules)
}}
/>
</span>
<span className="total"><span style={{color:"#2966FF"}}>{singleCount[0]}</span>题,合计<span style={{color:"#2966FF"}}>{singleCount[1]}</span></span>
</div>
<div className="item">
<span className="type">【多选题】</span>
<span className="score">每题
<InputNumber
min={1}
max={100}
defaultValue={rules[3].score}
value={rules[3].score}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
if (v <= rules[3].portionScore) {
return
}
let _r = [...rules]
_r[3].score = v
setRules(_r)
}}
/>
分,漏选得
<InputNumber
min={0}
max={rules[3].score <= 0 ? 0 : rules[3].score-1}
defaultValue={rules[3].portionScore}
value={rules[3].portionScore}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
let _r = [...rules]
_r[3].portionScore = v
setRules(_r)
}}
/>
</span>
<span className="total"><span style={{color:"#2966FF"}}>{multiCount[0]}</span>题,合计<span style={{color:"#2966FF"}}>{multiCount[1]}</span></span>
</div>
<div className="item">
<span className="type">【不定项选择题】</span>
<span className="score">每题
<InputNumber
min={1}
max={100}
defaultValue={rules[1].score}
value={rules[1].score}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
if (v <= rules[1].portionScore) {
return
}
let _r = [...rules]
_r[1].score = v
setRules(_r)
}}
/>
分,漏选得
<InputNumber
min={0}
max={rules[1].score <= 0 ? 0 : rules[1].score-1}
defaultValue={rules[1].portionScore}
value={rules[1].portionScore}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
let _r = [...rules]
_r[1].portionScore = v
setRules(_r)
}}
/></span>
<span className="total"><span style={{color:"#2966FF"}}>{indefiniteCount[0]}</span>题,合计<span style={{color:"#2966FF"}}>{indefiniteCount[1]}</span></span>
</div>
<div className="item">
<span className="type">【判断题】</span>
<span className="score">每题
<InputNumber
min={1}
max={100}
defaultValue={rules[2].score}
value={rules[2].score}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
let _r = [...rules]
_r[2].score = v
setRules(_r)
}}
/>
</span>
<span className="total"><span style={{color:"#2966FF"}}>{judgeCount[0]}</span>题,合计<span style={{color:"#2966FF"}}>{judgeCount[1]}</span></span>
</div>
<div className="item">
<span className="type">【填空题】</span>
<span className="score">每题
<InputNumber
min={1}
max={100}
defaultValue={rules[0].score}
value={rules[0].score}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
if (v <= rules[0].portionScore) {
return
}
let _r = [...rules]
_r[0].score = v
setRules(_r)
}}
/>
分,半对得<InputNumber
min={0}
max={rules[0].score <= 0 ? 0 : rules[0].score-1}
defaultValue={rules[0].portionScore}
value={rules[0].portionScore}
style={inputNumberStyle}
formatter={(value:number|undefined) => String(value)}
parser={(value:string|undefined) => parseInt(String(value))}
onChange={(v)=> {
v = Math.round(v)
let _r = [...rules]
_r[0].portionScore = v
setRules(_r)
}}
/>
</span>
<span className="total"><span style={{color:"#2966FF"}}>{gapCount[0]}</span>题,合计<span style={{color:"#2966FF"}}>{gapCount[1]}</span></span>
</div>
</div>
</Modal>
)
}
\ No newline at end of file
...@@ -2,33 +2,33 @@ ...@@ -2,33 +2,33 @@
.select-box { .select-box {
display: flex; display: flex;
align-items: center; align-items: center;
.select-container{ .select-container {
margin-right: 24px; margin-right: 24px;
.con{ .con {
background: #E9EFFF; background: #e9efff;
border-radius: 4px; border-radius: 4px;
padding: 3px 16px; padding: 3px 16px;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.tip{ .tip {
font-size:14px; font-size: 14px;
color:#2966FF; color: #2966ff;
margin-right:8px; margin-right: 8px;
} }
.text{ .text {
font-size:14px; font-size: 14px;
color:#666; color: #666;
margin-right:30px; margin-right: 30px;
} }
.clear{ .clear {
color:#5289FA; color: #5289fa;
font-size:14px; font-size: 14px;
} }
} }
} }
} }
.ant-radio-wrapper{ .ant-radio-wrapper {
left: -10px; left: -10px;
} }
.paper-list-filter { .paper-list-filter {
...@@ -75,8 +75,10 @@ ...@@ -75,8 +75,10 @@
.paper-list-content { .paper-list-content {
position: relative; position: relative;
margin-top: 12px; margin-top: 12px;
height: calc(100vh - 260px);
overflow: scroll;
.empty-list-tip { .empty-list-tip {
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
} }
.record-name { .record-name {
...@@ -88,7 +90,7 @@ ...@@ -88,7 +90,7 @@
display: flex; display: flex;
&__item { &__item {
color: #2966FF; color: #2966ff;
cursor: pointer; cursor: pointer;
&.split { &.split {
...@@ -98,7 +100,7 @@ ...@@ -98,7 +100,7 @@
} }
} }
} }
&.modal-select{ &.modal-select {
.search-condition { .search-condition {
width: calc(100% - 80px); width: calc(100% - 80px);
display: flex; display: flex;
......
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